Editorial: Define getters for "limited to only known values" attributes more formally - #12692
Editorial: Define getters for "limited to only known values" attributes more formally#12692dbaron wants to merge 1 commit into
Conversation
…mally. This connects the definitions used by the DOMString and DOMString? IDL getters for enumerated attributes that are "limited to only known values" to the formal "determine the state of an attribute" definition that defines the state of an enumerated attribute. The old wording used vague "corresponds to" wording that seemed to imply a connection to this definition but that wasn't formally connected to it. Fixes whatwg#12688.
|
|
||
| <li><p>If <var>contentAttributeValue</var> corresponds to a state of | ||
| <var>attributeDefinition</var> with no associated keyword value, then return null.</p></li> | ||
| <li><p>If <var>attributeState</var> is no state, or if <var>attributeState</var> is a state |
There was a problem hiding this comment.
I think the no state part of the condition here is actually a behaviour change in so far as we're not asserting that it matches a state.
Editorially, we require attribute definitions in this scenario has an an invalid value state. Whereas in now we're allowing them not to have one?
There was a problem hiding this comment.
I don't have a strong opinion here, but it seemed like we could allow specification authors the flexibility to not bother with the invalid value state if the intent is that it reflect as null. (I think this is a behavior change only in the sense that it allows specification authors to write spec text in ways that they couldn't before, not that it would change the implementation behavior of any previously-conformant spec text. At least that was my intent.)
|
|
||
| <div algorithm> | ||
| <p>To determine the state of an attribute, use the following steps:</p> | ||
| <p>To <dfn>determine the state of an attribute</dfn> given an attribute value <var>value</var> and |
There was a problem hiding this comment.
As this now takes an extra argument I would just double check that this algorithm wasn't somehow being used without the linking existing anywhere other than the reflection algorithms that've you touched. (I don't think it is but worth double checking)
There was a problem hiding this comment.
This appears to be the only occurrence of "the state of an attribute" in the spec (based on find-in-page on the single page version). So I think this should be ok.
This connects the definitions used by the
DOMStringandDOMString?IDL getters for enumerated attributes that are "limited to only known values" to the formal "determine the state of an attribute" definition that defines the state of an enumerated attribute. The old wording used vague "corresponds to" wording that seemed to imply a connection to this definition but that wasn't formally connected to it.Fixes #12688.
cc @lukewarlow
/common-dom-interfaces.html ( diff )
/common-microsyntaxes.html ( diff )