mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Support lang pseudo class
This commit is contained in:
parent
050d9d9097
commit
7456bcf02b
63 changed files with 250 additions and 238 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue