Skip to content
Permalink
Browse files

Make <input type=file>.files settable

  • Loading branch information...
annevk committed Aug 2, 2017
1 parent 5ead2c6 commit 5dc7db2108656c9ce4b2dc7a8bb7dcde5c03afee
Showing with 24 additions and 11 deletions.
  1. +24 −11 source
35 source
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-input-dirName">dirName</span>;
[<span>CEReactions</span>] attribute boolean <span data-x="dom-fe-disabled">disabled</span>;
readonly attribute <span>HTMLFormElement</span>? <span data-x="dom-fae-form">form</span>;
readonly attribute <span>FileList</span>? <span data-x="dom-input-files">files</span>;
attribute <span>FileList</span>? <span data-x="dom-input-files">files</span>;
[<span>CEReactions</span>] attribute USVString <span data-x="dom-fs-formAction">formAction</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-fs-formEnctype">formEnctype</span>;
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-fs-formMethod">formMethod</span>;

</dd>

<dt><var>input</var> . <code subdfn data-x="dom-input-files">files</code> <!-- [ = <var>files</var> ] --></dt>
<dt><var>input</var> . <code subdfn data-x="dom-input-files">files</code> [ = <var>files</var> ]</dt>

<dd>


<p>Returns null if the control isn't a file control.</p>

<!--
<p>Can be set to an array of <code>File</code> or <code>Blob</code> instances.</p>-
-->
<p>Can be set to a <code>FileList</code> object to change the <span
data-x="concept-input-type-file-selected">selected files</span> of the form control. For
instance, as the result of a drag-and-drop operation.</p>

</dd>

<hr>

<p>The <dfn><code data-x="dom-input-files">files</code></dfn> IDL attribute allows scripts to
access the element's <span data-x="concept-input-type-file-selected">selected files</span>. On
getting, if the IDL attribute <span data-x="concept-input-apply">applies</span>, it must return a
<code>FileList</code> object that represents the current <span
access the element's <span data-x="concept-input-type-file-selected">selected files</span>.

<p>On getting, if the IDL attribute <span data-x="concept-input-apply">applies</span>, it must
return a <code>FileList</code> object that represents the current <span
data-x="concept-input-type-file-selected">selected files</span>. The same object must be returned
until the list of <span data-x="concept-input-type-file-selected">selected files</span> changes. If
the IDL attribute <span data-x="do not apply">does not apply</span>, then it must instead return
null. <ref spec=FILEAPI></p>
until the list of <span data-x="concept-input-type-file-selected">selected files</span> changes.
If the IDL attribute <span data-x="do not apply">does not apply</span>, then it must instead
return null. <ref spec=FILEAPI></p>

<p>On setting, it must run these steps:

<ol>
<li><p>If the IDL attribute <span data-x="do not apply">does not apply</span> or the given value
is null, then return.</p></li>
<!-- This is inconsistent with other attributes, but Chrome and Safari already shipped so doesn't
seem worth the churn. -->

<li><p>Replace the element's <span data-x="concept-input-type-file-selected">selected
files</span> with the given value.</p></li>
</ol>

<hr>

0 comments on commit 5dc7db2

Please sign in to comment.
You can’t perform that action at this time.