Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js b/third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js |
| index 57b415a206b78dd076d3250fe6fd1145f7d28888..08ee5fa626fef308661d1b4c2d182bae2f621992 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/emulation/Geolocation.js |
| @@ -85,7 +85,8 @@ WebInspector.Geolocation.parseUserInput = function(latitudeString, longitudeStri |
| */ |
| WebInspector.Geolocation.latitudeValidator = function(value) |
| { |
| - return !value || (/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(value) && value >= -90 && value <= 90); |
| + var numValue = parseFloat(value); |
| + return /^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(value) && numValue >= -90 && numValue <= 90; |
| } |
| /** |
| @@ -94,7 +95,8 @@ WebInspector.Geolocation.latitudeValidator = function(value) |
| */ |
| WebInspector.Geolocation.longitudeValidator = function(value) |
| { |
| - return !value || (/^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(value) && value >= -180 && value <= 180); |
| + var numValue = parseFloat(value); |
| + return /^([+-]?[\d]+(\.\d+)?|[+-]?\.\d+)$/.test(value) && numValue >= -180 && numValue <= 180; |
|
lushnikov
2016/05/04 17:10:45
Is this regex just a fancy way of saying "this is
luoe
2016/05/04 17:31:10
Not quite. One case, value="1-0", parseFloat("1-0
|
| } |
| WebInspector.Geolocation.DefaultMockAccuracy = 150; |