Commit graph

23261 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
61f3ff1de3
style: Split LengthPercentage again.
This is needed to support min() / max() / clamp(), etc, as those need to be a
tree of values and thus need heap storage.

This unfortunately grows LengthPercentage to be two pointers, which is bad as
it blows up the size of nsStylePosition enough to trigger the size assertions.

This patch comments out the assertion for now, the follow-up patches will
uncomment them.

Differential Revision: https://phabricator.services.mozilla.com/D58700
2020-02-12 02:43:10 +01:00
Xidorn Quan
ec37e7a5b8
style: Ensure nested ruby level container don't escape from line break suppression.
Differential Revision: https://phabricator.services.mozilla.com/D58351
2020-02-12 02:43:10 +01:00
Emilio Cobos Álvarez
25fda147f3
style: Minor comment fix.
Differential Revision: https://phabricator.services.mozilla.com/D59310
2020-02-12 02:43:09 +01:00
Emilio Cobos Álvarez
d459e3453a
style: Make an assertion a release assert in nightly.
If this can happen legitimately, this will help fuzzers to catch it.

Differential Revision: https://phabricator.services.mozilla.com/D59066
2020-02-12 02:43:09 +01:00
Emilio Cobos Álvarez
718a9b1f05
style: Make display: -moz-box more similar to other display types for block layout.
It is unexpected (see bug) that a -moz-box is affected by baseline alignment.
Make -moz-box be block-outside, and -moz-inline-box be inline-outside, instead
of the bespoke thing we have now.

This is more similar to everything else, and fixes the bug.

Differential Revision: https://phabricator.services.mozilla.com/D58726
2020-02-12 02:43:09 +01:00
Emilio Cobos Álvarez
219c0f6328
style: Use cbindgen for content property.
This cleans up and also allows us to keep the distinction between content: none
and content: normal, which allows us to fix the computed style we return from
getComputedStyle().

Do this last bit from the resolved value instead of StyleAdjuster, because
otherwise we need to tweak every initial struct for ::before / ::after.

Differential Revision: https://phabricator.services.mozilla.com/D58276
2020-02-12 02:43:08 +01:00
Ting-Yu Lin
07d0eea5fb
style:- Remove column-span pref in column.mako.rs.
Differential Revision: https://phabricator.services.mozilla.com/D58399
2020-02-12 02:43:08 +01:00
Emilio Cobos Álvarez
4f4d480326
style: Do not incorrectly share style across elements with different part names.
Do the same we do for classes for now. We could be more precise and achieve a
bit more sharing with some more effort (left a comment there), but it seems
unlikely to matter in practice (and if we did that, we'd probably want to do the
same for classes).

Differential Revision: https://phabricator.services.mozilla.com/D58453
2020-02-12 02:43:08 +01:00
Emilio Cobos Álvarez
69bf0e40a6
style: Remove unused FFI function to refcount nsIReferrerInfo.
We don't use RefPtr<nsIReferrerInfo> in rust.

Differential Revision: https://phabricator.services.mozilla.com/D58274
2020-02-12 02:43:08 +01:00
Emilio Cobos Álvarez
d3e65000be
style: Workaround LLVM ABI bug.
All the gory details in https://bugzilla.mozilla.org/show_bug.cgi?id=1600735 and
related LLVM / GCC bugs. Avoid the issue by forcing the relevant enum to be
32-bit wide, so as to not trigger the LLVM bug.

Differential Revision: https://phabricator.services.mozilla.com/D57868
2020-02-12 02:43:07 +01:00
Emilio Cobos Álvarez
2b499e4850
style: Do not use synthetic display-inside values.
This matches the new servo layout engine too, and thus removes some #[cfg]
gunk.  Just use `flow` since it doesn't simplify the layout code as much.

Differential Revision: https://phabricator.services.mozilla.com/D45973
2020-02-12 02:43:07 +01:00
Sean Voisen
0dfbd38532
style: Add support for logical versions of overscroll-behavior.
Differential Revision: https://phabricator.services.mozilla.com/D57363
2020-02-12 02:43:07 +01:00
bors-servo
e89e78d401
Auto merge of #25700 - szeged:wgpu_compute_pipeline, r=jdm
Initial implementation of GPUComputePipeline

<!-- Please describe your changes on the following line: -->
Added WebIDL bindings for `GPUComputePipeline`.
Implemented the `createComputePipeline` function of `GPUDevice`.
This pull request is based on: #25677

---
<!-- 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-02-11 14:56:09 -05:00
bors-servo
6b2079e5b3
Auto merge of #25690 - mrobinson:queries, r=SimonSapin
Add support for some basic queries to layout_2020

These queries will make it easier to track progressions in the layout_2020 code.

---
<!-- 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-11 13:43:26 -05:00
bors-servo
ba23c5afee
Auto merge of #25687 - pshaughn:taintfile, r=jdm
Filter file: and about: responses opaquely

<!-- Please describe your changes on the following line: -->
file: and about: schemes were being treated like data: for cors purposes, when in fact they should have been subject to opaque response filtering. A comment indicated that this was necessary for some CSS tests, but I think the comment was out of date; the only tests depending on the unfiltered responses are unit tests that do not test any CSS functionality. I've updated those tests to now test for the opaque-filtering 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 #25686

<!-- Either: -->
- [X] There are tests for these changes, but also some loss of unit test coverage (#25693) and a newly failing test case (#25692)

<!-- 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 13:27:14 -05:00
bors-servo
419954474b
Auto merge of #25677 - szeged:wgpu_shader_module, r=jdm
Initial implementation of GPUShaderModule

Added WebIDL bindings for `GPUShaderModule`.
Implemented the `createShaderModule` function of `GPUDevice`.

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

<!-- Either: -->

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-02-11 11:23:59 -05:00
Patrick Shaughnessy
41d896c201 file: and about: are now opaque-filtered responses 2020-02-11 10:19:43 -05:00
bors-servo
55058b2875
Auto merge of #25710 - pylbrecht:pattern.incomplete, r=jdm
Make CanvasRenderingContext2D.createPattern() return null for incomplete images

<!-- Please describe your changes on the following line: -->
`createPattern()` should return `null` if the passed `image` argument is not usable.

References:
- https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createpattern
- 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 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-02-11 08:11:40 -05:00
Simon Sapin
53d5e29c7b Replace iterate_through_fragments with a callback returning bool with find / Option<T> 2020-02-11 14:02:22 +01:00
Simon Sapin
d353e08529 Deduplicate the loop in iterate_through_fragments 2020-02-11 14:02:22 +01:00
Simon Sapin
ef8c51c4b1 Exit iterate_through_fragments through all recursion levels when the callback says so 2020-02-11 14:02:22 +01:00
Martin Robinson
fa7839270d Add layout_2020 support for NodeGeometryQuery and ContentBoxQuery 2020-02-11 14:02:19 +01:00
bors-servo
f3dbe7d388
Auto merge of #25715 - mrobinson:position-fixed, r=SimonSapin
Improve position:fixed support in layout_2020

<!-- 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-11 06:21:39 -05:00
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
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