Commit graph

16155 commits

Author SHA1 Message Date
Paul Rouget
4edac8e63c make sure proper frame tree is sent when iframes change 2017-08-21 09:42:15 +02:00
Brian Birtles
4f53ca2e39 Expand var() references in single_value_to_css
This is a temporary step needed to support Gecko's getKeyframes() API
until we implement bug 1391537. It only takes effect when
a ComputedValues object is supplied and only for longhand declarations.
2017-08-21 12:59:53 +09:00
bors-servo
87206bd68e Auto merge of #18153 - emilio:restyle-damage-cleanup, r=heycam
stylo: Remove a lot of the restyle damage related complexity.

The only reason why we had the `existing_style_for_style_damage` bit is to apply
some optimizations that we don't have anymore.

I still want to reintroduce a few of them, at least for the non-eager
pseudo-element case... But I think I won't need this at all.

This allows us to remove a fair amount of Gecko code too.

<!-- 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: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./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/18153)
<!-- Reviewable:end -->
2017-08-20 07:00:25 -05:00
Emilio Cobos Álvarez
0f37b209cb
stylo: Remove a lot of the restyle damage related complexity.
The only reason why we had the `existing_style_for_style_damage` bit is to apply
some optimizations that we don't have anymore.

I still want to reintroduce a few of them, at least for the non-eager
pseudo-element case... But I think I won't need this at all.

This allows us to remove a fair amount of Gecko code too.
2017-08-20 13:59:46 +02:00
Xidorn Quan
7e92c15e00 Replace write! with to_css and write_str in some ToCss impls 2017-08-20 17:21:08 +10:00
bors-servo
4f3fb904ae Auto merge of #18158 - emilio:pseudo-crash, r=heycam
style: Skip state pseudo-classes when finding a pseudo-element.

Bug: 1391577
Reviewed-by: heycam
MozReview-Commit-ID: 1ICBijtcf2b
2017-08-20 02:14:08 -05:00
Emilio Cobos Álvarez
9e0dd19e7e
style: Skip state pseudo-classes when finding a pseudo-element.
Bug: 1391577
Reviewed-by: heycam
MozReview-Commit-ID: 1ICBijtcf2b
2017-08-20 09:12:57 +02:00
Xidorn Quan
c15ae3b6b4 Update parser state only after rule is successfully parsed 2017-08-20 10:44:32 +10:00
Boris Chiou
4ed1a6be20 Fix the identity transform of rotatex and rotatey.
Let's see the example: "rotatex(360deg)" to "none".

While we do interpolation between "rotatex" and "none", the original code
path is:
1. Build an identity transform for none and always use (0, 0, 1) as the
   direction vector, i.e. Rotate(0, 0, 1, 0deg).
2. Do interpolation between rotatex (i.e. Rotate(1, 0, 0, 360deg)) and
   Rotate(0, 0, 1, 0deg). Because their direction vectors are different,
   so we do matrix decomposition/interpolation/recomposition on both
   functions. The problem is, matrix decomposition makes the 360deg
   disappear, so it looks like "rotatex(0deg)".
3. Obviously, we are trying to interpolate from rotatex(0deg) to none, so
   the interpolated matrix is always an identity matrix.

I think rotatex, rotatey, and rotatez are special cases which should
really rotate according to the angle, so we should build the identity
transform for them according to the normalized direction vector, and so we do
interpolation on the angle, instead of converting them into matrix.

Replacing build_identity_transform_list() with
add_weighted_transform_lists(list, list, 0, 0) might be another solution;
However, I didn't do that because build_identity_transform_list() is
much simpler.
2017-08-20 02:26:18 +08:00
Boris Chiou
03cf0a8cb8 Fix divided by zero problem on non-normalizable direction vector.
While normalizing the direction vector, we have to make sure we don't
divide the components by zero length to avoid any assertion of "NaN".
2017-08-20 02:26:08 +08:00
bors-servo
c1b196b7cb Auto merge of #18148 - tamird:computedvalues-arc-borrow, r=emilio
style: pass a borrow instead of an Arc

https://bugzilla.mozilla.org/show_bug.cgi?id=1380133 has landed,
permitting us to pass a plain borrow into Gecko_CalcStyleDifference;
propagate this through style.

Closes #17795.

- [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/18148)
<!-- Reviewable:end -->
2017-08-19 08:51:16 -05:00
bors-servo
0b45a4f651 Auto merge of #18136 - upsuper:shadow-color, r=emilio
Use Option<RGBA> for color in shadow

This fixes [bug 1390697](https://bugzilla.mozilla.org/show_bug.cgi?id=1390697) by downgrading the support of currentcolor in shadow to what Gecko currently supports.

<!-- 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/18136)
<!-- Reviewable:end -->
2017-08-19 05:45:53 -05:00
Tamir Duberstein
c348d5afb3
style: pass a borrow instead of an Arc
https://bugzilla.mozilla.org/show_bug.cgi?id=1380133 has landed,
permitting us to pass a plain borrow into Gecko_CalcStyleDifference;
propagate this through style.

