Index: Source/core/rendering/style/RenderStyle.cpp |
diff --git a/Source/core/rendering/style/RenderStyle.cpp b/Source/core/rendering/style/RenderStyle.cpp |
index 64bd27767603576930aa858ea699211cb535c4ee..8d1f8dadef7fba33d45c24e845fbea67acd9682f 100644 |
--- a/Source/core/rendering/style/RenderStyle.cpp |
+++ b/Source/core/rendering/style/RenderStyle.cpp |
@@ -570,7 +570,9 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon |
if ((visibility() == COLLAPSE) != (other->visibility() == COLLAPSE)) |
return StyleDifferenceLayout; |
- if (rareNonInheritedData->hasOpacity() != other->rareNonInheritedData->hasOpacity()) { |
+ // We only need do layout for opacity changes if adding or losing opacity could trigger a change |
+ // in us being a stacking context. |
+ if (hasAutoZIndex() != other->hasAutoZIndex() && rareNonInheritedData->hasOpacity() != other->rareNonInheritedData->hasOpacity()) { |
// FIXME: We would like to use SimplifiedLayout here, but we can't quite do that yet. |
// We need to make sure SimplifiedLayout can operate correctly on RenderInlines (we will need |
// to add a selfNeedsSimplifiedLayout bit in order to not get confused and taint every line). |