aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/layout_wrapper.rs
diff options
context:
space:
mode:
authorKeith Yeung <kungfukeith11@gmail.com>2017-02-07 20:24:21 -0800
committerKeith Yeung <kungfukeith11@gmail.com>2017-02-27 17:21:20 -0800
commit7456bcf02b7384dd7dabedf2ff2f9c47fc54af02 (patch)
tree43e10f45142fd2c74d71d23a1e48ab387e10e5e6 /components/script/layout_wrapper.rs
parent050d9d909749f5d549b4dfdf69690bd1b5486836 (diff)
downloadservo-7456bcf02b7384dd7dabedf2ff2f9c47fc54af02.tar.gz
servo-7456bcf02b7384dd7dabedf2ff2f9c47fc54af02.zip
Support lang pseudo class
Diffstat (limited to 'components/script/layout_wrapper.rs')
-rw-r--r--components/script/layout_wrapper.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs
index 000a844bc16..071868a683f 100644
--- a/components/script/layout_wrapper.rs
+++ b/components/script/layout_wrapper.rs
@@ -53,6 +53,7 @@ use selectors::matching::ElementSelectorFlags;
use selectors::parser::{AttrSelector, NamespaceConstraint};
use servo_atoms::Atom;
use servo_url::ServoUrl;
+use std::ascii::AsciiExt;
use std::fmt;
use std::fmt::Debug;
use std::marker::PhantomData;
@@ -618,6 +619,10 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> {
},
NonTSPseudoClass::Visited => false,
+ // 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) => lang.eq_ignore_ascii_case(&self.element.get_lang_for_layout()),
+
NonTSPseudoClass::ServoNonZeroBorder => unsafe {
match (*self.element.unsafe_get()).get_attr_for_layout(&ns!(), &local_name!("border")) {
None | Some(&AttrValue::UInt(_, 0)) => false,