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()) |