Bug 240867

Summary: <text>, <tspan> position is not respected when white-space is applied and element contains text nodes
Product: WebKit Reporter: Bartosz Gryta <gtktsc>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: mmaxfield, sabouhallawa, simon.fraser, webkit-bug-importer, zalan, zimmermann
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=249300
Attachments:
Description Flags
Example of working and broken <text> nodes in SVG when white-space is applied none

Description Bartosz Gryta 2022-05-24 05:33:53 PDT
Created attachment 459718 [details]
Example of working and broken <text> nodes in SVG when white-space is applied

When <text> node has `white-space` property set to `pre-wrap` or `pre-line` and it contains <tspan> nodes and text nodes combined (for example newline character or empty space between <tspan>) children overlap on each other - their position is not respected. When text nodes are trimmed from <text> it works properly. It works in Firefox and Chrome.

Similar bug https://bugs.webkit.org/show_bug.cgi?id=189790 related to how `white-space` behaves, but it's not about text nodes in particular.

I've attached an example, it contains three <text> nodes:
- text node without `white-space` property - working,
- text node with `white-space` property and text nodes in between - broken,
- text node with `white-space` property but without text nodes in between - working.
Comment 1 Radar WebKit Bug Importer 2022-05-31 05:34:29 PDT
<rdar://problem/94145711>