Skip to content

Commit

Permalink
For-less propdesc autolinks are now *always* property refs. Descs nee…
Browse files Browse the repository at this point in the history
…d a for value. Fixes #2200
  • Loading branch information
tabatkins committed Jan 14, 2022
1 parent 4d354f1 commit f9584d2
Show file tree
Hide file tree
Showing 134 changed files with 7,431 additions and 8,128 deletions.
27 changes: 18 additions & 9 deletions bikeshed/shorthands/oldShorthands.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ def transformProductionPlaceholders(doc):
clearContents(el)
match = propdescRe.match(text)
if match:
if match.group(3) is None:
linkType = "propdesc"
elif match.group(3) in ("property", "descriptor"):
linkType = match.group(2)
linkFor, lt, linkType = match.groups()
if linkFor == "":
linkFor = "/"
if linkType is None:
if linkFor is None:
linkType = "property"
else:
linkType = "propdesc"
elif linkType in ("property", "descriptor"):
pass
else:
die(
f"Shorthand <<{match.group(0)}>> gives type as '{match.group(3)}', but only 'property' and 'descriptor' are allowed.",
Expand All @@ -43,10 +49,10 @@ def transformProductionPlaceholders(doc):
continue
el.tag = "a"
el.set("data-link-type", linkType)
el.set("data-lt", match.group(2))
if match.group(1) is not None:
el.set("for", match.group(1))
el.text = "<'" + match.group(2) + "'>"
el.set("data-lt", lt)
if linkFor is not None:
el.set("for", linkFor)
el.text = "<'" + lt + "'>"
continue
match = funcRe.match(text)
if match:
Expand Down Expand Up @@ -471,7 +477,10 @@ def propdescReplacer(match):
# Not a valid property actually.
return "'-'"
if linkType is None:
linkType = "propdesc"
if linkFor is None:
linkType = "property"
else:
linkType = "propdesc"
elif linkType in ("property", "descriptor"):
pass
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/biblio002.html
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ <h2 class="no-num no-toc no-ref heading settled" id="profile-and-date"><span cla
</div>
<div class="p-summary" data-fill-with="abstract">
<h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
<p>Testing <a class="property" data-link-type="propdesc">inline</a> vs <a class="property" data-link-type="propdesc">index</a> vs <a class="property" data-link-type="propdesc">direct</a> biblio links.</p>
<p>Testing <a class="property css" data-link-type="property">inline</a> vs <a class="property css" data-link-type="property">index</a> vs <a class="property css" data-link-type="property">direct</a> biblio links.</p>
</div>
<div data-fill-with="at-risk"></div>
<nav data-fill-with="table-of-contents" id="toc">
Expand Down
4 changes: 2 additions & 2 deletions tests/github/WICG/cq-usecases/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -506,15 +506,15 @@ <h2 class="heading settled" data-level="3" id="limitations-of-current-techniques
<dt> Media Queries
<dd> The use of Media Queries can only affect CSS changes based on the state and properties of the viewport. The viewport is not a good indicator of the state and properties of a particular container within the viewport.
<dt> CSS layout methods
<dd> CSS layout methods such as <strong>Flexbox</strong> and <strong>Grid</strong>, alongside <strong>CSS-based workarounds</strong> (such as the <a href="https://medium.freecodecamp.org/the-fab-four-technique-to-create-responsive-emails-without-media-queries-baf11fdfa848">Fab Four technique</a> which uses a combination of <code>width</code>, <code>calc</code>, <code>min-width</code> and <code>max-width</code> to affect binary changes to an elements width based on the width of its parent when compared to a static value, or <a class="property" data-link-type="propdesc">breakpoint</a>) can only deliver a small fraction of the functionality Container Queries are intended to offer.
<dd> CSS layout methods such as <strong>Flexbox</strong> and <strong>Grid</strong>, alongside <strong>CSS-based workarounds</strong> (such as the <a href="https://medium.freecodecamp.org/the-fab-four-technique-to-create-responsive-emails-without-media-queries-baf11fdfa848">Fab Four technique</a> which uses a combination of <code>width</code>, <code>calc</code>, <code>min-width</code> and <code>max-width</code> to affect binary changes to an elements width based on the width of its parent when compared to a static value, or <a class="property css" data-link-type="property">breakpoint</a>) can only deliver a small fraction of the functionality Container Queries are intended to offer.
These methods cannot employ the full capabilities of CSS on an element tree. For example, they cannot affect a child element’s <code>display</code> property in order to affect an new layout based on the width of a container.
<dt> <code>iframe</code>s
<dd>
The use of <code>iframe</code>s produces the closest effect to what Container Queries is intended to achieve, but their use has some significant drawbacks:
<ol>
<li> Without the use of JavaScript, some browsers require that the contents of the <code>iframe</code> are stored in a <em>separate HTML document</em> rather than being part of the current document. This necessitates a new document composition paradigm that’s very different from the methods currently employed by developers.
<li> There is currently no standard, declarative way for an <code>iframe</code> to auto-size to fit its contents. A container that is the subject of a Container Query is still expected to be able to adapt to its contents in the <em>opposite</em> dimension of the query. For example, in the case of a Container Query that is based on a container’s <em>width</em>, it is still expected that the container can adapt to the <em>height</em> of it’s contents, subject to any overflow rules.
<li> The contents of an <code>iframe</code> do not inherit any styles from their parent document, forcing the styles used by the <a class="property" data-link-type="propdesc">module</a> to be redeclared.
<li> The contents of an <code>iframe</code> do not inherit any styles from their parent document, forcing the styles used by the <a class="property css" data-link-type="property">module</a> to be redeclared.
<li> <code>iframe</code>s incur additional overhead by creating additional nested browsing contexts, which can degrade performance.
</ol>
<dt> JavaScript-based solutions
Expand Down
6 changes: 3 additions & 3 deletions tests/github/WICG/scroll-to-text-fragment/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,7 @@ <h4 class="heading settled" data-level="3.5.2" id="finding-ranges-in-a-document"
namespace</a> and meets any of the following conditions:</p>
<ol>
<li data-md>
<p>The <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#computed-value" id="ref-for-computed-value">computed value</a> of its <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-display-3/#propdef-display" id="ref-for-propdef-display">display</a> property is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-none" id="ref-for-valdef-display-none">none</a>.</p>
<p>The <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#computed-value" id="ref-for-computed-value">computed value</a> of its <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-display-3/#propdef-display" id="ref-for-propdef-display">display</a> property is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-none" id="ref-for-valdef-display-none">none</a>.</p>
<li data-md>
<p>If the node <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/parsing.html#serializes-as-void" id="ref-for-serializes-as-void">serializes as void</a>.</p>
<li data-md>
Expand All @@ -1983,8 +1983,8 @@ <h4 class="heading settled" data-level="3.5.2" id="finding-ranges-in-a-document"
<p>Is a <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/form-elements.html#the-select-element" id="ref-for-the-select-element">select</a></code> element whose <code><a data-link-type="element-sub" href="https://html.spec.whatwg.org/multipage/form-elements.html#attr-select-multiple" id="ref-for-attr-select-multiple">multiple</a></code> content attribute is absent.</p>
</ol>
<p>A node is part of a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="non-searchable-subtree">non-searchable subtree</dfn> if it is or has a <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-shadow-including-ancestor" id="ref-for-concept-shadow-including-ancestor">shadow-including ancestor</a> that is <a data-link-type="dfn" href="#search-invisible" id="ref-for-search-invisible①">search invisible</a>.</p>
<p>A node is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="visible-text-node">visible text node</dfn> if it is a <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#text" id="ref-for-text②">Text</a></code> node, the <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#computed-value" id="ref-for-computed-value①">computed value</a> of its <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#parent-element" id="ref-for-parent-element">parent element</a>'s <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/#propdef-visibility" id="ref-for-propdef-visibility">visibility</a> property is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css2/#valdef-visibility-visible" id="ref-for-valdef-visibility-visible">visible</a>, and it is <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/rendering.html#being-rendered" id="ref-for-being-rendered">being rendered</a>.</p>
<p>A node <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="has-block-level-display">has block-level display</dfn> if it is an <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-element" id="ref-for-concept-element⑥">element</a> and the <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#computed-value" id="ref-for-computed-value②">computed value</a> of its <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-display-3/#propdef-display" id="ref-for-propdef-display①">display</a> property is any of <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-block" id="ref-for-valdef-display-block">block</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-table" id="ref-for-valdef-display-table">table</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-flow-root" id="ref-for-valdef-display-flow-root">flow-root</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-grid" id="ref-for-valdef-display-grid">grid</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-flex" id="ref-for-valdef-display-flex">flex</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-list-item" id="ref-for-valdef-display-list-item">list-item</a>.</p>
<p>A node is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="visible-text-node">visible text node</dfn> if it is a <code class="idl"><a data-link-type="idl" href="https://dom.spec.whatwg.org/#text" id="ref-for-text②">Text</a></code> node, the <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#computed-value" id="ref-for-computed-value①">computed value</a> of its <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#parent-element" id="ref-for-parent-element">parent element</a>'s <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css2/#propdef-visibility" id="ref-for-propdef-visibility">visibility</a> property is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css2/#valdef-visibility-visible" id="ref-for-valdef-visibility-visible">visible</a>, and it is <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/rendering.html#being-rendered" id="ref-for-being-rendered">being rendered</a>.</p>
<p>A node <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="has-block-level-display">has block-level display</dfn> if it is an <a data-link-type="dfn" href="https://dom.spec.whatwg.org/#concept-element" id="ref-for-concept-element⑥">element</a> and the <a data-link-type="dfn" href="https://drafts.csswg.org/css-cascade-5/#computed-value" id="ref-for-computed-value②">computed value</a> of its <a class="property css" data-link-type="property" href="https://drafts.csswg.org/css-display-3/#propdef-display" id="ref-for-propdef-display①">display</a> property is any of <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-block" id="ref-for-valdef-display-block">block</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-table" id="ref-for-valdef-display-table">table</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-flow-root" id="ref-for-valdef-display-flow-root">flow-root</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-grid" id="ref-for-valdef-display-grid">grid</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-flex" id="ref-for-valdef-display-flex">flex</a>, <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-display-3/#valdef-display-list-item" id="ref-for-valdef-display-list-item">list-item</a>.</p>
<div class="algorithm" data-algorithm="nearest block ancestor">
To find the <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="nearest-block-ancestor">nearest block ancestor</dfn> of a <var>node</var> follow the steps:
<ol class="algorithm">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ <h3 class="heading settled" data-level="3.1" id="xrframe-structures"><span class
<p>Each value in <code class="idl"><a data-link-type="idl" href="#dom-xrmeshblock-indices" id="ref-for-dom-xrmeshblock-indices">indices</a></code> points to an offset into a point inside <code class="idl"><a data-link-type="idl" href="#dom-xrmeshblock-vertices" id="ref-for-dom-xrmeshblock-vertices①">vertices</a></code> and defines the corner of a triangle. The set of triangles creates a polygon mesh.
NOTE: the offset of each point is found by taking the index value and multiplying by 3.</p>
<p><code class="idl"><a data-link-type="idl" href="#dictdef-xrmeshblock" id="ref-for-dictdef-xrmeshblock①">XRMeshBlock</a></code> can contain an optional <code class="idl"><a data-link-type="idl" href="#dom-xrmeshblock-normals" id="ref-for-dom-xrmeshblock-normals">normals</a></code> which defines a buffer with the normal of each vertex. The size of <code class="idl"><a data-link-type="idl" href="#dom-xrmeshblock-normals" id="ref-for-dom-xrmeshblock-normals①">normals</a></code> must be the same as <code class="idl"><a data-link-type="idl" href="#dom-xrmeshblock-vertices" id="ref-for-dom-xrmeshblock-vertices②">vertices</a></code>.</p>
<p class="issue" id="issue-27e155ec"><a class="self-link" href="#issue-27e155ec"></a> is <a class="property" data-link-type="propdesc">normals</a> needed? If so, should it be requested during initialisation?</p>
<p class="issue" id="issue-27e155ec"><a class="self-link" href="#issue-27e155ec"></a> is <a class="property css" data-link-type="property">normals</a> needed? If so, should it be requested during initialisation?</p>
<pre class="idl highlight def"><c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="xrnearmesh"><code><c- g>XRNearMesh</c-></code></dfn> {
<c- b>readonly</c-> <c- b>setlike</c->&lt;<a data-link-type="idl-name" href="#dictdef-xrmeshblock" id="ref-for-dictdef-xrmeshblock②"><c- n>XRMeshBlock</c-></a>>;
};
Expand All @@ -816,7 +816,7 @@ <h3 class="heading settled" data-level="3.2" id="xrframe-interface"><span class=
<h2 class="heading settled" data-level="4" id="security"><span class="secno">4. </span><span class="content">Security and Privacy Considerations</span><a class="self-link" href="#security"></a></h2>
<p>The WebXR Meshing API is a powerful feature with that carries significant privacy risks.
A UA MUST ask permission from the user during session creation before meshing data is returned to the page.</p>
<p>An <a class="property" data-link-type="propdesc">inline</a> session must NOT have access to mesh data.</p>
<p>An <a class="property css" data-link-type="property">inline</a> session must NOT have access to mesh data.</p>
<p>Additionally, mesh data MUST be constructed from the geometry of the real world. It MUST not reveal writing, colors, pictures or other visual content.</p>
<p class="issue" id="issue-22eb3e63"><a class="self-link" href="#issue-22eb3e63"></a> clarify this section</p>
<p id="back-to-top" role="navigation"><a href="#toc"><abbr title="Back to Top"></abbr></a></p>
Expand Down Expand Up @@ -990,7 +990,7 @@ <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content
<div class="issue"> should the world mesh follow the observer or should it stay relative to the original position or should it be configurable? <a class="issue-return" href="#issue-d4b98141" title="Jump to section"></a></div>
<div class="issue"> should the world mesh have an XRSpace? <a class="issue-return" href="#issue-15434211" title="Jump to section"></a></div>
<div class="issue"> should the near mesh have an XRSpace? <a class="issue-return" href="#issue-a32157e9" title="Jump to section"></a></div>
<div class="issue"> is <a class="property" data-link-type="propdesc">normals</a> needed? If so, should it be requested during initialisation? <a class="issue-return" href="#issue-27e155ec" title="Jump to section"></a></div>
<div class="issue"> is <a class="property css" data-link-type="property">normals</a> needed? If so, should it be requested during initialisation? <a class="issue-return" href="#issue-27e155ec" title="Jump to section"></a></div>
<div class="issue"> should the mesh data persist per browser session or per xr session? <a class="issue-return" href="#issue-ffb06508" title="Jump to section"></a></div>
<div class="issue"> clarify this section <a class="issue-return" href="#issue-22eb3e63" title="Jump to section"></a></div>
</div>
Expand Down
Loading

0 comments on commit f9584d2

Please sign in to comment.