Commit graph

25652 commits

Author SHA1 Message Date
Matt Brubeck
1133ce7379 Update dependencies to latest compatible versions 2017-05-01 10:35:55 -07:00
bors-servo
0abd5bbabd Auto merge of #16674 - canaltinova:angle-unit, r=emilio
Preserve units in computed Angle

<!-- Please describe your changes on the following line: -->
It was converting all angles to radians before. But other browsers preserves the angle units. Fixed that behavior.

---
<!-- 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 #16594 and [Bug 1360659](https://bugzilla.mozilla.org/show_bug.cgi?id=1360659)

<!-- 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/16674)
<!-- Reviewable:end -->
2017-05-01 09:45:04 -05:00
Nazım Can Altınova
f8710bc189
stylo: Support other unit types in computed angle 2017-05-01 16:25:18 +03:00
bors-servo
b7f06d2c20 Auto merge of #16672 - nox:moz-force-broken-image-icon, r=emilio
Implement -moz-force-broken-image-icon in geckolib

<!-- 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/16672)
<!-- Reviewable:end -->
2017-05-01 08:14:34 -05:00
Anthony Ramine
2c9a2f61f4 Implement -moz-force-broken-image-icon in geckolib 2017-05-01 15:00:23 +02:00
Pyfisch
4f17b17082 Correct virtual gradient ray length of radial gradients.
The length should be the horizontal radius and not the
hypotenuse.
2017-05-01 14:19:35 +02:00
bors-servo
9b72d909f9 Auto merge of #16673 - nox:align, r=emilio
Fix AlignFlags::to_css

<!-- 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/16673)
<!-- Reviewable:end -->
2017-05-01 07:00:36 -05:00
Anthony Ramine
4099091afe Fix AlignFlags::to_css 2017-05-01 13:36:01 +02:00
Nazım Can Altınova
4483a7694a
stylo: Use computed Angle in computed value of filter property
Using specified Angle was wrong because it can keep calc
value and serialize with calc(). Also that will allow us to pass
angle unit later.
2017-05-01 14:28:04 +03:00
Pyfisch
f7f077c334 Add fix_gradient_stops function.
Render gradients where the last stop is the same position
as the previous one like Chrome and Firefox do.
2017-05-01 13:22:39 +02:00
bors-servo
7088969c28 Auto merge of #16671 - hiikezoe:animation-values-map, r=emilio
Pass AnimationValueMap raw pointer

This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1360776
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [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/16671)
<!-- Reviewable:end -->
2017-05-01 05:51:48 -05:00
Hiroyuki Ikezoe
1b6e32ebef Update bindings. 2017-05-01 19:37:45 +09:00
Hiroyuki Ikezoe
7a01a5f5c4 There is no need to clone for animation/transition declaration block.
Because it's a newly created Arc<Locked<PropertyDeclarationBlock> in
get_animation_rule.
2017-05-01 19:23:40 +09:00
Hiroyuki Ikezoe
83a4935b60 Pass AnimationValueMap raw pointer instead of Arc to Gecko_GetAnimationRule() 2017-05-01 19:23:34 +09:00
bors-servo
ecc818165f Auto merge of #16669 - heycam:text-align-glue, r=emilio
style: Correctly handle Gecko prefixed text-align values in property glue.

From https://bugzilla.mozilla.org/show_bug.cgi?id=1360991.
2017-05-01 04:23:28 -05:00
Cameron McCormack
2296649b5c style: Correctly handle Gecko prefixed text-align values in property glue. 2017-05-01 17:22:28 +08:00
bors-servo
c71d97ae5e Auto merge of #16665 - longsonr:1347409, r=heycam,emilio
Servo changes for bug 1347409

bug 1347409 is introducing a fallback type for SVG paint servers so that we can distinguish between url(something) and url(something) none and serialise those cases correctly. When we get a url(something) color we need to set the mFallbackType to eStyleSVGFallbackType_Color.

This change has already been reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1347409

---
<!-- 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 tests that will land in gecko as part of the rest of the patch there.

<!-- 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/16665)
<!-- Reviewable:end -->
2017-04-30 20:26:54 -05:00
bors-servo
38bbacda70 Auto merge of #16664 - emilio:fix-eternal-todo, r=bholley
style: Avoid allocating a unique nsStyleSVG and nsStyleBackground per element

Should also help with https://bugzilla.mozilla.org/show_bug.cgi?id=1360881, and it's a TODO that has always been there.

This is on top of #16663, so only last commit needs review.

<!-- 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/16664)
<!-- Reviewable:end -->
2017-04-30 19:14:43 -05:00
bors-servo
bf0bf4f4b4 Auto merge of #16663 - emilio:style-builder, r=bholley
style: Add a StyleBuilder struct to avoid refcount and atomic CAS during the cascade.

This should fix most of the complaints that caused
https://bugzilla.mozilla.org/show_bug.cgi?id=1360889 to be open, and also fix a
bunch of other FIXMEs across the style system.

<!-- 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/16663)
<!-- Reviewable:end -->
2017-04-30 18:31:41 -05:00
Robert Longson
8f5cb99b92 Set fallback type to eStyleSVGFallbackType_Color when a colour is encountered 2017-04-30 23:06:24 +01:00
Emilio Cobos Álvarez
54f33a6bfd
style: Avoid allocating a unique nsStyleSVG and nsStyleBackground per element.
Should also help with https://bugzilla.mozilla.org/show_bug.cgi?id=1360881
2017-04-30 23:57:22 +02:00
Emilio Cobos Álvarez
3b857f1c4e
style: Add a StyleBuilder struct to avoid refcount and atomic CAS during the cascade.
This should fix most of the complaints that caused
https://bugzilla.mozilla.org/show_bug.cgi?id=1360889 to be open, and also fix a
bunch of other FIXMEs across the style system.
2017-04-30 23:45:40 +02:00
bors-servo
a75fa0825c Auto merge of #16661 - emilio:alloc, r=bholley
style: Use SmallVec more in the style system.

I expect this to improve the situation significantly in https://bugzilla.mozilla.org/show_bug.cgi?id=1360881

This is worth doing on its own, though.

<!-- 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/16661)
<!-- Reviewable:end -->
2017-04-30 16:33:23 -05:00
Emilio Cobos Álvarez
0c5681140a
style: Use SmallVec in the computed value representation of most stuff. 2017-04-30 23:32:32 +02:00
Pyfisch
b230be8aaf Implement radial gradients for borders.
The property border-image-outset is not yet implemented.
Note: Also support repeating-linear-gradients for borders.
2017-04-30 22:36:45 +02:00
bors-servo
dbc093649f Auto merge of #16667 - servo:rustup, r=emilio
Upgrade to rustc 1.19.0-nightly (06fb4d256 2017-04-30)

<!-- 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/16667)
<!-- Reviewable:end -->
2017-04-30 14:33:11 -05:00
Pyfisch
a956e3fd52 Improve convert_gradient_stops function.
Implement Specification from CSS Images 3.

Improvements:

1. Stops with positions less than preceding stops are moved.
     A common pattern is blue `70%, white 0` for sharp transitions.
2. Stop runs are correct if first stop has a position.
    The list `black 0%, red, gold` now renders the same as `black, red, gold`.
    Other runs may also be corrected.
3. Absolute length are no longer capped to 100%.
2017-04-30 21:12:26 +02:00
Pyfisch
e62ad7e680 Implement -webkit-radial-gradient aliases.
In display_list_builder.rs handle cover and contain size keywords.
2017-04-30 21:12:26 +02:00
Simon Sapin
fe11849b2f Upgrade to rustc 1.19.0-nightly (06fb4d256 2017-04-30) 2017-04-30 21:00:48 +02:00
bors-servo
caa66a880a Auto merge of #16659 - bholley:faster_stylist_rebuild, r=emilio
Speed up stylist rebuilds

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

<!-- 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/16659)
<!-- Reviewable:end -->
2017-04-29 18:08:19 -05:00
Bobby Holley
a6ef89a7fe Make note_selector more efficient.
My measurements are inconclusive as to whether this really moves the
needle, but it seems like the right way to do it in any case.

MozReview-Commit-ID: 7OuCc2aQ7jH
2017-04-29 16:07:44 -07:00
Bobby Holley
b4a2e2f17c Clean up note_selector a bit and stop handling combinators in two places.
MozReview-Commit-ID: HhVi72K4yp0
2017-04-29 16:07:43 -07:00
Bobby Holley
71ecff849b Use a single rule hash for both lower_name and name.
Right now in the common case we're doing twice the work during stylist update,
and also checking is_html_element_in_html_document twice during lookup. This
patch aligns us with what Gecko does.

MozReview-Commit-ID: D4TyG30BP8C
2017-04-29 16:07:41 -07:00
Bobby Holley
080ff126b5 Factor out the various things stylist does per-selector into helpers.
This makes things more readable, and easier to profile (since the Gecko
profiler doesn't have any intra-function granularity, so I tend to make
helpers non-inline when drilling down into what's expensive).

It allows us to iterate the selector list once, which could help cache locality
for rules with many selectors.

MozReview-Commit-ID: GdFtgrbYCIu
2017-04-29 16:07:40 -07:00
Bobby Holley
b4d05919e2 Unbust unit tests.
Not sure how this managed to get past bors before.
2017-04-29 16:07:39 -07:00
bors-servo
0c4e13cbc5 Auto merge of #16658 - n0max:remove-index-size-error, r=emilio
Remove IndexSizeError in CanvasRenderingContext2D::drawImage

<!-- Please describe your changes on the following line: -->
The current spec don't expect the IndexSizeError if the rectangle is empty.

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

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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/16658)
<!-- Reviewable:end -->
2017-04-29 13:42:11 -05:00
n0max
49820a6797 Remove IndexSizeError in CanvasRenderingContext2D::drawImage 2017-04-29 19:27:00 +02:00
bors-servo
5dac4fbd2d Auto merge of #16646 - nox:loponu, r=emilio
Reverse Number and LengthOrPercentage in LengthOrPercentageOrNumber

"0" must be parsed as the number 0, not the unitless 0px length.

<!-- 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/16646)
<!-- Reviewable:end -->
2017-04-29 12:11:51 -05:00
bors-servo
53c62e890a Auto merge of #16385 - pyfisch:radial-gradient, r=emilio
Implement radial gradients

<!-- Please describe your changes on the following line: -->
This PR passes the `radial-gradient` function down from CSS parsed properties to webrender. It currently lacks tests but the examples from MDN and some other tests work fine. Probably there are some wpt tests I can enable?

<!-- 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 #11779 (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/16385)
<!-- Reviewable:end -->
2017-04-29 09:40:32 -05:00
Pyfisch
d48c1222ca Changes needed for rebase. 2017-04-29 14:38:33 +02:00
bors-servo
93a513c06f Auto merge of #16640 - hiikezoe:timing-function, r=xidorn
Use FunctionKeyword for computed_value of timing function

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1358330

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

<!-- Either: -->
- [X] These changes do not require tests because mozilla-central has test cases.  There might be some test cases in servo tree.

<!-- 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/16640)
<!-- Reviewable:end -->
2017-04-28 22:49:26 -05:00
bors-servo
bf32a7b9bd Auto merge of #16588 - KiChjang:fix-fixed-table-layout-column-width, r=mbrubeck
Fix fixed table layout column width distribution

Fixes #16324.

Replaces the incorrect [CSS3 "distributing excess width to columns" algorithm](https://drafts.csswg.org/css-tables-3/#distributing-width-to-columns) and implements the simpler [CSS2 fixed table layout algorithm](https://drafts.csswg.org/css2/tables.html#fixed-table-layout).

<!-- 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/16588)
<!-- Reviewable:end -->
2017-04-28 12:56:06 -05:00
bors-servo
bc690d67eb Auto merge of #16648 - emilio:combine, r=jryans
Bug 1360508: Adjust text-combine properly. r=jryans

Text style is always resolved via ServoStyleSet::ResolveStyleForText, either
from the frame constructor initially, or from
ServoRestyleManager::ProcessPostTraversalForText.

So text-only adjustments should go there instead. Since that doesn't call into
cascade(), all the code that passes `pseudo` there is dead code we can remove.

MozReview-Commit-ID: jpbBYpLlUL
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>

<!-- 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/16648)
<!-- Reviewable:end -->
2017-04-28 10:25:21 -05:00
Emilio Cobos Álvarez
5cbc6a9b16
Bug 1360508: Adjust text-combine properly. r=jryans
Text style is always resolved via ServoStyleSet::ResolveStyleForText, either
from the frame constructor initially, or from
ServoRestyleManager::ProcessPostTraversalForText.

So text-only adjustments should go there instead. Since that doesn't call into
cascade(), all the code that passes `pseudo` there is dead code we can remove.

MozReview-Commit-ID: jpbBYpLlUL
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-28 17:21:10 +02:00
bors-servo
86bc2c0205 Auto merge of #16643 - glennw:update-wr-bits-and-pieces, r=jdm
Update WR (various bits and pieces).

* Split out positioning and clipping per display item.
* Only send scroll states for clips that actually scroll.
* NV12 texture format support.
* Make dithering a feature.
* Handle radial gradients with invalid radii.

<!-- 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/16643)
<!-- Reviewable:end -->
2017-04-28 08:52:10 -05:00
bors-servo
ad87d36a69 Auto merge of #16623 - aacunningham:issue-16604-define-keyword-type-modification, r=Wafflespeanut
Move impl's into macro for macro-generated keyword types

Three keyword types are created through a macro but have some of their
impl's handled elsewhere. Since all impl's are the same, this commit
moves them into the macro to have them auto generated, for more concise
code.

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because this doesn't add any new features, just alters `impl` locations

<!-- 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/16623)
<!-- Reviewable:end -->
2017-04-28 08:09:13 -05:00
bors-servo
3b516af783 Auto merge of #16590 - MortimerGoro:texture_rgb, r=emilio
Fix WebGL premultiplied alpha. Fix texImage2D calls with RGB images.

Fix WebGL premultiplied alpha testcases.

Fix broken textures in some WebGL demos (e.g. Three.js). This was caused by WebGL::texImage2D calls with RGB formats. Alpha must be removed from the rgba8 pixel vector before submitting the data to the GPU.

---
<!-- 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/16590)
<!-- Reviewable:end -->
2017-04-28 07:12:05 -05:00
bors-servo
b7b5de0350 Auto merge of #16610 - Manishearth:fixup-overflow, r=emilio
overflow: -moz-scrollbars-none is shorthand-only

<!-- 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/16610)
<!-- Reviewable:end -->
2017-04-28 06:19:00 -05:00
bors-servo
22747e2763 Auto merge of #16642 - upsuper:bug1355394, r=heycam
stylo: Implement access to CSSSupportsRule

Servo side change of [bug 1355394](https://bugzilla.mozilla.org/show_bug.cgi?id=1355394).

<!-- 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/16642)
<!-- Reviewable:end -->
2017-04-28 05:11:04 -05:00
Anthony Ramine
193e1d5569 Reverse Number and LengthOrPercentage in LengthOrPercentageOrNumber
"0" must be parsed as the number 0, not the unitless 0px length.
2017-04-28 11:51:24 +02:00