Commit graph

5418 commits

Author SHA1 Message Date
J. Ryan Stinnett
87c51bd8bf Shrink ElementData by moving pseudo count to type
`ElementStyles` holds an optional list of values for each eager pseudo-element.
However, the type was declared as a slice instead of a fixed size array, so an
extra 8 bytes were being allocated to hold the size, even though it never
changes.

Moving the constant size into the type reduces `ElementStyles` and `ElementData`
by 8 bytes.

MozReview-Commit-ID: GaO6DKFxUMo
2017-06-22 15:47:34 -05:00
J. Ryan Stinnett
2b5c56e6a8 Move match and cascade temporaries to CurrentElementInfo
Before this change, the `ComputedStyle` struct that is part of permanent style
data per element holds 2 `StrongRuleNode`s (unvisited and visited) and 2
`Arc<ComputedValues>` (unvisited and visited).

Both rule nodes and the visited values don't actually need to be here.  This
patch moves these 3 to new temporary storage in `CascadeInputs` on
`CurrentElementInfo` during the match and cascade process.  Rule nodes are
pushed down inside the `ComputedValues` for later access after the cascade.
(Visited values were already available there.)

The permanent style data per element now has just the `Arc<ComputedValues>` for
itself and eager pseudo-elements (plus the `RestyleHint`).

MozReview-Commit-ID: 3wq52ERMpdi
2017-06-22 15:47:32 -05:00
Alan Jeffrey
d70964b881 Re-enabled iframe-append-to-child-document.html 2017-06-22 15:25:14 -05:00
Alan Jeffrey
030e01c1d1 Added exception-handling to worker wpt tests. 2017-06-22 11:28:58 -05:00
bors-servo
813eed222e Auto merge of #17456 - asajeffrey:script-paint-worklets-size, r=emilio
Paint worklet size should agree with Chrome.

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

Getting our implementation to agree with Chrome about the definition of the size parameter to a paint worklet.

---
<!-- 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 #17376
- [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/17456)
<!-- Reviewable:end -->
2017-06-22 07:54:10 -07:00
Alan Jeffrey
dded87e402 Paint worklet size should agree with Chrome. 2017-06-22 09:51:30 -05:00
bors-servo
3e686b7d1e Auto merge of #17260 - jyc:CSSStyleRule-style-test, r=jdm,emilio
Correctly test CSSStyleRule.style.

<!-- 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 do not require tests

This is part of a series of PRs to fix https://github.com/servo/servo/issues/17182

<!-- 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/17260)
<!-- Reviewable:end -->
2017-06-22 03:19:32 -07:00
bors-servo
64782bc6e3 Auto merge of #17419 - camlorn:master, r=jgraham
Windows can run WPT

<!-- Please describe your changes on the following line: -->
This PR contains fixes that address the specific errors in #17392: WTP workarounds for Windows terminals (see #8313), modifications to `mach test --all` that allow `test_tidy` to be called properly, and modifications to the test harness for WPT that allow it to run when OpenSSL isn't found.  How to handle OpenSSL on Windows is probably a separate issue because it doesn't have a straightforward answer: we either need to provide specific instructions to users or bundle it in binary form ourselves.

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

<!-- Either: -->
- [x] These changes do not require tests because they fix test running.

<!-- 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/17419)
<!-- Reviewable:end -->
2017-06-21 23:12:38 -07:00
bors-servo
1ae76ec246 Auto merge of #17405 - pyfisch:gradient-tests, r=jdm
Add some more tests for gradients

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

@jdm proposed to add these tests directly to servo.

@bors-servo try

---
<!-- 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/17405)
<!-- Reviewable:end -->
2017-06-21 14:44:25 -07:00
bors-servo
ed5485ed18 Auto merge of #17361 - servo:jdm-patch-7, r=nox
Add expected error for worker error event test.

Fixes #14775.

<!-- 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/17361)
<!-- Reviewable:end -->
2017-06-21 12:10:23 -07:00
Pyfisch
4935fbf555 Add some more tests for gradients 2017-06-21 20:19:06 +02:00
bors-servo
b211664e87 Auto merge of #17439 - bholley:compound_left_to_right, r=SimonSapin
Match compound selectors left-to-right (second try)

https://bugzilla.mozilla.org/show_bug.cgi?id=1373800

<!-- 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/17439)
<!-- Reviewable:end -->
2017-06-21 09:28:43 -07:00
bors-servo
7a80192a82 Auto merge of #17395 - pyfisch:issue17387, r=emilio
Make background gradient cover padding

CSS-gradients should not only cover the content of an
element but also the padding (but not the border).

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

