mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Optimize lookupPrefix.
This commit is contained in:
parent
44a4b7886d
commit
749598f5a0
2 changed files with 12 additions and 7 deletions
|
@ -52,6 +52,7 @@ use devtools_traits::NodeInfo;
|
|||
use parse::html::parse_html_fragment;
|
||||
use script_traits::UntrustedNodeAddress;
|
||||
use util::geometry::Au;
|
||||
use util::namespace;
|
||||
use util::str::{DOMString, null_str_as_empty};
|
||||
use selectors::parser::{Selector, AttrSelector, NamespaceConstraint};
|
||||
use selectors::parser::parse_author_origin_selector_list_from_str;
|
||||
|
@ -2470,8 +2471,10 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
|
|||
|
||||
// https://dom.spec.whatwg.org/#dom-node-lookupprefix
|
||||
fn LookupPrefix(self, namespace: Option<DOMString>) -> Option<DOMString> {
|
||||
let namespace = namespace::from_domstring(namespace);
|
||||
|
||||
// Step 1.
|
||||
if null_str_as_empty(&namespace).is_empty() {
|
||||
if namespace == ns!("") {
|
||||
return None;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue