From 05d8f8ef93b50203bcd0ebccf8d006410a06fcb7 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Sat, 7 Nov 2026 20:58:47 -0700 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20mobile-shots:=20phone-ergono?= =?UTF-8?q?mics=20hit-rect=20only=20grows,=20uses=20layout=20size?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andrew Anderson --- .../webstatic/testdata/tracker-phone-ergonomics.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pkg/dashboard/webstatic/testdata/tracker-phone-ergonomics.js b/src/pkg/dashboard/webstatic/testdata/tracker-phone-ergonomics.js index 62bc632337..9bc1b61129 100644 --- a/src/pkg/dashboard/webstatic/testdata/tracker-phone-ergonomics.js +++ b/src/pkg/dashboard/webstatic/testdata/tracker-phone-ergonomics.js @@ -31,14 +31,16 @@ const controls = [...section.querySelectorAll('button, a[href], input, select, summary, [role="button"], [role="menuitem"], [tabindex]:not([tabindex="-1"]):not(.ham-row):not(.ham-sub)')] .filter(el => visible(el) && !inlineText(el) && !stripCell(el)); // A compact control may extend its hit area with an absolutely positioned - // empty ::before (the progress pill, #17183): its tap target is the pseudo - // box, not the painted box. Negative insets grow the rect. + // empty ::before (the progress pill, #17183): negative insets grow the tap + // target past the painted box. Positive insets (the ?/⚙ ring drawn inside + // the --tap-target square) never shrink it. Layout size, not the client + // rect, so a one-shot transform animation (.ham-pill-moved) cannot fail it. const hitRect = el => { - const r = el.getBoundingClientRect(); + const r = { width: el.offsetWidth || el.getBoundingClientRect().width, height: el.offsetHeight || el.getBoundingClientRect().height }; const b = getComputedStyle(el, '::before'); if (b.position !== 'absolute' || b.content !== '""' || getComputedStyle(el).position === 'static') return r; - const px = v => parseFloat(v) || 0; - return { width: r.width - px(b.left) - px(b.right), height: r.height - px(b.top) - px(b.bottom) }; + const grow = v => Math.max(0, -(parseFloat(v) || 0)); + return { width: r.width + grow(b.left) + grow(b.right), height: r.height + grow(b.top) + grow(b.bottom) }; }; const small = []; for (const el of controls) { From e945e4b21ba61eaa277355f036b0267a73a7e5eb Mon Sep 17 00:00:00 2001 From: clubanderson <407614+clubanderson@users.noreply.github.com> Date: Sun, 8 Nov 2026 03:59:23 +0000 Subject: [PATCH 2/2] changelog: fragment for #17199 Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com> --- changelog.d/fixed-17199.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/fixed-17199.md diff --git a/changelog.d/fixed-17199.md b/changelog.d/fixed-17199.md new file mode 100644 index 0000000000..3d1847f296 --- /dev/null +++ b/changelog.d/fixed-17199.md @@ -0,0 +1 @@ +- mobile-shots: phone-ergonomics hit-rect only grows and uses layout size (#17199)