implement xforms:upload for xul context

RESOLVED FIXED

Status

Core Graveyard
XForms
RESOLVED FIXED
11 years ago
9 months ago

People

(Reporter: surkov, Assigned: surkov)

Tracking

({fixed1.8.0.12, fixed1.8.1.4})

Trunk
fixed1.8.0.12, fixed1.8.1.4
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

9.11 KB, patch
smaug
: review+
Details | Diff | Splinter Review
1.26 KB, application/vnd.mozilla.xul+xml
Details
(Assignee)

Description

11 years ago
We need support upload for xul.
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.
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).
(Assignee)

Comment 3

11 years ago
(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.
(Assignee)

Comment 4

11 years ago
changing summary to better reflect bug is about.
Summary: upload for xul → implement xforms:upload for xul context
(Assignee)

Updated

10 years ago
Blocks: 367826
(Assignee)

Comment 5

10 years ago
Created attachment 256342 [details] [diff] [review]
patch
Attachment #256342 - Flags: review?(Olli.Pettay)
(Assignee)

Updated

10 years ago
Attachment #256342 - Flags: review?(aaronr)
(Assignee)

Updated

10 years ago
Status: NEW → ASSIGNED

Comment 6

10 years ago
(Just a note to myself; because upload is quite security sensitive, must be careful with the review.)

Comment 7

10 years ago
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
Attachment #256342 - Flags: review?(aaronr) → review+
(Assignee)

Comment 8

10 years ago
Comment on attachment 256342 [details] [diff] [review]
patch

firstly I guess I should fix Aaron's notions
Attachment #256342 - Flags: review?(Olli.Pettay)
(Assignee)

Comment 9

10 years ago
Created attachment 257379 [details] [diff] [review]
patch2

with fixed Aaron's comments
Attachment #256342 - Attachment is obsolete: true
Attachment #257379 - Flags: review?(Olli.Pettay)

Comment 10

10 years ago
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.)
(Assignee)

Comment 11

10 years ago
Created attachment 257472 [details]
testcase
(Assignee)

Comment 12

10 years ago
(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.

Updated

10 years ago
Attachment #257379 - Flags: review?(Olli.Pettay) → review+
(Assignee)

Comment 13

10 years ago
checked in on trunk
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Whiteboard: xf-to-branch

Comment 14

10 years ago
checked into 1.8 branch on 2007-04-12
checked into 1.8.0 branch on 2007-04-16
Keywords: fixed1.8.0.12, fixed1.8.1.4
Whiteboard: xf-to-branch
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.