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

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

Issue 2948743002: [LayoutNG] Let NGLineBreaker pass line box location to NGInlineLayoutAlgorithm (Closed)
Patch Set: ikilpatrick review Created 3 years, 6 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 8ea6167d29ba49279ea609ed5eadf9cc13ada3de..bc694d6996baa9063a3b18707a26512053e37fe7 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,6 +8,7 @@
#include "core/CoreExport.h"
#include "core/layout/ng/inline/ng_inline_item_result.h"
#include "core/layout/ng/inline/ng_inline_node.h"
+#include "core/layout/ng/ng_layout_opportunity_iterator.h"
#include "platform/fonts/shaping/HarfBuzzShaper.h"
#include "platform/fonts/shaping/ShapeResultSpacing.h"
#include "platform/heap/Handle.h"
@@ -45,9 +46,12 @@ class CORE_EXPORT NGLineBreaker {
private:
void BreakLine(NGLineInfo*);
- bool HasAvailableWidth() const { return available_width_.has_value(); }
- LayoutUnit AvailableWidth() const { return available_width_.value(); }
+ bool HasAvailableWidth() const { return opportunity_.has_value(); }
+ LayoutUnit AvailableWidth() const {
+ return opportunity_.value().InlineSize();
+ }
void UpdateAvailableWidth();
+ void ComputeLineLocation(NGLineInfo*) const;
enum class LineBreakState {
// The current position is not breakable.
@@ -92,7 +96,7 @@ class CORE_EXPORT NGLineBreaker {
unsigned item_index_;
unsigned offset_;
LayoutUnit position_;
- WTF::Optional<LayoutUnit> available_width_;
+ WTF::Optional<NGLayoutOpportunity> opportunity_;
NGLogicalOffset content_offset_;
LazyLineBreakIterator break_iterator_;
HarfBuzzShaper shaper_;

Powered by Google App Engine
This is Rietveld 408576698