Commit 46ebd310 authored by Vladimir Levin's avatar Vladimir Levin Committed by Commit Bot

[DL]: Allow containment checks to pass if we have no computed style.

In cases where we might not have computed style, ensure that we pass
the containment checks (optimistically).

This comes with a TODO to switch to something like render=lockable to
force containment.

R=chrishtr@chromium.org

Bug: 882663
Change-Id: I78403b9bd5577a9ff006213c8452f07fb9197f93
Reviewed-on: https://chromium-review.googlesource.com/c/1452473Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Commit-Queue: vmpstr <vmpstr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629164}
parent 449215b2
......@@ -702,7 +702,11 @@ bool DisplayLockContext::ElementSupportsDisplayLocking() const {
// Otherwise, fallback on just checking style.
auto* style = element_->GetComputedStyle();
return style && style->ContainsStyle() && style->ContainsLayout();
// Note that if for whatever reason we don't have computed style, then
// optimistically assume that we have containment.
// TODO(vmpstr): Perhaps we need to add render=lockable which will ensure
// containment.
return !style || (style->ContainsStyle() && style->ContainsLayout());
}
// Scoped objects implementation
......
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