Skip to content

Commit

Permalink
Add class as an alias for className
Browse files Browse the repository at this point in the history
This adds class as an alias for className to be
more consistent and intuitive. This is now possible
since 'class' is no longer a globally reserved word
in Javascript.

fixes #1310
  • Loading branch information
Psychpsyo committed Sep 17, 2024
1 parent 484c8bc commit e771458
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6172,7 +6172,8 @@ interface Element : Node {
readonly attribute DOMString tagName;

[CEReactions] attribute DOMString id;
[CEReactions] attribute DOMString className;
[CEReactions] attribute DOMString class;
[CEReactions] attribute DOMString className; // legacy alias of .class
[SameObject, PutForwards=value] readonly attribute DOMTokenList classList;
[CEReactions, Unscopable] attribute DOMString slot;

Expand Down Expand Up @@ -6786,8 +6787,8 @@ claims as to whether using them is conforming or not.
<p>The <dfn attribute for=Element><code>id</code></dfn> attribute must <a for=Attr>reflect</a>
"<code>id</code>".

<p>The <dfn attribute for=Element><code>className</code></dfn> attribute must
<a for=Attr>reflect</a> "<code>class</code>".
<p>The <dfn attribute for=Element><code>class</code></dfn> and <dfn attribute
for=Element><code>className</code></dfn> attribute must <a for=Attr>reflect</a> "<code>class</code>".

<p>The <dfn attribute for=Element><code>classList</code></dfn> getter steps are to return a
{{DOMTokenList}} object whose associated <a for=/>element</a> is <a>this</a> and whose associated
Expand Down Expand Up @@ -10506,6 +10507,7 @@ Philippe Le Hégaret,
Piers Wombwell,
Pierre-Marie Dartus,
prosody—Gab<!-- riel --> Vereable<!-- Gaston --> <!-- Croft -->Context(,
Psychpsyo,
Rafael Weinstein,
Rakina Zata Amni,
Richard Bradshaw,
Expand Down

0 comments on commit e771458

Please sign in to comment.