Skip to content

Commit

Permalink
[URL] File state did not correctly deal with lack of base URL 他
Browse files Browse the repository at this point in the history
Editorial: move Windows drive letter to a more logical location
whatwg/url@ac6489f
d1457

File state did not correctly deal with lack of base URL
whatwg/url@698f3e8
5ab7e
Fixes whatwg/url#217
  • Loading branch information
triple-underscore committed Feb 7, 2017
1 parent b49687d commit 1990e45
Showing 1 changed file with 108 additions and 111 deletions.
219 changes: 108 additions & 111 deletions URL-ja.html
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ <h1>URL Standard 日本語訳</h1>
</p>

<p>
更新: <time>2017-02-01</time>
更新: <time>2017-02-08</time>
(公開: <time>2012-10-20</time>
</p>

Expand Down Expand Up @@ -980,7 +980,7 @@ <h1>URL Standard 日本語訳</h1>

<hgroup>
<h1>URL</h1>
<h2>Living Standard — 最終更新 2017 年 131</h2>
<h2>Living Standard — 最終更新 2017 年 27</h2>
</hgroup>

<dl>
Expand All @@ -990,7 +990,7 @@ <h2>Living Standard — 最終更新 2017 年 1 月 31 日</h2>

<dt>Commits:</dt>
<dd><a href="https://github.com/whatwg/url/commits">https://github.com/whatwg/url/commits</a></dd>
<dd><a href="https://url.spec.whatwg.org/commit-snapshots/b087fe2ab215caf656a94b067c9a69ae78f03c8f/" id="commit-snapshot-link">Snapshot as of this commit</a></dd>
<dd><a href="https://url.spec.whatwg.org/commit-snapshots/ac6489f9b0cf55b27fd1401ab77bc452c97d1457/" id="commit-snapshot-link">Snapshot as of this commit</a></dd>
<dd><a href="https://twitter.com/urlstandard">@urlstandard</a></dd>

<dt>各国語翻訳(非規範的)</dt>
Expand Down Expand Up @@ -1145,34 +1145,6 @@ <h2 title="Infrastructure">1. 基盤</h2>
To serialize an integer, represent it as the shortest possible decimal number.
</p>

<hr>

<div class="p">
<p>
`~drive_letter@
とは、次を満たす 2 個の~cp並び[
%L1, %L2
]である:
</p>

<ul ><li>%L1 ~IN `~ASCII英字$
</li><li>%L2 ~IN { ❝:, ❝| }
</li></ul>

A Windows drive letter is two code points, of which the first is an ASCII alpha and the second is either ":" or "|".
</div>

<p>
`正規化済み~drive_letter@
とは、`~drive_letter$のうち,[
2 個目の~cp ~EQ ❝:
]なるものである。
A normalized Windows drive letter is a Windows drive letter of which the second code point is ":".
</p>


<section id="parsers">

<h3 title="Parsers">1.1. 構文解析器</h3>
Expand Down Expand Up @@ -3247,6 +3219,31 @@ <h2 title="URLs">4. ~URL</h2>

<hr>

<div class="p">
<p>
`~drive_letter@
とは、次を満たす 2 個の~cp並び[
%L1, %L2
]である:
</p>

<ul ><li>%L1 ~IN `~ASCII英字$
</li><li>%L2 ~IN { ❝:, ❝| }
</li></ul>

A Windows drive letter is two code points, of which the first is an ASCII alpha and the second is either ":" or "|".
</div>

<p>
`正規化済み~drive_letter@
とは、`~drive_letter$のうち,[
2 個目の~cp ~EQ ❝:
]なるものである。
A normalized Windows drive letter is a Windows drive letter of which the second code point is ":".
</p>

<p class="algo-head">
%url の
`~pathを短縮する@
Expand Down Expand Up @@ -5353,13 +5350,15 @@ <h3 title="URL parsing">4.2. ~URLの構文解析法</h3>
<li>
%url の`~scheme$url ~SET `file^l
Set url’s scheme to "file", and then, switching on c:
Set url’s scheme to "file".
</li>
<li>
<p>
~IF[
`C$V ~IN { ❝/, ❝\ }
]:
If c is "/" or "\", then:
</p>
<ol>
<li>
Expand All @@ -5368,139 +5367,137 @@ <h3 title="URL parsing">4.2. ~URLの構文解析法</h3>
`構文違反$
If c is "\", syntax violation.
</li>
<li>
%state ~SET `~file~slash$st
Set state to file slash state.
</li>
</ol>
</li>
</li>
<li>
<p>
~ELIF[
`C$V ~IN { `EOF$i, ❝?, ❝# }
%基底 ~NEQ ~NULL
]~AND[
%基底 の`~scheme$url ~EQ `file^l
]:
Otherwise, if base is non-null and base’s scheme is "file", switch on c:
</p>
<ol>
<li>
<p>
~IF[
%基底 ~NEQ ~NULL
%D ~LET [
次が満たされるならば ~T /
~ELSE_ ~F
並び[
`C$V, `C1$V
]は `~drive_letter$である
]~AND[
%基底 の`~scheme$url ~EQ `file^l
`C2$V ~IN { ❝/, ❝\, ❝?, ❝# }
</p>

<ol>
<li>
<p class="note">注記:
これは~drive_letterのための(~platformに依存しない)過去互換対処である。
</p>

</li>
<li>
~IF[
%D ~EQ ~F
%url の`~host$url ~SET %基底 の`~host$url ~BR
%url の`~path$url ~SET %基底 の`~path$url
</li>
<li>
<li>
<p>
`C$V に応じて:
</p>
<dl class="switch">
<dt>`EOF$i</dt>
<dd>
<dl class="switch">
<dt>`EOF$i</dt>
<dd>
%url の`~query$url ~SET %基底 の`~query$url
Set url’s host to base’s host, url’s path to base’s path, and url’s query to base’s query.
</dd>

<dt>❝?</dt>
<dd>
<dt>❝?</dt>
<dd>
%url の`~query$url ~SET 空~文字列 ~BR
%state ~SET `~query$st
Set url’s host to base’s host, url’s path to base’s path, url’s query to the empty string, and state to query state.
</dd>

<dt>❝#</dt>
<dd>
<dt>❝#</dt>
<dd>
%url の`~query$url ~SET %基底 の`~query$url ~BR
%url の`素片$url ~SET 空~文字列 ~BR
%state ~SET `素片$st
Set url’s host to base’s host, url’s path to base’s path, url’s query to base’s query, url’s fragment to the empty string, and state to fragment state.
</dd>
</dl>
</li>
</ol>
</li>
</ol>

<div lang="en" style="white-space:pre-line;">
EOF code point
• If base is non-null and base’s scheme is "file", set url’s host to base’s host, url’s path to base’s path, and url’s query to base’s query.

"/"
"\"
• If c is "\", syntax violation.
• Set state to file slash state.

"?"
• If base is non-null and base’s scheme is "file", set url’s host to base’s host, url’s path to base’s path, url’s query to the empty string, and state to query state.

"#"
• If base is non-null and base’s scheme is "file", set url’s host to base’s host, url’s path to base’s path, url’s query to base’s query, url’s fragment to the empty string, and state to fragment state.
</div>
</li>
<li>
<p>
~ELSE:
Otherwise
</p>
<ol>
<li>
<p>
~IF[
%基底 ~NEQ ~NULL
]~AND[
%基底 の`~scheme$url ~EQ `file^l
]:
</p>
<ol>
<li>
<dt>その他◎Otherwise</dt>
<dd>
<ol>
<li>
<p>
~IF[
並び[
`C$V, `C1$V
]は `~drive_letter$である
]~AND[
`C2$V ~IN { ❝/, ❝\, ❝?, ❝# }
%D ~EQ ~F
`構文違反$
%url の`~pathを短縮する$
</p>

<p class="note">注記:
これは~drive_letterのための(~platformに依存しない)過去互換対処である。
</p>
</li>
<li>
~ELSE
%url の`~host$url ~SET %基底 の`~host$url ~BR
%url の`~path$url ~SET %基底 の`~path$url ~BR
%url の`~pathを短縮する$
</li>
</ol>
<div lang="en" style="white-space:pre-line;">
If base is non-null, base’s scheme is "file", and at least one of the following is true
If at least one of the following is true

• c and the first code point of remaining are not a Windows drive letter
• remaining consists of one code point
• remaining’s second code point is not "/", "\", "?", or "#"
• remaining’s second code point is not "/", "\", "?", or "#"

then set url’s host to base’s host, url’s path to base’s path, and then shorten url’s path.

This is a (platform-independent) Windows drive letter quirk.

Otherwise, if base is non-null and base’s scheme is "file", syntax violation.
</div>
</li>
<li>

</li>
<li>
~ELSE
`構文違反$
Otherwise, syntax violation.
</li>
<li>
%~pointer ~DECBY 1 ~BR
%state ~SET `~path$st
Set state to path state, and decrease pointer by one.
</li>
</ol>
</dd>
</dl>
</li>
</ol>
</li>
<li>
~ELSE
%~pointer ~DECBY 1 ~BR
%state ~SET `~path$st
Otherwise, set state to path state, and decrease pointer by one.
</li>
</ol>
</dd>

Expand Down

0 comments on commit 1990e45

Please sign in to comment.