'focusin' and 'focusout' events are not composed

RESOLVED FIXED in Firefox 63

Status

()

defect
P2
normal
RESOLVED FIXED
Last year
Last year

People

(Reporter: dave, Assigned: smaug)

Tracking

61 Branch
mozilla63
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox61 wontfix, firefox62 wontfix, firefox63 fixed)

Details

Attachments

(2 attachments)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36

Steps to reproduce:

var input = document.createElement('input');
document.body.appendChild(input);
input.addEventListener('focusout', (evt) => console.log('focusout', evt.composed));
input.addEventListener('focusin', (evt) => console.log('focusin', evt.composed));

Focus then blur on input.


Actual results:

In both cases above, evt.composed was false.


Expected results:

evt.composed should be true.
User Agent:  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:63.0) Gecko/20100101 Firefox/63.0 
Build ID: 20180705220111       
I manage to reproduce this issue on Mac 10.13 with Firefox Nightly 63.0a1 (2018-07-05) (64-bit). Please note that this issue is also displayed on Windows 10 x64.
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Events
Ever confirmed: true
Product: Firefox → Core
Making test-003.html to pass revealed also another bug, which the change to MayRetargetToChromeIfCanNotHandleEvent is about.
If relatedTarget and target are both in same shadow DOM, event propagation stops at ShadowRoot, but may propagate to chrome. So we need to mark the chrome target to actually be chrome.

remote: View your changes here:
remote:   https://hg.mozilla.org/try/rev/3c24d85af2dbe96025422dabc9ebdc5867786b03
remote:   https://hg.mozilla.org/try/rev/301529c8d2f1ad32d4263702a2ec26f3b9ffdc17
remote: 
remote: Follow the progress of your build on Treeherder:
remote:   https://treeherder.mozilla.org/#/jobs?repo=try&revision=301529c8d2f1ad32d4263702a2ec26f3b9ffdc17
remote: recorded changegroup in replication log in 0.127s
Assignee: nobody → bugs
Attachment #8990614 - Flags: review?(masayuki)
Comment on attachment 8990614 [details] [diff] [review]
composed_focusinout.diff

Review of attachment 8990614 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/events/EventDispatcher.cpp
@@ +772,5 @@
>      // Event target couldn't handle the event. Try to propagate to chrome.
>      EventTargetChainItem* chromeTargetEtci =
>        EventTargetChainItemForChromeTarget(aChain, aContent, aChildEtci);
>      if (chromeTargetEtci) {
> +      chromeTargetEtci->SetIsChromeHandler(true);

I think that you should write the reason of this change as comment which you mentioned in the bugzilla's comment.
Attachment #8990614 - Flags: review?(masayuki) → review+
Priority: -- → P2
gah, wrong tryserver push
remote: View the pushlog for these changes here:
remote:   https://hg.mozilla.org/try/pushloghtml?changeset=62b5b15337ca74246ad768e8a83b3147d2492c47
remote: 
remote: Follow the progress of your build on Treeherder:
remote:   https://treeherder.mozilla.org/#/jobs?repo=try&revision=62b5b15337ca74246ad768e8a83b3147d2492c47
remote: recorded changegroup in replication log in 0.118s
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/45853b30dd6b
focusin/out should be composed, and mark chrome event target chain items as chrome, r=masayuki
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/11866 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
https://hg.mozilla.org/mozilla-central/rev/45853b30dd6b
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Upstream PR merged
You need to log in before you can comment on or make changes to this bug.