Skip to content

spec for toggleAttribute could be a bit clearer #3779

@bzbarsky

Description

@bzbarsky

The current spec does this:

  1. If attribute is null, then:

    1. If force is not given or is true, create an attribute whose local name is qualifiedName, value is the empty string, and node document is the context object’s node document, then append this attribute to the context object, and then return true.
    2. Return false.

Note the need for a bunch of "then" in the first nested case. This might be easier to read as:

  1. If attribute is null, then:

    1. If force is given and is false, return false.

    2. Create an attribute whose local name is qualifiedName, value is the empty string, and node document is the context object’s node document.

    3. Append this attribute to the context object.

    4. Return true.

or so. Similar for the case when attribute is not null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions