Commit graph

5418 commits

Author SHA1 Message Date
Jonathan Chan
32f62a5ac6 style: 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.
2017-06-13 13:39:37 -07:00
Alan Jeffrey
4e04daa9d0 Clear webrender image id when resizing a canvas. 2017-06-13 09:30:26 -05:00
Emilio Cobos Álvarez
cb06375fe2
style: Implement a more fine-grained invalidation method.
This commit also removes the old restyle_hints module and splits it into
multiple modules under components/style/invalidation/element/.

The basic approach is to walk down the tree using compound selectors as needed,
in order to do as little selector-matching as possible.

Bug: 1368240
MozReview-Commit-ID: 2YO8fKFygZI
2017-06-13 13:26:41 +02:00
Xidorn Quan
cdc537f23e Bug 1331291 part 1 - Set stylesheet url_data correctly for import rule. 2017-06-13 10:07:06 +10:00
Jonathan Chan
18dbfced52 Correctly test CSSStyleRule.style.
Remove the assert_readonly test and add one to verify that assigning to
CSSStyleRule.style correctly forwards to CSSStyleRule.style.cssText.

We currently test for whether CSSStyleRule.style is read-only by
trying to assign to it; however, the spec has it as actually:

interface CSSStyleRule : CSSRule {
  ...
  [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
};

See: https://drafts.csswg.org/cssom/

The `PutForwards=cssText` means that assigning to CSSStyleRule.style
should actually assign to style.cssText.
2017-06-12 15:51:58 -07:00
Simon Sapin
5bccf98aa4 ID and class selectors are ASCII case-insensitive in quirks mode.
https://bugzilla.mozilla.org/show_bug.cgi?id=1363778
2017-06-12 23:33:53 +02:00
Bobby Holley
2d412d4e3a Add a size_of test for RuleNode.
MozReview-Commit-ID: Id6iedlK5tg
2017-06-12 12:13:27 -07:00
Bobby Holley
a98fff1af8 Hoist ApplicableDeclaration{Block,List} into a separate file.
MozReview-Commit-ID: EXnAzfyoZ1e
2017-06-12 12:13:21 -07:00
Bobby Holley
0caad2ffdc Use even fewer bits for source order and shrink ApplicableDeclarationsBlock by another word.
MozReview-Commit-ID: 7B1i1g0HLTj
2017-06-12 12:13:16 -07:00
Bobby Holley
3afab1400a Make source_order u32 and shrink Rule.
MozReview-Commit-ID: AKNTZZqke1O
2017-06-12 12:13:10 -07:00
bors-servo
811c980864 Auto merge of #17257 - servo:jdm-patch-4, r=emilio
Run selectors tests.

<!-- 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/17257)
<!-- Reviewable:end -->
2017-06-11 06:43:21 -07:00
Josh Matthews
27ae1ef2e7 Thread ParseError return values through CSS parsing. 2017-06-09 16:46:25 -04:00
Josh Matthews
97a536f741 Run selectors tests. 2017-06-09 14:51:49 -04:00
Boris Zbarsky
6601ae2810 Reduce the size of ApplicableDeclarationBlock.
The level is a u8, so on 64-bit it packs nicely after the u32 specificity.
2017-06-08 14:44:55 -04:00
bors-servo
09b4f79ed3 Auto merge of #17218 - canaltinova:transform-bug, r=emilio
Don't accept an extra token at the end of transform property

The lack of `input.try` usage makes transform property to accept values like `rotate(70deg)foo`.

---
<!-- 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] 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/17218)
<!-- Reviewable:end -->
2017-06-08 03:37:44 -07:00
bors-servo
12dca42dd7 Auto merge of #17196 - glennw:update-wr-cache-glyphs, r=jdm
Update WR (move glyph data to gpu cache and halve glyph alloc/uploads).

<!-- 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/17196)
<!-- Reviewable:end -->
2017-06-07 22:55:53 -07:00
Xidorn Quan
7568a19688 Merge CSSColor into Color. 2017-06-08 12:59:22 +10:00
Glenn Watson
392ed2c8db Update WR (move glyph data to gpu cache and halve glyph alloc/uploads). 2017-06-08 12:19:40 +10:00
Xidorn Quan
d0d170767d Unify specified Color type between Stylo and Servo. 2017-06-08 10:42:24 +10:00
Nazım Can Altınova
51066436fa
Don't accept an extra token at the end of transform property 2017-06-08 02:36:52 +03:00
Alan Jeffrey
fd17dcd604 Implemented the plumbing for paint worklets. 2017-06-07 13:49:30 -05:00
bors-servo
3db7f5d556 Auto merge of #17189 - bd339:iss17038, r=emilio
Add pref to force WebGL context creation failure

<!-- Please describe your changes on the following line: -->
Introduces the pref `webgl.testing.context_creation_error`, to force creation of a new WebGLRenderingContext to fail.

---
<!-- 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 #17038 (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/17189)
<!-- Reviewable:end -->
2017-06-07 02:27:29 -07:00
bors-servo
f4a720483d Auto merge of #17202 - BorisChiou:stylo/animation/mismatched_transform, r=Manishearth,birtles
stylo: Bug 1335998 - Handle interpolation and accumulation of mismatched transform lists