Thanks to @atouchet for catching this.

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

<!-- Either: -->
- [x] These changes do not require tests because gradients are hard to test automatically but you can use [this gist](https://gist.github.com/pyfisch/fa263c8dfc57e5812fe8a4869ad61513) as a manual test.

<!-- 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/17395)
<!-- Reviewable:end -->
2017-06-21 06:50:09 -07:00
bors-servo
82884050be Auto merge of #17421 - cbrewster:set_attribute_node_fix, r=emilio
Fix crash when id attribute is set via SetAttributeNode

fixes #17366
<!-- 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/17421)
<!-- Reviewable:end -->
2017-06-21 01:04:18 -07:00
Bobby Holley
1c7f2a9f09 Account for left-to-right rather than right-to-left precedence of classes in selector maps.
MozReview-Commit-ID: 8qIl4k3RxaC
2017-06-20 11:59:12 -07:00
Connor Brewster
2ccf729aa3 Fix crash when id attribute is set via SetAttributeNode 2017-06-20 10:34:33 -06:00
Austin Hicks
f78dc9f613 Minimal changes to get WPT tests running on Windows. 2017-06-20 10:09:29 -04:00
Pyfisch
a34d8c7fa9 Make background gradient cover padding
CSS-gradients should not only cover the content of an
element but also the padding (but not the border).

Add a reftest.
2017-06-20 14:35:02 +02:00
Glenn Watson
7a98b18ed7 Update WR (optimizations, local clip rect).
* PBO optimization for GPU cache updates.
* Alpha rectangle optimizations.
* Local clip rect improvements.
2017-06-20 14:54:32 +10:00
bors-servo
d700a301d3 Auto merge of #17404 - zuwow:shrink-rulenode, r=bholley
Shrink rulenode

This shrinks rulenode by one word by removing the Option wrapper around the StyleSource and adding None to StyleSource as an additional variant. The issue mentions shrinking by two words but the free_count one was taken care of in #17368.

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

Also tested with `./mach test-unit` and `./mach test-stylo` with no errors reported from either.

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

r? @bholley

<!-- 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/17404)
<!-- Reviewable:end -->
2017-06-19 15:30:21 -07:00
Alan Jeffrey
eb0eceb16c Support nested requestAnimationFrame in the presence of reftest-wait. 2017-06-19 15:25:02 -05:00
Brian Lewis
0fe381d774 Remove Option wrapper from RuleNode's StyleSource to save one word, add
a None variant to StyleSource as an indicator for a lack of style
source, and refactor all uses with this new form
2017-06-19 21:50:56 +02:00
Pyfisch
284cb8aae8 Fix several bugs related to scrolling
* scrollLeft/scrollTop returned values of parent or even document root
   Only the scroll of the node itself is returned. Otherwise 0.0.
* Scrolling via script had set viewport.
   This resulted in other nodes appearing scrolled.
   Now scroll_offsets are updated with correct node id.

These bugs caused other odd behavior like both body and
document.documentElement being scrolled or the view for scrolled
elements jumping.
2017-06-19 21:43:35 +02:00
Mantaroh Yoshinaga
d32948c46a Add the disable anotation of filter's css-tests in order to skip timeout fail. 2017-06-19 10:44:23 +09:00
bors-servo
348c282407 Auto merge of #17389 - glennw:revert, r=jdm
Update WR (unrevert border snapping code).

<!-- 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/17389)
<!-- Reviewable:end -->
2017-06-18 09:07:35 -07:00
Simon Sapin
316cd35767 Untry 2017-06-18 13:21:51 +02:00
Alexis Beingessner
265f81f002 Update WR (unrevert border snapping code). 2017-06-18 16:17:12 +10:00
Anthony Ramine
bc9bc1d340 Rename LengthOrPercentageOrAutoOrContent to FlexBasis 2017-06-17 13:46:35 +02:00
Bobby Holley
e93b7fb3e8 Reuse the prev_sibling slot for free_count to save a word.
MozReview-Commit-ID: 9jVkDM4P8mC
2017-06-16 14:11:58 -07:00
bors-servo
81275234aa Auto merge of #17284 - jyc:custom-properties-cascade, r=emilio
Propagate changes in custom properties' computed values to descendants

If ComputedValues.custom_properties differs between the old and new
ComputedValues, indicate that we have to propogate changes to
descendants by setting child_cascade_requirement to
MustCascadeDescendants in cascade_primary.

style::matching::TElement::cascade_primary already calls
accumulate_damage, which eventually calls
ServoRestyleDamage::compute_style_difference in order to check if other
properties' computed values changed. If any of those change, we signal
that we need to propogate changes for inherited properties.

