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..4b5ca83d0e769787379146aa4643390e7c3c0af4 100644 |
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp |
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp |
@@ -224,7 +224,12 @@ static CSSValue* ValueForPositionOffset(const ComputedStyle& style, |
if (offset.IsAuto() && layout_object) { |
// 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()) { |
+ // According to https://crbug.com/703816, "top:auto" and "top:0px" have very |
flackr
2017/05/09 21:21:41
nit: Let's just say something to the effect of "Po
yigu
2017/05/09 21:35:20
Done.
|
+ // different meaning for sticky elements. Therefore "auto" should be |
+ // returned regardless the opposite. Hence we only check IsRelPositioned |
+ // instead of IsInflowPositioned so StickyPositioned element can be handled |
+ // implicitly. |
+ if (layout_object->IsRelPositioned()) { |
// If e.g. left is auto and right is not auto, then left's computed value |
// is negative right. So we get the opposite length unit and see if it is |
// auto. |