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

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

Issue 2298273002: Initial exclusion aware layout opportunities implementation (Closed)
Patch Set: Address reviewer comments Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc » ('j') | 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_constraint_space.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h
index cb266a7aca30c581c813bed9669567ac104ffe9f..88b5cfd535bac64d6fc34fe8ae0af2e6179b40e3 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_constraint_space.h
@@ -11,6 +11,7 @@
#include "core/layout/ng/ng_writing_mode.h"
#include "platform/heap/Handle.h"
#include "wtf/text/WTFString.h"
+#include "wtf/Vector.h"
namespace blink {
@@ -98,7 +99,7 @@ class CORE_EXPORT NGConstraintSpace final
// size, or add an exclusion.
void Subtract(const NGFragment*);
- NGLayoutOpportunityIterator LayoutOpportunities(
+ NGLayoutOpportunityIterator* LayoutOpportunities(
unsigned clear = NGClearNone,
bool for_inline_or_bfc = false);
@@ -119,22 +120,38 @@ class CORE_EXPORT NGConstraintSpace final
unsigned writing_mode_ : 3;
};
-class CORE_EXPORT NGLayoutOpportunityIterator final {
+class CORE_EXPORT NGLayoutOpportunityIterator final
+ : public GarbageCollectedFinalized<NGLayoutOpportunityIterator> {
public:
NGLayoutOpportunityIterator(NGConstraintSpace* space,
unsigned clear,
- bool for_inline_or_bfc)
- : constraint_space_(space),
- clear_(clear),
- for_inline_or_bfc_(for_inline_or_bfc) {}
+ bool for_inline_or_bfc);
~NGLayoutOpportunityIterator() {}
NGConstraintSpace* Next();
+ DEFINE_INLINE_VIRTUAL_TRACE() {
+ visitor->trace(constraint_space_);
+ visitor->trace(current_opportunities_);
+ }
+
private:
- Persistent<NGConstraintSpace> constraint_space_;
+ void computeForExclusion(unsigned index);
+ LayoutUnit heightForOpportunity(LayoutUnit left,
+ LayoutUnit top,
+ LayoutUnit right,
+ LayoutUnit bottom);
+ void addLayoutOpportunity(LayoutUnit left,
+ LayoutUnit top,
+ LayoutUnit right,
+ LayoutUnit bottom);
+
+ Member<NGConstraintSpace> constraint_space_;
unsigned clear_;
bool for_inline_or_bfc_;
+ Vector<NGExclusion> filtered_exclusions_;
+ HeapVector<Member<NGConstraintSpace>> current_opportunities_;
+ unsigned current_exclusion_idx_;
};
inline std::ostream& operator<<(std::ostream& stream,
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_constraint_space.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698