Commit graph

4994 commits

Author SHA1 Message Date
Cameron McCormack
d90ff1801a style: Fix origin iteration order. 2017-08-13 18:51:05 +08:00
Cameron McCormack
84451e521b style: Only flush stylesheet invalidations for origins that have changed. 2017-08-13 18:51:04 +08:00
Cameron McCormack
f3a7adfcc7 style: Add ability to clear and rebuild individual origins. 2017-08-13 18:51:03 +08:00
Cameron McCormack
72107eb838 style: Move cleared state into per-origin data. 2017-08-13 18:51:02 +08:00
Cameron McCormack
57ee17d6d9 style: Move rule source order counter into per-origin data. 2017-08-13 18:51:01 +08:00
Cameron McCormack
db6a09f24f style: Move cached media query results into per-origin data. 2017-08-13 18:50:59 +08:00
Cameron McCormack
f9d1a0e2d1 style: Split style sheet invalidations per-origin. 2017-08-13 18:50:58 +08:00
Cameron McCormack
321643ae61 style: Factor out per-origin data storage.
Also add an iter_mut_origins() function.
2017-08-13 18:50:57 +08:00
Cameron McCormack
0635fddbfc style: Move Origin into its own file. 2017-08-13 18:36:58 +08:00
Anthony Ramine
51b740033b Introduce ComputeSquaredDistance
This allows us to merge the former Animatable methods compute_distance and
compute_squared_distance, reducing code size.
2017-08-13 00:51:09 +02:00
Anthony Ramine
b14e68f915 Remove impl_animatable_for_option_tuple 2017-08-13 00:51:08 +02:00
Bobby Holley
657878d8a5 Update bindings. 2017-08-11 19:14:33 -07:00
Hiroyuki Ikezoe
015a249afc Cleanup code that was used for verifying styling results for throttled animation flush in post traversal.
Now that we do process normal traversal even in the case of throttled animation
flush so that we don't need to do special handling for the case.

Note about the comment in has_current_styles():
the remaining animation hints is not caused by either this patch or the
previous patch in this patch series, it's been there in the first place, but
it should be fixed somehow later. See bug 1389675.

MozReview-Commit-ID: JojHufxNCiS
2017-08-11 18:52:36 -07:00
Hiroyuki Ikezoe
c0de5ebd21 Process normal traversal for throttled animation flush as well.
MozReview-Commit-ID: BirD8BDMifp
2017-08-11 18:52:29 -07:00
bors-servo
faad7ffb45 Auto merge of #18053 - bholley:descendants_bit_refactor, r=emilio
Overhaul dirty descendants propagation in preparation for restyle roots

https://bugzilla.mozilla.org/show_bug.cgi?id=1389385

<!-- 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/18053)
<!-- Reviewable:end -->
2017-08-11 19:01:15 -05:00
Bobby Holley
57d8ec95b7 Update bindings. 2017-08-11 17:00:40 -07:00
Bobby Holley
d8cba2959f Rearrange dirty noting to operate on the element rather than the parent.
This will allow us to scope restyle roots more tightly.

MozReview-Commit-ID: 2t2lp5sKBHH
2017-08-11 17:00:38 -07:00
Bobby Holley
24a52b7990 Do all descendant bit propagation from Gecko over FFI.
Deduplicating code is nice, and it will help us when we make the bit
propagation more complicated in upcoming patches.

MozReview-Commit-ID: KIQnNJVayrM
2017-08-11 17:00:37 -07:00
bors-servo
c3bbe9284c Auto merge of #18052 - Manishearth:fixup_generic, r=heycam
stylo: Don't call fixup_generic_font for system or CSS wide specified fonts

r=heycam https://bugzilla.mozilla.org/show_bug.cgi?id=1383869

<!-- 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/18052)
<!-- Reviewable:end -->
2017-08-11 17:51:36 -05:00
Manish Goregaokar
69070c7592 stylo: Don't call fixup_generic_font for system or CSS wide specified fonts 2017-08-11 14:51:45 -07:00
Bobby Holley
2df7ae1354 Update bindings. 2017-08-11 11:24:10 -07:00
Bobby Holley
248a245c95 Make the parallel traversal an explicit flag instead of guessing from Servo.
MozReview-Commit-ID: 83DgB1sZnCb
2017-08-11 10:53:14 -07:00
Bobby Holley
f4ccbf3687 Hoist StyleNew{Children,Subtree} into their own paths.
The buggy animation handling isn't a regression, since currently we pass
UnstyledChildrenOnly in those cases, which blocks the animation traversal
in Servo_TraverseSubtree.

In general I really wanted to handle these two paths together. But there's
enough broken with the NewChildren path that I wanted to scope the buginess
as tightly as possible. And I really need to separate the handling here from
StyleDocument() to make the restyle root stuff work.

MozReview-Commit-ID: 9F0mcQl7AAX
2017-08-11 10:53:08 -07:00
Bobby Holley
32790be78d Tidy up flags handling in recalc_style_at a bit.
MozReview-Commit-ID: 4BK0JfkgjdC
2017-08-11 10:53:03 -07:00
Bobby Holley
18ad382f00 Only clear the descendants bit for which we're traversing.
Doing anything else is non-sensical, since we're not guaranteed to reach all of
the bits from traversal Y when doing traversal X.

MozReview-Commit-ID: FQliRxBan70
2017-08-11 10:52:56 -07:00
Hiroyuki Ikezoe
fb8f31f973 Make -webkit-text-stroke-width animatable. 2017-08-11 21:41:36 +09:00
bors-servo
58e8a3126a Auto merge of #18042 - upsuper:grid-template, r=canaltinova
Make nsStylePosition::mGridTemplate{Columns,Rows} a UniquePtr.

This is the Servo side change of [bug 1388255](https://bugzilla.mozilla.org/show_bug.cgi?id=1388255).

<!-- 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/18042)
<!-- Reviewable:end -->
2017-08-11 06:32:44 -05:00
Xidorn Quan
888012dcf6 Make nsStylePosition::mGridTemplate{Columns,Rows} a UniquePtr. 2017-08-11 21:17:38 +10:00
Anthony Ramine
c4e33d9dca Animate basic shapes 2017-08-11 10:25:03 +02:00
bors-servo
56f5fc41fa Auto merge of #18037 - heycam:split-cascade-font-counter, r=emilio
style: Split collected @font-face / @counter-style rules per origin.

<!-- Please describe your changes on the following line: -->

More refactoring in preparation for rebuilding sheets only from the origin that changed.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/18037)
<!-- Reviewable:end -->
2017-08-11 00:40:18 -05:00
Cameron McCormack
57622004ce style: Split collected @font-face / @counter-style rules per origin. 2017-08-11 13:39:49 +08:00
Boris Zbarsky
e84cb45078 Stylo's atom generation needs to deal with wrapper anon boxes. 2017-08-11 00:08:11 -04:00
Xidorn Quan
d0179902bb Use namespace id instead of atom in synthesize_presentational_hints_for_legacy_attributes.
Using namespace id fixes this issue because in Gecko, the pref of MathML
(as well as SVG) works in the way that we choose a different namespace
id (the disabled id) for the elements. Those ids are mapped to the same
namespace atom as normal ids, which means if we use the atom, we would
treat the elements like normal mathml elements.
2017-08-10 16:38:28 +10:00
Manish Goregaokar
6dac81c34c Include logical properties in has_author_specified_rules 2017-08-09 22:00:11 -07:00
Manish Goregaokar
4d4cde293f Correctly scale -moz-min-font-size-ratio 2017-08-09 22:00:05 -07:00
bors-servo
8a48578a26 Auto merge of #17812 - brainlessdeveloper:use-resolved-url-instead-of-original, r=emilio
Introduce ComputedUrl

