Commit graph

8790 commits

Author SHA1 Message Date
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
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
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
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
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
yvt
dfb4a0c844 refactor(script): remove {DedicatedWorkerGlobalScope, ServiceWorkerGlobalScope}::origin 2021-07-13 21:27:26 +09:00
yvt
90b78a193c Revert "feat(script): add {DissimilarOriginWindow, PaintWorkletGlobalScope, TestWorkletGlobalScope}::origin"
This reverts commit 5959c2ef9b.
2021-07-13 21:12:44 +09:00
yvt
c3de9b72a6 feat(script): use GlobalScope::origin when creating a principals object
The concrete types of `[Global]` DOM interfaces have `origin` methods,
which were used before this commit. Some of them just delegate to
`GlobalScope::origin` while others are implemented differently. This
commit changes the created principals objects' associated origins in the
following way:

 - `DedicatedWorkerGlobalScope` - was `WorkerGlobalScope::worker_url`
 - `DissimilarOriginWindow` - no change
 - `PaintWorkletGlobalScope` - no change
 - `ServiceWorkerGlobalScope` - was `ServiceWorkerGlobalScope::scope_url`
 - `TestWorkletGlobalScope` - no change
 - `Window` - no change
2021-07-13 21:06:52 +09:00
yvt
52c60e0bf5
doc(script): use the recommended format of a WHATWG link
Enforced by `./mach test-tidy`
2021-07-13 12:19:49 +09:00
yvt
65aa3b0b4d doc(script): update comments in run_worker_scope and run_serviceworker_scope
The step numbers changed over time.

Note that service workers and non-service workers use different steps
defined in different specifications.
2021-07-13 09:31:17 +09:00
yvt
e9af95ec0f fix(script): Set DedicatedWorkerGlobalScope's origin correctly
<https://html.spec.whatwg.org/multipage/workers.html#worker-processing-model>

> 10.2.4 Processing model
>
> When a user agent is to run a worker for a script with `Worker` or
> `SharedWorker` object `worker`, [...] it must run the following steps.
>
> [...]
>
> 8. Set up a worker environment settings object with `realm execution
>    context` and `outside settings`, and let `inside settings` be the
>    result.

<https://html.spec.whatwg.org/multipage/workers.html#script-settings-for-workers>

> To **set up a worker environment settings object**, given a JavaScript
> execution context `execution context` and environment settings object
> `outside settings`:
>
> 1. Let `inherited origin` be `outside settings`'s origin.
>
> 2. Let `realm` be the value of `execution context`'s Realm component.
>
> 3. Let `worker global scope` be `realm`'s global object.
>
> 4. Let `settings object` be a new environment settings object whose
>    algorithms are defined as follows:
>
>    **The origin** Return a unique opaque origin if `worker global
>    scope`'s url's scheme is "data", and `inherited origin` otherwise.
2021-07-13 09:31:15 +09:00
yvt
3550270cd0 fix(script): implement the destroy-principals callback correctly 2021-07-12 01:30:02 +09:00
yvt
e786627199 fix(script): apply some of the changes requested in the review comments of #16501 2021-07-12 01:29:41 +09:00
yvt
bbb2cc42fe fix(script): remove debug printing 2021-07-12 00:02:28 +09:00
yvt
5959c2ef9b feat(script): add {DissimilarOriginWindow, PaintWorkletGlobalScope, TestWorkletGlobalScope}::origin 2021-07-11 23:30:42 +09:00
yvt
bfa2026220 feat(script): remove the call to JS_SetWrapObjectCallbacks
We don't make CCWs anymore.
2021-07-11 23:30:40 +09:00
yvt
40fbe6b722 chore(deps): update mozjs
- 798c5b6: Bring `RustJSPrincipals` back
2021-07-11 23:01:21 +09:00
yvt
fd177a9199 Merge remote-tracking branch 'upstream/master' into feat-cow-infra 2021-07-11 22:22:43 +09:00
bors-servo
4181962504
Auto merge of #28538 - yvt:chore-mozjs, r=jdm
Update mozjs

 - <https://github.com/servo/rust-mozjs/pull/548>

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

---
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it introduces no behavioral changes
2021-07-10 13:39:59 -04:00
bors-servo
d8081343e3
Auto merge of #27805 - halvko:html_progress_element, r=jdm
Properly implement HTMLProgressElement DOM code

<!-- Please describe your changes on the following line: -->
The DOM code for HTMLProgressElement have been implemented, according to https://html.spec.whatwg.org/multipage/form-elements.html#the-progress-element . As mentioned in #23201, tests already exists for this element in tests/wpt/web-platform-tests/html/semantics/forms/the-progress-element/, which now passes (tested on Linux).

---
<!-- 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. -->
2021-07-10 11:21:30 -04:00
yvt
28c670d6c3 fix: accommodate to the modern age 2021-07-10 18:18:33 +09:00
yvt
01a7de50ab Merge remote-tracking branch 'upstream/master' into feat-cow-infra
`tests/wpt/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html`
was reverted to the upstream version.
2021-07-10 17:55:42 +09:00
yvt
727662a1e6 chore(deps): update mozjs
- a8b688a: Add `ProxyTraps::{getPrototype, setPrototype, setImmutablePrototype}`
2021-07-10 12:54:31 +09:00
yvt
d597264d1b doc(script): we don't do cross-compartment brain transplantation anymore 2021-07-07 22:21:26 +09:00
yvt
5871d09c26 fix(script): one compartment for each script thread (agent)
Documents in the same agent[1] can share and exchange JS and DOM objects
freely, so putting them in separate compartments would require almost
every instance of `Dom` to be able to handle cross-compartment
references.

[1]: https://html.spec.whatwg.org/multipage/webappapis.html#integration-with-the-javascript-agent-formalism
2021-07-06 09:10:33 +09:00
Adrian Willenbücher
0917dc4e87 Replaced ref_slice::ref_slice with std::slice::from_ref
ref_slice::ref_slice is deprecated in ref_slice-1.2.1,
because it's redundant with std since rust 1.28.

Signed-off-by: Adrian Willenbücher <willenbuecher@xq-tec.com>
2021-06-10 21:17:04 +02:00
sagudev
fd3bbc7ec9 Fix error 2021-04-17 18:19:02 +02:00
sagudev
13095741c5 Fix for bindgen 2021-04-17 17:53:11 +02:00
sagudev
19be2cd3fa Update mozjs to 88 2021-04-14 09:20:58 +02:00
Erik Funder Carstensen
85ac792fc0 Properly implement HTMLProgressElement DOM code
Signed-off-by: Erik Funder Carstensen <fundererik@gmail.com>
2021-03-31 19:03:37 +02:00
bors-servo
c52d84dafa
Auto merge of #28300 - sagudev:master, r=jdm
Update mozjs to 87

Depends on: https://github.com/servo/rust-mozjs/pull/540
2021-03-30 07:38:57 -04:00
sagu
3ef3ee5a62
Fix warning 2021-03-30 12:09:18 +02:00
sagudev
5f91ab07da fmt 2021-03-30 11:38:33 +02:00
sagu
61d7775673
Update imagedata.rs 2021-03-30 06:21:05 +02:00
Philip Lamb
b8a74e89cf Improve IME messaging to embedder with insertion point index and multiline flag. 2021-03-29 17:55:54 +13:00
sagudev
b921cd14df Fix errors 2021-03-19 07:01:46 +01:00
sagudev
a265a2a7e6 Formating 2021-03-12 18:30:13 +01:00