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

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: 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 | « third_party/WebKit/Source/core/layout/ng/ng_box.h ('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/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..356bf59423119529b4caf484f8e05500a69e1e78 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_box.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_box.cc
@@ -103,11 +103,19 @@ void NGBox::SetFirstChild(NGBox* child) {
first_child_ = child;
}
-void NGBox::PositionUpdated() {
+void NGBox::PositionUpdated(LayoutBox* parent) {
if (layout_box_) {
layout_box_->setX(fragment_->LeftOffset());
layout_box_->setY(fragment_->TopOffset());
}
+
+ if (layout_box_->isFloating() && parent->isLayoutBlockFlow()) {
cbiesinger 2016/10/17 21:00:34 You're accessing layout_box_ without a nullcheck h
Gleb Lanbin 2016/10/17 22:13:22 Done.
+ FloatingObject* floating_object =
+ toLayoutBlockFlow(parent)->insertFloatingObject(*layout_box_);
+ floating_object->setX(fragment_->LeftOffset());
+ floating_object->setY(fragment_->TopOffset());
+ floating_object->setIsPlaced(true);
+ }
}
bool NGBox::CanUseNewLayout() {
@@ -137,7 +145,7 @@ void NGBox::CopyFragmentDataToLayoutBox(
// LayoutObject tree.
for (NGBox* box = FirstChild(); box; box = box->NextSibling()) {
if (box->fragment_)
- box->PositionUpdated();
+ box->PositionUpdated(layout_box_);
}
if (layout_box_->isLayoutBlock())
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_box.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698