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).
There's no reason the attribute value should have any whitespace processing done on it. I don't understand why the whitespace is changing.
This is a bug in Acid3. Presumably Hixie means to include a "g" like this: p.className = p.className.replace(/ /g, '\n');
Adding Ian to make sure he saw this was a bug in Acid3.
No need. He sees all. (Seriously, he's cc'd on all WebKit bugs.)
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.