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 679549835d6f52797f6431e7053480efeaca286a..ae0fe16d111f7515328a25b561f49345225cd5fa 100644 |
| --- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp |
| +++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp |
| @@ -607,9 +607,7 @@ bool DOMSelection::containsNode(const Node* n, bool allowPartial) const { |
| if (!isAvailable()) |
| return false; |
| - FrameSelection& selection = frame()->selection(); |
| - |
| - if (frame()->document() != n->document() || selection.isNone()) |
|
yosin_UTC9
2017/02/16 09:50:26
FrameSeleciton::isNone() requires clean layout tre
|
| + if (frame()->document() != n->document()) |
| return false; |
| unsigned nodeIndex = n->nodeIndex(); |
| @@ -619,8 +617,11 @@ bool DOMSelection::containsNode(const Node* n, bool allowPartial) const { |
| // |VisibleSelection::toNormalizedEphemeralRange| requires clean layout. |
| frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets(); |
| + FrameSelection& selection = frame()->selection(); |
| const EphemeralRange selectedRange = |
| selection.selection().toNormalizedEphemeralRange(); |
| + if (selectedRange.isNull()) |
| + return false; |
| ContainerNode* parentNode = n->parentNode(); |
| if (!parentNode) |