Skip to content

Commit 3951015

Browse files
[css-content-3] Add an example explaining how to use counters in alt text w3c/csswg-drafts@aa8f239
1 parent 8ef0bef commit 3951015

1 file changed

Lines changed: 79 additions & 47 deletions

File tree

css-content-ja.html

Lines changed: 79 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@
120120
●●options
121121

122122
spec_title:CSS Generated Content Module Level 3
123-
spec_date:2024-02-05
124-
trans_update:2024-02-08
123+
spec_date:2025-07-21
124+
trans_update:2025-07-22
125125
source_checked:2019-08-09
126126
page_state_key:CSS
127127
original_url:https://drafts.csswg.org/css-content-3/
@@ -130,7 +130,7 @@
130130
ref_id_lowercase:true
131131
site_nav:css-gnerated,css
132132
conformance:css
133-
copyright:2024,permissive
133+
copyright:2025,permissive
134134
trans_1st_pub:2018-08-18
135135

136136
●●class_map
@@ -162,6 +162,9 @@
162162

163163
●●original_id_map
164164

165+
valdef-content-content-list:typedef-content-content-list
166+
typedef-content-list:
167+
165168
●●mdn_urls
166169
propdef-bookmark-label:CSS/bookmark-label
167170
propdef-bookmark-level:CSS/bookmark-level
@@ -177,20 +180,18 @@
177180

178181
●●link_map
179182

183+
●css
180184
pe.after:~CSSPSEUDO#selectordef-after
181185
pe.before:~CSSPSEUDO#selectordef-before
182186
pe.first-letter:~CSSPSEUDO#selectordef-first-letter
183187
pe.marker:~CSSPSEUDO#selectordef-marker
184-
pe.placeholder:~CSSPSEUDO#selectordef-placeholder
185-
pe.file-selector-button:~CSSPSEUDO#selectordef-file-selector-button
188+
pe.placeholder:~CSSFORMS#selectordef-placeholder
189+
pe.file-selector-button:~CSSFORMS#selectordef-file-selector-button
186190
ps.target:~SELECTORS4#target-pseudo
187191
~HTMLselectors#selector-target
188192
ps.left:~CSSPAGE#valdef-page-left
189193
ps.right:~CSSPAGE#valdef-page-right
190194

191-
e.img:~HEimages#the-img-element
192-
e.q:~HEtextlevel#the-q-element
193-
194195
p.bookmark-label:#propdef-bookmark-label
195196
p.bookmark-level:#propdef-bookmark-level
196197
p.bookmark-state:#propdef-bookmark-state
@@ -202,14 +203,15 @@
202203

203204
f.leader:#funcdef-leader
204205
t.leader():#funcdef-leader
206+
#funcdef-content-leader
205207
f.target-counter:#funcdef-target-counter
206208
t.target-counter():#funcdef-target-counter
207209
f.target-counters:#funcdef-target-counters
208210
t.target-counters():#funcdef-target-counters
209211

210212
f.leader( <leader-type> ):#funcdef-content-leader
211213

