bors-servo
255c9d00da
Auto merge of #17895 - bholley:clean_up_traversal, r=emilio
...
Clean up traversal modes
https://bugzilla.mozilla.org/show_bug.cgi?id=1384769
<!-- 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/17895 )
<!-- Reviewable:end -->
2017-07-27 18:29:29 -05:00
Bobby Holley
ce295f6daf
Pass TraversalFlags from C++ into Rust.
...
MozReview-Commit-ID: EVUzgnL5coN
2017-07-27 14:25:58 -07:00
Nazım Can Altınova
43cf493832
style: Implement parsing/serialization for @font-feature-values rule
2017-07-27 13:37:57 -07:00
Emilio Cobos Álvarez
4c391ca6ba
style: Avoid exponential blowup when processing invalidations of the same kind.
...
Bug: 1383981
Reviewed-by: heycam
MozReview-Commit-ID: HZ97UwvblkQ
2017-07-27 13:03:22 +02:00
Emilio Cobos Álvarez
af2b429557
style: Avoid looking at descendant hints to check whether the element needs a restyle.
2017-07-24 12:12:08 +02:00
Emilio Cobos Álvarez
2d57e001aa
style: Remove bogus assertion.
...
Bug: 1381682
Reviewed-by: heycam
MozReview-Commit-ID: E6bKyBdMUue
2017-07-19 09:44:00 +02:00
Hiroyuki Ikezoe
f91126ba86
Add has_current_styles_for_traversal().
...
In animation-only restyle, we just need to check the element
has animation restyle hints or has recascade self which is a result
of animation-only restyle for ancestors.
has_current_styles() in Servo_ResolveStyle() is intentionally left there,
it will be changed in a subsequent patch.
2017-07-18 19:13:50 +09:00
Emilio Cobos Álvarez
dee4aea264
style: Remove hashes from style rules and dependencies.
...
Dependencies are very numerous, and now we shouldn't be getting so many of them.
Style rules just don't need them, so it's a waste of memory.
2017-07-13 05:44:53 +02:00
Emilio Cobos Álvarez
9394ea9644
style: Remove unneeded bounds in SelectorMap and related code.
...
MozReview-Commit-ID: CWwdVCwWijn
2017-07-13 03:34:33 +02:00
Emilio Cobos Álvarez
1263075776
stylo: Fix StyleSheetInner/Stylesheet mapping
...
The key of this patch is the split between Stylesheet and StylesheetContents.
Gecko will use StylesheetContents, which maps to a ServoStyleSheetInner.
2017-07-02 15:49:40 +02:00
Emilio Cobos Álvarez
f8346e598e
style: Look at XBL stylists to collect dependencies too.
...
Bug: 1375969
Reviewed-By: heycam
MozReview-Commit-ID: 72wZj6o667V
2017-06-28 16:02:10 -07:00
Emilio Cobos Álvarez
215d14b37e
style: Factor out computation for a given InvalidationMap.
...
Bug: 1375969
Reviewed-By: heycam
MozReview-Commit-ID: 9qSr1LcsKK5
2017-06-28 16:02:09 -07:00
bors-servo
6b99318f55
Auto merge of #17443 - emilio:smallwat, r=SimonSapin
...
style: Don't use SmallVec::into_iter to move into another vector.
See bug 1374848 for why.
<!-- 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/17443 )
<!-- Reviewable:end -->
2017-06-22 00:14:38 -07:00
Emilio Cobos Álvarez
1572bd0948
style: Don't use SmallVec::into_iter to move into another vector.
...
See bug 1374848 for why.
2017-06-21 01:39:15 +02:00
Bobby Holley
1d242ad760
Store selectors in matching order, rather than parse order.
...
We add a slow in-place reverse during parsing to achieve this for now, which
gets fixed up later on.
MozReview-Commit-ID: 42QkOzSgV3T
2017-06-20 11:59:10 -07:00
Emilio Cobos Álvarez
84a8bbc8a6
style: Remove extra-optimistic optimization.
...
We can't really do this :(
2017-06-20 15:36:16 +02:00
Emilio Cobos Álvarez
ae5a6c9c69
style: Get restyle hints right in presence of XBL.
...
Bug: 1371130
Reviewed-By: heycam
MozReview-Commit-ID: 56lMyXEYT1I
2017-06-20 13:09:36 +02:00
Emilio Cobos Álvarez
459b22a985
style: Invalidate style using the DOM tree, and scan pseudo-elements and NAC separately.
...
Bug: 1371130
Reviewed-By: heycam
MozReview-Commit-ID: IU1TbVf4Zz9
2017-06-20 12:17:54 +02:00
Hiroyuki Ikezoe
9b166c5cda
Use mutate_data() instead of get_data().map() with borrow_mut().
2017-06-19 14:55:36 +09:00
Emilio Cobos Álvarez
ffc45e9aaa
style: Inline RestyleData.
...
Bug: 1368236
MozReview-Commit-ID: 49s3SO0PMHf
2017-06-16 03:36:18 +02:00
Emilio Cobos Álvarez
f9c268922d
style: Kill StoredRestyleHint.
...
Reviewed-By: bholley
Bug: 1368236
MozReview-Commit-ID: 43Cf0rJyhzO
2017-06-14 13:11:10 +02:00
Emilio Cobos Álvarez
6b0f4c0410
style: Move one-off checks out of the recursive invalidation function.
...
There isn't a need to pay the cost for them multiple times.
Bug: 1372068
MozReview-Commit-ID: 3K2mRcWTheJ
2017-06-13 13:27:09 +02:00
Emilio Cobos Álvarez
36bac58863
style: Don't try to go down the tree if there aren't invalidations.
...
This can happen when adding an empty stylesheet, for example.
Bug: 1372068
MozReview-Commit-ID: Jtm4eJBWjEA
2017-06-13 13:27:08 +02:00
Emilio Cobos Álvarez
4434509088
style: Add an AllLinksVisitedAndUnvisited for invalidation.
...
Otherwise, tests like the following fail, given we always match as unvisited,
and we'd never mark the link as needing invalidation.
<!doctype html>
<style>
a {
color: red !important;
}
.foo :visited {
color: green !important;
}
</style>
<div>
<a href="https://google.es ">visit me</a>
<button onclick="this.parentNode.className = 'foo'">Then click me</button>
</div>
Bug: 1368240
MozReview-Commit-ID: LDv6S28c4ju
2017-06-13 13:27:06 +02:00
Emilio Cobos Álvarez
fdf9093466
style: Add missing visitedness check while invalidating elements.
...
This is needed for the omta test to pass. This is pretty much the equivalent to
the old restyle hints code.
Bug: 1368240
MozReview-Commit-ID: BLUfw5Wxpxd
2017-06-13 13:27:02 +02:00
Emilio Cobos Álvarez
14bb57c08f
style: Properly handle invalidation of eager pseudo-elements.
...
Bug: 1368240
MozReview-Commit-ID: EkzDVhC3GPH
2017-06-13 13:26:46 +02:00
Emilio Cobos Álvarez
cb06375fe2
style: Implement a more fine-grained invalidation method.
...
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
2017-06-13 13:26:41 +02:00
Simon Sapin
5bccf98aa4
ID and class selectors are ASCII case-insensitive in quirks mode.
...
https://bugzilla.mozilla.org/show_bug.cgi?id=1363778
2017-06-12 23:33:53 +02:00
Cameron McCormack
c533097e20
style: Distinguish between the tree structures used for traversal and 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.
2017-06-09 18:37:35 +08:00
Bobby Holley
5ddabef636
Collapse Selector, SelectorInner, and ComplexSelector into a single Selector.
...
The refcounting is still internal. We'll fix that up next.
MozReview-Commit-ID: CTxZNaR3Qgj
2017-06-05 19:44:00 -07:00
Bobby Holley
713c9a63f6
Move the ancestor hashes out of Selector.
...
MozReview-Commit-ID: 5mipXnjgSED
2017-06-05 19:43:58 -07:00
Emilio Cobos Álvarez
5c66d3c77a
Cache effective media query results.
...
This patch also makes RulesIterator not iterate over rules for which we don't
process nested rules.
There's nothing depending on this behavior right now afaik, and this will make
us duplicate less code in following patches.
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1357461
MozReview-Commit-ID: CaMFQtAVnJF
2017-06-03 14:43:44 +02:00
Emilio Cobos Álvarez
b5232c940d
style: Move the stylesheet invalidation code to another submodule.
...
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1357461
MozReview-Commit-ID: DIzZXoHycZs
2017-06-03 14:18:56 +02:00
Emilio Cobos Álvarez
ac5872b48c
Bug 1357583: style: Make effective_rules return an iterator, stop refcounting the Device. r=heycam
...
This makes the code cleaner, and also documents the fact that effective_rules
recurses into imports.
No we're not adding the imported stylesheets twice, and we share code with the
invalidation analysis.
MozReview-Commit-ID: DOF2AViTlmR
2017-05-29 20:27:43 +02:00
Emilio Cobos Álvarez
ebd6f47be3
Bug 1357583: style: Recurse into @import rules when looking at the added rules. r=heycam
...
Apparently my whole conception of how the list of sheets in the styleset looked
like was flawled, and we only ever get one append_sheet for the topmost
stylesheet, instead of one for each.
MozReview-Commit-ID: FMClygMJkTc
2017-05-29 20:27:41 +02:00
Emilio Cobos Álvarez
f569274cca
Bug 1357583: Add a bunch of logging, shortcuts, and look also at the rightmost selector while invalidating sheets. r=heycam
...
MozReview-Commit-ID: 2XGcOCTa7MV
2017-05-29 20:27:38 +02:00
Emilio Cobos Álvarez
39e836966e
Bug 1357583: style: Hook up the invalidator in the StyleSheetSet. r=heycam
...
MozReview-Commit-ID: IhgKAovTJMX
2017-05-29 20:27:36 +02:00
Emilio Cobos Álvarez
658075af32
Bug 1357583: style: Add an initial version of the stylesheet invalidation code. r=heycam
...
MozReview-Commit-ID: 4jLxPYNF07U
2017-05-29 20:15:35 +02:00