Skip to content

Commit bc76140

Browse files
authored
[css-view-transitions-1][css-viewport] Resolve a few missing types (#8901)
* Update date for publishing * Define missing types * Remove all view-box stuff
1 parent e15cda1 commit bc76140

File tree

2 files changed

+35
-81
lines changed

2 files changed

+35
-81
lines changed

css-view-transitions-1/Overview.bs

+34-80
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Shortname: css-view-transitions
44
Level: 1
55
Status: WD
66
Group: csswg
7-
Date: 2023-05-29
7+
Date: 2023-05-30
88
Prepare for TR: yes
99
ED: https://drafts.csswg.org/css-view-transitions-1/
1010
TR: https://www.w3.org/TR/css-view-transitions-1/
@@ -785,10 +785,7 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
785785
## The snapshot containing block ## {#snapshot-containing-block-concept}
786786

787787
The <dfn>snapshot containing block</dfn> is a rectangle that covers all areas of the window that could potentially display web content.
788-
This area is consistent regardless of root scrollbars or interactive widgets.
789-
790-
Issue: "Interactive widgets" refers to UI described within a property definition in [[css-viewport#interactive-widget-section]].
791-
This should be extracted into an exported definition that can be used independently of the property.
788+
This area is consistent regardless of root scrollbars or [=interactive-widget|interactive widgets=].
792789

793790
<figure>
794791
<img src="diagrams/phone-browser.svg" width="200" height="335" alt="A diagram of a phone screen, including a top status bar, a browser URL bar, web-content area with a floating scrollbar, a virtual keyboard, and a bottom bar with an OS back button">
@@ -833,28 +830,33 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
833830
The [=view-transition layer=] is a sibling of this stacking context.
834831

835832
- The [=view-transition layer=] paints after the stacking context for the [=document element=] and [/=document=]'s [=Document/top layer=].
833+
This includes the filters and effects that are applied to the [=document element=].
836834

837835
Note: The intent of the feature is to be able to capture the contents of the page, which includes the top layer elements.
838836
In order to accomplish that, the [=view-transition layer=] cannot be a part of the captured top layer context,
839837
since that results in a circular dependency.
840838
Instead, this stacking context is a sibling of other page contents.
841839

842-
Issue: Do we need to clarify that the stacking context for the root and top layer elements has filters and effects coming from the [=document element=]'s style?
843-
844840
## [=Captured elements=] ## {#captured-elements}
845841

846842
A <dfn>captured element</dfn> is a [=struct=] with the following:
847843

848844
<dl dfn-for="captured element">
849845
: <dfn>old image</dfn>
850-
:: an image or null. Initially null.
846+
:: an {{ImageData}} or null. Initially null.
851847

852-
Issue: The type of "image" needs to be linked or defined.
848+
: <dfn>old width</dfn>
849+
: <dfn>old height</dfn>
850+
:: an {{unrestricted double}}, initially zero.
853851

854-
: <dfn>old styles</dfn>
855-
:: a set of styles or null. Initially null.
852+
: <dfn>old transform</dfn>
853+
:: a <a data-xref-type="css-type">&lt;transform-function&gt;</a>, initially the [=identity transform function=].
856854

857-
Issue: The type of "a set of styles" needs to be linked or defined.
855+
: <dfn>old writing-mode</dfn>
856+
:: Null or a 'writing-mode', initially null.
857+
858+
: <dfn>old direction</dfn>
859+
:: Null or a 'direction', initially null.
858860

859861
: <dfn>new element</dfn>
860862
:: an [=/element=] or null. Initially null.
@@ -872,12 +874,6 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
872874
: <dfn>group styles rule</dfn>
873875
:: A {{CSSStyleRule}} or null. Initially null.
874876

875-
: <dfn>old view-box rule</dfn>
876-
:: A {{CSSStyleRule}} or null. Initially null.
877-
878-
: <dfn>new view-box rule</dfn>
879-
:: A {{CSSStyleRule}} or null. Initially null.
880-
881877
: <dfn>image pair isolation rule</dfn>
882878
:: A {{CSSStyleRule}} or null. Initially null.
883879

@@ -1248,7 +1244,8 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
12481244

12491245
1. If |element| has more than one [=box fragment=], then [=continue=].
12501246

1251-
Issue: We might want to enable transitions for fragmented elements in future versions.
1247+
Note: We might want to enable transitions for fragmented elements in future versions.
1248+
See [#8900](https://github.com/w3c/csswg-drafts/issues/8900).
12521249

12531250
1. Let |transitionName| be the [=computed value=] of 'view-transition-name' for |element|.
12541251

@@ -1264,31 +1261,21 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
12641261

12651262
1. Set |capture|'s [=old image=] to the result of [=capturing the image=] of |element|.
12661263

1267-
1. Set |capture|'s [=captured element/old styles=] to the following:
1264+
1. Let |originalRect| be [=snapshot containing block=] if |element| is the [=document element=],
1265+
otherwise, the element|'s [=border box=].
12681266

1269-
: 'transform'
1270-
:: A transform that would map |element|'s [=border box=] from
1271-
the [=snapshot containing block origin=] to its current visual position.
1272-
:: This value is identity for the [=document element=].
1267+
1. Set |capture|'s [=captured element/old width=] to |originalRect|'s {{DOMRect/width}}.
12731268

1274-
: 'width'
1275-
: 'height'
1276-
:: The size of the [=snapshot containing block=] if |element| is the [=document element=],
1277-
otherwise, the width and height of |element|'s border box.
1269+
1. Set |capture|'s [=captured element/old height=] to |originalRect|'s {{DOMRect/height}}.
12781270

1279-
: 'object-view-box'
1280-
:: ''object-view-box/none'' if |element| is the [=document element=],
1281-
otherwise, an 'object-view-box' value that, when applied to the old image,
1282-
will cause the view box to coincide with |element|'s [=border box=] in the image.
1283-
This must be expressed using ''&lt;basic-shape&gt;/inset()''.
1271+
1. Set |capture|'s [=captured element/old transform=] to a
1272+
<a data-xref-type="css-type">&lt;transform-function&gt;</a> that would map
1273+
|element|'s [=border box=] from the [=snapshot containing block origin=] to its
1274+
current visual position.
12841275

1285-
: 'writing-mode'
1286-
:: The 'writing-mode' of |element|.
1276+
1. Set |capture|'s [=captured element/old writing-mode] to the [=computed value=] of 'writing-mode' on |element|.
12871277

1288-
: 'direction'
1289-
:: The 'direction' of |element|.
1290-
1291-
Issue: This needs proper types.
1278+
1. Set |capture|'s [=captured element/old direction] to the [=computed value=] of 'direction' on |element|.
12921279

12931280
1. Set |namedElements|[|transitionName|] to |capture|.
12941281
</div>
@@ -1363,20 +1350,6 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
13631350

13641351
1. Append |old| to |imagePair|.
13651352

1366-
1. Let |oldViewBox| be |capturedElement|'s [=captured element/old styles=] 'object-view-box' property.
1367-
1368-
1. Set |capturedElement|'s [=captured element/old view-box rule=] to a new {{CSSStyleRule}} representing the following CSS,
1369-
and append it to |document|'s [=document/view transition style sheet=].
1370-
1371-
<!-- deliberately using <pre> so the example can contain <var> references -->
1372-
<pre highlight="css">
1373-
:root::view-transition-old(<var>transitionName</var>) {
1374-
object-view-box: <var>oldViewBox</var>;
1375-
}
1376-
</pre>
1377-
1378-
Note: The above code example contains variables to be replaced.
1379-
13801353
1. If |capturedElement|'s [=new element=] is not null, then:
13811354

13821355
1. Let |new| be a new ''::view-transition-new()'',
@@ -1395,11 +1368,11 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
13951368
1. If both of |capturedElement|'s [=captured element/old image=] and [=captured element/new element=]
13961369
are not null, then:
13971370

1398-
1. Let |transform| be |capturedElement|'s [=captured element/old styles=]'s 'transform' property.
1371+
1. Let |transform| be |capturedElement|'s [=captured element/old transform=].
13991372

1400-
1. Let |width| be |capturedElement|'s [=captured element/old styles=]'s 'width' property.
1373+
1. Let |width| be |capturedElement|'s [=captured element/old width=].
14011374

1402-
1. Let |height| be |capturedElement|'s [=captured element/old styles=]'s 'height' property.
1375+
1. Let |height| be |capturedElement|'s [=captured element/old height=].
14031376

14041377
1. Set |capturedElement|'s [=captured element/group keyframes=] to a new {{CSSKeyframesRule}} representing the following CSS,
14051378
and append it to |document|'s [=document/view transition style sheet=]:
@@ -1663,15 +1636,15 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
16631636

16641637
1. If |capturedElement|'s [=new element=] is null, then:
16651638

1666-
1. Set |width| to |capturedElement|'s [=captured element/old styles=] 'width' property.
1639+
1. Set |width| to |capturedElement|'s [=captured element/old width=].
16671640

1668-
1. Set |height| to |capturedElement|'s [=captured element/old styles=] 'height' property.
1641+
1. Set |height| to |capturedElement|'s [=captured element/old height=].
16691642

1670-
1. Set |transform| to |capturedElement|'s [=captured element/old styles=] 'transform' property.
1643+
1. Set |transform| to |capturedElement|'s [=captured element/old transform=].
16711644

1672-
1. Set |writingMode| to |capturedElement|'s [=captured element/old styles=] 'writing-mode' property.
1645+
1. Set |writingMode| to |capturedElement|'s [=captured element/old writing-mode=].
16731646

1674-
1. Set |direction| to |capturedElement|'s [=captured element/old styles=] 'direction' property.
1647+
1. Set |direction| to |capturedElement|'s [=captured element/old direction=].
16751648

16761649
1. Otherwise:
16771650

@@ -1719,25 +1692,6 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
17191692

17201693
1. Set |new|'s [=replaced element=] content to the result of [=capturing the image=] of |capturedElement|'s [=new element=].
17211694

1722-
1. Let |newViewBox| be an ''object-view-box'' value that when applied to |new|,
1723-
will cause the view box to coincide with |capturedElement|'s [=new element=]'s [=border box=] in the image.
1724-
This must be expressed using ''&lt;basic-shape&gt;/inset()''.
1725-
1726-
1. If |capturedElement|'s [=captured element/new view-box rule=] is null,
1727-
then set |capturedElement|'s [=captured element/new view-box rule=] to a new {{CSSStyleRule}} representing the following CSS,
1728-
and append it to |document|'s [=document/view transition style sheet=].
1729-
1730-
Otherwise, update |capturedElement|'s [=captured element/new view-box rule=] to match the following CSS:
1731-
1732-
<!-- deliberately using <pre> so the example can contain <var> references -->
1733-
<pre highlight="css">
1734-
:root::view-transition-new(<var>transitionName</var>) {
1735-
object-view-box: <var>newViewBox</var>;
1736-
}
1737-
</pre>
1738-
1739-
Note: The above code example contains variables to be replaced.
1740-
17411695
This algorithm must be executed to update styles in [=user-agent origin=] if its effects can be observed by a web API.
17421696

17431697
Note: An example of such a web API is `window.getComputedStyle(document.documentElement, "::view-transition")`.

css-viewport/Overview.bs

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ Issue: Specify extend-to-zoom behavior by the viewport meta tag
271271

272272
Issue: Move the definition of ''visual viewport'' from CSSOM-View to this spec.
273273

274-
The <dfn><code>interactive-widget</code></dfn> property specifies the effect that interactive UI
274+
The <dfn export><code>interactive-widget</code></dfn> property specifies the effect that interactive UI
275275
widgets have on the page's viewports. It defines whether widgets overlay a given viewport or whether
276276
the viewport is shrunken so that it remains fully visible while the widget is showing. Interactive
277277
UI widgets are transient user agent or operating system UI through which a user can provide input.

0 commit comments

Comments
 (0)