Skip to content

Commit 85c3134

Browse files
committed
Editorial changes.
1 parent d00897a commit 85c3134

File tree

1 file changed

+65
-48
lines changed

1 file changed

+65
-48
lines changed

permission-elements.bs

Lines changed: 65 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,16 @@ where it's oftentimes unclear to users what the consequences of these requests
108108
might be.
109109

110110
This spec introduces a new mechanism that requests and initiates access to
111-
[=powerful features=] through an in-page element, with built-in protections
111+
[=powerful features=] through in-page elements, with built-in protections
112112
against abuse. This wants to tie permission requests to the actual context
113113
in which they will be used, thus reducing "permission spam" and at the same
114114
time providing implementations with a better signal of user intent.
115115

116116

117-
# {{InPagePermissionMixin}}: Common Behaviours Of The HTML Permission Elements # {#permission-mixin}
117+
# Common Behaviours Of The HTML Permission Elements: {{InPagePermissionMixin}} # {#permission-mixin}
118118

119119
The elements in this specification exhibit a number of common behaviours, which
120-
are captured by the {{InPagePermissionMixin}} and the associated state,
120+
are captured by the {{InPagePermissionMixin}} and its associated state,
121121
algorithms, and rendering rules.
122122

123123
<dl class="element">
@@ -161,13 +161,13 @@ for the global <{htmlsvg-global/tabindex}> content attribute on the
161161
element is 0.
162162

163163
The following are the [=event handlers=] (and their corresponding [=event handler event types=]) that must be supported on elements that include the {{InPagePermissionMixin}}:
164-
164+
<dfn lt="permission elements attributes">
165165
<pre class=simpledef>
166166
onpromptaction: Event
167167
onpromptdismiss: Event
168168
onvalidationstatuschange: Event
169169
</pre>
170-
170+
</dfn>
171171

172172
## {{InPagePermissionMixin|Mixin}} internal state ## {#mixin-internal-state}
173173

@@ -798,7 +798,7 @@ Note: The <{permission}> element is the original proposed in-page permission
798798
expect that this element will be removed in favour of the more specific
799799
elements detailled in the following chapters.
800800

801-
The HTML <{permission}> element can request arbitrary [=powerful features=].
801+
The <{permission}> element can request arbitrary [=powerful features=].
802802

803803
<dl class="element">
804804
<dt>[=Categories=]:</dt>
@@ -809,24 +809,16 @@ The HTML <{permission}> element can request arbitrary [=powerful features=].
809809
<dt>[=Contexts in which this element can be used=]:</dt>
810810
<dd>Where [=phrasing content=] is expected.</dd>
811811
<dt>[=Content model=]:</dt>
812-
<dd>[=flow content=].</dd>
812+
<dd>[=Flow content=].</dd>
813813
<dt>[=Content attributes=]:</dt>
814814
<dd>[=Global attributes=]</dd>
815-
<dd>{{HTMLPermissionElement/type}} — Type of permission this element applies to.</dd>
815+
<dd>[=Permission elements attributes=]</dd>
816+
<dd><{permission/type}> — Type of permission this element applies to.</dd>
817+
<dd><{permission/lang}> — Like the global <a element-attr for=html-global>lang</a> attribute.
816818
<dt>[=Accessibility considerations=]:</dt>
817819
<dd></dd>
818820
<dt>[=DOM interface=]:</dt>
819-
<dd>
820-
<pre class=idl>
821-
[Exposed=Window]
822-
interface HTMLPermissionElement : HTMLElement {
823-
[HTMLConstructor] constructor();
824-
[CEReactions, Reflect] attribute DOMString type;
825-
static boolean isTypeSupported(DOMString type);
826-
};
827-
HTMLPermissionElement includes InPagePermissionMixin;
828-
</pre>
829-
</dd>
821+
<dd>{{HTMLPermissionElement}}</dd>
830822
</dl>
831823

832824
ISSUE: Add accessibility considerations.
@@ -836,27 +828,42 @@ ISSUE: Check attribute & event handler & invalid reason names against
836828

837829
The <{permission}> element's content, if any, are its [=fallback content=].
838830

839-
The <dfn attribute for=HTMLPermissionElement>type</dfn> attribute controls the behavior of the
840-
permission element when it is activated. Is is an [=enumerated attribute=],
831+
The <dfn element-attr for=permission>type</dfn> attribute controls the behavior
832+
of the
833+
<{permission}> element when it is activated. Is is an [=enumerated attribute=],
841834
whose values are the [=powerful feature/names=] of [=powerful features=]. It
842835
has neither a
843836
[=missing value default=] state nor a [=invalid value default=] state.
844837

845-
The {{HTMLPermissionElement/isTypeSupported()}} [=static operation=] whether a
846-
gives {{HTMLPermissionElement/type}}, that is, a given
847-
[=enumerated attribute|enumeration=] of [=powerful features=], is supported.
848-
It predicts whether creating a <{permission}> element and assigning the given
849-
{{HTMLPermissionElement/type}} string will work, or whether it will create
850-
an element blocked by a {{InPagePermissionMixinBlockerReason/type_invalid}}
851-
[=permanent blocker=].
852-
853-
The global <a attribute spec=html for=HTMLElement>lang</a> attribute is
838+
The <dfn element-attr for=permission>lang</dfn> attribute is the same as the
839+
global <a element-attr for=html-global>lang</a> attribute. It is
854840
observed by the <{permission}> element to select localized text.
855841

