Skip to content

Commit

Permalink
Add link for Applies to in propdef tables. Fixes #1992 (#2133)
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasai committed Sep 30, 2021
1 parent 082cf46 commit 980486a
Show file tree
Hide file tree
Showing 82 changed files with 597 additions and 595 deletions.
6 changes: 4 additions & 2 deletions bikeshed/datablocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,10 @@ def transformPropdef(
th = f"<th><a href='https://www.w3.org/TR/css-cascade/#computed'>{key}:</a>"
elif key in ("Animatable", "Animation type"):
th = f"<th><a href='https://www.w3.org/TR/web-animations/#animation-type'>{key}:</a>"
elif key == "Applies to" and val.lower() == "all elements":
td = "<td><a href='https://www.w3.org/TR/css-pseudo/#generated-content' title='Includes ::before and ::after pseudo-elements.'>all elements</a>"
elif key == "Applies to":
th = f"<th><a href='https://www.w3.org/TR/css-cascade/#applies-to'>{key}:</a>"
if val.lower() == "all elements":
td = "<td><a href='https://www.w3.org/TR/css-pseudo/#generated-content' title='Includes ::before and ::after pseudo-elements.'>all elements</a>"
ret.append(tr + th + td)
ret.append("</table>")

Expand Down
22 changes: 11 additions & 11 deletions tests/github/w3c/csswg-drafts/css-align-3/Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ <h3 class="heading settled" data-level="5.1" id="align-justify-content"><span cl
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>normal
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td>block containers, multicol containers, flex containers, and grid containers
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -1322,7 +1322,7 @@ <h3 class="heading settled" data-level="5.1" id="align-justify-content"><span cl
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>normal
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td>multicol containers, flex containers, and grid containers
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -1468,7 +1468,7 @@ <h3 class="heading settled" data-level="5.2" id="place-content"><span class="sec
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>normal
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td>block containers, flex containers, and grid containers
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -1603,7 +1603,7 @@ <h3 class="heading settled" data-level="6.1" id="justify-self-property"><span cl
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>auto
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td>block-level boxes, absolutely-positioned boxes, and grid items
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -1792,7 +1792,7 @@ <h3 class="heading settled" data-level="6.2" id="align-self-property"><span clas
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>auto
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td>flex items, grid items, and absolutely-positioned boxes
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -1957,7 +1957,7 @@ <h3 class="heading settled" data-level="6.3" id="place-self-property"><span clas
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>auto
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td>block-level boxes, absolutely-positioned boxes, and grid items
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -2073,7 +2073,7 @@ <h3 class="heading settled" data-level="7.1" id="justify-items-property"><span c
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>legacy
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -2122,7 +2122,7 @@ <h3 class="heading settled" data-level="7.2" id="align-items-property"><span cla
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>normal
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -2157,7 +2157,7 @@ <h3 class="heading settled" data-level="7.3" id="place-items-property"><span cla
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>see individual properties
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -2204,7 +2204,7 @@ <h3 class="heading settled" data-level="8.1" id="column-row-gap"><span class="se
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>normal
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a data-link-type="dfn" href="https://drafts.csswg.org/css-multicol-1/#multi-column-container" id="ref-for-multi-column-container①">multi-column containers</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/css-flexbox-1/#flex-container" id="ref-for-flex-container①②">flex containers</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/css-grid-2/#grid-container" id="ref-for-grid-container⑥">grid containers</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -2290,7 +2290,7 @@ <h3 class="heading settled" data-level="8.2" id="gap-shorthand"><span class="sec
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>see individual properties
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a data-link-type="dfn" href="https://drafts.csswg.org/css-multicol-1/#multi-column-container" id="ref-for-multi-column-container④">multi-column containers</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/css-flexbox-1/#flex-container" id="ref-for-flex-container①⑥">flex containers</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/css-grid-2/#grid-container" id="ref-for-grid-container⑨">grid containers</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down
18 changes: 9 additions & 9 deletions tests/github/w3c/csswg-drafts/css-animations-1/Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ <h3 class="heading settled" data-level="3.2" id="animation-name"><span class="se
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>none
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -1253,7 +1253,7 @@ <h3 class="heading settled" data-level="3.3" id="animation-duration"><span class
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>0s
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -1313,7 +1313,7 @@ <h3 class="heading settled" data-level="3.4" id="animation-timing-function"><spa
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>ease
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -1357,7 +1357,7 @@ <h3 class="heading settled" data-level="3.5" id="animation-iteration-count"><spa
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>1
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -1405,7 +1405,7 @@ <h3 class="heading settled" data-level="3.6" id="animation-direction"><span clas
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>normal
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -1455,7 +1455,7 @@ <h3 class="heading settled" data-level="3.7" id="animation-play-state"><span cla
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>running
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -1504,7 +1504,7 @@ <h3 class="heading settled" data-level="3.8" id="animation-delay"><span class="s
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>0s
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -1558,7 +1558,7 @@ <h3 class="heading settled" data-level="3.9" id="animation-fill-mode"><span clas
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>none
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -1611,7 +1611,7 @@ <h3 class="heading settled" data-level="3.10" id="animation"><span class="secno"
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>see individual properties
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down
4 changes: 2 additions & 2 deletions tests/github/w3c/csswg-drafts/css-animations-2/Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ <h3 class="heading settled" data-level="3.8" id="animation-composition"><span cl
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>replace
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down Expand Up @@ -1193,7 +1193,7 @@ <h3 class="heading settled" data-level="3.9" id="animation-timeline"><span class
<th><a href="https://www.w3.org/TR/css-cascade/#initial-values">Initial:</a>
<td>auto
<tr>
<th>Applies to:
<th><a href="https://www.w3.org/TR/css-cascade/#applies-to">Applies to:</a>
<td><a href="https://www.w3.org/TR/css-pseudo/#generated-content" title="Includes ::before and ::after pseudo-elements.">all elements</a>
<tr>
<th><a href="https://www.w3.org/TR/css-cascade/#inherited-property">Inherited:</a>
Expand Down
Loading

0 comments on commit 980486a

Please sign in to comment.