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

[PE] Don't create effect for non-layered non-svg objects with stacking context style

Such objects are not actual stacking contexts. For now we know LayoutTableCol
is one of such objects for now, though it should support effects
(crbug.com/892734).

Bug: 890615
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I7fe4b09e5b95731b0ce3805583b6391677419216
Reviewed-on: https://chromium-review.googlesource.com/c/1262927
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597333}
parent b584f23f
......@@ -699,8 +699,11 @@ static bool NeedsClipPathClip(const LayoutObject& object) {
static bool NeedsEffect(const LayoutObject& object) {
const ComputedStyle& style = object.StyleRef();
// For now some objects (e.g. LayoutTableCol) with stacking context style
// don't create layer thus are not actual stacking contexts, so the HasLayer()
// condition. TODO(crbug.com/892734): Support effects for LayoutTableCol.
const bool is_css_isolated_group =
object.IsBoxModelObject() && style.IsStackingContext();
object.HasLayer() && style.IsStackingContext();
if (!is_css_isolated_group && !object.IsSVG())
return false;
......
......@@ -6379,4 +6379,15 @@ TEST_P(PaintPropertyTreeBuilderTest, EffectOutputClipWithFixedDescendant) {
PaintPropertiesForElement("target5")->Effect()->OutputClip());
}
TEST_P(PaintPropertyTreeBuilderTest, TableColOpacity) {
SetBodyInnerHTML(R"HTML(
<table>
<col id="col" style="opacity: 0.5">
</table>
)HTML");
// TODO(crbug.com/892734): For now table col doesn't support effects.
EXPECT_EQ(nullptr, PaintPropertiesForElement("col"));
}
} // namespace blink
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