Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(487)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp

Issue 2786743002: Enable position:sticky for <thead> and <tr> elements (Closed)
Patch Set: Rebase over blink reformat Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b14965cd8942153e182585d74d747d5b054ab45a..6488bb360cb8499efb3e8b20add03621c600852d 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"
@@ -988,10 +989,19 @@ 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* location_container_for_sticky =
+ IsTableCell() ? ToLayoutTableCell(this)->Row() : location_container;
+
constraints.SetNearestStickyBoxShiftingStickyBox(
- FindFirstStickyBetween(location_container, containing_block));
+ FindFirstStickyBetween(location_container_for_sticky, containing_block));
+
// We cannot use |scrollAncestor| here as it disregards the root
// ancestorOverflowLayer(), which we should include.
constraints.SetNearestStickyBoxShiftingContainingBlock(FindFirstStickyBetween(
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698