Ensure click() works on input elements which are disconnected from a document
Categories
(Core :: DOM: Core & HTML, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox75 | --- | fixed |
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
Details
(Keywords: dev-doc-complete, site-compat)
Attachments
(2 files)
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
Updated•5 years ago
|
Comment 6•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/c8655a12d0b3
https://hg.mozilla.org/mozilla-central/rev/96f22cd237f3
Assignee | ||
Updated•5 years ago
|
Comment 7•5 years ago
|
||
Ehsan: do you think this might cause site compatibility issues, e.g. unintentional click events?
Assignee | ||
Comment 8•5 years ago
|
||
(In reply to Kohei Yoshino [:kohei] from comment #7)
Ehsan: do you think this might cause site compatibility issues, e.g. unintentional click events?
I hope it doesn't cause compatibility issues, since this should bring us on par (mostly) with how other browsers behave. But it is certainly possible (even if unlikely) for a site to UA sniff and then run some code only in Firefox which involves triggering an event on a form control which is detached from the document and depend on the event not getting triggered. That's why I added the site-compat keyword.
Comment 9•5 years ago
•
|
||
Okay, I’ll mention that in my site compat doc.
One thing I just noticed is, Firefox no longer opens a file picker when a detached <input type="file">
is clicked, because the hack has been removed with the patch. It seems this works in Chrome. Is this intentional or should I file a bug for that?
const input = document.createElement('input');
input.type = 'file';
input.click();
Assignee | ||
Comment 10•5 years ago
|
||
I think that's a non-intentional regression. Do you mind filing a bug for that please? Thanks!
Assignee | ||
Comment 11•5 years ago
|
||
(In reply to :ehsan akhgari from comment #10)
I think that's a non-intentional regression. Do you mind filing a bug for that please? Thanks!
To be clear I can't reproduce this... This test case seems to work in the latest Nightly for me: https://lateral-composer-7stw8wd42.glitch.me/
Comment 12•5 years ago
|
||
Sorry for a false alarm. Looks like my issue was unrelated to this change. I was running the snippet in the browser console, and somehow it doesn’t always work even on Firefox 73. The test case Ehsan provided works for me.
And finally posted a site compatibility note for this.
Comment 13•5 years ago
•
|
||
<deleted for being a lame question - sorry about that>
Comment 14•5 years ago
|
||
Documentation updated:
- Submitted BCD PR 5856
- Noted on Firefox 75 for developers
Description
•