Chromium Code Reviews| 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 91d8dbedd404b282866de9c7e0d5c0719ca87a62..54ef6a5887d621f10f10d9146e2f564a48ac576b 100644 |
| --- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp |
| +++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp |
| @@ -272,8 +272,16 @@ void DOMSelection::setBaseAndExtent(Node* baseNode, |
| return; |
| } |
| - if (!baseNode || !extentNode) |
| + if (!baseNode || !extentNode) { |
| UseCounter::count(frame(), UseCounter::SelectionSetBaseAndExtentNull); |
| + // TODO(editing-dev): Behavior on where base or extent is null is still |
| + // under discussion: https://github.com/w3c/selection-api/issues/72 |
| + if (!baseNode) { |
|
yosin_UTC9
2016/12/02 04:38:02
It seems that dealing nullptr explicitly is more r
|
| + frame()->selection().clear(); |
| + return; |
| + } |
| + extentOffset = 0; |
| + } |
| if (!isValidForPosition(baseNode) || !isValidForPosition(extentNode)) |
| return; |