Commit graph

23196 commits

Author SHA1 Message Date
Patrick Shaughnessy
004c059518 fix DOMTokenList 2020-01-30 22:25:25 -05:00
bors-servo
6d220d02de
Auto merge of #25640 - kunalmohan:20758-Cleanup, r=gterzian
move ConstellationMsg to compositing

<!-- Please describe your changes on the following line: -->
`ConstellationMsg` enum in script_traits is moved to compositing since it's not used by script_traits. The other enums mentioned in the issue, `LayoutControllerMsg` and `LayoutMsg` cannot be moved out of script_traits since script_traits depends on both of them and moving out would create cyclic dependencies.

r?@gterzian

---
<!-- 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 #20758  (GitHub issue number if applicable)

<!-- 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. -->
2020-01-30 05:37:12 -05:00
bors-servo
b939b3806f
Auto merge of #25634 - pshaughn:cjkcookies, r=jdm
Accept UTF8 cookie header values

<!-- Please describe your changes on the following line: -->
HeaderValue::to_str only works on ASCII; cookies can be utf8 too, so we decode accordingly.

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

- [ ] There are tests for these changes in http_loader; I don't know whether websocket cookies have 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. -->
2020-01-29 20:35:47 -05:00
Kunal Mohan
8d4aeef08b
move ConstellationMsg to compositing 2020-01-29 23:34:16 +05:30
bors-servo
b3ac17b82f
Auto merge of #25633 - pshaughn:localnames, r=jdm
Remove unnecessary LocalName::from(constant) calls

Changing calls to LocalName::from with a constant argument to use the interned local name instead doesn't really save a meaningful amount of time (when it's not in a loop or on a critical path), but it's good for codebase consistency.
2020-01-29 10:22:30 -05:00
bors-servo
271a30f22f
Auto merge of #25635 - pshaughn:urlmismatcherror, r=jdm
Implement URLMismatchError

Nothing in current specifications actually throws this DOMException type, but the type exists in specs nonetheless, and adding it lets us check off a WPT test.

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

<!-- 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. -->
2020-01-28 21:16:58 -05:00
Patrick Shaughnessy
15e1bdf1bf Add an unused but part-of-the-spec exception type 2020-01-28 14:22:13 -05:00
Patrick Shaughnessy
fc13bd8b2f Cookie header values can be utf8 2020-01-28 12:47:18 -05:00
Patrick Shaughnessy
0228904f27 Remove unnecessary LocalName::from(constant) calls 2020-01-28 11:47:05 -05:00
bors-servo
388a0f618b
Auto merge of #25625 - pshaughn:errorargs, r=jdm
Make error events only pass the extra error-event arguments to global listeners

Error event handlers were getting lineno, etc. arguments even when they weren't on globals, failing two WPT tests; this fixes that.

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

<!-- 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. -->
2020-01-28 11:04:08 -05:00
Kunal Mohan
9859410193
Implement Blob methods (text/arraybuffer) and async file read method 2020-01-28 14:38:32 +05:30
bors-servo
1b7223a284
Auto merge of #25622 - pylbrecht:composite.op.clear, r=jdm
Add missing CanvasRenderingContext2D global composition operation "clear"

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

<!-- 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. -->
2020-01-27 19:40:42 -05:00
Patrick Shaughnessy
ee53e10f70 Errors only pass the special bonus arguments to globals 2020-01-27 15:03:28 -05:00
pylbrecht
ae110f2e6c Add missing CompositionStyle::Clear 2020-01-27 19:21:45 +01:00
bors-servo
d0f64d9d56
Auto merge of #25610 - pshaughn:abortfix, r=Manishearth
do less on abort if not done

Abort() was resetting state when it didn't need to, and possibly also not resetting as much of it as it needed to. I'm not sure if this is a completely correct fix but it passes some WPT 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 #24931

<!-- Either: -->
- [X] There are tests for these change

<!-- 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. -->
2020-01-27 11:49:02 -05:00
bors-servo
e3a9063412
Auto merge of #25575 - pshaughn:celoop, r=jdm
Prevent infinite recursion when upgrading custom elements

<!-- Please describe your changes on the following line: -->
The spec and tests were out of sync when I implemented #25410 and I mentioned I'd have an extra detail to attend to if whatwg/html#5126 landed; it did, and I did, and a couple test cases pass.

