aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2017-05-18 10:32:26 +0200
committerSimon Sapin <simon.sapin@exyr.org>2017-05-18 17:13:18 +0200
commit7149a6a29de6d1c351eedf1404369aa5f9efbd09 (patch)
tree5161224c61d7d107be3c072622bd6e8dbb282691 /components/script
parent853b688d0b1e5caff55685ef0cb029b3ebe151ed (diff)
downloadservo-7149a6a29de6d1c351eedf1404369aa5f9efbd09.tar.gz
servo-7149a6a29de6d1c351eedf1404369aa5f9efbd09.zip
ol[type=…] and li[type=…] preshints need to be case-sensitive
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/element.rs5
-rw-r--r--components/script/layout_wrapper.rs5
2 files changed, 9 insertions, 1 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs
index 6f423f47162..55175fd45c6 100644
--- a/components/script/dom/element.rs
+++ b/components/script/dom/element.rs
@@ -2451,6 +2451,11 @@ impl<'a> ::selectors::Element for Root<Element> {
}
},
+ NonTSPseudoClass::ServoCaseSensitiveTypeAttr(ref expected_value) => {
+ self.get_attribute(&ns!(), &local_name!("type"))
+ .map_or(false, |attr| attr.value().eq(expected_value))
+ }
+
// FIXME(#15746): This is wrong, we need to instead use extended filtering as per RFC4647
// https://tools.ietf.org/html/rfc4647#section-3.3.2
NonTSPseudoClass::Lang(ref lang) => extended_filtering(&*self.get_lang(), &*lang),
diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs
index 0e9dffd28ab..62e5158f321 100644
--- a/components/script/layout_wrapper.rs
+++ b/components/script/layout_wrapper.rs
@@ -706,7 +706,10 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> {
_ => true,
}
},
-
+ NonTSPseudoClass::ServoCaseSensitiveTypeAttr(ref expected_value) => {
+ self.get_attr_enum(&ns!(), &local_name!("type"))
+ .map_or(false, |attr| attr == expected_value)
+ }
NonTSPseudoClass::ReadOnly =>
!self.element.get_state_for_layout().contains(pseudo_class.state_flag()),