Skip to content

Commit ea67bde

Browse files
authored
Editorial: spell filename as a single word
Context: whatwg/whatwg.org#355.
1 parent 3ffa1ba commit ea67bde

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

source

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -21673,7 +21673,7 @@ interface <dfn>HTMLTimeElement</dfn> : <span>HTMLElement</span> {
2167321673
</dl>
2167421674

2167521675
<p>The <code>code</code> element <span>represents</span> a fragment of computer code. This could
21676-
be an XML element name, a file name, a computer program, or any other string that a computer would
21676+
be an XML element name, a filename, a computer program, or any other string that a computer would
2167721677
recognize.</p>
2167821678

2167921679
<p>There is no formal way to indicate the language of computer code being marked up. Authors who
@@ -22858,10 +22858,10 @@ document.body.appendChild(wbr);</code></pre>
2285822858
<p>The <dfn element-attr for="a,area"><code data-x="attr-hyperlink-download">download</code></dfn>
2285922859
attribute, if present, indicates that the author intends the hyperlink to be used for <span
2286022860
data-x="downloading hyperlinks">downloading a resource</span>. The attribute may have a value; the
22861-
value, if any, specifies the default file name that the author recommends for use in labeling the
22861+
value, if any, specifies the default filename that the author recommends for use in labeling the
2286222862
resource in a local file system. There are no restrictions on allowed values, but authors are
2286322863
cautioned that most file systems have limitations with regard to what punctuation is supported in
22864-
file names, and user agents are likely to adjust file names accordingly.</p>
22864+
filenames, and user agents are likely to adjust filenames accordingly.</p>
2286522865

2286622866

2286722867
<p>The <dfn id="ping" data-x="attr-hyperlink-ping"><code>ping</code></dfn> attribute, if present,
@@ -23551,7 +23551,7 @@ document.body.appendChild(wbr);</code></pre>
2355123551
<code>a</code> or <code>area</code> element that creates the <span>hyperlink</span> to that
2355223552
resource.</p>
2355323553

23554-
<p>The attribute can furthermore be given a value, to specify the file name that user agents are
23554+
<p>The attribute can furthermore be given a value, to specify the filename that user agents are
2355523555
to use when storing the resource in a file system. This value can be overridden by the `<code
2355623556
data-x="http-content-disposition">Content-Disposition</code>` HTTP header's filename parameters.
2355723557
<ref spec=RFC6266></p>
@@ -23632,7 +23632,7 @@ document.body.appendChild(wbr);</code></pre>
2363223632
successfully obtained. Otherwise, it should report any problems downloading the file to the
2363323633
user.</p>
2363423634

23635-
<p>If the user agent needs a file name for a resource being handled <span>as a download</span>, it
23635+
<p>If the user agent needs a filename for a resource being handled <span>as a download</span>, it
2363623636
should select one using the following algorithm.</p>
2363723637

2363823638
<p class="warning">This algorithm is intended to mitigate security dangers involved in downloading
@@ -23645,8 +23645,8 @@ document.body.appendChild(wbr);</code></pre>
2364523645
<!-- Content-Disposition: attachment; filename="" is always honoured, even cross-origin -->
2364623646
<li><p>If the resource has a `<code data-x="http-content-disposition">Content-Disposition</code>`
2364723647
header, that header specifies the <code data-x="">attachment</code> disposition type, and the
23648-
header includes file name information, then let <var>filename</var> have the value
23649-
specified by the header, and jump to the step labeled <i>sanitize</i> below. <ref spec=RFC6266></p></li>
23648+
header includes filename information, then let <var>filename</var> have the value specified by
23649+
the header, and jump to the step labeled <i>sanitize</i> below. <ref spec=RFC6266></p></li>
2365023650

2365123651
<li><p>Let <var>interface origin</var> be the <span
2365223652
data-x="concept-document-origin">origin</span> of the <code>Document</code> in which the <span
@@ -23664,16 +23664,16 @@ document.body.appendChild(wbr);</code></pre>
2366423664

2366523665
<!-- Content-Disposition: *; filename="" overrides download="" for same-origin -->
2366623666
<li><p>If <var>trusted operation</var> is true and the resource has a `<code
23667-
data-x="http-content-disposition">Content-Disposition</code>` header and that header includes file
23668-
name information, then let <var>filename</var> have the value specified by the header,
23669-
and jump to the step labeled <i>sanitize</i> below. <ref spec=RFC6266></p></li>
23667+
data-x="http-content-disposition">Content-Disposition</code>` header and that header includes
23668+
filename information, then let <var>filename</var> have the value specified by the header, and
23669+
jump to the step labeled <i>sanitize</i> below. <ref spec=RFC6266></p></li>
2367023670

2367123671
<li><p>If the download was not initiated from a <span>hyperlink</span> created by an
2367223672
<code>a</code> or <code>area</code> element, or if the element of the <span>hyperlink</span> from
2367323673
which it was initiated did not have a <code data-x="attr-hyperlink-download">download</code>
2367423674
attribute when the download was initiated, or if there was such an attribute but its value when
2367523675
the download was initiated was the empty string, then jump to the step labeled <i>no proposed
23676-
file name</i>.</p></li>
23676+
filename</i>.</p></li>
2367723677

2367823678
<li><p>Let <var>proposed filename</var> have the value of the <code
2367923679
data-x="attr-hyperlink-download">download</code> attribute of the element of the
@@ -23692,16 +23692,16 @@ document.body.appendChild(wbr);</code></pre>
2369223692
header and that header specifies the <code data-x="">attachment</code> disposition type, let <var>filename</var> have the value of <var>proposed filename</var>, and jump to the
2369323693
step labeled <i>sanitize</i> below. <ref spec=RFC6266></p></li>
2369423694

23695-
<!-- fallback for same-origin resources or explicit downloads: use the resource's file name -->
23696-
<li><p><i>No proposed file name</i>: If <var>trusted operation</var> is true, or if the
23695+
<!-- fallback for same-origin resources or explicit downloads: use the resource's filename -->
23696+
<li><p><i>No proposed filename</i>: If <var>trusted operation</var> is true, or if the
2369723697
user indicated a preference for having the resource in question downloaded, let
2369823698
<var>filename</var> have a value derived from the <span>URL</span> of the resource in an
2369923699
<span>implementation-defined</span> manner, and jump to the step labeled <i>sanitize</i> below.</p></li>
2370023700

2370123701
<!-- no C-D: a header on cross-origin raises red flags -->
2370223702
<li>
23703-
<p>Let <var>filename</var> be set to the user's preferred file name or to a file name selected
23704-
by the user agent, and jump to the step labeled <i>sanitize</i> below.</p>
23703+
<p>Let <var>filename</var> be set to the user's preferred filename or to a filename selected by
23704+
the user agent, and jump to the step labeled <i>sanitize</i> below.</p>
2370523705

2370623706
<div class="warning">
2370723707

@@ -23716,26 +23716,26 @@ document.body.appendChild(wbr);</code></pre>
2371623716
by tricking the user into thinking the data is from the hostile server.</p>
2371723717

2371823718
<p>Thus, it is in the user's interests that the user be somehow notified that the resource in
23719-
question comes from quite a different source, and to prevent confusion, any suggested file name
23719+
question comes from quite a different source, and to prevent confusion, any suggested filename
2372023720
from the potentially hostile <var>interface origin</var> should be ignored.</p>
2372123721

2372223722
</div>
2372323723
</li>
2372423724

2372523725
<li><p><i>Sanitize</i>: Optionally, allow the user to influence <var>filename</var>. For
23726-
example, a user agent could prompt the user for a file name, potentially providing the value of
23726+
example, a user agent could prompt the user for a filename, potentially providing the value of
2372723727
<var>filename</var> as determined above as a default value.</p></li>
2372823728

2372923729
<li>
2373023730
<p>Adjust <var>filename</var> to be suitable for the local file system.</p>
2373123731

2373223732
<p class="example">For example, this could involve removing characters that are not legal in
23733-
file names, or trimming leading and trailing whitespace.</p>
23733+
filenames, or trimming leading and trailing whitespace.</p>
2373423734
</li>
2373523735

2373623736
<li><p>If the platform conventions do not in any way use <span
2373723737
data-x="concept-extension">extensions</span> to determine the types of file on the file system,
23738-
then return <var>filename</var> as the file name.</p></li>
23738+
then return <var>filename</var> as the filename.</p></li>
2373923739

2374023740
<li><p>Let <var>claimed type</var> be the type given by the resource's <span
2374123741
data-x="Content-Type">Content-Type metadata</span>, if any is known. Let <var>named
@@ -23744,14 +23744,14 @@ document.body.appendChild(wbr);</code></pre>
2374423744
<i>type</i> is a mapping of a <span>MIME type</span> to an <span
2374523745
data-x="concept-extension">extension</span>.</p></li>
2374623746

23747-
<li><p>If <var>named type</var> is consistent with the user's preferences (e.g. because
23748-
the value of <var>filename</var> was determined by prompting the user), then return <var>filename</var> as the file name.</p></li>
23747+
<li><p>If <var>named type</var> is consistent with the user's preferences (e.g., because the
23748+
value of <var>filename</var> was determined by prompting the user), then return
23749+
<var>filename</var> as the filename.</p></li>
2374923750

23750-
<li><p>If <var>claimed type</var> and <var>named type</var> are the same type
23751-
(i.e. the type given by the resource's <span data-x="Content-Type">Content-Type metadata</span> is
23752-
consistent with the type given by <var>filename</var>'s <span
23753-
data-x="concept-extension">extension</span>), then return <var>filename</var> as the file
23754-
name.</p></li>
23751+
<li><p>If <var>claimed type</var> and <var>named type</var> are the same type (i.e., the type
23752+
given by the resource's <span data-x="Content-Type">Content-Type metadata</span> is consistent
23753+
with the type given by <var>filename</var>'s <span data-x="concept-extension">extension</span>),
23754+
then return <var>filename</var> as the filename.</p></li>
2375523755

2375623756
<li>
2375723757
<p>If the <var>claimed type</var> is known, then alter <var>filename</var> to
@@ -23768,14 +23768,14 @@ document.body.appendChild(wbr);</code></pre>
2376823768
matter.</p>
2376923769
</li>
2377023770

23771-
<li><p>Return <var>filename</var> as the file name.</p></li>
23771+
<li><p>Return <var>filename</var> as the filename.</p></li>
2377223772
</ol>
2377323773

2377423774
<p>For the purposes of this algorithm, a file <dfn data-x="concept-extension">extension</dfn>
23775-
consists of any part of the file name that platform conventions dictate will be used for
23776-
identifying the type of the file. For example, many operating systems use the part of the file
23777-
name following the last dot ("<code data-x="">.</code>") in the file name to determine the type of
23778-
the file, and from that the manner in which the file is to be opened or executed.</p>
23775+
consists of any part of the filename that platform conventions dictate will be used for
23776+
identifying the type of the file. For example, many operating systems use the part of the filename
23777+
following the last dot ("<code data-x="">.</code>") in the filename to determine the type of the
23778+
file, and from that the manner in which the file is to be opened or executed.</p>
2377923779

2378023780
<p>User agents should ignore any directory or path information provided by the resource itself,
2378123781
its <span>URL</span>, and any <code data-x="attr-hyperlink-download">download</code> attribute, in
@@ -29929,7 +29929,7 @@ href="?audio">audio&lt;/a> test instead.)&lt;/p></code></pre>
2992929929
egregious error of providing phony alternative text, because state-of-the-art automated
2993029930
conformance checkers cannot distinguish phony alternative text from correct alternative text.</p>
2993129931

29932-
<p>Markup generators should generally avoid using the image's own file name as the alternative
29932+
<p>Markup generators should generally avoid using the image's own filename as the alternative
2993329933
text. Similarly, markup generators should avoid generating alternative text from any content that
2993429934
will be equally available to presentation user agents (e.g., web browsers).</p>
2993529935

@@ -43792,7 +43792,7 @@ interface <dfn>HTMLInputElement</dfn> : <span>HTMLElement</span> {
4379243792
<tr>
4379343793
<td> <dfn><code data-x="attr-input-type-file-keyword">file</code></dfn>
4379443794
<td> <span data-x="attr-input-type-file">File Upload</span>
43795-
<td> Zero or more files each with a <span>MIME type</span> and optionally a file name
43795+
<td> Zero or more files each with a <span>MIME type</span> and optionally a filename
4379643796
<td> A label and a button
4379743797
<tr>
4379843798
<td> <dfn><code data-x="attr-input-type-submit-keyword">submit</code></dfn>
@@ -47618,16 +47618,16 @@ ldh-str = &lt; as defined in <a href="https://tools.ietf.org/html/rfc1034#
4761847618
</div>
4761947619

4762047620
<p>The <code>input</code> element <span>represents</span> a list of <dfn
47621-
data-x="concept-input-type-file-selected">selected files</dfn>, each file consisting of a file
47622-
name, a file type, and a file body (the contents of the file).</p>
47621+
data-x="concept-input-type-file-selected">selected files</dfn>, each file consisting of a
47622+
filename, a file type, and a file body (the contents of the file).</p>
4762347623

4762447624
<div w-nodev>
4762547625

47626-
<p>File names must not contain <span data-x="concept-input-file-path">path components</span>, even
47626+
<p>Filenames must not contain <span data-x="concept-input-file-path">path components</span>, even
4762747627
in the case that a user has selected an entire directory hierarchy or multiple files with the same
4762847628
name from different directories. <dfn data-x="concept-input-file-path">Path components</dfn>, for
4762947629
the purposes of the <span data-x="attr-input-type-file">File Upload</span> state, are those parts
47630-
of file names that are separated by U+005C REVERSE SOLIDUS character (\) characters.</p>
47630+
of filenames that are separated by U+005C REVERSE SOLIDUS character (\) characters.</p>
4763147631

4763247632
<p>Unless the <code data-x="attr-input-multiple">multiple</code> attribute is set, there must be
4763347633
no more than one file in the list of <span data-x="concept-input-type-file-selected">selected
@@ -47759,7 +47759,7 @@ ldh-str = &lt; as defined in <a href="https://tools.ietf.org/html/rfc1034#
4775947759
<p>On platforms that only use file extensions to describe file types, the extensions listed here
4776047760
can be used to filter the allowed documents, while the MIME types can be used with the system's
4776147761
type registration table (mapping MIME types to extensions used by the system), if any, to
47762-
determine any other extensions to allow. Similarly, on a system that does not have file names or
47762+
determine any other extensions to allow. Similarly, on a system that does not have filenames or
4776347763
extensions but labels documents with MIME types internally, the MIME types can be used to pick
4776447764
the allowed files, while the extensions can be used if the system has an extension registration
4776547765
table that maps known extensions to MIME types used by the system.</p>
@@ -47778,10 +47778,10 @@ ldh-str = &lt; as defined in <a href="https://tools.ietf.org/html/rfc1034#
4777847778
<div class="example" id="fakepath-srsly">
4777947779

4778047780
<p>For historical reasons, the <code data-x="dom-input-value">value</code> IDL attribute prefixes
47781-
the file name with the string "<code data-x="">C:\fakepath\</code>". Some legacy user agents
47781+
the filename with the string "<code data-x="">C:\fakepath\</code>". Some legacy user agents
4778247782
actually included the full path (which was a security vulnerability). As a result of this,
47783-
obtaining the file name from the <code data-x="dom-input-value">value</code> IDL attribute in a
47784-
backwards-compatible way is non-trivial. The following function extracts the file name in a
47783+
obtaining the filename from the <code data-x="dom-input-value">value</code> IDL attribute in a
47784+
backwards-compatible way is non-trivial. The following function extracts the filename in a
4778547785
suitably compatible manner:</p>
4778647786

4778747787
<pre><code class="js">function extractFilename(path) {
@@ -47794,7 +47794,7 @@ ldh-str = &lt; as defined in <a href="https://tools.ietf.org/html/rfc1034#
4779447794
x = path.lastIndexOf('\\');
4779547795
if (x >= 0) // Windows-based path
4779647796
return path.substr(x+1);
47797-
return path; // just the file name
47797+
return path; // just the filename
4779847798
}</code></pre>
4779947799

4780047800
<p>This can be used as follows:</p>
@@ -49459,7 +49459,7 @@ You cannot submit this form when the field is incorrect.</samp></pre>
4945949459
information.</p>
4946049460

4946149461
<p class="note">Since <span data-x="concept-input-file-path">path components</span> are not
49462-
permitted in file names in the list of <span data-x="concept-input-type-file-selected">selected
49462+
permitted in filenames in the list of <span data-x="concept-input-type-file-selected">selected
4946349463
files</span>, the "\fakepath\" cannot be mistaken for a path component.</p>
4946449464
</dd>
4946549465
</dl>
@@ -56692,12 +56692,12 @@ fur
5669256692
<li><p>The order of parts must be the same as the order of fields in <var>entry list</var>.
5669356693
Multiple entries with the same name must be treated as distinct fields.</p></li>
5669456694

56695-
<li><p>Field names, field values for non-file fields, and file names for file fields, in the
56695+
<li><p>Field names, field values for non-file fields, and filenames for file fields, in the
5669656696
generated <code>multipart/form-data</code> resource must be set to the result of <span
5669756697
data-x="encode">encoding</span> the corresponding entry's name or value with
5669856698
<var>encoding</var>, converted to a byte sequence.</p></li>
5669956699

56700-
<li><p>For field names and file names for file fields, the result of the encoding in the
56700+
<li><p>For field names and filenames for file fields, the result of the encoding in the
5670156701
previous bullet point must be escaped by replacing any 0x0A (LF) bytes with the byte sequence
5670256702
`<code data-x="">%0A</code>`, 0x0D (CR) with `<code data-x="">%0D</code>` and 0x22 (") with
5670356703
`<code data-x="">%22</code>`. The user agent must not perform any other escapes.</p></li>
@@ -75611,7 +75611,7 @@ body { display:none }
7561175611

7561275612
<dt><i>File</i></dt>
7561375613
<dd>
75614-
<p>Binary data with a file name.</p>
75614+
<p>Binary data with a filename.</p>
7561575615
</dd>
7561675616

7561775617
<!-- DND-v4:
@@ -75639,7 +75639,7 @@ body { display:none }
7563975639

7564075640
<dt>The actual data</dt>
7564175641

75642-
<dd><p>A Unicode or binary string, in some cases with a file name (itself a Unicode string),
75642+
<dd><p>A Unicode or binary string, in some cases with a filename (itself a Unicode string),
7564375643
<!-- (DND-v4:) or an object, --> as per <span>the drag data item kind</span>.</p></dd>
7564475644
</dl>
7564575645

@@ -114678,7 +114678,7 @@ details[open] > summary {
114678114678
<p>An <code>input</code> element whose <code data-x="attr-input-type">type</code> attribute is in
114679114679
the <span data-x="attr-input-type-file">File Upload</span> state, when it generates a <span>CSS
114680114680
box</span>, is expected to render as an <span>'inline-block'</span> box containing a span of text
114681-
giving the file name(s) of the <span data-x="concept-input-type-file-selected">selected
114681+
giving the filename(s) of the <span data-x="concept-input-type-file-selected">selected
114682114682
files</span>, if any, followed by a button that, when activated, provides the user with a file
114683114683
picker from which the selection can be changed. The button is expected to use <span>button
114684114684
layout</span> and match the <span>'::file-selector-button'</span> pseudo-element. The contents of
@@ -120350,7 +120350,7 @@ interface <dfn>MimeType</dfn> {
120350120350
<th> <code data-x="">download</code>
120351120351
<td> <code data-x="attr-hyperlink-download">a</code>;
120352120352
<code data-x="attr-hyperlink-download">area</code>
120353-
<td> Whether to download the resource instead of navigating to it, and its file name if so
120353+
<td> Whether to download the resource instead of navigating to it, and its filename if so
120354120354
<td> Text
120355120355
<tr>
120356120356
<th> <code data-x="">draggable</code>

0 commit comments

Comments
 (0)