212-
t.content-list:#_typedef-content-list
214+
t.content-list:#typedef-content-list
213215
t.content-replacement:#typedef-content-content-replacement
214216
t.leader-type:#typedef-leader-type
215217
t.quote:#typedef-quote
@@ -237,7 +239,7 @@
237239
v.normal:#valdef-content-normal
238240
v.~noneC:#valdef-content-none
239241
vt.image:#valdef-content-list-image
240-
vt.content-list:#typedef-content-content-list
242+
vt.content-list:#valdef-content-content-list
241243
vt.string:#valdef-content-string
242244
/ `string$t:#valdef-content---string--counter--attr
243245
t.attr():#valdef-content-attr
@@ -249,6 +251,7 @@
249251
vt.integer:#valdef-bookmark-level-integer
250252
vt.content-list:#valdef-bookmark-label-content-list
251253

254+
252255
v.dotted:#valdef-leader-dotted
253256
v.solid:#valdef-leader-solid
254257
v.space:#valdef-leader-space
@@ -260,7 +263,7 @@
260263

261264
t.qname:~CSSNS#qname
262265

263-
●§2.7
266+
css §2.7
264267
p.string-set:#propdef-string-set
265268

266269
at.page:~CSSPAGE#at-ruledef-page
@@ -286,6 +289,9 @@
286289
v.first-letter:#valdef-content-first-letter
287290
v.marker:#valdef-content-marker
288291

292+
●code
293+
e.img:~HEimages#the-img-element
294+
e.q:~HEtextlevel#the-q-element
289295

290296
●用語
291297

@@ -388,7 +394,7 @@
388394
改行:line break::~
389395
収まら:fitし::~
390396
より幅広:wider
391-
右寄せされ:right-aligned
397+
(左横書きなら右へ寄せられ:right-aligned
392398

393399
●CSS
394400
出自の:originating:~
@@ -468,7 +474,6 @@
468474
諸々の:Lots of miscellaneous
469475

470476
させなくする:prevent
471-
種類別にとりあげる:enumerate
472477
併用:in conjunction with
473478
見受けられ:appears to
474479
とも呼ばれる:known
@@ -536,7 +541,7 @@
536541
重複:duplicate
537542
局所的に:localized
538543
目次:tables of contents
539-
代替:alt
544+
“代替~text”:"alt text"
540545
CSS Images:Images
541546
:chapter
542547
著者:author
@@ -579,6 +584,7 @@
579584
まで:and including
580585
であり続け:stay
581586
1 だけずれていた:off-by-one
587+
同じ〜:itself ()
582588

583589
●●images
584590
@css-content/
@@ -598,23 +604,25 @@
598604
[CSS-COUNTER-STYLES-3]
599605
Tab Atkins Jr.. <CSS Counter Styles Level 3. URL: https://drafts.csswg.org/css-counter-styles/
600606
[CSS-DISPLAY-4]
601-
<CSS Display Module Level 4. Editor's Draft. URL: https://drafts.csswg.org/css-display-4/
607+
Elika Etemad; Tab Atkins Jr.. <CSS Display Module Level 4. URL: https://drafts.csswg.org/css-display/
608+
[CSS-FORMS-1]
609+
Tim Nguyen. <CSS Form Control Styling Level 1. URL: https://drafts.csswg.org/css-forms-1/
602610
[CSS-IMAGES-3]
603611
Tab Atkins Jr.; Elika Etemad; Lea Verou. <CSS Images Module Level 3. URL: https://drafts.csswg.org/css-images-3/
604612
[CSS-IMAGES-4]
605613
Tab Atkins Jr.; Elika Etemad; Lea Verou. <CSS Images Module Level 4. URL: https://drafts.csswg.org/css-images-4/
606614
[CSS-LISTS-3]
607615
Elika Etemad; Tab Atkins Jr.. <CSS Lists and Counters Module Level 3. URL: https://drafts.csswg.org/css-lists-3/
608616
[CSS-PSEUDO-4]
609-
Daniel Glazman; Elika Etemad; Alan Stearns. <CSS Pseudo-Elements Module Level 4. URL: https://drafts.csswg.org/css-pseudo-4/
617+
Elika Etemad; Alan Stearns. <CSS Pseudo-Elements Module Level 4. URL: https://drafts.csswg.org/css-pseudo-4/
610618
[CSS-TEXT-4]
611619
Elika Etemad; et al. <CSS Text Module Level 4. URL: https://drafts.csswg.org/css-text-4/
612620
[CSS-VALUES-3]
613621
Tab Atkins Jr.; Elika Etemad. <CSS Values and Units Module Level 3. URL: https://drafts.csswg.org/css-values-3/
614622
[CSS-VALUES-4]
615623
Tab Atkins Jr.; Elika Etemad. <CSS Values and Units Module Level 4. URL: https://drafts.csswg.org/css-values-4/
616624
[CSS-VALUES-5]
617-
<CSS Values and Units Module Level 5. Editor's Draft. URL: https://drafts.csswg.org/css-values-5/
625+
Tab Atkins Jr.; Elika Etemad; Miriam Suzanne. <CSS Values and Units Module Level 5. URL: https://drafts.csswg.org/css-values-5/
618626
[CSS2]
619627
Bert Bos; et al. <Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification>. URL: https://drafts.csswg.org/css2/
620628
[CSS3-NAMESPACE]
@@ -752,7 +760,7 @@ <h2 title="Introduction">序論</h2>
752760

753761
<p>
754762
要素を画像~その他の~multimedia内容で置換する効果も,共通的にある。
755-
すべての~UAがすべての~multimedia形式を~supportするわけではないので
763+
すべての~UAがすべての~multimedia形式を~supportするとは限らないので
756764
~fallbackを供する必要もあろう。
757765
758766
Another common effect is replacing elements with images or other multimedia content. Since not all user agents support all multimedia formats, fallbacks may have to be provided.
@@ -761,16 +769,17 @@ <h2 title="Introduction">序論</h2>
761769
<div class="example">
762770
<pre class="lang-css">
763771
/* <span class="comment">
764-
~UAが~supportする形式を利用して,`logo^e 要素を~siteの~logoに置換する。
772+
~UAが~supportする形式を利用して,
773+
`logo^e 要素を~siteの~logoで置換する。
765774
766775
Replace &lt;logo&gt; elements with the site’s logo, using a format supported by the UA
767776
</span> */
768777
logo { content: url(logo.mov), url(logo.mng), url(logo.png), none; }
769778

770779
/* <span class="comment">
771-
`figure^e 要素を参照先の文書に置換する
780+
`figure^e 要素を参照先の文書で置換する
772781
— 失敗した場合, `alt^a 属性が[
773-
在れば その内容/無ければ要素~自身の内容
782+
在るならば その内容/無いならば 要素~自身の内容
774783
]で置換する。
775784
776785
Replace &lt;figure&gt; elements with the referenced document, or, failing that, with either the contents of the alt attribute or the contents of the element itself if there is no alt attribute
@@ -877,8 +886,7 @@ <h2 title="Inserting and Replacing Content: the content property">1. 内容の
877886
`marker$pe /
878887
`placeholder$pe /
879888
`file-selector-button$pe
880-
]疑似要素~用には,
881-
それ自身( `normal$v )に算出される。
889+
]疑似要素~用には,同じ `normal$v に算出される。
882890
883891
For ::marker, ::placeholder, and ::file-selector-button, this computes to itself (normal).
884892
</dd>
@@ -934,7 +942,8 @@ <h2 title="Inserting and Replacing Content: the content property">1. 内容の
934942
<dd class="issue">
935943
上の`無効な画像$の挙動は、
936944
~Chromeに見られる。
937-
これでいいのか? もっと良い挙動を利用できる/利用するべきでは?
945+
これでいいのか?
946+
もっと良い挙動を利用できるのでは?利用するべきでは?
938947
939948
The above invalid image behavior appears to be what Chrome is doing. Is this okay? Is there a better behavior we can/should use?
940949
</dd>
@@ -963,11 +972,11 @@ <h2 title="Inserting and Replacing Content: the content property">1. 内容の
963972
This value has historically been treated as &lt;content-list&gt; on ::before and ::after. Presumably there’s a Web-compat requirement on this, so these pseudo-elements might need an exception. [Issue #2889]
964973
</dd>
965974

966-
<dt id="typedef-content-content-list">`content-list$t</dt>
975+
<dt id="valdef-content-content-list">`content-list$t</dt>
967976
<dd>
968977
要素の内容を[
969978
指定された 1 個~以上の各~値に対応する,指定された順序による`匿名$な`行内~box$たち
970-
に置換する
979+
で置換する
971980
通常の内容は、
972981
`display$p が `none^v にされていたかのように抑止され,~boxを生成しなくなる。
973982
@@ -1006,7 +1015,7 @@ <h2 title="Inserting and Replacing Content: the content property">1. 内容の
10061015
<dd>
10071016
この仕様は,[
10081017
~UAは,どちらの挙動を利用するモノトスルか
1009-
は 意図的に定義しないが
1018+
を意図的に定義しないが
10101019
~UAは,一貫して片方のみを利用するモノトスル。
10111020
10121021
This specification intentionally does not define which behavior a user agent must use, but it must use one or the other consistently.
@@ -1029,10 +1038,29 @@ <h2 title="Inserting and Replacing Content: the content property">1. 内容の
10291038
10301039
Specifies the "alt text" for the element. See § 1.2 Alternative Text for Accessibility for details. If omitted, the element has no "alt text".
10311040
</dd>
1041+
<dd class="example">
1042+
<p>
1043+
“代替~text” 内で `counter$t を正しく
1044+
— 【 “代替~text” 用の構文が?】~supportされない~browserにおいて【も通用するよう】 —
1045+
利用するためには、
1046+
`content$p ~propを重ねて指定するべきである
1047+
— ~fallback用として “代替~text” 内に~counterを伴わないものと,
1048+
“代替~text” 内で~counterを利用するものを。
1049+
1050+
To correctly use &lt;counter&gt; in "alt text" in unsupported browsers one should specify content property twice. First, a fallback without counter in "alt text". Second, use counter in "alt text".
1051+
</p>
1052+
1053+
<pre class="lang-css">
1054+
::before {
1055+
content: "Chapter" counter(chapter);
1056+
content: "Chapter" counter(chapter) / "Chapter" counter(chapter);
1057+
}
1058+
</pre>
1059+
</dd>
10321060
</dl>
10331061

10341062
<p class="issue">
1035-
`contents$v ~keywordは `content$f に置換するベキか
1063+
`contents$v ~keywordは `content$f で置換するべきか
10361064
10371065
Should the contents keyword be replaced with content()?
10381066
</p>
@@ -1112,7 +1140,7 @@ <h3 title="Alternative Text for Accessibility">1.2. ~accessibilityを得るた
11121140
11131141
or a localized attribute from the DOM:
11141142
</span>
1115-
attr("data-alt")
1143+
... / attr("data-alt");
11161144
*/
11171145
}
11181146
</pre>
@@ -1153,8 +1181,8 @@ <h3 title="Alternative Text for Accessibility">1.2. ~accessibilityを得るた
11531181
<p class="trans-note">【†
11541182
“`black right-pointing pointer^en”
11551183
は,~Unicodeに定義される "►" ( U+25BA )の文字~名であり、
1156-
文字~名は おそらく英語~名しか正式に定義されていないので、
1157-
`内容~言語$が英語でない環境でも,このとおり発話されるかもしれない。
1184+
文字~名はおそらく英語~名しか正式に定義されていないので、
1185+
`内容~言語$が英語でない場合でも,このとおり発話されるかもしれない。
11581186
</p>
11591187
</div>
11601188

@@ -1168,14 +1196,13 @@ <h2 title="Generated Content Values: the &lt;content-list&gt; type">2. 生成d
11681196
画像, 文字列, ~counterの値, 要素の~text値
11691197
]も含め, 1 個以上の`匿名$な`行内~box$で要素を埋めるために `content$p 内で利用される。
11701198
この節では、
1171-
これがとり得る値を種類別にとりあげる
1199+
これがとり得る値を列挙する
11721200
11731201
The &lt;content-list&gt; value is used in content to fill an element with one or more anonymous inline boxes, including images, strings, the values of counters, and the text value of elements. In this section we enumerate the possibilities.
11741202
</p>
11751203

11761204
<p>
1177-
`content-list$t の構文は、
1178-
次で定義される:
1205+
`content-list$t の構文は:
11791206
11801207
The syntax of &lt;content-list&gt; is defined as:
11811208
</p>
@@ -1502,7 +1529,7 @@ <h4 title="Quotation Mark System: the quotes property">2.4.1. 引用符~system
15021529
一般に,親の`算出d値$を継承することと等価になる
15031530
— `auto$v `it^en【?】 は親が利用したものと同じ`内容~言語$を利用して解決されることを除いて。
15041531
1505-
Specifies the same quotation mark system as the the parent. In general this is equivalent to inheriting the parent’s computed value, except that auto it resolves using the same content language that the parent used.
1532+
Specifies the same quotation mark system as the parent. In general this is equivalent to inheriting the parent’s computed value, except that auto it resolves using the same content language that the parent used.
15061533
</dd>
15071534
<dd class="issue">
15081535
<p>
@@ -1592,7 +1619,7 @@ <h4 title="Inserting Quotation Marks: the *-quote keywords">2.4.2. 引用符の
15921619
]の出現は、
15931620
`引用符-深さ$に基づいて,[
15941621
`quotes$p ~propに指定された`引用符~system$に定義されるとおりの引用符~文字列
1595-
に置換される
1622+
で置換される
15961623
15971624
Quotation marks can be inserted in appropriate places in a document with the open-quote and close-quote values of the content property. Each occurrence of open-quote or close-quote is replaced by a quotation mark string as defined by the quotation mark system specified by the quotes property, based on the depth of nesting.
15981625
</p>
@@ -1934,8 +1961,10 @@ <h4 title="The leader() function">2.5.1. `leader^f 関数</h4>
19341961
</div>
19351962

19361963
<p class="issue">
1937-
~leaderは、
1938-
より後にある内容は右寄せされる(終端に整列される)とする前提に依存するか?
1964+
~leaderは、[
1965+
より後にある内容は、
1966+
終端に整列される(左横書きなら右へ寄せられる)
1967+
]とする前提に依存するか?
19391968
19401969
Do leaders depend on the assumption that the content after the leader is right-aligned (end-aligned)?
19411970
</p>
@@ -2806,9 +2835,9 @@ <h2 title="Bookmarks">3. ~bookmark</h2>
28062835
~navi用の援助として
28072836
`~bookmark@
28082837
の利用-を許容する。
2809-
文書~内の要素に指定された~bookmarkは、[
2838+
文書を成す要素に指定された~bookmarkは、[
28102839
~link, その~labelを成す~text, ~level値
2811-
の組を要素に供する
2840+
を当の要素に供する
28122841
各~bookmarkは、
28132842
3 個の~prop[
28142843
`bookmark-level$p,
@@ -2820,7 +2849,7 @@ <h2 title="Bookmarks">3. ~bookmark</h2>
28202849
</p>
28212850

28222851
<p>
2823-
利用者が~bookmarkを作動化したとき
2852+
利用者が~bookmarkを作動化したときは
28242853
~UAは,その参照-先を利用者の注目を引く地点へ持ってくるモノトスル
28252854
— ちょうど、
28262855
素片~URLにより参照-先の要素へ~navigateしたかのように。
@@ -2851,9 +2880,11 @@ <h2 title="Bookmarks">3. ~bookmark</h2>
28512880
<h3 title="Setting a Bookmark: the bookmark-level property">3.1. ~bookmarkの設定-法: `bookmark-level^p ~prop</h3>
28522881

28532882
<p>
2854-
`bookmark-level$p ~propは、
2855-
~bookmarkを作成するかどうか,そうならばどの~levelにするかを決定する。
2856-
この~propが無い, または値 `~noneB$v にされている場合、[
2883+
`bookmark-level$p ~propは、[
2884+
~bookmarkを作成するかどうか,
2885+
そうする場合 その~levelは何になるか
2886+
]を決定する。
2887+
この~propの算出d値が `~noneB$v になる【!is absent, or has】場合、[
28572888
`bookmark-label$p / `bookmark-state$p
28582889
]の値に関わらず,~bookmarkは生成されるベキでない。
28592890
@@ -2887,7 +2918,8 @@ <h3 title="Setting a Bookmark: the bookmark-level property">3.1. ~bookmarkの設
28872918
<dt id="valdef-bookmark-level-integer">`integer [1,∞]$t</dt>
28882919
<dd>
28892920
~bookmarkの~levelを定義する
2890-
— ~top-levelは 1 とする( 0 以下の値は妥当でない)。
2921+
— 1 が~top-levelを表すとする
2922+
( 0 以下の値は妥当でない)。
28912923
28922924
defines the level of the bookmark, with the top level being 1 (negative and zero values are invalid).
28932925
</dd>
@@ -2910,8 +2942,8 @@ <h3 title="Setting a Bookmark: the bookmark-level property">3.1. ~bookmarkの設
29102942

29112943
<p class="note">注記:
29122944
~bookmarkは、
2913-
各~levelの厳密な階層を作成する必要は無い
2914-
!~levelが飛び飛びになっていても/~tree構造に合致していなくともよい。】
2945+
~levelたちが成す厳密な階層を作成する必要はない
2946+
言い換えれば、~levelたちに指定する数は, 1 から開始する必要も~~連続的になる必要もない。】
29152947
29162948
Note: Bookmarks do not need to create a strict hierarchy of levels.
29172949
</p>

0 commit comments

Comments
 (0)