When an element with "display:flex; flex-direction:row" is selected, selection.toString() inserts newlines between the child elements. Bug is on both Desktop and iOS Safari Safari Version: Version 17.0 (18616.1.27.111.22, 18616) Bug is not present in Chrome Repro steps: ``` myDiv.innerHTML = `<div style="display:flex; flex-direction:row;"><div>a</div><div>b</div></div>`; r = document.createRange(); r.setStartBefore(myDiv); r.setEndAfter(myDiv); sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(r); sel.toString() ``` Expected: "ab" Actual: " a b "
Created attachment 468266 [details] test As far as I've tested, Chrome 118.0.5993.70 as well as Firefox 118.0.2 both serializes this as "a\nb" with new line in between "a" and "b".