Commit graph

4542 commits

Author SHA1 Message Date
bors-servo
ed75bcae75 Auto merge of #17912 - bzbarsky:stylo-first-line, r=emilio
Implement ::first-line support in stylo

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

Fixes Gecko bug 1324619.

---
<!-- 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=1324619

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

<!-- 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/17912)
<!-- Reviewable:end -->
2017-07-28 22:51:20 -05:00
Boris Zbarsky
c531af96ae Make sure we don't recreate boxes just because we have a ::first-line.
Servo part of part 5 of the fix for Gecko bug 1324619.  r=emilio
2017-07-28 22:54:06 -04:00
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
bors-servo
b47e1876bd Auto merge of #17913 - upsuper:prop-enabled, r=Manishearth
Have check_allowed_in read gPropertyEabled table directly

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

<!-- 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/17913)
<!-- Reviewable:end -->
2017-07-28 21:49:38 -05:00
Xidorn Quan
5be5d493df Have check_allowed_in read gPropertyEabled table directly. 2017-07-29 12:08:46 +10:00
Boris Zbarsky
91d4956da5 Don't reconstruct the layout object when going from no pseudo to pseudo with no content for ::before and ::after.
Fixes Gecko bug 1376073.  r=emilio
2017-07-28 17:45:29 -04:00
bors-servo
e95da98f5f Auto merge of #17901 - heycam:rm-empty-variables, r=emilio
style: Remove now-unused empty Variables struct.

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

The `Servo_GetEmptyVariables` FFI function no longer has any callers from Gecko, so we can remove it and the code that creates/frees that struct.

---
<!-- 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/17901)
<!-- Reviewable:end -->
2017-07-28 09:08:24 -05:00
bors-servo
3ab6b1cf8f Auto merge of #17898 - BorisChiou:stylo/animation/filter_distance, r=birtles
stylo: Fix compute_squared_distance for AnimatedFilterList

We implement compute_distance for Angle to avoid returning Err(()) from it, and then rewrite compute_squared_distance of AnimatedFilterLIst to avoid using unwrap() and make it simpler.

---
<!-- 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 [Bug 1384014](https://bugzilla.mozilla.org/show_bug.cgi?id=1384014).
- [X] These changes do not require tests because there is a DevTools test for this already.

<!-- 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/17898)
<!-- Reviewable:end -->
2017-07-28 02:08:31 -05:00
Xidorn Quan
193be649d6 Upgrade to bindgen 0.29. 2017-07-28 14:16:50 +10:00
Cameron McCormack
45df66f9ff style: Remove now-unused empty Variables struct. 2017-07-28 11:57:45 +08:00
Boris Chiou
902819590f Rewrite compute_squared_distance for AnimatedFilterList. 2017-07-28 11:27:46 +08:00
bors-servo
b1d9746041 Auto merge of #17897 - Manishearth:bump-au, r=emilio
Bump app units version (take 2)

<!-- 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/17897)
<!-- Reviewable:end -->
2017-07-27 19:32:30 -05:00
Manish Goregaokar
1c77535b3f stylo: Bump app units version 2017-07-27 16:49:17 -07:00
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
5a1550401a Update checked-in bindings.
MozReview-Commit-ID: 34zO9Jp9VEr
2017-07-27 14:26:27 -07:00
Bobby Holley
6148db670b Break TraversalFlags::ForReconstruct down into several independent pieces.
These will be useful in followup work.

MozReview-Commit-ID: Dyp9R0PG36v
2017-07-27 14:26:21 -07:00
Bobby Holley
5c6d3b820e Stop unconditionally traversing every element in the subtree on reconstruct traversals.
We already have a more-specific check further down in the file, which was added in the same revision.
I think this one was erroneous.

MozReview-Commit-ID: CnP0zCpBtnp
2017-07-27 14:26:15 -07:00
Bobby Holley
68c8808711 Get rid of the ForNewlyBoundElement mode.
MozReview-Commit-ID: 1IRn2iaPnVc
2017-07-27 14:26:10 -07:00
Bobby Holley
543bbb7b9c Clean up ForThrottledAnimationFlush stuff.
MozReview-Commit-ID: I6xeHv65nH2
2017-07-27 14:26:04 -07: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
25896c384f stylo: Create ServoFontFeatureValuesRule and bind servo data
Add ServoFontFeatureValuesRule for CSSOM representation of
@font-feature-values rule and wire up with bindings.
2017-07-27 13:38:00 -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
bors-servo
d429561aa2 Auto merge of #17889 - chenpighead:fix-transition-visited, r=hiro
stylo: remove bogus optimization check in replace_rules() for visited styles.

