Change features to a sequence of 'any'#807
Merged
Merged
Conversation
Manishearth
reviewed
Aug 14, 2019
| 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: |
Contributor
There was a problem hiding this comment.
Should we have a named list of acceptable values so that other specs may extend this easily?
Member
Author
There was a problem hiding this comment.
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.
NellWaliczek
left a comment
Member
There was a problem hiding this comment.
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"?
Member
Author
|
Agreed that "feature value" sounds weird. Changed to "feature descriptor". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/fixes #791
Updates the
requiredFeatures/optionalFeaturesdictionary keys to accept sequences ofanyvalues for forwards compatibility purposes. (Namely, enablingoptionalFeaturesto 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
objector an array ofany, depending on which seemed to fit our use case better. I tested both in Chrome, and both value types worked. I choseanyfor the PR here because in Javascript strings are not considered to be "objects" (ie:"string" instanceof object == false). The WebIDL definition ofobjectappears to be a distinct concept from the Javascriptobjecttype, but even reading through the WebIDL spec that's not readily apparent. As such usinganyfelt like it was easier to understand on initial reading.