Commit 43c87dfd authored by Stefan Zager's avatar Stefan Zager Committed by Commit Bot

[IntersectionObserver] Assume non-zero opacity for unpainted iframes

BUG=933694
R=atotic@chromium.org

Change-Id: I0a0aac1da5ab30ab09c1557e88387b1a2987bdf0
Reviewed-on: https://chromium-review.googlesource.com/c/1478944Reviewed-by: default avatarAleks Totic <atotic@chromium.org>
Commit-Queue: Stefan Zager <szager@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633880}
parent 1b2590be
......@@ -1544,10 +1544,17 @@ bool LayoutObject::HasDistortingVisualEffects() const {
}
bool LayoutObject::HasNonZeroEffectiveOpacity() const {
PropertyTreeState paint_properties = EnclosingLayer()
->GetLayoutObject()
.FirstFragment()
.LocalBorderBoxProperties();
const FragmentData& fragment =
EnclosingLayer()->GetLayoutObject().FirstFragment();
// This can happen for an iframe element which is outside the viewport and has
// therefore never been painted. In that case, we do the safe thing -- report
// it as having non-zero opacity -- since this method is used by
// IntersectionObserver to detect occlusion.
if (!fragment.HasLocalBorderBoxProperties())
return true;
PropertyTreeState paint_properties = fragment.LocalBorderBoxProperties();
for (const auto* effect = &paint_properties.Effect().Unalias(); effect;
effect = SafeUnalias(effect->Parent())) {
......
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