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

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

Issue 2084723002: Remove LayoutView::doingFullPaintInvalidation() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More NeedsRebaselines Created 4 years, 6 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/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 8d2f18f7012defd451e73877a9219c51143dc035..8cc5859cdb74d683fcf2beeddef15f128a77e7ba 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1556,7 +1556,7 @@ PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(const PaintInvalidati
PaintInvalidationReason reason = LayoutBoxModelObject::invalidatePaintIfNeeded(paintInvalidationState);
- if (!view()->doingFullPaintInvalidation() && !isFullPaintInvalidationReason(reason))
+ if (!isFullPaintInvalidationReason(reason))
invalidatePaintForOverflowIfNeeded();
if (PaintLayerScrollableArea* area = getScrollableArea())
@@ -4670,7 +4670,46 @@ void LayoutBox::logicalExtentAfterUpdatingLogicalWidth(const LayoutUnit& newLogi
setMarginRight(oldMarginRight);
}
-inline bool LayoutBox::mustInvalidateFillLayersPaintOnWidthChange(const FillLayer& layer) const
+bool LayoutBox::mustInvalidateFillLayersPaintOnHeightChange(const FillLayer& layer) const
+{
+ // Nobody will use multiple layers without wanting fancy positioning.
+ if (layer.next())
+ return true;
+
+ // Make sure we have a valid image.
+ StyleImage* img = layer.image();
+ if (!img || !img->canRender())
+ return false;
+
+ if (layer.repeatY() != RepeatFill && layer.repeatY() != NoRepeatFill)
+ return true;
+
+ // TODO(alancutter): Make this work correctly for calc lengths.
+ if (layer.yPosition().hasPercent() && !layer.yPosition().isZero())
+ return true;
+
+ if (layer.backgroundYOrigin() != TopEdge)
+ return true;
+
+ EFillSizeType sizeType = layer.sizeType();
+
+ if (sizeType == Contain || sizeType == Cover)
+ return true;
+
+ if (sizeType == SizeLength) {
+ // TODO(alancutter): Make this work correctly for calc lengths.
+ if (layer.sizeLength().height().hasPercent() && !layer.sizeLength().height().isZero())
+ return true;
+ if (img->isGeneratedImage() && layer.sizeLength().height().isAuto())
+ return true;
+ } else if (img->usesImageContainerSize()) {
+ return true;
+ }
+
+ return false;
+}
+
+bool LayoutBox::mustInvalidateFillLayersPaintOnWidthChange(const FillLayer& layer) const
{
// Nobody will use multiple layers without wanting fancy positioning.
if (layer.next())
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698