Commit a1946e63 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

[PE] Fix DCHECK failure when there are both border radius clip and overflow clip

The DCHECK is incorrect when there are both border radius clip and
overflow clip.

Remove the DCHECK, and use FragmentData::PostOverflowClip() and
PreClip() in this function.

Bug: 828164
Change-Id: I3e9d36b26bfb72c90a37ffd492c44236920cc6f7
Reviewed-on: https://chromium-review.googlesource.com/994052Reviewed-by: default avatarTien-Ren Chen <trchen@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548556}
parent fac3813a
<!DOCTYPE html>
<div style="will-change: transform; width: 100px; height: 100px; border-radius: 10px; overflow: scroll">
<div style="width: 190px; height: 200px; background: blue"></div>
</div>
<!DOCTYPE html>
<div style="will-change: transform; width: 100px; height: 100px; border-radius: 10px; overflow: scroll">
<div style="transform: translateX(-10px); width: 200px; height: 200px; background: blue"></div>
</div>
......@@ -52,7 +52,7 @@ const TransformPaintPropertyNode* FragmentData::PostScrollTranslation() const {
return LocalBorderBoxProperties().Transform();
}
const ClipPaintPropertyNode* FragmentData::ClipPathClip() const {
const ClipPaintPropertyNode* FragmentData::PreClip() const {
if (const auto* properties = PaintProperties()) {
if (properties->ClipPathClip()) {
// SPv1 composited clip-path has an alternative clip tree structure.
......
......@@ -172,7 +172,7 @@ class CORE_EXPORT FragmentData {
// from the ancestor before applying any local CSS properties,
// but includes paint offset transform.
PropertyTreeState PreEffectProperties() const {
return PropertyTreeState(PreTransform(), ClipPathClip(), PreEffect());
return PropertyTreeState(PreTransform(), PreClip(), PreEffect());
}
// This is the complete set of property nodes that can be used to
......@@ -198,7 +198,7 @@ class CORE_EXPORT FragmentData {
const TransformPaintPropertyNode* PreTransform() const;
const TransformPaintPropertyNode* PostScrollTranslation() const;
const ClipPaintPropertyNode* ClipPathClip() const;
const ClipPaintPropertyNode* PreClip() const;
const ClipPaintPropertyNode* PostOverflowClip() const;
const EffectPaintPropertyNode* PreEffect() const;
const EffectPaintPropertyNode* PreFilter() const;
......
......@@ -555,22 +555,13 @@ void PaintLayerClipper::InitializeCommonClipRectState(
.FirstFragment()
.LocalBorderBoxProperties();
auto* ancestor_properties =
context.root_layer->GetLayoutObject().FirstFragment().PaintProperties();
if (!ancestor_properties)
return;
const auto& ancestor_fragment_data =
context.root_layer->GetLayoutObject().FirstFragment();
if (context.ShouldRespectRootLayerClip()) {
const auto* ancestor_css_clip = ancestor_properties->CssClip();
if (ancestor_css_clip) {
DCHECK_EQ(destination_property_tree_state.Clip(),
ancestor_css_clip);
destination_property_tree_state.SetClip(ancestor_css_clip->Parent());
}
} else if (const auto* clip =
ancestor_properties->OverflowOrInnerBorderRadiusClip()) {
DCHECK_EQ(destination_property_tree_state.Clip(), clip->Parent());
destination_property_tree_state.SetClip(clip);
destination_property_tree_state.SetClip(ancestor_fragment_data.PreClip());
} else {
destination_property_tree_state.SetClip(
ancestor_fragment_data.PostOverflowClip());
}
}
......
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