Commit 1b79e986 authored by Vladimir Levin's avatar Vladimir Levin Committed by Commit Bot

CSSRenderSubtree: Remove contain: size addition when element activates.

This patch only affects the CSS version of render-subtree. Right now,
we keep size containment if the invisible token is present, even if
the lock is activated. I don't think this was ever the intent, although
the spec language suggests that if 'invisible' is present, we should
have size containment. The language is speaking about the attribute
version though, so I think we should reword that for CSS.

See https://github.com/WICG/display-locking/issues/104 for more
discussion.

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

Change-Id: Iaf03c234aa27024a76908ef2e14b11a17426703e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1993389Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Commit-Queue: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#730192}
parent ab826cd1
......@@ -604,8 +604,12 @@ static void AdjustStateForRenderSubtree(ComputedStyle& style,
if (should_be_invisible) {
// Add containment to style if we're invisible.
auto contain =
style.Contain() | kContainsStyle | kContainsLayout | kContainsSize;
auto contain = style.Contain() | kContainsStyle | kContainsLayout;
// If we haven't activated, then we should also contain size. This means
// that if we are rendering the element's subtree (i.e. it is either
// unlocked or activated), then we do not have size containment.
if (!context->IsActivated())
contain |= kContainsSize;
style.SetContain(contain);
// If we're unlocked and unactivated, then we should lock the context. Note
......
<!doctype HTML>
<html>
<meta charset="utf8">
<title>activated element removes size containment</title>
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
<link rel="help" href="https://github.com/WICG/display-locking">
<style>
.border {
border: 1px solid black;
}
</style>
<div class=border>
Test passes if there is a border around this text.
</div>
</html>
<!doctype HTML>
<html class="reftest-wait">
<meta charset="utf8">
<title>activated element removes size containment</title>
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
<link rel="help" href="https://github.com/WICG/display-locking">
<link rel="match" href="activated-removes-size-containment-ref.html">
<meta name="assert" content="activated render-subtree removes size containment.">
<script src="/common/reftest-wait.js"></script>
<style>
.locked {
render-subtree: invisible;
border: 1px solid black;
}
</style>
<div class=locked>
Test passes if there is a border around this text.
</div>
<script>
window.onload = requestAnimationFrame(() => {
requestAnimationFrame(() => {
requestAnimationFrame(() => {
takeScreenshot();
});
});
});
</script>
</html>
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