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

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

Issue 2848993002: Make FrameSelection::SelectAll bail if 'selectstart' detaches frame (Closed)
Patch Set: Created 3 years, 8 months 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/LayoutTests/editing/selection/selectstart_detaches_frame.html ('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/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;
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/selection/selectstart_detaches_frame.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698