mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-22 01:08:56 +00:00
LibWeb: Add view transition related user relevancy
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
This commit is contained in:
parent
9c062d9d4e
commit
c04f83f5f4
Notes:
github-actions[bot]
2025-09-10 16:38:48 +00:00
Author: https://github.com/Psychpsyo
Commit: c04f83f5f4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6127
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 10 additions and 6 deletions
|
@ -3282,21 +3282,25 @@ bool Element::is_relevant_to_the_user()
|
|||
if (document().get_selection()->contains_node(*this, true))
|
||||
return true;
|
||||
|
||||
// Either the element or its contents are placed in the top layer.
|
||||
bool is_in_top_layer = false;
|
||||
bool has_relevant_contents = false;
|
||||
for_each_in_inclusive_subtree_of_type<Element>([&](auto& element) {
|
||||
// Either the element or its contents are placed in the top layer.
|
||||
if (element.in_top_layer()) {
|
||||
is_in_top_layer = true;
|
||||
has_relevant_contents = true;
|
||||
return TraversalDecision::Break;
|
||||
}
|
||||
|
||||
// The element has a flat tree descendant that is captured in a view transition.
|
||||
if (&element != this && element.captured_in_a_view_transition()) {
|
||||
has_relevant_contents = true;
|
||||
return TraversalDecision::Break;
|
||||
}
|
||||
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
if (is_in_top_layer)
|
||||
if (has_relevant_contents)
|
||||
return true;
|
||||
|
||||
// FIXME: The element has a flat tree descendant that is captured in a view transition.
|
||||
|
||||
// NOTE: none of the above conditions are true, so the element is not relevant to the user.
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue