diff options
author | Cameron McCormack <cam@mcc.id.au> | 2017-06-06 12:44:17 +0800 |
---|---|---|
committer | Cameron McCormack <cam@mcc.id.au> | 2017-06-08 09:37:09 +0800 |
commit | 524794c09ac3ab4aa4fa80c6b134182bab494bd6 (patch) | |
tree | cbe40a6c78f97f22797159ceb83f26b161228944 /components/script/layout_wrapper.rs | |
parent | 07b0770d21d2b374f9a30c98cdde5ae5531aaecb (diff) | |
download | servo-524794c09ac3ab4aa4fa80c6b134182bab494bd6.tar.gz servo-524794c09ac3ab4aa4fa80c6b134182bab494bd6.zip |
script: Move extended_filtering to the style crate.
We'll need to call it from the style crate in later patches, when matching
:lang() against element snapshots.
Diffstat (limited to 'components/script/layout_wrapper.rs')
-rw-r--r-- | components/script/layout_wrapper.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs index e915a2d07b1..9ce38c6a187 100644 --- a/components/script/layout_wrapper.rs +++ b/components/script/layout_wrapper.rs @@ -34,7 +34,6 @@ use atomic_refcell::{AtomicRef, AtomicRefCell}; use dom::bindings::inheritance::{CharacterDataTypeId, ElementTypeId}; use dom::bindings::inheritance::{HTMLElementTypeId, NodeTypeId}; use dom::bindings::js::LayoutJS; -use dom::bindings::str::extended_filtering; use dom::characterdata::LayoutCharacterDataHelpers; use dom::document::{Document, LayoutDocumentHelpers, PendingRestyle}; use dom::element::{Element, LayoutElementHelpers, RawLayoutElementHelpers}; @@ -70,7 +69,7 @@ use style::dom::{PresentationalHintsSynthesizer, TElement, TNode, UnsafeNode}; use style::element_state::*; use style::font_metrics::ServoMetricsProvider; use style::properties::{ComputedValues, PropertyDeclarationBlock}; -use style::selector_parser::{NonTSPseudoClass, PseudoElement, SelectorImpl}; +use style::selector_parser::{NonTSPseudoClass, PseudoElement, SelectorImpl, extended_filtering}; use style::shared_lock::{SharedRwLock as StyleSharedRwLock, Locked as StyleLocked}; use style::sink::Push; use style::str::is_whitespace; @@ -691,8 +690,10 @@ impl<'le> ::selectors::Element for ServoLayoutElement<'le> { NonTSPseudoClass::AnyLink => self.is_link(), 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 + // FIXME(heycam): This is wrong, since extended_filtering accepts + // a string containing commas (separating each language tag in + // a list) but the pseudo-class instead should be parsing and + // storing separate <ident> or <string>s for each language tag. NonTSPseudoClass::Lang(ref lang) => extended_filtering(&*self.element.get_lang_for_layout(), &*lang), NonTSPseudoClass::ServoNonZeroBorder => unsafe { |