[Webkit-unassigned] [Bug 95631] New: element.classList.remove("x") on an element with only class "x" leaves <p class> instead of <p class="">

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 31 20:31:21 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=95631

           Summary: element.classList.remove("x") on an element with only
                    class "x" leaves <p class> instead of <p class="">
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
        OS/Version: Mac OS X 10.8
            Status: UNCONFIRMED
          Severity: Trivial
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: dunn.alex at gmail.com


By inspecting the <h1> element in this jsFiddle, you can see that using classList.remove to remove the only class from an element results in, e.g., <h1 class>, when it seems that the right result is <h1 class="">:

http://jsfiddle.net/gyre/6rVJU/

The current HTML5 draft says that the class attribute, "if specified, must have a value" (http://dev.w3.org/html5/spec-author-view/global-attributes.html#classes).  But neither the regular or "nu" W3 validators flag this as invalid, so I doubt it's important.  Gecko does have the "correct" behavior, though.

Tested on Safari 6.0 (8536.25), Webkit 537+, and Chrome 21.0.1180.89

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list