Revision 2e8fa7ba82e6d796bf460567be21fbe3d4902568 authored by Ian Clelland on 11 April 2018, 02:30:42 UTC, committed by Blink WPT Bot on 11 April 2018, 02:40:01 UTC
According to the DOM spec (https://dom.spec.whatwg.org/#dom-domtokenlist-supports)
the supports() method should compare the ASCII-lowercase transform of its input to
the list of tokens supported by the DOMTokenList.

Bug: 831166
Change-Id: I40903a307ffb949bbbbc99e02b56565cb81d00ed
Reviewed-on: https://chromium-review.googlesource.com/1005412
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549733}
1 parent 1bb2bd0
Raw File
support.js
var geo;

setup(function() {
  geo = navigator.geolocation;
});

// The spec states that an implementation SHOULD acquire user permission before
// beggining the position acquisition steps. If an implementation follows this
// advice, set the following flag to aid debugging.
var isUsingPreemptivePermission = false;


var dummyFunction = function() {};

var positionToString = function(pos) {
  var c = pos.coords;
  return '[lat: ' + c.latitude + ', lon: ' + c.longitude + ', acc: ' + c.accuracy + ']';
};

var errorToString = function(err) {
  var codeString;
  switch(err.code) {
    case err.UNKNOWN_ERROR: codeString = 'UNKNOWN_ERROR'; break;
    case err.PERMISSION_DENIED: codeString = 'PERMISSION_DENIED'; break;
    case err.POSITION_UNAVAILABLE: codeString = 'POSITION_UNAVAILABLE'; break;
    case err.TIMEOUT: codeString = 'TIMEOUT'; break;
    default: codeString = 'undefined error code'; break;
  }
  return '[code: ' + codeString + ' (' + err.code + '), message: ' + (err.message ? err.message : '(empty)') + ']';
};
back to top