We skipped updating the rule nodes for visited rules during animation-only restyle.
However, this causes isseus that visited style overrides animation styles on visited element.
So, it turns out that we should update the visited rules even during animation-only restyle.

Gecko bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1381235

<!-- 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/17889)
<!-- Reviewable:end -->
2017-07-27 08:25:20 -05:00
Jeremy Chen
000547b999 stylo: remove bogus optimization check in replace_rules() for visited styles.
We skipped updating the rule nodes for visited rules during animation-only restyle.
However, this causes isseus that visited style overrides animation styles on visited element.
So, it turns out that we should update the visited rules even during animation-only restyle.

Gecko bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1381235
2017-07-27 19:10:38 +08: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
Boris Chiou
20e3508ca3 Implement compute_distance for Angle.
When computing the distance between two filter functions, e.g.
HueRotate(0deg) and HueRotate(-360deg), we got an Err(()) and unwrap it
immediately in compute_filter_square_distance(), which causes a crash.
The root-cause is that we don't implement computed_distance of Angle, and we
assume we always get a valid result from compute_squared_distance() for
each filter function.
2017-07-27 15:23:44 +08:00
bors-servo
9645ecef3e Auto merge of #17881 - emilio:fncall, r=canaltinova
style: fix alignment in call to get_all_matching_rules.

<!-- 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/17881)
<!-- Reviewable:end -->
2017-07-27 02:10:46 -05:00
bors-servo
33c9504690 Auto merge of #17880 - Manishearth:stylo-update-border, r=emilio
stylo: call update_border_foo when inheriting borders too

this fixes the reftest failure in layout/reftests/bugs/731521-1.html

<!-- 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/17880)
<!-- Reviewable:end -->
2017-07-27 01:09:24 -05:00
Emilio Cobos Álvarez
b15fa2cd79
style: fix alignment in call to get_all_matching_rules. 2017-07-27 01:35:57 +02:00
Manish Goregaokar
68d67ef3f5 stylo: call update_border_foo when inheriting borders too 2017-07-26 15:48:51 -07:00
bors-servo
27031b996b Auto merge of #17878 - Manishearth:bump-au, r=emilio
stylo: Bump app units version

r=emilio https://bugzilla.mozilla.org/show_bug.cgi?id=1383492

<!-- 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/17878)
<!-- Reviewable:end -->
2017-07-26 16:53:58 -05:00
Hiroyuki Ikezoe
123e5d33c2 MatrixDecomposed3D.add_weighted() is called with zero value for other_portion in case of iteration composite.
In the case where we accumulate transform:none onto decomposed matrix for
iteration composite whose iteration count is over 2, we pass zero
other_portion and self_portion which is over 1.0.  We should care about the
case.
2017-07-27 06:20:35 +09:00
Manish Goregaokar
f61eb07a10 stylo: Bump app units version 2017-07-26 13:55:30 -07:00
bors-servo
020188fdd7 Auto merge of #17875 - bzbarsky:first-line-dual-inheritance, r=emilio
Add support for having two separate parent styles.  Fixes gecko bug 1382806.

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

This is needed for ::first-line support.  See https://drafts.csswg.org/css-pseudo-4/#first-line-inheritance

This PR doesn't quite implement what the CSS spec draft says right now.  It implements what Gecko does, which is what an earlier draft said.

---
<!-- 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=1382806

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because servo doesn't support ::first-line yet

<!-- 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/17875)
<!-- Reviewable:end -->
2017-07-26 15:21:37 -05: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
bors-servo
a15d13a6ec Auto merge of #17877 - canaltinova:font-face-refactoring, r=jdm
Cleanup @font-face rule constructor

Passing SourceLocation into constructor instead of assigning
immediately after construction cleans up the code and helps to
prevent leaving an invalid SourceLocation in the future.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] These changes do not require tests because it's just a cleanup.

<!-- 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/17877)
<!-- Reviewable:end -->
2017-07-26 14:13:02 -05:00
Nazım Can Altınova
c9e5cf0a28 Cleanup @font-face rule constructor
Passing SourceLocation into constructor instead of assigning
immediately after construction cleans up the code and helps to
prevent leaving an invalid SourceLocation in the future.
2017-07-26 11:55:22 -07:00
Boris Zbarsky
f991b76535 Give StyleBuilder separate inherited styles for inherited and non-inherited structs.
This is needed for ::first-line, which causes its kids to inherit different properties from different places.