856842
The <a href="https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#default-value">default value</a>
857843
for the global <{htmlsvg-global/tabindex}> content attribute on the
858844
<{permission}> element is 0.
859845

846+
<pre class=idl>
847+
[Exposed=Window]
848+
interface HTMLPermissionElement : HTMLElement {
849+
[HTMLConstructor] constructor();
850+
[CEReactions, Reflect] attribute DOMString type;
851+
static boolean isTypeSupported(DOMString type);
852+
};
853+
HTMLPermissionElement includes InPagePermissionMixin;
854+
</pre>
855+
856+
The {{HTMLPermissionElement/type}} attribute [=reflects=] the <{permission/type}> element attribute.
857+
858+
The {{HTMLPermissionElement/isTypeSupported(type)}}
859+
[=static operation=] determines whether a given {{DOMString}}
860+
{{HTMLPermissionElement/isTypeSupported(type)/type}},
861+
that is, a given
862+
[=enumerated attribute|enumeration=] of [=powerful features=], is supported.
863+
It predicts whether creating a <{permission}> element and assigning the given
864+
{{HTMLPermissionElement/type}} string will work, or whether it will create
865+
an element blocked by a {{InPagePermissionMixinBlockerReason/type_invalid}}
866+
[=permanent blocker=].
860867

861868
## <{permission}> element internal state ## {#permission-element-internal-state}
862869

@@ -1135,25 +1142,13 @@ The HTML <{geolocation}> element can request access to
11351142
<dd>[=Flow content=].</dd>
11361143
<dt>[=Content attributes=]:</dt>
11371144
<dd>[=Global attributes=].</dd>
1145+
<dd>[=Permission elements attributes=].</dd>
1146+
<dd><{geolocation/autolocate}> — Whether to locate right away (if permission has already been granted).</dd>
1147+
<dd><{geolocation/watch}> — Wether to read the position once, or watch it continously.</dd>
11381148
<dt>[=Accessibility considerations=]:</dt>
11391149
<dd></dd>
11401150
<dt>[=DOM interface=]:</dt>
1141-
<dd>
1142-
<pre class=idl>
1143-
[Exposed=Window]
1144-
interface HTMLGeolocationElement : HTMLElement {
1145-
[HTMLConstructor] constructor();
1146-
1147-
readonly attribute GeolocationPosition position;
1148-
readonly attribute GeolocationPositionError error;
1149-
[CEReactions, Reflect] attribute boolean autolocate;
1150-
[CEReactions, Reflect] attribute boolean watch;
1151-
1152-
attribute EventHandler onlocation;
1153-
};
1154-
HTMLGeolocationElement includes InPagePermissionMixin;
1155-
</pre>
1156-
</dd>
1151+
<dd>{{HTMLGeolocationElement}}</dd>
11571152
</dl>
11581153

11591154
The {{InPagePermissionMixin/isValid}} and
@@ -1165,6 +1160,28 @@ The {{InPagePermissionMixin/isValid}} and
11651160
{{InPagePermissionMixin/onvalidationstatuschange}} event handlers follow the
11661161
description in [[#permission-mixin]].
11671162

1163+
The <dfn element-attr for=geolocation>autolocate</dfn> attribute determines
1164+
whether the <{geolocation}> element should start locating immediately (if
1165+
permission has already been granted).
1166+
1167+
The <dfn element-attr for=geolocation>watch</dfn> attribute determine whether
1168+
the <{geolocation}> element report the location once or continously.
1169+
1170+
<pre class=idl>
1171+
[Exposed=Window]
1172+
interface HTMLGeolocationElement : HTMLElement {
1173+
[HTMLConstructor] constructor();
1174+
1175+
readonly attribute GeolocationPosition position;
1176+
readonly attribute GeolocationPositionError error;
1177+
[CEReactions, Reflect] attribute boolean autolocate;
1178+
[CEReactions, Reflect] attribute boolean watch;
1179+
1180+
attribute EventHandler onlocation;
1181+
};
1182+
HTMLGeolocationElement includes InPagePermissionMixin;
1183+
</pre>
1184+
11681185
If the user has decided to allow access to geolocation information, the
11691186
readonly attributes <dfn attribute for=HTMLGeolocationElement>position</dfn> and
11701187
<dfn attribute for=HTMLGeolocationElement>error</dfn> reflect the current
@@ -1191,8 +1208,8 @@ location, are available in the {{HTMLGeolocationElement/position}} or the
11911208
{{HTMLGeolocationElement/watch}} element this happens once (if absent or false),
11921209
or continously (if true).
11931210

1194-
<{geolocation}> wants to mirror the {{Geolocation}} interface, and there is a
1195-
direct correspondance:
1211+
{{HTMLGeolocationElement}} wants to mirror the {{Geolocation}} interface.
1212+
There is a direct correspondance:
11961213

11971214
<pre class=simpledef>
11981215
position: Result of {{PositionCallback}}.

0 commit comments

Comments
 (0)