diff options
author | John-Mark Bell <jmb@netsurf-browser.org> | 2024-02-04 22:19:05 +0000 |
---|---|---|
committer | John-Mark Bell <jmb@netsurf-browser.org> | 2024-02-04 22:38:58 +0000 |
commit | 59113c3cd529ff1ab03241bfda30f95617bc003b (patch) | |
tree | 113af44d03291ab6407c325c7613ab09e0cb4e70 | |
parent | 33ab748e87725ee789e5a28f45be905086672918 (diff) | |
download | netsurf-jmb/bm.tar.gz netsurf-jmb/bm.tar.bz2 |
HTML: avoid selection if text content is only changejmb/bm
-rw-r--r-- | content/handlers/html/box/manager.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/content/handlers/html/box/manager.c b/content/handlers/html/box/manager.c index fd42de50c..92bde8c1c 100644 --- a/content/handlers/html/box/manager.c +++ b/content/handlers/html/box/manager.c @@ -19,6 +19,7 @@ #define BM_DOM_FLAG_ATTRIBUTE_CHANGED 0x00000010 /* A (non-@class/@id) attribute on this node has changed */ +#define BM_DOM_STRUCTURAL_CHANGE_MASK 0x000000ff /* If any of the above flags are set on a node: recompute style information * for it, its descendants, its subsequent siblings, and their descendants. * If styles have changed, rebuild box subtree */ @@ -140,12 +141,17 @@ _rebuild_boxes_for_element(dom_node *node, void *pw) /* Consider whether anything has changed that might affect this node's * box tree segment (noting that we have already done so for the box * tree segments attached to our descendants) */ - if (flags_ancestor != 0 || flags_sibling != 0 || flags_self != 0) { // XXX: or if there's no style information for this node yet + if (((flags_ancestor | flags_sibling | flags_self) & + BM_DOM_STRUCTURAL_CHANGE_MASK) != 0) { // XXX: or if there's no style information for this node yet /* DOM structure has changed: (re)select styles for node */ // XXX: if styles have changed, ensure our box tree segment reflects reality } + if ((flags_self & BM_DOM_FLAG_TEXT_CONTENTS_CHANGED) != 0) { + /* Text contents changed: consider inlines */ + } + // XXX: regardless, ensure that box tree is in normal form (only need to consider relationship between our box(es) and those of our child elements) // XXX: then, if the box tree changed (either because our styles changed, or we needed to normalize things): |