Commit graph

16155 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
55d9151dd3
style: Minor reformatting.
MozReview-Commit-ID: KVCfX3LqccF
2017-07-24 10:05:26 +02:00
Brian Birtles
b34e331fa2 Only allow animation-timing-function in @keyframes
CSS animations used to erroneously indicate that 'animation-play-state'
is permitted in @keyframes. It is not and is non-sensical to allow it
there. This mistake was faithfully transferred into Servo code (although
we also make 'animation-timing-function' which is what the spec text
meant to say).

The spec has been updated[1] and so we should update the Servo code
accordingly.

[1] adeb3434c5
2017-07-24 14:40:31 +09:00
Brian Birtles
8e7011da8a Iterate through properties in priority order when computing keyframes
This is largely just a translation of Gecko's
PropertyPriorityIterator[1] into rust with the exception that IDL sort
order is only defined for shorthands since that's all we currently
require.

[1] http://searchfox.org/mozilla-central/rev/3a3af33f513071ea829debdfbc628caebcdf6996/dom/animation/KeyframeUtils.cpp#151
2017-07-24 13:50:18 +09:00
bors-servo
46ffcbaf7b Auto merge of #17814 - glennw:update-wr-text-decorations, r=emilio
Update WR (switch to new text-decorations API in WR).

This only makes use of the "Solid" text decoration type, which
matches the existing support. WR now supports dotted, dashed
and wavy text decorations, but supporting those will need some
extra work in Servo to pass through the correct values.

<!-- 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/17814)
<!-- Reviewable:end -->
2017-07-23 20:04:38 -07:00
Glenn Watson
dc82366f72 Update WR (switch to new text-decorations API in WR).
This only makes use of the "Solid" text decoration type, which
matches the existing support. WR now supports dotted, dashed
and wavy text decorations, but supporting those will need some
extra work in Servo to pass through the correct values.
2017-07-24 13:02:21 +10:00
Emilio Cobos Álvarez
533ea86bab
style: Mention when visited styles may be disabled. 2017-07-24 00:04:45 +02:00
bors-servo
2241d5879e Auto merge of #17828 - emilio:visited-now, r=Manishearth
stylo: Visited link fixes.

Straight from https://bugzilla.mozilla.org/show_bug.cgi?id=1383307

<!-- 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/17828)
<!-- Reviewable:end -->
2017-07-23 13:46:43 -07:00
Emilio Cobos Álvarez
9b2d96f7e7
stylo: Honor the relevant link visited pref.
MozReview-Commit-ID: D5NiEJUpONQ
2017-07-23 22:37:47 +02:00
Emilio Cobos Álvarez
04e855c38d
style: Fix relevant-link-visited logic in presence of nested links.
MozReview-Commit-ID: LIjpTAgrPBY
2017-07-23 22:12:47 +02:00
Emilio Cobos Álvarez
aea24fa81e
style: Update bindings. 2017-07-23 22:12:37 +02:00
Nikhil Shagrithaya
15ac245ae7 Update step annotations in script's prepare method 2017-07-24 00:20:07 +05:30
Emilio Cobos Álvarez
4e0492c5d1
style: Move the RELEVANT_LINK_VISITED flag to servo.
And kill one GetParentAllowServo call while at it, and some other dumbness...

Bug: 1383307
Reviewed-by: Manishearth
2017-07-23 05:22:18 +02:00
Emilio Cobos Álvarez
1c5d522742
layout: Make -Z show-parallel-layout show something useful again. 2017-07-23 01:47:47 +02:00
Emilio Cobos Álvarez
b576229567
stylo: Set the NS_STYLE_IS_TEXT_COMBINED flag.
This should fix at least
layout/reftests/writing-mode/1135361-ruby-justify-1.html
2017-07-22 02:29:36 +02:00
bors-servo
9b276565f8 Auto merge of #17822 - Manishearth:die-stylearc-die, r=bzbarsky
Remove last vestiges of stylearc

<!-- 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/17822)
<!-- Reviewable:end -->
2017-07-21 15:47:54 -07:00
Manish Goregaokar
01b1027365 Remove last vestiges of stylearc 2017-07-21 14:39:51 -07:00
bors-servo
76ad913870 Auto merge of #17634 - asajeffrey:canvas-image-css-style-value, r=jdm
Implement drawing an image from a CSS style value into a canvas

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

Implemented drawing a CSS style value into a canvas, which is needed for the Houdini CSS Paint API.

This PR is dependent on #17364.

---
<!-- 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 #17432.
- [X] These changes do not require tests because the existing CSS paint API wpt test cases test this behaviour.

