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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js

Issue 1923393006: DevTools: fix styles and input validation in sensor pane (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address change in orientation input labels Created 4 years, 7 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 /** 5 /**
6 * @constructor 6 * @constructor
7 * @param {number} latitude 7 * @param {number} latitude
8 * @param {number} longitude 8 * @param {number} longitude
9 * @param {boolean} error 9 * @param {boolean} error
10 */ 10 */
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 var longitude = isLongitudeValid ? parseFloat(longitudeString) : -1; 78 var longitude = isLongitudeValid ? parseFloat(longitudeString) : -1;
79 return new WebInspector.Geolocation(latitude, longitude, !!errorStatus); 79 return new WebInspector.Geolocation(latitude, longitude, !!errorStatus);
80 } 80 }
81 81
82 /** 82 /**
83 * @param {string} value 83 * @param {string} value
84 * @return {boolean} 84 * @return {boolean}
85 */ 85 */
86 WebInspector.Geolocation.latitudeValidator = function(value) 86 WebInspector.Geolocation.latitudeValidator = function(value)
87 { 87 {
88 return !value || (/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(value) && value > = -90 && value <= 90); 88 return /^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(value) && value >= -90 && va lue <= 90;
lushnikov 2016/05/02 19:25:57 value >= -90 while we're here - let's not use imp
luoe 2016/05/02 21:46:17 Done.
89 } 89 }
90 90
91 /** 91 /**
92 * @param {string} value 92 * @param {string} value
93 * @return {boolean} 93 * @return {boolean}
94 */ 94 */
95 WebInspector.Geolocation.longitudeValidator = function(value) 95 WebInspector.Geolocation.longitudeValidator = function(value)
96 { 96 {
97 return !value || (/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(value) && value > = -180 && value <= 180); 97 return /^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(value) && value >= -180 && v alue <= 180;
lushnikov 2016/05/02 19:25:57 ditto
luoe 2016/05/02 21:46:17 Done, using parseFloat.
98 } 98 }
99 99
100 WebInspector.Geolocation.DefaultMockAccuracy = 150; 100 WebInspector.Geolocation.DefaultMockAccuracy = 150;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698