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

Side by Side Diff: ios/web/web_state/js/resources/common.js

Issue 1785643004: [ios] Removed __gCrWeb.common.isFocusable JS API as unused. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file provides common methods that can be shared by other JavaScripts. 5 // This file provides common methods that can be shared by other JavaScripts.
6 6
7 goog.provide('__crWeb.common'); 7 goog.provide('__crWeb.common');
8 8
9 goog.require('__crWeb.base'); 9 goog.require('__crWeb.base');
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 * @return {boolean} true if the |element| is a form control element. 72 * @return {boolean} true if the |element| is a form control element.
73 */ 73 */
74 __gCrWeb.common.isFormControlElement = function(element) { 74 __gCrWeb.common.isFormControlElement = function(element) {
75 var tagName = element.tagName; 75 var tagName = element.tagName;
76 return (tagName === 'INPUT' || 76 return (tagName === 'INPUT' ||
77 tagName === 'SELECT' || 77 tagName === 'SELECT' ||
78 tagName === 'TEXTAREA'); 78 tagName === 'TEXTAREA');
79 }; 79 };
80 80
81 /** 81 /**
82 * Detects focusable elements.
83 * @param {Element} element A DOM element.
84 * @return {boolean} true if the |element| is focusable.
85 */
86 __gCrWeb.common.isFocusable = function(element) {
87 // When the disabled or hidden attributes are present, controls do not
88 // receive focus.
89 if (element.hasAttribute('disabled') || element.hasAttribute('hidden'))
90 return false;
91 return __gCrWeb.common.isFormControlElement(element);
92 };
93
94 /**
95 * Returns an array of control elements in a form. 82 * Returns an array of control elements in a form.
96 * 83 *
97 * This method is based on the logic in method 84 * This method is based on the logic in method
98 * void WebFormElement::getFormControlElements( 85 * void WebFormElement::getFormControlElements(
99 * WebVector<WebFormControlElement>&) const 86 * WebVector<WebFormControlElement>&) const
100 * in chromium/src/third_party/WebKit/Source/WebKit/chromium/src/ 87 * in chromium/src/third_party/WebKit/Source/WebKit/chromium/src/
101 * WebFormElement.cpp. 88 * WebFormElement.cpp.
102 * 89 *
103 * @param {Element} form A form element for which the control elements are 90 * @param {Element} form A form element for which the control elements are
104 * returned. 91 * returned.
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 var plugins = findPluginNodesWithoutFallback_(); 674 var plugins = findPluginNodesWithoutFallback_();
688 if (plugins.length > 0) { 675 if (plugins.length > 0) {
689 // Store the list of plugins in a known place for the replacement script 676 // Store the list of plugins in a known place for the replacement script
690 // to use, then trigger it. 677 // to use, then trigger it.
691 __gCrWeb['placeholderTargetPlugins'] = plugins; 678 __gCrWeb['placeholderTargetPlugins'] = plugins;
692 return true; 679 return true;
693 } 680 }
694 return false; 681 return false;
695 }; 682 };
696 }()); // End of anonymous object 683 }()); // End of anonymous object
OLDNEW
« 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