mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Match :lang() using snapshots correctly.
This commit is contained in:
parent
c7e2500311
commit
f492c8fe6e
6 changed files with 134 additions and 11 deletions
|
@ -13,7 +13,7 @@ use dom::{OpaqueNode, TElement, TNode};
|
|||
use element_state::ElementState;
|
||||
use fnv::FnvHashMap;
|
||||
use restyle_hints::ElementSnapshot;
|
||||
use selector_parser::{ElementExt, PseudoElementCascadeType, SelectorParser};
|
||||
use selector_parser::{AttrValue as SelectorAttrValue, ElementExt, PseudoElementCascadeType, SelectorParser};
|
||||
use selectors::Element;
|
||||
use selectors::attr::{AttrSelectorOperation, NamespaceConstraint};
|
||||
use selectors::parser::SelectorMethods;
|
||||
|
@ -588,6 +588,12 @@ impl ElementSnapshot for ServoElementSnapshot {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn lang_attr(&self) -> Option<SelectorAttrValue> {
|
||||
self.get_attr(&ns!(xml), &local_name!("lang"))
|
||||
.or_else(|| self.get_attr(&ns!(), &local_name!("lang")))
|
||||
.map(|v| String::from(v as &str))
|
||||
}
|
||||
}
|
||||
|
||||
impl ServoElementSnapshot {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue