Commit graph

25473 commits

Author SHA1 Message Date
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
Imanol Fernandez
e6d17f80a4 Fix WebGL premultiplied alpha. Fix texImage2D calls with RGB images. 2017-04-28 11:49:48 +02:00
Xidorn Quan
81af3be034 Update binding files. 2017-04-28 16:55:28 +08:00
Keith Yeung
2d5833d3af Fix fixed table layout column width distribution 2017-04-27 23:35:26 -07:00
Hiroyuki Ikezoe
b5bcc6e5eb Mark some tests for timing-function as FAIL.
Those test cases are apparently wrong. Keyword values (e.g. 'ease')
should not be serialized as cubic-bezier function.
https://drafts.csswg.org/css-timing/#serializing-a-timing-function

On gecko, we also mark those tests FAIL.

https://hg.mozilla.org/mozilla-central/file/2cca333f546f/testing/web-platform/meta/css/css-transitions-1/transition-001.html.ini
https://hg.mozilla.org/mozilla-central/file/2cca333f546f/testing/web-platform/meta/css/css-transitions-1/transition-timing-function-001.html.ini
2017-04-28 13:43:53 +09:00
bors-servo
f1287814db Auto merge of #16601 - servo:cargoup, r=nox
Update to cargo 0.19.0-nightly (994e552 2017-04-25)

This should be unblocked now: https://github.com/servo/servo/pull/15852#issuecomment-296379226

<!-- 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/16601)
<!-- Reviewable:end -->
2017-04-27 23:32:54 -05:00
Glenn Watson
3a30d30a9c 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.
2017-04-28 13:46:04 +10:00
bors-servo
d8bcc0db1a Auto merge of #16609 - nox:quirks, r=Manishearth,emilio
Implement unitless length quirk

The Gecko side doesn't propagate its quirks mode yet.

<!-- 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/16609)
<!-- Reviewable:end -->
2017-04-27 22:32:24 -05:00
Xidorn Quan
767e10b29d Implement CSSOM support for @supports. 2017-04-28 09:11:01 +08:00
Xidorn Quan
f19b9763cf Move GetRules function into macro. 2017-04-28 09:10:52 +08:00
bors-servo
eb975ab890 Auto merge of #16641 - emilio:dupedupedupedupe, r=bholley
Bug 1360399: Don't deduplicate revalidation selectors. r=bholley

It's unfortunate, but it's a correctness issue. I was looking at the
expectations update here:

 * 659cddddd4

And investigating it I realised that it's wrong to coalesce selectors like that,
because we keep the bloom filter flags.

So in the test cases disabled, we have a selector that looks like this:

```
msub > :not(:first-child),
msup > :not(:first-child),
msubsup > :not(:first-child),
mmultiscripts > :not(:first-child) {
    -moz-script-level: +1;
    -moz-math-display: inline;
}
```

And an element that looks like this:

```
<msubsup><mi></mi><mi></mi></msubsup>
```

We're only inserting the first selector msub > :not(:first-child) into the set,
so when we're going to match the <mi> elements we fast-reject it in both cases
due to the bloom filter, so they share style.

I can't see an easy way to fix this keeping the deduplication. If we keep it, we
need to remove the bloom filter optimization, which means that we'd trash the
cache for every first-child in the document (the :not(:first-child) effectively
becomes a global rule).

MozReview-Commit-ID: 9VPkmdj9zDg
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-27 19:59:25 -05:00
Emilio Cobos Álvarez
7a556a7f03
Bug 1360399: Don't deduplicate revalidation selectors. r=bholley
It's unfortunate, but it's a correctness issue. I was looking at the
expectations update here:

 * 659cddddd4

And investigating it I realised that it's wrong to coalesce selectors like that,
because we keep the bloom filter flags.

So in the test cases disabled, we have a selector that looks like this:

msub > :not(:first-child),
msup > :not(:first-child),
msubsup > :not(:first-child),
mmultiscripts > :not(:first-child) {
    -moz-script-level: +1;
    -moz-math-display: inline;
}

And an element that looks like this:

<msubsup><mi></mi><mi></mi></msubsup>

We're only inserting the first selector msub > :not(:first-child) into the set,
so when we're going to match the <mi> elements we fast-reject it in both cases
due to the bloom filter, so they share style.

I can't see an easy way to fix this keeping the deduplication. If we keep it, we
need to remove the bloom filter optimization, which means that we'd trash the
cache for every first-child in the document (the :not(:first-child) effectively
becomes a global rule).

MozReview-Commit-ID: 9VPkmdj9zDg
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-28 02:57:54 +02:00
Hiroyuki Ikezoe
f15896078a Use FunctionKeyword for computed_value of timing-function as well. 2017-04-28 09:11:58 +09:00
Hiroyuki Ikezoe
90ab181a6c Factor out serialize keywoded timing function values.
This will be used for computed timing function as well.
2017-04-28 09:11:58 +09:00
bors-servo
04aac0247a Auto merge of #16637 - bzbarsky:probing-lazy-pseudos, r=emilio
Fix Stylist::lazily_compute_pseudo_element_style to return None when it should.

We have a fast path to return None if we have no rules for the pseudo-element at
all, but we should also return None if we have no _matching_ rules for it for
the given originating element.  This is relied on by consumers like
Servo_ResolvePseudoStyle, which needs to be able to detect the "no styles for
this pseudo-element for this originating element case", to support probing for
whether work for a specific pseudo-element should be done at all.

<!-- 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
- [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/16637)
<!-- Reviewable:end -->
2017-04-27 18:31:20 -05:00
bors-servo
5c321737c6 Auto merge of #16639 - aneeshusa:skip-nonexisting-dirs-when-cleaning-nightlies, r=jdm
Avoid searching for old nightlies in missing dirs

These directories may be missing (e.g. a first time build or due to Buildbot cleaning),
so don't try to look inside them for old nightlies if so.

I noticed this in http://build.servo.org/builders/arm32/builds/6815/steps/shell__1/logs/stdio.

<!-- 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
- [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/16639)
<!-- Reviewable:end -->
2017-04-27 17:18:55 -05:00
Aneesh Agrawal
ba874d67bb Avoid searching for old nightlies in missing dirs
These directories may be missing (e.g. a first time build),
so don't try to look inside them for old nightlies if so.
2017-04-27 17:30:56 -04:00
Pyfisch
ce3e1406ca Handle unimplemented size keywords for radial gradients. 2017-04-27 22:07:31 +02:00
Pyfisch
0708d62f16 Set /css-flexbox-1_dev/html/align-content-004.htm.ini to PASS 2017-04-27 22:07:31 +02:00
Pyfisch
c9461985c1 Fix gradient position if background-clip is present. 2017-04-27 22:07:31 +02:00
Pyfisch
1c4ae53a88 Pass repeating gradients to webrender. 2017-04-27 22:07:31 +02:00
Pyfisch
803bc0395c Fix gradient math and positioning. Formatting.
Start adding repeating gradients.
2017-04-27 22:07:31 +02:00
Pyfisch
6768614fdd Use content_box instead of absoulte bounds in radial_gradient. 2017-04-27 22:07:31 +02:00
Pyfisch
0215947733 Implement radial gradient size keywords. 2017-04-27 22:07:31 +02:00
Pyfisch
f4bad2d920 Partially implement radial gradients.
Missing: repeating radial gradients and keyword sizes.
2017-04-27 22:07:31 +02:00
Boris Zbarsky
c9fd747e69 Fix Stylist::lazily_compute_pseudo_element_style to return None when it should.
We have a fast path to return None if we have no rules for the pseudo-element at
all, but we should also return None if we have no _matching_ rules for it for
the given originating element.  This is relied on by consumers like
Servo_ResolvePseudoStyle, which needs to be able to detect the "no styles for
this pseudo-element for this originating element case", to support probing for
whether work for a specific pseudo-element should be done at all.
2017-04-27 16:00:40 -04:00
bors-servo
2c445169ad Auto merge of #16635 - bholley:too_many_revalidation_selectors, r=emilio
Too many revalidation selectors

https://bugzilla.mozilla.org/show_bug.cgi?id=1358693
2017-04-27 13:14:01 -05:00
Bobby Holley
f4d81b010b Properly handle -moz-any for revalidation selectors.
Note that, while the comment is correct that there is a fair amount of -moz-any
usage in the UA sheet, it's always used as an ancestor selector, and thus ignored
for our purposes. Nevertheless, it's straightforward enough to support properly,
so we do that here.

MozReview-Commit-ID: Kz1yNfPUIaP
2017-04-27 11:13:11 -07:00
Bobby Holley
6e413653e7 Add unit tests for revalidation selectors.
If these break, our cache may be subtly wrong in certain situations, which may
be hard to detect.

MozReview-Commit-ID: AXG2tpGnQ6k
2017-04-27 11:13:04 -07:00