servo/components/script
Simon Wülker 270df6e263
Consider shadow dom when dispatching events (#34788)
* Implement EventTarget::get_the_parent

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Add spec steps to Event::init_event

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Rewrite Event::composedPath to be spec compliant

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Retarget EventTargets instead of Nodes

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Rewrite event dispatch/invocation to better match the spec

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Add spec comments to Event struct

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Don't traverse shadow roots when calculating an events path

We can't do this correctly yet, and assuming that an events
composed flag is never set is correct 99% of the time.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Fix typo in event dispatch

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* fix comment

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* allow crown error

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* fmt

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Reduce item visibility where possible

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Simplify code a bit

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Fix Step 5.10 of Event::invoke

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Fix renamed method calls

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-01-07 21:22:16 +00:00
..
docs Update branch name to main (#30877) 2023-12-16 09:32:20 +00:00
dom Consider shadow dom when dispatching events (#34788) 2025-01-07 21:22:16 +00:00
layout_dom Add shadow tree flags to Bind/UnbindContext (#34863) 2025-01-07 00:00:43 +00:00
xpath Elide lifetimes where possible after rustup (#34824) 2025-01-03 18:54:44 +00:00
animation_timeline.rs script: Start replacing time with std::time and chrono (#30639) 2024-01-16 12:23:18 +00:00
animations.rs script: Expose node helpers as NodeTraits and give more descriptive names (#34832) 2025-01-03 18:55:01 +00:00
body.rs script: Unsilence all main thread TaskQueue errors (#34849) 2025-01-07 03:36:39 +00:00
build.rs Upgrade rustc to 1.83 (#34793) 2025-01-01 09:38:28 +00:00
canvas_state.rs script: Expose node helpers as NodeTraits and give more descriptive names (#34832) 2025-01-03 18:55:01 +00:00
Cargo.toml script: Make timers per-process (#34581) 2024-12-24 09:53:35 +00:00
clipboard_provider.rs
conversions.rs Correct a variety of documentation issues (#34786) 2024-12-29 10:37:57 +00:00
devtools.rs script: Expose node helpers as NodeTraits and give more descriptive names (#34832) 2025-01-03 18:55:01 +00:00
document_collection.rs Elide lifetimes where possible after rustup (#34824) 2025-01-03 18:54:44 +00:00
document_loader.rs Fix GC borrow hazards triggered by LoadBlocker::terminate (#34122) 2024-11-04 22:27:41 +00:00
drag_data_store.rs Implement DataTransfer and related interfaces (#34205) 2024-11-25 10:49:04 +00:00
fetch.rs script: Unsilence all main thread TaskQueue errors (#34849) 2025-01-07 03:36:39 +00:00
iframe_collection.rs Correct a variety of documentation issues (#34786) 2024-12-29 10:37:57 +00:00
image_listener.rs script: Expose NodeTraits::owner_global / Window::as_global_scope (#34843) 2025-01-07 09:56:02 +00:00
init.rs Create two-phase initialization for generated JS engine bindings (#34366) 2024-12-06 07:34:24 +00:00
layout_image.rs script: Expose node helpers as NodeTraits and give more descriptive names (#34832) 2025-01-03 18:55:01 +00:00
lib.rs Elide lifetimes where possible after rustup (#34824) 2025-01-03 18:54:44 +00:00
links.rs script: Expose NodeTraits::owner_global / Window::as_global_scope (#34843) 2025-01-07 09:56:02 +00:00
mem.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
messaging.rs script: Eliminate code duplication in the task queue (#34798) 2025-01-01 13:50:52 +00:00
microtask.rs Dom: Re-implement ReadableStream Part 1 : Default Reader and Controller (#34064) 2024-12-17 21:14:00 +00:00
network_listener.rs script: Unsilence all main thread TaskQueue errors (#34849) 2025-01-07 03:36:39 +00:00
realms.rs Elide lifetimes where possible after rustup (#34824) 2025-01-03 18:54:44 +00:00
script_module.rs script: Expose NodeTraits::owner_global / Window::as_global_scope (#34843) 2025-01-07 09:56:02 +00:00
script_runtime.rs script: Unsilence all main thread TaskQueue errors (#34849) 2025-01-07 03:36:39 +00:00
script_thread.rs script: Expose NodeTraits::owner_global / Window::as_global_scope (#34843) 2025-01-07 09:56:02 +00:00
security_manager.rs Rewrite From/TryFrom conversions on generated types to avoid future orphan rule violations (#34554) 2024-12-11 05:52:48 +00:00
serviceworker_manager.rs Prevent moving CanGc values between threads/tasks (#33902) 2024-10-18 17:26:54 +00:00
stylesheet_loader.rs script: Expose node helpers as NodeTraits and give more descriptive names (#34832) 2025-01-03 18:55:01 +00:00
stylesheet_set.rs Elide lifetimes where possible after rustup (#34824) 2025-01-03 18:54:44 +00:00
task.rs script: Unsilence all main thread TaskQueue errors (#34849) 2025-01-07 03:36:39 +00:00
task_manager.rs script: Unsilence all main thread TaskQueue errors (#34849) 2025-01-07 03:36:39 +00:00
task_queue.rs clippy: Fix suggestions in script, libservo, and servoshell (#33453) 2024-09-14 08:41:13 +00:00
task_source.rs script: Unsilence all main thread TaskQueue errors (#34849) 2025-01-07 03:36:39 +00:00
test.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
textinput.rs build: upgrade rustc to 1.81.0 (#34270) 2024-12-12 07:26:16 +00:00
timers.rs script: Unsilence all main thread TaskQueue errors (#34849) 2025-01-07 03:36:39 +00:00
unminify.rs Unminify module scripts. (#34206) 2024-11-12 13:06:55 +00:00
unpremultiplytable.rs
webdriver_handlers.rs script: Expose NodeTraits::owner_global / Window::as_global_scope (#34843) 2025-01-07 09:56:02 +00:00
window_named_properties.rs Replace the lazy_static crate whth std::sync::LazyLock in components/script (#33004) 2024-08-12 07:30:35 +00:00