Selection Handles Fix

#451833352 Blink CL 7596201 Merged CC follow-up pending P3

Issue

On Android, text selection handles were not visible when an input field's line-height exceeded its height. The fix required two CLs: one for the blink paint path (merged) and one for the CC compositor path (pending).

Blink Visual Comparison (Non-Composited)

Before (Bug)

Unpatched - handles hidden

Selection handles not visible

After (Fixed)

Patched - handles visible

Selection handles correctly visible

CC Visual Comparison (Composited Layers)

Before (Bug)

CC Unpatched - handles hidden

Composited input - handles not visible

After (Fixed)

CC Patched - handles visible

Composited input - handles correctly visible

Downloads (x86 emulator)

Install via adb install -r <file>.apk, then open sampler.html on device.

⬇ patched.apk (Blink + CC fix) ⬇ unpatched.apk (Blink only) ▶ Test Page

patched.apk -- Blink paint-path fix + CC compositor-path fix. All test cases should show handles.

unpatched.apk -- Blink paint-path fix only. Composited inputs (will-change, translateZ) may still hide handles.

Two Code Paths

Blink Paint path (non-composited)

PaintedSelectionBoundToLayerSelectionBound in paint_chunks_to_cc_layer.cc. Fixed by CL 7596201: uses the full edge bounding rect instead of a single point near edge_end.

CC Compositor path (composited layers)

ComputeViewportSelectionBound in cc/trees/layer_tree_impl.cc. Follow-up CL: when the point near edge_end misses, also checks a point near edge_start. Gated behind kCCSelectionEdgeVisibilityUsesFullEdge in cc/base/features.h.

Composited layers are triggered by will-change: transform, transform: translateZ(0), hardware-accelerated scrolling, etc.

Unit Tests

# Blink-side (CL 7596201, merged)
tools/autotest.py -C out/Default \
  --gtest_filter="SelectionBoundsRecorderTest.Bounds*" \
  third_party/blink/renderer/core/paint/selection_bounds_recorder_test.cc

# CC-side (follow-up CL)
./out/Default/cc_unittests \
  --gtest_filter="*SelectionBoundsVisibleWithPartialEdgeOverflow*"