Skip to content

Commit 95d49d3

Browse files
[HTML] Prevent infinite loop in revealing algorithms whatwg/html@55baf05
1 parent f974a49 commit 95d49d3

3 files changed

Lines changed: 184 additions & 126 deletions

File tree

HTML-interaction-ja.html

Lines changed: 167 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@
118118

119119
●●options
120120

121-
spec_date:2025-07-30
122-
trans_update:2025-06-08
121+
spec_date:2025-08-01
122+
trans_update:2025-08-03
123123
source_checked:240603
124124
page_state_key:HTML
125125
spec_status:LS
@@ -488,7 +488,6 @@
488488
cF.動作:~HEinteractive#command-facet-action
489489
cF.不能化されるか:~HEinteractive#command-facet-disabledstate
490490
cF.隠されるか:~HEinteractive#command-facet-hiddenstate
491-
先祖~detailsを露呈する:~HEinteractive#ancestor-details-revealing-algorithm
492491

493492
ps.focus-visible:~SELECTORS4#focus-visible-pseudo
494493

@@ -503,6 +502,11 @@
503502
文書:~HTMLdom#the-document-object
504503
~tabindex値:#tabindex-value
505504

505+
先祖を露呈する:#ancestor-revealing-algorithm
506+
先祖~露呈~pair:#ancestor-reveal-pair
507+
arP.~node:#ancestor-reveal-pair-node
508+
arP.文字列:#ancestor-reveal-pair-string
509+
506510
失効-:#activation-expiry
507511
作動化を誘発する入力~event:#activation-triggering-input-event
508512

@@ -624,8 +628,6 @@
624628
fiP.~query:#fip-query
625629
fiP.合致-~list:#fip-matches
626630
fiP.作動中な合致-:#fip-active-match
627-
見出されるまでは非可視な先祖を露呈する:#ancestor-hidden-until-found-revealing-algorithm
628-
629631

630632
-注視器:#close-watcher
631633
cW.~window:#close-watcher-window
@@ -767,6 +769,7 @@
767769
~ASCII大小無視:~INFRA#ascii-case-insensitive
768770
~ASCII空白:~INFRA#ascii-whitespace
769771
~ASCII空白で分割する:~INFRA#split-on-ascii-whitespace
772+
~tuple:~INFRA#tuple
770773
~list:~INFRA#list
771774
~size:~INFRA#list-size
772775
空:~INFRA#list-is-empty
@@ -1033,6 +1036,7 @@
10331036
失効-:expire:~
10341037
強調-:highlight:~
10351038
露呈-:reveal:露わに
1039+
露呈:reveal:露わ化
10361040
展開-:expand:~
10371041
検索語:search term::~
10381042
切替器:switcher:~
@@ -1192,6 +1196,10 @@
11921196
%状態:-
11931197
%内容~属性~:-
11941198
%履歴~動作による作動化を要求するか:requireHistoryActionActivation
1199+
%~target:target
1200+
%露呈~:revealType
1201+
%露呈する先祖~:ancestorsToReveal
1202+
%露呈する先祖:ancestorToReveal
11951203

11961204
●保安
11971205
通過制御-:gate::~
@@ -1924,14 +1932,14 @@ <h3 title="The hidden attribute">6.1. `hidden^a 属性</h3>
19241932
<dd>
19251933
これらの特能が,当の要素の下位tree内にある~targetへ~scrollするよう試みたときは、
19261934
~UAは,[
1927-
当の~target~nodeに対し`見出されるまでは非可視な先祖を露呈する$~algoを走らすことにより,そこへ~scrollする
1935+
当の~target~nodeに対し`先祖を露呈する$ことにより,そこへ~scrollする
19281936
]より前に[
19291937
当の要素の `hidden$a 属性を
19301938
— 当の要素の内容が露呈されるよう —
19311939
除去する
19321940
]ことになる。
19331941
1934-
When these features attempt to scroll to a target which is in the element's subtree, the user agent will remove the hidden attribute in order to reveal the content before scrolling to it by running the ancestor hidden-until-found revealing algorithm on the target node.
1942+
When these features attempt to scroll to a target which is in the element's subtree, the user agent will remove the hidden attribute in order to reveal the content before scrolling to it by running the ancestor revealing algorithm on the target node.
19351943
</dd>
19361944
</dl>
19371945

@@ -2232,55 +2240,186 @@ <h3 title="The hidden attribute">6.1. `hidden^a 属性</h3>
22322240
</li>
22332241
</ul>
22342242

2243+
<p>
2244+
`先祖~露呈~pair@
2245+
は、
2246+
(
2247+
`~node@arP,
2248+
`文字列@arP
2249+
)
2250+
からなる`~tuple$である。
2251+
2252+
An ancestor reveal pair is a tuple consisting of a node and a string.
2253+
</p>
2254+
22352255
<div class="algo">
22362256
<p>
2237-
`見出されるまでは非可視な先祖を露呈する@
2257+
`先祖を露呈する@
22382258
~algoは、
22392259
所与の
2240-
( %現在の~node )
2260+
( ~node %~target )
22412261
に対し:
22422262
2243-
The ancestor hidden-until-found revealing algorithm is to run the following steps on currentNode:
2263+
The ancestor revealing algorithm given a node target is:
22442264
</p>
22452265
<ol>
22462266
<li>
2267+
%露呈する先祖~群 ~LET « »
2268+
2269+
Let ancestorsToReveal be « ».
2270+
</li>
2271+
<li>
2272+
%先祖 ~LET %~target
2273+
2274+
Let ancestor be target.
2275+
</li>
2276+
<li>
22472277
<p>
22482278
~WHILE[
2249-
`平坦~tree$の中の %現在の~node の親~nodeは在る
2250-
2279+
`平坦~tree$において %先祖 の親~nodeは在る
2280+
22512281
2252-
While currentNode has a parent node within the flat tree:
2282+
While ancestor has a parent node within the flat tree:
22532283
</p>
22542284
<ol>
22552285
<li>
2286+
~IF[
2287+
%先祖 の `hidden$a 属性の状態 ~EQ `見出されるまでは非可視$st
2288+
2289+
2290+
%露呈する先祖~群 に ( %先祖, `until-found^l ) を`付加する$
2291+
2292+
If ancestor has a hidden attribute in the Hidden Until Found state, then append (ancestor, "until-found") to ancestorsToReveal.
2293+
</li>
2294+
<li>
22562295
<p>
22572296
~IF[
2258-
%現在の~node の `hidden$a 属性の状態 ~EQ `見出されるまでは非可視$st
2297+
~AND↓ を満たす `details$e 要素が在る
2298+
]…
2299+
</p>
2300+
<ul>
2301+
<li>
2302+
`open$a 属性を有さない
2303+
</li>
2304+
<li>
2305+
%先祖 は その `2 個目の~slot@~HTMLrendering#_details-slots$の中に~slotされている
2306+
</li>
2307+
</ul>
2308+
<p>
2309+
…ならば
2310+
2311+
%露呈する先祖~群 に
2312+
( %先祖 の親~node*, `details^l )
2313+
を`付加する$
2314+
2315+
If ancestor is slotted into the second slot of a details element which does not have an open attribute, then append (ancestor's parent node, "details") to ancestorsToReveal.
2316+
</p>
2317+
</li>
2318+
<li>
2319+
%先祖 ~SET `平坦~tree$における %先祖 の親~node
2320+
2321+
Set ancestor to the parent node of ancestor within the flat tree.
2322+
</li>
2323+
</ol>
2324+
</li>
2325+
<li>
2326+
<p>
2327+
%露呈する先祖~群 を成す
2328+
~EACH( ( %露呈する先祖, %露呈~型 ) )
2329+
に対し:
2330+
2331+
For each (ancestorToReveal, revealType) of ancestorsToReveal:
2332+
</p>
2333+
<ol>
2334+
<li>
2335+
~IF[
2336+
%露呈する先祖 は`接続されて$いない
2337+
2338+
2339+
~RET
2340+
2341+
If ancestorToReveal is not connected, then return.
2342+
</li>
2343+
<li>
2344+
<p>
2345+
~IF[
2346+
%露呈~型 ~EQ `until-found^l
22592347
]:
22602348
2261-
If currentNode has the hidden attribute in the Hidden Until Found state, then:
2349+
If revealType is "until-found":
22622350
</p>
22632351
<ol>
22642352
<li>
2265-
`~eventを発火する$( %現在の~node, `beforematch$et )
2353+
~IF[
2354+
%露呈する先祖 の `hidden$a 属性の状態 ~NEQ `見出されるまでは非可視$st
2355+
2356+
2357+
~RET
2358+
2359+
If ancestorToReveal's hidden attribute is not in the Hidden Until Found state, then return.
2360+
</li>
2361+
<li>
2362+
`~eventを発火する$( %露呈する先祖, `beforematch$et )
22662363
— 次のように初期化して
22672364
22682365
`bubbles$m 属性 ~SET ~T
22692366
2270-
Fire an event named beforematch at currentNode with the bubbles attribute initialized to true.
2367+
Fire an event named beforematch at ancestorToReveal with the bubbles attribute initialized to true.
22712368
</li>
22722369
<li>
2273-
%現在の~node から `hidden$a 属性を除去する
2370+
~IF[
2371+
%露呈する先祖 は`接続されて$いない
2372+
2373+
2374+
~RET
22742375
2275-
Remove the hidden attribute from currentNode.
2376+
If ancestorToReveal is not connected, then return.
2377+
</li>
2378+
<li>
2379+
~IF[
2380+
%露呈する先祖 の `hidden$a 属性の状態 ~NEQ `見出されるまでは非可視$st
2381+
2382+
2383+
~RET
2384+
2385+
If ancestorToReveal's hidden attribute is not in the Hidden Until Found state, then return.
2386+
</li>
2387+
<li>
2388+
%露呈する先祖 から `hidden$a 属性を除去する
2389+
2390+
Remove the hidden attribute from ancestorToReveal.
22762391
</li>
22772392
</ol>
22782393
</li>
22792394
<li>
2280-
%現在の~node ~SET `平坦~tree$の中の %現在の~node の親~node
2395+
<p>
2396+
~ELSE:
2397+
2398+
Otherwise:
2399+
</p>
2400+
<ol>
2401+
<li>
2402+
~Assert:
2403+
%露呈~型 ~EQ `details^l
2404+
2405+
Assert: revealType is "details".
2406+
</li>
2407+
<li>
2408+
~IF[
2409+
%露呈する先祖 は `open$a 属性を有する
2410+
2411+
2412+
~RET
22812413
2282-
Set currentNode to the parent node of currentNode within the flat tree.
2414+
If ancestorToReveal has an open attribute, then return.
22832415
</li>
2416+
<li>
2417+
%露呈する先祖 の `open$a 属性の値 ~SET 空~文字列
2418+
2419+
Set ancestorToReveal's open attribute to the empty string.
2420+
</li>
2421+
</ol>
2422+
</li>
22842423
</ol>
22852424
</li>
22862425
</ol>
@@ -2687,7 +2826,7 @@ <h4 title="Modal dialogs and inert subtrees">6.3.1. ~modal~dialogと不活な下
26872826
という。
26882827
そのような要素 %dialog が在る間は、
26892828
%文書 に`接続されて$いる~nodeのうち[
2690-
%dialog と その`平坦~tree$における子孫
2829+
%dialog と`平坦~tree$における その子孫
26912830
]以外は,`不活$になるモノトスル。
26922831
26932832
A Document document is blocked by a modal dialog subject if subject is the topmost dialog element in document's top layer.\
@@ -2700,7 +2839,7 @@ <h4 title="Modal dialogs and inert subtrees">6.3.1. ~modal~dialogと不活な下
27002839
(すなわち、
27012840
%dialog は “先祖の不活 性から逃れる”
27022841
【 %dialog は、この属性を有さないならば,先祖が不活でも不活にならない】)。
2703-
%dialog の`平坦~tree$を成す各~子孫も,同様に`不活$になり得る。
2842+
`平坦~tree$における %dialog の各~子孫も,同様に`不活$になり得る。
27042843
27052844
subject can additionally become inert via the inert attribute, but only if specified on subject itself (i.e., subject escapes inertness of ancestors); subject's flat tree descendants can become inert in a similar fashion.
27062845
</p>
@@ -2722,7 +2861,7 @@ <h4 title="The inert attribute">6.3.2. `inert^a 属性</h4>
27222861
`真偽-属性$であり,在るならば次を指示する
27232862
27242863
当の要素, および[
2725-
当の要素の`平坦~tree$を成す子孫のうち
2864+
`平坦~tree$における当の要素の子孫のうち
27262865
“先祖の不活 性から逃れる” もの(~modal~dialogなど)以外のもの
27272866
]すべて
27282867
]は、
@@ -10478,23 +10617,11 @@ <h4 title="Interaction with details and hidden=until-found">6.9.2. `details^e
1047810617
</p>
1047910618

1048010619
<div class="algo">
10481-
<p>
10482-
手続きは:
10483-
10484-
the following steps:
10485-
</p>
10486-
<ol>
10487-
<li>
10488-
`先祖~detailsを露呈する$( %~node )
10489-
10490-
Run the ancestor details revealing algorithm on node.
10491-
</li>
10492-
<li>
10493-
`見出されるまでは非可視な先祖を露呈する$( %~node )
10620+
手続きは
10621+
10622+
`先祖を露呈する$( %~node )
1049410623
10495-
Run the ancestor hidden-until-found revealing algorithm on node.
10496-
</li>
10497-
</ol>
10624+
the ancestor revealing algorithm on node.
1049810625
</div>
1049910626
</li>
1050010627
</ol>

0 commit comments

Comments
 (0)