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]|. |