Commit graph

44272 commits

Author SHA1 Message Date
Bryce Wilson
f305c82494
Fix compiler warnings 2021-08-14 21:35:15 -07:00
bors-servo
8b3a49349d
Auto merge of #28567 - yvt:chore-no-fail-fast, r=jdm
CI: Don't cancel the entire job matrix when one of them fails

By default, GitHub Actions [cancels][1] all in-progress jobs in a build matrix when one of them fails. This PR disables this behavior.

[1]: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast

---
- [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)

---
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they are for CI
2021-08-14 01:33:30 -04:00
bors-servo
3a56027cf1
Auto merge of #28564 - bjorn3:patch-1, r=jdm
Update script_plugin for rust-lang/rust#85296

This will update the script_plugin for the plugin interface changes in rust-lang/rust#85296.

---
<!-- 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 it is a fix for rustc changes.
2021-08-13 23:22:01 -04:00
bjorn3
7bc6742a45
Remove unnecessary feature gate 2021-08-13 13:03:46 +02:00
bjorn3
f389da9429
Rustup to nightly-2021-08-13 2021-08-13 12:54:22 +02:00
yvt
ca34a002b3 chore(ci): don't cancel the entire job matrix when one of them fails 2021-08-13 14:05:28 +09:00
bjorn3
5b0d7fbe5d
Fix lint 2021-08-10 15:34:50 +02:00
bjorn3
92a23f7583
Update script_plugin for rust-lang/rust#85296 2021-08-09 12:01:42 +02:00
bors-servo
cc1f89863c
Auto merge of #28560 - yvt:fix-nosrc-iframe-load-2, r=jdm
The "process the iframe attributes" steps shouldn't enqueue the iframe load event steps (anymore)

Fixes `HtmlIFrameElement::process_the_iframe_attributes` (which implements [the "process the `iframe` attributes" steps][1]) queueing an element task to execute [the iframe load event steps][2], which causes another `load` event to be fired on the iframe in addition to the one asynchronously generated by [the "create a new nested browsing context" steps][3].

The following timeline shows what happens when a `src`-less `iframe` element is parser-inserted and which step this PR intends to remove. (This does not necessarily match Servo's current behavior exactly - Most notably, `T2`'s steps might run late because the "create a nested browsing context" steps' implementation actually [parses][5] a blank HTML document.)

```diff
  T0 (networking task source)
   | Insert the `iframe` element, causing the following steps to be executed:
   |  | Create a new nested browsing context
   |  |  | Create a new browsing context
   |  |  |  | Completely finish loading the `iframe` element's `Document`
   |  |  |  |  | Queue element task T2.
   |  |
   |  | Process the `iframe` attributes
-  |  |  | Queue element task T1

- T1 (DOM manipulation task source)
-  | Execute the `iframe` load event steps
-  |  | Fire `load` for the `iframe` element

  T2 (DOM manipulation task source)
   | Execute the `iframe` load event steps
   |  | Fire `load` for the `iframe` element
```

This bug likely originates from [a bug][4] in the specification.

[1]: https://html.spec.whatwg.org/multipage/#process-the-iframe-attributes
[2]: https://html.spec.whatwg.org/multipage/#iframe-load-event-steps
[3]: https://html.spec.whatwg.org/multipage/#creating-a-new-nested-browsing-context
[4]: https://github.com/whatwg/html/pull/5797
[5]: https://html.spec.whatwg.org/multipage/#the-end

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24501, #15727, and the `cross-origin-objects-on-new-window.html` part of #26299

---
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___
2021-08-07 14:15:24 -04:00
yvt
3e56446dd5 test: update expectations 2021-08-07 13:44:44 +09:00
yvt
38adb092ad fix(script): "process the iframe attributes" shouldn't invoke the iframe load event steps anymore
This likely originates from a bug that existed in the specification[1].
A `src`-less iframe would fire two `load` events when implemented
according to an affected version of the specification.

[1]: f2839722e1
2021-08-07 11:41:00 +09:00
yvt
3090505fd4 refactor(script): navigate_or_reload_child_browsing_context should only handle cases involving navigation
The initial document creation does not involve navigation, and it would
cause a confusion if this was done by a function which has `navigation`
in its name. This commit renames `navigate_or_reload_child_browsing_
context` to `start_new_pipeline`, and introduces a new function which
has the original name and is dedicated to handle navigation.
2021-08-03 09:11:19 +09:00
bors-servo
bd92fad81a
Auto merge of #28546 - yvt:feat-cow-infra, r=jdm
Implement `Location`'s custom internal methods

This PR partly resurrects #16501 and introduces the use of principals object to associate objects and Realms with origins. Using this infrastructure, this PR implements [the custom internal methods][1] of the `Location` interface, which is "maybe-cross-origin".

Unimplemented/incomplete things:

 - Other maybe-cross-origin interfaces, namely `WindowProxy` and `DissimilarWindowLocation`, aren't implemented correctly yet (causing most test cases of `tests/wpt/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html` to fail).
     - `WindowProxy`: #28556
 - [The "perform a security check" operation][2] and `Location`'s non-cross-origin properties' relevant `Document` origin checks aren't implemented either (not sure if they are covered by the existing tests).
 - There are a slight deviation from the standard and inefficiency in `CrossOriginGetOwnPropertyHelper`'s current implementation.
     - #28557

[1]: https://html.spec.whatwg.org/multipage/#the-location-interface
[2]: https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #16243 and make some progress in #2382

---
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___
2021-08-01 10:31:40 -04:00
yvt
afbe2fa1f2 fix(script): don't pass an unrooted slice to from_rooted_slice 2021-07-28 09:10:55 +09:00
yvt
110b3ab6bc style(script): add underscore to unused parameter 2021-07-27 22:38:32 +09:00
yvt
b6ee398b91 refactor(script): make grouping clearer while keeping test-tidy happy 2021-07-27 22:26:28 +09:00
yvt
2e0dd0816f refactor(script): refactor common code into PropertyDefiner.generateUnguardedArray
There are code fragments in `(Method|Attr)Definer.generateArray` that
are much alike. This commit refactors them into a new method of
`PropertyDefiner` named `generateUnguardedArray` (in contrast to the
existing method `generateGuardedArray`).
2021-07-27 01:31:08 +09:00
yvt
c28e98ec40 refactor(script): squash CGDOMJSProxyHandler_set
The implementation in `crate::dom::bindings::proxyhandler::
maybe_cross_origin_set_rawcx` is now directly assigned to `ProxyTraps::
set`.
2021-07-26 01:07:29 +09:00
yvt
66a4ea0727 doc(script): fix comments
`History` is not a maybe-cross-origin object. I must have been very
sleepy when I wrote this.
2021-07-26 01:06:24 +09:00
yvt
e98cba1896 refactor(script): don't conjure up ServoJSPrincipals in ServoJSPrincipalsRef::deref
It's technically safe to do because of `#[repr(transparent)]` and is a
prerequisite of having `ServoJSPrincipalsRef: Copy`, but I guess it's
not worth an `unsafe` block.
2021-07-25 19:36:06 +09:00
yvt
690d8462a5 refactor(script): apply suggestions 2021-07-25 18:45:22 +09:00
yvt
df5e2911fd
refactor(script): apply suggestion
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2021-07-25 17:20:09 +09:00
bors-servo
052278d058
Auto merge of #28550 - yvt:feat-shorter-thread-names, r=jdm
Shorten thread names to prevent information loss

The Linux kernel [imposes][1] a 15-byte limit on thread names. This means information that does not fit in this limit, e.g., the pipeline ID of layout and script threads, is lost in a debugger and profiler (see the first column of the table below).

This commit shortens the thread names used in Servo to maximize the amount of information conveyed. It also rectifies some inconsistencies in the names.

|       Before      |       After       |
|-------------------|-------------------|
| `BluetoothThread` | `Bluetooth`       |
| `CanvasThread`    | `Canvas`          |
| `display alert d` | `AlertDialog`     |
| `FontCacheThread` | `FontCache`       |
| `GLPlayerThread`  | `GLPlayer`        |
| `HTML Parser`     | `Parse:www.examp` |
| `LayoutThread Pi` | `Layout(1,1)`     |
| `Memory profiler` | `MemoryProfiler`  |
| `Memory profiler` | `MemoryProfTimer` |
| `OfflineAudioCon` | `OfflineACResolv` |
| `PullTimelineMar` | `PullTimelineDat` |
| `ScriptThread Pi` | `Script(1,1)`     |
| `WebWorker for h` | `WW:www.example.` |
| `ServiceWorker f` | `SW:www.example.` |
| `ServiceWorkerMa` | `SvcWorkerManage` |
| `Time profiler t` | `TimeProfTimer`   |
| `Time profiler`   | `TimeProfiler`    |
| `WebGL thread`    | `WebGL`           |
| `Choose a device` | `DevicePicker`    |
| `Pick a file`     | `FilePicker`      |
| `Pick files`      | `FilePicker`      |

[1]: https://stackoverflow.com/questions/5026531/thread-name-longer-than-15-chars

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #28548

---
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they don't affect Servo's primary functionality in any way
2021-07-24 12:26:27 -04:00
bors-servo
d4f37d466e
Auto merge of #28547 - yvt:ci-repetition, r=jdm
Optimize repetition in workflow configuration

Replaces 20 CI jobs (`linux-wpt-{1, 2, ..., 20}`) with one with a build matrix.

---
- [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)

---
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they only affect the CI pipeline
2021-07-24 09:58:13 -04:00
yvt
36f33ab02c chore(ci): move jobs.<job_id>.{strategy.matrix -> env}.max_chunk_id 2021-07-20 00:21:23 +09:00
bors-servo
f5c0296649
Auto merge of #28551 - okias:py2cleanup, r=jdm
mach: cleanup after dropping Python 2 support

Signed-off-by: David Heidelberg <david@ixit.cz>

<!-- 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
- [ ] `./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 if it builds, then it works 😄

<!-- 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. -->
2021-07-19 08:56:29 -04:00
David Heidelberg
aa0484d76b
mach: cleanup after dropping Python 2 support
Signed-off-by: David Heidelberg <david@ixit.cz>
2021-07-19 14:24:29 +02:00
yvt
41b3726271 feat: shorten thread names
The Linux kernel imposes a 15-byte limit on thread names[1]. This means
information that does not fit in this limit, e.g., the pipeline ID of
layout and script threads, is lost in a debugger and profiler (see the
first column of the table below).

This commit shortens the thread names used in Servo to maximize the
amount of information conveyed. It also rectifies some inconsistencies
in the names.

|       Before      |       After       |
|-------------------|-------------------|
| `BluetoothThread` | `Bluetooth`       |
| `CanvasThread`    | `Canvas`          |
| `display alert d` | `AlertDialog`     |
| `FontCacheThread` | `FontCache`       |
| `GLPlayerThread`  | `GLPlayer`        |
| `HTML Parser`     | `Parse:www.examp` |
| `LayoutThread Pi` | `Layout(1,1)`     |
| `Memory profiler` | `MemoryProfiler`  |
| `Memory profiler` | `MemoryProfTimer` |
| `OfflineAudioCon` | `OfflineACResolv` |
| `PullTimelineMar` | `PullTimelineDat` |
| `ScriptThread Pi` | `Script(1,1)`     |
| `WebWorker for h` | `WW:www.example.` |
| `ServiceWorker f` | `SW:www.example.` |
| `ServiceWorkerMa` | `SvcWorkerManage` |
| `Time profiler t` | `TimeProfTimer`   |
| `Time profiler`   | `TimeProfiler`    |
| `WebGL thread`    | `WebGL`           |
| `Choose a device` | `DevicePicker`    |
| `Pick a file`     | `FilePicker`      |
| `Pick files`      | `FilePicker`      |

[1]: https://stackoverflow.com/questions/5026531/thread-name-longer-than-15-chars
2021-07-19 00:57:48 +09:00
yvt
f369f36ec4 chore(ci): make parameter names more descriptive and less error-prone 2021-07-18 21:55:25 +09:00
yvt
9e71bd6a70 chore(ci): remove the auto-generation of main.yml 2021-07-18 21:35:24 +09:00
bors-servo
e8cb9f56e3
Auto merge of #28549 - jdm:rustup2, r=jdm
Update to 7/17 nightly.
2021-07-17 17:39:19 -04:00
Josh Matthews
8d5dd66ed3 Update to 7/17 nightly. 2021-07-17 16:41:38 -04:00
yvt
c692ac1c0a chore(ci): optimize repetition in workflow configuration
Replaces 20 CI jobs (`linux-wpt-{1, 2, ..., 20}`) with one with a build
matrix.
2021-07-17 21:20:49 +09:00
yvt
d733abfca0 style(script): address test-tidy errors 2021-07-17 17:06:05 +09:00
yvt
a6b2f75656 feat(script): implement getOwnEnumerablePropertyKeys for Location
Fixes the following assertion from `tests/wpt/web-platform-tests/html/
browsers/origin/cross-origin-objects/cross-origin-objects.html`:

    assert_equals(Object.keys(win.location).length, 0,
                        "Object.keys() gives the right answer for cross-origin Location");
2021-07-17 15:26:15 +09:00
yvt
75242d6c4c feat(script): implement the last step of CrossOriginOwnPropertyKeys 2021-07-17 15:26:15 +09:00
yvt
1bcbdae27b doc(script): improve comments in proxyhandler.rs 2021-07-17 15:26:15 +09:00
yvt
4bc3453174 feat(script): Implement [[Set]] for Location 2021-07-17 15:26:15 +09:00
yvt
80cda12a87 test: update expectations
No improvements are seen in `/html/browsers/origin/cross-origin-
objects/cross-origin-objects.html` because each included test case
tests both `Location` and `WindowProxy`, the latter of which isn't
implemented correctly yet. In fact, the first test case "Basic sanity-
checking" passes if it's reduced to only check `Location` as follows:

    addTest(function(win) {
      assert_equals(B.location.pathname, path, "location.href works same-origin");
      assert_throws("SecurityError", function() { win.location.pathname; }, "location.pathname throws cross-origin");
    }, "Basic sanity-checking");
2021-07-17 15:26:15 +09:00
yvt
bdd20f0139 feat(script): enable js::ProxyOptions::setLazyProto for maybe-cross-origin objects
Setting the lazy proto option allows proxy handlers to provide dynamic
prototype objects. This is necessary for the customization of
`ProxyTraps::{get,set}PrototypeOf` to actually take effect.
2021-07-17 15:26:15 +09:00
yvt
722a239715 feat(script): Implement [[{Get,Set}PrototypeOf]] for Location 2021-07-17 15:26:15 +09:00
bors-servo
1522befabb
Auto merge of #28543 - lrazovic:master, r=jdm
Upgrade to uluru 2

* Update `uluru` dependency from 0.4 to 2, which slightly simplifies the syntax and remove some dependencies.
---
- [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)
---
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because it introduces no behavioral changes
2021-07-16 02:57:27 -04:00
Leonardo Razovic
ef7eb02b8d
Upgrade to uluru 2 2021-07-15 18:28:12 +02:00
yvt
41cce140bc feat(script): implement some of the non-ordinary internal methods of Location
<https://html.spec.whatwg.org/multipage/#the-location-interface>

 - `[[GetPrototypeOf]]`: not yet
 - `[[SetPrototypeOf]]`: not yet
 - `[[IsExtensible]]`: `proxyhandler::is_extensible`
 - `[[PreventExtensions]]`: `proxyhandler::prevent_extensions`
 - `[[GetOwnProperty]]`: `CGDOMJSProxyHandler_getOwnPropertyDescriptor` (updated)
 - `[[DefineOwnProperty]]`: `CGDOMJSProxyHandler_defineProperty` (updated)
 - `[[Get]]`: `CGDOMJSProxyHandler_get` (updated)
 - `[[Set]]`: not yet
 - `[[Delete]]`: `CGDOMJSProxyHandler_delete` (updated)
 - `[[OwnPropertyKeys]]`: `CGDOMJSProxyHandler_ownPropertyKeys` (updated)
2021-07-16 01:26:05 +09:00
yvt
1a033ba8a9 test: re-enable /html/browsers/origin/cross-origin-objects/cross-origin-objects.html 2021-07-16 01:24:09 +09:00
yvt
1d970b1351 feat(script): add CrossOrigin*able attributes to Window and Location's members 2021-07-15 00:07:04 +09:00
yvt
863c90acd8 Merge remote-tracking branch 'upstream/master' into feat-cow-infra 2021-07-14 01:00:04 +09:00
yvt
f884506dfb refactor(script): auto ref-count ServoJSPrincipals 2021-07-13 23:08:23 +09:00
yvt
b77ee8721b refactor(script): rename ServoJSPrincipal to ServoJSPrincipals 2021-07-13 21:51:54 +09:00
yvt
320965bfb9 refactor(script): move crate::dom::bindings::{utils → principals)::ServoJSPrincipal 2021-07-13 21:45:21 +09:00