Commit graph

12672 commits

Author SHA1 Message Date
bors-servo
06f99c13f2 Auto merge of #15913 - emilio:viewport-size, r=heycam,hiro
Use the proper viewport size for stylo

Reviewed upstream at [bug 1303229](https://bugzil.la/1303229).

<!-- 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/15913)
<!-- Reviewable:end -->
2017-03-11 04:40:31 -08:00
Emilio Cobos Álvarez
396fb62ca8
Bug 1303229: Get the proper viewport size for animations. r=hiro,heycam
While we're here, don't re-recompute the default computed values, just grab them
from the device.

MozReview-Commit-ID: GqqnPLIwN2F
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-11 11:54:14 +01:00
Emilio Cobos Álvarez
95ccfa748e
Bug 1303229: Get the proper viewport size for stylo. r=heycam
At least until we support scrollbars properly, this size is going to be the
correct one. I've left a TODO to grab the proper one once we support it.

This allows to trivially test viewport units for now.

MozReview-Commit-ID: JdaZ6WlZ2C6
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-03-11 11:54:12 +01:00
Emilio Cobos Álvarez
4bafdedf64
layout: Merge inline nodes based on node address, not node style. 2017-03-11 11:31:12 +01:00
Emilio Cobos Álvarez
6f134892da
layout: Reflow some code and comments in layout/inline.rs 2017-03-11 11:31:11 +01:00
Emilio Cobos Álvarez
ebdc6f69b1
gfx: Show the text in the display item when debugging. 2017-03-11 11:31:11 +01:00
Emilio Cobos Álvarez
58c6aad1f0
style: Add the traversal kind to the style stats. 2017-03-11 11:31:11 +01:00
Emilio Cobos Álvarez
d3e7f1f0f4
style: Iterate the LRU cache contents from back to front.
We put the more recently used item last, so iterating then from left to right is
pointless.
2017-03-11 11:31:10 +01:00
Cameron McCormack
c0996c6536 stylo: Align eRestyle_Subtree value with RESTYLE_DESCENDANTS.
Handle the translation of eRestyle_Subtree into
(RESTYLE_SELF | RESTYLE_DESCENDANTS) in the From impl, too.
2017-03-11 09:33:55 +08:00
bors-servo
c90d3d2f06 Auto merge of #15889 - ferjm:issue-14519-cors-preflight, r=avadacatavra
Allow for redirects after a CORS-preflight

~Continue the work done in #14811 and #15547~. And applies the Fetch [spec change](0d9a4db8bc) about [allowing redirects after CORS preflights](https://github.com/whatwg/fetch/issues/204).

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix ~#14787 and~ #14519
- [X] There are tests for these changes. Several WPTs go from FAIL to SUCCESS. The new expected FAILs for the cors/redirect-preflight.htm tests are caused by the spec change done [here](0d9a4db8bc), as suggested in the associated [issue](https://github.com/servo/servo/issues/14519#issuecomment-284384667).

<!-- 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/15889)
<!-- Reviewable:end -->
2017-03-10 07:49:35 -08:00
Fernando Jiménez Moreno
469eb192c5 Allow for redirects after a CORS-preflight 2017-03-10 16:39:33 +01:00
bors-servo
7af2f819be Auto merge of #15908 - canaltinova:single-keywords, r=emilio
Fix wrong initial values in various single keyword properties

In `single_properties` helper, first values set as initial value. But it seems like a problem here because it's not clear to anyone who don't know the working mechanism of this helper or it can be easily forgotten. Maybe we should make it explicit. I was fixing Bug 1331516 but expanded to cover all single keyword properties.

Also discovered that mask-repeat's initial value is [wrong](https://bugzilla.mozilla.org/show_bug.cgi?id=1346193) in gecko.

---
<!-- 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] This PR started to fix [Bug 1331516](https://bugzilla.mozilla.org/show_bug.cgi?id=1331516) but expanded to cover all single keyword properties afterwards.

<!-- 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/15908)
<!-- Reviewable:end -->
2017-03-10 06:52:51 -08:00
Nazım Can Altınova
bae7c50ef7
Fix wrong initial values in various single keyword properties 2017-03-10 17:18:22 +03:00
bors-servo
c584f3967c Auto merge of #15892 - hgallagher1993:local_branch, r=emilio
Change while loop in HTMLImageElement::handle_event to for loop

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because @Ms2ger said none were needed

<!-- 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/15892)
<!-- Reviewable:end -->
2017-03-10 05:51:45 -08:00
Hugh Gallagher
97e7c6be29 Change while loop in HTMLImageElement::handle_event to for loop
Remove trailing whitespace
2017-03-10 13:48:35 +00:00
bors-servo
b97b0fd7cc Auto merge of #15899 - glennw:wr-update-premultiply, r=nox
Update WR (pre-multiplied alpha)

<!-- 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/15899)
<!-- Reviewable:end -->
2017-03-10 02:27:23 -08:00
bors-servo
a11a3fe68b Auto merge of #15903 - servo:set-origin-header, r=Wafflespeanut
Set Origin header in http_network_or_cache_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/15903)
<!-- Reviewable:end -->
2017-03-09 22:15:11 -08:00
rabisg
de2b9b7707 Fixes #14787: Set Origin header in http_network_or_cache_fetch
Sets Origin header on request with CORS flag set or on requests other
than those with GET/HEAD methods
2017-03-10 11:44:21 +05:30
bors-servo
72128de681 Auto merge of #15901 - upsuper:text-align-last, r=Manishearth
Restore text-align-last removed in #15839 by mistake

<!-- 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/15901)
<!-- Reviewable:end -->
2017-03-09 21:03:10 -08:00
Xidorn Quan
4a897b25dc Restore text-align-last removed in #15839 by mistake 2017-03-10 15:35:24 +11:00
bors-servo
63bed27073 Auto merge of #15900 - hiikezoe:process-css-animations, r=heycam
Process css animations for gecko

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

---
<!-- 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
- [X] These changes do not require tests because it's for stylo

<!-- 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/15900)
<!-- Reviewable:end -->
2017-03-09 20:23:21 -08:00
bors-servo
8b8eb5e192 Auto merge of #15896 - canaltinova:flex-basis, r=Manishearth
Change the predefined type of flex-basis and make gecko glue auto-generate

Gecko [doesn't support](https://bugzilla.mozilla.org/show_bug.cgi?id=1105111) content value in flex-basis yet. We had to change the predefined type to `LengthOrPercentageOrAuto` in stylo build.

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

<!-- Either: -->
- [X] These changes do not require tests because it's stylo glue change.

<!-- 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/15896)
<!-- Reviewable:end -->
2017-03-09 18:46:37 -08:00
Hiroyuki Ikezoe
f2c547aaaf Call UpdateAnimations even if the element has no computed values. 2017-03-10 11:37:06 +09:00
Hiroyuki Ikezoe
c32ba98031 Skip update_animations if we have no running animations and the element becomes display:none. 2017-03-10 11:37:05 +09:00
Hiroyuki Ikezoe
9ff99d4608 Update CSS animations in a SequentialTask.
We create the SequentialTask only if:

* We have no old computed values and we have animation name style in the new
  computed values.
* Any animation properties is changed.
* display property is changed from 'none' and we have animation name style.
* display property is changed to 'none'.

In a subsequent patch we skip the SequentialTask if we have no running
animations and the display propery is changed to 'none'.
2017-03-10 11:36:58 +09:00
Glenn Watson
2b4511e3c6 Update WR (pre-multiply images). 2017-03-10 12:33:55 +10:00
Hiroyuki Ikezoe
fdb8c48094 Split off animation related process in a function. 2017-03-10 11:09:18 +09:00
Hiroyuki Ikezoe
22de4dc7a6 Add a utility function to convert PseudoElement to nsIAtom*.
MozReview-Commit-ID: 14qYFpiW0iG
2017-03-10 11:08:58 +09:00
Hiroyuki Ikezoe
d8f08b80e0 Implement Gecko_StyleAnimationsEquals for checking nsStyleAutoArray<StyleAnimation> equality in servo side.
Later we update CSS animations if this function returns false.
2017-03-10 11:07:18 +09:00
bors-servo
d124297456 Auto merge of #15839 - chenpighead:stylo-text-justify, r=upsuper
Stylo - gecko glue code for text-justify

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

Implement gecko glue for text-justify property.

Gecko has supported text-justify in [Bug 276079](https://bugzilla.mozilla.org/show_bug.cgi?id=276079), and going to pref-on on Nightly very soon in [Bug 1343512](https://bugzilla.mozilla.org/show_bug.cgi?id=1343512). Let's make it work for stylo.

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

<!-- 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/15839)
<!-- Reviewable:end -->
2017-03-09 17:57:15 -08:00
Hiroyuki Ikezoe
2892071ce7 Update bindings. 2017-03-10 10:55:00 +09:00
Jeremy Chen
6ff62b1c36 Stylo - gecko glue code for text-justify 2017-03-10 09:34:47 +08:00
bors-servo
8f7c69e15f Auto merge of #15783 - ferjm:issue15756-parse-hosts, r=avadacatavra
Replace manual host parsing code with parse-host crate

This patch is replacing the code to parse the hosts file with the [parse-hosts](https://crates.io/crates/parse-hosts) crate. This crate has a [CC0 1.0 Universal License](https://creativecommons.org/publicdomain/zero/1.0/deed.en).

I could have used [HostsFile::load()](https://clarcharr.github.io/parse-hosts/parse_hosts/struct.HostsFile.html#method.load) directly, but this method loads `/etc/hosts` by default and does not allow to override the default path (for example with [env::var("HOST_FILE")](https://dxr.mozilla.org/servo/source/components/net_traits/hosts.rs#19)), so I kept the existing code to open and read the content of `env::var("HOST_FILE")` and also kept the [parse_hostsfile](https://dxr.mozilla.org/servo/source/components/net_traits/hosts.rs#42) method (used by the unit tests), but I modified it to use [HostsFile::read_buffered](https://clarcharr.github.io/parse-hosts/parse_hosts/struct.HostsFile.html#method.read_buffered), which is doing the actual hosts parsing for a given string buffer.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #15756 .
- [X] There are tests for these changes (tests/unit/net/resource_thread.rs and tests/unit/net/http_loader.rs)

<!-- 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/15783)
<!-- Reviewable:end -->
2017-03-09 17:17:14 -08:00
Jamie Nicol
ec3142e811 Premultiply RGBA image data before sending to webrender 2017-03-10 11:06:44 +10:00
Nazım Can Altınova
aa5477bd34
Change predefined type of flex-basis / make gecko glue auto-generate
Gecko doesn't support content value in flex-basis yet.
2017-03-10 03:14:06 +03:00
bors-servo
ee223798cc Auto merge of #15893 - Manishearth:stylo-svg-pres, r=bz
Support SVG presentation attributes

r=bz from https://bugzilla.mozilla.org/show_bug.cgi?id=1329093

<!-- 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/15893)
<!-- Reviewable:end -->
2017-03-09 15:02:06 -08:00
Manish Goregaokar
eda6a4fc4f stylo: Pass parser URL data in Servo_DeclarationBlock_SetProperty*
MozReview-Commit-ID: EVk4aEoyiXv
2017-03-09 14:44:17 -08:00
Fernando Jiménez Moreno
79b7b9de54 Replace manual host parsing code with parse-host crate 2017-03-09 22:20:09 +01:00
Manish Goregaokar
14d8eb93ba stylo: Handle SVG presentation attributes 2017-03-09 12:23:30 -08:00
bors-servo
5c46e86546 Auto merge of #15888 - emilio:caching, r=Ms2ger
style: Simplify style sharing code.

No functional changes, just some code 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/15888)
<!-- Reviewable:end -->
2017-03-09 11:33:33 -08:00
Emilio Cobos Álvarez
727be58b4a
style: Simplify style sharing code. 2017-03-09 19:31:03 +01:00
bors-servo
e7efdfc655 Auto merge of #15869 - Iakis:NegBordRad, r=Wafflespeanut
Reject negative border radius

Replacerd Parse in parse_one_set_of_border_values with parse_non_negative and added tests for it
---
<!-- 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 #15345 (github issue number if applicable).

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

<!-- 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/15869)
<!-- Reviewable:end -->
2017-03-09 04:52:35 -08:00
#
f5253c9f09 Fix and tests for negative border radius 2017-03-09 07:48:51 -05:00
bors-servo
802440dbf0 Auto merge of #15879 - glennw:update-wr-scroll, r=mrobinson
Update WR (scroll root changes, border gradients, yuv updates).

<!-- 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/15879)
<!-- Reviewable:end -->
2017-03-08 23:43:10 -08:00
Glenn Watson
ce49bc5f89 Update WR (scroll root changes, border gradients, yuv updates). 2017-03-09 16:01:47 +10:00
bors-servo
dc3b32c853 Auto merge of #15861 - projektir:make-text-decoration-testable, r=Wafflespeanut
Make text decoration testable and do not serialize initial text-decoration-style

Servo now uses the same name for the text-decoration-line longhand property as Gecko. This was done to enable testing of the text-decoration shorthand.

The text-decoration shorthand has been fixed to not serialize initial text-decoration-style.

---

- [x ] `./mach build -d` does not report any errors
- [x ] `./mach test-tidy` does not report any errors
- [x ] These changes fix #15790

---

- [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/15861)
<!-- Reviewable:end -->
2017-03-08 21:39:30 -08:00
projektir
b4c50de31e Don't serialize initial text-decoration-style #15790 2017-03-09 00:33:17 -05:00
bors-servo
5fe921f2ab Auto merge of #15844 - notriddle:domain_match_lowercase, r=nox
Assert that `domain_match` is operating on lowercase text

> (Note that both the domain string and the string will have been
> canonicalized to lower case at this point.)

Related to #15789

<!-- 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/15844)
<!-- Reviewable:end -->
2017-03-08 18:18:16 -08:00
Michael Howell
b0499e3422 Assert that domain_match is operating on lowercase text
> (Note that both the domain string and the string will have been
> canonicalized to lower case at this point.)

Related to #15789
2017-03-09 02:18:02 +00:00
Glenn Watson
034feafa8c Update WR (types updates, stacking context culling) 2017-03-09 10:32:40 +10:00