Closed Bug 1795620 Opened 3 years ago Closed 3 years ago

Fix the failure of testing/web-platform/tests/html/semantics/forms/the-input-element/checkable-active-onblur.html

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P3)

defect

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox108 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

()

Details

(Keywords: parity-chrome, parity-safari)

Attachments

(1 file)

The failures are caused by:

  1. Gecko does not activate <input type="checkbox"> and <input type="readio"> when user presses the space key.
  2. Gecko makes all ancestors active when an element gets activated.
  3. Gecko does not inactivate elements when active element gets lost focus.

The 2nd issue is not intended to check with the test. Therefore, we should fix this in the test side.

On the other hand, the 1st and 3rd issues are real issues. This difference could cause different look and feel in some web apps.

https://wpt.fyi/results/html/semantics/forms/the-input-element/checkable-active-onblur.html?q=label%3Ainterop-2022-forms&run_id=5114607463563264&run_id=5149015453204480&run_id=5205767540441088

First, the test compares document.querySelector(":active") and a checkbox or
a radio button. However, Gecko activates ancestor elements too. Therefore,
Gecko returns <html> element or null for the selector. However, this is
an issue of CSS pseudo class compatibility which is not scope of the test.
Therefore, this patch makes it compare document.querySelector("input:active")
and a checkbox or a radio button instead.

Next, Gecko does not activate checkboxes and radio buttons when user presses
the space key, but the other browsers do it. Therefore, this patch makes
HTMLInputElement::PostHandleEvent do it and
EventStateManager::PostHandleEvent clear it at keyup of the space key.

Next, Gecko does not inactive active elements when it gets lost focus.
Therefore, this patch makes nsFocusManager::NotifyFocusStateChange do it
like the other browsers.

Finally, with manual testing of draft patches, I found some issues of
inactivating them when they are activated by <label>s. Therefore, I add new
tests in a separate file. Note that Chrome fails only in the cases testing
<input type="radio"> with <label>.

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/e64ab51c2c29 Make it work better to activate/inactivate checkboxes and radio buttons like the other browsers r=smaug
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/36934 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: