Bug 18957 - Allow assignment to value attr of input[type=file] elements via ObjC DOM API
Summary: Allow assignment to value attr of input[type=file] elements via ObjC DOM API
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Enhancement
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2008-05-08 16:51 PDT by Todd Ditchendorf
Modified: 2022-08-11 10:06 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Todd Ditchendorf 2008-05-08 16:51:46 PDT
Given an HTML element in a DOM:

<input type="file">

AFAICT, you cannot programmatically set the value of the "value" attribute of this element via the ObjC DOM API. 

I understand that JavaScript is not allowed to set the value of the "value" attr due to security restrictions. But it seems that ObjC should be allowed to set this value attribute, as it wouldn't be a security risk, no?

thx!
Comment 1 Todd Ditchendorf 2008-05-08 16:55:31 PDT
My use case:

I am writing a WebKit-based desktop application, and I want users to be able to easily drag a local file to anywhere on the WebView, to add the file as the value of the 'value' attr of an <input type="file"> element in the current DOM.

I know that you can currently drop a file directly over the input element, but that *does* require a bit more dexterity, and does not work in the case where the input element may be currently hidden or scrolled out of view.

This enhancement would allow me to offer nicer usability.
Comment 2 mitz 2008-05-08 18:27:50 PDT
Maybe this can be better served by (extensions to) the DOM drag and drop API.
Comment 3 Mark Rowe (bdash) 2008-05-08 23:46:59 PDT
<rdar://problem/5923198>
Comment 4 Ahmad Saleem 2022-08-11 10:06:44 PDT
There are various enhancements in WebAPI and JavaScript use cases and in general across browsers, I think this can be achieved easily these days and this enhancement request can be marked as "RESOLVED WONTFIX".

Please reopen, if you think there is still gap in modern Web standards to achieve this and you can also raise such discussion of gaps in Standards or related WHATWG Github. Thanks!