Commit graph

6452 commits

Author SHA1 Message Date
Corey Farwell
befe538472 Utilize match_ignore_ascii_case! in more places. 2017-07-29 09:58:09 +00:00
Corey Farwell
6238035612 Minor refactorings for 'data-' attribute logic. 2017-07-29 09:58:03 +00:00
Corey Farwell
23e5bfaf27 Audit usages of unicode case-changing methods. 2017-07-26 23:44:01 +00:00
Simon Sapin
eb98ae6e04 Update cssparser to 0.18
https://github.com/servo/rust-cssparser/pull/171
2017-07-24 11:39:12 +02:00
Nikhil Shagrithaya
15ac245ae7 Update step annotations in script's prepare method 2017-07-24 00:20:07 +05:30
Alan Jeffrey
2318caf002 Implement drawing an image from a CSS style value into a canvas. 2017-07-21 16:39:11 -05:00
bors-servo
d1ac8b26e9 Auto merge of #17813 - upsuper:supports-decl, r=SimonSapin
Store raw string for prop decl in @supports

This fixes the serialization issue of `@supports` rule that whitespaces are not preserved like in other browsers.

It makes the work a bit redundant (the property name and colon is parsed twice), but I suppose this isn't a big deal.

<!-- 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/17813)
<!-- Reviewable:end -->
2017-07-21 09:01:57 -07:00
Xidorn Quan
adee1e403c Store raw string for prop decl in @supports 2017-07-21 22:59:39 +10:00
Alan Jeffrey
caa3585219 Fixed scaling artefacts in paint worklets caused by zoom and hidpi. 2017-07-20 17:25:50 -05:00
Fernando Jiménez Moreno
892b30edca Implement basic Time To First Paint and First Contentful Paint PWMs 2017-07-20 15:41:21 +02:00
bors-servo
7d95fb8e49 Auto merge of #17749 - SergeevPavel:extra-space-check, r=jdm
Extra space check

<!-- Please describe your changes on the following line: -->
Add tidy check for keywords with more than one space afterwards.

---
<!-- 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 #17700 (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/17749)
<!-- Reviewable:end -->
2017-07-19 16:03:51 -07:00
Pavel Sergeev
677a24a8d6 remove extra spaces after keywords 2017-07-20 00:45:02 +03:00
Michael Partheil
b07ebbae6b Replace all uses of the style::stylearc alias with servo_arc.
The alias is left there temporarilly and will be removed completely in a later commit where
also components/style/gecko/generated/structs_{debug|release}.rs are re-generated (they still
use the old alias).
2017-07-19 09:29:05 +02:00
bors-servo
a6739cb17f Auto merge of #17761 - cbrewster:ce_reactions, r=jdm
Add [CEReactions] to webidls

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

---
<!-- 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/17761)
<!-- Reviewable:end -->
2017-07-18 12:37:46 -07:00
Connor Brewster
9ecb931c5e Fix adopted and connected callback reactions 2017-07-18 13:36:55 -06:00
Connor Brewster
77efab8a9e Return null when an attr's namespace is not set 2017-07-18 13:36:48 -06:00
Connor Brewster
2460997ee1 Add CEReactions where needed 2017-07-18 12:22:20 -06:00
bors-servo
eb26194dd1 Auto merge of #17735 - ferjm:navigationstart, r=jdm
Set navigation start value according to navigation timing spec

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #17651

<!-- 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/17735)
<!-- Reviewable:end -->
2017-07-18 10:24:44 -07:00
Fernando Jiménez Moreno
db044bdbef Set navigation start value according to navigation timing spec 2017-07-18 17:42:14 +02:00
bors-servo
92eeec297b Auto merge of #17763 - asajeffrey:script-worklets-pref, r=jdm
Placed worklets implementation behind a pref

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

At the moment, worklets are always exposed, even though their spec is still a draft. This PR hides them behind a pref.

---
<!-- 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 #17680.
- [X] These changes do not require tests because the existing worklet tests do the job.

<!-- 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/17763)
<!-- Reviewable:end -->
2017-07-18 08:11:23 -07:00
Alan Jeffrey
a3fe0b72d5 Placed worklets implementation behind a pref. 2017-07-18 09:38:56 -05:00
Connor Brewster
438191e0b2 Implement CEReactions codegen 2017-07-18 08:18:22 -06:00
bors-servo
7b134440fc Auto merge of #17614 - cbrewster:custom_element_reactions, r=jdm
Implement custom element reactions

<!-- Please describe your changes on the following line: -->
Initial work for implementing custom element reactions: https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-reactions

---
<!-- 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 #17433 (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/17614)
<!-- Reviewable:end -->
2017-07-17 22:58:53 -07:00
Connor Brewster
9b587a4f2d Invoke backup element queue via a microtask 2017-07-17 22:23:47 -06:00
Connor Brewster
4665991503 Support custom element callback reactions 2017-07-17 22:23:45 -06:00
Manish Goregaokar
89930e7565 stylo: Switch Gecko over to ServoStyleContext 2017-07-17 18:03:23 -07:00
Austin Hicks
033b31979b Convert node serialization to a purely iterative algorithm.
We maintain a stack of open element nodes and non-node elements and use it to determine when to close them.
2017-07-17 12:24:30 -04:00
bors-servo
2bb4f65100 Auto merge of #16508 - brainlessdeveloper:fetch-set-origin, r=asajeffrey
Properly set origin of fetch requests

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

These changes aim to fix #15247

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

<!-- Either: -->
- [ ] There are tests for these changes
- [x] These changes do not require tests because cors is already tested with different origins

These changes require changes in tests, but I need help with that (see comments below).

<!-- 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/16508)
<!-- Reviewable:end -->
2017-07-17 08:29:23 -07:00
bors-servo
38f4ae80c4 Auto merge of #17739 - jdm:no-vendor-prefixed-errors, r=emilio
Suppress CSS parser errors for vendor-prefixed properties.

This matches the behaviour of Gecko's CSS parser.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #17736
- [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/17739)
<!-- Reviewable:end -->
2017-07-17 07:10:11 -07:00
Josh Matthews
94d631c1f4 Suppress CSS parser errors for vendor-prefixed properties. 2017-07-17 10:00:31 -04:00
bors-servo
2d37700cf8 Auto merge of #17731 - emilio:percentage-calc, r=nox
style: Respect calc for percentages.

<!-- 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/17731)
<!-- Reviewable:end -->
2017-07-17 01:29:11 -07:00
Fausto Núñez Alberro
6032940fb8 Change RequestInit origin type to ImmutableOrigin 2017-07-16 21:44:33 +02:00
Emilio Cobos Álvarez
bf9369b29d
script: Move the layout_wrapper outside of script.
This allows us to have ensure_data() and clear_data() functions on the TElement
trait, instead of hacking around it adding methods in random traits.

This also allows us to do some further cleanup, which I'd rather do in a
followup.
2017-07-15 16:41:12 +02:00
Emilio Cobos Álvarez
310be02ba8
style: Respect calc for percentages. 2017-07-14 13:43:27 +02:00
bors-servo
6597178b91
Auto merge of #17701 - bholley:reuse_allocations, r=emilio
reuse the bloom filter and style sharing cache across traversals

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

<!-- 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/17701)
<!-- Reviewable:end -->
2017-07-14 11:01:07 +02:00
bors-servo
559c0d1d90 Auto merge of #17501 - jyc:Text-children_changed, r=emilio
Have CharacterData call children_changed on its parent when data is set.

**Can't run WPT on my computer, so pushing here to run tests 😢**

Have CharacterData.SetData call children_changed on its parent when
data is set (if it is a Text node) so that HTMLStyleElement parents can
re-parse. Add variant ChildrenMutation::Text for it to use as the
mutation.

This fixes an issue where an empty <style> element's data is set but the
style is not updated. An HTMLStyleElement parent re-parses in its
children_changed implementation.

<!-- 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 are part of a series to fix #17182 (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/17501)
<!-- Reviewable:end -->
2017-07-13 14:00:13 -07:00
Jonathan Chan
4142665282 Have CharacterData call children_changed on its parent when data is set.
Have CharacterData.SetData call children_changed on its parent when
data is set (if it is a Text node) so that HTMLStyleElement parents can
re-parse. Add variant ChildrenMutation::Text for it to use as the
mutation.

This fixes an issue where an empty <style> element's data is set but the
style is not updated. An HTMLStyleElement parent re-parses in its
children_changed implementation.
2017-07-13 13:02:27 -07:00
Connor Brewster
596ed557d2 Get observed attributes when a CE is defined
Implements steps 10.5 - 10.6 of CustomElementRegistry.define
2017-07-13 09:38:16 -06:00
Connor Brewster
901a2028f1 Store lifecycle callbacks when CEs are defined
This implements steps 10.3 - 10.4 of the CustomElementRegistry.define
steps.
2017-07-13 09:27:05 -06:00
Emilio Cobos Álvarez
a34f288b98
Revert "Auto merge of #17701 - bholley:reuse_allocations, r=emilio"
This reverts commit ebfc8f5858, reversing
changes made to 5585ff2c44.

Animation code can reenter and create a new TLS context from the traversal
SequentialTask, so this won't work as written.
2017-07-13 09:58:08 +02:00
bors-servo
173181a491 Auto merge of #17694 - glennw:webrender-update, r=glennw
Upgrade to the latest version of WebRender

<!-- 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/17694)
<!-- Reviewable:end -->
2017-07-12 21:52:27 -07:00
Bobby Holley
d1c31f7eaf Add owning_ref back as a style dep, and update parking_lot. 2017-07-12 16:37:50 -07:00
Martin Robinson
e58e8ab42e Upgrade to the latest version of WebRender 2017-07-13 07:44:08 +10:00
Jonathan Chan
92ec8f15f0 Implement CSSStyleRule.selectorText.
We parse when assigning using the namespaces of the stylesheet. It isn't
clear if the spec says to do that (Firefox doesn't support the setter at
all, Chrome does, Safari doesn't); the spec issue is here:
https://github.com/w3c/csswg-drafts/issues/1511

Also fix ToCss implementation of AttrSelectorOperator to not pad with
spaces, to conform with CSSOM. This means we have to update some unit
tests that expect operators with spaces around them in attribute
selectors to roundtrip.

See the "attribute selector" section of "Serializing Selectors" here:
https://drafts.csswg.org/cssom/#serializing-selectors

CSSStyleRule.selectorText is specified here:
https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext
2017-07-12 01:03:58 -07:00
bors-servo
749891e48e Auto merge of #17672 - sadmansk:heap_in_box, r=jdm
Use boxed slice instead of vec for FuntionTimerCallback

<!-- Please describe your changes on the following line: -->
Added `fn trace()` implementation for `Box<[T]>` type, and change FunctionTimerCallback to store boxed slices for heap values instead of Vector.

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

<!-- Either: -->
- [x] These changes do not require tests

<!-- 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/17672)
<!-- Reviewable:end -->
2017-07-11 18:55:18 -07:00
bors-servo
bc44246fc6 Auto merge of #17364 - asajeffrey:script-paint-worklets-properties, r=jdm
Implement paint worklet properties

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

This is the final PR to get basic paint worklet support. It adds support for paint worklet properties (https://drafts.css-houdini.org/css-paint-api/#paint-definition-input-properties). When a paint worklet is registered, it specifies a list of CSS properties, and is provided with their computed values when it is invoked.

This is a dependent PR:
* "Implemented paint worklets invoking worklet scripts" is #17239.
* "Implemented paint worklets rendering contexts" is #17326.

There should be tests added for this, hopefully the existing wpt houdini tests.

---
<!-- 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 #16839
- [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/17364)
<!-- Reviewable:end -->
2017-07-11 16:24:18 -07:00
Alan Jeffrey
ef033b8362 Implemented paint worklet properties. 2017-07-11 17:28:56 -05:00
Sadman Kazi
fa678992ff Use boxed slice instead of vec for FuntionTimerCallback 2017-07-11 14:07:40 -07:00
bors-servo
2a575acabe Auto merge of #17665 - jdm:postmessage-panic, r=KiChjang
Avoid panic when postMessage targets closed window.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #17664
- [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/17665)
<!-- Reviewable:end -->
2017-07-11 12:28:33 -07:00
Josh Matthews
4c54129877 Avoid panic when postMessage targets closed window. 2017-07-11 10:37:58 -04:00