Bug 165299

Summary: Can not select whole line when using flexbox
Product: WebKit Reporter: Samuel Williams <samuel>
Component: TextAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, esprehn+autocc, glenn, hyatt, kondapallykalyan, mmaxfield, simon.fraser, webkit-bug-importer, zalan
Priority: P2    
Version: Safari 10   
Hardware: Mac   
OS: macOS 10.12   
Attachments:
Description Flags
Working example.
none
Failing example
none
Patch none

Description Samuel Williams 2016-12-02 03:14:04 PST
Created attachment 295938 [details]
Working example.

Cannot select both "xxx" and "foo = bar" in the attached example by clicking mouse cursor and dragging along line. Removing display: flexbox makes it possible, as expected.
Comment 1 Samuel Williams 2016-12-02 03:16:07 PST
Created attachment 295939 [details]
Failing example
Comment 2 zalan 2016-12-06 13:26:21 PST
It's because RootInlineBox::selectionTopAdjustedForPrecedingBlock() assumes preceding block is always above the current line (while in flex layout, they could very well share the same line).
Comment 3 zalan 2016-12-06 14:26:24 PST
Created attachment 296322 [details]
Patch
Comment 4 Dave Hyatt 2016-12-06 14:34:09 PST
Comment on attachment 296322 [details]
Patch

r=me
Comment 5 WebKit Commit Bot 2016-12-06 15:07:09 PST
Comment on attachment 296322 [details]
Patch

Clearing flags on attachment: 296322

Committed r209427: <http://trac.webkit.org/changeset/209427>
Comment 6 WebKit Commit Bot 2016-12-06 15:07:14 PST
All reviewed patches have been landed.  Closing bug.