Commit graph

25052 commits

Author SHA1 Message Date
Martin Robinson
63aae0178f Improve position:fixed support in layout_2020
This makes it so that position:fixed elements do not scroll with the
rest of the contents, but does not tackle the rest of the issues with
their positioning.
2020-02-11 10:42:35 +01:00
bors-servo
9f4b674fb5
Auto merge of #25691 - mrobinson:improve-query-name, r=jdm
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 an element's border.

<!-- 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-02-11 04:26:32 -05:00
Zakor Gyula
4facd3d4d2 Initial implementation of GPUCommandEncoder
Added WebIDL bindings for `GPUCommandEncoder`, `GPUCommandBuffer`, `GPUComputePassEncoder`, `GPUProgrammablePassEncoder`.
Implemented the `beginComputePass`, `copyBufferToBuffer` and `finish` functions of `GPUCommandEncoder`.
Implemented the `createCommandEncoder` function of `GPUDevice`.
2020-02-11 10:20:34 +01:00
Istvan Miklos
9031369c19 Initial implementation of GPUComputePipeline
Added WebIDL bindings for `GPUComputePipeline`.
Implemented the `createComputePipeline` function of `GPUDevice`.
2020-02-11 10:15:03 +01:00
Istvan Miklos
a8621c4ed9 Initial implementation of GPUShaderModule
Added WebIDL bindings for `GPUShaderModule`.
Implemented the `createShaderModule` function of `GPUDevice`.
2020-02-11 10:12:20 +01:00
bors-servo
3725273870
Auto merge of #25719 - pshaughn:controlbeforeform, r=jdm
Make HTMLFormControlsCollection rooted at the form's root, not rooted at the form itself

<!-- Please describe your changes on the following line: -->
We'd been misreading the first line of https://html.spec.whatwg.org/#dom-form-elements. The collection needs to be rooted higher than the form itself, so it can contain form controls elsewhere in the document with a form= content attribute. It is, as far as I can tell, unspecified whether "rooted at the form's root" is meant to live-update to a new root if the form is moved to another tree, and I'm assuming it doesn't have to.

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

<!-- 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-11 00:27:17 -05:00
bors-servo
8e65787737
Auto merge of #25675 - pylbrecht:draw.image, r=jdm
Add usability checks to CanvasRenderingContext2D.drawImage()

<!-- Please describe your changes on the following line: -->
These changes add the usability checks performed on an image to be drawn to the canvas.

References:
- https://html.spec.whatwg.org/multipage/canvas.html#drawing-images
- https://html.spec.whatwg.org/multipage/canvas.html#check-the-usability-of-the-image-argument

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and repla(e `___` 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-02-10 22:59:37 -05:00
bors-servo
7b540945cd
Auto merge of #25695 - pshaughn:eventsource, r=nox
Let EventSource fail fast on bad schemes

<!-- Please describe your changes on the following line: -->
EventSource went into an infinite reconnect loop in some cases where tests wanted it to go into a hard error state; this addresses the cases where that happens because the url isn't even http(s) and will thus definitely never result in an event stream.

https://github.com/web-platform-tests/wpt/issues/4311 suggests the tests might just be too picky here; the spec does use the word "may" on relevant 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 #25692

<!-- 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 20:01:01 -05:00
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
49376e3b31 Prompt user before accepting incoming devtools connection 2020-02-10 06:51:18 +01:00
Paul Rouget
51f15a055e Embedder Prompt API 2020-02-10 06:51:18 +01:00
Martin Robinson
20b8edc625 Clean up BoxFragment display list builder in layout_2020
This makes things a big easier to read and will make it easier to add
support for position:fixed.
2020-02-07 14:35:05 +01:00
bors-servo
c67b3d71e2
Auto merge of #25694 - kunalmohan:24891-Constellation, r=Manishearth
Remove dependency of constellation on canvas

move `ConstellationCanvasMsg` to canvas_traits and start canvas paint thread
to components/servo. This, however, does not remove dependency for conditional
compilation options.

5f55cd5d71/components/constellation/Cargo.toml (L13-L15)

<!-- 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 #24891  (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. -->
2020-02-06 13:27:29 -05:00
Kunal Mohan
a4ba33376a
Remove dependency of constellation on canvas
move `ConstellationCanvasMsg` to canvas_traits and start canvas paint thread
to components/servo. This, however, does not remove dependency for conditional
compilation options.
2020-02-06 08:03:49 +05:30
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
5f55cd5d71
Auto merge of #25669 - atouchet:uas, r=jdm
Update user agent info

<!-- Please describe your changes on the following line: -->
GitHub is again giving warnings in Servo due to using an outdated Firefox version in the user agent string. This updates the version numbers as well as the OS versions to the latest supported releases.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (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. -->
2020-02-01 16:49:25 -05:00
bors-servo
c4785e3256
Auto merge of #25645 - mrobinson:scrollable-overflow-v2, r=SimonSapin
Add support for overflow:scroll and overflow:hidden to layout_2020

This adds clipping and interactive scrolling support, but scrolling from
script is still not functional.

<!-- 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: -->
- [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 10:45:22 -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
Alex Touchet
77a9ff9074
Update user agent info 2020-01-31 14:32:42 -08:00
Martin Robinson
7a5a320d74 Add support for overflow:scroll and overflow:hidden to layout_2020
This adds clipping and interactive scrolling support, but scrolling from
script is still not functional.
2020-01-31 17:30:29 +01:00
Josh Matthews
bc946edc66
Don't spam the log if the constellation can't be reached from the canvas thread. 2020-01-31 14:39:44 +01: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
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
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