aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/codegen/CodegenRust.py
Commit message (Collapse)AuthorAgeFilesLines
* Impl Setlike and Maplike (#30237)Samson2023-09-061-1/+76
| | | | | | | | | | | | | | | | | | | * 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
* build(deps): bump bitflags from 1.3.2 to 2.3.1 (#30273)Martin Robinson2023-09-011-1/+1
| | | | | | 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)
* Fix the 32-bit build (#30204)Martin Robinson2023-08-251-2/+2
| | | | 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.
* Throw type error when calling DOM constructor without new.Josh Matthews2023-05-301-15/+35
|
* Support arbitrary protos when wrapping DOM objects with constructors.Josh Matthews2023-05-281-3/+1
|
* Support arbitrary protos when wrapping EventTarget objects.Josh Matthews2023-05-281-12/+43
|
* Use an enum to pass the index value for interfaces/protos.Josh Matthews2023-05-261-5/+8
|
* Extract bodies of DefineDOMInterface and GetProtoObject/GetConstructorObject ↵Josh Matthews2023-05-261-29/+12
| | | | out of generated bindings.
* apply pylbrecht/servo/named.window.getter (closes #27952)Delan Azabani2023-03-231-15/+19
|
* Fix Codegensagudev2023-02-201-30/+30
|
* Changes for spidermomkey upgrade.Josh Matthews2022-11-231-31/+36
|
* Update CodegenRust.pyKagami Sascha Rosylight2022-01-051-7/+7
|
* fix(script): the condition for exposing a cross-origin setter is ↵yvt2021-08-171-1/+1
| | | | | | | | | | | | | | | | | | `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.
* refactor(script): make grouping clearer while keeping `test-tidy` happyyvt2021-07-271-3/+4
|
* refactor(script): refactor common code into ↵yvt2021-07-271-20/+38
| | | | | | | | | `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`).
* refactor(script): squash `CGDOMJSProxyHandler_set`yvt2021-07-261-51/+5
| | | | | | The implementation in `crate::dom::bindings::proxyhandler:: maybe_cross_origin_set_rawcx` is now directly assigned to `ProxyTraps:: set`.
* refactor(script): apply suggestionsyvt2021-07-251-1/+0
|
* style(script): address `test-tidy` errorsyvt2021-07-171-1/+1
|
* feat(script): implement `getOwnEnumerablePropertyKeys` for `Location`yvt2021-07-171-3/+6
| | | | | | | | 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");
* feat(script): Implement `[[Set]]` for `Location`yvt2021-07-171-3/+57
|
* feat(script): enable `js::ProxyOptions::setLazyProto` for maybe-cross-origin ↵yvt2021-07-171-2/+14
| | | | | | | | 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.
* feat(script): Implement `[[{Get,Set}PrototypeOf]]` for `Location`yvt2021-07-171-7/+37
|
* feat(script): implement some of the non-ordinary internal methods of `Location`yvt2021-07-161-27/+205
| | | | | | | | | | | | | | | <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)
* feat(script): use `GlobalScope::origin` when creating a principals objectyvt2021-07-131-2/+2
| | | | | | | | | | | | | | | 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
* fix(script): apply some of the changes requested in the review comments of ↵yvt2021-07-121-1/+1
| | | | #16501
* Merge remote-tracking branch 'upstream/master' into feat-cow-infrayvt2021-07-111-0/+3
|\
| * chore(deps): update mozjsyvt2021-07-101-0/+3
| | | | | | | | - a8b688a: Add `ProxyTraps::{getPrototype, setPrototype, setImmutablePrototype}`
* | Merge remote-tracking branch 'upstream/master' into feat-cow-infrayvt2021-07-101-1091/+1857
|\| | | | | | | | | `tests/wpt/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html` was reverted to the upstream version.
| * Fix errorsagudev2021-04-171-1/+1
| |
| * Fix for bindgensagudev2021-04-171-0/+1
| |
| * Update mozjs to 88sagudev2021-04-141-9/+12
| |
| * Port some code to Python3Vincent Ricard2021-02-181-20/+20
| |
| * Implement toStringTag symbol for DOM objects.Josh Matthews2021-02-181-22/+69
| | | | | | | | This symbol is now required for the expected stringification behaviour in WPT.
| * Update mozjs.Josh Matthews2021-02-181-4/+3
| |
| * Added is_platform_obj_staticSean Joseph2020-11-261-1/+2
| |
| * Add creation url and Secure ContextsJonathan Kingston2020-11-251-4/+9
| |
| * Update mozjs to 0.14.1Sudarsan2020-08-281-0/+2
| | | | | | | | | | | | | | 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.
| * dom: Generate iterator symbol for interfaces with indexed getters.Josh Matthews2020-07-091-2/+21
| |
| * dom: Use pref macro for IDL conditional guards.Josh Matthews2020-07-091-1/+1
| |
| * Fix incorrect string joiningKagami Sascha Rosylight2020-06-211-2/+2
| |
| * Fix remaining flake8 warningsKagami Sascha Rosylight2020-06-211-168/+169
| |
| * dom: Convert parent dictionary values when converting dictionaries to JS.Josh Matthews2020-06-161-4/+13
| |
| * Use atomic pointers instead of `static mut` for DOM proxy handlersSimon Sapin2020-06-051-3/+9
| |
| * Keep DOM proxy handlers as separate named items rather than in one arraySimon Sapin2020-06-051-10/+12
| |
| * integrate readablestream with fetch and blobGregory Terzian2020-06-041-0/+37
| |
| * Auto merge of #25432 - warren-fisher:HTMLConstructor, r=jdmbors-servo2020-06-031-70/+6
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract some of CGClassConstructHook to utils.rs <!-- Please describe your changes on the following line: --> Moving some of the functionality from the massive tripled quoted string in CGClassConstructHook in `components/script/dom/bindings/codegen/CodegenRust.py` to `components/script/dom/bindings/utils.rs`. Must be made unsafe because of UnwrapObjectDynamic and other functions. Added imports as necessary as well, as well as cleaning up using test-tidy. --- <!-- 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 #25395 (GitHub issue number if applicable) <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because the issue says so <!-- 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. -->
| | * Reduce code duplication. Move some of CodegenRust.py to htmlconstructor.rsWarren Fisher2020-06-031-70/+6
| | |
| * | Improve webidl precisionKunal Mohan2020-06-011-8/+12
| | | | | | | | | | | | Allow enum variants staring with digit
| * | Allow sequence of nullable dictionary items in webidlKunal Mohan2020-05-301-2/+5
| | | | | | | | | | | | of type "sequence<Dict?> x"
| * | Auto merge of #26718 - jdm:codegen-sequence, r=Manishearthbors-servo2020-05-291-4/+4
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve precision of sequence types for WebIDL codegen. Unlike #26699, this doesn't attempt to improve any of the resulting types and only maintains the status quo. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] There are tests for these changes