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

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

Issue 2883213003: [LayoutNG] Implement inline margins for atomic inline boxes (Closed)
Patch Set: Fix 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_inline_node.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
index f690f02b41d38792f9e11f5741cf8badb5c16430..b87dc9aa1d93a9f42db71308064f8a65f1641443 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
@@ -100,10 +100,17 @@ LayoutObject* NGInlineNode::CollectInlines(LayoutObject* start,
// NGInlineLayoutAlgorithm.
builder->Append(NGInlineItem::kFloating, kObjectReplacementCharacter,
nullptr, node);
+
} else if (node->IsOutOfFlowPositioned()) {
builder->Append(NGInlineItem::kOutOfFlowPositioned,
kObjectReplacementCharacter, nullptr, node);
+ } else if (node->IsAtomicInlineLevel()) {
+ // For atomic inlines add a unicode "object replacement character" to
+ // signal the presence of a non-text object to the unicode bidi algorithm.
+ builder->Append(NGInlineItem::kAtomicInline, kObjectReplacementCharacter,
+ node->Style(), node);
+
} else if (!node->IsInline()) {
// A block box found. End inline and transit to block layout.
return node;
@@ -111,15 +118,8 @@ LayoutObject* NGInlineNode::CollectInlines(LayoutObject* start,
} else {
builder->EnterInline(node);
- // For atomic inlines add a unicode "object replacement character" to
- // signal the presence of a non-text object to the unicode bidi algorithm.
- if (node->IsAtomicInlineLevel()) {
- builder->Append(NGInlineItem::kAtomicInline,
- kObjectReplacementCharacter, node->Style(), node);
- }
-
- // Otherwise traverse to children if they exist.
- else if (LayoutObject* child = node->SlowFirstChild()) {
+ // Traverse to children if they exist.
+ if (LayoutObject* child = node->SlowFirstChild()) {
node = child;
continue;

Powered by Google App Engine
This is Rietveld 408576698