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

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

Issue 1406953003: Compute positioned elements width correctly when it has anonymous ancestors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 5 years, 1 month 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
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 4319671d0ac7e4a7120fca3ef59d05e0d5e5f3df..78cd0d7b2b193b1f671509af4405168dbec7d1ff 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -2852,7 +2852,11 @@ LayoutUnit LayoutBox::containingBlockLogicalWidthForPositioned(const LayoutBoxMo
if (hasOverrideContainingBlockLogicalWidth())
return overrideContainingBlockContentLogicalWidth();
- if (containingBlock->isBox())
+ // Ensure we compute our width based on the width of our rel-pos inline container rather than any anonymous block
+ // created to manage a block-flow ancestor of ours in the rel-pos inline's inline flow.
+ if (containingBlock->isAnonymousBlock() && containingBlock->isRelPositioned())
+ containingBlock = toLayoutBox(containingBlock)->continuation();
+ else if (containingBlock->isBox())
return std::max(LayoutUnit(), toLayoutBox(containingBlock)->clientLogicalWidth());
ASSERT(containingBlock->isLayoutInline() && containingBlock->isInFlowPositioned());
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/block/positioning/positioned-child-inside-relative-positioned-anonymous-block-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698