aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/reflector.rs
Commit message (Collapse)AuthorAgeFilesLines
* Start marking functions that can transitively trigger a GC (#33144)Josh Matthews2024-08-221-3/+14
| | | | | | | | | | | | | | | | | * Mark JS reflector wrappers as CanGc. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Propagate CanGc from reflect_dom_object_with_proto. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Mark DOM constructors as GC operations. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* clippy: Fix a bunch of warnings in `script` (#32680)Martin Robinson2024-07-041-0/+2
| | | This is just a portion of the errors that are remaining to be fixed.
* Fix rustdoc errors in `components/script/dom` (#31617)Mucha Naibei2024-03-111-1/+1
| | | | | * Fix rustdoc errors in components/script/dom * Revert if to iff in audiobuffer.rs
* Replace script_plugins with a clippy like rustc driver (named crown) (#30508)Samson2023-12-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-3/+5
| | | | | * strict imports formatting * Reformat all imports
* Rename reflect_dom_object2.Josh Matthews2023-05-311-1/+5
|
* Formatting.Josh Matthews2023-05-281-1/+6
|
* Support arbitrary protos when wrapping DOM objects with constructors.Josh Matthews2023-05-281-2/+2
|
* Support arbitrary protos when wrapping EventTarget objects.Josh Matthews2023-05-281-2/+12
|
* Make GlobalScope.get_cx a static method.Josh Matthews2023-05-201-2/+4
|
* Add trait DomObjectWrap to provide WRAP functionYUAN LYU2020-03-201-8/+22
|
* Introduce a new type MaybeUnreflectedDom<T> (fixes #25701)Anthony Ramine2020-02-171-4/+5
|
* Use `#![register_tool]` instead of `#![register_attr]`Simon Sapin2019-11-151-1/+1
| | | | CC https://github.com/rust-lang/rust/issues/66079
* Modify *::get_cx methods to return a safe JSContext instead of a raw onemarmeladema2019-07-241-9/+3
|
* Wrap(Global)Method now takes a SafeJSContext instead of a JSContextmarmeladema2019-07-241-3/+10
| | | | as first argument.
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Reorder importsPyfisch2018-11-061-1/+1
|
* `cargo fix --edition`Simon Sapin2018-11-061-3/+3
|
* Format script componentchansuke2018-09-191-9/+12
|
* Updated to mozjs v0.7.1.Alan Jeffrey2018-05-301-1/+1
|
* Adapt Servo for mozjs 0.6 and the changes introduced in servo/rust-mozjs#393Marcin Mielniczuk2018-03-281-1/+2
|
* Use unsafe Heap::handle wherever neededIgor Matuszewski2018-03-231-1/+2
|
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* Make DomRoot<T> a type alias of a more general Root<T> typeAnthony Ramine2017-09-281-1/+1
| | | | | | | This Root<T> relies on the concept of a stable trace object, which doesn't move for the whole lifetime of the T value. For safety reasons, T must be 'static. The only implementor of StableTraceObject for now is Dom<T>.
* Rename Root<T> to DomRoot<T>Anthony Ramine2017-09-261-4/+4
| | | | | | | In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>, where Root<T> will be able to handle all the things that need to be rooted that have a stable traceable address that doesn't move for the whole lifetime of the root. Stay tuned.
* Rename dom::bindings::js to dom::bindings::rootAnthony Ramine2017-09-261-1/+1
|
* Replace inheritance_integrity by trait shenanigansAnthony Ramine2017-02-151-2/+1
| | | | | | | | | | | | | | | | | For each derived DomObject impl, we also generate a dummy trait ShouldNotImplDomObject that is implemented for all T: DomObject. We then try to implement it for each field type except the first one. If compilation succeed, this means that field type doesn't implement DomObject itself otherwise it would break coherence rules. error[E0119]: conflicting implementations of trait `dom::xmlhttprequest::_IMPL_DOMOBJECT_FOR_XMLHttpRequest::ShouldNotImplDomObject` for type `((), SomeFieldTypeThatShouldNotImplementDomObject)`: --> /Users/nox/src/servo/components/script/dom/xmlhttprequest.rs:120:1 | 120 | #[dom_struct] | ^^^^^^^^^^^^^ | | | first implementation here | conflicting implementation for `((), SomeFieldTypeThatShouldNotImplementDomObject)`
* Derive DomObject with a proc macroAnthony Ramine2017-02-141-0/+12
|
* Use Heap in DOM object reflector implementation to ensure GC barriers are used.Josh Matthews2017-01-201-15/+11
|
* Rename `Reflectable` to `DomObject`.Corey Farwell2016-12-081-4/+4
| | | | Fixes https://github.com/servo/servo/issues/8473.
* script creates methods taking '*mut JSContext' unsafeAbelardo E. Mendoza2016-11-141-2/+4
| | | | rebase + marked the necessary new code as unsafe
* Rename Reflectable::global_scope to globalAnthony Ramine2016-10-061-1/+1
|
* Remove GlobalRoot and GlobalRefAnthony Ramine2016-10-061-2/+1
|
* Remove Reflectable::globalAnthony Ramine2016-10-061-6/+1
|
* Remove global_root_from_reflectorAnthony Ramine2016-10-061-2/+2
|
* Introduce Reflectable::global_scopeAnthony Ramine2016-10-061-1/+6
|
* Make reflect_dom_object take a &GlobalScopeAnthony Ramine2016-10-061-6/+12
|
* Extract mutability out of Reflectable trait.Josh Matthews2016-09-071-2/+6
|
* Add global default method for Reflectable traitChad Kimes2016-01-111-1/+6
|
* Remove `#[allow(raw_pointer_derive)]` attributesBrandon Fairchild2015-11-271-1/+1
| | | | | | The attributes are unused. Fixes #8699.
* Rustfmt some of script.Ms2ger2015-11-181-6/+5
|
* rearrange imports to be in alphabetical orderrohan.prinja2015-10-301-1/+1
|
* more refactoringrohan.prinja2015-10-301-0/+79