<!-- 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/17634)
<!-- Reviewable:end -->
2017-07-21 14:39:47 -07:00
Alan Jeffrey
2318caf002 Implement drawing an image from a CSS style value into a canvas. 2017-07-21 16:39:11 -05:00
bors-servo
d1c4d7a6af Auto merge of #17817 - emilio:always-be-removing-the-ugly, r=stshine
style: Move a conditional import to where it's used.

To avoid yet another cfg().

<!-- 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/17817)
<!-- Reviewable:end -->
2017-07-21 13:31:13 -07:00
bors-servo
4bf8e4413e Auto merge of #17821 - bzbarsky:pseudo-prop-restrictions, r=emilio
Implement restrictions on which properties apply to which pseudo-elements

::first-line, ::first-letter, and ::placeholder don't allow all properties to apply to them.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because they're Gecko-only for the moment, and Gecko has 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/17821)
<!-- Reviewable:end -->
2017-07-21 12:15:50 -07:00
Boris Zbarsky
86b3b6a32f Filter out non-applying properties when cascading style for ::first-letter/::first-line/::placeholder. r=emilio
Part 3 of the fix for Gecko bug 1382786 <https://bugzilla.mozilla.org/show_bug.cgi?id=1382786>.
2017-07-21 14:16:06 -04:00
Boris Zbarsky
592a96fc06 Flag properties that apply to ::first-letter/::first-line/::placeholder. r=emilio
Part 2 of the fix for Gecko bug 1382786 <https://bugzilla.mozilla.org/show_bug.cgi?id=1382786>.
2017-07-21 14:15:42 -04:00
Boris Zbarsky
e05058d2b9 Add property flags for which properties apply to certain pseudo-elements. r=emilio
These flags can be used to flag properties that apply to ::first-letter, ::first-line, and ::placeholder

Part 1 of the fix for Gecko bug 1382786 <https://bugzilla.mozilla.org/show_bug.cgi?id=1382786>.
2017-07-21 14:09:41 -04:00
bors-servo
992c647f76 Auto merge of #17818 - Manishearth:stylo-fixup, r=heycam
stylo: Various ComputedValues fixes

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

<!-- 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/17818)
<!-- Reviewable:end -->
2017-07-21 11:05:13 -07:00
Manish Goregaokar
b332a061b4 stylo: Rename ServoComputedValues -> ServoComputedData
ServoComputedValues is confusing because ComputedValues is actually
ServoStyleContext on the C++ side.
2017-07-21 11:04:45 -07:00
bors-servo
d1ac8b26e9 Auto merge of #17813 - upsuper:supports-decl, r=SimonSapin
Store raw string for prop decl in @supports

This fixes the serialization issue of `@supports` rule that whitespaces are not preserved like in other browsers.

It makes the work a bit redundant (the property name and colon is parsed twice), but I suppose this isn't a big deal.

<!-- 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/17813)
<!-- Reviewable:end -->
2017-07-21 09:01:57 -07:00
Emilio Cobos Álvarez
3f323dde10
style: Move a conditional import to where it's used.
To avoid yet another cfg().
2017-07-21 17:41:56 +02:00
Manish Goregaokar
cca0eacf80 stylo: Remove usage of ServoComputedValues from most Gecko code 2017-07-21 08:33:33 -07:00
Manish Goregaokar
3c3e4399da stylo: Remove usage of ServoComputedValues from binding functions 2017-07-21 08:33:11 -07:00
Manish Goregaokar
9776d070ea stylo: Replace stylearc with servo_arc 2017-07-21 08:30:39 -07:00
Fernando Jiménez Moreno
585d0e52af PWM tests 2017-07-21 15:10:04 +02:00
Xidorn Quan
adee1e403c Store raw string for prop decl in @supports 2017-07-21 22:59:39 +10:00
bors-servo
06b409ad60 Auto merge of #17811 - brainlessdeveloper:remove-immeta-dep, r=jdm
Remove unused immeta dependency in net_traits

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it is an unused dependency removal

<!-- 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/17811)
<!-- Reviewable:end -->
2017-07-20 23:52:56 -07:00
bors-servo
1e6999b02b Auto merge of #17806 - emilio:quirks-mode-bloom, r=bholley
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

<!-- 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/17806)
<!-- Reviewable:end -->
2017-07-20 22:40:15 -07:00
bors-servo
3c89486de2 Auto merge of #17804 - emilio:visited-comment, r=jryans
Add a comment about visited style inheritance.

<!-- 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/17804)
<!-- Reviewable:end -->
2017-07-20 21:38:58 -07:00
bors-servo
a3c398b5da Auto merge of #17802 - emilio:reland-stuff, r=heycam
Revert "Backed out changeset b10e6ba9cbdb because gecko part had to b…

…e backed out."

This reverts commit b96d96d448.

The fix on the Gecko side is trivial, and I can land it after this lands.

<!-- 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/17802)
<!-- Reviewable:end -->
2017-07-20 20:28:25 -07:00
bors-servo
fafb8476e8 Auto merge of #17799 - upsuper:body-color-panic, r=heycam
Don't panic when body element don't have style data

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

<!-- 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/17799)
<!-- Reviewable:end -->
2017-07-20 19:23:19 -07:00
bors-servo
c81ddeedf3 Auto merge of #17797 - dadaa:bug1378076, r=hiro
make border-XX-style, cursor, -moz-user-select animatable

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

<!-- Either: -->
- [X] There are tests for these changes. The test codes are patch 4 and 5 of https://bugzilla.mozilla.org/show_bug.cgi?id=1378076

<!-- 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/17797)
<!-- Reviewable:end -->
2017-07-20 18:20:36 -07:00
bors-servo
9fcbeb3ca2 Auto merge of #17499 - asajeffrey:script-paint-worklets-zoom, r=glennw
Fixed scaling artefacts in paint worklets caused by zoom and hidpi

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

This PR renders paint worklet canvases at the device pixel resolution, rather than the CSS pixel resolution.

It's a dependent PR, building on #17239, #17326 and #17364.

---
<!-- 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 #17454
- [X] These changes do not require tests because we don't run reftests with zoom enabled

<!-- 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/17499)
<!-- Reviewable:end -->
2017-07-20 17:09:06 -07:00
bors-servo
4616f4ae77 Auto merge of #17809 - Manishearth:stylo-system-anim, r=hiikezoe
Stop asserting when cached system font changes

It may change during animation

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

<!-- 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/17809)
<!-- Reviewable:end -->
2017-07-20 16:07:51 -07:00
Xidorn Quan
7f3fa3edeb Don't panic when body element don't have style data. 2017-07-21 09:07:15 +10:00
Alan Jeffrey
caa3585219 Fixed scaling artefacts in paint worklets caused by zoom and hidpi. 2017-07-20 17:25:50 -05:00
Fausto Núñez Alberro
9b6a065569 Remove unused immeta dependency in net_traits 2017-07-21 00:15:21 +02:00
Manish Goregaokar
5f7d0436ab Stop asserting when cached system font changes
It may change during animation
2017-07-20 15:07:55 -07:00
bors-servo
a303696ae3 Auto merge of #17793 - hiikezoe:may-have-animations-check, r=birtles
Call may_have_animations() for parent element in the case where the t…

…arget is pseudo element.

In case of pseudo elements ElementHasAnimations is set on the parent element.

updating-animation-on-pseudo-element.html fails without this patch, succeeds
with this patch.

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1367278
---
- [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/17793)
<!-- Reviewable:end -->
2017-07-20 14:21:34 -07: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
bors-servo
e19fefcb47 Auto merge of #17792 - upsuper:supports-any-value, r=SimonSapin
Fix supports rule parsing issues with <any-value>

This eventually fixes #15482, as well as several reftests in mozilla-central which were added for [bug 883987](https://bugzilla.mozilla.org/show_bug.cgi?id=883987).

The new function should probably be moved into cssparser crate at some point.

<!-- 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/17792)
<!-- Reviewable:end -->
2017-07-20 13:08:58 -07:00
bors-servo
eba573d774 Auto merge of #17256 - ferjm:ttfp, r=jdm
Implement basic Time To First Paint and First Contentful Paint PWMs

- [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/17256)
<!-- Reviewable:end -->
2017-07-20 11:34:35 -07:00
bors-servo
a64f085ee0 Auto merge of #17803 - Manishearth:servo-fontcomputation, r=emilio
servo: Move FontComputationData to the end of ServoComputedValues to make size check easier, make it NonZero

We fail bindgen layout tests on 32 bit because FontComputationData does not accurately reflect the size/alignment of the rust-side replacement.

We move it to the end so that alignment is more straightforward, and
use a NonZero enum so that the representation can be more accurately
handled on the C++ side.

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

<!-- 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/17803)
<!-- Reviewable:end -->
2017-07-20 10:33:43 -07:00
Emilio Cobos Álvarez
2006994ae6
Add a comment about visited style inheritance. 2017-07-20 19:05:16 +02:00