Commit graph

15974 commits

Author SHA1 Message Date
J. Ryan Stinnett
d76abed401 Update Stylo bindings 2017-08-22 11:00:56 -05:00
bors-servo
8ca9542de6 Auto merge of #18134 - servo:we-are-leaving-babylon, r=emilio
Introduce values::animated::Animate

<!-- 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/18134)
<!-- Reviewable:end -->
2017-08-22 07:22:10 -05:00
Emilio Cobos Álvarez
fcd6e79659
style: Inline a bunch of trivial stuff we're paying calls for in Geckolib. 2017-08-22 12:48:14 +02:00
Anthony Ramine
aea0cd7ec7 Introduce values::animated::Animate
This replaces the Animatable trait and merges its three former methods into a single one.
2017-08-22 09:41:01 +02:00
Anthony Ramine
0cceeb9d5c Simplify add_weighted_with_initial_val 2017-08-21 23:48:59 +02:00
Anthony Ramine
54dc3e1670 Clean up filter animations 2017-08-21 23:48:58 +02:00
Anthony Ramine
baf3597477 Clean up transform animations 2017-08-21 23:48:58 +02:00
bors-servo
10779f0251 Auto merge of #18077 - glennw:wr-profiling, r=emilio
Add key bindings for more WR debug / profiler options.

<!-- 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/18077)
<!-- Reviewable:end -->
2017-08-21 16:11:20 -05:00
bors-servo
181f41ed37 Auto merge of #18168 - mantaroh:stroke-distance, r=nox
Add ComputeSquaredDistance trait for SvgLengthOrPercentageOrNumber

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

This patch will add ComputeSquaredDistance trait for SvgLengthOrPercentageOrNumber in order to calculating distance between LengthOrPercentage and Number.

---
<!-- 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 already these tests in dom/smil/tests of gecko, this PR will enable these tests.
For detail, see https://bugzilla.mozilla.org/show_bug.cgi?id=1387986.

<!-- 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-21 14:35:09 -05:00
Mantaroh Yoshinaga
d5cfa1395b Add ComputeSquaredDistance trait for SvgLengthOrPercentageOrNumber.
Currently, Servo uses ComputeSquaredDistance derive for
SvgLengthOrPercentageOrNumber, so servo can't calculate between
LengthOrPercentage and Number.
This PR will allow calculating these value.
2017-08-22 04:20:12 +09:00
bors-servo
05f2001914 Auto merge of #18173 - emilio:invalidation-dirty-thingie, r=bholley
style: Keep dirty bit invariants during invalidation.

There's the question of whether should we be recursing into the invalidation
code for elements without data... Probably not, but that's a somewhat more
risky change.

Bug: 1391444

<!-- 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/18173)
<!-- Reviewable:end -->
2017-08-21 13:21:20 -05:00
Emilio Cobos Álvarez
293274fa5e
style: Make sure to set the initial value of the transition even if we don't start it.
Otherwise we may get to the end of it directly, which is far from what we want.
2017-08-21 17:58:45 +02:00
Emilio Cobos Álvarez
85996826ab
style: Remove Stylist::is_device_dirty.
More progress on unifying how Gecko and Servo track stylist dirtiness.
2017-08-21 17:58:43 +02:00
Emilio Cobos Álvarez
aa0c320f4f
style: Keep dirty bit invariants during invalidation.
There's the question of whether should we be recursing into the invalidation
code for elements without data... Probably not, but that's a somewhat more
risky change.

Bug: 1391444
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-21 17:54:12 +02:00
bors-servo
d4e43d9d76 Auto merge of #18169 - upsuper:write-css-fix, r=nox
Add whitespace before line number in grid line

This is a followup fix of #18159 where the space was incorrectly removed.

<!-- 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/18169)
<!-- Reviewable:end -->
2017-08-21 07:49:11 -05:00
Xidorn Quan
afc9323b7c Add whitespace before line number in grid line 2017-08-21 22:21:51 +10:00
bors-servo
430b171f88 Auto merge of #18139 - upsuper:parser-state, r=SimonSapin
Update parser state only after rule is successfully parsed

This is expected to fix several web-platform tests mentioned in [bug 1389187](https://bugzilla.mozilla.org/show_bug.cgi?id=1389187).

<!-- 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/18139)
<!-- Reviewable:end -->
2017-08-21 06:46:11 -05:00
bors-servo
6a1b0d0526 Auto merge of #18159 - upsuper:write-to-css, r=nox
Replace write! with to_css and write_str in some ToCss impls

Some of this is necessary for fixing things like [bug 1370779](https://bugzilla.mozilla.org/show_bug.cgi?id=1370779) because otherwise we would still not be using the new numeric serialization algorithm from cssparser crate.

<!-- 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/18159)
<!-- Reviewable:end -->
2017-08-21 04:14:08 -05:00
bors-servo
a1006a52a7 Auto merge of #18149 - paulrouget:hittest-issue, r=cbrewster
make sure proper frame tree is sent when iframes change

We ran into a hittest issue because the frame tree was not correctly updated after #17425.

The frame tree should be updated on tab change (via send_frame_tree) or when the frame sub tree changes and it's the active one (via update_frame_tree_if_active).

---
<!-- 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 #18101 (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/18149)
<!-- Reviewable:end -->
2017-08-21 03:02:21 -05:00
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