| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
In the next patch, we'll move logic to identify the children for traversal into
preprocess_children (which will be renamed), and the set_dirty_descendants logic
will move along with it. So left as-is, the code here will clobber the flags.
MozReview-Commit-ID: 7ZskKWD4QC3
|
| |
|
|
|
|
|
|
|
|
| |
This allows us to have ensure_data() and clear_data() functions on the TElement
trait, instead of hacking around it adding methods in random traits.
This also allows us to do some further cleanup, which I'd rather do in a
followup.
|
| |
|
|
|
|
| |
We can take it straight from the validation target.
|
|
|
|
| |
MozReview-Commit-ID: 42MyHx3QHuu
|
|
|
|
|
|
| |
Yay
MozReview-Commit-ID: JiWTEz63AlE
|
|
|
|
| |
MozReview-Commit-ID: 4BzjbLbFebF
|
|
|
|
|
|
| |
Removing the ugly.
MozReview-Commit-ID: BvahbMKS7QU
|
|
|
|
| |
MozReview-Commit-ID: 5WTLuk323Ac
|
|
|
|
|
| |
Mostly reflowing comments that have become too long or two short with
refactorings, and using consistent indentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this change, the `ComputedStyle` struct that is part of permanent style
data per element holds 2 `StrongRuleNode`s (unvisited and visited) and 2
`Arc<ComputedValues>` (unvisited and visited).
Both rule nodes and the visited values don't actually need to be here. This
patch moves these 3 to new temporary storage in `CascadeInputs` on
`CurrentElementInfo` during the match and cascade process. Rule nodes are
pushed down inside the `ComputedValues` for later access after the cascade.
(Visited values were already available there.)
The permanent style data per element now has just the `Arc<ComputedValues>` for
itself and eager pseudo-elements (plus the `RestyleHint`).
MozReview-Commit-ID: 3wq52ERMpdi
|
|
|
|
|
|
|
|
| |
normal traversal.
Before this patch, we were setting the dirty descendants bit in animation-only
restyles and it triggered unnecessary traversal for elements that does not need
the traversal (i.e no need selector matching).
|
|
|
|
|
|
|
|
| |
preprocess_children.
If we check it and skip the child after ensure_element_data() call,
the child will have an empty element data, so we will succeed
element_data.is_some() check unexpectedly.
|
|
|
|
| |
Animation-only restyle only works with elements that have already been styled.
|
|
|
|
|
| |
Bug: 1368236
MozReview-Commit-ID: 49s3SO0PMHf
|
|
|
|
|
|
| |
Reviewed-By: bholley
Bug: 1368236
MozReview-Commit-ID: 8KK0YfhiS2
|
|
|
|
|
|
| |
Reviewed-By: bholley
Bug: 1368236
MozReview-Commit-ID: 43Cf0rJyhzO
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This commit also removes the old restyle_hints module and splits it into
multiple modules under components/style/invalidation/element/.
The basic approach is to walk down the tree using compound selectors as needed,
in order to do as little selector-matching as possible.
Bug: 1368240
MozReview-Commit-ID: 2YO8fKFygZI
|
|
|
|
|
|
|
|
|
|
|
|
| |
selector matching.
This patch renames TNode::parent_element to traversal_parent, since it returns
the parent from the perspective of traversal (which in Gecko uses the
flattened tree). It also renames TNode::children to traversal_children
for the saem reason.
We keep parent_element and children functions on TNode to use for selector
matching, which must be done on the real DOM tree structure.
|
| |
|
| |
|
|
|
|
| |
changes.
|
|\
| |
| |
| |
| |
| |
| |
| | |
style: Allow sharing styles across elements with presentational hints.
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17063)
<!-- Reviewable:end -->
|
| |
| |
| |
| |
| | |
This patch also removes all notion of style sharing from matching.rs, which is
nice.
|
|/
|
|
|
| |
This also moves the result of deciding whether to recascade from the
RestyleData into the RestyleHint.
|
| |
|
|
|
|
|
|
|
|
|
| |
We only use whether the return value is IMPORTANT_RULES_CHANGED or not, so we
can just return true if an important rules was changed in the function.
Also, we can just return false in case of animation rules changes sine for
animation we can ensure there is no importan rules.
Because of these changes, replace_rule_node does not borrow |result| so that
we can drop a scope there.
|
| |
|
|
|
|
|
|
| |
triggered by CSS rule changes.
And propagate the new flag to servo if mRestyleForCSSRuleChanges is set.
|
|
|
|
|
| |
This is just a code health change. I want to move it away to keep matching.rs as
simple as possible.
|
| |
|
|
|
|
|
| |
Later PRs will add additional data to it that is not so easy to
represent using bitflags.
|
|
|
|
| |
style changes to children.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we add/remove important rules, we may need to update a list of all important
rules (in Gecko) which overrides animation properties. Therefore, we need to
set a flag if we update the primary rules which includes important ones.
If we have animations on this element, we update its effect properties, and
also send a task to update cascade results.
Calling get_properties_overriding_animations() might cases some impact
on performance because we need to walk the rule tree, so if possible, we could
just store this set into TNode to avoid finding the properties for both old
and new rules each time. This could be a future work if necessary.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've chosen this approach mainly because there's no other good way to guarantee
the model is correct than holding the snapshots alive until a style refresh.
What I tried before this (storing them in a sort of "immutable element data") is
a pain, since we call into style from the frame constructor and other content
notifications, which makes keeping track of which snapshots should be cleared an
which shouldn't an insane task.
Ideally we'd have a single entry-point for style, but that's not the case right
now, and changing that requires pretty non-trivial changes to the frame
constructor.
MozReview-Commit-ID: FF1KWZv2iBM
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
|
|
|
|
|
| |
MozReview-Commit-ID: 4BXx9JpGZKX
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
|
|
|
|
|
|
|
|
|
| |
When an element has a display:none ancestor we don't traverse it during
restyle. However, at the end of restyling we expect the tree to be free
of dirty bits. We currently take special care to clear the regular
(non-animation) dirty bit on nodes in display:none subtrees in order to
preserve this invariant. This patch applies the same handling to the
animation-only dirty descendants bit.
|
|
|
|
|
| |
MozReview-Commit-ID: FEvY3ZlJEnc
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
|
|
|
|
| |
animation-only restyle.
|
| |
|
|
|
|
| |
That's because the function does not invoke cascade() at all.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make the sequential traversal breadth-first
Reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1354806
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16312)
<!-- Reviewable:end -->
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
While we're at it, we also eliminate the 'unknown' dom depth for the
bloom filter. Computing depth has negligible cost relative to the
amount of work we do setting up the bloom filter at a given depth.
Doing it once per traversal should be totally fine.
I originally separated the elimination of unknown dom depth from the
traversal changes, but I got bloom filter crashes on the intermediate
patch, presumably because I didn't properly fix the sequential traversal
for this case. Given that the final state is green, I just decided to
squash and move on.
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
| |
If we append a child to a display:none element, and we use StyleNewChildren on
that parent, we should skip restyling the children.
|