diff --git a/source b/source index 8dfc29a8f0b..737fef9a0c5 100644 --- a/source +++ b/source @@ -5430,31 +5430,34 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute

Multiple keywords can map to the same state.

-

To determine the state of an attribute, use the following steps:

+

To determine the state of an attribute given an attribute value value and + a set of keyword/state mappings and special states defined in the specification + attributeDefinition, use the following steps:

  1. -

    If the attribute is not specified:

    +

    If value is null (meaning the attribute is not specified):

      -
    1. If the attribute has a missing value default - state defined, then return that missing value default - state.

    2. +
    3. If attributeDefinition has a missing value + default state defined, then return that missing value + default state.

    4. Otherwise, return no state.

  2. -
  3. If the attribute's value is an ASCII case-insensitive match for one of the - keywords defined for the attribute, then return the state represented by that keyword.

  4. +
  5. If value is an ASCII case-insensitive match for one of the + keywords defined for the attribute in attributeDefinition, then return the state + represented by that keyword.

  6. -
  7. If the attribute has an empty value default state - defined and the attribute's value is the empty string, then return that empty value default state.

  8. +
  9. If attributeDefinition has an empty value + default state defined and value is the empty string, then return that empty value default state.

  10. -
  11. If the attribute has an invalid value default state - defined, then return that invalid value default - state.

  12. +
  13. If attributeDefinition has an invalid value + default state defined, then return that invalid value + default state.

  14. Return no state.

@@ -8679,14 +8682,17 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute values:

    -
  1. If contentAttributeValue does not correspond to any state of - attributeDefinition (e.g., it is null and there is no missing value default), or if it is in a state of - attributeDefinition with no associated keyword value, then return the empty - string.

  2. - -
  3. Return the canonical keyword for the state of - attributeDefinition that contentAttributeValue corresponds to.

  4. +
  5. Let attributeState be the result of determine the state of an + attribute given contentAttributeValue and + attributeDefinition.

  6. + +
  7. If attributeState is no state (e.g., because the attribute is not present + and there is no missing value default), or if + attributeState is a state of attributeDefinition with no associated + keyword value, then return the empty string.

  8. + +
  9. Return the canonical keyword for attributeState in + attributeDefinition.

@@ -8731,14 +8737,18 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
  • Assert: the reflected IDL attribute is limited to only known values.

  • -
  • Assert: contentAttributeValue corresponds to a state of +

  • Let attributeState be the result of determine the state of an + attribute given contentAttributeValue and attributeDefinition.

  • -
  • If contentAttributeValue corresponds to a state of - attributeDefinition with no associated keyword value, then return null.

  • +
  • If attributeState is no state, or if attributeState is a state + of attributeDefinition with no associated keyword value, then return + null.

  • + +
  • Assert: contentAttributeValue is not null.

  • -
  • Return the canonical keyword for the state of - attributeDefinition that contentAttributeValue corresponds to.

  • +
  • Return the canonical keyword for attributeState in + attributeDefinition.