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

Unified Diff: third_party/WebKit/Source/core/page/FocusController.cpp

Issue 2948063002: Null check FocusedFrame in spatial navigation (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | 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/page/FocusController.cpp
diff --git a/third_party/WebKit/Source/core/page/FocusController.cpp b/third_party/WebKit/Source/core/page/FocusController.cpp
index 217b52178ece193c1a0bd537541765afc5ff7e04..7e77fe49a37135adefe33a1bc9babd19b52ac773 100644
--- a/third_party/WebKit/Source/core/page/FocusController.cpp
+++ b/third_party/WebKit/Source/core/page/FocusController.cpp
@@ -1342,9 +1342,11 @@ bool FocusController::AdvanceFocusDirectionallyInContainer(
DCHECK(element);
if (!element->IsTextControl() && !HasEditableStyle(*element->ToNode())) {
- // To fulfill the expectation of spatial-navigation/snav-input.html
+ // To fulfill the expectation of spatial-navigation/snav-textarea.html
// we clear selection when spatnav moves focus away from a text-field.
- FocusedFrame()->Selection().Clear();
+ // TODO(hugoh@opera.com): crbug.com/734552 remove Selection.Clear()
+ if (FocusedFrame())
+ FocusedFrame()->Selection().Clear();
}
element->focus(FocusParams(SelectionBehaviorOnFocus::kReset, type, nullptr));
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698