diff --git a/geolocation-element.bs b/geolocation-element.bs index ff1c2ff..e686206 100644 --- a/geolocation-element.bs +++ b/geolocation-element.bs @@ -137,7 +137,7 @@ capabilities.
[=Content attributes=]:
[=Global attributes=].
[=ActivationBlockersMixin attributes=].
-
[=PermissionsMixin attributes=].
+
[=PowerfulFeatureObserver attributes=].
<{geolocation/autolocate}> — Whether to locate right away (if permission has already been granted).
<{geolocation/watch}> — Wether to read the position once, or watch it continously.
[=Accessibility considerations=]:
@@ -163,8 +163,8 @@ The {{ActivationBlockersMixin/isValid}} and {{ActivationBlockersMixin/invalidReason}}, as well as the global lang and <{htmlsvg-global/tabindex}> content attributes, and the -{{PermissionsMixin/onpromptaction}}, -{{PermissionsMixin/onpromptdismiss}}, and +{{PowerfulFeatureObserver/onpromptaction}}, +{{PowerfulFeatureObserver/onpromptdismiss}}, and {{ActivationBlockersMixin/onvalidationstatuschange}} event handlers follow the description in [[#all-the-mixins]]. @@ -188,7 +188,7 @@ interface HTMLGeolocationElement : HTMLElement { attribute EventHandler onlocation; }; HTMLGeolocationElement includes ActivationBlockersMixin; -HTMLGeolocationElement includes PermissionsMixin; +HTMLGeolocationElement includes PowerfulFeatureObserver; If the user has decided to allow access to geolocation information, the @@ -237,7 +237,7 @@ element is 0. ## <{geolocation}> element internal state ## {#geolocation-element-internal-state} -The <{geolocation}> element uses all the internal slots from {{ActivationBlockersMixin}} and {{PermissionsMixin}}. Additionally, +The <{geolocation}> element uses all the internal slots from {{ActivationBlockersMixin}} and {{PowerfulFeatureObserver}}. Additionally, <{geolocation}> has the following internal slots: * A constant \[[watchIDs]], @@ -251,7 +251,7 @@ The <{geolocation}> element uses all the internal slots from {{ActivationBlocker ### Mixin-supporting state at the [=/navigable=] ### {#mixin-navigable-state} In order to support the {{HTMLGeolocationElement}}, the [=/navigable=] maintains -an [=ordered set=] of elements, \[[PermissionElements]]. This [=ordered set=] is used to evaluate the [=blockers=] of type {{ActivationBlockersMixinBlockerReason/unsuccessful_registration}}. +an [=ordered set=] of elements, \[[ActivationBlockableElements]]. This [=ordered set=] is used to evaluate the [=blockers=] of type {{ActivationBlockersMixinBlockerReason/unsuccessful_registration}}. @@ -271,7 +271,7 @@ The {{HTMLGeolocationElement}} const greater than zero. 1. Initialize the internal {{[[position]]}} to null. 1. Initialize the internal {{[[positionError]]}} to null. -1. Run {{PermissionsMixin}}'s [=PermissionsMixin/initialization steps=]. +1. Run {{PowerfulFeatureObserver}}'s [=PowerfulFeatureObserver/initialization steps=]. @@ -279,14 +279,14 @@ The {{HTMLGeolocationElement}} const The {{HTMLGeolocationElement}}'s insertion steps are: 1. Initialize the internal {{[[BlockerList]]}} to «». -1. [=set/Append=] [=this=] to [=node navigable=]'s {{[[PermissionElements]]}}. +1. [=set/Append=] [=this=] to [=node navigable=]'s {{[[ActivationBlockableElements]]}}. 1. Initialize the internal {{[[IntersectionRect]]}} with undefined. 1. Initialize the internal {{[[IntersectionObserver]]}} with the result of constructing a new {{IntersectionObserver}} with [=ActivationBlockersMixin/IntersectionObserver callback=] and «[ "{{IntersectionObserverInit/rootMargin}}" → `"-4px"` ]». 1. Call {{[[IntersectionObserver]]}}.observe([=this=]). -1. Run {{PermissionsMixin}}'s [=PermissionsMixin/insertion steps=]. +1. Run {{PowerfulFeatureObserver}}'s [=PowerfulFeatureObserver/insertion steps=]. 1. If [=this=] is not [=type permissible=], then [=add a temporary blocker=] with {{ActivationBlockersMixinBlockerReason/unsuccessful_registration}}. 1. [=Add an expiring blocker=] with reason @@ -303,7 +303,7 @@ The {{HTMLGeolocationElement}}'s insert
The {{HTMLGeolocationElement}} [=removing steps=] are: -1. [=list/Remove=] [=this=] from [=node navigable=]'s {{[[PermissionElements]]}}. +1. [=list/Remove=] [=this=] from [=node navigable=]'s {{[[ActivationBlockableElements]]}}. 1. [=Recheck type permissibility=] for [=this=]'s [=node navigable=]. 1. [=Maybe dispatch onvalidstatechange=] on [=this=]. @@ -351,7 +351,7 @@ The {{HTMLGeolocationElement/error}} getter steps are to return the value of
To maybe autolocate: -1. If [=PermissionsMixin/get the current permission state=] is not +1. If [=PowerfulFeatureObserver/get the current permission state=] is not {{PermissionState/granted}}, then return. 1. If {{HTMLGeolocationElement/autolocate}} is not true, then return. 1. [=Fetch location=]. @@ -386,14 +386,13 @@ To fetch location:
To determine whether an |element| is type permissible: -1. [=Assert=]: |element|'s [=node navigable=]'s {{[[PermissionElements]]}} +1. [=Assert=]: |element|'s [=node navigable=]'s {{[[ActivationBlockableElements]]}} [=set/contains=] |element|. 1. Let |count| be 0. 1. [=list/iterate|For each=] |current| in - |element|'s [=node navigable=]'s {{[[PermissionElements]]}}: + |element|'s [=node navigable=]'s {{[[ActivationBlockableElements]]}}: 1. If |current| is |element|, then [=iteration/break=]. 1. If |element|.{{[[Features]]}} [=set/equals=] |current|.{{[[Features]]}} - then increment |count| by 1. 1. Return whether |count| is less than 3. @@ -404,7 +403,7 @@ To recheck type permissibility for a |document|: 1. [=list/iterate|For each=] |current| in |document|'s - {{[[PermissionElements]]}}: + {{[[ActivationBlockableElements]]}}: 1. If |current| is [=type permissible=], then [=remove blockers=] with {{ActivationBlockersMixinBlockerReason/unsuccessful_registration}} from |current|. @@ -430,15 +429,15 @@ determined by the browser, rather than the page, and reflects its function of gi access to {{Geolocation}} functionality. The element may also convey information about the current permission state of the "geolocation" [=powerful feature=]. -The page can influence the permission elements' styling, but with +The page can influence the element's styling, but with constraints to prevent abuse (e.g. minimum and maximum sizes for fonts and the label itself). These are described in [[#rendering]]. The page can also select a locale for the text via the <{html-global/lang}> attribute. -The permission elements support [=fallback content=], which will be +<{geolocation}> supports [=fallback content=], which will be displayed by any browser not yet supporting that element. Note that there are also conditions under which a browser that supports -a respective permission element falls back to its [=fallback content=]. +<{geolocation}> will fall back to its [=fallback content=], as described in [[#fallback]]. # Mixins and Infrastructure # {#all-the-mixins} @@ -789,13 +788,13 @@ ISSUE: Do I need to define dictionary equality? ## Powerful Features, aka Permissions ## {#mixin-permissions} To support elements that gate access to [=powerful features=], you can use the -{{PermissionsMixin}}. +{{PowerfulFeatureObserver}}.
[=DOM interface=]:
-    interface mixin PermissionsMixin {
+    interface mixin PowerfulFeatureObserver {
       readonly attribute PermissionState initialPermissionStatus;
       readonly attribute PermissionState permissionStatus;
       attribute EventHandler onpromptaction;
@@ -805,22 +804,22 @@ To support elements that gate access to [=powerful features=], you can use the
   
-The following are the [=event handlers=] (and their corresponding [=event handler event types=]) that must be supported on elements that include the {{PermissionsMixin}}: +The following are the [=event handlers=] (and their corresponding [=event handler event types=]) that must be supported on elements that include the {{PowerfulFeatureObserver}}:
 onpromptaction: Event
 onpromptdismiss: Event
 
-The PermissionsMixin attributes are: +The PowerfulFeatureObserver attributes are: -* {{PermissionsMixin/initialPermissionStatus}} -* {{PermissionsMixin/permissionStatus}} -* {{PermissionsMixin/onpromptaction}} -* {{PermissionsMixin/onpromptdismiss}} +* {{PowerfulFeatureObserver/initialPermissionStatus}} +* {{PowerfulFeatureObserver/permissionStatus}} +* {{PowerfulFeatureObserver/onpromptaction}} +* {{PowerfulFeatureObserver/onpromptdismiss}} ### Internal state ### {#mixin-permissions-internal-state} -The {{PermissionsMixin}} [=represents=] capabilities gated by user-requestable +The {{PowerfulFeatureObserver}} [=represents=] capabilities gated by user-requestable [=permissions=], which the user can activate to allow the site to start accessing them. It is core to the these elements that such requests are triggered by the user, and not by the page's script. To enforce @@ -828,63 +827,63 @@ this, the element checks whether the activation event is {{Event/isTrusted|trust (partially) occluded, or if it has recently been moved. The element maintains an internal {{[[BlockerList]]}} to keep track of this. -{{PermissionsMixin}} elements have the following internal slots: +{{PowerfulFeatureObserver}} elements have the following internal slots: -* \[[Features]] is null +* \[[Features]] is null or an [=ordered set=] of [=powerful features=]. For most permission elements this is likely a fixed set, while for some this may be variable. Making it an internal slot allows us to write algorithms that work for all of them. -* \[[InitialPermissionStatus]] +* \[[InitialPermissionStatus]] is a {{PermissionState}} that stores the initial {{PermissionState}} for {{[[Features]]}}. ### Algorithms ### {#mixin-permissions-algorithms}
-A {{PermissionsMixin}}'s initialization steps are: +A {{PowerfulFeatureObserver}}'s initialization steps are: -1. [=Assert=]: The internal {{PermissionsMixin/[[Features]]}} slot has been +1. [=Assert=]: The internal {{PowerfulFeatureObserver/[[Features]]}} slot has been initialized. The including element must define and initialize this. -1. Initialize the internal {{PermissionsMixin/[[InitialPermissionStatus]]}} to - the result of [=PermissionsMixin/get the current permission state=]. +1. Initialize the internal {{PowerfulFeatureObserver/[[InitialPermissionStatus]]}} to + the result of [=PowerfulFeatureObserver/get the current permission state=].
-A {{PermissionsMixin}}'s insertion steps are: +A {{PowerfulFeatureObserver}}'s insertion steps are: -1. If {{PermissionsMixin/[[Features]]}} [=list/is empty=] or is null, +1. If {{PowerfulFeatureObserver/[[Features]]}} [=list/is empty=] or is null, then [=add a permanent blocker=] with reason {{ActivationBlockersMixinBlockerReason/type_invalid}}.
-A {{PermissionsMixin}} |element|'s -initialPermissionStatus +A {{PowerfulFeatureObserver}} |element|'s +initialPermissionStatus getter steps are: -1. Return |element|'s internal {{PermissionsMixin/[[InitialPermissionStatus]]}}. +1. Return |element|'s internal {{PowerfulFeatureObserver/[[InitialPermissionStatus]]}}.
-A {{PermissionsMixin}} |element|'s -permissionStatus +A {{PowerfulFeatureObserver}} |element|'s +permissionStatus getter steps are: -1. Return [=PermissionsMixin/get the current permission state=] for +1. Return [=PowerfulFeatureObserver/get the current permission state=] for |element|.
-To get the current permission state for -a {{PermissionsMixin}} |element|: +To get the current permission state for +a {{PowerfulFeatureObserver}} |element|: -1. Let |features| be |element|'s internal {{PermissionsMixin/[[Features]]}}. +1. Let |features| be |element|'s internal {{PowerfulFeatureObserver/[[Features]]}}. 1. If |features| is null or |features| is [=list/empty=], return "{{PermissionState/prompt}}". 1. Let |current| be "{{PermissionState/granted}}". @@ -905,12 +904,12 @@ ISSUE: It's not clear what the PermissionState for 'no valid permission type'
-To dispatch onpromptaction for |element|: +To dispatch onpromptaction for |element|: 1. Let |event| be a new {{Event}}. 1. [=Event/Initialize=] |event| with type - "{{PermissionsMixin/onpromptaction}}", + "{{PowerfulFeatureObserver/onpromptaction}}", bubbles true, and cancelable @@ -920,12 +919,12 @@ To dispatch onpromptaction for |element|:
-To dispatch onpromptdismiss for |element|: +To dispatch onpromptdismiss for |element|: 1. Let |event| be a new {{Event}}. 1. [=Event/Initialize=] |event| with type - "{{PermissionsMixin/onpromptdismiss}}", + "{{PowerfulFeatureObserver/onpromptdismiss}}", bubbles true, and cancelable @@ -935,7 +934,7 @@ To dispatch onpromptdismiss for |element|:
-To build a permission descriptor for an +To build a permission descriptor for an |element|: ISSUE: The [[Permissions]] specification assumes a descriptor describes a @@ -957,7 +956,7 @@ in [[Permissions]], plus adaptions here. ISSUE: There isn't much precedence for describing the user agent UI in detail. It may be better to leave more freedom to user agents. -An element using the {{PermissionsMixin}} contains browser-chosen content, text and maybe an +An element using the {{PowerfulFeatureObserver}} contains browser-chosen content, text and maybe an icon. Activating them will often [=prompt the user to choose=]. This provides two bits of user interface that a user can interact with. The [=user agent=] is largely free to determine these — rendering of the @@ -1010,7 +1009,7 @@ instead of its usual rendering. ## Styling, and Styling Restrictions ## {#rendering} -Permission elements constrain the styling that can be applied to them. +<{geolocation}> elements constrain the styling that can be applied to them. These constraints come in three flavours: 1. If the condition isn't met, the element is deactivated. @@ -1047,7 +1046,7 @@ ISSUE: Define "alpha". ### User-Agent Defined Stylesheet ### {#style-stylesheet} -A permission element is expected to render with the following styles: +A <{geolocation}> element is expected to render with the following styles:
 @namespace "http://www.w3.org/1999/xhtml";
@@ -1065,7 +1064,7 @@ geolocation {
 
### Additional User-Agent Defined Style Bounds ### {#style-style-bounds} -Permission elements define several bounds on styles. For example, we want +<{geolocation}> elements define several bounds on styles. For example, we want the font size are constraints on the The style bounds are explained below. For notational convenience, we imagine that the [=computed value=] of an element