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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc

Issue 2745973002: [LayoutNG] Implement atomic inlines for LayoutNGInline (Closed)
Patch Set: ikilpatrick review 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_node.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc
index 6b896ddb19dd867b675242c3bcb8e8063a5bf2c1..1137faaf66ef0b6706c0d2b182da31909d70d58c 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc
@@ -219,8 +219,11 @@ LayoutUnit NGLayoutInlineItem::InlineSize(unsigned start, unsigned end) const {
return LayoutUnit();
if (!style_ || !shape_result_) {
- // Bidi controls do not have widths.
- // TODO(kojii): Atomic inline not supported yet.
+ DCHECK(start == start_offset_ && end == end_offset_);
+ DCHECK(!IsAtomicInlineLevel()) << "Use NGLineBuilder::InlineSize";
+ DCHECK(!layout_object_ ||
+ layout_object_->isFloatingOrOutOfFlowPositioned());
+ // Bidi controls and out-of-flow objects do not have in-flow widths.
return LayoutUnit();
}
@@ -250,7 +253,8 @@ void NGInlineNode::ShapeText() {
// Shape each item with the full context of the entire node.
HarfBuzzShaper shaper(text_content_.characters16(), text_content_.length());
for (auto& item : items_) {
- // Skip object replacement characters and bidi control characters.
+ // Skip non-text items; e.g., bidi controls, atomic inlines, out-of-flow
+ // objects.
if (!item.style_)
continue;
@@ -305,7 +309,7 @@ MinMaxContentSize NGInlineNode::ComputeMinMaxContentSize() {
// max-content is the width without any line wrapping.
// TODO(kojii): Implement hard breaks (<br> etc.) to break.
for (const auto& item : items_)
- sizes.max_content += item.InlineSize();
+ sizes.max_content += line_builder.InlineSize(item);
ikilpatrick 2017/03/16 18:26:15 add todo for atomic inlines.
kojii 2017/03/16 19:16:33 atomic inline is computed by this change, by calli
return sizes;
}

Powered by Google App Engine
This is Rietveld 408576698