aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/utils.rs
Commit message (Collapse)AuthorAgeFilesLines
* Use out parameter for generated methods returning JSVal (#34087)Josh Matthews2024-11-051-5/+7
| | | | | | | | | | | | | | | | | | | | | * Make generated bindings that return a WebIDL `any` value use out parameters. Returning raw JSVal values makes it easier to create GC hazards in code that calls these methods. Accepting a MutableHandle argument instead ensures that the values are rooted by the caller. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Update mozjs. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* frozen array in XRInputSourcesChangeEvent, update `to_frozen_array` doc (#34100)chickenleaf2024-11-021-1/+1
| | | | | | | | | | | | | | | | | * frozen array in XRInputSourcesChangeEvent, update o_frozen_array doc Signed-off-by: L Ashwin B <lashwinib@gmail.com> * simplified changes Signed-off-by: L Ashwin B <lashwinib@gmail.com> * added tests Signed-off-by: L Ashwin B <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* tidy: Fix rustdoc warnings and add a tidy check for a common URL issue (#33366)Martin Robinson2024-09-081-2/+2
| | | | | | | | This change fixes all rustdoc errors and also adds a tidy check for a very common rustdoc URL issue. Eventually rustdoc warnings should likely cause the build to fail, but this catches those issues sooner in order to not waste so much developer time. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* jsstring_to_str should accept a NonNull argument for the JS string (#33306)Andriy Sultanov2024-09-051-12/+12
| | | | | | Instead of asserting the raw pointer is not null, force callers to produce a NonNull pointer. Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>
* fix: Replace callargs_is_constructing with is_constructing method (#33101)Koki Saito2024-08-181-4/+0
| | | | Signed-off-by: Koki Saito <saitoto828@gmail.com> Co-authored-by: kokisaito <kosaito@indeed.com>
* Add exception to rejection logic in `generic_call` (#32950)Samson2024-08-061-11/+19
| | | | | | | | | | | | | | | | | | | | | * exception in JS Promise Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * EXCEPTION_TO_REJECTION on generic_call Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * PromiseRejectionEvent should handle promise as object Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* bindings: Convert certain Exceptions into Promise rejections (#32923)Samson2024-08-031-8/+49
| | | | | | | | | | | | | | | | | | | | | | | | | * Impl promise exception to rejection for methods Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Impl promise exception to rejection for getters Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Impl promise exception to rejection for static methods Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Add tests for exception to rejection Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Expectations Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* fix: Memory leak from CreateProxyWindowHandler (#32773)Erik Hennig2024-08-011-14/+5
| | | | | | | | | | | | | | | | | * fix: Memory leak from CreateProxyWindowHandler Signed-off-by: ede1998 <online@erik-hennig.me> * fix: memory leak in WindowProxy Signed-off-by: ede1998 <online@erik-hennig.me> * fix: Memory leak in WindowProxyHandler through static Signed-off-by: ede1998 <online@erik-hennig.me> --------- Signed-off-by: ede1998 <online@erik-hennig.me>
* fixed various clippy warnings (#31954)Rosemary Ajayi2024-03-311-1/+1
|
* clippy: Fix a variety of warnings in components/script/dom (#31894)Ekta Siwach2024-03-291-1/+1
|
* clippy: Fix `unnecessary_cast` warnings in `components/script` (#31823)Oluwatobi Sofela2024-03-221-1/+1
| | | | | | | * clippy: Fix unnecessary cast warnings * clippy: Replace redundant field names with their shorthand alternatives * clippy: Delete struct pattern dereferencings
* clippy: Fix dereferencing a tuple pattern warnings (#31811)Oluwatobi Sofela2024-03-211-1/+1
|
* Remove repeated imports from generated code (#31711)eri2024-03-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * feat: try to deduplicate imports in codegen * feat: another attempt * feat: start testing imports * feat: clean all global imports * feat: remove shared imports from CGDescriptor * feat: remove redundant imports from CGDescriptor * fix: formatting * fix: remove libc (base level import) * feat: roll back named path changes * feat: last changes and tidy * experiment: move imports into a separate file * fix: extra parenthesis * fix: remove repeated allow statement
* Use FLoat32Array in GamepadPose (#31106)Taym Haddadi2024-01-191-10/+0
| | | | | | | | | | | | | * 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>
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-37/+31
| | | | | * strict imports formatting * Reformat all imports
* Use MozTools 4 and update mozjs (#30326)Samson2023-09-111-1/+1
| | | | | | | | | | | | | | | | | | | * Update mozjs * moztools4 in bootstrap * no autoconf * tidy * switch to servo-build-deps * update mozjs for real * glue mozjs * fmt * move to servo/mozjs
* Throw type error when calling DOM constructor without new.Josh Matthews2023-05-301-0/+4
|
* Support arbitrary protos when wrapping EventTarget objects.Josh Matthews2023-05-281-0/+4
|
* Format.Josh Matthews2022-11-231-1/+1
|
* Changes for spidermomkey upgrade.Josh Matthews2022-11-231-11/+9
|
* refactor(script): move `crate::dom::bindings::{utils → ↵yvt2021-07-131-45/+0
| | | | principals)::ServoJSPrincipal`
* fix(script): implement the destroy-principals callback correctlyyvt2021-07-121-2/+6
|
* fix(script): apply some of the changes requested in the review comments of ↵yvt2021-07-121-2/+2
| | | | #16501
* feat(script): remove the call to `JS_SetWrapObjectCallbacks`yvt2021-07-111-168/+8
| | | | We don't make CCWs anymore.
* chore(deps): update mozjsyvt2021-07-111-5/+23
| | | | - 798c5b6: Bring `RustJSPrincipals` back
* fix: accommodate to the modern ageyvt2021-07-101-4/+13
|
* Merge remote-tracking branch 'upstream/master' into feat-cow-infrayvt2021-07-101-199/+331
|\ | | | | | | | | `tests/wpt/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html` was reverted to the upstream version.
| * Update mozjs.Josh Matthews2021-02-181-9/+30
| |
| * Added is_platform_obj_staticSean Joseph2020-11-261-4/+19
| |
| * Remove unnecessary generic from private_from_proto_check.Josh Matthews2020-06-041-4/+5
| |
| * Remove WebVRAlan Jeffrey2020-04-081-0/+10
| |
| * Update SpiderMonkeyAnthony Ramine2020-03-061-5/+7
| |
| * add a generic utility to convert a slice into a frozen arrayGregory Terzian2020-01-111-7/+2
| |
| * Handle u32 property indicesKagami Sascha Rosylight2019-11-271-22/+40
| |
| * continue messageport, transferable, postmessage optionsGregory Terzian2019-10-191-1/+17
| |
| * DefineDOMInterfaceMethod now takes a SafeJSContext instead of a JSContextmarmeladema2019-07-241-2/+3
| | | | | | | | as first argument.
| * Upgrade to Spidermonkey 67.Josh Matthews2019-06-261-6/+11
| |
| * Update to SpiderMonkey 66.Josh Matthews2019-05-101-7/+6
| |
| * Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
| |
| * Remove useless `use crate_name;` imports.Simon Sapin2018-11-081-2/+0
| | | | | | | | A `crate_name::foo` path always works in 2018
| * Reorder importsPyfisch2018-11-061-7/+7
| |
| * Manually format remaining problemsPyfisch2018-11-061-13/+14
| | | | | | | | | | | | | | | | | | Use line comments instead of block comments as block comments contain trailing whitespace after formatting with rustfmt. Skip tests for malloc_size_of and script_plugins with rustfmt as they have many block comments.
| * Format remaining filesPyfisch2018-11-061-1/+1
| |
| * `cargo fix --edition`Simon Sapin2018-11-061-9/+9
| |
| * Format script componentchansuke2018-09-191-108/+143
| |
| * Upgraded to SM 60Alan Jeffrey2018-08-201-10/+12
| |
| * Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393Marcin Mielniczuk2018-03-281-24/+32
| |
| * Use specific negative assertion for DOM bindings utilsCYBAI2018-01-261-1/+1
| |
| * Fix tyvar_behind_raw_pointer warningsSimon Sapin2018-01-101-2/+2
| | | | | | | | https://github.com/rust-lang/rust/issues/46906
| * Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`. `malloc_size_of` is better -- it handles various cases that `heapsize` does not -- so this patch changes Servo to use `malloc_size_of`. This patch makes the following changes to the `malloc_size_of` crate. - Adds `MallocSizeOf` trait implementations for numerous types, some built-in (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`). - Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't support that operation. - For `HashSet`/`HashMap`, falls back to a computed estimate when `enclosing_size_of_op` isn't available. - Adds an extern "C" `malloc_size_of` function that does the actual heap measurement; this is based on the same functions from the `heapsize` crate. This patch makes the following changes elsewhere. - Converts all the uses of `heapsize` to instead use `malloc_size_of`. - Disables the "heapsize"/"heap_size" feature for the external crates that provide it. - Removes the `HeapSizeOf` implementation from `hashglobe`. - Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of` doesn't derive those types, unlike `heapsize`.