YUILibrary - Open source JavaScript and CSS for building richly interactive software.
Fork YUI on GitHub

YUI 2.x

Ticket #2528188 (accepted enhancement)

Reporter


Sylvain Pasche
Opened: 08/20/09
Last modified: 10/7/09
Status: accepted
Type: enhancement

Owner


Matt Sweeney
Target Release: FUTURE
Priority: P3 (normal)
Summary: Use element.classList if available to speed up class manipulation
Description:

Element.classList is a new API introduced in HTML5 for manipulating the classes of an element. The API is documented on https://developer.mozilla.org/en/DOM/element.classList.

This API is implemented in Firefox 3.6 and WebKit is planning to implement it.

YUI could detect if this property is available and use it in the YAHOO.util.Dom.{add,has,remove}Class functions. A speedup of up to 12 could be achieved with Firefox according to this benchmark:
https://bug501257.bugzilla.mozilla.org/attachment.cgi?id=395627).

Type: enhancement Observed in Version: 2.x
Component: Dom Severity: S4 (low)
Assigned To: Matt Sweeney Target Release: FUTURE
Location: Library Code Priority: P3 (normal)
Tags: Relates To:
Browsers: N/A
URL:
Test Information:

Change History

Matt Sweeney

YUI Developer

Posted: 08/21/09
  • location changed to Library Code
  • milestone changed to FUTURE
  • priority changed to P3 (normal)
  • status changed from new to accepted

Matt Sweeney

YUI Developer

Posted: 10/7/09

I'm wary of implementing from a draft spec, especially if the feature does not exist in any A-grade browsers.

Leaving open to consider for future inclusion.