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

Unified Diff: third_party/WebKit/Source/core/editing/SelectionTemplate.cpp

Issue 2533693002: [Editing] Add SelectionTemplate::showTreeForThis() (Closed)
Patch Set: update Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionTemplate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d3652e72edd936085f1a834a86da4de45947c616 100644
--- a/third_party/WebKit/Source/core/editing/SelectionTemplate.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionTemplate.cpp
@@ -103,6 +103,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 {
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionTemplate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698