aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_bindings/proxyhandler.rs
Commit message (Collapse)AuthorAgeFilesLines
* Fix crash when setting custom property on Location (#36494)Josh Matthews7 days1-1/+6
| | | | | | | | | | | | | | | | | The JS engine uses types like `Handle<Maybe<PropertyDescriptor>>` in various places and our automated bindings are not able to handle the Maybe type. We have hand-written bindings that use outparams to indicate a PropertyDescriptor value is actually the Nothing type, but that data was getting lost when we passed the property descriptor to SetPropertyIgnoringNamedGetter, which assumed that the property descriptor was always valid. Depends on https://github.com/servo/mozjs/pull/579. Testing: Manual testing on testcase from https://github.com/servo/servo/issues/34709, and new crashtest added. Fixes: #34709 Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Remove unsafe annotation add to unsafe blocks (#36399)Barigbue Nbira2025-04-081-17/+23
| | | | | | | | | | | | Remove the `unsafe` annotation from the `cross_origin_get` function and add `unsafe` blocks around unsafe code within the function Testing: Testing is not required as this change does not alter behaviour. Fixes: #36358 --------- Signed-off-by: Barigbue <barigbuenbira@gmail.com>
* Remove unsafe from cross_origin_property_fallback (#36373)Usman Yahaya Baba2025-04-061-2/+2
| | | | | | | | | | | | Remove unsafe from cross_origin_property_fallback - Refactors `cross_origin_property_fallback` to remove the `unsafe` annotation from the function signature, as it now uses safe wrappers instead of raw pointers - Adds an `unsafe` block around `MutableHandle::from_raw` Testing: Changes does not require test Fixes: https://github.com/servo/servo/issues/36359 Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
* Remove unsafe from maybe_cross_origin_get_prototype (#36366)Usman Yahaya Baba2025-04-061-8/+6
| | | | | | | | | | | | | Remove unsafe from maybe_cross_origin_get_prototype -Refactors `maybe_cross_origin_get_prototype` to remove the `unsafe` annotation from the function signature and `get_proto_object` argument -Adds `unsafe` blocks around calls `D::GlobalScope::from_context` and `MutableHandleObject::from_raw` Testing: Changes does not require test Fixes: https://github.com/servo/servo/issues/36357 Signed-off-by: Uthman Yahaya Baba <uthmanyahayababa@gmail.com>
* Refactor:Refactors report_cross_origin_denial method to use unsafe block ↵kaushikashok452025-04-051-5/+7
| | | | | | | | | | | | | | | | (#36365) The method report_cross_origin_denial was marked as unsafe, have instead moved the unsafe code within the method into an unsafe block within the method and removed the unsafe marking for the method. Testing: No testing needed Fixes: This PR resolves #36356. Signed-off-by : Ashok Kaushik kaushikashok45@gmail.com --------- Signed-off-by: ashok.kaushik <ashok.kaushik@zohocorp.com> Co-authored-by: ashok.kaushik <ashok.kaushik@zohocorp.com>
* Move generated bindings to script_bindings (#36323)Josh Matthews2025-04-041-29/+305
| | | | | | | | | | | | | | | | | | | | | This is the final step of #1799, where the majority of the generated code for the JS bindings is now compiled as part of the script_bindings build step. The remaining pieces in script must live there because they refer to concrete DOM types; all code in script_bindings is generic over the [DomTypes](https://doc.servo.org/script/dom/bindings/codegen/DomTypes/trait.DomTypes.html) trait. My testing with incremental builds shows me a 12 second reduction in build times on my 2024 M4 Macbook Pro when modifying code in the script crate after these changes. Before this PR those changes took 20 seconds to rebuild Servo, and now they take 8 seconds. Testing: Existing WPT tests ensure no regressions. Fixes: #1799 --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* More miscellaneous script splitting changes (#36220)Josh Matthews2025-03-301-0/+494
* script: Move HasParent to script_bindings and update imports for InheritTypes. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make principal creation generic over DOM interface. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move a bunch of proxy-related code to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make some proxy-related code generic over the DOM interface. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move DomSlice to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move some utility bindings code to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make enumerating and resolving globals generic over the DOM interface. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make realm helpers generic over the DOM interface. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move implementations on concrete DOM types to concrete bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make additional codegen helpers generic over the DOM interface. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make iterator creation generic over the DOM interface. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make reporting an exception a generic operation. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move AsCCharPtrPtr to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Address clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>