<!-- Please describe your changes on the following line: -->

Use the new `ComputedUrl` type for computed types and `SpecifiedUrl` for specified types instead of using the `SpecifiedUrl` implementation for both.

---
<!-- 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 #17625 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because this is an implementation change and tests already exist.

<!-- 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/17812)
<!-- Reviewable:end -->
2017-08-09 20:34:04 -05:00
bors-servo
ca14848711 Auto merge of #18017 - heycam:split-cascade, r=emilio
style: Move all origin-specific cascade data to PerOriginCascadeData

<!-- Please describe your changes on the following line: -->

This is a preliminary refactoring in preparation for only rebuilding cascade data for origins that have a change. https://bugzilla.mozilla.org/show_bug.cgi?id=1382925

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/18017)
<!-- Reviewable:end -->
2017-08-09 19:28:07 -05:00
bors-servo
faf5b1f797 Auto merge of #18024 - bradwerth:mediatypeAtom, r=emilio
Rework MediaType to be an atom-based struct instead of an enum.

MozReview-Commit-ID: 1Tfrs9PBkhA

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1371395
https://reviewboard.mozilla.org/r/163194/

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/18024)
<!-- Reviewable:end -->
2017-08-09 18:24:48 -05:00
bors-servo
845131c425 Auto merge of #18025 - servo:line-counting, r=jdm
Update to cssparser 0.19, count line numbers during tokenization

https://github.com/servo/rust-cssparser/pull/177

Also simplify the `ParseErrorReporter` trait a bit.

<!-- 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/18025)
<!-- Reviewable:end -->
2017-08-09 16:16:33 -05:00
Simon Sapin
7382dad939 Update to cssparser 0.19, count line numbers during tokenization 2017-08-09 22:37:16 +02:00
Brad Werth
557ffa979d Rework MediaType to be an atom-based struct instead of an enum.
MozReview-Commit-ID: 1Tfrs9PBkhA
2017-08-09 13:25:30 -07:00
bors-servo
2b92a7e82d Auto merge of #18026 - bholley:continue_traversal_cleanup, r=emilio
Continue cleaning up the traversal entry point machinery

https://bugzilla.mozilla.org/show_bug.cgi?id=1388623

<!-- 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/18026)
<!-- Reviewable:end -->
2017-08-09 13:03:00 -05:00
Bobby Holley
49bdb5bb4e Be more careful about the flags we clear for forgetful traversals.
MozReview-Commit-ID: ETDL8KsInAn
2017-08-09 10:52:04 -07:00
Bobby Holley
c92f883d92 Unrelated: Add a comment for Gecko bug 1368291.
Bundling this in to avoid an extra servo push.
2017-08-09 10:52:01 -07:00
Emilio Cobos Álvarez
7d813d8f25
style: Only zoom absolute lengths.
As silly as it may seem to specify font-sizes using viewport units, we weren't
handling zoom for them correctly either.

Bug: 1388588
Reviewed-by: Manishearth
MozReview-Commit-ID: 3Q6phYAu5CE
2017-08-09 17:53:49 +02:00
Fausto Núñez Alberro
14c5a1b8d3 Introduce ComputedUrl
Add web platform tests for computed URL styles

Mark url with no original or resolved unreachable

Update the WPT manifest for new url tests
2017-08-09 13:55:39 +02:00
Cameron McCormack
6cbe55206b style: Move selector/declaration counts into PerOriginCascadeData. 2017-08-09 19:27:56 +08:00
Cameron McCormack
cd5b2c9fbe style: Move revalidation selectors into PerOriginCascadeData. 2017-08-09 19:27:55 +08:00
Cameron McCormack
30de56f208 style: Move attribute and state dependencies into PerOriginCascadeData. 2017-08-09 19:27:54 +08:00
Cameron McCormack
16937ba7cd style: Move invalidation map into PerOriginCascadeData. 2017-08-09 19:27:53 +08:00