aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/cell.rs
Commit message (Collapse)AuthorAgeFilesLines
* Update rustfmt to the 2024 style edition (#35764)Simon Wülker2025-03-031-1/+1
| | | | | | | | | | | | | * Use 2024 style edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Reformat all code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* Fire slot change events when the slot content changes (#35137)Simon Wülker2025-01-271-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add the onslotchange attribute to ShadowRoot Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add spec comments to MutationObserver::queue_mutation_observer_microtask Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add DomRefCell::take Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Add spec comments to notify_mutation_observers Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fire slotchange events when a slot changes Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * ./mach fmt Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Fix check for when to dispatch slot events Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Potentially fire slot change events in Node::remove Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Update WPT expectations Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * ./mach fmt Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Bump stylo Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Move "signal a slot change" into ScriptThread impl Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* script: Limit public exports. (#34915)Josh Matthews2025-01-101-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Restrict reexport visibility of DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Mass pub->pub(crate) conversion. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Hide existing dead code warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix unit tests. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * More formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Fix incorrect documentation and add `track_caller` to DomRefCell methods ↵Simon Wülker2024-08-191-4/+16
| | | | | | | | | | | | | | | | | | | (#33111) * Fix DomRefCell documentation about panic behaviour Fixes https://github.com/servo/servo/issues/33099 Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Annotate DomRefCell::borrow/borrow_mut with #[track_caller] Fixes https://github.com/servo/servo/issues/27336 Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* clippy: Fix a bunch of warnings in `script` (#32680)Martin Robinson2024-07-041-2/+17
| | | This is just a portion of the errors that are remaining to be fixed.
* clippy: Fix all errors in `components/script` (#31911)Azhar Ismagulova2024-03-281-2/+2
| | | | | * clippy: Fix errors in components/script/dom * clippy: fixed remaining errors in components/script
* script: Do not run layout in a thread (#31346)Martin Robinson2024-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Do not run layout in a thread Instead of spawning a thread for layout that almost always runs synchronously with script, simply run layout in the script thread. This is a resurrection of #28708, taking just the bits that remove the layout thread. It's a complex change and thus is just a first step toward cleaning up the interface between script and layout. Messages are still passed from script to layout via a `process()` method and script proxies some messages to layout from other threads as well. Big changes: 1. Layout is created in the script thread on Document load, thus every live document is guaranteed to have a layout. This isn't completely hidden in the interface, but we can safely `unwrap()` on a Document's layout. 2. Layout configuration is abstracted away into a LayoutConfig struct and the LayoutFactory is a struct passed around by the Constellation. This is to avoid having to monomorphize the entire script thread for each layout. 3. Instead of having the Constellation block on the layout thread to figure out the current epoch and whether there are pending web fonts loading, updates are sent synchronously to the Constellation when rendering to a screenshot. This practically only used by the WPT. A couple tests start to fail, which is probably inevitable since removing the layout thread has introduced timing changes in "exit after load" and screenshot behavior. Co-authored-by: Josh Matthews <josh@joshmatthews.net> * Update test expectations * Fix some issues found during review * Clarify some comments * Address review comments --------- Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-4/+6
| | | | | * strict imports formatting * Reformat all imports
* Fix refcell_backtrace feature.Josh Matthews2020-06-181-4/+2
|
* Move thread state checks out of generic methods to reduce generated code ↵Josh Matthews2020-06-041-6/+6
| | | | duplication.
* Make DomRefCell not mutate the borrow flag non-atomicallyAnthony Ramine2020-05-181-4/+5
|
* Add accountable-refcell as optional build time featureKunal Mohan2020-01-081-1/+7
|
* Make use of RefCell::try_borrow_unguardedAnthony Ramine2019-04-121-1/+3
|
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Format script componentchansuke2018-09-191-3/+4
|
* Make JSTraceable for DomRefCell<T> panic if cell is mutably borrowed (see ↵Anthony Ramine2018-01-261-12/+0
| | | | #19871)
* Bump bitflags to 1.0 in every servo crateBastien Orivel2017-10-301-2/+2
|
* Backed out changeset e64e659c077d: servo PR #18809 and revendor for reftest ↵Gecko Backout2017-10-191-2/+2
| | | | | | failures, e.g. in layout/reftests/bugs/392435-1.html. r=backout on a CLOSED TREE Backs out https://github.com/servo/servo/pull/18809
* Update bitflags to 1.0 in every servo crateBastien Orivel2017-10-191-2/+2
| | | | | It still needs dependencies update to remove all the other bitflags versions.
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* Replace uses of libcore with libstd in components/scriptSimon Sapin2017-10-161-2/+2
|
* Rename DOMRefCell<T> to DomRefCell<T>Anthony Ramine2017-09-261-9/+9
| | | | | | | | I don't want to do such a gratuitous rename, but with all the other types now having "Dom" as part of their name, and especially with "DomOnceCell", I feel like the other cell type that we already have should also follow the convention. That argument loses weight though when we realise there is still DOMString and other things.
* Introduce PendingScriptAnthony Ramine2017-01-111-1/+1
| | | | | This moves scripts' loading results in Document, instead of maintaining them behind a DOMRefCell in each HTMLScriptElement.
* Update to Rust 1.14.0-nightly (19ac57926 2016-10-08)Anthony Ramine2016-10-091-2/+2
| | | | A cargo bump and a switch to serde_derive is needed to do this rustup.
* Don’t pretend DOMRefCell is Send or Sync, after all.Simon Sapin2016-10-041-7/+0
|
* Revert "Make DOMRefCell use style’s copy of RefCell"Simon Sapin2016-10-041-1/+1
| | | | This reverts commit ec723057b2360446790d436fe5e234d798fb4175.
* Move DOMRefCell back into script.Simon Sapin2016-10-041-0/+135
| | | | We’re not using it in style after all.
* Move DOMRefCell to style.Simon Sapin2016-08-311-139/+0
|
* Make DOMRefCell use style’s copy of RefCellSimon Sapin2016-08-311-1/+1
|
* Update Rust to 1.13.0-nightly (3c5a0fa45 2016-08-22)Anthony Ramine2016-08-231-3/+3
|
* Move thread_state to style.Ms2ger2016-08-221-2/+2
|
* Use feature try_borrow instead of borrow_state in scriptAnthony Ramine2016-08-201-44/+31
|
* task -> threadrohan.prinja2016-01-101-10/+10
|
* Rustfmt some of script.Ms2ger2015-11-181-2/+2
|
* Check modified event state from layout and dirty it there.Bobby Holley2015-10-271-0/+7
| | | | | | | | | This adds some overhead, but also provides the small performance benefit of avoiding dirtying in the case where an event state is toggled an even number of times between reflows. The main benefit here though is that it sets us up to be smarter about what we mark as dirty using restyle hints.
* sorted the extern crate, mod & use declarationsRavi Shankar2015-09-241-1/+1
|
* Fix reported test-tidy errors for unmerged import blocksBrandon Fairchild2015-09-191-3/+1
| | | | This merges import blocks that were reported by tidy as unmerged.
* Elide most 'a lifetimesManish Goregaokar2015-09-041-7/+7
|
* Start reporting memory usage for Window and all nodes in all DOM trees for ↵Josh Matthews2015-08-031-1/+1
| | | | frame treese in script tasks.
* Fix some warnings caused by the SM upgradeMichael Wu2015-06-191-1/+1
|
* Upgrade to SM 39Michael Wu2015-06-191-1/+3
|
* Make async XMLHttpRequest requests use async network events.Josh Matthews2015-04-161-0/+1
|
* Utilize Option::expectCorey Farwell2015-04-061-8/+2
|
* Replace unsafe_blocks by unsafe_code.Manish Goregaokar2015-03-211-0/+3
|
* Replace borrow with borrow_for_gc_trace in JSTraceable::trace (Issue #4778).Avi Weinstock2015-03-031-1/+3
|
* DOMRefCell<T>.is_mutably_borrowed() should return the state correctly.Tetsuharu OHZEKI2015-02-131-1/+1
| | | | | | | | | | | | | | | | This method returned the result of `RefCell<T>.try_borrow().is_some()`. But it meant whether the state **is not** BorrowState::Writing. This wrong is introduced by [1], Before it revision, this method had returned whether the state is BorrowState::Writing or not. This doesn't change callers of this method because git blames ([3], [4]) says that the caller is introduced by [2] and [2] is introduced before [1]. [1]: https://github.com/servo/servo/commit/86d609abaf7bf980a55916b90add2795cc11bf17 [2]: https://github.com/servo/servo/commit/49234484d6539a4d8df8374a9548c2004b8e68b7 [3]: https://github.com/servo/servo/blame/2cc08f289ab909de44fa09a07b2c43b70ce379b9/components/script/dom/servohtmlparser.rs [4]: https://github.com/servo/servo/blame/a7e29939a1df679bd865573dc71f7ba65f0268c4/components/script/dom/bindings/cell.rs
* Fix warnings about RefCell<T>.try_borrow().Tetsuharu OHZEKI2015-02-131-3/+9
|
* Adds borrow_for_script_deallocation and unsafe_mut_js_info method to avoid ↵Diego Marcos2015-01-301-0/+7
| | | | | | 'DOMRefCell already mutably borrowed' messages. This is just a temporary fix until the Rust standard library allows borrowing already-borrowed RefCell values during unwinding. It also removes LiveDOMReferences destructor that it's a no-op but it contains an assert that was being violated causing an endless cycle of destructor calls ending up in a stack overflow.
* Import the util crate as util rather than servo_util.Ms2ger2015-01-291-2/+2
| | | | | | | | This used to conflict with the util crate from the standard library, which has long since been removed. The import in layout has not been changed because of a conflict with the util mod there.
* Require documentation for all code in dom::bindings (excluding ↵Ms2ger2015-01-251-2/+0
| | | | dom::bindings::codegen).