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

Unified Diff: Source/core/html/RadioInputType.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 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 | « Source/core/html/PasswordInputType.cpp ('k') | Source/core/html/RangeInputType.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/RadioInputType.cpp
diff --git a/Source/core/html/RadioInputType.cpp b/Source/core/html/RadioInputType.cpp
index 30397058a8bcfbbb48d7d0d02cb20502ec54f8ca..8b3dac2064909aa08cf59f2785fbde2718b4b0a3 100644
--- a/Source/core/html/RadioInputType.cpp
+++ b/Source/core/html/RadioInputType.cpp
@@ -75,8 +75,8 @@ void RadioInputType::handleKeydownEvent(KeyboardEvent* event)
// Tested in WinIE, and even for RTL, left still means previous radio button (and so moves
// to the right). Seems strange, but we'll match it.
// However, when using Spatial Navigation, we need to be able to navigate without changing the selection.
- Document* document = element()->document();
- if (isSpatialNavigationEnabled(document->frame()))
+ Document& document = element()->document();
+ if (isSpatialNavigationEnabled(document.frame()))
return;
bool forward = (key == "Down" || key == "Right");
@@ -95,7 +95,7 @@ void RadioInputType::handleKeydownEvent(KeyboardEvent* event)
break;
if (inputElement->isRadioButton() && inputElement->name() == element()->name() && inputElement->isFocusable()) {
RefPtr<HTMLInputElement> protector(inputElement);
- document->setFocusedElement(inputElement);
+ document.setFocusedElement(inputElement);
inputElement->dispatchSimulatedClick(event, SendNoEvents, DoNotShowPressedLook);
event->setDefaultHandled();
return;
@@ -121,12 +121,12 @@ bool RadioInputType::isKeyboardFocusable() const
return false;
// When using Spatial Navigation, every radio button should be focusable.
- if (isSpatialNavigationEnabled(element()->document()->frame()))
+ if (isSpatialNavigationEnabled(element()->document().frame()))
return true;
// Never allow keyboard tabbing to leave you in the same radio group. Always
// skip any other elements in the group.
- Element* currentFocusedElement = element()->document()->focusedElement();
+ Element* currentFocusedElement = element()->document().focusedElement();
if (currentFocusedElement && currentFocusedElement->hasTagName(inputTag)) {
HTMLInputElement* focusedInput = toHTMLInputElement(currentFocusedElement);
if (focusedInput->isRadioButton() && focusedInput->form() == element()->form() && focusedInput->name() == element()->name())
« no previous file with comments | « Source/core/html/PasswordInputType.cpp ('k') | Source/core/html/RangeInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698