Last Comment Bug 347563 - implement xforms:upload for xul context
: implement xforms:upload for xul context
Status: RESOLVED FIXED
: fixed1.8.0.12, fixed1.8.1.4
Product: Core Graveyard
Classification: Graveyard
Component: XForms (show other bugs)
: Trunk
: All All
-- normal (vote)
: ---
Assigned To: alexander :surkov
: Stephen Pride
:
Mentors:
Depends on:
Blocks: 327236 367826
  Show dependency treegraph
 
Reported: 2006-08-05 14:29 PDT by alexander :surkov
Modified: 2016-07-15 14:46 PDT (History)
6 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch (6.41 KB, patch)
2007-02-25 04:19 PST, alexander :surkov
aaronr: review+
Details | Diff | Splinter Review
patch2 (9.11 KB, patch)
2007-03-05 09:33 PST, alexander :surkov
bugs: review+
Details | Diff | Splinter Review
testcase (1.26 KB, application/vnd.mozilla.xul+xml)
2007-03-05 20:54 PST, alexander :surkov
no flags Details

Description User image alexander :surkov 2006-08-05 14:29:39 PDT
We need support upload for xul.
Comment 1 User image Alex Vincent [:WeirdAl] 2006-08-05 14:33:07 PDT
What sort of support do you have in mind?  I wrote the serverpost widget for actually submitting from XUL to a server (xulwidgets.mozdev.org), but in terms of file uploads, that means a file picker.
Comment 2 User image Alex Vincent [:WeirdAl] 2006-08-05 14:34:07 PDT
Also, is this properly a XForms bug?  It might best belong in Toolkit for XUL widgets (where neil & jag, our UI gurus, can eyeball it).
Comment 3 User image alexander :surkov 2006-08-05 22:49:52 PDT
(In reply to comment #2)
> Also, is this properly a XForms bug?  It might best belong in Toolkit for XUL
> widgets (where neil & jag, our UI gurus, can eyeball it).
> 

Alex, sorry for ambiguous. The bug is upload should be implemented for xforms that are hosted in xul document (http://www.w3.org/TR/xforms/slice8.html#ui-upload).

I'm not sure really whether should be xul:upload control or not.
Comment 4 User image alexander :surkov 2006-08-05 22:56:36 PDT
changing summary to better reflect bug is about.
Comment 5 User image alexander :surkov 2007-02-25 04:19:22 PST
Created attachment 256342 [details] [diff] [review]
patch
Comment 6 User image Olli Pettay [:smaug] (pto-ish for couple of days) 2007-02-25 04:27:37 PST
(Just a note to myself; because upload is quite security sensitive, must be careful with the review.)
Comment 7 User image aaronr 2007-03-02 19:45:37 PST
Comment on attachment 256342 [details] [diff] [review]
patch

>Index: extensions/xforms/resources/content/xforms-xul.xml
>===================================================================

>+  <!-- UPLOAD: DISABLED -->
>+  <binding id="xformswidget-upload-disabled"
>+           extends="chrome://xforms/content/xforms.xml#xformswidget-upload-base">
>+    <content>
>+      <children includes="label"/>
>+      <xul:textbox anonid="text_control"
>+                   class="xf-value"
>+                   readonly="readonly"
>+                   tabindex="-1"/>
>+      <xul:button anonid="browse_button"
>+                   xbl:inherits="tabindex"
>+                   label="&xforms.upload.browsetext;"/>
>+      <xul:button anonid="clear_button"
>+                   xbl:inherits="tabindex"
>+                   label="&xforms.upload.cleartext;"/>

don't you need to disable the buttons?

>+      <children/>
>+    </content>
>+
>+    <implementation>
>+      <method name="getControlElement">
>+        <body>
>+          return {
>+            get value(){ return ""; },
>+            set value(val){},
>+            set readonly(val){},
>+            focus: function(){}
>+          };
>+        </body>
>+      </method>
>+    </implementation>
>+  </binding>
>+

I would vote that you have the xul upload extend the xhtml one or vice versa, then you only have to define getControlElement once.  Just the anonymous content needs to be different.

with those, r=me
Comment 8 User image alexander :surkov 2007-03-04 19:21:37 PST
Comment on attachment 256342 [details] [diff] [review]
patch

firstly I guess I should fix Aaron's notions
Comment 9 User image alexander :surkov 2007-03-05 09:33:51 PST
Created attachment 257379 [details] [diff] [review]
patch2

with fixed Aaron's comments
Comment 10 User image Olli Pettay [:smaug] (pto-ish for couple of days) 2007-03-05 11:43:06 PST
I'd like to see a testcase for this too ;)
(And I'm still trying figure out whether it is possible to use
scripts to change the file to be uploaded. I hope not.)
Comment 11 User image alexander :surkov 2007-03-05 20:54:09 PST
Created attachment 257472 [details]
testcase
Comment 12 User image alexander :surkov 2007-03-05 20:57:29 PST
(In reply to comment #10)
> I'd like to see a testcase for this too ;)
> (And I'm still trying figure out whether it is possible to use
> scripts to change the file to be uploaded. I hope not.)
> 

Why not, just use nsIXFormsAccessors::setValue() ;). But in any way I believe security related issue shouldn't deal with this bug.
Comment 13 User image alexander :surkov 2007-03-08 07:13:23 PST
checked in on trunk
Comment 14 User image aaronr 2007-04-23 16:16:54 PDT
checked into 1.8 branch on 2007-04-12
checked into 1.8.0 branch on 2007-04-16

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