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

Side by Side Diff: Source/core/html/forms/RadioInputType.cpp

Issue 67473002: Have ElementTraversal / NodeTraversal's next() methods take a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master Created 7 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « Source/core/html/MediaDocument.cpp ('k') | Source/core/html/track/TextTrackCue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // when using Spatial Navigation, we need to be able to navigate without 77 // when using Spatial Navigation, we need to be able to navigate without
78 // changing the selection. 78 // changing the selection.
79 Document& document = element().document(); 79 Document& document = element().document();
80 if (isSpatialNavigationEnabled(document.frame())) 80 if (isSpatialNavigationEnabled(document.frame()))
81 return; 81 return;
82 bool forward = (key == "Down" || key == "Right"); 82 bool forward = (key == "Down" || key == "Right");
83 83
84 // We can only stay within the form's children if the form hasn't been demot ed to a leaf because 84 // We can only stay within the form's children if the form hasn't been demot ed to a leaf because
85 // of malformed HTML. 85 // of malformed HTML.
86 Node* node = &element(); 86 Node* node = &element();
87 while ((node = (forward ? NodeTraversal::next(node) : NodeTraversal::previou s(node)))) { 87 while ((node = (forward ? NodeTraversal::next(*node) : NodeTraversal::previo us(node)))) {
88 // Once we encounter a form element, we know we're through. 88 // Once we encounter a form element, we know we're through.
89 if (node->hasTagName(formTag)) 89 if (node->hasTagName(formTag))
90 break; 90 break;
91 // Look for more radio buttons. 91 // Look for more radio buttons.
92 if (!node->hasTagName(inputTag)) 92 if (!node->hasTagName(inputTag))
93 continue; 93 continue;
94 HTMLInputElement* inputElement = toHTMLInputElement(node); 94 HTMLInputElement* inputElement = toHTMLInputElement(node);
95 if (inputElement->form() != element().form()) 95 if (inputElement->form() != element().form())
96 break; 96 break;
97 if (inputElement->isRadioButton() && inputElement->name() == element().n ame() && inputElement->isFocusable()) { 97 if (inputElement->isRadioButton() && inputElement->name() == element().n ame() && inputElement->isFocusable()) {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 { 185 {
186 return true; 186 return true;
187 } 187 }
188 188
189 bool RadioInputType::supportsIndeterminateAppearance() const 189 bool RadioInputType::supportsIndeterminateAppearance() const
190 { 190 {
191 return false; 191 return false;
192 } 192 }
193 193
194 } // namespace WebCore 194 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/MediaDocument.cpp ('k') | Source/core/html/track/TextTrackCue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698