RESOLVED CONFIGURATION CHANGED 76392
Whitespace in option elements should be collapsed in DOM
https://bugs.webkit.org/show_bug.cgi?id=76392
Summary Whitespace in option elements should be collapsed in DOM
felipe
Reported 2012-01-16 10:03:32 PST
var d = document.createElement("div"); d.innerHTML = "<select><option>foo bar</option><select>"; d.firstChild.firstChild.value The above should, per the spec, give "foo bar", which every other major browser gives; WK, however, gives "foo bar". cf. http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#dom-option-text
Attachments
test with normal parsing (170 bytes, text/html)
2012-01-16 11:40 PST, Alexey Proskuryakov
no flags
Eric Seidel (no email)
Comment 1 2012-01-16 11:26:05 PST
The spec you reference applies to textContent. But I checked d.textContent, and we also preserve the spaces there, so at least the textContent part is a valid bug.
Alexey Proskuryakov
Comment 2 2012-01-16 11:40:24 PST
I think that the same applies to normal parsing, not just innerHTML and textContent. We collapse whitespace at render time, while others appear to do that at parse time.
Alexey Proskuryakov
Comment 3 2012-01-16 11:40:43 PST
Created attachment 122669 [details] test with normal parsing
Antaryami Pandia (apandia)
Comment 4 2012-02-09 04:51:07 PST
Ahmad Saleem
Comment 5 2022-08-02 03:52:49 PDT
All browsers (Chrome Canary 106, Firefox Nightly 105 and Safari 15.6 on macOS 12.5) in the attached test case show '7' and matching with each other. I think it might be something resolved along the way and this can be marked as "RESOLVED CONFIGURATION CHANGED". Thanks!
Ryosuke Niwa
Comment 6 2022-08-02 09:18:30 PDT
Yup, we return 7 now.
Note You need to log in before you can comment on or make changes to this bug.