mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Update layout after dispatching initial mouse events
Since #8182, we've been verifying "is the layout up to date" in more places. After dispatching mouseup/pointerup, the layout could have been changed again and we need to update it before trying to run activation behaviors. Fixes opening/closing an email's details in Roundcube webmail.
This commit is contained in:
committed by
Andreas Kling
parent
e99ff65a58
commit
d73b268445
Notes:
github-actions[bot]
2026-03-02 16:55:36 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/d73b268445e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8246
@@ -733,6 +733,9 @@ EventResult EventHandler::handle_mouseup(CSSPixelPoint visual_viewport_position,
|
||||
// then step 8 of this algorithm needs to be implemented in Navigable::choose_a_navigable:
|
||||
// https://html.spec.whatwg.org/multipage/document-sequences.html#the-rules-for-choosing-a-navigable
|
||||
|
||||
// NOTE: Event dispatches above may have run JS that invalidated layout.
|
||||
m_navigable->active_document()->update_layout(DOM::UpdateLayoutReason::EventHandlerHandleMouseUp);
|
||||
|
||||
auto top_level_viewport_position = m_navigable->to_top_level_position(viewport_position);
|
||||
if (GC::Ptr<HTML::HTMLAnchorElement const> link = node->enclosing_link_element()) {
|
||||
GC::Ref<DOM::Document> document = *m_navigable->active_document();
|
||||
|
||||
Reference in New Issue
Block a user