These are the interdependent patches of Bug 1335998. We want to do interpolation and accumulation for mismatched transform lists, so introduce ComputedOperation::InterpolateMatrix and ComputedOperation::Accumulation. Both arms store the from_list and to_list, and resolve them until we have the layout information. For the Servo part, we haven't implemented how to read the transform lists in layout/fragment.rs, but I think it would be easy. (related issue #13267)

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1335998](https://bugzilla.mozilla.org/show_bug.cgi?id=1335998)
- [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/17202)
<!-- Reviewable:end -->
2017-06-06 23:54:41 -07:00
Boris Chiou
a2a19f02ab Add some unit tests for basic transform operations for Servo. 2017-06-07 13:04:06 +08:00
Bobby Holley
b3a61b7a1c Use NonZeroPtrMut for {Strong,Weak}RuleNode.
MozReview-Commit-ID: Da4Ds7SIcCD
2017-06-06 21:38:52 -07:00
Bobby Holley
eee07be227 Introduce NonZeroPtrMut and use it in servo_arc.
MozReview-Commit-ID: AAmeyjfyXeU
2017-06-06 21:38:51 -07:00
Bobby Holley
c369d0708c Add some size tests for ElementData and what's inside.
MozReview-Commit-ID: Aj0rryEnJpl
2017-06-06 19:09:10 -07:00
Benjamin Dahse
c034d99880 Add pref to force WebGL context creation failure
The pref `webgl.testing.context_creation_error` will cause creation of a new WebGLRenderingContext to fail, iff set to true.
Also update test expectation of `context_creation_error.html` to pass.
2017-06-06 23:08:57 +02:00
Simon Sapin
008e733df6 Fix some "unused" warnings 2017-06-06 16:58:35 +02:00
Bobby Holley
f105d3438d Fix up unit tests.
MozReview-Commit-ID: 9eyOhoQ02qX
2017-06-05 19:44:13 -07:00
Bobby Holley
27568de567 Use ThinArc in Selector.
MozReview-Commit-ID: Axvq0rbqA7Y
2017-06-05 19:44:10 -07:00
Bobby Holley
852efb825f Use dynamically-sized Arcs for Selector.
MozReview-Commit-ID: hq0jYrx8Sg
2017-06-05 19:44:06 -07:00
Bobby Holley
b815cabaf7 Add a size_of test for Rule.
MozReview-Commit-ID: J9y9cl0rpxX
2017-06-05 19:29:17 -07:00
bors-servo
9a9a0749b8 Auto merge of #17104 - Eijebong:bump_euclid_heapsize, r=emilio
Bump euclid to 0.13 and heapsize to 0.4

This is necessary for the serde 1.0 update.

--
- [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).

- [X] These changes do not require tests because it's just a dependency bump

<!-- 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/17104)
<!-- Reviewable:end -->
2017-06-05 12:34:19 -07:00
bors-servo
429db6a3c6 Auto merge of #17055 - bzbarsky:sharing-across-ids, r=emilio
Allow style sharing for elements with ids as long as the ID is not being used for styling

<!-- 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 part of the problem we're seeing in https://bugzilla.mozilla.org/show_bug.cgi?id=1367862

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because the only impact is on performance and memory.

<!-- 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/17055)
<!-- Reviewable:end -->
2017-06-05 11:05:00 -07:00
Boris Zbarsky
d031b5badb Add selectors with an id in them to the list of revalidation selectors. 2017-06-05 13:32:02 -04:00
Bastien Orivel
0a254b0306 Bump euclid to 0.13 and heapsize to 0.4 2017-06-05 19:28:39 +02:00
bors-servo
b584944f17 Auto merge of #17112 - cbrewster:custom_element_registry, r=jdm
Implement custom element registry

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

---
<!-- 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 #16753 (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/17112)
<!-- Reviewable:end -->
2017-06-05 08:38:03 -07:00
Connor Brewster
87bf4ca2ef Update test expectations 2017-06-05 09:18:58 -06:00
Connor Brewster
1800da779c Fix custom element registry define test
The test relies on DOM elements with ids beind added
as properties of the window. Servo does not do this, and
this is not a best practice.
2017-06-05 09:18:56 -06:00
Connor Brewster
e21e64a33c Add custom element registry 2017-06-05 09:18:54 -06:00
Xidorn Quan
61eb7e055f Use animation_value_type in AnimatedProperty.
So that we can remove redundant interpolation code for corresponding
computed types.
2017-06-05 11:23:18 +10:00
Emilio Cobos Álvarez
58fd80e282
style: Split stylesheets.rs
This file has become quite bloated lately. This commit deletes that file in
favor of a set of submodules.

The only noticeable change apart from code move, is converting deep_clone_foo
methods into a trait.

It also unifies logic related to different style rules in the same place.

There's some missing work, specially related to font-face and counter-style, but
I think this is worth landing in the meantime.
2017-06-04 21:50:09 +02:00
Manish Goregaokar
41f1c3463e Bump cssparser to 0.13.7 2017-06-02 17:43:56 -07:00
bors-servo
eac4f407e2 Auto merge of #15354 - cynicaldevil:manual-redirect, r=jdm
Redirect document loads manually

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

r? @jdm

I ran some tests at random from the `navigating-across-documents` folder, and they are passing.

<!-- 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/15354)
<!-- Reviewable:end -->
2017-06-02 14:49:21 -07:00
Anthony Ramine
7da94d0880 Use BorderSideWidth for outline-width 2017-06-02 10:53:27 +02:00
Anthony Ramine
2c7fbb4b4c Use generics for text spacing properties 2017-06-02 10:21:22 +02:00
Manish Goregaokar
5de2f29080 stylo: Create separate Attr type 2017-06-01 14:20:56 -07:00
bors-servo
cd22fc6b90 Auto merge of #17095 - servo:derive-all-the-things, r=emilio
Refactor a few CSS properties

<!-- 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/17095)
<!-- Reviewable:end -->
2017-05-31 11:08:56 -05:00
bors-servo
bdf4135b6a Auto merge of #17101 - cbrewster:custom_element_tests, r=jdm
Run custom element tests

I would like to have these enabled so its easier to see newly passing tests in subsequent PRs.

<!-- 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/17101)
<!-- Reviewable:end -->
2017-05-31 08:37:05 -05:00