[Webkit-unassigned] [Bug 240566] innerText from element with "white-space: pre-line" incorrectly removes line breaks

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 18 10:06:43 PDT 2022


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

Sam Sneddon [:gsnedders] <gsnedders at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cdumez at apple.com
          Component|JavaScriptCore              |DOM

--- Comment #1 from Sam Sneddon [:gsnedders] <gsnedders at apple.com> ---
https://html.spec.whatwg.org/multipage/dom.html#rendered-text-collection-steps says:

> If node is a Text node, then for each CSS text box produced by node, in content order, compute the text of the box after application of the CSS 'white-space' processing rules and 'text-transform' rules, set items to the list of the resulting strings, and return items. The CSS 'white-space' processing rules are slightly modified: collapsible spaces at the end of lines are always collapsed, but they are only removed if the line is the last line of the block, or it ends with a br element. Soft hyphens should be preserved. [CSSTEXT]

This implies that pre-line should be preserve the new lines.

Not looked closely at Firefox, but it seems Safari is the only browser failing the '\n preserved ("<div style='white-space:pre-line'>abc\ndef")' subtest at https://wpt.fyi/results/html/dom/elements/the-innertext-and-outertext-properties/getter.html?label=master&label=experimental&product=chrome&product=firefox&product=safari&aligned

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220518/bfbf887a/attachment.htm>


More information about the webkit-unassigned mailing list