Closed
Bug 786172
Opened 12 years ago
Closed 12 years ago
change event not fired for file dropped on file select box
Categories
(Core :: Layout: Form Controls, defect)
Tracking
()
VERIFIED
FIXED
mozilla18
People
(Reporter: cvwillegen, Assigned: drexler)
References
Details
(Keywords: regression, testcase, Whiteboard: [mentor=mounir][lang=c++])
Attachments
(2 files, 1 obsolete file)
184 bytes,
text/html
|
Details | |
2.18 KB,
patch
|
mounir
:
review+
akeybl
:
approval-mozilla-aurora+
akeybl
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
For an example of a page showing the behaviour, see http://jsfiddle.net/7wR2L/
Drop a file onto the file select box. The change event is not triggered.
A few versions of FireFox ago, the change event did fire (I wrote a GreaseMonkey script using an .onchange handler some time ago, at that time the event did fire).
![]() |
||
Comment 1•12 years ago
|
||
Regression window(m-c)
Good:
http://hg.mozilla.org/mozilla-central/rev/333626f688a4
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/15.0 Firefox/15.0a1 ID:20120507160328
Bad:
http://hg.mozilla.org/mozilla-central/rev/fafd873d469c
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/15.0 Firefox/15.0a1 ID:20120507174628
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=333626f688a4&tochange=fafd873d469c
Regression window(m-i)
Good:
http://hg.mozilla.org/integration/mozilla-inbound/rev/97bef33bf606
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/15.0 Firefox/15.0a1 ID:20120507095528
Bad:
http://hg.mozilla.org/integration/mozilla-inbound/rev/14aa9de6287f
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/15.0 Firefox/15.0a1 ID:20120507100429
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=97bef33bf606&tochange=14aa9de6287f
Triggered by:
ba79daeeb874 Andrew Quartey — Bug 722599 - Move change event firing to content from layout r=mounir
![]() |
||
Updated•12 years ago
|
Blocks: 722599
Status: UNCONFIRMED → NEW
tracking-firefox16:
--- → ?
tracking-firefox17:
--- → ?
tracking-firefox18:
--- → ?
Component: Untriaged → Layout: Form Controls
Ever confirmed: true
Keywords: regression
OS: Mac OS X → All
Product: Firefox → Core
Updated•12 years ago
|
Assignee: nobody → andrew.quartey
Comment 2•12 years ago
|
||
Andrew, if you don't have time to look into this just shout and we'll figure something out.
Comment 3•12 years ago
|
||
This sounds worse than the regressing bug 722599. Does that match other peoples' expectations? One alternative to properly fixing would be to back out bug 722599.
Comment 4•12 years ago
|
||
The issue is that nsHTMLInputElement::FireChangeEventIfNeeded() is assuming that it should only work for single line text control which a text field isn't. I wrote a quick patch changing that and it did work. However, it's not as trivial given that mFocusedValue has to be modified in consequence.
Whiteboard: [mentor=mounir][lang=c++]
Assignee | ||
Comment 5•12 years ago
|
||
Just noticed this. I'll be looking into it.
Assignee | ||
Comment 7•12 years ago
|
||
Passed local tests. Sent to try: https://tbpl.mozilla.org/?tree=Try&rev=fd1fe7c26eeb. Left out appending a test for this. I looked at using sythesizeDrop: https://mxr.mozilla.org/mozilla-central/source/services/sync/tps/extensions/mozmill/resource/stdlib/EventUtils.js#530 but that fell short as i would need to simulate a dragging and dropping a local file - which i can easily QI to obtain it. Mounir ideas??
Attachment #659942 -
Flags: review?(mounir)
Comment 8•12 years ago
|
||
Comment on attachment 659942 [details] [diff] [review]
patch
Review of attachment 659942 [details] [diff] [review]:
-----------------------------------------------------------------
Your patch is full of trailing whitespaces. Please, make sure to remove them. You might want to configure your editor to have them being highlighted.
I think the solution you are proposing here might work but is a bit hacky. Maybe the best way to do this is to fire the change event from the layout.
You could do:
nsContentUtils::DispatchTrustedEvent(content->OwnerDoc(), content,
NS_LITERAL_STRING("change"), true, false);
instead of calling:
FireChangeEventIfNeeded()
in nsFileControlFrame.cpp.
Attachment #659942 -
Flags: review?(mounir) → review-
Comment 9•12 years ago
|
||
(In reply to Andrew Quartey [:drexler] from comment #7)
> Created attachment 659942 [details] [diff] [review]
> patch
>
> Passed local tests. Sent to try:
> https://tbpl.mozilla.org/?tree=Try&rev=fd1fe7c26eeb. Left out appending a
> test for this. I looked at using sythesizeDrop:
> https://mxr.mozilla.org/mozilla-central/source/services/sync/tps/extensions/
> mozmill/resource/stdlib/EventUtils.js#530 but that fell short as i would
> need to simulate a dragging and dropping a local file - which i can easily
> QI to obtain it. Mounir ideas??
Regarding the tests, I'm not sure this can easily be done. I never tried sythesizeDrop for a file picker but it's clearly not working well enough for a text field.
You can try with sythesizeDrop and see how far you can go though.
Assignee | ||
Comment 10•12 years ago
|
||
(In reply to Mounir Lamouri (:mounir) from comment #8)
> I think the solution you are proposing here might work but is a bit hacky.
> Maybe the best way to do this is to fire the change event from the layout.
Firing from layout seemed the obvious solution but then again with regards to bug 722599, isn't content meant to handle this rather than moving it back to layout?
Comment 11•12 years ago
|
||
(In reply to Andrew Quartey [:drexler] from comment #10)
> (In reply to Mounir Lamouri (:mounir) from comment #8)
>
> > I think the solution you are proposing here might work but is a bit hacky.
> > Maybe the best way to do this is to fire the change event from the layout.
>
> Firing from layout seemed the obvious solution but then again with regards
> to bug 722599, isn't content meant to handle this rather than moving it back
> to layout?
Given that the changes actually happens from the layout (ie. if there is no layout, you can't do that change), I wouldn't be shocked to have the change event fired from the layout.
I don't know if we should move that to the content in the future but for the moment, lets move that event back to the layout. (for example, SetFiles() could fire the event)
Assignee | ||
Comment 12•12 years ago
|
||
Fires the change event from layout. Passed locally; sent to Try: https://tbpl.mozilla.org/?tree=Try&rev=ab10a84f9bbb
Attachment #659942 -
Attachment is obsolete: true
Attachment #660526 -
Flags: review?(mounir)
Updated•12 years ago
|
Attachment #660526 -
Flags: review?(mounir) → review+
Comment 13•12 years ago
|
||
Andrew, do you need me to push this to mozilla-inbound for you?
Comment 14•12 years ago
|
||
Try run for ab10a84f9bbb is complete.
Detailed breakdown of the results available here:
https://tbpl.mozilla.org/?tree=Try&rev=ab10a84f9bbb
Results (out of 196 total builds):
success: 178
warnings: 16
failure: 2
Builds (or logs if builds failed) available at:
http://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/andrew.quartey@gmail.com-ab10a84f9bbb
Assignee | ||
Comment 15•12 years ago
|
||
Status: NEW → ASSIGNED
Comment 16•12 years ago
|
||
If we don't see any regression reports over the weekend, please nominate for uplift to Aurora/Beta Monday with a risk evaluation. If we don't land in time for Beta 4 on Tuesday or this is risky, we'll have to first fix in FF17.
Comment 17•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
status-firefox18:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
Comment 18•12 years ago
|
||
Comment on attachment 660526 [details] [diff] [review]
patch
[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 722599
User impact if declined: change event will not be fired when using the file picker
Risk to taking this patch (and alternatives if risky): risks are very small given that this patch only changes the way the change event is fired from the file picker layout to make it quite explicit and direct instead of going trough the content.
String or UUID changes made by this patch: none
Attachment #660526 -
Flags: approval-mozilla-beta?
Attachment #660526 -
Flags: approval-mozilla-aurora?
Comment 19•12 years ago
|
||
Comment on attachment 660526 [details] [diff] [review]
patch
[Triage Comment]
Low risk fix for a FF15 regression - approving for branches.
Attachment #660526 -
Flags: approval-mozilla-beta?
Attachment #660526 -
Flags: approval-mozilla-beta+
Attachment #660526 -
Flags: approval-mozilla-aurora?
Attachment #660526 -
Flags: approval-mozilla-aurora+
Comment 20•12 years ago
|
||
(please land today or tomorrow morning to make it into the next beta build)
Comment 21•12 years ago
|
||
Landed in Aurora: http://hg.mozilla.org/releases/mozilla-aurora/rev/337bb2250bd2
Landed in Beta: http://hg.mozilla.org/releases/mozilla-beta/rev/bbe608b96368
status-firefox16:
--- → fixed
status-firefox17:
--- → fixed
Comment 22•12 years ago
|
||
Verified on Firefox 16 beta 4 by following the steps from the Description and the sample from comment 1 that the change event is fired for the files dropped on file select box.
Mozilla/5.0 (Windows NT 6.1; rv:16.0) Gecko/20100101 Firefox/16.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:16.0) Gecko/20100101 Firefox/16.0
Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20100101 Firefox/16.0
QA Contact: simona.marcu
Reporter | ||
Comment 23•12 years ago
|
||
Verified as working in my own situation as well.
status-firefox16:
verified → ---
status-firefox17:
fixed → ---
Updated•12 years ago
|
status-firefox16:
--- → verified
status-firefox17:
--- → fixed
Comment 24•12 years ago
|
||
Verified on Firefox 17 beta 1 that the change event is fired for the files dropped on file select box.
Verified on Windows 7, Ubuntu 12.04 and Mac OS X 10.7:
Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/17.0 Firefox/17.0
Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Firefox/17.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Firefox/17.0
Updated•12 years ago
|
Assignee: andrew.quartey → simona.marcu
Updated•12 years ago
|
Assignee: simona.marcu → andrew.quartey
Comment 25•12 years ago
|
||
Verified on Firefox 18 beta 2 on Windows 7 x64, Ubuntu x32 and Mac OS X 10.8 and for all platforms it works as requested. It looks like this issue is no longer reproducible as it hadn't done on FF 17 too from comment 24 .
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0 (20121128060531)
Mozilla/5.0 (X11; Linux i686; rv:18.0) Gecko/20100101 Firefox/18.0 (20121128060531)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:18.0) Gecko/20100101 Firefox/18.0 (20121128060531)
Please someone with permission set firefox18 flag as verified.
Comment 26•12 years ago
|
||
Thank you for the help Mario.
You need to log in
before you can comment on or make changes to this bug.
Description
•