mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Make Element::prefix return an Option<&DOMString>
This commit is contained in:
parent
2fcb908daa
commit
a377caa7e9
4 changed files with 10 additions and 10 deletions
|
@ -151,11 +151,11 @@ impl HTMLCollection {
|
|||
}
|
||||
|
||||
fn match_element(elem: &Element, qualified_name: &LocalName) -> bool {
|
||||
match *elem.prefix() {
|
||||
match elem.prefix() {
|
||||
None => elem.local_name() == qualified_name,
|
||||
Some(ref prefix) => qualified_name.starts_with(prefix as &str) &&
|
||||
qualified_name.find(":") == Some((prefix as &str).len()) &&
|
||||
qualified_name.ends_with(elem.local_name() as &str),
|
||||
Some(prefix) => qualified_name.starts_with(&**prefix) &&
|
||||
qualified_name.find(":") == Some(prefix.len()) &&
|
||||
qualified_name.ends_with(&**elem.local_name()),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue