Closed
Bug 1371121
Opened 7 years ago
Closed 7 years ago
Date chooser breaks when clicking between input in iframe
Categories
(Core :: Layout: Form Controls, defect, P1)
Tracking
()
VERIFIED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox56 | --- | verified |
People
(Reporter: jtojnar, Assigned: jessica)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
190 bytes,
text/html
|
Details | |
1.50 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
Steps to reproduce: 1. Click a date input outside the frame 2. Click a date input inside the frame 3. Click a date input outside the frame 4. Click a date input inside the frame Expected behaviour: Date chooser will open. Actual behaviour: Date chooser is not opened. Frames are commonly used by jsfiddle where I first noticed this. There are actually many variations on the bug, looks like state management gone wrong.
Reporter | ||
Updated•7 years ago
|
Blocks: datetime-bugs
Assignee | ||
Comment 2•7 years ago
|
||
I found that this is because we check document.activeElement on blur event handler [1], and if document.activeElement is still the input element, we do nothing and early return. If date input is inside an iframe, when you click outside the iframe, the iframe and the input element is no longer focused, but document.activeElement inside the iframe is still the input element, hence we early return and the state of the picker is wrong after that. I think we may need to extra check if the input is inside an iframe and if the iframe has focus or not. Or maybe we can just remove this part [1], since it looks like it's not possible to call .focus() on blur event handler. Olli, what do you think? [1] http://searchfox.org/mozilla-central/rev/61054508641ee76f9c49bcf7303ef3cfb6b410d2/toolkit/content/widgets/datetimebox.xml#1612-1613
Flags: needinfo?(bugs)
Comment 3•7 years ago
|
||
Hmm, how do we prevent calling .focus() in while handling blur, but looks like that is somehow happening data:text/html,<input id="a" onblur="this.nextSibling.focus();" placeholder="Focus me"><input id="b" onfocus="this.previousSibling.focus();"><input id="c" placeholder="and then click me"> But I think I could live without the activeElement check after all.
Flags: needinfo?(bugs)
Comment 4•7 years ago
|
||
I'd still like to understand what prevents re-focusing in blur. I couldn't immediately see it
Assignee | ||
Comment 5•7 years ago
|
||
We prevent re-focusing in blur here [1]. However, focusing another element is valid, data:text/html,<input id="a" onblur="this.nextSibling.focus();" placeholder="Focus me"><input id="b" onfocus="this.previousSibling.focus();"><input id="c" placeholder="and then click me"> so in this case, focusing "a" and then clicking "c", I get: focus a blur a focus b blur b focus c [1] http://searchfox.org/mozilla-central/rev/d67ef71097da4d1aa344c9d9c672e49a7228e765/dom/base/nsFocusManager.cpp#1817-1818
Assignee | ||
Comment 6•7 years ago
|
||
Attachment #8877493 -
Flags: review?(bugs)
Updated•7 years ago
|
Attachment #8877493 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 7•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=74ec11c8bf52302868b2ab2eac88d540fcc34117&group_state=expanded
Keywords: checkin-needed
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → jjong
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/7537cb5329c4 [DateTimeInput] Remove activeElement check in blur event handler. r=smaug
Keywords: checkin-needed
Comment 9•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7537cb5329c4
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Comment 10•7 years ago
|
||
Verified as fixed using the latest Nightly 56.0a1 (2017-07-09) on Ubuntu 16.04, Mac OS X 10.12 and Windows 10 x64.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•