-
Notifications
You must be signed in to change notification settings - Fork 15
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
Allow use in same-origin children, add Feature Policy integration #13
Changes from 3 commits
a369bc9
041b059
e9f5442
d2458d8
fb43978
e486c5a
a9e3c94
3e08915
7ad0dd5
e500e98
6d2ce77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,8 +135,9 @@ <h2> | |
Terminology | ||
</h2> | ||
<p> | ||
The following concepts, terms, and interfaces are defined in | ||
[[!HTML5]], [[!ECMASCRIPT]], [[!WEBIDL]], and [[!SECURE-CONTEXTS]]: | ||
The following concepts, terms, and interfaces are defined in [[!HTML]], | ||
[[!HTML5]], [[!ECMASCRIPT]], [[!WEBIDL]], [[!SECURE-CONTEXTS]], and | ||
[[!FEATURE-POLICY]]: | ||
</p> | ||
<ul> | ||
<li> | ||
|
@@ -180,8 +181,8 @@ <h2> | |
</li> | ||
<li> | ||
<dfn><a href= | ||
"https://www.w3.org/TR/html5/webappapis.html#incumbent-settings-object"> | ||
incumbent settings object</a></dfn> | ||
"https://html.spec.whatwg.org/multipage/webappapis.html#current-settings-object"> | ||
current settings object</a></dfn> | ||
</li> | ||
<li> | ||
<a href= | ||
|
@@ -204,6 +205,36 @@ <h2> | |
"https://www.w3.org/TR/secure-contexts/#secure-context"><dfn>secure | ||
context</dfn></a> | ||
</li> | ||
<li> | ||
<a href= | ||
"https://html.spec.whatwg.org/multipage/browsers.html#active-document"> | ||
<dfn>active document</dfn></a> | ||
</li> | ||
<li> | ||
<a href= | ||
"https://html.spec.whatwg.org/multipage/origin.html#concept-origin"><dfn> | ||
origin</dfn></a> | ||
</li> | ||
<li> | ||
<a href= | ||
"https://html.spec.whatwg.org/multipage/origin.html#same-origin-domain"> | ||
<dfn>same-origin domain</dfn></a> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same origin-domain |
||
</li> | ||
<li> | ||
<a href= | ||
"https://wicg.github.io/feature-policy/#policy-controlled-feature"><dfn> | ||
policy-controlled feature</dfn></a> | ||
</li> | ||
<li> | ||
<a href= | ||
"https://wicg.github.io/feature-policy/#feature-name"><dfn>feature | ||
name</dfn></a> | ||
</li> | ||
<li> | ||
<a href= | ||
"https://wicg.github.io/feature-policy/#default-allowlist"><dfn>default | ||
allowlist</dfn></a> | ||
</li> | ||
</ul> | ||
</section> | ||
<section class="informative"> | ||
|
@@ -255,17 +286,18 @@ <h2> | |
the following steps: | ||
</p> | ||
<ol> | ||
<li>If the <a>incumbent settings object</a> is not a <a>secure | ||
<li>If the <a>current settings object</a> is not a <a>secure | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Things in the web platform generally use "relevant settings object of this |
||
context</a>, then reject this <a>Navigator</a> object's <a>battery | ||
promise</a> with a "<a>SecurityError</a>" <a>DOMException</a>, return | ||
this <a>Navigator</a> object's <a>battery promise</a> and abort these | ||
steps. | ||
</li> | ||
<li>If the <a>browsing context</a> is not a <a>top-level browsing | ||
context</a>, then reject this <a>Navigator</a> object's <a>battery | ||
promise</a> with a "<a>SecurityError</a>" <a>DOMException</a>, return | ||
this <a>Navigator</a> object's <a>battery promise</a> and abort these | ||
steps. | ||
<li>If the <a>top-level browsing context</a>'s <a>active document</a>'s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #19 doesn't seem to be fixed here.
|
||
<a>origin</a> and the <a>origin</a> specified by the <a>current | ||
settings object</a> is not <a>same-origin domain</a>, then reject this | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same origin-domain |
||
<a>Navigator</a> object's <a>battery promise</a> with a | ||
"<a>SecurityError</a>" <a>DOMException</a>, return this <a>Navigator</a> | ||
object's <a>battery promise</a> and abort these steps. | ||
</li> | ||
<li>If this <a>Navigator</a> object's <a>battery promise</a> is not | ||
<code>null</code>, return this <a>Navigator</a> object's <a>battery | ||
|
@@ -483,6 +515,20 @@ <h2> | |
</table> | ||
</section> | ||
</section> | ||
<section> | ||
<h2> | ||
Feature Policy integration | ||
</h2> | ||
<p data-link-for="Navigator"> | ||
The Battery Status API is a <a>policy-controlled feature</a>, as | ||
defined by Feature Policy [[!FEATURE-POLICY]]. The <a>feature name</a> | ||
for the Battery Status API is "<code>battery</code>". The <a>default | ||
allowlist</a> for the Battery Status API is <code>["self"]</code>. When | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The allowlist is defined as an ordered set, which is a list. So instead of |
||
disabled in a document, the <code><a>getBattery</a>()</code> method | ||
MUST return a <a>promise</a> which rejects with a | ||
"<a>SecurityError</a>" <a>DOMException</a>. | ||
</p> | ||
</section> | ||
<section class="informative"> | ||
<h2> | ||
Examples | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's HTML5 still used for? Everything used should come out of WHATWG's version of the spec.