Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
| index 33672ccc2d653469824876d32a0794e44c97fdf4..dd2c47d7dbe0e0167b23642b8f2edd94ef13e93d 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp |
| @@ -33,6 +33,7 @@ |
| #include "core/layout/LayoutFlexibleBox.h" |
| #include "core/layout/LayoutGeometryMap.h" |
| #include "core/layout/LayoutInline.h" |
| +#include "core/layout/LayoutTableCell.h" |
| #include "core/layout/LayoutView.h" |
| #include "core/layout/compositing/CompositedLayerMapping.h" |
| #include "core/layout/compositing/PaintLayerCompositor.h" |
| @@ -981,10 +982,18 @@ void LayoutBoxModelObject::updateStickyPositionConstraints() const { |
| // nested position:sticky elements between themselves and their |
| // containingBlock, and between the containingBlock and their scrollAncestor. |
| // |
| - // The respective search ranges are [container, containingBlock) and |
| + // The respective search ranges are [locationContainer, containingBlock) and |
| // [containingBlock, scrollAncestor). |
| + |
| + // Table cells are a special case; Blink ignores them for locationContainer() |
| + // purposes, but their sticky offset does affect descendant sticky objects. |
| + // TODO(smcgruer): Remove cell override once Blink supports the correct |
| + // locationContainer for CSS 3. |
| + LayoutObject* locationContainerForSticky = |
|
smcgruer
2017/03/29 18:02:57
1. I'm not sure if we also want to do this for its
|
| + isTableCell() ? toLayoutTableCell(this)->row() : locationContainer; |
| + |
| constraints.setNearestStickyBoxShiftingStickyBox( |
| - findFirstStickyBetween(locationContainer, containingBlock)); |
| + findFirstStickyBetween(locationContainerForSticky, containingBlock)); |
| // We cannot use |scrollAncestor| here as it disregards the root |
| // ancestorOverflowLayer(), which we should include. |
| constraints.setNearestStickyBoxShiftingContainingBlock(findFirstStickyBetween( |