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

Unified Diff: third_party/WebKit/Source/core/layout/ng/layout_ng_block_flow.cc

Issue 2591273002: [layoutng] Better abspos support in legacy interop (Closed)
Patch Set: isPositioned -> isOutOfFlowPositioned Created 4 years 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 | « no previous file | 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/ng/layout_ng_block_flow.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/layout_ng_block_flow.cc b/third_party/WebKit/Source/core/layout/ng/layout_ng_block_flow.cc
index 6410d6ab882310807be524338ac5e5d86b8123ca..eeff2fa3f38af1e5810f49108b5a109054179400 100644
--- a/third_party/WebKit/Source/core/layout/ng/layout_ng_block_flow.cc
+++ b/third_party/WebKit/Source/core/layout/ng/layout_ng_block_flow.cc
@@ -30,6 +30,21 @@ void LayoutNGBlockFlow::layoutBlock(bool relayoutChildren) {
while (!m_box->Layout(constraint_space, &fragment))
;
+ if (isOutOfFlowPositioned()) {
+ // In legacy layout, abspos differs from regular blocks in that abspos
+ // blocks position themselves in their own layout, instead of getting
+ // positioned by their parent. So it we are a positioned block in a legacy-
+ // layout containing block, we have to emulate this positioning.
+ // Additionally, until we natively support abspos in LayoutNG, this code
+ // will also be reached though the layoutPositionedObjects call in
+ // NGBlockNode::CopyFragmentDataToLayoutBox.
+ LogicalExtentComputedValues computedValues;
+ computeLogicalWidth(computedValues);
+ setLogicalLeft(computedValues.m_position);
+ computeLogicalHeight(logicalHeight(), logicalTop(), computedValues);
+ setLogicalTop(computedValues.m_position);
+ }
+
for (auto& descendant : fragment->PhysicalFragment()->OutOfFlowDescendants())
descendant->UseOldOutOfFlowPositioning();
clearNeedsLayout();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698