Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
index c438cf02eb89b27ee507e657c12a2d6998906d3c..ac7a882cf16d9f23d8cd8dab4921d29c19da833a 100644 |
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
@@ -317,8 +317,17 @@ void CompositedLayerMapping::UpdateStickyConstraints( |
// The enclosing layers offset returned from |convertToLayerCoords| must be |
// adjusted for both scroll and ancestor sticky elements. |
LayoutPoint enclosing_layer_offset; |
- compositing_container->ConvertToLayerCoords(ancestor_overflow_layer, |
- enclosing_layer_offset); |
+ // The offset from the compositing_container to the ancestor_overflow_layer |
+ // when we have a scroll parent or a fix positioned container is computed by |
+ // the source_to_parent vector on the transform node. |
+ // TODO(yigu): Eventually we want to remove the dependancy of |
+ // source_to_parent from StickyPositionOffset in property_tree.cc. |
+ if (!ScrollParent() || |
+ !compositing_container->GetLayoutObject().IsFixedPositioned()) { |
flackr
2017/05/19 18:28:31
I thought we wanted to only compute this offset if
yigu
2017/05/19 19:50:45
Done.
|
+ compositing_container->ConvertToLayerCoords(ancestor_overflow_layer, |
+ enclosing_layer_offset); |
+ } |
+ |
DCHECK(!ScrollParent() || ScrollParent() == ancestor_overflow_layer); |
if (!ScrollParent() && compositing_container != ancestor_overflow_layer) { |
enclosing_layer_offset += LayoutSize( |