Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FileList interface to HTML. #10693

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mkruisselbrink
Copy link
Contributor

@mkruisselbrink mkruisselbrink commented Oct 10, 2024

This interface really only exists for usage by DataTransfer and
<input type=file>, and its interface is driven by how it is (or should
be used) by those. As such, it makes more sense to be part of HTML
rather than FileAPI, as discussed at TPAC.

(See WHATWG Working Mode: Changes for more details.)


💥 Error: Wattsi server error 💥

PR Preview failed to build. (Last tried on Oct 10, 2024, 8:30 PM UTC).

More

PR Preview relies on a number of web services to run. There seems to be an issue with the following one:

🚨 Wattsi Server - Wattsi Server is the web service used to build the WHATWG HTML spec.

🔗 Related URL

Parsing MDN data...
Parsing...
Generating HTML variant...
Error: Multiple definitions for term "filelist" Parent of first says: "The FileList interface", parent of second says: "[Exposed=(Window,Worker), Serializable] interface FileList {   getter File? item(unsigned long index);   readonly attribute unsigned long length; };   "
Error count: 1
Saving index-html
Splitting...
Saving index.html
Saving introduction.html
Saving infrastructure.html
Saving common-microsyntaxes.html
Saving urls-and-fetching.html
Saving common-dom-interfaces.html
Saving structured-data.html
Saving dom.html
Saving semantics.html
Saving sections.html
Saving grouping-content.html
Saving text-level-semantics.html
Saving links.html
Saving edits.html
Saving embedded-content.html
Saving images.html
Saving iframe-embed-object.html
Saving media.html
Saving image-maps.html
Saving embedded-content-other.html
Saving tables.html
Saving forms.html
Saving input.html
Saving form-elements.html
Saving form-control-infrastructure.html
Saving interactive-elements.html
Saving scripting.html
Saving canvas.html
Saving custom-elements.html
Saving semantics-other.html
Saving microdata.html
Saving interaction.html
Saving dnd.html
Saving popover.html
Saving browsers.html
Saving nav-history-apis.html
Saving document-sequences.html
Saving browsing-the-web.html
Saving document-lifecycle.html
Saving webappapis.html
Saving dynamic-markup-insertion.html
Saving timers-and-user-prompts.html
Saving system-state.html
Saving imagebitmap-and-animations.html
Saving comms.html
Saving server-sent-events.html
Saving web-messaging.html
Saving workers.html
Saving worklets.html
Saving webstorage.html
Saving syntax.html
Saving parsing.html
Saving named-characters.html
Saving xhtml.html
Saving rendering.html
Saving obsolete.html
Saving iana.html
Saving indices.html
Saving references.html
Saving acknowledgements.html
Generating DEV variant...
Error: Multiple definitions for term "filelist" Parent of first says: "The FileList interface", parent of second says: "[Exposed=(Window,Worker), Serializable] interface FileList {   getter File? item(unsigned long index);   readonly attribute unsigned long length; };   "
Error count: 1
Splitting...
Saving index.html
Saving introduction.html
Saving infrastructure.html
Saving common-microsyntaxes.html
Saving urls-and-fetching.html
Saving common-dom-interfaces.html
Saving structured-data.html
Saving dom.html
Saving semantics.html
Saving sections.html
Saving grouping-content.html
Saving text-level-semantics.html
Saving links.html
Saving edits.html
Saving embedded-content.html
Saving images.html
Saving iframe-embed-object.html
Saving media.html
Saving image-maps.html
Saving embedded-content-other.html
Saving tables.html
Saving forms.html
Saving input.html
Saving form-elements.html
Saving form-control-infrastructure.html
Saving interactive-elements.html
Saving scripting.html
Saving canvas.html
Saving custom-elements.html
Saving semantics-other.html
Saving microdata.html
Saving interaction.html
Saving dnd.html
Saving popover.html
Saving browsers.html
Saving nav-history-apis.html
Saving document-sequences.html
Saving browsing-the-web.html
Saving document-lifecycle.html
Saving webappapis.html
Saving dynamic-markup-insertion.html
Saving timers-and-user-prompts.html
Saving system-state.html
Saving imagebitmap-and-animations.html
Saving comms.html
Saving server-sent-events.html
Saving web-messaging.html
Saving workers.html
Saving worklets.html
Saving webstorage.html
Saving syntax.html
Saving named-characters.html
Saving xhtml.html
Saving obsolete.html
Saving indices.html
Saving references.html
Saving acknowledgements.html
Generating SNAP variant...
Error: Multiple definitions for term "filelist" Parent of first says: "The FileList interface", parent of second says: "[Exposed=(Window,Worker), Serializable] interface FileList {   getter File? item(unsigned long index);   readonly attribute unsigned long length; };   "
Error count: 1
Saving index-snap

If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.

This interface really only exists for usage by DataTransfer and
<input type=file>, and its interface is driven by how it is (or
should be used) by those. As such, it makes more sense to be part
of HTML rather than FileAPI, as discussed at TPAC.
@mkruisselbrink
Copy link
Contributor Author

I think the build errors are because FileAPI still defines this type? Or I might be doing something wrong...

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix the build error, remove the cross-reference definition on line 3473:

     <li>The <dfn data-x-href="https://w3c.github.io/FileAPI/#filelist-section"><code>FileList</code></dfn> interface</li>

are:</p>

<ol>
<li><p>Set <var>serialized</var>.[[Files]] to an empty <span>list</span>.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: single-space indents, here and below.

<ol>
<li><p>Set <var>serialized</var>.[[Files]] to an empty <span>list</span>.</p>

<li><p><span data-x="list iterate">For each</span> <var>file</var> in <var>value</var>, append
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should loop through value's file list, here and below.

<li><p>Let <var>files</var> be <span>this</span>'s <span>files list</span>.</p></li>

<li><p>If <var>index</var> is greater than or equal to the <span data-x="list size">size</span>
of <var>files</var>, return null.</p></li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "then return null"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants