Commit 9fd79fb1 authored by Vladimir Levin's avatar Vladimir Levin Committed by Chromium LUCI CQ

[content-visibility]: Ensure to ignore hidden-matchable children.

This patch ensures that we property check that hidden-matchable
children should be skipped. This only affects hidden-matchable, because
hidden hides everything to the buggy if statement would work and
auto allows all activations so the result of the buggy return is
the same as it would have been without the bug.

The effect of this bug is that hidden-matchable children are exposed
to accessibility, which they shouldn't be.

R=chrishtr@chromium.org, jarhar@chromium.org

Change-Id: I863889889cb28e4d3ab075f599f7660dc8637cff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2567342Reviewed-by: default avatarJoey Arhar <jarhar@chromium.org>
Commit-Queue: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832495}
parent 9b53f52e
......@@ -398,9 +398,6 @@ bool DisplayLockUtilities::IsInUnlockedOrActivatableSubtree(
node.GetDocument()
.GetDisplayLockDocumentState()
.LockedDisplayLockCount() == 0 ||
node.GetDocument()
.GetDisplayLockDocumentState()
.DisplayLockBlockingAllActivationCount() == 0 ||
!node.CanParticipateInFlatTree()) {
return true;
}
......
......@@ -37,6 +37,21 @@ class DisplayLockUtilitiesTest
}
};
TEST_F(DisplayLockUtilitiesTest, ShouldIgnoreHiddenMatchableChildren) {
SetBodyInnerHTML(R"HTML(
<style>
.hidden { content-visibility: hidden-matchable }
</style>
<div class=hidden>
<div id=target></div>
</div>
)HTML");
Node* target = GetDocument().getElementById("target");
EXPECT_TRUE(DisplayLockUtilities::ShouldIgnoreNodeDueToDisplayLock(
*target, DisplayLockActivationReason::kAccessibility));
}
TEST_F(DisplayLockUtilitiesTest, DISABLED_ActivatableLockedInclusiveAncestors) {
SetBodyInnerHTML(R"HTML(
<style>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment