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

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

Issue 2776643002: Walk the container chain to correctly find nested inline sticky ancestors. (Closed)
Patch Set: Created 3 years, 9 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/layout/LayoutBoxModelObject.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/LayoutBoxModelObjectTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp
index 2075455464a254e8ad6aab65699330b30d5f2476..d9f877390429ff1d4c835927d545807d2cb73a63 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObjectTest.cpp
@@ -341,9 +341,15 @@ TEST_F(LayoutBoxModelObjectTest,
setBodyInnerHTML(
"<style>#stickyOuterDiv { position: sticky; }"
"#stickyOuterInline { position: sticky; display: inline; }"
- "#stickyInnerInline { position: sticky; display: inline; }</style>"
- "<div id='stickyOuterDiv'><div id='stickyOuterInline'>"
- "<div id='stickyInnerInline'></div></div></div>");
+ "#stickyInnerInline { position: sticky; display: inline; }"
+ ".inline { display: inline; }</style>"
+ "<div id='stickyOuterDiv'>"
+ " <div id='stickyOuterInline'>"
+ " <div class='inline'>"
+ " <div id='stickyInnerInline'></div>"
+ " </div>"
+ " </div>"
+ "</div>");
LayoutBoxModelObject* stickyOuterDiv =
toLayoutBoxModelObject(getLayoutObjectByElementId("stickyOuterDiv"));
@@ -371,7 +377,8 @@ TEST_F(LayoutBoxModelObjectTest,
.nearestStickyBoxShiftingStickyBox());
// However the inner inline element does have a sticky-box shifting ancestor,
- // as its containing block is the ancestor block element, not its parent.
+ // as its containing block is the ancestor block element, above its ancestor
+ // sticky element.
EXPECT_EQ(stickyOuterInline,
constraintsMap.at(stickyInnerInline->layer())
.nearestStickyBoxShiftingStickyBox());
@@ -843,10 +850,18 @@ TEST_F(LayoutBoxModelObjectTest, StickyPositionNestedInlineElements) {
"<style>#scroller { width: 100px; height: 100px; overflow-y: scroll; }"
"#paddingBefore { height: 50px; }"
"#outerInline { display: inline; position: sticky; top: 0; }"
+ ".inline {display: inline;}"
"#innerInline { display: inline; position: sticky; top: 25px; }"
"#paddingAfter { height: 200px; }</style>"
- "<div id='scroller'><div id='paddingBefore'></div><div id='outerInline'>"
- "<div id='innerInline'></div></div><div id='paddingAfter'></div></div>");
+ "<div id='scroller'>"
+ " <div id='paddingBefore'></div>"
+ " <div id='outerInline'>"
+ " <div class='inline'>"
+ " <div id='innerInline'></div>"
+ " </div>"
+ " </div>"
+ " <div id='paddingAfter'></div>"
+ "</div>");
LayoutBoxModelObject* outerInline =
toLayoutBoxModelObject(getLayoutObjectByElementId("outerInline"));
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698