Last Comment Bug 662977 - File upload control needs a change event on drop
: File upload control needs a change event on drop
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Layout: Form Controls (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla7
Assigned To: Geoff Lankow (:darktrojan)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-08 17:01 PDT by Geoff Lankow (:darktrojan)
Modified: 2011-06-11 02:15 PDT (History)
2 users (show)
mounir: in‑testsuite?
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (1.24 KB, patch)
2011-06-08 19:14 PDT, Geoff Lankow (:darktrojan)
no flags Details | Diff | Splinter Review
patch (1.26 KB, patch)
2011-06-10 05:47 PDT, Geoff Lankow (:darktrojan)
bzbarsky: review+
Details | Diff | Splinter Review

Description Geoff Lankow (:darktrojan) 2011-06-08 17:01:28 PDT

    
Comment 1 Geoff Lankow (:darktrojan) 2011-06-08 19:14:32 PDT
Created attachment 538162 [details] [diff] [review]
patch
Comment 2 Boris Zbarsky [:bz] 2011-06-09 23:31:40 PDT
Is there a reason this isn't using mTextFrame->CheckFireOnChange() like the filepicker codepath?
Comment 3 Geoff Lankow (:darktrojan) 2011-06-10 05:47:49 PDT
Created attachment 538487 [details] [diff] [review]
patch

That reason might be "tried it, didn't work, found something that did". Turns out it was something else I was doing wrong. I told you I shouldn't hack layout.
Comment 4 Mounir Lamouri (:mounir) 2011-06-10 08:03:56 PDT
Geoff, maybe you could add a private SetFiles() (or the name you want) method doing all the file setting dance including the change event? Given that you basically copy-paste the code that is in CaptureMouseListener::MouseClick, I think it worth it.
Comment 5 Boris Zbarsky [:bz] 2011-06-10 10:28:43 PDT
Comment on attachment 538487 [details] [diff] [review]
patch

r=me, though bonus points for factoring the duplicated code out into a helper!
Comment 6 Geoff Lankow (:darktrojan) 2011-06-10 16:42:15 PDT
(In reply to comment #4)
> Geoff, maybe you could add a private SetFiles() (or the name you want)
> method doing all the file setting dance including the change event? Given
> that you basically copy-paste the code that is in
> CaptureMouseListener::MouseClick, I think it worth it.

I've just tried that, but they use different versions of nsHTMLInputElement::SetFiles. So I've given up.
Comment 7 Dão Gottwald [:dao] 2011-06-11 01:20:51 PDT
http://hg.mozilla.org/mozilla-central/rev/f47664f19b08

Note You need to log in before you can comment on or make changes to this bug.