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

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

Issue 2871733003: [LayoutNG] Refactor NGLineBreaker for ShapingLineBreaker (Closed)
Patch Set: WIP, eae review Created 3 years, 7 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/inline/ng_line_breaker.h
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.h
index 79f9d07250c41fea5d3c694f5f4c15efd54c0783..2cda5dcee466c7b68ee65ba3f4bbe24140e13c3b 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.h
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.h
@@ -6,24 +6,46 @@
#define NGLineBreaker_h
#include "core/CoreExport.h"
+#include "core/layout/ng/inline/ng_inline_item_result.h"
#include "platform/heap/Handle.h"
#include "platform/wtf/text/AtomicString.h"
namespace blink {
+class LazyLineBreakIterator;
+class NGInlineBreakToken;
+class NGInlineItem;
+class NGInlineNode;
class NGInlineLayoutAlgorithm;
// Represents a line breaker.
class CORE_EXPORT NGLineBreaker {
public:
- NGLineBreaker(const AtomicString locale) : locale_(locale) {}
+ NGLineBreaker(NGInlineNode*,
+ const NGConstraintSpace*,
+ NGInlineBreakToken* = nullptr);
~NGLineBreaker() {}
STACK_ALLOCATED();
- void BreakLines(NGInlineLayoutAlgorithm*, const String&, unsigned);
+ // Compute the next line break point and produces NGInlineItemResults for
+ // the line.
+ void NextLine(NGInlineItemResults*, NGInlineLayoutAlgorithm*);
+
+ // Create an NGInlineBreakToken for the last line returned by NextLine().
+ RefPtr<NGInlineBreakToken> CreateBreakToken() const;
private:
+ void LayoutAtomicInline(const NGInlineItem&, NGInlineItemResult*);
+
+ void HandleOverflow(NGInlineItemResults*, const LazyLineBreakIterator&);
+
+ void SkipCollapsibleWhitespaces();
+
+ Persistent<NGInlineNode> node_;
+ const NGConstraintSpace* constraint_space_;
const AtomicString locale_;
+ unsigned item_index_;
+ unsigned offset_;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698