1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:47:35 +00:00

LibWeb: Add Paintable::dom_node() convenience accessor

This commit is contained in:
Andreas Kling 2022-03-21 11:19:02 +01:00
parent b64b5fa8bd
commit f7cfd47b48
2 changed files with 9 additions and 6 deletions

View file

@ -182,7 +182,7 @@ bool EventHandler::handle_mouseup(const Gfx::IntPoint& position, unsigned button
if (paintable) {
RefPtr<DOM::Node> node = paintable->mouse_event_target();
if (!node)
node = paintable->layout_node().dom_node();
node = paintable->dom_node();
if (node) {
if (is<HTML::HTMLIFrameElement>(*node)) {
@ -235,7 +235,7 @@ bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned butt
node = paintable->mouse_event_target();
if (!node)
node = paintable->layout_node().dom_node();
node = paintable->dom_node();
document->set_hovered_node(node);
if (paintable->wants_mouse_events()) {
@ -357,7 +357,7 @@ bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned butt
const HTML::HTMLAnchorElement* hovered_link_element = nullptr;
if (paintable) {
if (paintable->wants_mouse_events()) {
document.set_hovered_node(paintable->layout_node().dom_node());
document.set_hovered_node(paintable->dom_node());
if (paintable->handle_mousemove({}, position, buttons, modifiers) == Painting::Paintable::DispatchEventOfSameName::No)
return false;
@ -368,7 +368,7 @@ bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned butt
RefPtr<DOM::Node> node = paintable->mouse_event_target();
if (!node)
node = paintable->layout_node().dom_node();
node = paintable->dom_node();
if (node && is<HTML::HTMLIFrameElement>(*node)) {
if (auto* nested_browsing_context = static_cast<HTML::HTMLIFrameElement&>(*node).nested_browsing_context())