mirror of
https://github.com/servo/servo.git
synced 2025-09-15 09:28:20 +01:00
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.
This commit is contained in:
parent
a89a76e1fc
commit
25c303ee62
6 changed files with 116 additions and 79 deletions
|
@ -20,8 +20,8 @@ use style::error_reporting::{ParseErrorReporter, ContextualParseError};
|
|||
use style::media_queries::MediaList;
|
||||
use style::properties::Importance;
|
||||
use style::properties::{CSSWideKeyword, DeclaredValueOwned, PropertyDeclaration, PropertyDeclarationBlock};
|
||||
use style::properties::longhands;
|
||||
use style::properties::longhands::animation_timing_function;
|
||||
use style::properties::DeclarationSource;
|
||||
use style::properties::longhands::{self, animation_timing_function};
|
||||
use style::shared_lock::SharedRwLock;
|
||||
use style::stylesheets::{Origin, Namespaces};
|
||||
use style::stylesheets::{Stylesheet, StylesheetContents, NamespaceRule, CssRule, CssRules, StyleRule, KeyframesRule};
|
||||
|
@ -35,7 +35,7 @@ pub fn block_from<I>(iterable: I) -> PropertyDeclarationBlock
|
|||
where I: IntoIterator<Item=(PropertyDeclaration, Importance)> {
|
||||
let mut block = PropertyDeclarationBlock::new();
|
||||
for (d, i) in iterable {
|
||||
block.push(d, i)
|
||||
block.push(d, i, DeclarationSource::CssOm);
|
||||
}
|
||||
block
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue