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