Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checks on allowed usage are specced incorrectly #19

Closed
domenic opened this issue Jul 3, 2018 · 1 comment
Closed

Checks on allowed usage are specced incorrectly #19

domenic opened this issue Jul 3, 2018 · 1 comment

Comments

@domenic
Copy link
Contributor

domenic commented Jul 3, 2018

(This seems related to #10, but it's focused more on the details, so I opened a new issue.)

If the incumbent settings object is not a secure context, then reject this Navigator object's battery promise with a "SecurityError" DOMException, return this Navigator object's battery promise and abort these steps.

"incumbent settings object" should never be used by new specifications. I hope nobody implemented it this way. Instead, prefer the relevant settings object of this Navigator object.

See https://html.spec.whatwg.org/multipage/webappapis.html#realms-settings-objects-global-objects to learn about the (testable, observable) differences between these choices.

(Thanks @TimothyGu for spotting this.)

If the browsing context is not a top-level browsing context, then reject this Navigator object's battery promise with a "SecurityError" DOMException, return this Navigator object's battery promise and abort these steps.

What is "the browsing context"?

Probably you want, hmm, this Navigator object's relevant global object's associated Document's browsing context?

(If we see this pattern more, maybe we should make it easier to write... I'll file a tracking issue.)

@anssiko
Copy link
Member

anssiko commented Jul 30, 2018

#13 is where the latest is, should address both these issues too. Sorry @domenic if you wasted some time reviewing the old text. The plan was to merge that PR sooner to get this fix in too.

Please let us know if the text in #13 looks good and we try to get it landed.

anssiko added a commit that referenced this issue Aug 24, 2018
…main-ness

- Use 'relevant settings object' over 'current settings object' where applicable
- Update 'allowlist' to match the convention
- Use WHATWG HTML references (except for firing a simple event that's gone)
- Fix typos

Fix #19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants