Closed Bug 1495364 Opened Last year Closed Last year

FeaturePolicy: geolocation

Categories

(Core :: DOM: Core & HTML, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: baku, Assigned: baku)

References

Details

(Keywords: dev-doc-complete, Whiteboard: [domsecurity-backlog1] [domsecurity-active])

Attachments

(1 file, 1 obsolete file)

Supporting for 'geolocation' feature policy.
Attached patch A_feature_geolocation.patch (obsolete) — Splinter Review
Attachment #9013219 - Flags: review?(bugs)
Comment on attachment 9013219 [details] [diff] [review]
A_feature_geolocation.patch

https://bugzilla.mozilla.org/show_bug.cgi?id=1495362#c3 applies here too.
Attachment #9013219 - Flags: review?(bugs)
Priority: -- → P2
Attachment #9013219 - Flags: review?(bugs)
Comment on attachment 9013219 [details] [diff] [review]
A_feature_geolocation.patch

https://bugzilla.mozilla.org/show_bug.cgi?id=1495362#c6 applies here too.

 nsCOMPtr<nsIDocument> doc = win->GetDoc();
should use GetExtantDoc()
Attachment #9013219 - Flags: review?(bugs) → review-
Attachment #9013219 - Attachment is obsolete: true
Attachment #9014731 - Flags: review?(bugs)
Comment on attachment 9014731 [details] [diff] [review]
A_feature_geolocation.patch

>+function test_currentPosition() {
>+  navigator.geolocation.getCurrentPosition(() => {
>+    tests.push(1);
>+    test_watchPosition();
>+  }, () => {
>+    tests.push(0);
>+    test_watchPosition();
>+  })
>+}
>+
>+function test_watchPosition() {
>+  navigator.geolocation.watchPosition(() => {
>+    tests.push(1);
>+    send_results();
>+  }, () => {
>+    tests.push(0);
>+    send_results();
>+  });
>+}
What are these magical 0 and 1 values in the tests array? Couldn't you just push "denied" or "allowed"


>+
>+var tests = [
>+  [ "geolocation 'none'", "denied"],
>+  [ "geolocation", "allowed"],
>+  [ "geolocation 'src'", "allowed"],
>+  [ "geolocation 'self'", "allowed"],
>+  [ "geolocation *", "allowed"],
>+  [ "geolocation http://random.net", "denied"],
>+];
Please add a test without any featurepolicy (in which case allow attribute isn't set) and ensure its behavior doesn't change with or without the patch.


>+
>+function nextTest() {
>+  if (tests.length == 0) {
>+    SimpleTest.finish();
>+    return;
>+  }
>+
>+  let test = tests.shift();
>+
>+  var iframe = document.createElement("iframe");
>+  iframe.setAttribute("allow", test[0]);
>+
>+  window.continueTest = event => {
>+    delete window.continueTest;
event isn't an event, just a message. So, don't call the argument event. Perhaps msg
Attachment #9014731 - Flags: review?(bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/fd12d054f76c
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.