Commit graph

16155 commits

Author SHA1 Message Date
Boris Zbarsky
e4660c2b5b Add pseudo-classes to match on the state of the "dir" attribute.
Fixes the servo parts of Gecko bug 1373798 <https://bugzilla.mozilla.org/show_bug.cgi?id=1373798>
2017-06-19 14:44:12 -04:00
Hiroyuki Ikezoe
a3da636f69 Don't traverse any elements that needed only for animation-only restyles in normal traversal.
Before this patch, we were setting the dirty descendants bit in animation-only
restyles and it triggered unnecessary traversal for elements that does not need
the traversal (i.e no need selector matching).
2017-06-19 15:01:17 +09:00
Hiroyuki Ikezoe
5a8e2562d5 Check the child is unstyled without creating element data in preprocess_children.
If we check it and skip the child after ensure_element_data() call,
the child will have an empty element data, so we will succeed
element_data.is_some() check unexpectedly.
2017-06-19 14:56:27 +09:00
Hiroyuki Ikezoe
028c0e4a43 Don't traverse elements that have no style data in animation-only restyle.
Animation-only restyle only works with elements that have already been styled.
2017-06-19 14:55:58 +09:00
Hiroyuki Ikezoe
9b166c5cda Use mutate_data() instead of get_data().map() with borrow_mut(). 2017-06-19 14:55:36 +09:00
Ravi Shankar
c145dd7b0c Cleanup some old code 2017-06-18 21:18:43 -07:00
bors-servo
e41b7d06b4 Auto merge of #17288 - mantaroh:filter, r=hiro
Make filter property animatable.

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

---
<!-- 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: -->
There are tests for these changes, a test case will be landed in web-platform-tests in https://bugzilla.mozilla.org/show_bug.cgi?id=1362897

<!-- 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/17288)
<!-- Reviewable:end -->
2017-06-18 20:28:16 -07:00
Cameron McCormack
accd2752ce style: Make checks for attribute/state dependencies take stylist dirty state into account.
This is a follow-up Servo-side change for https://bugzilla.mozilla.org/show_bug.cgi?id=1352306
which caused some test failures on landing.
2017-06-19 09:33:02 +08:00
Mantaroh Yoshinaga
b9f6994dcc Add compute distance for Filter. 2017-06-19 09:47:26 +09:00
Mantaroh Yoshinaga
87e580a33d Make filter property animatable. 2017-06-19 09:47:26 +09:00
Mantaroh Yoshinaga
0ca9a01be4 Add function which convert from URLValueData to SpecifiedUrl.
We will need to convert from URLValueData to SpecifiedUrl when cloning the
stylo's data from gecko's data. Because the filter structure on gecko has url as
URLValue type. We will use this convert function when interpolating as
discrete also(Bug 1368610).
2017-06-19 09:47:26 +09:00
Mantaroh Yoshinaga
ccf08bcead Preserve the unit when interpolating/adding angles with matching units.
If the units of two angles being interpolated/added matches, we should preserve
the original unit; otherwise, we fall back to radians. This matches the behavior
of Gecko.
2017-06-19 09:47:26 +09:00
Simon Sapin
316cd35767 Untry 2017-06-18 13:21:51 +02:00
Simon Sapin
7af5a7fd54 Untry script 2017-06-18 13:21:49 +02:00
Simon Sapin
a5bb55790f Untry style 2017-06-18 13:18:13 +02:00
Boris Zbarsky
eddca4d6f6 :-moz-locale-dir shouldn't be a revalidation selector.
Fixes Gecko bug 1374019 <https://bugzilla.mozilla.org/show_bug.cgi?id=1374019>
2017-06-17 23:01:02 -04:00
bors-servo
c5433277b4 Auto merge of #17384 - emilio:stylist-attr-dep, r=nox
style: Clean up some stylist code and make it slightly more efficient.

<!-- 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/17384)
<!-- Reviewable:end -->
2017-06-17 06:20:45 -07:00
Emilio Cobos Álvarez
61a4ba3e79
style: Clean up some stylist code and make it slightly more efficient. 2017-06-17 15:18:05 +02:00
bors-servo
effd6f2f87 Auto merge of #17382 - servo:derive-all-the-things, r=emilio
Derive more ToCss impls

<!-- 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/17382)
<!-- Reviewable:end -->
2017-06-17 04:53:32 -07:00
Anthony Ramine
bc9bc1d340 Rename LengthOrPercentageOrAutoOrContent to FlexBasis 2017-06-17 13:46:35 +02:00
Anthony Ramine
a568f7752f Derive ToCss for some shorthand properties 2017-06-17 13:46:34 +02:00
Anthony Ramine
3a2e79274a Derive ToCss for keyword structs 2017-06-17 13:46:33 +02:00
Anthony Ramine
b0bc1d05a9 Derive ToCss for media query qualifiers 2017-06-17 13:46:32 +02:00
Anthony Ramine
3217d1404e Derive ToCss for font-face sources 2017-06-17 13:46:30 +02:00
Anthony Ramine
3ee6598abb Derive ToCss for some counter-style descriptors 2017-06-17 12:29:57 +02:00
bors-servo
9c2dffdf72 Auto merge of #17037 - cynicaldevil:impl-Sink, r=nox
Added Async HTML Tokenizer