---
<!-- 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 two WPT test cases, see test metadata in commit

<!-- 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. -->
2020-01-26 06:07:08 -05:00
Patrick Shaughnessy
52d8336d7f do less on abort if not done 2020-01-25 19:12:19 -05:00
pylbrecht
5a773bf55a Send fill/stroke style along with drawing message 2020-01-25 21:29:36 +01:00
pylbrecht
ebdf4693ab Update fill and stroke style only when required
So far fill and stroke style updates have been sent to the canvas paint
thread by `SetFillStyle()` and `SetStrokeStyle()`. This resulted in
fill/stroke style updates not being considered by the canvas paint
thread between the latest call of `SetFillStyle()`/`SetStrokeStyle()` and
the drawing operation (e.g. fill or stroke).

This issue is solved by making `SetFillStyle()` and `SetStrokeStyle()`
update the local canvas state and propagating the state to the canvas
paint thread right before any drawing operation that requires it.
2020-01-25 21:29:24 +01:00
bors-servo
937efba0cd
Auto merge of #25576 - pshaughn:menuelement, r=jdm
Implement HTMLMenuElement

<!-- Please describe your changes on the following line: -->
Per spec, "The menu element is simply a semantic alternative to ul to express an unordered list of commands (a "toolbar")." We already have the CSS for it in user-agent.css, and this gives us the interface object.

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

<!-- 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. -->
2020-01-25 11:15:32 -05:00
bors-servo
f3e6351e47
Auto merge of #25598 - pshaughn:cookieexpire, r=jdm
Expire cookies on lookup

<!-- Please describe your changes on the following line: -->
Cookies were rarely, if ever, expiring; this caused tests that used max-age=0 as a cookie deletion method to have cookies they shouldn't have had.

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

<!-- 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. -->
2020-01-25 08:48:27 -05:00
bors-servo
53879945a9
Auto merge of #25515 - pshaughn:checkpoints, r=jdm
Add microtask checkpoints to script elements and custom elements

Servo had a microtask checkpoint at the end of running a script, but there was also supposed to be one at the end of HTML-parsing a script element before Javascript-parsing the script itself, and there were supposed to be checkpoints immediately after the call to a custom element constructor. This adds those, passing all cases of one WPT test file.

---
<!-- 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 #25016 except for the remaining not-really-about-microtasks case #25514

<!-- 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. -->
2020-01-25 07:30:48 -05:00
bors-servo
31eafadcb3
Auto merge of #25594 - servo:gradient, r=mrobinson
Background follow ups

* Fix `background-clip` + `border-radius`
* Fix `background-clip` + `background-color`
* Render linear and radial gradients
* Enable `css/css-background/` in WPT
2020-01-25 05:34:38 -05:00
Simon Sapin
37ccefbe19 Adress review comments 2020-01-25 07:37:28 +01:00
Patrick Shaughnessy
6d31827464 Cookies are now expired immediately before each lookup 2020-01-24 20:07:08 -05:00
bors-servo
12693b51f5
Auto merge of #25597 - kunalmohan:25581-Compartment, r=jdm
Rename compartment to realm

<!-- Please describe your changes on the following line: -->
Rename compartment-related terminology to use realms instead.

r?@jdm

---
<!-- 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 #25581 (GitHub issue number if applicable)

<!-- 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. -->
2020-01-24 17:10:21 -05:00
Kunal Mohan
5a3e1b8e69
rename compartment to realm 2020-01-24 20:52:36 +05:30
bors-servo
0bd995cdf5
Auto merge of #25561 - pshaughn:formdata-same-file, r=jdm
Make File objects roundtrip through FormData

FormData.append now only creates a new File object if it needs to file-wrap a blob or set a filename, and not when appending an existing File with no filename override. The hardest part here was reading the specification in a way that matched browser behavior.

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

- [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. -->
2020-01-24 09:48:55 -05:00
Simon Sapin
632e731760 Render gradients 2020-01-24 14:20:20 +01:00
Simon Sapin
f39c3ff38b Apply background-clip to background-color 2020-01-24 14:20:20 +01:00
Simon Sapin
ea4882a1c5 Fix combinations of border-radius and background-clip 2020-01-24 14:20:20 +01:00
Simon Sapin
9fedade396 Rename clipping_area to painting_area
https://drafts.csswg.org/css-backgrounds/#background-painting-area
2020-01-24 14:20:20 +01:00
Simon Sapin
c8c198a172 Add a display_list::background module 2020-01-24 14:20:20 +01:00
Simon Sapin
6901bf951a Make layout_2020::display_list a directory-module 2020-01-24 14:20:20 +01:00
bors-servo
be409233fd
Auto merge of #25574 - mrobinson:use-euclid-for-physical-structs, r=SimonSapin
Use Euclid data types for physical structs in layout_2020

This removes a bit of duplication and allows layout_2020 to benefit from a
much richer set of utilities.

<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they should not change behavior.

<!-- 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. -->
2020-01-24 06:54:34 -05:00
bors-servo
8b9018cd3e
Auto merge of #25578 - pshaughn:custompicture, r=jdm
Let custom element registry know about picture tag

<!-- Please describe your changes on the following line: -->
This replaces one WPT failure with another, but the previous one failure was preventing multiple cases from running, and now only one of those cases fails (due to #24993).

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

<!-- 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. -->
2020-01-24 03:57:47 -05:00
Patrick Shaughnessy
c1a23a85b2 Implement HTMLMenuElement 2020-01-23 18:04:48 -05:00
bors-servo
ae1758fec9
Auto merge of #25490 - teapotd:radio-group-iter, r=Manishearth
Simplify and fix iteration over radio button group

- Code for iterating over radio button group elements has been extracted to `radio_group_iter`
- `in_same_group` now checks if elements are in the same tree
- `radio_group_name` returns `None` if name is empty
- Radio buttons now group together in orphan trees (#25486)

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #25486
- [ ] There are tests for these changes
2020-01-23 16:56:57 -05:00
Martin Robinson
02deb99a05 Use euclid data types for physical structs in layout_2020
This removes a bit of duplication and allows layout_2020 to benefit from
a much richer set of utilities.
2020-01-23 15:39:32 +01:00
Patrick Shaughnessy
8a4df2ae2a PutForwards cleanup 2020-01-23 08:51:34 -05:00
Patrick Shaughnessy
eb246371f1 Let custom element registry know about picture tag 2020-01-23 08:41:46 -05:00
Istvan Miklos
dbed5f1364 Support worker for WebGPU
To create resource ids for the WebGPU we need to access the `IdentityHub`.
In order to access the `IdentityHub` from a `Window` or a `Worker` as well, I've moved the `IdentityHub` to the `GlobalScope` from the `Navigator`.
2020-01-23 10:51:21 +01:00
Patrick Shaughnessy
10869f66b5 Prevent infinite recursion when upgrading custom elements 2020-01-22 18:44:33 -05:00
bors-servo
ee3fb92e53
Auto merge of #25504 - Manishearth:features, r=asajeffrey
Support features in webxr

Based on https://github.com/servo/webxr/pull/119

Todo:
 - [x] gate reference space creation on feature presence
 - [x] Fix the `features_deviceSupport` test to correctly use simulateUserActivation

Fixes #24196, #24270
r? @jdm @asajeffrey
2020-01-21 23:19:40 -05:00
Manish Goregaokar
9a04a37c1c Gate reference space creation on requested features 2020-01-21 20:19:22 -08:00
Manish Goregaokar
535e05f7b2 Correctly unset pending flag 2020-01-21 15:47:30 -08:00
Manish Goregaokar
d33d21ce72 Add support for requesting features 2020-01-21 15:47:30 -08:00
Manish Goregaokar
e0135fe783 Support profiles 2020-01-21 15:47:30 -08:00
Manish Goregaokar
9c34a6585b Handle SetTargetRayMode and SetHandedness 2020-01-21 15:47:30 -08:00
bors-servo
35eb6dd074
Auto merge of #25560 - mrobinson:scrollable-overflow-v1, r=SimonSapin
Add initial scrolling support to layout_2020

This adds very early scrolling support to layout_2020. Only the root element scrolls for now, but the idea is to continue to polish 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
- [ ] 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. -->
2020-01-21 13:03:27 -05:00