Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(502)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBlock.cpp

Issue 1643663002: Conditionally create PaintLayer's scrollable area object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PaintLayerClipper
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698