Bug 138913 - FrameSelection::selectionBounds rarely matches the painted selection highlight rect
Summary: FrameSelection::selectionBounds rarely matches the painted selection highligh...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 178032
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-20 00:11 PST by Tim Horton
Modified: 2017-10-12 14:12 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2014-11-20 00:11:05 PST
There are a number of places between selection painting and the rect returned by FrameSelection::selectionBounds where rounding is applied inconsistently, resulting in a rect that doesn't precisely match the painted pixels.

For example, RenderView::subtreeSelectionBounds does a 'enclosingBoundingBox', and InlineTextBox::localSelectionRect does a 'enclosingIntRect' instead of 'snapRectToDevicePixelsWithWritingDirection' (which is what happens in the painting code).

This means that FrameSnapshotting::snapshotSelection often returns a snapshot that doesn't precisely match the blue highlight. This also breaks TextIndicator's BounceAndCrossfade animation, which depends on that being true.
Comment 1 Radar WebKit Bug Importer 2014-11-20 00:37:50 PST
<rdar://problem/19041871>