Part 2 of Gecko bug 1382806.  r=emilio
2017-07-26 13:41:11 -04:00
Boris Zbarsky
648c0a3d0b Remove the inherited_style getter from StyleBuilder.
The concept of inherited style is about to get a bit more complicated, and this
will prevent consumers from doing it wrong.

Part 1 of Gecko bug1382806.  r=emilio
2017-07-26 13:40:02 -04:00
bors-servo
799988578e Auto merge of #17871 - emilio:revert-gradient-stuff, r=emilio
Revert "Auto merge of #17868 - ferjm:bug1380259.radial.gradients, r=xidorn"

This reverts commit ef233381cc, reversing
changes made to f61528d297.

This broke a bunch of tests in m-c, like:

  https://treeherder.mozilla.org/logviewer.html#?job_id=118007409&repo=autoland

<!-- 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/17871)
<!-- Reviewable:end -->
2017-07-26 07:51:21 -05:00
Emilio Cobos Álvarez
75a844cd32
Revert "Auto merge of #17868 - ferjm:bug1380259.radial.gradients, r=xidorn"
This reverts commit ef233381cc, reversing
changes made to f61528d297.

This broke a bunch of tests in m-c, like:

  https://treeherder.mozilla.org/logviewer.html#?job_id=118007409&repo=autoland
2017-07-26 14:25:22 +02:00
bors-servo
f59bd8e2b2 Auto merge of #17859 - jdm:geckodecl, r=heycam
Add message suffixes to stylo error reports.

This is the Servo-side part of https://bugzilla.mozilla.org/show_bug.cgi?id=1381137. This allows us to add the "Declaration dropped" or "Skipped to next declaration" messages after relevant CSS errors that are reported.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- 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/17859)
<!-- Reviewable:end -->
2017-07-26 06:46:13 -05:00
bors-servo
ef233381cc Auto merge of #17868 - ferjm:bug1380259.radial.gradients, r=xidorn
stylo: serialize radial gradients using modern unprefixed style

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

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

<!-- 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/17868)
<!-- Reviewable:end -->
2017-07-26 03:20:33 -07:00
Fernando Jiménez Moreno
c50e892a04 stylo: serialize radial gradients using modern unprefixed style 2017-07-26 12:00:15 +02:00
bors-servo
f61528d297 Auto merge of #17867 - emilio:pseudo-display-none, r=heycam
style: Don't skip computation of pseudo-elements of display: none elements

We have optimizations to avoid doing selector-matching when the style attribute
changes, so, given you can toggle the display property and the pseudo-elements
will suddenly become effective, we can't really skip them.

Furthermore, we assume that if an element has an ElementStyles, they're
up-to-date and we can use them for getComputedStyle, so it's pretty easy to
prove that we do the wrong thing when calling getComputedStyle with a
pseudo-element on a display: none root.

Bug: 1384065
Reviewed-by: heycam
MozReview-Commit-ID: BIOqevGZyrm
2017-07-26 02:15:30 -07:00
Emilio Cobos Álvarez
43278ed349
style: Don't skip computation of pseudo-elements of display: none elements.
We have optimizations to avoid doing selector-matching when the style attribute
changes, so, given you can toggle the display property and the pseudo-elements
will suddenly become effective, we can't really skip them.

Furthermore, we assume that if an element has an ElementStyles, they're
up-to-date and we can use them for getComputedStyle, so it's pretty easy to
prove that we do the wrong thing when calling getComputedStyle with a
pseudo-element on a display: none root.

Bug: 1384065
Reviewed-by: heycam
MozReview-Commit-ID: BIOqevGZyrm
2017-07-26 11:14:04 +02:00
Daisuke Akatsuka
40ce3ddd82 make font-variant-alternates animatable 2017-07-26 10:16:39 +09:00
Josh Matthews
d8fe376f09 Add message suffixes to stylo error reports. (bug 1381137) 2017-07-25 18:37:13 -04:00
Manish Goregaokar
7cdcfa0f8e stylo: Use saturating ops for clip computation
MozReview-Commit-ID: DYQRM4CJbAg
2017-07-25 14:29:05 -07:00
bors-servo
e825bf1442 Auto merge of #17850 - upsuper:bug1382077, r=heycam
Record viewport unit usage and generate proper restyle hint

This is the Servo side change of [bug 1382077](https://bugzilla.mozilla.org/show_bug.cgi?id=1382077).
2017-07-25 02:09:45 -07:00