html_interaction.c: Default node to <HTML> node

In order to cope when an entire document is `visibility: hidden`
we default to the <HTML> node when interacting with the document
to ensure we don't drop off the end of the box model without
identifying at least one node to fire events at.

This resolves #2658

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2019-08-01 13:55:54 +01:00
parent 87177d8aa1
commit acee5faa3f

View File

@ -382,7 +382,7 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
int padding_left, padding_right, padding_top, padding_bottom; int padding_left, padding_right, padding_top, padding_bottom;
browser_drag_type drag_type = browser_window_get_drag_type(bw); browser_drag_type drag_type = browser_window_get_drag_type(bw);
union content_msg_data msg_data; union content_msg_data msg_data;
struct dom_node *node = NULL; struct dom_node *node = html->layout->node; /* Default to the <HTML> */
union html_drag_owner drag_owner; union html_drag_owner drag_owner;
union html_selection_owner sel_owner; union html_selection_owner sel_owner;
bool click = mouse & (BROWSER_MOUSE_PRESS_1 | BROWSER_MOUSE_PRESS_2 | bool click = mouse & (BROWSER_MOUSE_PRESS_1 | BROWSER_MOUSE_PRESS_2 |