Closes #17795.
2017-08-19 03:24:46 -07:00
bors-servo
9f64630eaa Auto merge of #17521 - KiChjang:update-fetch, r=jdm
Update fetch methods

Includes updates to main fetch, scheme fetch, HTTP fetch, HTTP-redirect fetch, HTTP-network fetch, HTTP-network-or-cache fetch and CORS preflight fetch.

<!-- 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/17521)
<!-- Reviewable:end -->
2017-08-18 18:39:02 -05:00
Keith Yeung
4a4caa8583 Update CORS preflight fetch 2017-08-18 16:30:22 -07:00
Keith Yeung
34178bdd4c Update HTTP-network fetch 2017-08-18 16:30:19 -07:00
Keith Yeung
99f59352b8 Update HTTP-network-or-cache fetch 2017-08-18 16:30:16 -07:00
Keith Yeung
5b69d18fca Add location_url to Metadata struct 2017-08-18 16:30:14 -07:00
Keith Yeung
d6c197b40c Update HTTP-redirect fetch 2017-08-18 16:30:06 -07:00
bors-servo
62d0de349d Auto merge of #18056 - cynicaldevil:remove-treesink-dep-on-dom, r=nox
End TreeBuilder's reliance on DOM.

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

Fixed h5e's TreeBuilder so that it does not use `same_tree` and `has_parent_node` methods: d8c2ea5cb6
<!-- 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/18056)
<!-- Reviewable:end -->
2017-08-18 16:27:05 -05:00
bors-servo
9bf70d4865 Auto merge of #18144 - canaltinova:legacy-position-x, r=emilio
Handle single X keyword value in LegacyPosition

This is reviewed by emilio in bugzilla.

---
<!-- 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 1391432](https://bugzilla.mozilla.org/show_bug.cgi?id=1391432)

<!-- 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/18144)
<!-- Reviewable:end -->
2017-08-18 15:28:37 -05:00
bors-servo
4918d3f148 Auto merge of #18146 - cbrewster:insertadjacenthtml_cereactions, r=jdm
Annotate insertAdjacentHTML with CEReactions

<!-- 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
- [ ] 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/18146)
<!-- Reviewable:end -->
2017-08-18 14:09:15 -05:00
Connor Brewster
9c6292f294 Annotate insertAdjacentHTML with CEReactions 2017-08-18 13:59:53 -05:00
Nazım Can Altınova
692d009e32 Handle single X keyword value in LegacyPosition 2017-08-18 11:06:58 -07:00
bors-servo
941e0dbb5a Auto merge of #18142 - emilio:less-mess-ns, r=SimonSapin
style: Less messy namespace handling.

This PR accounts for the fact that the namespace table is only needed in
`NestedRuleParser`, and only for style rules, in order to simplify the setup and
be able to fix a few bugs wrt parsing of invalid 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/18142)
<!-- Reviewable:end -->
2017-08-18 12:58:46 -05:00
Emilio Cobos Álvarez
62d42a090b
style: Fix namespace handling during keyframe parsing. 2017-08-18 19:58:00 +02:00
Emilio Cobos Álvarez
a962c54928
style: Cleanup ParserContext::new_with_rule_type. 2017-08-18 19:57:59 +02:00
Nikhil Shagrithaya
2cc7199f42 TreeSink impls do not explicitly rely on and methods anymore 2017-08-18 19:55:34 +05:30
Nikhil Shagrithaya
99235c9201 Updated h5e and x5e 2017-08-18 19:51:17 +05:30
Xidorn Quan
4e0b1071e7 Use Option<RGBA> for color in shadow 2017-08-19 00:20:24 +10:00
Emilio Cobos Álvarez
4763d05cf0
style: A few minor formatting cleanups. 2017-08-18 16:10:41 +02:00
Emilio Cobos Álvarez
48ce204cb2
style: Less messy namespace handling.
This PR accounts for the fact that the namespace table is only needed in
`NestedRuleParser`, and only for style rules, in order to simplify the setup and
be able to fix a few bugs wrt parsing of invalid rules.
2017-08-18 16:10:29 +02:00
bors-servo
81a382cb00 Auto merge of #18124 - emilio:stylist-stylesheets, r=SimonSapin
style: Replicate the list of stylesheets on the layout thread.

This is a patch that unifies a bit how Gecko and Stylo stylesheets work, in
order to be able to eventually move the stylesheets into the stylist, and be
able to incrementally update the invalidation map.

This is on top of #18113

<!-- 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/18124)
<!-- Reviewable:end -->
2017-08-18 08:33:35 -05:00
Emilio Cobos Álvarez
d1725b1f19
style: Replicate the list of stylesheets on the layout thread.
This is a patch that unifies a bit how Gecko and Stylo stylesheets work, in
order to be able to eventually move the stylesheets into the stylist, and be
able to incrementally update the invalidation map.
2017-08-18 14:31:35 +02:00
bors-servo
0fcbcf7fc5 Auto merge of #18138 - glennw:update-wr-remove-webgl, r=jdm
Update WR (remove internal webgl implementation).

