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

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

Issue 2423263002: Create FloatingObject from NG Fragment in old Layout tree (Closed)
Patch Set: add DCHECK(layout_box_->parent()) Created 4 years, 2 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 | « 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/ng_box.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_box.cc b/third_party/WebKit/Source/core/layout/ng/ng_box.cc
index 72f3af367574b0289697a268044e420b502fdce1..1c54934ee10e97962c1c6f2abf02abeee977dd12 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_box.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_box.cc
@@ -104,9 +104,19 @@ void NGBox::SetFirstChild(NGBox* child) {
}
void NGBox::PositionUpdated() {
- if (layout_box_) {
- layout_box_->setX(fragment_->LeftOffset());
- layout_box_->setY(fragment_->TopOffset());
+ if (!layout_box_)
+ return;
+ DCHECK(layout_box_->parent()) << "Should be called on children only.";
+
+ layout_box_->setX(fragment_->LeftOffset());
+ layout_box_->setY(fragment_->TopOffset());
+
+ if (layout_box_->isFloating() && layout_box_->parent()->isLayoutBlockFlow()) {
+ FloatingObject* floating_object = toLayoutBlockFlow(layout_box_->parent())
+ ->insertFloatingObject(*layout_box_);
+ floating_object->setX(fragment_->LeftOffset());
+ floating_object->setY(fragment_->TopOffset());
+ floating_object->setIsPlaced(true);
}
}
« 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