Closed Bug 2092565 Opened 14 days ago Closed 6 days ago

test_moz_toggle.html clicks a zero-size description element, so the result depends on sub-pixel layout

Categories

(Toolkit :: UI Widgets, task)

task

Tracking

()

RESOLVED FIXED
163 Branch
Tracking Status
firefox163 --- fixed

People

(Reporter: florian, Assigned: florian, NeedInfo)

References

Details

Attachments

(1 external file)

testMozToggleInteraction in toolkit/content/tests/widgets/test_moz_toggle.html renders a moz-toggle without a description, then calls synthesizeMouseAtCenter(mozToggle.descriptionEl). The empty description is a 0x0 box at the label's bottom-left corner, so the click lands on a boundary point: with a fractional frame offset it hits the label, which toggles and focuses the button ("Input elements emit the expected number of events. - got 3, expected +0"). This shows in the upcoming mochitest-chrome-repeat jobs. When it passes, the click misses the element entirely, so the check never tested anything.

The fix gives the toggle a description so the click hits real text, and expects the single click event without a toggle.

Blocks: 2092575

Without a description, descriptionEl is a 0x0 box at the label's bottom-left corner, so whether the click on it lands on the label (and toggles the button) depends on the sub-pixel position of the test frame, and the old empty expectation only held when the click hit nothing at all. With real description text, the click now bubbles out of moz-toggle as one click that neither toggles nor focuses the button.

The Bugbug bot thinks this bug should belong to the 'Toolkit::UI Widgets' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → UI Widgets
Pushed by fqueze@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/21cf2f155f01 https://hg.mozilla.org/integration/autoland/rev/eafd3a33086a Give the toggle in test_moz_toggle.html's interaction test a description to click, r=hjones.
Pushed by smolnar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/da45666346da https://hg.mozilla.org/integration/autoland/rev/410c63226a78 Revert "Bug 2092565 - Give the toggle in test_moz_toggle.html's interaction test a description to click, r=hjones." for causing lint failures
Pushed by fqueze@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e36900901469 https://hg.mozilla.org/integration/autoland/rev/ca0dea791226 Give the toggle in test_moz_toggle.html's interaction test a description to click, r=hjones.
Status: ASSIGNED → RESOLVED
Closed: 6 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: