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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h

Issue 2816933003: Use Layout Opportunity Iterator to position new FC blocks. (Closed)
Patch Set: Fix comments Created 3 years, 8 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
Index: third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h
index 231750602f6c817490ecca332435c35b1ba478d3..e7e9be73e94b0d4e2a5e5b000054a532616e1a40 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h
@@ -6,6 +6,7 @@
#define NGLayoutAlgorithm_h
#include "core/CoreExport.h"
+#include "core/layout/ng/ng_floats_utils.h"
#include "core/layout/ng/ng_fragment_builder.h"
#include "core/layout/ng/ng_min_max_content_size.h"
#include "platform/wtf/Allocator.h"
@@ -64,6 +65,18 @@ class CORE_EXPORT NGLayoutAlgorithm {
return container_builder_.BfcOffset().value();
}
+ // Positions pending floats starting from {@origin_block_offset} and relative
+ // to ContainerBfcOffset().
+ void PositionPendingFloats(LayoutUnit origin_block_offset) {
ikilpatrick 2017/04/18 13:19:56 if there is another way to do this i'd prefer that
Gleb Lanbin 2017/04/18 17:30:20 yes, I was thinking about that as well. Here are 4
ikilpatrick 2017/04/18 21:04:11 My preferred option here would be (4) in a follow
+ DCHECK(container_builder_.BfcOffset())
+ << "Parent BFC offset should be known here";
+ const auto& floating_objects = container_builder_.UnpositionedFloats();
+ PositionFloats(origin_block_offset, ContainerBfcOffset().block_offset,
+ floating_objects, MutableConstraintSpace());
+ container_builder_.MutablePositionedFloats().AppendVector(floating_objects);
+ container_builder_.MutableUnpositionedFloats().Clear();
+ }
+
virtual NGInputNodeType* Node() const { return node_; }
NGBreakTokenType* BreakToken() const { return break_token_; }

Powered by Google App Engine
This is Rietveld 408576698