mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Add GetPropertyPriority to CSSStyleDeclaration
Tweak getPropertyPriority to match recommendations Adding Tests for Style Priority Use else if Adding Content Test for GetPropertyPriority Revert "Adding Tests for Style Priority" This reverts commit 8666a37f833b06c3e43f27acd8a9678e94425e55.
This commit is contained in:
parent
49f2c6974d
commit
674fe910c1
4 changed files with 68 additions and 1 deletions
|
@ -469,6 +469,7 @@ pub trait ElementHelpers<'a> {
|
|||
fn remove_inline_style_property(self, property: DOMString);
|
||||
fn update_inline_style(self, property_decl: style::PropertyDeclaration, important: bool);
|
||||
fn get_inline_style_declaration(self, property: &Atom) -> Option<style::PropertyDeclaration>;
|
||||
fn get_important_inline_style_declaration(self, property: &Atom) -> Option<style::PropertyDeclaration>;
|
||||
}
|
||||
|
||||
impl<'a> ElementHelpers<'a> for JSRef<'a, Element> {
|
||||
|
@ -595,6 +596,16 @@ impl<'a> ElementHelpers<'a> for JSRef<'a, Element> {
|
|||
.map(|decl| decl.clone())
|
||||
})
|
||||
}
|
||||
|
||||
fn get_important_inline_style_declaration(self, property: &Atom) -> Option<style::PropertyDeclaration> {
|
||||
let inline_declarations = self.style_attribute.borrow();
|
||||
inline_declarations.as_ref().and_then(|declarations| {
|
||||
declarations.important
|
||||
.iter()
|
||||
.find(|decl| decl.matches(property.as_slice()))
|
||||
.map(|decl| decl.clone())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
pub trait AttributeHandlers {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue