| Index: third_party/WebKit/Source/core/editing/Position.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/Position.cpp b/third_party/WebKit/Source/core/editing/Position.cpp
|
| index c7c0a81a8ab1bffa7da96ed81d3d66e83049917d..18a9f303973b34d818b0702c5ec2ceab6ddfabf0 100644
|
| --- a/third_party/WebKit/Source/core/editing/Position.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/Position.cpp
|
| @@ -574,34 +574,32 @@ Position toPositionInDOMTree(const PositionInFlatTree& position)
|
| }
|
| }
|
|
|
| -#ifndef NDEBUG
|
| -
|
| template <typename Strategy>
|
| String PositionTemplate<Strategy>::toAnchorTypeAndOffsetString() const
|
| {
|
| - StringBuilder builder;
|
| switch (anchorType()) {
|
| - case PositionAnchorType::OffsetInAnchor:
|
| - builder.append("offset");
|
| - break;
|
| + case PositionAnchorType::OffsetInAnchor: {
|
| + StringBuilder builder;
|
| + builder.append("offsetInAnchor[");
|
| + builder.append(m_offset);
|
| + builder.append("]");
|
| + return builder.toString();
|
| + }
|
| case PositionAnchorType::BeforeChildren:
|
| - builder.append("beforeChildren");
|
| - break;
|
| + return "beforeChildren";
|
| case PositionAnchorType::AfterChildren:
|
| - builder.append("afterChildren");
|
| - break;
|
| + return "afterChildren";
|
| case PositionAnchorType::BeforeAnchor:
|
| - builder.append("before");
|
| - break;
|
| + return "beforeAnchor";
|
| case PositionAnchorType::AfterAnchor:
|
| - builder.append("after");
|
| - break;
|
| + return "afterAnchor";
|
| }
|
| - builder.append(", offset:");
|
| - builder.append(m_offset);
|
| - return builder.toString();
|
| + NOTREACHED();
|
| + return emptyString();
|
| }
|
|
|
| +#ifndef NDEBUG
|
| +
|
| template <typename Strategy>
|
| void PositionTemplate<Strategy>::showTreeForThis() const
|
| {
|
| @@ -629,10 +627,7 @@ static std::ostream& printPosition(std::ostream& ostream, const PositionType& po
|
| {
|
| if (position.isNull())
|
| return ostream << "null";
|
| - ostream << position.anchorNode() << "@";
|
| - if (position.isOffsetInAnchor())
|
| - return ostream << position.offsetInContainerNode();
|
| - return ostream << position.anchorType();
|
| + return ostream << position.anchorNode() << "@" << position.toAnchorTypeAndOffsetString().utf8().data();
|
| }
|
|
|
| std::ostream& operator<<(std::ostream& ostream, PositionAnchorType anchorType)
|
|
|