Allow element prefix to be set

Implements step 6.1.10 of
https://dom.spec.whatwg.org/#concept-create-element
This commit is contained in:
Connor Brewster 2017-06-23 14:21:50 -06:00
parent dd9bb0550b
commit 37e8b89377
6 changed files with 26 additions and 17 deletions

View file

@ -152,7 +152,7 @@ impl HTMLCollection {
}
fn match_element(elem: &Element, qualified_name: &LocalName) -> bool {
match elem.prefix() {
match elem.prefix().as_ref() {
None => elem.local_name() == qualified_name,
Some(prefix) => qualified_name.starts_with(&**prefix) &&
qualified_name.find(":") == Some(prefix.len()) &&