Commit graph

25052 commits

Author SHA1 Message Date
Josh Matthews
b7f0612807 Update to 7/27 nightly rustc. 2020-07-27 12:56:57 -04:00
Manish Goregaokar
5a53fb1271 Adjust absolute positioned box offsets in flow layout 2020-07-27 09:48:37 -07:00
Manish Goregaokar
bc704d8a3d Move AbsoluteBoxOffsets into HoistedSharedFragment 2020-07-27 09:48:37 -07:00
Manish Goregaokar
d476a10773 Create HoistedSharedFragment 2020-07-27 09:48:37 -07:00
Manish Goregaokar
96c0c50874 Allow adjusting box offsets 2020-07-27 09:48:37 -07:00
bors-servo
5a8023dae7
Auto merge of #27393 - servo:jdm-patch-47, r=nox
Remove unit test that triggers frequent intermittent failure.

This works around #26895 by removing the test that triggers it. The underlying cause of the failure isn't clear, but it's something to do with the hyper server and doesn't appear to impact the way that Servo's HTTP stack functions. The unit test itself is testing one particular property of the way CORS requests are made with HEAD requests, and that's not a property that is critical functionality if we stop testing it.
2020-07-27 12:16:56 -04:00
Josh Matthews
7775833b11 Remove unit test that triggers frequent intermittent failure. 2020-07-27 11:02:29 -04:00
Alex Touchet
f231025b42
Update user agent strings 2020-07-26 18:45:49 -07:00
bors-servo
9864e4ce6c
Auto merge of #27385 - servo:list, r=Manishearth
Add Layout 2020 support for `display: list-item`
2020-07-24 21:18:16 -04:00
bors-servo
b83433fb14
Auto merge of #27299 - avr1254:master, r=jdm
Implemented get element target algorithm

Added check for area and anchor element

Finished issue: Implemented get target and no opener algorithm

Implemented get element target and get element noopener algorithms.

<!-- Please describe your changes on the following line: -->
Used the algorithms in html spec to implement target and no opener algorithms.

---
<!-- 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 #27253 (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-07-24 17:30:38 -04:00
Arjun Ramachandrula
2d5c30d042 Implemented get element target and get element noopener algorithms
and refactored into functions.
2020-07-24 16:50:46 -04:00
bors-servo
ebec798263
Auto merge of #27389 - kunalmohan:update-wgpu, r=kvark
Implement GPURenderBundles

<!-- Please describe your changes on the following line: -->
1. Implement `GPURenderBundleEncoder` and `GPURenderBundle`.
2. Update wgpu to use serializable descriptors.
3. Set user-defined labels on object creation.

r?@kvark

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

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2020-07-24 14:55:09 -04:00
bors-servo
6ca3c84d28
Auto merge of #27376 - pcwalton:floats-2020-containing-block, r=Manishearth
Use the size of the containing block, not the size of the block formatting context, to place floats in layout 2020.

The containing block for a float is not necessarily the same as the block
formatting context the float is in per CSS 2.1 [1]:

"For other elements, if the element’s position is relative or static, the
containing block is formed by the content edge of the nearest block container
ancestor box."

This shows up in the simplest case:

	<html>
	<body>
	<div style="float: left">Hello</div>
	</body>
	</html>

In this case, the `<html>` element is the block formatting context with inline
size equal to the width of the window, but the `<body>` element with nonzero
inline margins is the containing block for the float. The float placement must
respect the content box of the `<body>` element (i.e. floats must not overlap
the `<body>` element's margins), not that of the `<html>` element.

Because a single block formatting context may contain floats with different
containing blocks, the left and right "walls" of that containing block become
properties of individual floats at the time of placement, not properties of the
float context itself.

Additionally, this commit generalizes the float placement logic a bit to allow
the placement of arbitrary objects, not just floats. This is intended to
support inline layout and block formatting context placement.

This commit updates the `FloatContext` and associated tests only and doesn't
actually wire the context up to the rest of layout, so floats in pages still
aren't actually laid out.

[1]: https://drafts.csswg.org/css2/#containing-block-details

r? @Manishearth

<!-- 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 #___ (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-07-24 11:12:34 -04:00
Simon Sapin
b91e293819 Add layout support for list markers 2020-07-24 09:31:24 +02:00
Simon Sapin
4a4199c1d6 Don’t parse unspported values of content 2020-07-24 09:31:24 +02:00
Kunal Mohan
aff22db33f Implement GPURenderBundleEncoder and GPURenderBundle 2020-07-24 12:45:23 +05:30
Simon Sapin
82e274aec9 Make a bool for display: list-item available to flow box construction 2020-07-23 16:43:57 +02:00
Patrick Walton
362b64aa68 Use the size of the containing block, not the size of the block formatting
context, to place floats in layout 2020.

The containing block for a float is not necessarily the same as the block
formatting context the float is in per CSS 2.1 [1]:

"For other elements, if the element’s position is relative or static, the
containing block is formed by the content edge of the nearest block container
ancestor box."

This shows up in the simplest case:

	<html>
	<body>
	<div style="float: left">Hello</div>
	</body>
	</html>

In this case, the `<html>` element is the block formatting context with inline
size equal to the width of the window, but the `<body>` element with nonzero
inline margins is the containing block for the float. The float placement must
respect the content box of the `<body>` element (i.e. floats must not overlap
the `<body>` element's margins), not that of the `<html>` element.

Because a single block formatting context may contain floats with different
containing blocks, the left and right "walls" of that containing block become
properties of individual floats at the time of placement, not properties of the
float context itself.

Additionally, this commit generalizes the float placement logic a bit to allow
the placement of arbitrary objects, not just floats. This is intended to
support inline layout and block formatting context placement.

This commit updates the `FloatContext` and associated tests only and doesn't
actually wire the context up to the rest of layout, so floats in pages still
aren't actually laid out.

[1]: https://drafts.csswg.org/css2/#containing-block-details
2020-07-22 19:58:28 -07:00
Kunal Mohan
75abccb16b update wgpu, use serializable descriptors 2020-07-22 23:22:13 +05:30
Josh Matthews
e3f0989e1c Ensure scripts compiled off-thread can import modules. 2020-07-22 13:10:03 -04:00
Josh Matthews
a271ed9150 Pass C string pointer to CompileOptionsWrapper. 2020-07-22 12:30:27 -04:00
bors-servo
a242913629
Auto merge of #26710 - AbhishekSharma102:issue_26571, r=jdm,gterzian
Compile external scripts off the main thread

<!-- 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 #26571  (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-07-21 18:29:47 -04:00
AbhishekSharma102
1119dd119e Added off thread compilation
Co-authored-by: Gregory Terzian <2792687+gterzian@users.noreply.github.com>
Co-authored-by: Abhishek Sharma <20724848+AbhishekSharma102@users.noreply.github.com>
2020-07-21 16:20:51 -04:00
bors-servo
ac37078af8
Auto merge of #27348 - kunalmohan:gpu-copy, r=kvark
Implement GPUCommandEncoder.copy commands

<!-- Please describe your changes on the following line: -->
r?@kvark

---
<!-- 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
- [ ] 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-07-21 15:13:08 -04:00
Kunal Mohan
5285c07f1f Implement GPUCommandEncoder.copy commands 2020-07-21 21:00:23 +05:30
bors-servo
774673d186
Auto merge of #27304 - paulrouget:staticdevtoolsport, r=jdm
UWP: non random port for devtools, and support for custom UWP prefs

packages-prefs.json is now taken into account for libsimpleservo. Making it possible to have custom pref for the UWP builds, removing some weirdness in the way we handle preferences in the hololens code.

This also adds a new set of preferences to control the devtools server startup state, and make the port choice constant across sessions.

Fix #27267
Fix #22970
2020-07-21 03:38:10 -04:00
bors-servo
c02da14847
Auto merge of #27339 - Manishearth:flex-align-items, r=pcwalton
flexbox 2020: Implement `align-items` and `align-self`, excluding `baseline`

This PR is based on https://github.com/servo/servo/pull/27334 for ease of testing

`baseline` is tricky and involves keeping track of a "baseline set"

https://drafts.csswg.org/css-flexbox/#flex-baselines

Part of https://github.com/servo/servo/issues/26639
2020-07-21 02:36:48 -04:00
bors-servo
c0778ff3c5
Auto merge of #27313 - jdm:layer-idl, r=asajeffrey
Update XRWebGLLayer to match specification.

This unbreaks most of the webxr WPT tests.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #27312
- [x] There are tests for these changes
2020-07-21 01:38:08 -04:00
bors-servo
132d8b4601
Auto merge of #27216 - pcwalton:floats-2020, r=Manishearth
Implement core float layout for layout 2020

<!-- Please describe your changes on the following line: -->
Add an implementation of the core float and clear placement logic in layout 2020, not yet wired to the rest of layout.

This commit implements an object that handles the 10 rules in CSS 2.1:

https://www.w3.org/TR/CSS2/visuren.html#float-position

The implementation strategy is that of a persistent balanced binary search tree
of float bands. Binary search trees are commonly used for implementing float
positioning; e.g. by WebKit.  Persistence enables each object that interacts
with floats to efficiently contain a snapshot of the float list at the time
that object was laid out. That way, incremental layout can invalidate and start
reflow at any point in a containing block.

This commit features extensive use of
[QuickCheck](https://github.com/BurntSushi/quickcheck) to ensure that the rules
of the CSS specification are followed.

Because this is not yet connected to layout, floats will not actually be laid
out in Web pages yet.

Note that unit tests as set up in Servo currently require types that they
access to be public. Therefore, some internal layout 2020 types that were
previously private have been made public. This is somewhat unfortunate.

---
<!-- 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
- [ ] 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-07-21 00:09:00 -04:00
Manish Goregaokar
ba9448e682 flex 2020: Handle positioning flex item based on align-self 2020-07-20 20:16:23 -07:00
bors-servo
59841377c2
Auto merge of #27329 - kunalmohan:gpu-label, r=kvark
Update GPUObjectBase webidl and cleanup valid flags

<!-- Please describe your changes on the following line: -->
Update labels to be `USVString`
Remove `valid` flags in WebGPU resources. The only place where we still have that is `GPUCommandEncoder` (Only to validate the GPUCommandEncoder state. Not sure how errors would be handled/reported by server for copy commands).

r?@kvark

---
<!-- 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
- [ ] 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-07-20 20:43:56 -04:00
Manish Goregaokar
d1b92b68c7 flexbox 2020: Respect the stretchiness of align-self 2020-07-20 14:26:14 -07:00
Manish Goregaokar
1af5efc542 flexbox 2020: Enable align-self and align-items in CSS 2020-07-20 14:26:14 -07:00
Manish Goregaokar
63ac4d165c flexbox 2020: Store align_items on FlexContext 2020-07-20 14:26:14 -07:00
Josh Matthews
c34e587140 Update XRWebGLLayer to match specification. 2020-07-20 15:52:16 -04:00
Patrick Walton
5b36d211b4 Add an implementation of the core float and clear placement logic in layout
2020, not yet wired to the rest of layout.

This commit implements an object that handles the 10 rules in CSS 2.1:

https://www.w3.org/TR/CSS2/visuren.html#float-position

The implementation strategy is that of a persistent balanced binary search tree
of float bands. Binary search trees are commonly used for implementing float
positioning; e.g. by WebKit.  Persistence enables each object that interacts
with floats to efficiently contain a snapshot of the float list at the time
that object was laid out. That way, incremental layout can invalidate and start
reflow at any point in a containing block.

This commit features extensive use of
[QuickCheck](https://github.com/BurntSushi/quickcheck) to ensure that the rules
of the CSS specification are followed.

Because this is not yet connected to layout, floats will not actually be laid
out in Web pages yet.

Note that unit tests as set up in Servo currently require types that they
access to be public. Therefore, some internal layout 2020 types that were
previously private have been made public. This is somewhat unfortunate.

Part of #25167.
2020-07-20 12:42:34 -07:00
Manish Goregaokar
6914c51195 Handle flex item box sizing and minmax for flexbox in 2020 2020-07-20 12:22:06 -07:00
Kunal Mohan
cdc0a75fe4 Update GPUObjectBase webidl and cleanup valid flags 2020-07-20 23:03:53 +05:30
bors-servo
48bf169101
Auto merge of #27316 - asajeffrey:webxr-save-restore-gl-state, r=Manishearth
Save / restore state when updating opaque framebuffer bindings

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

This saves and restores the WebGL bindings for texture and framebuffer when beginning a webxr frame.

---
<!-- 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 #27286
- [x] These changes do not require tests because we don't reftest hololens (it would be nice if we did!)

<!-- 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-07-20 12:20:40 -04:00
Alan Jeffrey
a708b5f7ce Save / restore state when updating opaque framebuffer bindings 2020-07-20 10:10:38 -05:00
bors-servo
086556e706
Auto merge of #27026 - CYBAI:dynamic-module, r=jdm
Introduce dynamic module

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #25439
- [x] There are tests for these changes
2020-07-19 09:29:50 -04:00
CYBAI
419cd53561 Use JS_GetScriptPrivate to get a mutated return value
Because MSVC uses a different calling conventions for functions that
return non-POD values, we need to use the new exposed wrapper function
so that `GetScriptPrivate` can be handled correctly on Windows.
2020-07-19 16:24:24 +09:00
bors-servo
e41f1662dc
Auto merge of #27310 - asajeffrey:gitignore-emacs-backup-files, r=jdm
Remove emacs backup files, add them to .gitignore

Remove emacs backup files and add them to .gitignore.
2020-07-17 23:17:47 -04:00
bors-servo
b63ce282aa
Auto merge of #27303 - camelid:async-to-asynch, r=jdm
Use `asynch` instead of `r#async`

<!-- Please describe your changes on the following line: -->
This is a vestige of the transition from 2015 to 2018 edition Rust.
`async` was added as a keyword in 2018 edition Rust, so `cargo fix`
changed the variable name here to `r#async`.

---
<!-- 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
- [x] These changes do not require tests because this is just an internal name 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-07-17 22:51:12 -04:00
bors-servo
8ce3ff656d
Auto merge of #27295 - asajeffrey:gstreamer-webxr, r=Manishearth
Gstreamer plugin support for streaming from webxr

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

Allows us to stream webxr video content.

---
<!-- 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 do not require tests because we don't reftest the gstreamer plugin

<!-- 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-07-17 17:36:38 -04:00
bors-servo
9cd22a01f7
Auto merge of #27285 - kunalmohan:async-error, r=kvark
Implement WebGPU ErrorScopes

<!-- Please describe your changes on the following line: -->
This PR covers the following-
1. update wgpu-core (Rustify `RenderPipelineDescriptor`)
2. Add initial implementation of `pushErrorScope` and `popErrorScope`.
3. Use existing `BGL` if an equivalent already exists.

A brief explanation of the ErrorScope Implementation-
1. We store `HashMap<u64, ErrorScopeInfo>` in `GPUDevice`. `ErrorScopeInfo` is a new struct used to store all necessary info for an ErrorScope.
2. We simultaneously store `Vec<u64>` to keep track of the ErrorScope hierarchy. `next_scope_id` is used to get the `scope_id` for a new Scope.
3. We send the `scope_id` of top-level scope to the server in the message for an operation. The server performs the operation and sends back the scope_id with the result message (only if a scope_id was sent from the client. Otherwise no message is sent.).
4. We store a `HashMap<WebGPUDevice, Dom<GPUDevice>>` in `GlobalScope` to access them from `ScriptThread`.
5. While creating a `GPUDevice` we send the `PipelineId` of the pipeline it was created in so that when the server send the response, we can access the device from the GlobalScope of that Pipeline.
6. We generate the relevant `GPUError` in `GlobalScope`(if required) can call the necessary fn in `GPUDevice`.

This implementation is pretty rough and not complete at all. Broadly the following cases aren't handled at the moment-
1. ErrorFilter is not checked when an error is captured.
2. We don't propagate an error to enclosing scope if a scope did not capture it.
3. `UncapturedErrorEvents` is not implemented.

As for Equivalent BGLs we now store `Vec<(Vec<wgt::BindGroupLayoutEntry>, Dom<GPUBindGroupLayout>)>` in `GPUDevice` and compare `Vec<wgt::BindGroupLayoutEntry>` for new BGL with the existing ones and return one if it is found. Otherwise a new one is created and an entry added to the `Vec`.

r?@kvark

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

<!-- 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-07-17 13:18:31 -04:00
Kunal Mohan
785497af63 Ensure GPUDevice cleanup in GlobalScope 2020-07-17 21:17:38 +05:30
CYBAI
08723b0e37 Handle script private reference hooks properly 2020-07-18 00:43:35 +09:00
CYBAI
d1715918f0 Set private reference for classic script
Web developers can use `Dynamic Import` in a classic script; thus, we
need to save the script's private reference so that we can reuse it when
we're going to fetch a dynamic import module for a classic script.

Besides, because it's possible to use different executing context for a
dynamic import module (like `dynamic-import/string-compilation-other-document.html` WPT test),
we can't initialize a module owner at the timing of `SetScriptPrivate`;
thus, if the private module script doesn't hold an owner, we'll use a
DynamicImport owner for it.
2020-07-18 00:43:34 +09:00
CYBAI
99e832a345 Move from direct Evaluate to compile then execute for classic script 2020-07-18 00:43:34 +09:00