Commit 4b96f800 authored by Rune Lillesveen's avatar Rune Lillesveen Committed by Commit Bot

Use StyleForLayoutObject for option to update stacking context properly.

We used OriginalStyleForLayoutObject which doesn't update animations or
stacking context. Hopefully a better fix for 813348.

Bug: 813348, 813439, 813836
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I93584261a935c4813f618a9291d384a5b1203ec7
Reviewed-on: https://chromium-review.googlesource.com/924705Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539093}
parent 29f39939
......@@ -91,7 +91,7 @@ void HTMLOptionElement::AttachLayoutTree(AttachContext& context) {
if (!GetNonAttachedStyle() && ParentComputedStyle()) {
if (HTMLSelectElement* select = OwnerSelectElement())
select->UpdateListOnLayoutObject();
SetNonAttachedStyle(OriginalStyleForLayoutObject());
SetNonAttachedStyle(StyleForLayoutObject());
}
HTMLElement::AttachLayoutTree(option_context);
}
......
......@@ -1088,4 +1088,27 @@ TEST_F(LayoutBoxModelObjectTest, BackfaceVisibilityChange) {
EXPECT_FALSE(target_layer->NeedsRepaint());
}
TEST_F(LayoutBoxModelObjectTest, UpdateStackingContextForOption) {
SetBodyInnerHTML(R"HTML(
<style>
@keyframes op {
0% { opacity: 0 }
100% { opacity: 1 }
}
option {
animation: op 0.001s;
}
</style>
<select multiple size=1>
<option id=opt>PASS</option>
</select>
)HTML");
auto* option_element = GetDocument().getElementById("opt");
auto* option_layout = option_element->GetLayoutObject();
ASSERT_TRUE(option_layout);
EXPECT_TRUE(option_layout->StyleRef().IsStackingContext());
EXPECT_TRUE(option_layout->StyleRef().HasCurrentOpacityAnimation());
}
} // namespace blink
......@@ -663,11 +663,6 @@ static bool NeedsEffect(const LayoutObject& object) {
const bool is_css_isolated_group =
object.IsBoxModelObject() && style.IsStackingContext();
// TODO(chrishtr): this should not be necessary, since masks induce
// stacking contexts. See crbug.com/813348
if (style.HasMask())
return true;
if (!is_css_isolated_group && !object.IsSVGChild())
return false;
......
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