Commit graph

25367 commits

Author SHA1 Message Date
bors-servo
dc594face8 Auto merge of #15794 - paulrouget:head_parsed_url, r=asajeffrey
Notify embedder when history changes

`WindowMethods::set_page_url` is only called when the embedder set the URL. It is not called when the page url is updated. I believe that instead we should just pass the URL to `head_parsed`.

---
<!-- 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 #15439 #15643 and #15642 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because I'm not sure how to test that

<!-- 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/15794)
<!-- Reviewable:end -->
2017-04-25 14:14:31 -05:00
bors-servo
7aeed78eef Auto merge of #16570 - Manishearth:scriptmin-parent, r=heycam
Compute scriptminsize against the parent font base size

It's supposed to be, because it is used in the computation of the font size, so we can't have the current font size as a dependency.

http://searchfox.org/mozilla-central/rev/7aa21f3b531ddee90a353215bd86e97d6974e25b/layout/style/nsRuleNode.cpp#3842

<!-- 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/16570)
<!-- Reviewable:end -->
2017-04-25 13:06:23 -05:00
bors-servo
3c7c960e11 Auto merge of #16444 - Wafflespeanut:generics, r=emilio
Cleanup various modules and introduce generic types

Almost all the types in `values/specified` and `values/computed` share their `ToCss` implementations. The only reason they have duplicated code hanging around is a result of different specified and computed forms for types like `LengthOrPercentage`. This PR makes some of these types *generic* so that we could have a common definition and `ToCss` impl (`Parse` and `ToComputedValue` impls too, if possible).

<!-- 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/16444)
<!-- Reviewable:end -->
2017-04-25 07:29:33 -05:00
Ravi Shankar
d56aec4109 Make ShapeSource generic 2017-04-25 17:42:02 +05:30
Ravi Shankar
24226af794 Make InsetRect generic 2017-04-25 17:40:41 +05:30
Ravi Shankar
63965f55f5 Make use of predefined_type for some aliased types 2017-04-25 17:40:39 +05:30
Ravi Shankar
61a17993eb Cleanup position and make use of generic Position for its users 2017-04-25 17:32:45 +05:30
Ravi Shankar
3f53fb148d Add generic versions of Position structs 2017-04-25 17:13:47 +05:30
Ravi Shankar
6f062e5857 Add a generic PositionValue struct 2017-04-25 17:13:46 +05:30
Ravi Shankar
f4b18643c2 Cleanup Polygon and make it generic 2017-04-25 17:13:45 +05:30
Ravi Shankar
a36bf9efc4 Make ShapeRadius generic 2017-04-25 17:13:44 +05:30
Ravi Shankar
b2b3f99427 Make BorderRadius generic 2017-04-25 17:13:42 +05:30
Ravi Shankar
0249270f61 Create a module for generics and make BorderRadiusSize generic 2017-04-25 17:13:41 +05:30
bors-servo
c5c6e8c442 Auto merge of #16600 - KiChjang:update-rust-mozjs, r=Wafflespeanut
Update rust-mozjs

<!-- 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/16600)
<!-- Reviewable:end -->
2017-04-25 01:51:11 -05:00
Keith Yeung
55539633b4 Update rust-mozjs 2017-04-24 23:46:16 -07:00
bors-servo
f3c1bbe070 Auto merge of #16598 - aacunningham:fix-build-errors, r=jdm
Fix various build warnings

This removes six separate warnings when building servo. One of
the warnings was an unused mut, and the other were various dead code
warnings

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because they address warnings from the build process

<!-- 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/16598)
<!-- Reviewable:end -->
2017-04-25 01:02:56 -05:00
Aaron Cunningham
f03ddf6c6c Fix various build warnings
This should remove six separate warnings when building servo. One of
the warnings was an unused mut, and the other were various dead code
warnings
2017-04-24 22:54:06 -07:00
bors-servo
fffb94530e Auto merge of #16596 - Manishearth:length-parsing, r=heycam
Handle length parsing mode for other types too

All length types should handle this. Seems to block a couple tests.

try at https://treeherder.mozilla.org/#/jobs?repo=try&revision=b1eb64509e65f9dc548d361ac2ae00ce000c9d7b

<!-- 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/16596)
<!-- Reviewable:end -->
2017-04-24 22:03:12 -05:00
bors-servo
ef5c61e833 Auto merge of #16586 - chenpighead:stylo-moz-border-colors-support, r=heycam
Stylo: add -moz-border-*-colors support

In Gecko, we use double pointers to nsBorderColors to store -moz-border-*-colors.
We can simplify the implementation of computed value in Servo by using Option<Vec>.
As to passing computed values from Servo to Gecko, we might need to use some
binding functions (pre-added in the same Gecko bug, see Bug 1348173).

Note that we also added -moz-border-*-colors as sub_properties of the 'border'
shorthand, so we can make the 'border' shorthand reset -moz-border-*-colors
(See Gecko Bug 482692).

A bit refactoring of replacing all ["top", "right", "bottom", "left"] with PHYSICAL_SIDES
is included in this patch, since we've already had PHYSICAL_SIDES for a while.

<!-- 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: -->
- [ ] 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/16586)
<!-- Reviewable:end -->
2017-04-24 21:03:52 -05:00
Manish Goregaokar
16390962d6 Handle length parsing mode for other types too
MozReview-Commit-ID: CIJQmx84QB2
2017-04-24 19:01:14 -07:00
Jeremy Chen
13f6cf6e3a Stylo: add -moz-border-*-colors support
In Gecko, we use double pointers to nsBorderColors to store -moz-border-*-colors.
We can simplify the implementation of computed value in Servo by using Option<Vec>.
As to passing computed values from Servo to Gecko, we might need to use some
binding functions (pre-added in the same Gecko bug, see Bug 1348173).

Note that we added -moz-border-*-colors as sub_properties of the 'border'
shorthand, so we can make the 'border' shorthand reset -moz-border-*-colors
(See Gecko Bug 482692). However, since they are Gecko only non-standard properties,
we should skip these sub_properties while doing unit testing in Servo. The test part
should be convered by Stylo/Gecko already.

A bit refactoring of replacing all ["top", "right", "bottom", "left"] with PHYSICAL_SIDES
is included in this patch, since we've already had PHYSICAL_SIDES for a while.
2017-04-25 09:52:19 +08:00
Jeremy Chen
3f3f780ae5 Stylo: update bindings for -moz-border-*-colors support 2017-04-25 09:42:31 +08:00
bors-servo
e3e10ada09 Auto merge of #16589 - servo:cssparserup, r=emilio
Update to cssparser 0.13

https://github.com/servo/rust-cssparser/pull/140

<!-- 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/16589)
<!-- Reviewable:end -->
2017-04-24 18:47:00 -05:00
Simon Sapin
11cef135e7 Update to cssparser 0.13 2017-04-25 01:45:33 +02:00
bors-servo
8efa680774 Auto merge of #16595 - emilio:strings-are-hard, r=Manishearth
stylo: Fix a serialization bug for string pseudos.

The string is null-terminated, so we need to avoid passing that last null
character.

<!-- 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/16595)
<!-- Reviewable:end -->
2017-04-24 12:34:08 -05:00
Emilio Cobos Álvarez
e136863939
stylo: Fix a serialization bug for string pseudos.
The string is null-terminated, so we need to avoid passing that last null
character.
2017-04-24 19:28:11 +02:00
bors-servo
ef3903163d Auto merge of #16530 - metajack:kill-domrectlist, r=nox
Remove DOMRectList and use sequences instead.

DOMRectList was removed last back in 2015. See
https://www.w3.org/Bugs/Public/show_bug.cgi?id=26200 for details.

<!-- 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: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they are covered by existing 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/16530)
<!-- Reviewable:end -->
2017-04-24 10:35:52 -05:00
bors-servo
4263b798ad Auto merge of #16592 - avadacatavra:globalscope, r=jdm
added origin to globalscope

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

---
<!-- 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/16592)
<!-- Reviewable:end -->
2017-04-24 08:54:07 -05:00
bors-servo
46bb635c4c Auto merge of #16587 - hiikezoe:intermediate-rgba, r=birtles,boris
Introduce intermediate rgba

<!-- Please describe your changes on the following line: -->
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1356941
---
<!-- 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] These changes do not require tests because it's for stylo.

<!-- 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/16587)
<!-- Reviewable:end -->
2017-04-24 07:22:39 -05:00
ddh
2c6bd51bef added origin to globalscope 2017-04-24 13:15:42 +01:00
bors-servo
70d7a2be34 Auto merge of #16579 - servo:rustup, r=nox
Upgrade to rustc 1.18.0-nightly (23de823e9 2017-04-23)

<!-- 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/16579)
<!-- Reviewable:end -->
2017-04-24 06:09:25 -05:00
bors-servo
fd7af58bec Auto merge of #16585 - servo:log, r=emilio
Don’t log CSS parsing errors in user-agent stylesheets

This used to make `RUST_LOG=style` basically useless.

<!-- 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/16585)
<!-- Reviewable:end -->
2017-04-24 05:05:51 -05:00
bors-servo
418c3e8cc7 Auto merge of #16541 - sbwtw:fix_calc_behavior, r=stshine
Add calc method for CalcLengthOrPercentage

* Add calc method to calculate formula value with parent size
* Add unit test case

<!-- Please describe your changes on the following line: -->
Please see this issue: https://github.com/servo/servo/issues/15986

---
<!-- 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 #15986 (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/16541)
<!-- Reviewable:end -->
2017-04-24 04:16:18 -05:00
Hiroyuki Ikezoe
0ec5a64a71 ComputedDistance for IntermediateTextShadow. 2017-04-24 15:40:30 +09:00
Hiroyuki Ikezoe
46e567e688 Use IntermediateColor for text-shadow. 2017-04-24 15:40:29 +09:00
Hiroyuki Ikezoe
1e9c118f7f ComputedDistance for IntermediateBoxShadow. 2017-04-24 15:40:28 +09:00
Hiroyuki Ikezoe
424e4f9d35 Use IntermediateColor for box-shadow. 2017-04-24 15:40:26 +09:00
Hiroyuki Ikezoe
2d808bf162 Introduce a macro to implement Interpolate trait for box-shadow and text-shadow.
This macro will be used for implementation of intermediate type shadows
as well.  In the case of intermediate types transparent_color will be
IntermediateRGB::transparent().
2017-04-24 15:40:25 +09:00
Hiroyuki Ikezoe
09e728b43d ComputedDistance for IntermediateColor. 2017-04-24 15:40:24 +09:00
Hiroyuki Ikezoe
486578fe74 Use IntermediateColor for caret-color. 2017-04-24 15:40:23 +09:00
Hiroyuki Ikezoe
5834577157 Introduce IntermediateColor to store currentcolor or IntermeditateRGBA. 2017-04-24 15:40:22 +09:00
Hiroyuki Ikezoe
8de605f0dd ComputedDistance for IntermediateRGBA. 2017-04-24 15:40:21 +09:00
Hiroyuki Ikezoe
d70e4aa229 Use IntermediateRGBA to store overflowed RGBA components during interpolation. 2017-04-24 15:40:20 +09:00
Hiroyuki Ikezoe
e47d30f668 Rename 'normal' of animation_value_type to 'ComputedValue'. 2017-04-24 15:40:13 +09:00
Simon Sapin
512944c32c Don’t report CSS parsing errors from user-agent stylesheets.
This used to make `RUST_LOG=style` basically useless.
2017-04-24 08:27:26 +02:00
Hiroyuki Ikezoe
ce51ff3a9a Check animation_value_type is not 'discrete' instead of 'normal' for ComputeDistance.
We will introduce various new animation_value_type in subsequent patches,
so we should just check 'discrete' type for properties that we can't compute
distance.
2017-04-24 15:23:48 +09:00
Simon Sapin
7fe57ecaea Rename StdoutErrorReporter to RustLogReporter. 2017-04-24 08:23:41 +02:00
Hiroyuki Ikezoe
94fb839fdd Rename animation_type to animation_value_type. 2017-04-24 15:23:39 +09:00
石博文
22f99c71b9
Add to_computed method for CalcLengthOrPercentage
* Add to_computed method to calculate `calc()` value with parent size,
if parent container size is `None`, the result will be `None`.
* Add from_option method for `MaybeAuto`, to construct from
`Option<Au>`.
* Update some test case.
2017-04-24 14:22:14 +08:00
Hiroyuki Ikezoe
1da31f5cf3 Introduce IntermediateRGBA type.
We need to store color values that each components exceeds its normal range
(i.e. [0, 1]) during animation operations (e.g. interpolation). We clamp it
right before we insert animated values into the cascade.
2017-04-24 15:13:59 +09:00