This is necessary in order to make the computation of eager pseudos depend on
the primary ComputedValues, which we want to do for ::first-letter/::first-line.
This also fixes a bug where the behavior of EagerPseudoStyles::is_empty was reversed
in both the implementation and the callsite.
MozReview-Commit-ID: EXBxclyHWXu
This simplifies things by avoiding the computation of MatchResults when we
don't need them.
We continue to compute rule_nodes_changed, even though we don't use it
for the moment, since we will need it soon for various incremental restyle
optimizations.
MozReview-Commit-ID: 4qsUYaD5Bs2
The UpdateAnimationsTasks is a bitflags and each bit is generated from
Gecko's UpdateAnimationsTasks (enum class) values for matching values
between C++ and Rust. For this reason, the bitflags is annotated as
(feature = "gecko"), as a result update_animations() which uses this bitflags
also became gecko-only function.
We need a scope to restore rule_node_changed that were borrowed by the closure.
This closure function will be used for animation-only restyles as well.
A new function, cascade_with_rules, takes StrongRuleNode
and computes cascading result values with the StrongRuleNode.
This new function will be used for getting after-change-style
for CSS Transitions.
Now that cascade() gets a Device, we can use the default computed values from
there to avoid propagating that state all over the place.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
At least until we support scrollbars properly, this size is going to be the
correct one. I've left a TODO to grab the proper one once we support it.
This allows to trivially test viewport units for now.
MozReview-Commit-ID: JdaZ6WlZ2C6
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
We create the SequentialTask only if:
* We have no old computed values and we have animation name style in the new
computed values.
* Any animation properties is changed.
* display property is changed from 'none' and we have animation name style.
* display property is changed to 'none'.
In a subsequent patch we skip the SequentialTask if we have no running
animations and the display propery is changed to 'none'.
Otherwise they trigger their animations and transitions.
We will introduce gecko's own process in bug 1341985 (animations) and
bug 1341372 (transitions).
We need to do something here to avoid a double-borrow when passing a mutable
StyleContext to match_element. After some discussion on IRC, we decided that
building the bloom filter for this case is probably worthwhile.
We try to get the servo animation rule and declarations during elements
matching, and put the rule to the right priority.
Note: According to CSS Cascade Level spec, Animations is between
Important author declarations and Normal override declarations.
They were formerly different because we used the element check to cull the
traversal.
Now this is no longer true, so we can just unify them.
Also, update a no-longer up-to-date comment on that.
MozReview-Commit-ID: FH5GH7NfI8G
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>