/
761.txt
136 lines (110 loc) · 7.34 KB
/
761.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
* 仕様書
[REFS[
- [12] [CITE@en-GB-x-hixie[HTML Standard]] ([TIME[2015-04-25 04:40:19 +09:00]] 版) <https://html.spec.whatwg.org/#navigate>
]REFS]
* 文脈
[16] [[navigate]] は、[[仕様書]]で規定されている手順により ([[著者]]の指示により)
実行される場合もあれば、[[利用者エージェント]]依存の方法で ([[利用者]]の直接の指示により)
実行される場合もあります。
[EG[
[17] 前者の例として [CODE(JS)@en[[[location.href]]]] の設定が、
後者の例として[[アドレスバー]]からの [[URL]] の指定があります。
]EG]
[13] [[navigate]] を発生させる操作には、例えば次のものがあります。
[FIG(short list)[
- [[ハイパーリンクをたどる]]
- [[フォーム提出]]
- [CODE(JS)@en[[[window.open]]]]
- [CODE(JS)@en[[[location.assign]]]]
- [CODE(JS)@en[[[location.href]]]]
- [[アドレスバー]]、[[メニュー]]、[[DnD]]、[[WebDriver]] 等からの [[URL]] の指定
- [[栞]]の選択
- [[コマンドライン引数]]等の他の[[アプリケーション]]からの [[URL]] の指定
]FIG]
* 入力
[14] [[navigate]] は、ある[[閲覧文脈]]に関する操作です。
[21] [[navigate]] は、ある[[資源]]を入力とする操作です。[[資源]]は [[URL]]
によって表されますが、 [[URL]] 以外にも ([[フォーム提出]]など)
[[資源]]を表す入力があります。
[15] [DFN[[RUBYB[原始閲覧文脈]@en[source browsing context]]]]は、
[[navigate]] の開始に責任を持つ[[閲覧文脈]]です [SRC[>>12]]。
[[原始閲覧文脈]]は、 [[navigate]] される[[閲覧文脈]]について
[[navigate]] を認められているか、いないかのいずれかです。
[20] [DFN[[RUBYB[明示的自己ナビゲーション上書き]@en[explicit self-navigation override]]]]
[SRC[>>12]] は、[[navigate]] する[[閲覧文脈]]の選択方法についてのフラグです。
[19] [DFN[[RUBYB[例外有効]@en[exceptions enabled]]]] [SRC[>>12]]
は、[[例外]]を投げるかどうかのフラグです。
* 処理
[18] [[利用者エージェント]]は、 [[navigate]] を次のように行わなければ[['''なりません''']]
[SRC[>>12]]。
[FIG(steps)[
= [[ストレージミューテックス]]を解放します。
= [[原始閲覧文脈]]が当該[[閲覧文脈]]を [[navigate]] することを認められていなければ、
== [[利用者]]の判断により次のいずれかを実行できても構いません。
ただし[[著者]]の[[砂箱化]]の要求を無視する場合もあり、危険かもしれません。
==- 新しい[[最上位閲覧文脈]]を開いて [[navigate]] することを[[利用者]]が選択したかのように扱います。
==- [[原始閲覧文脈]]の[[最上位閲覧文脈]]を [[navigate]] することを[[利用者]]が選択したかのように扱います。
== そうしない場合、
=== [[例外有効]]なら、 [CODE(DOMe)@en[[[SecurityError]]]] [[例外]]を投げます。
=== ここで停止します。
=
[FIG(list)[
- [[原始閲覧文脈]]が [[navigate]] する[[閲覧文脈]]と同じで、
- [[seamless browsing context flag]] が設定されていて、
- [[navigate]] する[[閲覧文脈]]が[[明示的自己ナビゲーション上書き]]フラグ無しで選ばれたなら、
]FIG]
... [[seamless browsing context flag]] が設定されていない直近の[[祖先閲覧文脈]]を
[[navigate]] する[[閲覧文脈]]とします。
=
[FIG(list)[
- [[原始閲覧文脈]]と [[navigate]] する[[閲覧文脈]]が同じで、
- [[navigate]] する[[閲覧文脈]]が他の [[navigate]] を実行中で、
- その [[navigate]] が [[unload a document]] を実行中で、
- その [[navigate]] の[[資源]]の [[URL]] の[[起源]]と本 [[navigate]] の[[資源]]の [[URL]]
の[[起源]]が[[同じ起源]]では''ない''なら、
]FIG]
... ここで停止します。
= [[traverse the history by a delta]] により[[タスクキュー]]に入れられた[[タスク]]が
[[navigate]] する[[閲覧文脈]]の[[活性文書]]について [[unload a document]] を走らせている場合、
ここで停止します。
= [[navigate]] する[[閲覧文脈]]の[[活性文書]]について [[prompt to unload a document]]
が走っている場合、ここで停止します。
=
@@ ...
]FIG]
* 歴史
[1] [CITE@en[Web Applications 1.0 r5685 Make form submission via .submit(), and page navigation via location.href, when either is done before the page has completely loaded, result in a history replacement (like a redirect) rather than a regular load.]]
( ([TIME[2010-11-30 10:22:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=5684&to=5685>
[2] [CITE@en[Web Applications 1.0 r5686 Change pushState() and replaceState() so that they update the pending state object as well (otherwise, pushState vs pushState;back;forward would result in different state objects in the initial popostate which is just silly).]]
( ([TIME[2010-11-30 11:07:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=5685&to=5686>
[3] [CITE[''''''[''''''whatwg'''''']'''''' pushState and session history issues]]
( ([TIME[2010-11-30 23:35:29 +09:00]] 版))
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-November/029234.html>
[8] [CITE@en[Web Applications 1.0 r6630 Define navigating to video and audio resources]]
( ([TIME[2011-10-05 09:02:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=6629&to=6630>
[9] リンクのクリック時に [CODE(DOMa)@en[[[click]]]] で [CODE(HTMLe)@en[[[img]]]] を使って [[fetch]]
を行うと、 [[IE10]] ではアクセスが発生しますが、 [[Firefox]] と [[Chrome]] ではアクセスが来ません。
[CODE(DOMa)@en[[[mousedown]]]] だと [[Chrome]] はアクセスが来ますが、応答を受け取ったり受け取れなかったりするようです。
[[Chrome]] の場合 [[navigation]] によってアクセスが中断され、そのタイミングによって要求が送られたり送られなかったり、
応答を処理できたりできなかったりするようです。 [TIME[2013-07-04T03:10:59.800Z]]
[10] [CITE[''''''[''''''whatwg'''''']'''''' scrdoc and session history don't play along in the spec]]
( ([TIME[2013-07-13 11:50:26 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2013-July/040059.html>
[11] [CITE[''''''[''''''whatwg'''''']'''''' Avoiding synchronous iframe load]]
( ([TIME[2013-10-26 04:58:58 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2013-October/041281.html>
[4] [CITE[''''''[''''''whatwg'''''']'''''' Navigation and history traversal issues]]
( ([TIME[2012-09-19 01:33:19 +09:00]] 版))
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-September/037325.html>
[5] [CITE@en-US[Window Object 1.0]]
( ([TIME[2006-04-08 02:19:28 +09:00]] 版))
<http://www.w3.org/TR/Window/#dfn-navigate>
[6] [CITE@en[Web Applications 1.0 r8555 Be more explicit about handing off to external software during navigation.]]
( ([TIME[2014-03-20 07:01:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=8554&to=8555>
[7] [CITE@en[Web Applications 1.0 r8799 Stop using the word 'asynchronously', and reduce usage of the word 'synchronous'.]]
( ([TIME[2014-09-20 08:19:00 +09:00]] 版))
<https://html5.org/r/8799>