 Chromium Code Reviews
 Chromium Code Reviews Issue 2890583002:
  Fix incorrect use of coords conversion for sticky elements  (Closed)
    
  
    Issue 2890583002:
  Fix incorrect use of coords conversion for sticky elements  (Closed) 
  | 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 b938ccffbe207cb53c29ea507fcb973da2d904a8..17691563d39a802e21ae22ccbdeae4e6f042108f 100644 | 
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp | 
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp | 
| @@ -315,8 +315,12 @@ 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); | 
| + bool is_descendant = false; | 
| 
flackr
2017/05/17 19:44:03
Is this not equivalent to !ScrollParent()?
 
yigu
2017/05/17 20:28:15
No. is_descendant will be false if compositing_con
 
flackr
2017/05/18 15:54:08
Composite which ancestor? If you apply will-change
 | 
| + compositing_container->ConvertToLayerCoords( | 
| + ancestor_overflow_layer, enclosing_layer_offset, &is_descendant); | 
| + if (!is_descendant) | 
| + enclosing_layer_offset = LayoutPoint(); | 
| 
flackr
2017/05/17 19:44:03
How does the sticky element know where it is with
 
yigu
2017/05/17 20:28:15
When the compositing_container is a descendant of
 
flackr
2017/05/18 15:54:08
My concern is when the scroller is not at the top-
 | 
| + | 
| DCHECK(!ScrollParent() || ScrollParent() == ancestor_overflow_layer); | 
| if (!ScrollParent() && compositing_container != ancestor_overflow_layer) { | 
| enclosing_layer_offset += LayoutSize( |