mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
script: Move the majority of the input event handling code to DocumentEventHandler
(#38584)
This moves the majority of the input event handler code to the `DocumentEventHandler` helper structure. It better encapsulates event handling, hiding most of the details from both `ScriptThread` and `Document`. The benefit here is that the majority of the functions can become private and `Document` is over 1000 lines shorter. Testing: This should not change any behavior so is covered by existing WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
bd9bb77295
commit
069ad40872
8 changed files with 1519 additions and 1484 deletions
|
@ -358,7 +358,10 @@ pub(crate) fn follow_hyperlink(
|
|||
let document = subject.owner_document();
|
||||
let target_attribute_value =
|
||||
if subject.is::<HTMLAreaElement>() || subject.is::<HTMLAnchorElement>() {
|
||||
if document.alternate_action_keyboard_modifier_active() {
|
||||
if document
|
||||
.event_handler()
|
||||
.alternate_action_keyboard_modifier_active()
|
||||
{
|
||||
Some("_blank".into())
|
||||
} else {
|
||||
get_element_target(subject)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue