Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/SelectionTemplate.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/SelectionTemplate.cpp b/third_party/WebKit/Source/core/editing/SelectionTemplate.cpp |
| index c901ce77248dea86d74f08c3ab6b270f089a9d89..9e93f9127d73079de89d80dec63085446d2e885c 100644 |
| --- a/third_party/WebKit/Source/core/editing/SelectionTemplate.cpp |
| +++ b/third_party/WebKit/Source/core/editing/SelectionTemplate.cpp |
| @@ -4,6 +4,7 @@ |
| #include "core/editing/SelectionTemplate.h" |
| +#include "core/editing/VisibleSelection.h" |
|
yosin_UTC9
2016/11/30 02:34:31
We should not include "VisibleSelection.h" in Sele
yoichio
2016/11/30 04:45:41
Done.
|
| #include "wtf/Assertions.h" |
| #include <ostream> // NOLINT |
| @@ -103,6 +104,27 @@ bool SelectionTemplate<Strategy>::assertValid() const { |
| } |
| #endif |
| +#ifndef NDEBUG |
| +template <typename Strategy> |
| +void SelectionTemplate<Strategy>::showTreeForThis() const { |
| + if (m_base.isNull()) { |
| + LOG(INFO) << "\nbase is null"; |
| + return; |
| + } |
| + |
| + LOG(INFO) << "\n" |
| + << m_base.anchorNode() |
| + ->toMarkedTreeString(m_base.anchorNode(), "B", |
| + m_extent.anchorNode(), "E") |
| + .utf8() |
| + .data() |
| + << "base: " << m_base.toAnchorTypeAndOffsetString().utf8().data() |
| + << "\n" |
| + << "extent: " |
| + << m_extent.toAnchorTypeAndOffsetString().utf8().data(); |
| +} |
| +#endif |
| + |
| template <typename Strategy> |
| void SelectionTemplate<Strategy>::printTo(std::ostream* ostream, |
| const char* type) const { |