mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-15 05:52:19 +00:00
LibWeb: Fix handling of find-in-page with pseudo-element content
This change makes find-in-page ignore content that’s been added to the document using CSS ::after or ::before pseudo-elements. Ignoring such pseudo-element content for find-in-page matches the behavior in Chrome and Safari (though not in Firefox). Otherwise, without this change, find-in-page doesn’t ignore the pseudo-element content, and we instead crash in DOM::Range::common_ancestor_container after hitting an assert, due to the start container and end container for the matched range not having a common ancestor. Fixes https://github.com/LadybirdBrowser/ladybird/issues/514
This commit is contained in:
parent
bee42160c5
commit
0a55e36403
Notes:
sideshowbarker
2024-07-17 02:29:45 +09:00
Author: https://github.com/sideshowbarker
Commit: 0a55e36403
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/531
Issue: https://github.com/LadybirdBrowser/ladybird/issues/514
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 1 additions and 1 deletions
|
@ -57,7 +57,7 @@ void Viewport::update_text_blocks()
|
|||
if (layout_node.display().is_none() || !layout_node.paintable() || !layout_node.paintable()->is_visible())
|
||||
return TraversalDecision::Continue;
|
||||
|
||||
if (layout_node.is_box()) {
|
||||
if (layout_node.is_box() || layout_node.is_generated()) {
|
||||
if (!builder.is_empty()) {
|
||||
text_blocks.append({ builder.to_string_without_validation(), text_positions });
|
||||
current_start_position = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue