Bug 101627 - REGRESSION (r125239): classList contains() doesn't work after element was moved from strict mode document to quirks mode document
Summary: REGRESSION (r125239): classList contains() doesn't work after element was mov...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P1 Normal
Assignee: Erik Arvidsson
URL:
Keywords: Regression
Depends on:
Blocks:
 
Reported: 2012-11-08 11:22 PST by Brad Vogel
Modified: 2013-01-07 15:56 PST (History)
6 users (show)

See Also:


Attachments
test case (921 bytes, text/html)
2012-11-08 11:22 PST, Brad Vogel
no flags Details
Patch (7.74 KB, patch)
2012-11-08 14:25 PST, Erik Arvidsson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brad Vogel 2012-11-08 11:22:08 PST
Created attachment 173080 [details]
test case

Browsers tested:
Chrome 22 - PASS
Chrome 23.0.1271.64 - FAIL
Safari 6 (AppleWebKit/536.26.17) - PASS
Webkit Nightly 6.0.2 (AppleWebKit/537.19+) - FAIL

Repro:
Run the attached file.

Expected:
The alert dialog shows: contains "newclass": true

Actual:
The alert dialog shows: contains "newclass": false

Notes:
Adding a doctype to the iframe is a workaround to the issue:
      doc.write('<!doctype html><html><body></body></html>');
Comment 1 Erik Arvidsson 2012-11-08 13:11:17 PST
This happens when an element is moved from a standards mode document to a quirks mode document since the internal list of class names now needs to be handled by the ClassList.

We need to verify that ClassList::classNames returns an up to date SpaceSplitString.

Is this really a regression? I'm surprised this ever worked.
Comment 2 Brad Vogel 2012-11-08 13:49:17 PST
Yes, I verified it worked on Chrome 22 and Safari 6.
Comment 3 Alexey Proskuryakov 2012-11-08 14:02:49 PST
Definitely a regression, I bisected to <http://trac.webkit.org/changeset/125239>.
Comment 4 Erik Arvidsson 2012-11-08 14:25:00 PST
Created attachment 173115 [details]
Patch
Comment 5 WebKit Review Bot 2012-11-09 12:55:22 PST
Comment on attachment 173115 [details]
Patch

Clearing flags on attachment: 173115

Committed r134102: <http://trac.webkit.org/changeset/134102>
Comment 6 WebKit Review Bot 2012-11-09 12:55:26 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Brad Vogel 2012-11-09 13:29:26 PST
Thanks!
Comment 8 Levi Weintraub 2013-01-07 15:56:11 PST
You may want to merge this into m25 given it's super low risk and high return.
Comment 9 Levi Weintraub 2013-01-07 15:56:29 PST
(In reply to comment #8)
> You may want to merge this into m25 given it's super low risk and high return.

Whoops, wrong bug.