<!-- 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/18138)
<!-- Reviewable:end -->
2017-08-18 06:55:43 -05:00
bors-servo
92176d1152 Auto merge of #18131 - emilio:calc-serialization, r=canaltinova
style: Multiple calc serialization fixes.

This puts us in line with the spec as written, except for caveat in https://github.com/w3c/csswg-drafts/issues/1731.

Need to fix computed calc() too, I'm less confident that we won't need to change test expectations.

<!-- 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/18131)
<!-- Reviewable:end -->
2017-08-18 04:42:12 -05:00
Emilio Cobos Álvarez
6df597b0b8
style: Use Au::abs. 2017-08-18 11:06:39 +02:00
Emilio Cobos Álvarez
7bf1748c34
style: update app_units. 2017-08-18 11:06:37 +02:00
Emilio Cobos Álvarez
22d6a73436
style: Make computed serialization of calc() match the spec too. 2017-08-18 11:06:36 +02:00
Emilio Cobos Álvarez
1d54a8e857
style: Add a note about weirdness in serialization of computed calc(). 2017-08-18 11:06:34 +02:00
Emilio Cobos Álvarez
e05c673df3
style: Serialize percentages first in specified calc() expressions. 2017-08-18 11:06:32 +02:00
Emilio Cobos Álvarez
f8a6eccda2
style: Update calc() serialization to the spec. 2017-08-18 11:06:31 +02:00
bors-servo
494dcd7e52 Auto merge of #18086 - BorisChiou:stylo/transform/distance, r=nox,birtles
stylo: Bug 1362896 - Implement ComputeSquaredDistance for TransformList

We implement ComputeSquaredDistance for TransformList.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1362896](https://bugzilla.mozilla.org/show_bug.cgi?id=1362896).
- [X] These changes do not require tests because Gecko has related 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/18086)
<!-- Reviewable:end -->
2017-08-18 02:24:33 -05:00
bors-servo
d17f27640b Auto merge of #17704 - mantaroh:interpolate-stroke, r=nox
Add animation value related with stroke-dasharray / stroke-dashoffset / stroke-width.

<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1369614

This patch will:
 * Add animation value conversion of LengthOrPercentage in order to interpolate length and number.
 * Add animation value of Vec<LengthOrPercentage> in order to interpolate the stroke-dasharray.

Spec is as follow:
https://svgwg.org/svg2-draft/painting.html#StrokeDashing

---
<!-- 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: -->
There are tests for these changes, a test case will be landed in wpt in https://bugzilla.mozilla.org/show_bug.cgi?id=1369614.

<!-- 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/17288)
<!-- Reviewable:end -->
2017-08-17 23:39:00 -05:00
bors-servo
489b25004b Auto merge of #18137 - bholley:thread_pool_parent_process, r=upsuper
Avoid creating a stylo thread pool in e10s parent processes

Reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1375911

<!-- 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/18137)
<!-- Reviewable:end -->
2017-08-17 22:28:34 -05:00
Glenn Watson
73fe2f0e96 Update WR (remove internal webgl implementation). 2017-08-18 13:09:51 +10:00
Bobby Holley
d2842daa2d Avoid creating a stylo thread pool in e10s parent processes.
MozReview-Commit-ID: LW92yNDKZf4
2017-08-17 19:14:16 -07:00
bors-servo
90a75d41b7 Auto merge of #18092 - cbrewster:ce_domtokenlist, r=jdm
Only run DOMTokenList update steps if token was found

<!-- 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
- [ ] 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/18092)
<!-- Reviewable:end -->
2017-08-17 21:00:10 -05:00
Mantaroh Yoshinaga
1c574cf93b Add SVGLengthOrPercentageOrNumber for stroke-*.
We need to use enum instead of Either since we can't interpolate stroke-* between
unitless length and unit length(e.g. '5' -> '10px').

This coomit make following:

 * Introduce SVGLengthOrPercentageOrNumber on computed and specified values.
 * Make SVGLengthOrPercentageOrNumber animatable.
 * Make stroke-dasharray not-accumulate.
2017-08-18 10:28:11 +09:00
bors-servo
12607531d8 Auto merge of #18123 - mrobinson:absolute-containing-blocks, r=pcwalton
Improve containing block creation for position:absolute flows

Instead of only promoting flows with positioned fragments to containing
blocks, also do this for flows which have the transform, perspective or
filter properties set. This is what the spec requires and also fixes
some failing tests. It will allow us to stop creating stacking contexts
for overflow:hidden and overflow:scroll flows.

Fixes #18091.

<!-- 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 #18091  (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/18123)
<!-- Reviewable:end -->
2017-08-17 19:42:20 -05:00