Bug 221416

Summary: Text not selectable in <pre> overflow-x: auto in some circumstances
Product: WebKit Reporter: Jeff Johnson <opendarwin>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: megan_gardner, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: Mac (Apple Silicon)   
OS: macOS 11   

Description Jeff Johnson 2021-02-04 10:01:53 PST
Overview: In some circumstances, the text is not selectable inside a <pre> element with style overflow-x: auto. This happens when the page is wide enough that the scroller does not appear.

Steps to Reproduce:
1. In System Preferences, General pane, enable Show scroll bars: Always
2. In Safari, View menu, select Show Tab Bar
3. Open https://lapcatsoftware.com/articles/DerivedData.html
4. Slowly horizontally resize the window until the first <pre> element containing "/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister" no longer shows the horizontal scrollbar.
5. Make sure the page and vertical scrollbar is scrolled to the top
6. Try to select "CoreServices.framework" inside the <pre>

Actual Results: The text can't be selected.

Expected Results: The text can be selected.

Build Date & Hardware: Safari 14.0.3 (16610.4.3.1.4), macOS 11.2 (20D64), Mac mini (M1, 2020)

Additional Builds and Platforms: I can also reproduce in Safari Technology Preview 119, and also on an Intel MacBook Pro. I can only reproduce on macOS Big Sur, not on Catalina or Mojave.

Additional Information: The bug depends on the exact circumstances described above. Strangely, it depends on Show Tab Bar in Safari and doesn't happen when the tab bar is not showing. It also depends on the System Preferences scroll behavior. And it depends not only on the width of the page but also the vertical scroll position: if you scroll down a bit on the page, then the bug doesn't occur.
Comment 1 Radar WebKit Bug Importer 2021-02-11 10:02:16 PST
<rdar://problem/74239286>