With Properties & Values, some custom properties will not be inherited,
and we will need to revisit this.

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

<!-- 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/17284)
<!-- Reviewable:end -->
2017-06-16 11:04:51 -07:00
Josh Matthews
49db7cf11e Add expected error for worker error event test. 2017-06-16 09:57:16 -04:00
Simon Sapin
b83afdedc8 Upgrade cssparser to 0.15 2017-06-16 15:05:46 +02:00
Bastien Orivel
76d8573393 Bump serde to 1.0 2017-06-16 13:31:18 +02:00
bors-servo
c58bcc23ea Auto merge of #17224 - cbrewster:html_constructor, r=jdm
WebIDL HTMLConstructor support

<!-- Please describe your changes on the following line: -->
spec: https://html.spec.whatwg.org/multipage/#htmlconstructor

---
<!-- 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 #17194 (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/17224)
<!-- Reviewable:end -->
2017-06-15 21:47:16 -07:00
Connor Brewster
81e28a2b5f Test steps 4 and 5 of the HTMLConstructor 2017-06-15 21:33:30 -06:00
Connor Brewster
2333b39569 Implement HTMLConstructor 2017-06-15 21:32:22 -06:00
bors-servo
33766b2714 Auto merge of #17348 - emilio:bup, r=bholley
style: Inline RestyleData.

Bug: 1368236
MozReview-Commit-ID: 49s3SO0PMHf

<!-- 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/17348)
<!-- Reviewable:end -->
2017-06-15 20:28:56 -07:00
Emilio Cobos Álvarez
ffc45e9aaa
style: Inline RestyleData.
Bug: 1368236
MozReview-Commit-ID: 49s3SO0PMHf
2017-06-16 03:36:18 +02:00
bors-servo
04935de3ea Auto merge of #17347 - duckinator:fix-issue-17319, r=mbrubeck
Fix setting img src before window.onload causing panic

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

Setting an image source asynchronously (e.g. using `setTimeout` or in the callback of an `XMLHttpRequest`) before `window.onload` fired would cause a panic due to a preexisting load blocker not being terminated before assigning a new one.

This PR fixes that and adds a test 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 #17319.

<!-- 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/17347)
<!-- Reviewable:end -->
2017-06-15 16:58:20 -07:00
Ellen Marie Dash
53da1e3915 add title to test; update manifest. 2017-06-15 17:13:30 -04:00
Ellen Marie Dash
3ec15aa3df test that setting img src async before window.onload doesn't panic. 2017-06-15 17:06:13 -04:00
Anthony Ramine
608e7f71a2 Make computed types hold Percentage instead of bare CSSFloat 2017-06-15 16:59:03 +02:00
Anthony Ramine
51a4481388 Use CustomIdent for transition-property 2017-06-15 13:03:23 +02:00
bors-servo
b0392dbf39 Auto merge of #17324 - ferjm:bug1371393.column, r=SimonSapin
stylo: set location for NestedRuleParser during prelude parsing

From https://bugzilla.mozilla.org/show_bug.cgi?id=1371393

<!-- 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/17324)
<!-- Reviewable:end -->
2017-06-15 01:36:22 -07:00
Fernando Jiménez Moreno
7334298f30 stylo: set location for NestedRuleParser during prelude parsing 2017-06-15 10:26:42 +02:00
bors-servo
09b8f124f5 Auto merge of #17331 - birtles:animate-display, r=hiro
Support animation of the display property

These are the Servo-side changes of [Mozilla bug 1371518](https://bugzilla.mozilla.org/show_bug.cgi?id=1371518).

These changes have been reviewed by @hiikezoe.

<!-- 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/17331)
<!-- Reviewable:end -->
2017-06-14 20:17:47 -07:00
Bobby Holley
d5fb93d487 Bump rayon to 0.8.
MozReview-Commit-ID: 8OFE5PghMzl
2017-06-14 18:52:05 -07:00
Brian Birtles
8f3dad598f Use AnimatableLonghand for AnimationValueMap and related code
In the next few patches we move all non-transition related code over to
using AnimatableLonghand instead of TransitionProperty. This will allow
us to re-purpose TransitionProperty to represent only properties that
can be transitioned (i.e. excluding discrete properties) as well as
simplifying the code by removing the need to deal with shorthands and
the "all" value in places that do not need to handle those values.
2017-06-15 10:18:18 +09:00
Nicolas Silva
8617320500 Bump euclid to 0.14. 2017-06-14 16:00:59 +02:00
Hiroyuki Ikezoe
8bfed4cb3c Move ParsingMode into style_traits. 2017-06-14 09:51:36 +09:00