Bug 240867 - <text>, <tspan> position is not respected when white-space is applied and element contains text nodes
Summary: <text>, <tspan> position is not respected when white-space is applied and ele...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-05-24 05:33 PDT by Bartosz Gryta
Modified: 2022-12-14 13:21 PST (History)
6 users (show)

See Also:


Attachments
Example of working and broken <text> nodes in SVG when white-space is applied (567 bytes, image/svg+xml)
2022-05-24 05:33 PDT, Bartosz Gryta
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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>