Skip to content

Host: browser_viewport_reset returns before the page reads its restored size (Chromium 152 lag) #221

Closed

Description

@SSFSKIM

Purpose

After browser_viewport_reset, a screenshot can still show the old override size. Chromium 152 answers Emulation.clearDeviceMetricsOverride before the page reads its restored size. MAWS measured this in 30-try runs (MAWS run 40311614893; maws-app 40311728565, 40312068417, 40312071190): 8, 1, 5 and 9 reads taken right after the reply still showed the override's 800, and the page caught up within about 80 ms. Setting an override has no such lag.

Goal

browser_viewport_reset in cua's host (src/chrome/host.mjs, sendViewport / setViewport) returns only once the page shows its restored size. After the clear, poll Page.getLayoutMetrics until the size differs from the cleared override's, bounded by a short deadline. When the deadline passes, log what was still outstanding and return; don't fail the reset. MAWS passes browser_viewport_reset through unchanged, so the in-app route gets the fix too.

Notes

  • MAWS made the equivalent fix for its own pre-release undo in MAWS PR Reusable accept-native sitting on the mini: parameterized commit and approved home, gated --watch, and the deferred live TextEdit item #166 (master c2af92b14, MAWS P4 Decision Log 90): a cleared override is undone only once Page.getLayoutMetrics reads the view's size, with bounds RESET_BOUND_MS 1 s and UNDO_WAIT_MS 2 s. Reported by the MAWS architect, who logged it as a MAWS tracker row with cua as owner.
  • Edge cases: the reset on a tab that is not attached (only tab.viewport = null is recorded, so there's nothing to wait for); a lost debugger (forgetLostDebugger); and a page whose natural size equals the override, where the size never changes and the poll must end at its bound without logging a false alarm.
  • Test with the host's fake extension: the clear is answered first, then the reported metrics change some milliseconds later, and the reset must not return before that.

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P2
    on Oct 26, 2026
  2. added
    status:in-progress
    and removed
    status:ready-for-implementer
    on Oct 26, 2026
  3. added
    status:in-review
    and removed
    status:in-progress
    on Oct 26, 2026
  4. SSFSKIM commented on Oct 26, 2026

    @SSFSKIM
    OwnerAuthor

    [review-trail] Independent doperpowers:reviewer-medium reviewed 9c57bfa..575b282 for PR #223. One actionable P2: a fixed 24-DIP scrollbar allowance can treat an unchanged overridden viewport with wide/double gutters as restored. Independently reproduced with a 750x600 actual layout under an 800x600 override: reset returned in 0.3 ms before the delayed restoration. Fix wave underway to compare observed pre-clear layout instead; no merge.

  5. SSFSKIM commented on Oct 26, 2026

    @SSFSKIM
    OwnerAuthor

    [review-trail] Fixed the verified P2 in afb007d. doperpowers:reviewer-medium re-reviewed 575b282..afb007d and returned correct: no material findings; both scrollbar reproductions now wait for restoration. Final head verification: 77/77 host tests; full local suite 3998 passed, 172 skipped, 0 failed with CUA_FEEDBACK_DIR unset. PR #223 remains open and unmerged.

  6. added 3 commits that reference this issue on Oct 26, 2026
    e1aeda2
    7e24db6
    7023047
  7. removed
    status:in-review
    on Nov 1, 2026
  8. SSFSKIM commented on Nov 1, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: finalize: closed by its merged PR; stale in-review label stripped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions