mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Set Adjacent::Position case-insensitive
This commit is contained in:
parent
19f9b5bef9
commit
40feb524d9
2 changed files with 6 additions and 5 deletions
|
@ -129,12 +129,12 @@ pub enum AdjacentPosition {
|
|||
|
||||
impl AdjacentPosition {
|
||||
pub fn parse(position: &str) -> Fallible<AdjacentPosition> {
|
||||
match position {
|
||||
match_ignore_ascii_case! { &*position,
|
||||
"beforebegin" => Ok(AdjacentPosition::BeforeBegin),
|
||||
"afterbegin" => Ok(AdjacentPosition::AfterEnd),
|
||||
"beforeend" => Ok(AdjacentPosition::AfterBegin),
|
||||
"afterend" => Ok(AdjacentPosition::BeforeEnd),
|
||||
_ => Err(Error::Syntax),
|
||||
"afterbegin" => Ok(AdjacentPosition::AfterBegin),
|
||||
"beforeend" => Ok(AdjacentPosition::BeforeEnd),
|
||||
"afterend" => Ok(AdjacentPosition::AfterEnd),
|
||||
_ => Err(Error::Syntax)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ extern crate canvas;
|
|||
extern crate canvas_traits;
|
||||
extern crate caseless;
|
||||
extern crate core;
|
||||
#[macro_use]
|
||||
extern crate cssparser;
|
||||
extern crate devtools_traits;
|
||||
extern crate encoding;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue