Commit 87923cb6 authored by Chris Harrelson's avatar Chris Harrelson Committed by Commit Bot

Mark for needing visual overflow recalc when marking for needing descendant layout.

CL 1391863 inadvertently removed this.

Bug: 918713

Change-Id: I3622168c1dab40403361f8d671a3bb84af88de01
Reviewed-on: https://chromium-review.googlesource.com/c/1395557Reviewed-by: default avatarAleks Totic <atotic@chromium.org>
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619865}
parent 439d5156
......@@ -949,10 +949,19 @@ void LayoutObject::MarkContainerChainForLayout(bool schedule_relayout,
DCHECK(!object->IsSetNeedsLayoutForbidden());
#endif
if (object->HasLayer() &&
ToLayoutBoxModelObject(object)->Layer()->IsSelfPaintingLayer())
ToLayoutBoxModelObject(object)->Layer()->SetNeedsVisualOverflowRecalc();
if (layouter) {
layouter->RecordObjectMarkedForLayout(object);
if (object == layouter->Root())
if (object == layouter->Root()) {
if (auto* painting_layer = PaintingLayer())
painting_layer->SetNeedsVisualOverflowRecalc();
return;
}
}
last = object;
......
......@@ -827,6 +827,31 @@ TEST_F(LayoutObjectTest, DistortingVisualEffectsUnaliases) {
EXPECT_TRUE(object->HasNonZeroEffectiveOpacity());
}
TEST_F(LayoutObjectTest, UpdateVisualRectAfterAncestorLayout) {
SetBodyInnerHTML(R"HTML(
<style>
#target {
width: 50px;
height: 0;
position: relative;
}
</style>
<div id=ancestor style="width: 100px; height: 100px; position: relative">
<div>
<div id=target></div>
</div>
</div>
)HTML");
auto* target = GetDocument().getElementById("target");
target->setAttribute(html_names::kStyleAttr, "height: 300px");
GetDocument().View()->UpdateAllLifecyclePhases(
DocumentLifecycle::LifecycleUpdateReason::kTest);
const auto* container = GetLayoutObjectByElementId("ancestor");
EXPECT_EQ(LayoutRect(0, 0, 100, 300),
ToLayoutBox(container)->VisualOverflowRect());
}
class LayoutObjectSimTest : public SimTest {
public:
bool DocumentHasTouchActionRegion(const EventHandlerRegistry& registry) {
......
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