Commit graph

703 commits

Author SHA1 Message Date
Taym Haddadi
9d2c102fa0
Use FLoat32Array in GamepadPose (#31106)
* Use FLoat32Array in GamepadPose

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove unused create_typed_array

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-01-19 04:39:09 +00:00
Taym Haddadi
f76982e2e7
script: Use FLoat32Array in XRRay (#31087)
* use FLoat32Array in XRRay

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Apply suggestions from code review

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-01-17 10:38:01 +00:00
Taym Haddadi
6a7b450478
use FLoat32Array in XRRigidTransform (#31076)
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-01-17 08:14:35 +00:00
tannal
8c53a8c745
use FLoat32Array in XRView (#31077)
* use FLoat32Array in XRView

* handle error when calling set_data

Yes, we should handle this.

Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>

* fix: error handling

* chore: error message

---------

Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>
2024-01-16 15:56:32 +00:00
Gregory Terzian
e145c51234
WebIDL: use FLoat32Array (#30990)
* inital

* audiobuffer: return float 32 array as channel data

* add on heap float 32 array type

* fix warnings

* add list of webidl interfaces to ignore for float 32

* codegen: remove duplication of builtin return type handling

* bindings: derive default for float 32 array wrapper

* bindings: allow unsafe code in typedarrays module

* bindings: rename float 32 array wrapper

* bindings: rename HeapFloat32Array is_set method to is_initialized

* bindings: assert float 32 array is initialized before data can be acquired

* bindings: use let syntax for error handling in float 32 array wrapper

* bindings: use copy_from_slice where possible in float 32 array wrapper

* bindings: rename args in typedarray copy methods

* codegen: use idl type in builtin names for float 32 array

* bindings: add a util to create float 32 arrays, use in dom matrix readonly

* codegen: tidy

* bindings: box the heap inside heaped float 32 arrays
2024-01-11 09:43:36 +00:00
Samson
604979e367
Replace script_plugins with a clippy like rustc driver (named crown) (#30508)
* Remove script_plugins

* Use crown instead of script_plugins

* crown_is_not_used

* Use crown in command base

* bootstrap crown

* tidy happy

* disable sccache

* Bring crown in tree

* Install crown from tree

* fix windows ci

* fix warning

* fix mac

libscript_plugins.dylib is not available anymore

* Update components/script/lib.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update for nightly-2023-03-18

Mostly just based off https://github.com/servo/servo/pull/30630

* Always install crown

it's slow only when there is new version

* Run crown test with `mach test-unit`

* Small fixups; better trace_in_no_trace tests

* Better doc

* crown in config.toml

* Fix tidy for real

* no sccache on rustc_wrapper

* document rustc overrides

* fixup of compiletest

* Make a few minor comment adjustments

* Fix a typo in python/servo/platform/base.py

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>

* Proper test types

* Ignore tidy on crown/tests

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-12-01 15:50:52 +00:00
Samson
8436002383
Support Namespace const in webidl (#30492)
* Add TestNS with const

* Implement namespace const in codegen
2023-10-04 11:29:54 +00:00
Samson
ddc47aa56b
Codegen support multiple interfaces in single webidl file & WebGPU single webidl (#30448)
* Codegen support multiple interfaces in single webidl file

* Merge GPU*.webidl into WebGPU.webidl

* Update gpu files to use WebGPUBinding module file
2023-09-30 12:30:12 +00:00
Samson
ebd41d4101
Use Foo_Binding instead of FooBinding for namespace modules (#30447)
* Update Codegen.py to emit Foo_Binding instead of FooBinding

* s/FooBinding/Foo_Binding/g
2023-09-30 00:52:04 +00:00
Samson
711dbbd4af
remove extern crate (#30311)
* remove extern crate

* Update components/script_plugins/lib.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-09-08 12:11:31 +00:00
Martin Robinson
a1b83cac2a
Replace a method call now deprecated in mozjs (#30307) 2023-09-06 23:29:04 +00:00
Samson
e0a6281e73
Impl Setlike and Maplike (#30237)
* MallocSizeOf for Index{Set, Map}

* like as iterable in WebIDL

* Codegen magic for like interfaces

* TestBinding for like

* Test for Setlike and Maplike test bindings

* Some fixes

* Switch to any.js

* nit

* Keep order
2023-09-06 13:08:45 +00:00
Martin Robinson
e9281e2eda
build(deps): bump bitflags from 1.3.2 to 2.3.1 (#30273)
Bumps [bitflags](https://github.com/bitflags/bitflags) from 1.3.2 to 2.3.1.
 - [Release notes](https://github.com/bitflags/bitflags/releases)
 - [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
 - [Commits](https://github.com/bitflags/bitflags/compare/1.3.2...2.3.1)
2023-09-01 09:58:48 +00:00
Martin Robinson
65138add46
Fix the 32-bit build (#30204)
Use the `libc::char` to represent a pointer to characters rather than
`i8`. This fixes the build for the Raspberry Pi and Android 32-bit.
2023-08-25 08:11:54 +00:00
Josh Matthews
56a8237ef4 Throw type error when calling DOM constructor without new. 2023-05-30 10:32:33 -04:00
Josh Matthews
dbff26bce0 Support arbitrary protos when wrapping DOM objects with constructors. 2023-05-28 23:23:12 -04:00
Josh Matthews
d9600ff50f Support arbitrary protos when wrapping EventTarget objects. 2023-05-28 23:23:12 -04:00
Josh Matthews
7d9dc458af Use an enum to pass the index value for interfaces/protos. 2023-05-26 01:21:31 -04:00
Josh Matthews
747a99d3f6 Extract bodies of DefineDOMInterface and GetProtoObject/GetConstructorObject out of generated bindings. 2023-05-26 01:02:38 -04:00
Delan Azabani
fd1de05592 apply pylbrecht/servo/named.window.getter (closes #27952) 2023-03-23 18:01:26 +08:00
sagudev
ee7c393773 Fix Codegen 2023-02-20 06:16:13 +01:00
Josh Matthews
bd77a4043c Changes for spidermomkey upgrade. 2022-11-23 10:04:50 -05:00
Kagami Sascha Rosylight
4bd814a078 Update CodegenRust.py 2022-01-05 13:54:56 +01:00
yvt
c25355704d fix(script): the condition for exposing a cross-origin setter is CrossOriginWritable, not CrossOriginReadable
The expression `crossOriginIframe.contentWindow.location.href = "new
href"` takes the following steps: (1) Get the setter for `href` by
invoking `[[GetOwnProperty]]` on `crossOriginIframe.contentWindow.
location`. (2) Call the setter, passing `crossOriginIframe.
contentWindow` and `"new href"`. Since the target `Location` is cross
origin, getting the setter succeeds only if the `CrossOriginWritable`
extended attribute is present on the `href` attribute, and it's present.
However, instead of `CrossOriginWritable`, `CrossOriginReadable` was
checked mistakenly.

Since `Location#href` has `CrossOriginWritable` but not
`CrossOriginReadable`, this bug rendered `Location#href` inaccessible
from a cross-origin document.
2021-08-17 09:26:27 +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
690d8462a5 refactor(script): apply suggestions 2021-07-25 18:45:22 +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
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
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
e786627199 fix(script): apply some of the changes requested in the review comments of #16501 2021-07-12 01:29:41 +09:00
yvt
fd177a9199 Merge remote-tracking branch 'upstream/master' into feat-cow-infra 2021-07-11 22:22:43 +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
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
Vincent Ricard
a627dde0d0 Port some code to Python3 2021-02-18 09:35:46 -05:00
Josh Matthews
397b9b2601 Implement toStringTag symbol for DOM objects.
This symbol is now required for the expected stringification behaviour in WPT.
2021-02-18 09:35:46 -05:00
Josh Matthews
5c4939599e Update mozjs. 2021-02-18 09:35:45 -05:00
Sean Joseph
823cca30d6 Added is_platform_obj_static 2020-11-26 18:30:52 -05:00
Jonathan Kingston
0e1479cc84 Add creation url and Secure Contexts 2020-11-25 18:30:50 +00:00
Sudarsan
f8c9ee4eff Update mozjs to 0.14.1
This update pulls in improvements on mozjs that now removes the need to
pass pointers to CompileOptionsWraper::new(), allows NewProxyObject to
now accept a Singleton bool and JSClass and removes an unsafe
Handle::new usage.
2020-08-28 20:54:18 +08:00
Josh Matthews
63528f6fdf dom: Generate iterator symbol for interfaces with indexed getters. 2020-07-09 23:22:48 -04:00
Josh Matthews
aa80f91399 dom: Use pref macro for IDL conditional guards. 2020-07-09 23:22:48 -04:00