[Bug 13999] DOMTokenList (e.g., element.classList): allow to add/remove multiple tokens at once

https://www.w3.org/Bugs/Public/show_bug.cgi?id=13999

--- Comment #12 from Erik Arvidsson <arv@chromium.org> 2012-03-05 17:52:23 UTC ---
(In reply to comment #3)
> (In reply to comment #1)
> 
> > The performance of classList is an implementation detail.  There's no
> > particular reason for it to be slower.

There are reasons that makes classList slower. None of the JS frameworks
validate the input. Validation of the input is required by the spec for
DOMTokenList.

> One of major reasons is that consequent adding classes one by one causes
> multiple rendering-reflows. (Each reflow is quite time-expensive operation.)

This is not true. However, it does serialize the DOMTokenList to a string. That
string is then used in setAttribute('class', string) since there might be
mutation listeners etc.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Monday, 5 March 2012 17:52:32 UTC