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); |
} |
} |