RESOLVED INVALID 16639
Acid3 expects className to preserve whitespace when setting
https://bugs.webkit.org/show_bug.cgi?id=16639
Summary Acid3 expects className to preserve whitespace when setting
Eric Seidel (no email)
Reported 2007-12-28 02:08:35 PST
Acid3 excpects className to preserve whitespace when setting We fail this section: p.className = p.className.replace(/ /, '\n'); if (!p.hasAttribute('class') || p.getAttribute('class') != '\nte\n\nst\n' || p.className != '\nte\n\nst\n') of the following test: function () { // test 51: className and the class attribute: space preservation var ok = true; var p = document.createElement('p'); if (p.hasAttribute('class')) ok = false; p.setAttribute('class', ' te st '); if (!p.hasAttribute('class') || p.getAttribute('class') != ' te st ' || p.className != ' te st ') ok = false; p.className = p.className.replace(/ /, '\n'); if (!p.hasAttribute('class') || p.getAttribute('class') != '\nte\n\nst\n' || p.className != '\nte\n\nst\n') ok = false; p.className = ''; if (!p.hasAttribute('class') || p.getAttribute('class') != '' || p.className != '') ok = false; if (ok) return 4; }, I'm not sure what spec supports preserving whitespace like that (or what other browsers do).
Attachments
Darin Adler
Comment 1 2007-12-31 16:11:59 PST
There's no reason the attribute value should have any whitespace processing done on it. I don't understand why the whitespace is changing.
Darin Adler
Comment 2 2007-12-31 16:23:10 PST
This is a bug in Acid3. Presumably Hixie means to include a "g" like this: p.className = p.className.replace(/ /g, '\n');
Eric Seidel (no email)
Comment 3 2007-12-31 18:25:11 PST
Adding Ian to make sure he saw this was a bug in Acid3.
Darin Adler
Comment 4 2007-12-31 18:36:20 PST
No need. He sees all. (Seriously, he's cc'd on all WebKit bugs.)
Ian 'Hixie' Hickson
Comment 5 2008-01-01 05:55:05 PST
oops. fixed. good catch. cc'ing me explicitly is a good way to catch my attention, by the way. Though I do watch many people, I don't guarantee that I'll see all bugmail, especially if I'm not explicitly cc'ed.
Note You need to log in before you can comment on or make changes to this bug.