Bug 132596 - REGRESSION(r155957): Selection rects are incorrect when the selection contains BR elements.
Summary: REGRESSION(r155957): Selection rects are incorrect when the selection contain...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: iPhone / iPad Unspecified
: P2 Normal
Assignee: Enrica Casucci
Keywords: InRadar
Depends on:
Reported: 2014-05-05 18:19 PDT by Enrica Casucci
Modified: 2014-05-06 10:50 PDT (History)
6 users (show)

See Also:

Patch (5.21 KB, patch)
2014-05-05 18:22 PDT, Enrica Casucci
koivisto: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Enrica Casucci 2014-05-05 18:19:06 PDT
This was introduced by http://trac.webkit.org/changeset/155957
The renderer for BR elements used to inherit from RenderText before the change listed above.
RenderText has an implementation of the method collectSelectionRects, available only for iOS. RenderLineBreak doesn't have one and it defaults to the implementation in RenderObject that doesn't return the correct rectangle and most of all does not provide the correct annotations for the rect.
The above mentioned change also changes the behavior of the renderer when it is not the only element on the line, which creates additional problems.
Among the various reported issues are:
- the selection is not drawn when BR is the only element on the line
- overlapping selections when two lines of text are separated by BR.

Comment 1 Enrica Casucci 2014-05-05 18:22:54 PDT
Created attachment 230878 [details]
Comment 2 Antti Koivisto 2014-05-06 00:05:53 PDT
We should really move this stuff out from PLATFORM(IOS) and make it testable with an internal setting.
Comment 3 Enrica Casucci 2014-05-06 10:50:46 PDT
Committed revision 168364.