Boris Zbarsky
7161fff1b8
Add a Stylo API for reparenting a given style.
...
Servo side of part 4 of the fix for Gecko bug 1324619. r=emilio
2017-07-28 22:54:06 -04: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
b15fa2cd79
style: fix alignment in call to get_all_matching_rules.
2017-07-27 01:35:57 +02:00
Boris Zbarsky
048044f98b
Make it possible to construct StyleBuilder with two different inherited styles.
...
Part 3 of Gecko bug 1382806. r=emilio
2017-07-26 15:25:34 -04:00
Emilio Cobos Álvarez
f879ebcc99
selectors: Don't track class and id ancestor hashes in quirks mode.
...
It's incorrect to track classes and id selectors in a quirks-mode document,
since they should match case-insensitively.
Bug: 1382812
Reviewed-by: bholley
MozReview-Commit-ID: 4uvrfYsWb1v
2017-07-20 22:42:35 +02:00
Michael Partheil
b07ebbae6b
Replace all uses of the style::stylearc alias with servo_arc.
...
The alias is left there temporarilly and will be removed completely in a later commit where
also components/style/gecko/generated/structs_{debug|release}.rs are re-generated (they still
use the old alias).
2017-07-19 09:29:05 +02:00
Emilio Cobos Álvarez
655c842d2e
style: Cleanup most of the Inner mess.
...
MozReview-Commit-ID: Ieg2GJT0yUl
2017-07-18 17:34:57 +02:00
Manish Goregaokar
89930e7565
stylo: Switch Gecko over to ServoStyleContext
2017-07-17 18:03:23 -07:00
Manish Goregaokar
74519cc1a7
stylo: Make Servo Arc types use ptr to T instead of ptr to ArcInner<T>
2017-07-17 18:03:09 -07:00
Manish Goregaokar
808b1f509b
stylo: Use ComputedValuesInner instead of ComputedValues when we don't need it
2017-07-17 18:02:25 -07: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
6d6c80e79b
style: Remove StyleRelations.
...
They're unused now. We can add them back if needed.
MozReview-Commit-ID: 92Y2Na0ZbVn
2017-07-12 09:26:55 +02:00
Emilio Cobos Álvarez
c6d5dbbb01
style: Rewrite restyling to split between resolving styles and handling changes.
...
MozReview-Commit-ID: 4BzjbLbFebF
2017-07-12 09:26:36 +02:00
Emilio Cobos Álvarez
fcf85e4658
style: Make RuleTree::root return a reference instead of a strong pointer.
...
There's no reason it wasn't done before.
MozReview-Commit-ID: G0lMLWmfHbS
2017-07-12 08:39:41 +02:00
Josh Matthews
a08371e8eb
stylo: Create error reporters linked to documents (bug 1352669)
2017-07-10 20:46:08 -04:00
Gecko Backout
32269fa7cc
Backed out changeset fec394734f83 (bug 17624) for build bustage a=backout CLOSED TREE
...
Backs out https://github.com/servo/servo/pull/17624
2017-07-06 21:58:15 +00:00
Josh Matthews
dc2a500f4b
stylo: Create error reporters linked to documents (bug 1352669)
2017-07-06 14:05:52 -04: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
Bobby Holley
6ade9c11ec
Allow StrongRuleNode drops after RuleTree destruction.
2017-06-30 23:35:40 -07:00
Boris Zbarsky
52d1b59515
Implement :visited handling for lazy pseudo-elements in stylo.
...
Part 2 of the fix for Gecko bug 1364242: https://bugzilla.mozilla.org/show_bug.cgi?id=1364242
2017-06-29 16:22:13 -07:00
Boris Zbarsky
351c7f7859
Change lazily_compute_pseudo_element_style to take an &Arc for the parent style.
...
This makes it easier to do later changes that want to pass an Arc here.
Part 1 of the fix for Gecko bug 1364242: https://bugzilla.mozilla.org/show_bug.cgi?id=1364242
2017-06-29 16:20:47 -07:00
Boris Zbarsky
746f245f32
Fix style computation for first-letter pseudo-elements with inline ancestors.
...
We should inherit from the inline, not its parent block.
Gecko bug 1324618 part 10 servo bits: https://bugzilla.mozilla.org/show_bug.cgi?id=1324618
2017-06-26 23:29:18 -07:00
bors-servo
6342a4b455
Auto merge of #17471 - aethanyc:fix-pseudo-element-matching-xbl, r=emilio
...
stylo: Fix pseudo element matching for rules in XBL stylesheets
This change was reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1372876
<!-- 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/17471 )
<!-- Reviewable:end -->
2017-06-22 19:53:37 -07:00
J. Ryan Stinnett
2b5c56e6a8
Move match and cascade temporaries to CurrentElementInfo
...
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
2017-06-22 15:47:32 -05:00
Ting-Yu Lin
1795af5e57
stylo: Fix pseudo element matching for rules in XBL stylesheets (bug 1372876)
...
MozReview-Commit-ID: JeliK45G8MT
2017-06-22 22:37:51 +08:00
Bobby Holley
db8f59407f
Hoist sink into selectors.
...
It probably makes more sense (eventually) to put it in SmallVec.
MozReview-Commit-ID: AIBKCLiMNN2
2017-06-20 11:59:10 -07:00
Cameron McCormack
accd2752ce
style: Make checks for attribute/state dependencies take stylist dirty state into account.
...
This is a follow-up Servo-side change for https://bugzilla.mozilla.org/show_bug.cgi?id=1352306
which caused some test failures on landing.
2017-06-19 09:33:02 +08:00
bors-servo
c5433277b4
Auto merge of #17384 - emilio:stylist-attr-dep, r=nox
...
style: Clean up some stylist code and make it slightly more efficient.
<!-- 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/17384 )
<!-- Reviewable:end -->
2017-06-17 06:20:45 -07:00
Emilio Cobos Álvarez
61a4ba3e79
style: Clean up some stylist code and make it slightly more efficient.
2017-06-17 15:18:05 +02:00
Bobby Holley
ea81f36b1d
Assert against permanently-leaked rule nodes.
...
MozReview-Commit-ID: CK5iEWWHFSr
2017-06-16 14:12:09 -07:00
Ting-Yu Lin
e80cb09be3
stylo: Fix pseudo element matching for XBL stylesheets (Bug 1371577)
...
MozReview-Commit-ID: GzWbztqW0V1
2017-06-14 17:58:15 +08:00
bors-servo
07f6e11485
Auto merge of #17292 - emilio:better-style-invalidation, r=heycam
...
style: Implement a more fine-grained invalidation method.
<!-- 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/17292 )
<!-- Reviewable:end -->
2017-06-13 04:56:09 -07: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
Cameron McCormack
e314dbb4ac
style: Don't skip style attributes on NAC.
2017-06-13 17:44:33 +08: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
bors-servo
75d6796cbd
Auto merge of #17281 - bholley:shrink_rule_again, r=emilio
...
Pack bloom filter hashes better and save a word on Rule
https://bugzilla.mozilla.org/show_bug.cgi?id=1371949
<!-- 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/17281 )
<!-- Reviewable:end -->
2017-06-12 12:41:39 -07:00
Bobby Holley
a98fff1af8
Hoist ApplicableDeclaration{Block,List} into a separate file.
...
MozReview-Commit-ID: EXnAzfyoZ1e
2017-06-12 12:13:21 -07:00
Bobby Holley
0caad2ffdc
Use even fewer bits for source order and shrink ApplicableDeclarationsBlock by another word.
...
MozReview-Commit-ID: 7B1i1g0HLTj
2017-06-12 12:13:16 -07:00
Bobby Holley
3afab1400a
Make source_order u32 and shrink Rule.
...
MozReview-Commit-ID: AKNTZZqke1O
2017-06-12 12:13:10 -07:00
Emilio Cobos Álvarez
f8755d6cf0
style: Don't try to compute @viewport unnecessarily.
...
If the viewport rule is not enabled, there's just no point in computing it.
Bug: 1372058
2017-06-12 20:36:37 +02:00
Nazım Can Altınova
15fe48f3f6
stylo: Support :hover and :active quirk
2017-06-10 22:18:32 +03:00
Josh Matthews
3773a4d499
Encapsulate CSS error reporter creation for stylo.
2017-06-09 13:16:38 -04:00
Boris Zbarsky
6601ae2810
Reduce the size of ApplicableDeclarationBlock.
...
The level is a u8, so on 64-bit it packs nicely after the u32 specificity.
2017-06-08 14:44:55 -04:00
bors-servo
3616b8f0c3
Auto merge of #17225 - bzbarsky:pseudo-sharing-fixage, r=emilio
...
Fix revalidation selectors when pseudo-elements are involved.
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix https://bugzilla.mozilla.org/show_bug.cgi?id=1371112
<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because I am adding a Gecko test for them
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- 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/17225 )
<!-- Reviewable:end -->
2017-06-08 07:21:01 -07:00
Boris Zbarsky
537cf52707
Fix revalidation selectors when pseudo-elements are involved.
2017-06-08 01:19:50 -04:00
Ting-Yu Lin
2411749fcf
stylo: Get rules from Gecko XBL stylesheets in cascading (Bug 1290276)
2017-06-08 11:18:44 +08:00
Bobby Holley
1281fd9353
Stop slicing selectors when noting dependencies, and match with an offset instead.
...
MozReview-Commit-ID: KLqmdRKygO0
2017-06-05 19:44:01 -07: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