Bug 210875 - Caret does not paint correctly in vertical SVG text
Summary: Caret does not paint correctly in vertical SVG text
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-04-22 14:13 PDT by Daniel Bates
Modified: 2022-07-11 14:48 PDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2020-04-22 14:13:30 PDT
Consider the .svg page with the following markup:
[[
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g writing-mode="vertical-lr">
    <text id="text" font-size="50" x="50" y="50" style="-webkit-user-modify: read-write" tabindex="0">Hello</text>
</g>
<script>
window.getSelection().setBaseAndExtent(document.getElementById('text').firstChild, 0, document.getElementById('text').firstChild, 0);
</script>
</svg>
]]

Open the page. You should see a horizontal caret before the 'h'. On iOS I see a vertical caret to the left of the 'h' and on Mac I see a horizontal caret only on first load between 'l' and 'l'.
Comment 1 Radar WebKit Bug Importer 2020-04-22 14:47:31 PDT
<rdar://problem/62212006>
Comment 2 Ahmad Saleem 2022-07-10 11:48:16 PDT
I am able to reproduce this bug in Safari 15.5 on macOS 12.4 and Safari Technical Preview 148 (based on described of caret showing up on first load between "l" vertically.

I also changed the test case into following JSFiddle - https://jsfiddle.net/gcmr2s1p/show

On other browsers, Chrome Canary 105 does not show caret upon selection and just show selection border (also no weird horizontal block like Safari to shape like "L" of Tetris game) while Firefox Nightly 104 does not show selection border unless if I select all text. Thanks!