aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/layout_wrapper.rs
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/layout_wrapper.rs
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/layout_wrapper.rs')
-rw-r--r--components/script/layout_wrapper.rs15
1 files changed, 7 insertions, 8 deletions
diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs
index 773937fce00..ac59921d2ea 100644
--- a/components/script/layout_wrapper.rs
+++ b/components/script/layout_wrapper.rs
@@ -50,9 +50,8 @@ use script_layout_interface::{HTMLCanvasData, LayoutNodeType, SVGSVGData, Truste
use script_layout_interface::{OpaqueStyleAndLayoutData, PartialPersistentLayoutData};
use script_layout_interface::wrapper_traits::{DangerousThreadSafeLayoutNode, GetLayoutData, LayoutNode};
use script_layout_interface::wrapper_traits::{PseudoElementType, ThreadSafeLayoutElement, ThreadSafeLayoutNode};
-use selectors::attr::AttrSelectorOperation;
+use selectors::attr::{AttrSelectorOperation, NamespaceConstraint};
use selectors::matching::{ElementSelectorFlags, MatchingContext};
-use selectors::parser::NamespaceConstraint;
use servo_atoms::Atom;
use servo_url::ServoUrl;
use std::fmt;
@@ -606,13 +605,13 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> {
}
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_attr_enum(&ns.url, local_name)
+ self.get_attr_enum(ns, local_name)
.map_or(false, |value| value.eval_selector(operation))
}
NamespaceConstraint::Any => {
@@ -1159,13 +1158,13 @@ impl<'le> ::selectors::Element for ServoThreadSafeLayoutElement<'le> {
}
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_attr_enum(&ns.url, local_name)
+ self.get_attr_enum(ns, local_name)
.map_or(false, |value| value.eval_selector(operation))
}
NamespaceConstraint::Any => {