mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -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(())
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue