Index: third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
index 5d363848d3c5ab03df6601b0635173eddeff537e..d64edeca9e1b51268e8f85e80454e168f11fb8fb 100644 |
--- a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
+++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp |
@@ -119,35 +119,6 @@ static bool parentStyleForcesZIndexToCreateStackingContext(const ComputedStyle& |
return parentStyle.isDisplayFlexibleOrGridBox(); |
} |
-static bool hasWillChangeThatCreatesStackingContext(const ComputedStyle& style) |
-{ |
- for (size_t i = 0; i < style.willChangeProperties().size(); ++i) { |
- switch (style.willChangeProperties()[i]) { |
- case CSSPropertyOpacity: |
- case CSSPropertyTransform: |
- case CSSPropertyAliasWebkitTransform: |
- case CSSPropertyTransformStyle: |
- case CSSPropertyAliasWebkitTransformStyle: |
- case CSSPropertyPerspective: |
- case CSSPropertyAliasWebkitPerspective: |
- case CSSPropertyWebkitMask: |
- case CSSPropertyWebkitMaskBoxImage: |
- case CSSPropertyWebkitClipPath: |
- case CSSPropertyWebkitBoxReflect: |
- case CSSPropertyWebkitFilter: |
- case CSSPropertyBackdropFilter: |
- case CSSPropertyZIndex: |
- case CSSPropertyPosition: |
- case CSSPropertyMixBlendMode: |
- case CSSPropertyIsolation: |
- return true; |
- default: |
- break; |
- } |
- } |
- return false; |
-} |
- |
void StyleAdjuster::adjustComputedStyle(ComputedStyle& style, const ComputedStyle& parentStyle, Element* element) |
{ |
if (style.display() != NONE) { |
@@ -180,26 +151,14 @@ void StyleAdjuster::adjustComputedStyle(ComputedStyle& style, const ComputedStyl |
style.setHasCompositorProxy(true); |
// Make sure our z-index value is only applied if the object is positioned. |
- if (style.position() == StaticPosition && !parentStyleForcesZIndexToCreateStackingContext(parentStyle)) |
- style.setHasAutoZIndex(); |
- |
- // Auto z-index becomes 0 for the root element and transparent objects. This prevents |
- // cases where objects that should be blended as a single unit end up with a non-transparent |
- // object wedged in between them. Auto z-index also becomes 0 for objects that specify transforms/masks/reflections. |
- if (style.hasAutoZIndex() && ((element && element->document().documentElement() == element) |
- || style.hasOpacity() |
- || style.hasTransformRelatedProperty() |
- || style.hasMask() |
- || style.clipPath() |
- || style.boxReflect() |
- || style.hasFilterInducingProperty() |
- || style.hasBlendMode() |
- || style.hasIsolation() |
- || style.hasViewportConstrainedPosition() |
- || isInTopLayer(element, style) |
- || hasWillChangeThatCreatesStackingContext(style) |
- || style.containsPaint())) |
- style.setZIndex(0); |
+ if (style.position() == StaticPosition && !parentStyleForcesZIndexToCreateStackingContext(parentStyle)) { |
+ style.setIsStackingContext(false); |
+ // TODO(alancutter): Avoid altering z-index here. |
rune
2016/06/10 12:25:52
Could you add the crbug issue here as well? I've a
|
+ if (!style.hasAutoZIndex()) |
+ style.setZIndex(0); |
+ } else if (!style.hasAutoZIndex()) { |
+ style.setIsStackingContext(true); |
+ } |
if (doesNotInheritTextDecoration(style, element)) |
style.clearAppliedTextDecorations(); |