mirror of
https://github.com/servo/servo.git
synced 2025-08-15 18:35:33 +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
|
@ -8,8 +8,8 @@ use cssparser::{AtRuleParser, Parser, QualifiedRuleParser, RuleListParser, Parse
|
|||
use cssparser::{DeclarationListParser, DeclarationParser, parse_one_rule, SourceLocation};
|
||||
use error_reporting::{NullReporter, ContextualParseError, ParseErrorReporter};
|
||||
use parser::{ParserContext, ParserErrorContext};
|
||||
use properties::{Importance, PropertyDeclaration, PropertyDeclarationBlock, PropertyId, PropertyParserContext};
|
||||
use properties::{PropertyDeclarationId, LonghandId, SourcePropertyDeclaration};
|
||||
use properties::{DeclarationSource, Importance, PropertyDeclaration, PropertyDeclarationBlock, PropertyId};
|
||||
use properties::{PropertyDeclarationId, PropertyParserContext, LonghandId, SourcePropertyDeclaration};
|
||||
use properties::LonghandIdSet;
|
||||
use properties::longhands::transition_timing_function::single_value::SpecifiedValue as SpecifiedTimingFunction;
|
||||
use servo_arc::Arc;
|
||||
|
@ -549,7 +549,11 @@ impl<'a, 'i, R: ParseErrorReporter> QualifiedRuleParser<'i> for KeyframeListPars
|
|||
while let Some(declaration) = iter.next() {
|
||||
match declaration {
|
||||
Ok(()) => {
|
||||
block.extend(iter.parser.declarations.drain(), Importance::Normal);
|
||||
block.extend(
|
||||
iter.parser.declarations.drain(),
|
||||
Importance::Normal,
|
||||
DeclarationSource::Parsing,
|
||||
);
|
||||
}
|
||||
Err((error, slice)) => {
|
||||
iter.parser.declarations.clear();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue