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

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

Issue 2854993002: [LayoutNG] Add NGLayoutInputNode::ShowNodeTree (Closed)
Patch Set: Use forward declaration for LayoutObject Created 3 years, 8 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_item.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item.cc
index a2ce14cfb7214c2cd29cb0c61f06b8847b8e3ef2..b2bf548821100a8d0f01558a6965f1bdadb83e63 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item.cc
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item.cc
@@ -4,10 +4,22 @@
#include "core/layout/ng/inline/ng_inline_item.h"
+#include "core/layout/LayoutObject.h"
#include "platform/fonts/CharacterRange.h"
#include "platform/fonts/shaping/ShapeResultBuffer.h"
namespace blink {
+namespace {
+
+const char* kNGInlineItemTypeStrings[] = {
+ "Text", "AtomicInline", "OpenTag", "CloseTag",
+ "Floating", "OutOfFlowPositioned", "BidiControl"};
+
+} // namespace
+
+const char* NGInlineItem::NGInlineItemTypeToString(int val) const {
+ return kNGInlineItemTypeStrings[val];
+}
// Set bidi level to a list of NGInlineItem from |index| to the item that ends
// with |end_offset|.
@@ -39,6 +51,12 @@ unsigned NGInlineItem::SetBidiLevel(Vector<NGInlineItem>& items,
return index + 1;
}
+String NGInlineItem::ToString() const {
+ return String::Format("NGInlineItem. Type: '%s'. LayoutObject: '%s'",
+ NGInlineItemTypeToString(Type()),
+ GetLayoutObject()->DebugName().Ascii().data());
+}
+
// Split |items[index]| to 2 items at |offset|.
// All properties other than offsets are copied to the new item and it is
// inserted at |items[index + 1]|.

Powered by Google App Engine
This is Rietveld 408576698