<input type="time"> datalist: "Other..." picker not shown at window bottom

#40911529 Filed 2023-05-09 Linux / Windows Fixed by CL 7856802 (issue 348520442)

Bug

A date/time input with a <datalist> first opens a small suggestion list popup. Choosing the "Other..." entry swaps the full time picker into the same popup window. When the input sits near the bottom of the screen the picker must grow upward: the popup origin moves up while the size grows in one bounds change.

Root cause

On Aura desktop the popup lives inside a wrapper top-level widget (DesktopNativeWidgetTopLevelHandler). SetBounds() converts screen to parent coordinates against the wrapper's old origin, so the child ends up offset (e.g. 0,-144) inside the wrapper, and OnWindowBoundsChanged then moves the wrapper to the child's screen bounds without re-aligning the child. The picker renders shifted out of the popup; what remains visible is gutter — or nothing at all. The corrective SetWindowRect() normally repairs this, but those SetPopupBounds calls are dropped while the browser waits for an UpdateScreenRects ack, which reliably happens because the renderer main thread is busy building the picker DOM.

Reproduce

  1. Open the repro page (time input with datalist, pinned to the viewport bottom).
  2. Place the browser window so the input is at the bottom of the screen.
  3. Click the clock icon → suggestion list opens.
  4. Click "Other..." → before the fix, no time picker appears.
▶ Open repro page

Before / After

Captured on Linux (X11, device scale factor 1.25, window at screen bottom). "Before" is top-of-tree with the fix commit reverted; "after" is top-of-tree.

Step 1

Suggestion list opens

Suggestion picker with Other... entry
Before — click "Other..."

No picker is shown

Bug: no time picker appears
After — click "Other..."

Time picker opens upward

Fixed: time picker opens above the input
After — native Wayland (weston)

Time picker opens upward

Fixed: time picker on Wayland

Fix

ui/views/widget/desktop_aura/desktop_native_widget_aura.cc

DesktopNativeWidgetTopLevelHandler::OnWindowBoundsChanged now re-aligns the child window to the wrapper's origin after following a child bounds change, so a grow-upward popup stays inside its wrapper. With the geometry fixed, the suggestion picker no longer needs the hide-to-1x1 window dance before opening the full picker.

Landed as CL 7856802 ("Fix datalist Other picker when popup opens upward", commit 838d8c692a14, bug 348520442). Issue 40911529 is the same defect and is fixed by that CL.

<input type="time" list="popularHours">
<datalist id="popularHours">
  <option value="12:00"></option>
  <option value="13:00"></option>
  <option value="14:00"></option>
</datalist>