Chromium Code Reviews| Index: Source/core/rendering/style/RenderStyle.cpp |
| diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp |
| index e89db8af349ca5009b86f4ad2d9cc54e510963d5..9e576f2ed3487227fe9279c7ec20071dce5b0015 100644 |
| --- a/Source/core/rendering/style/RenderStyle.cpp |
| +++ b/Source/core/rendering/style/RenderStyle.cpp |
| @@ -355,6 +355,16 @@ bool RenderStyle::inheritedDataShared(const RenderStyle* other) const |
| && rareInheritedData.get() == other->rareInheritedData.get(); |
| } |
| +static bool dependenceOnContentHeightHasChanged(const LengthBox& a, const LengthBox& b) |
| +{ |
| + // If top or bottom become auto/non-auto then it means we either have to solve height based |
| + // on the content or stop doing so (http://www.w3.org/TR/CSS2/visudet.html#abs-non-replaced-height) |
| + // - either way requires a layout. |
| + if (a.top().isAuto() != b.top().isAuto() || a.bottom().isAuto() != b.bottom().isAuto()) |
|
mstensho (USE GERRIT)
2015/02/02 10:00:47
Just "return blablabla", instead of "if (blablabla
rhogan
2015/02/02 19:22:49
We would still need to resolve top/bottom in compu
|
| + return true; |
| + return false; |
| +} |
| + |
| StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other) const |
| { |
| // Note, we use .get() on each DataRef below because DataRef::operator== will do a deep |
| @@ -383,7 +393,10 @@ StyleDifference RenderStyle::visualInvalidationDiff(const RenderStyle& other) co |
| if (!diff.needsFullLayout() && position() != StaticPosition && surround->offset != other.surround->offset) { |
| // Optimize for the case where a positioned layer is moving but not changing size. |
| - diff.setNeedsPositionedMovementLayout(); |
| + if (dependenceOnContentHeightHasChanged(surround->offset, other.surround->offset)) |
| + diff.setNeedsFullLayout(); |
| + else |
| + diff.setNeedsPositionedMovementLayout(); |
| } |
| if (diffNeedsPaintInvalidationLayer(other)) |