Design: I realized having two different parsers for sync and async was wrong, because the API for both was fundamentally the same. All I needed to do was create another Tokenizer, because `ParseNode` ( representation for nodes which are yet to be created) is used by the TreeBuilder and the Sink, and the `Tokenizer` is the 'lowermost' type concerned with these two types.

Therefore, I created one and placed it in `async_html.rs`, and also created a new Sink which deals with `ParseNode`s. I changed the methods in ServoParser to take an `async` argument too, which decides which Tokenizer will be used. The Tokenizer isn't exactly *async* for now, but this PR separates action creation from execution, which allows the async behaviour to be implemented later. Right now, all actions are executed soon after they are created.

The Sink consists of two Hashmaps, `nodes`, which contains the actual nodes, with the key being their corresponding `ParseNode`'s id, and `parse_node_data`, which contains metadata about the nodes.

It's still a bit rough, (I can't figure out how to deal with `complete_script` and `is_mathml_annotation_xml_integration_point`, along with some other parts I wrote in a hurry), but I believe the overall design is sound. I'd like to hear what you think about it.

<!-- 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/17037)
<!-- Reviewable:end -->
2017-06-17 02:21:19 -07:00
Nikhil Shagrithaya
ad649bb7e3 Added preference to enable/disable async html tokenizer 2017-06-17 13:35:55 +05:30
Nikhil Shagrithaya
161ff15d54 Added Async HTML Tokenizer 2017-06-17 13:10:10 +05:30
bors-servo
f56d192276 Auto merge of #17380 - MortimerGoro:over_alignment, r=bholley
Fix over-alignment assert crash on Android.

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

See https://github.com/servo/servo/issues/17320

---
<!-- 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 #17320 (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/17380)
<!-- Reviewable:end -->
2017-06-16 19:34:23 -07:00
bors-servo
d388dc94fc Auto merge of #17360 - servo:stderr, r=emilio
Hold stderr lock when using stdout through Console APIs.

This addresses a longstanding source of intermittent test failures where the stderr and stdout outputs get interleaved and the test harness becomes confused.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12797
- [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/17360)
<!-- Reviewable:end -->
2017-06-16 17:37:26 -07:00
Imanol Fernandez
58e887658d Fix over-alignment assert crash on Android. 2017-06-17 01:43:24 +02:00
bors-servo
2b02a444ea Auto merge of #17356 - servo:derive-all-the-things, r=SimonSapin
Minor improvements to #[derive(ToCss)]

<!-- 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/17356)
<!-- Reviewable:end -->
2017-06-16 15:46:12 -07:00
Anthony Ramine
b7c83eeb64 Limit trait bounds for derive(ToCss) to types with free variables 2017-06-17 00:36:53 +02:00
Josh Matthews
b29d0c6c31 Hold stderr lock when using stdout through Console APIs. 2017-06-16 17:55:25 -04:00
Bobby Holley
ea81f36b1d Assert against permanently-leaked rule nodes.
MozReview-Commit-ID: CK5iEWWHFSr
2017-06-16 14:12:09 -07: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
Bobby Holley
65fc5a9bd5 Actually increment the counter when adding rule nodes to the free list.
MozReview-Commit-ID: 1uipYlIF8fv
2017-06-16 14:11:53 -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
Simon Sapin
b83afdedc8 Upgrade cssparser to 0.15 2017-06-16 15:05:46 +02:00
Simon Sapin
605ef8b7ec Remove explicit dependencies on serde_derive 2017-06-16 13:58:21 +02:00
Anthony Ramine
d65a7e6f95 Avoid an unwrap in #[derive(ToCss)] 2017-06-16 13:55:26 +02:00
Bastien Orivel
76d8573393 Bump serde to 1.0 2017-06-16 13:31:18 +02:00
bors-servo
e1bce24129 Auto merge of #17352 - glennw:update-wr-faster-text, r=emilio
Update WR (CPU text optimizations, image format renames).

<!-- 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/17352)
<!-- Reviewable:end -->
2017-06-16 01:21:05 -07:00
bors-servo
32f82959f8 Auto merge of #17353 - upsuper:counter-style-disc, r=dbaron
Make counter style 'disc' not overridable

This is the Servo side change for [bug 1372488](https://bugzilla.mozilla.org/show_bug.cgi?id=1372488).

<!-- 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/17353)
<!-- Reviewable:end -->
2017-06-15 23:51:16 -07:00
Xidorn Quan
38a0824ccd Bug 1372488 - Make counter style 'disc' not overridable. 2017-06-16 16:39:52 +10:00
bors-servo
4d54f2c9bb Auto merge of #17351 - heycam:nit, r=emilio
style: Tweak an import.

<!-- 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/17351)
<!-- Reviewable:end -->
2017-06-15 22:50:53 -07:00
Glenn Watson
e7b1e041c8 Update WR (CPU text optimizations, image format renames). 2017-06-16 15:27:22 +10: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
e4ff934e82 Remove applet from list extendable interfaces 2017-06-15 21:33:32 -06:00
Connor Brewster
1f3fd77d8f Implement step 5 of HTMLConstructor 2017-06-15 21:33:28 -06:00