Skip to content

Commit

Permalink
Abstract away creating an attribute from toggleAttribute() and setAtt…
Browse files Browse the repository at this point in the history
…ribute()
  • Loading branch information
jonathanKingston committed Jun 29, 2018
1 parent 63a9c3e commit 543336c
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6189,6 +6189,22 @@ in an <a for="/">element</a> <var>element</var>, run these steps:

<hr>


To <dfn export id=concept-element-attributes-set-by-name>create an attribute by value</dfn>
given a <var>qualifiedName</var>, <var>value</var> and <a for="/">element</a> <var>element</var>, run these steps:

<ol>
<li><p>Create an <a>attribute</a> whose
<a for="Attr">local name</a> is <var>qualifiedName</var>, <a for=Attr>value</a> is
<var>value</var>, and <a for=Node>node document</a> is <a>context object</a>'s
<a for=Node>node document</a>.

<li><a lt="append an attribute">Append</a> this <a>attribute</a> to
<a>element</a>

<li>Return.
</ol>

To <dfn export id=concept-element-attributes-get-valid-by-name>get a valid attribute by name</dfn>
given a <var>qualifiedName</var>, and <a for="/">element</a> <var>element</var>, run these steps:

Expand Down Expand Up @@ -6548,11 +6564,8 @@ method, when invoked, must run these steps:
<ol>
<li><p>Let <var>qualifiedName</var> and <var>attribute</var> be the result of running <a>get a valid attribute by name</a> given the <var>qualifiedName</var> and <a>context object</a>

<li><p>If <var>attribute</var> is null, create an <a>attribute</a> whose
<a for="Attr">local name</a> is <var>qualifiedName</var>, <a for=Attr>value</a> is
<var>value</var>, and <a for=Node>node document</a> is <a>context object</a>'s
<a for=Node>node document</a>, then <a lt="append an attribute">append</a> this <a>attribute</a> to
<a>context object</a>, and then return.

<li><p>If <var>attribute</var> is null, run <a>create an attribute by value</a> given the <var>qualifiedName</var>, <var>value</var> and <a>context object</a>, and then return.

<li><p><a lt="change an attribute">Change</a> <var>attribute</var> from <a>context object</a> to
<var>value</var>.
Expand Down Expand Up @@ -6606,13 +6619,7 @@ method, when invoked, must run these steps:
<ol>
<li><p>If <var>force</var> is given and is false, return false.

<li><p>Create an <a>attribute</a> whose
<a for="Attr">local name</a> is <var>qualifiedName</var>, <a for=Attr>value</a> is the empty
string, and <a for=Node>node document</a> is the <a>context object</a>'s
<a for=Node>node document</a>.

<li><a lt="append an attribute">Append</a> this <a>attribute</a>
to the <a>context object</a>.
<li><p>Run <a>create an attribute by value</a> given the <var>qualifiedName</var>, <var>the empty string</var> and <a>context object</a>.

<li>Return true.
</ol>
Expand Down

0 comments on commit 543336c

Please sign in to comment.