Commit graph

9715 commits

Author SHA1 Message Date
Patrick Shaughnessy
0eeb075ecd rooted at the form's root, not rooted at the form 2020-02-10 14:35:48 -05:00
bors-servo
c0ee7594c2
Auto merge of #25659 - pshaughn:timingresolution, r=jdm,nox
Expose DOMHighResTimeStamps at lower res

As explained in https://www.w3.org/TR/hr-time-2/#clock-resolution and tested in a few WPT tests, we're not supposed to show Javascript the full resolution of OS timestamps. This fixes that on all the DOMHighResTimeStamp interfaces that weren't already limiting themselves to integer milliseconds.

The specific choice of how to coarsen the resolution is extremely bikesheddable; I commented the reasoning for my arbitrary choice but I admit it's arbitrary.

A couple tests of timing resolution still fail, but because they're seeing undefined and NaN values due to unimplemented attributes (#25658).

---
<!-- 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 #25656 fix #25296 fix #21276

<!-- 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-02-10 13:50:42 -05:00
Patrick Shaughnessy
7ef644c1f7 Fail fast on bad schemes 2020-02-10 12:40:43 -05:00
pylbrecht
481ef46167 Make create_pattern() return None for incomplete images 2020-02-10 14:23:38 +01:00
bors-servo
504437938a Auto merge of #25242 - paulrouget:prompt, r=manishearth
Mechanism to allow Servo to prompt the user

This blocks the embedder thread (compositor thread). Not ideal. I don't think it's too much work to only block script, I'll do that in a follow up bug.

Fix #23376

@Manishearth we have a few new APIs. Hopefully this will cover your needs. A thing I haven't implemented yet is a way to ask the user to pick from a list. Let me know if it's something you'll need.
2020-02-10 03:33:50 -05:00
Paul Rouget
51f15a055e Embedder Prompt API 2020-02-10 06:51:18 +01:00
Patrick Shaughnessy
4ea0a7061b Remove outdated comment about #4105 2020-02-05 15:43:03 -05:00
Martin Robinson
740211d191 Improve the name the NodeGeometryQuery
This query is used to get the clientTop, clientWidth, clientHeight,
clientLeft properties of DOM objects. "NodeGeometry" doesn't really
capture what these properties do as they often are returning the width
of element border.
2020-02-05 15:25:52 +01:00
pylbrecht
423b86e439 Add canvas usability checks to drawImage() 2020-02-03 22:49:46 +01:00
pylbrecht
ed0973fb1c Add image usability checks to drawImage() 2020-02-03 20:46:03 +01:00
Patrick Shaughnessy
8e65782efb Expose DOMHighResTimeStamps at lower res 2020-02-03 09:54:39 -05:00
bors-servo
e71dc9977c
Auto merge of #25651 - medimatrix:xhr-progress-timeout, r=jdm
Do not include request progress/total values on XHR timeout

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

Do not include request progress/total values on XHR timeout as [the specification]( https://xhr.spec.whatwg.org/#request-error-steps) states that upload events when errors occur should always pass 0 for both values.

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

<!-- 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-02-01 04:59:58 -05:00
bors-servo
393b6768f0
Auto merge of #25636 - pshaughn:submitevent, r=jdm
Implement SubmitEvent

<!-- Please describe your changes on the following line: -->
FormSubmitter was already being passed into submit, so there wasn't much work to do here other than making the new event interface itself.

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

<!-- 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-31 06:14:47 -05:00
bors-servo
7ac4f9eec6
Auto merge of #25654 - pshaughn:domtokennull, r=jdm
fix DOMTokenList

I fixed the bug described in 25128, and also the other cases in the same test (order of elements after replace).

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

<!-- 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-31 04:08:55 -05:00
bors-servo
4edd1590f4
Auto merge of #25627 - pshaughn:definedpseudo, r=emilio,jdm
Implement :defined CSS selector

<!-- Please describe your changes on the following line: -->
ElementState::IN_DEFINED_STATE already existed but wasn't hooked up to anything; now it is set appropriately, and CSS is aware of it. The main test for this selector needed the window named getter for no important reason, so I made a one-line test change to avoid that. Remaining failures in the test are all about SVG elements.

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

<!-- 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-31 01:48:35 -05:00
Patrick Shaughnessy
004c059518 fix DOMTokenList 2020-01-30 22:25:25 -05:00
bors-servo
b2f466d9e4
Auto merge of #25653 - pshaughn:removeonclick, r=jdm
Make nulling out an inline event handler remove it from the list order

Setting a content attribute or IDL attribute to null now removes event handlers like it's supposed to; the removeAttribute case seems to be something deeper which this change doesn't fix.

---
<!-- 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 #25196, but not the related #25652

<!-- 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-30 21:48:34 -05:00
bors-servo
0bf4703eac
Auto merge of #25642 - pshaughn:requestintegrity, r=jdm
Send request's integrity metadata via RequestBuilder

RequestBuilder wasn't reinflating integrity_metadata along with other request fields, so main_fetch never saw that an integrity checksum was requested. Integrity checking seems to have otherwise been working; with this change, the entire WPT test for it passes (other than the SharedWorker test, which would probably pass if we had SharedWorker)

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

<!-- 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-30 21:23:49 -05:00
Patrick Shaughnessy
9cc218d0b0 SubmitEvent and test changes 2020-01-30 17:37:33 -05:00
Patrick Shaughnessy
2874c62d35 Fix some of the remove-event-handler problems 2020-01-30 14:27:30 -05:00
Médi-Rémi Hashim
cc2d68a15d Do not include request progress/total values on XHR timeout 2020-01-30 18:15:04 +00:00
bors-servo
1352e7188a
Auto merge of #25637 - szeged:wgpu_crete_bind_group, r=jdm
Initial implementation of GPUBindGroup for WebGPU

Added WebIDL bindings for `GPUBindGroup`.
Implemented the `createBindGroup` function of `GPUDevice`
Renamed `GPUBindGroupBinding` to `GPUBindGroupBindings` and `GPUBufferBinding` to `GPUBufferBindings` in the WebIDL, because these names are already occupied.

<!-- 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 addresses a part of #24706

cc @kvark @jdm @zakorgy

<!-- 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 12:34:26 -05:00
Patrick Shaughnessy
065c61edbb let integrity_metadata survive IPC sending 2020-01-30 10:34:29 -05:00
Patrick Shaughnessy
8ca4db2cd6 :defined works 2020-01-30 10:09:51 -05:00
Patrick Shaughnessy
f043a3eee2 Error and resize get special getter/setters for reflection 2020-01-30 10:00:16 -05:00
bors-servo
9933d2fac7
Auto merge of #25648 - szeged:identity_backend_select, r=jdm
Remove code duplication from IdentityHub

Outsourced the backend selection to a function.

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

<!-- 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.-->
cc @kvark @jdm @zakorgy
<!-- 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 09:59:32 -05:00
Istvan Miklos
3cefc5f3a1 Initial implementation of GPUBindGroup for WebGPU
Added WebIDL bindings for `GPUBindGroup`.
Implemented the `createBindGroup` function of `GPUDevice`
2020-01-30 14:45:01 +01:00
Istvan Miklos
0842e53d8d Remove code duplication from IdentityHub
Outsourced the backend selection to a function.
2020-01-30 12:39:39 +01:00
Patrick Shaughnessy
5c00acca98 w3c/performance-timeline#159 2020-01-29 14:59:43 -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
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
Patrick Shaughnessy
6d15c0682d Performance observers better, not perfect 2020-01-27 15:35:39 -05:00
Patrick Shaughnessy
ee53e10f70 Errors only pass the special bonus arguments to globals 2020-01-27 15:03:28 -05: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
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
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
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