Index: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp |
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp |
index 9d4e5c14c0e8de4d66f367f8eff7ae977eaba06c..61fc55728919a5e585bc53c26a94f0b4c49ab354 100644 |
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp |
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp |
@@ -222,6 +222,11 @@ static CSSValue* ValueForPositionOffset(const ComputedStyle& style, |
} |
if (offset.IsAuto() && layout_object) { |
+ // "top:auto" and "top:0px" have very different meaning for sticky elements. |
+ // Therefore "auto" should be returned regardless the opposite. |
flackr
2017/05/09 20:26:34
nit: Add a link to the bug for reference.
yigu
2017/05/09 20:43:58
Done.
|
+ if (layout_object->IsStickyPositioned()) |
+ return CSSIdentifierValue::Create(CSSValueAuto); |
+ |
// If the property applies to a positioned element and the resolved value of |
// the display property is not none, the resolved value is the used value. |
if (layout_object->IsInFlowPositioned()) { |
flackr
2017/05/09 20:26:35
Sticky is in flow positioned, let's change this co
yigu
2017/05/09 20:43:58
Done.
|