Index: third_party/WebKit/Source/core/editing/DOMSelection.cpp |
diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp |
index bb6e173919ba4199fe6b7bb9a67fccceaed84d45..ae438372f5031fe19ac97d7639391e87a3002aa9 100644 |
--- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp |
+++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp |
@@ -459,6 +459,17 @@ void DOMSelection::extend(Node* node, |
// 3. Let oldAnchor and oldFocus be the context object's anchor and focus, and |
// let newFocus be the boundary point (node, offset). |
const Position& oldAnchor = anchorPosition(); |
+ // TODO(tkent): Diagnostic checks for crbug.com/693578. They should be |
+ // removed before M58 branch. |
+ if (oldAnchor.isNull()) { |
+ if (Range* range = documentCachedRange()) { |
+ LOG(FATAL) |
+ << "Selection has a cached Range, but anchorPosition is null. start=" |
+ << range->startContainer() << " end=" << range->endContainer(); |
+ } else if (frame() && !frame()->selection().isNone()) { |
+ LOG(FATAL) << "FrameSelection is not none, but anchorPosition is null."; |
+ } |
+ } |
DCHECK(!oldAnchor.isNull()); |
const Position newFocus(node, offset); |