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

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

Issue 2772503004: [LayoutNG] Add NGInlineBreakToken and back of NGInlineLayoutAlgorithm (Closed)
Patch Set: Resolved merge conflicts Created 3 years, 9 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_inline_break_token.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_inline_break_token.h b/third_party/WebKit/Source/core/layout/ng/ng_inline_break_token.h
new file mode 100644
index 0000000000000000000000000000000000000000..d6a46034e0f13963ea8082d9e73fb2b5a1651b56
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/ng_inline_break_token.h
@@ -0,0 +1,53 @@
+// Copyright 2017 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 NGInlineBreakToken_h
+#define NGInlineBreakToken_h
+
+#include "core/CoreExport.h"
+#include "core/layout/ng/ng_break_token.h"
+
+namespace blink {
+
+class NGInlineNode;
+
+// Represents a break token for an inline node.
+class CORE_EXPORT NGInlineBreakToken : public NGBreakToken {
+ public:
+ // Creates a break token for a node which did fragment, and can potentially
+ // produce more fragments.
+ static RefPtr<NGInlineBreakToken> create(NGInlineNode* node,
+ unsigned item_index,
+ unsigned text_offset) {
+ return adoptRef(new NGInlineBreakToken(node, item_index, text_offset));
+ }
+
+ // Creates a break token for a node which cannot produce any more fragments.
+ static RefPtr<NGInlineBreakToken> create(NGLayoutInputNode* node) {
+ return adoptRef(new NGInlineBreakToken(node));
+ }
+
+ unsigned ItemIndex() const { return item_index_; }
+ unsigned TextOffset() const { return text_offset_; }
+
+ private:
+ NGInlineBreakToken(NGInlineNode* node,
+ unsigned item_index,
+ unsigned text_offset);
+
+ explicit NGInlineBreakToken(NGLayoutInputNode* node);
+
+ unsigned item_index_;
+ unsigned text_offset_;
+};
+
+DEFINE_TYPE_CASTS(NGInlineBreakToken,
+ NGBreakToken,
+ token,
+ token->Type() == NGBreakToken::kInlineBreakToken,
+ token.Type() == NGBreakToken::kInlineBreakToken);
+
+} // namespace blink
+
+#endif // NGInlineBreakToken_h

Powered by Google App Engine
This is Rietveld 408576698