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:
Emilio Cobos Álvarez 2017-10-13 16:25:13 +02:00
parent a89a76e1fc
commit 25c303ee62
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
6 changed files with 116 additions and 79 deletions

View file

@ -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(())
})