aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/mod.rs
Commit message (Collapse)AuthorAgeFilesLines
* Generate a trait abstracting over all known DOM interfaces (#34357)Josh Matthews2024-11-241-0/+6
| | | | | | | | | | | | | | | | | * script: Generate trait for all DOM interfaces and parameterize generated Methods traits over it. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Update trait implementations with new generic type. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* implement CachedFrozenArray (#34145)Gae242024-11-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | * extract code into CachedFrozenArray Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * fix borrow crash Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * fix already borrowed error using an else will cause the borrow to live more than it needs Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * restore return statement Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> --------- Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* refactor `CGClassConstructHook` to use handwritten constructors (#33614)Gae242024-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | * extract generated class constructor hook into handwritten functions Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * downcast to window only when it's actually used Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * simplify downcast Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * rename htmlconstructor to constructor, include call_default_constructor in it Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> --------- Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* Less `allow(crown::unrooted_must_root)` in bindings (#33630)Samson2024-10-031-1/+1
| | | | | | | | | | | | | * Limit `allow(crown::unrooted_must_root)` in bindings Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * extra_decorators Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* clippy: Fix remaining warnings in generated code (#31844)eri2024-03-251-2/+10
| | | | | * clippy: fix warnings in generated code * clippy: fix wrap_panic closure warnings
* 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
* Extract generated finalizers into generic helper functions. (#31569)Josh Matthews2024-03-081-0/+1
|
* WedIDL: bring dom/bindings/typedarray further in line with spec (#31375)Taym Haddadi2024-02-251-1/+1
| | | | | | | | | | | | | | | | | * WedIDL: bring dom/bindings/typedarray further in line with spec Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Rename HeapBufferSourceTypes to HeapBufferSource Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * fmt code Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
* docs: dom binding link fixes (#31311)Abhay Raj Singh2024-02-111-4/+5
|
* WebIDL: use FLoat32Array (#30990)Gregory Terzian2024-01-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Replace script_plugins with a clippy like rustc driver (named crown) (#30508)Samson2023-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Impl Setlike and Maplike (#30237)Samson2023-09-061-0/+1
| | | | | | | | | | | | | | | | | | | * 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
* refactor(script): move `crate::dom::bindings::{utils → ↵yvt2021-07-131-0/+1
| | | | principals)::ServoJSPrincipal`
* re-structure blob, structured serializationGregory Terzian2019-12-111-0/+1
|
* begin messageport, transferable objects, implKeith Yeung2019-10-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Accept transfer argument for StructuredCloneData::write Allow structured clone reads to return a boolean Add Transferable trait Add basic skeletons to MessagePort Implement transfer and transfer-receiving steps on MessagePort Use transfer and transfer_receive in StructuredClone callbacks Implement MessageChannel Freeze the array object for the MessageEvent ports attribute Implement transfer argument on window.postMessage Use ReentrantMutex instead for MessagePortInternal Accept origin as a parameter in dispatch_jsval Fix BorrowMut crash with pending_port_message Detach port on closure and check for detached during transfer Enable webmessaging tests fix webidl fix
* Support WebIDL `record<>`Kagami Sascha Rosylight2019-10-151-1/+1
|
* Remove unused code from script* cratesest312019-06-021-3/+0
|
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Replace NonNullJSObjectPtr with std::ptr::NonNull<JSObject>Simon Sapin2018-01-221-1/+0
|
* Moved function html_constructor() from interface.rs to new file ↵olmanz2017-11-161-0/+1
| | | | htmlconstructor.rs
* Replace NonZero<*mut JSObject> with a wrapper to enable local trait impls.Simon Sapin2017-10-161-0/+1
|
* Rename dom::bindings::js to dom::bindings::rootAnthony Ramine2017-09-261-1/+1
|
* Implement the entry global.Ms2ger2017-01-061-0/+1
| | | | Partial fix for #10963.
* Don't generate constructor IDs for inline interfacesAnthony Ramine2017-01-031-3/+3
|
* Remove and allow some dead code.Ms2ger2016-12-221-1/+1
|
* Move attributes for the bindings module to its mod.rs.Ms2ger2016-12-221-0/+4
|
* Remove GlobalRoot and GlobalRefAnthony Ramine2016-10-061-1/+0
|
* Pass a &GlobalScope to WebIDL static methods and constructorsAnthony Ramine2016-10-061-3/+4
|
* Move DOMRefCell back into script.Simon Sapin2016-10-041-2/+1
| | | | We’re not using it in style after all.
* Implement the MozMap type.Ms2ger2016-09-211-0/+1
| | | | Fixes #13144.
* Implement WebIDL namespacesAnthony Ramine2016-09-081-0/+1
|
* Move WebIDL constants machinery to bindings::constantAnthony Ramine2016-09-061-0/+1
|
* Move DOMRefCell to style.Simon Sapin2016-08-311-1/+2
|
* Implement pair iterators in WebIDL interfaces.Josh Matthews2016-08-241-0/+1
|
* Remove utils::Prefable in favour of guard::GuardAnthony Ramine2016-05-261-0/+1
|
* fix docsZhen Zhang2016-05-021-5/+0
|
* Lazily define interface objects on globals (fixes #6419)Anthony Ramine2016-02-251-0/+3
|
* Remove remaining reference to the long-disappeared JSRef type.Ms2ger2016-01-181-1/+2
|
* Refactor prototype initialisationAnthony Ramine2016-01-121-0/+1
| | | | | | | | | | | | | The function do_create_interface_objects is removed in favour of 4 functions: create_callback_interface_object, create_interface_prototype_object, create_noncallback_interface_object and create_named_constructors. While this increases the amount of codegen'd code, this greatly improves the readability of the code involved in this part of DOM, instead of having one function doing 4 different things. We can always find a more adequate abstraction later. NativeProperties and everything related to the interface objects have been removed from the utils module.
* Introduce trait WeakReferenceableAnthony Ramine2015-11-121-0/+1
| | | | This allows to take weak references of JS-managed DOM objects.
* Auto merge of #8286 - eefriedman:no-move, r=noxbors-servo2015-11-081-3/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unnecessary uses of #[no_move] The patch makes RootCollection a bit safer by making the StackRootTLS hold it in place. RootedVec was doing an extremely delicate dance and just hoping nobody messed it up; switch to a Box to be safe. CodeGenRust seemed to be using no_move for no particularly good reason. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8286) <!-- Reviewable:end -->
| * Clean up some code related to #[no_move].Eli Friedman2015-11-071-3/+1
| | | | | | | | | | | | | | | | The patch makes RootCollection a bit safer by making the StackRootTLS hold it in place. The use of no_move in CodeGenRust was leftover from when roots couldn't be moved.
* | more refactoringrohan.prinja2015-10-301-0/+3
|/
* Enable some warnings for generated code.Ms2ger2015-10-161-4/+1
| | | | None of those warnings currently occur.
* sorted the extern crate, mod & use declarationsRavi Shankar2015-09-241-3/+0
|
* Issue #7390 correct the order of mod declarationHugo Thiessard2015-09-181-7/+6
|
* Do not allow unreachable_code in codegen anymoreAnthony Ramine2015-08-301-2/+2
|
* Do not allow dead_code in codegen anymoreAnthony Ramine2015-08-301-4/+2
|
* Do not allow unused_parens in codegen anymoreAnthony Ramine2015-08-301-2/+2
|
* Do not allow unused_mut in codegen anymoreAnthony Ramine2015-08-301-2/+2
|