Index: third_party/WebKit/Source/core/editing/FrameSelection.cpp |
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.cpp b/third_party/WebKit/Source/core/editing/FrameSelection.cpp |
index 87ec20377a9264488e300255fbd46ffb3ea3af8e..c29027dd0a1dd11bf29fa63735e9e3ee60b32b52 100644 |
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp |
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp |
@@ -658,6 +658,11 @@ void FrameSelection::SelectAll() { |
if (select_start_target->DispatchEvent(Event::CreateCancelableBubble( |
EventTypeNames::selectstart)) != DispatchEventResult::kNotCanceled) |
return; |
+ // The frame may be detached due to selectstart event. |
+ if (!IsAvailable()) { |
+ // Reached by editing/selection/selectstart_detach_frame.html |
+ return; |
+ } |
// |root| may be detached due to selectstart event. |
if (!root->isConnected() || expected_document != root->GetDocument()) |
return; |