Index: third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h |
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h |
index b9ddfdfd1ae200e3b144228f846c317db12b34bb..ee043a8a791d6914ae6c678f636347a6214ecf87 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h |
@@ -15,8 +15,9 @@ namespace blink { |
class NGBlockNode; |
class NGBreakToken; |
+struct NGFloatingObject; |
-// The NGPhysicalFragmentBase contains the output information from layout. The |
+// The NGPhysicalFragment contains the output information from layout. The |
// fragment stores all of its information in the physical coordinate system for |
// use by paint, hit-testing etc. |
// |
@@ -45,20 +46,20 @@ class CORE_EXPORT NGPhysicalFragment |
// Returns the offset relative to the parent fragement's content-box. |
LayoutUnit LeftOffset() const { |
- DCHECK(has_been_placed_); |
+ DCHECK(is_placed_); |
return offset_.left; |
} |
LayoutUnit TopOffset() const { |
- DCHECK(has_been_placed_); |
+ DCHECK(is_placed_); |
return offset_.top; |
} |
// Should only be used by the parent fragement's layout. |
void SetOffset(NGPhysicalOffset offset) { |
- DCHECK(!has_been_placed_); |
+ DCHECK(!is_placed_); |
offset_ = offset; |
- has_been_placed_ = true; |
+ is_placed_ = true; |
} |
NGBreakToken* BreakToken() const { return break_token_; } |
@@ -72,6 +73,19 @@ class CORE_EXPORT NGPhysicalFragment |
return out_of_flow_positions_; |
} |
+ bool IsPlaced() const { return is_placed_; } |
+ |
+ // List of floats that need to be positioned by the next in-flow child that |
+ // can determine its position in space. |
ikilpatrick
2017/01/20 00:03:17
... this may occurs in situation X.
Gleb Lanbin
2017/01/20 00:45:27
Done.
|
+ const HeapVector<Member<NGFloatingObject>>& UnpositionedFloats() const { |
+ return unpositioned_floats_; |
+ } |
+ |
+ // List of positioned float that need to be copied to the old layout tree. |
ikilpatrick
2017/01/20 00:03:17
maybe... TODO remove this once we change painting
Gleb Lanbin
2017/01/20 00:45:27
Done.
|
+ const HeapVector<Member<NGFloatingObject>>& PositionedFloats() const { |
+ return positioned_floats_; |
+ } |
+ |
DECLARE_TRACE_AFTER_DISPATCH(); |
DECLARE_TRACE(); |
@@ -84,6 +98,8 @@ class CORE_EXPORT NGPhysicalFragment |
NGFragmentType type, |
HeapLinkedHashSet<WeakMember<NGBlockNode>>& out_of_flow_descendants, |
Vector<NGStaticPosition> out_of_flow_positions, |
+ HeapVector<Member<NGFloatingObject>>& unpositioned_floats, |
+ HeapVector<Member<NGFloatingObject>>& positioned_floats, |
NGBreakToken* break_token = nullptr); |
NGPhysicalSize size_; |
@@ -92,9 +108,11 @@ class CORE_EXPORT NGPhysicalFragment |
Member<NGBreakToken> break_token_; |
HeapLinkedHashSet<WeakMember<NGBlockNode>> out_of_flow_descendants_; |
Vector<NGStaticPosition> out_of_flow_positions_; |
+ HeapVector<Member<NGFloatingObject>> unpositioned_floats_; |
+ HeapVector<Member<NGFloatingObject>> positioned_floats_; |
unsigned type_ : 1; |
- unsigned has_been_placed_ : 1; |
+ unsigned is_placed_ : 1; |
}; |
} // namespace blink |