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

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

Issue 2322293002: [LayoutNG] Split LayoutOpportunityIterator into separate file (Closed)
Patch Set: Patch for landing 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
Index: third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h
new file mode 100644
index 0000000000000000000000000000000000000000..98aac125e28c3df55eecc69082887d2b9c05f8ce
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h
@@ -0,0 +1,53 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NGLayoutOpportunityIterator_h
+#define NGLayoutOpportunityIterator_h
+
+#include "core/CoreExport.h"
+#include "core/layout/LayoutBox.h"
+#include "core/layout/ng/ng_constraint_space.h"
+#include "platform/heap/Handle.h"
+#include "wtf/text/WTFString.h"
+#include "wtf/Vector.h"
+
+namespace blink {
+
+class CORE_EXPORT NGLayoutOpportunityIterator final
+ : public GarbageCollectedFinalized<NGLayoutOpportunityIterator> {
+ public:
+ NGLayoutOpportunityIterator(NGConstraintSpace* space,
+ unsigned clear,
+ bool for_inline_or_bfc);
+ ~NGLayoutOpportunityIterator() {}
+
+ NGConstraintSpace* Next();
+
+ DEFINE_INLINE_VIRTUAL_TRACE() {
+ visitor->trace(constraint_space_);
+ visitor->trace(current_opportunities_);
+ }
+
+ private:
+ 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_;
+};
+
+} // namespace blink
+
+#endif // NGLayoutOpportunityIterator_h

Powered by Google App Engine
This is Rietveld 408576698