[Webkit-unassigned] [Bug 263302] New: [iOS] range.toString() ignores newlines

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 17 22:03:08 PDT 2023


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

            Bug ID: 263302
           Summary: [iOS] range.toString() ignores newlines
           Product: WebKit
           Version: Other
          Hardware: iPhone / iPad
                OS: iOS 17
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: DOM
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: morganfredding at gmail.com

When a range includes newlines, range.toString() does not include them.

This bug occurs 100% of the time and does *not* occur on Macbook Safari (or Chrome). 

Also "window.getSelection().toString()" *does* include newlines (i.e. there's probably already a bug-free implementation you can use in the webkit code base).

Bug probably occurs on all iPhones/iPads, but I've only specifically reproduced it in the simulator for "iPhone 15 Pro Max" and "iPhone 14 Pro Max".

navigator.userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148"

Repro steps:

```
myDiv.innerHTML = '<div>a</div><div>b</div><br><div>c</div>';
let range = document.createRange();
range.setStartBefore(myDiv);
range.setEndAfter(myDiv);
console.log(range.toString());
```

Expected:

"a
b

c"

Actual:

"abc"

-- 
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/20231018/ff1a17bb/attachment.htm>


More information about the webkit-unassigned mailing list