Commit graph

25860 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
fe8da51fee
Bug 1364412: Properly reject to parse pseudo-element states that don't support state. r=bholley
MozReview-Commit-ID: KQCFPtOTGQI
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-16 02:53:44 +02:00
Emilio Cobos Álvarez
1e0edf4909
Bug 1364412: Expose pseudo-element flags, and properly reject pseudos in non-UA sheets. r=bholley
MozReview-Commit-ID: KYC1ywfI7Lg
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-16 02:53:43 +02:00
Emilio Cobos Álvarez
5820e3ecac
Bug 1364412: Convert pseudo-elements to an enum. r=hiro,xidorn 2017-05-16 02:53:41 +02:00
Emilio Cobos Álvarez
0bc185f1c2
Bug 1364412: Properly handle state restyle hints for pseudo-elements. r=bholley 2017-05-16 02:49:39 +02:00
Emilio Cobos Álvarez
de680b06fe
Bug 1364412: Track pseudo-element's state dependencies too. r=heycam
MozReview-Commit-ID: 8zOE7TyW1xi
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-16 02:49:37 +02:00
Emilio Cobos Álvarez
737c7f1f63
Bug 1364412: Simplify Servo_HasAuthorSpecifiedRules looking at the pseudo style. r=bholley
MozReview-Commit-ID: HpV92ttZGJz
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-16 02:49:34 +02:00
Emilio Cobos Álvarez
84f5a90668
Bug 1364412: Use the pseudo selector to reject state selectors. r=bholley
MozReview-Commit-ID: 73dnp6nZpdU
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-16 02:49:30 +02:00
Emilio Cobos Álvarez
dd38740ece
Bug 1364412: Store full selectors in the Rule object. r=bholley
MozReview-Commit-ID: EKLKxNCghLD
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-16 02:49:26 +02:00
Emilio Cobos Álvarez
10560ae043
Bug 1364412: Allow pseudo-element selectors to store state. r=bholley
MozReview-Commit-ID: CzAwg2uxqO2
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-16 02:49:22 +02:00
bors-servo
5bd6b92494 Auto merge of #16862 - CJKu:bug-1310885-part-6, r=heycam
stylo: Pass Cached ImageValue from stylo back to gecko

<!-- Please describe your changes on the following line: -->
This is  part 6 ~ part 9 patch in bug 1310885

gecko bug link:
https://bugzilla.mozilla.org/show_bug.cgi?id=1310885
---
<!-- 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/16862)
<!-- Reviewable:end -->
2017-05-15 18:04:59 -05:00
bors-servo
a51da06dd9 Auto merge of #16877 - bzbarsky:moz-anonymous-content, r=emilio
Implement :-moz-anonymous-content in stylo

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because they're tested by 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/16877)
<!-- Reviewable:end -->
2017-05-15 16:38:14 -05:00
bors-servo
fa251ec96b Auto merge of #16295 - jdm:transition-safety, r=nox
Root nodes for the duration of their CSS transitions

This ensures that we can pass a node address as part of the asynchronous
transition end notification, making it safe to fire the corresponding
DOM event on the node from the script thread. Without explicitly rooting
this node when the transition starts, we risk the node being GCed before
the transition is complete.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14972
- [X] There are tests for these changes

<!-- 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/16295)
<!-- Reviewable:end -->
2017-05-15 15:00:19 -05:00
Boris Zbarsky
c5cd84392f Implement :-moz-native-anonymous support in stylo.
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1364591
2017-05-15 15:58:20 -04:00
Boris Zbarsky
5ddf455235 Fix style sharing cache lookups to compare ids of the two elements.
Otherwise we can have a situation like this:

  <style>
    .notmatching > #foo {}
  </style>
  <span id="foo"></span>
  <span></span>

and the style sharing cache lookup for the second <span> would try to revalidate
against the cached value for the first <span>, but end up failing asserts about
the two elements matching lists of revalidation selectors that have the same
length.
2017-05-15 15:55:05 -04:00
cku
cc67f37d4e Stylo: Add new Gecko_XXXImageValue functions and remove unsed ones in binding.rs 2017-05-16 02:34:18 +08:00
cku
f9b370719d Stylo: Pass style list's image_value to gecko. 2017-05-16 02:34:16 +08:00
bors-servo
dfb9396296 Auto merge of #16699 - jdm:make-cross-origin-image-tests-fail, r=ajeffrey,jgraham
Make cross-origin canvas drawing tests use a same-origin redirect.

These tests either pass or maintain existing known failures in Firefox and Chrome, and expose the problem in our current implementation that #15887 is addressing.

<!-- 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/16699)
<!-- Reviewable:end -->
2017-05-15 13:26:25 -05:00
Josh Matthews
b0bf2b4bad Make methods storing layout-originating nodes unsafe. 2017-05-15 14:12:08 -04:00
Josh Matthews
2ca80a800f Warn about ignored transitions which can't be rooted. 2017-05-15 14:12:08 -04:00
Josh Matthews
9134918844 Send information to script as part of finishing layout.
This avoids the need for multiple layout RPC operations immediately
following return of control to script. This means that layout and
script can continue to operate in parallel at this point, rather
than one potentially waiting on the shared mutex to be unlocked.
2017-05-15 14:12:08 -04:00
Josh Matthews
c3b9714ab7 Accumulate transitioning nodes inside the layout context. 2017-05-15 14:11:40 -04:00
Josh Matthews
dabebdfbf5 Root nodes for the duration of their CSS transitions.
This ensures that we can pass a node address as part of the asynchronous
transition end notification, making it safe to fire the corresponding
DOM event on the node from the script thread. Without explicitly rooting
this node when the transition starts, we risk the node being GCed before
the transition is complete.
2017-05-15 14:07:41 -04:00
cku
ff5043c8b5 Stylo: Pass cursor's image_value to gecko. 2017-05-16 01:42:33 +08:00
cku
c04195f79e Stylo: Pass content's image_value to gecko. 2017-05-16 01:42:32 +08:00
cku
f7e3c534e3 Stylo: Pass LayerImage's image_value to gecko. 2017-05-16 01:42:31 +08:00
cku
2fe55e82d3 Stylo: Let SpecifiedUrl be able to carry ImageValue. 2017-05-16 01:42:30 +08:00
bors-servo
ff5f90386b Auto merge of #16873 - bzbarsky:fix-dir-matching, r=emilio
Fix dynamic updates when :dir matching changes in stylo.

This is the servo part of https://bugzilla.mozilla.org/show_bug.cgi?id=1364280

<!-- 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=1364280
<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because Gecko has lots of tests for this and this is Gecko-only.

<!-- 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/16873)
<!-- Reviewable:end -->
2017-05-15 11:40:40 -05:00
Boris Zbarsky
cd29916c99 Fix dynamic updates when :dir matching changes in stylo.
This is the servo part of https://bugzilla.mozilla.org/show_bug.cgi?id=1364280
2017-05-15 12:31:49 -04:00
bors-servo
f3c8f7e0d0 Auto merge of #16869 - nox:mime, r=nox
Ignore mime type parameters in nosniff (fixes #16049)

<!-- 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/16869)
<!-- Reviewable:end -->
2017-05-15 10:15:37 -05:00
bors-servo
eb7314b412 Auto merge of #16859 - nox:gradients, r=emilio
Rewrite style images with a good dose of generics 💉

<!-- 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/16859)
<!-- Reviewable:end -->
2017-05-15 09:13:38 -05:00
Anthony Ramine
dd38bba1be Pass the gradient compatibility mode to gecko 2017-05-15 15:36:28 +02:00
Anthony Ramine
ea4e7299d4 Implement -webkit-gradient() (fixes #16542) 2017-05-15 15:36:26 +02:00
Anthony Ramine
9e6f9db127 Reorganise specified::image::GradientItem methods 2017-05-15 15:36:24 +02:00
Anthony Ramine
c9d140121d Accept strings in -moz-image-rect() (fixes #16823) 2017-05-15 15:36:23 +02:00
Anthony Ramine
73f77e0a53 Rename LayerImage to ImageLayer and make it a type alias 2017-05-15 15:36:21 +02:00
Anthony Ramine
fa5b46b6ee Clean up methods on specified::Image 2017-05-15 15:36:19 +02:00
Anthony Ramine
abef5da9d8 Refactor Gradient
In a similar way to Position, now specified and computed gradients share
a common Gradient type defined in style::values::generics::image.

This allows us to reuse most code for many style traits like ToCss,
HasViewportPercentage and ToComputedValue.

The test changes are the fallout of the disappearance of AngleOrCorner::None,
which align our code to the spec for serialisation, where components that can
be omitted should be omitted.
2017-05-15 15:36:15 +02:00
Anthony Ramine
f2aaba685b Kill side keywords from style::values::specified::image 2017-05-15 15:35:31 +02:00
Anthony Ramine
1c54758ad6 Introduce style::values::generics::image 2017-05-15 15:35:26 +02:00
Fabrice Desré
990b85049e Ignore mime type parameters in nosniff
This patch implements the following changes:
- Only check for the toplevel/sublevel part of the mime type when
  deciding if it's a js or css resource, ignoring the mime parameters.
- Fix the wpt tests that did not escape url parameters properly and
  also used an invalid syntax for the mime parameter.
- Update the wpt manifest.
2017-05-15 14:43:45 +02:00
bors-servo
9bc565362b Auto merge of #16866 - MortimerGoro:update_mozjs, r=nox
Update mozjs_sys

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

See https://github.com/servo/mozjs/pull/118

Required for https://github.com/servo/servo/issues/11921

---
<!-- 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/16866)
<!-- Reviewable:end -->
2017-05-15 07:32:11 -05:00
Imanol Fernandez
4916048924 Update mozjs_sys 2017-05-15 13:21:06 +02:00
bors-servo
5cd8265f9a Auto merge of #16835 - ferjm:bug1350175.line.column.css.rules, r=upsuper,SimonSapin
Stylo: Bug 1350175 - Support getting line / column number of CSS rules

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

Bugzilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1350175

<!-- 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/16835)
<!-- Reviewable:end -->
2017-05-15 05:28:50 -05:00
bors-servo
94e977efeb Auto merge of #16863 - birtles:additive-animation, r=hiro
Additive animation

Pull request for [Mozilla bug 1329878](https://bugzilla.mozilla.org/show_bug.cgi?id=1329878).

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Mozilla bug 1329878](https://bugzilla.mozilla.org/show_bug.cgi?id=1329878).
- [X] There are tests for these changes in web-platform-tests

<!-- 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/16863)
<!-- Reviewable:end -->
2017-05-14 23:24:48 -05:00
Brian Birtles
5539728b3c Implement animation addition in Servo_AnimationCompose 2017-05-15 13:11:37 +09:00
Brian Birtles
49bc7b9e69 Add add() method to Animatable interface 2017-05-15 12:53:14 +09:00
Brian Birtles
2f07b29296 Rewrite interpolate() in terms of a more general add_weighted() function
Generalizing the procedure like this will allow us to re-use it for addition of
most types.
2017-05-15 12:26:21 +09:00
bors-servo
8366b4d4f9 Auto merge of #16855 - emilio:rem-root, r=upsuper
style: Set root font-size right after cascading font-size

This way rem in the root element works as expected.

This fixes layout/reftests/css-valuesandunits/unit-rem-root-width.html in Gecko.

<!-- 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/16855)
<!-- Reviewable:end -->
2017-05-14 18:53:28 -05:00
bors-servo
9583aaf21c Auto merge of #16856 - canaltinova:moz-image-region, r=nox
stylo: -moz-image-region shouldn't parse unitless lengths in quirks mode

For clip property, `ClipRectOrAuto` was parsing its lengths without units in quirks mode. But `-moz-image-region` property should reject unitless lengths according to gecko. This fixes a stylo test failure.

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

<!-- 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/16856)
<!-- Reviewable:end -->
2017-05-14 13:03:47 -05:00
Nazım Can Altınova
85fb3efd76
stylo: -moz-image-region shouldn't parse unitless lengths in quirks mode 2017-05-14 21:01:46 +03:00