-
Notifications
You must be signed in to change notification settings - Fork 401
Change features to a sequence of 'any' #807
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
Conversation
index.bs
Outdated
}; | ||
</pre> | ||
|
||
The <dfn dict-member for="XRSessionInit">requiredFeatures</dfn> array contains any [=Required features=] for the experience. If any value in the list is not a recognized [=feature name=] the {{XRSession}} will not be created. If any feature listed in the {{XRSessionInit/requiredFeatures}} array is not supported by the [=XRSession/XR Device=] or, if necessary, has not received a clear signal of [=user intent=] the {{XRSession}} will not be created. | ||
|
||
The <dfn dict-member for="XRSessionInit">optionalFeatures</dfn> array contains any [=Optional features=] for the experience. If any value in the list is not a recognized [=feature name=] it will be ignored. Features listed in the {{XRSessionInit/optionalFeatures}} array will be enabled if supported by the [=XRSession/XR Device=] and, if necessary, given a clear signal of [=user intent=], but will not block creation of the {{XRSession}} if absent. | ||
|
||
The feature lists accept any string. However, in order to be a considered a valid <dfn>feature name</dfn>, the string must be a value from the following enums: | ||
The feature lists accept any value. However, in order to be a considered a valid <dfn>feature name</dfn>, the value must be a string from the following enums: |
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.
Should we have a named list of acceptable values so that other specs may extend this easily?
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.
Latest iteration makes this a bit more explicit, but I'm reluctant to duplicate the actual values into a list here because it's harder to maintain, especially if future modules extend the enums in question.
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.
BIKESHEDDING WARNING I know we're splitting hairs here, but "feature value" seems pretty confusing to me. I'm not sure I have a better suggestions, though. Perhaps "feature description"?
Agreed that "feature value" sounds weird. Changed to "feature descriptor". |
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.
Thanks!
/fixes #791
Updates the
requiredFeatures
/optionalFeatures
dictionary keys to accept sequences ofany
values for forwards compatibility purposes. (Namely, enablingoptionalFeatures
to always ignore unknown values even if non-enum feature are introduced in the future.)After the discussion in the above issue, I talked to @bfgeek about how to approach this particular concern. From that conversation it seemed that we either wanted to make this a array of
object
or an array ofany
, depending on which seemed to fit our use case better. I tested both in Chrome, and both value types worked. I choseany
for the PR here because in Javascript strings are not considered to be "objects" (ie:"string" instanceof object == false
). The WebIDL definition ofobject
appears to be a distinct concept from the Javascriptobject
type, but even reading through the WebIDL spec that's not readily apparent. As such usingany
felt like it was easier to understand on initial reading.