aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2017-05-17 22:21:00 +0200
committerSimon Sapin <simon.sapin@exyr.org>2017-05-18 17:13:14 +0200
commit9376abdd2c0ca75cdb351f5565964908e1e2446a (patch)
treea6c94cfafc6dce88de4ee92c002399c83efb3bcb /components/script/dom
parent83c7824fda2377ea2b52414de35d146dd4f6e64d (diff)
downloadservo-9376abdd2c0ca75cdb351f5565964908e1e2446a.tar.gz
servo-9376abdd2c0ca75cdb351f5565964908e1e2446a.zip
Shrink selectors::Component, add case-insensitive for other attr selectors
* https://bugzilla.mozilla.org/show_bug.cgi?id=1364148 * https://bugzilla.mozilla.org/show_bug.cgi?id=1364162
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/element.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index 9c6d84ba485..bdd2b49a751 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -86,10 +86,9 @@ use net_traits::request::CorsSettings;
use ref_filter_map::ref_filter_map;
use script_layout_interface::message::ReflowQueryType;
use script_thread::Runnable;
-use selectors::attr::AttrSelectorOperation;
+use selectors::attr::{AttrSelectorOperation, NamespaceConstraint};
use selectors::matching::{ElementSelectorFlags, MatchingContext, MatchingMode, matches_selector_list};
use selectors::matching::{HAS_EDGE_CHILD_SELECTOR, HAS_SLOW_SELECTOR, HAS_SLOW_SELECTOR_LATER_SIBLINGS};
-use selectors::parser::NamespaceConstraint;
use servo_atoms::Atom;
use std::ascii::AsciiExt;
use std::borrow::Cow;
@@ -2387,13 +2386,13 @@ impl<'a> ::selectors::Element for Root<Element> {
}
fn attr_matches(&self,
- ns: &NamespaceConstraint<SelectorImpl>,
+ ns: &NamespaceConstraint<&Namespace>,
local_name: &LocalName,
- operation: &AttrSelectorOperation<SelectorImpl>)
+ operation: &AttrSelectorOperation<&String>)
-> bool {
match *ns {
NamespaceConstraint::Specific(ref ns) => {
- self.get_attribute(&ns.url, local_name)
+ self.get_attribute(ns, local_name)
.map_or(false, |attr| attr.value().eval_selector(operation))
}
NamespaceConstraint::Any => {