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..597235f810dec3ea1ef63ce0f4f632b19a60f45a 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
@@ -287,6 +287,28 @@ 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(); |
Xianzhu
2016/02/25 19:57:51
Moved from LayoutBox::updateFromStyle().
|
+ 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 |
+{ |
+ bool rootLayerScrolls = document().settings() && document().settings()->rootLayerScrolls(); |
+ return (rootLayerScrolls || !isLayoutView()) |
+ // If overflow has been propagated to the viewport, it has no effect here. |
+ && node() != document().viewportDefiningElement(); |
chrishtr
2016/02/26 19:42:16
It seems it would be slightly faster to write:
if
Xianzhu
2016/02/26 20:12:57
Separated out root scroll logic into LayoutView::a
|
+} |
+ |
void LayoutBlock::invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& childPaintInvalidationState) |
{ |
LayoutBox::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidationState); |