diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-10-13 16:25:13 +0200 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2017-10-14 11:30:59 +0200 |
commit | 25c303ee627774ee8cb0b0acfe06f6802daf17c2 (patch) | |
tree | cfb79117fce4b672e91ae42a222ddc1d8d0b1a40 /components/script/dom/cssstyledeclaration.rs | |
parent | a89a76e1fc138bd1a60ee974abfc47a4b0f69c09 (diff) | |
download | servo-25c303ee627774ee8cb0b0acfe06f6802daf17c2.tar.gz servo-25c303ee627774ee8cb0b0acfe06f6802daf17c2.zip |
style: Be clearer about whether a declaration comes from parsing or not.
This introduces DeclarationSource, to see if a declaration has been parsed or
set from CSSOM in a declaration block.
The Servo_DeclarationBlock_SetFoo and similar callers are changed to
DeclarationSource::CssOm because their semantics are more CSSOM-y, but it
shouldn't matter since they should all be checked before hand with
Servo_DeclarationBlock_PropertyIsSet.
Diffstat (limited to 'components/script/dom/cssstyledeclaration.rs')
-rw-r--r-- | components/script/dom/cssstyledeclaration.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/components/script/dom/cssstyledeclaration.rs b/components/script/dom/cssstyledeclaration.rs index f2cb3b4e5ce..71220f6e87b 100644 --- a/components/script/dom/cssstyledeclaration.rs +++ b/components/script/dom/cssstyledeclaration.rs @@ -18,7 +18,7 @@ use servo_arc::Arc; use servo_url::ServoUrl; use std::ascii::AsciiExt; use style::attr::AttrValue; -use style::properties::{Importance, PropertyDeclarationBlock, PropertyId, LonghandId, ShorthandId}; +use style::properties::{DeclarationSource, Importance, PropertyDeclarationBlock, PropertyId, LonghandId, ShorthandId}; use style::properties::{parse_one_declaration_into, parse_style_attribute, SourcePropertyDeclaration}; use style::selector_parser::PseudoElement; use style::shared_lock::Locked; @@ -274,7 +274,11 @@ impl CSSStyleDeclaration { // Step 7 // Step 8 - *changed = pdb.extend_reset(declarations.drain(), importance); + *changed = pdb.extend( + declarations.drain(), + importance, + DeclarationSource::CssOm, + ); Ok(()) }) |