Index: third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
index 9793a7e6714b61b6a6e07379afc26ae23cf00e83..8e19b3a046f9c539b1de5ee8e535696a70100d18 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
@@ -287,6 +287,26 @@ void LayoutBlock::styleDidChange(StyleDifference diff, const ComputedStyle* oldS |
m_heightAvailableToChildrenChanged |= oldStyle && diff.needsFullLayout() && needsLayout() && borderOrPaddingLogicalDimensionChanged(*oldStyle, newStyle, LogicalHeight); |
} |
+void LayoutBlock::updateFromStyle() |
+{ |
+ LayoutBox::updateFromStyle(); |
+ |
+ bool shouldClipOverflow = !styleRef().isOverflowVisible() && allowsOverflowClip(); |
+ if (shouldClipOverflow != hasOverflowClip()) { |
+ // FIXME: This shouldn't be required if we tracked the visual overflow |
+ // generated by positioned children or self painting layers. crbug.com/345403 |
+ for (LayoutObject* child = firstChild(); child; child = child->nextSibling()) |
+ child->setMayNeedPaintInvalidation(); |
+ } |
+ setHasOverflowClip(shouldClipOverflow); |
+} |
+ |
+bool LayoutBlock::allowsOverflowClip() const |
+{ |
+ // If overflow has been propagated to the viewport, it has no effect here. |
+ return node() != document().viewportDefiningElement(); |
+} |
+ |
void LayoutBlock::invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& childPaintInvalidationState) |
{ |
LayoutBox::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState); |