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

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

Issue 2865903002: [LayoutNG] Inline margin/border/padding, inter-item breaking, and tests (Closed)
Patch Set: ikilpatrick 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 3823bd947c116cbf03d65554036fb014894a6c99..9260b0ac7e5a54f9f1480d299f9b57c83951c083 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
@@ -8,11 +8,12 @@
#include "core/CoreExport.h"
#include "core/layout/ng/inline/ng_inline_item_result.h"
#include "platform/heap/Handle.h"
+#include "platform/text/TextBreakIterator.h"
+#include "platform/wtf/Allocator.h"
#include "platform/wtf/text/AtomicString.h"
namespace blink {
-class LazyLineBreakIterator;
class NGInlineBreakToken;
class NGInlineItem;
class NGInlineNode;
@@ -43,24 +44,50 @@ class CORE_EXPORT NGLineBreaker {
private:
void BreakLine(NGInlineItemResults*, NGInlineLayoutAlgorithm*);
- bool HandleControlItem(const NGInlineItem&,
- const String& text,
- NGInlineItemResult*,
- LayoutUnit position);
- void LayoutAtomicInline(const NGInlineItem&, NGInlineItemResult*);
+ enum class LineBreakState {
+ // The current position is not breakable.
+ kNotBreakable,
+ // The current position is breakable.
+ kIsBreakable,
+ // Break by including trailing items (CloseTag).
+ kBreakAfterTrailings,
+ // Break immediately.
+ kForcedBreak
+ };
- void HandleOverflow(NGInlineItemResults*, const LazyLineBreakIterator&);
+ LineBreakState HandleText(const NGInlineItem&, NGInlineItemResult*);
+ void BreakText(NGInlineItemResult*,
+ const NGInlineItem&,
+ LayoutUnit available_width);
+
+ LineBreakState HandleControlItem(const NGInlineItem&, NGInlineItemResult*);
+ LineBreakState HandleAtomicInline(const NGInlineItem&, NGInlineItemResult*);
+ void HandleFloat(const NGInlineItem&,
+ NGInlineItemResults*,
+ NGInlineLayoutAlgorithm*);
+
+ void HandleOpenTag(const NGInlineItem&, NGInlineItemResult*);
+ void HandleCloseTag(const NGInlineItem&, NGInlineItemResult*);
+
+ void HandleOverflow(NGInlineItemResults*);
+ void Rewind(NGInlineItemResults*, unsigned new_end);
+
+ void UpdateBreakIterator(const ComputedStyle&);
void MoveToNextOf(const NGInlineItem&);
+ void MoveToNextOf(const NGInlineItemResult&);
void SkipCollapsibleWhitespaces();
- void AppendCloseTags(NGInlineItemResults*);
-
Persistent<NGInlineNode> node_;
const NGConstraintSpace* constraint_space_;
const AtomicString locale_;
unsigned item_index_;
unsigned offset_;
+ LayoutUnit available_width_;
+ LayoutUnit position_;
+ LazyLineBreakIterator break_iterator_;
+
+ unsigned auto_wrap_ : 1;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698