Skip to content

Commit 6167395

Browse files
author
gregwhitworth
committed
Merge branch 'master' of github.com:w3c/csswg-drafts
2 parents 606374a + e516e9f commit 6167395

4 files changed

Lines changed: 97 additions & 40 deletions

File tree

css-color/Overview.bs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,18 +1769,15 @@ Implementations may choose to implement these steps in some other way (for examp
17691769
using an ICC profile with relative colorimetric rendering intent) provided the results
17701770
are the same for colors inside the source and destination gamuts.
17711771

1772-
<h3 id="at-profile">Specifying a color profile: the ''profile'' at-rule</h3>
1773-
<!-- we agreed to call it profile rather than color-profile or icc-profile, for brevity -->
1772+
<h3 id="at-profile">Specifying a color profile: the ''color-profile'' at-rule</h3>
17741773

17751774
The <dfn data-dfn-type='at-rule' id="at-ruledef-profile">@color-profile</dfn>
17761775
rule is a group rule. It consists of the at-keyword
1777-
'@color-profile' followed by an identifier, followed by a group rule body.
1776+
'@color-profile' followed by a name, followed by a group rule body.
17781777

17791778
In a very similar way to the ''<@font-face.'' at-rule, the ''<@color-profile>''
1780-
at-rule has a descriptor
1781-
to give the profile a name which will be used inside the stylesheet,
1782-
<!-- is this actualy a descriptor, or a parameter to the at-rule?-->
1783-
and another descriptor to point to the actual
1779+
at-rule has a name (which will be used inside the stylesheet),
1780+
and a descriptor to point to the actual
17841781
data (<dfn for="@color-profile/src">src</dfn>, just like
17851782
<dfn for="@font-face/src">src</dfn> in font-face.)
17861783
<!-- not clear how I link to the two different descriptors therte, in bikeshed syntax -->

css-color/conversions.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,53 @@ function XYZ_to_lin_sRGB(XYZ) {
5050
return math.multiply(M, XYZ).valueOf();
5151
}
5252

53+
// DCI P3-related functions
54+
55+
56+
function lin_P3(RGB) {
57+
// convert an array of DCI P3 RGB values in the range 0.0 - 1.0
58+
// to linear light (un-companded) form.
59+
60+
return RGB.map(function (val) {
61+
return Math.pow(val, 2.6);
62+
});
63+
}
64+
65+
function gam_P3(RGB) {
66+
// convert an array of linear-light P3 RGB in the range 0.0-1.0
67+
// to gamma corrected form
68+
69+
return RGB.map(function (val) {
70+
return Math.pow(val, 1/2.6);
71+
}
72+
});
73+
}
74+
75+
function lin_P3_to_XYZ(rgb) {
76+
// convert an array of linear-light P3 values to CIE XYZ
77+
// using D65 (no chromatic adaptation)
78+
// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
79+
var M = math.matrix([
80+
[0.4865709486482162, 0.26566769316909306, 0.1982172852343625],
81+
[0.2289745640697488, 0.6917385218365064, 0.079286914093745],
82+
[0.0000000000000000, 0.04511338185890264, 1.043944368900976]
83+
]);
84+
// 0 was computed as -3.972075516933488e-17
85+
86+
return math.multiply(M, rgb).valueOf();
87+
}
88+
89+
function XYZ_to_lin_P3(XYZ) {
90+
// convert XYZ to linear-light P3
91+
var M = math.matrix([
92+
[ 2.493496911941425, -0.9313836179191239, -0.40271078445071684],
93+
[-0.8294889695615747, 1.7626640603183463, 0.023624685841943577],
94+
[ 0.03584583024378447, -0.07617238926804182, 0.9568845240076872]
95+
]);
96+
97+
return math.multiply(M, XYZ).valueOf();
98+
}
99+
53100
//Rec.2020-related functions
54101

55102
function lin_2020(RGB) {

css-color/matrixmaker.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
// these are for ITU Rec BT.2020
16-
16+
/*
1717
const xred=0.708 ;
1818
const yred=0.292 ;
1919
@@ -22,7 +22,17 @@
2222
2323
const xblue=0.131 ;
2424
const yblue=0.046 ;
25+
*/
26+
27+
// these are for DCI P3
28+
const xred=0.680 ;
29+
const yred=0.320 ;
2530

31+
const xgreen=0.265 ;
32+
const ygreen=0.690 ;
33+
34+
const xblue=0.150 ;
35+
const yblue=0.060 ;
2636

2737
// AdobeRGB, for testing
2838
/*

css-snappoints/Overview.bs

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Introduction {#intro}
3838
which leaves a page partially on-screen when panning.
3939

4040
To this end, we introduce scroll snap positions
41-
which enforce the scroll offsets that a <a>scroll container's</a> visual viewport may end at
41+
which enforce the scroll offsets that a <a>scroll container's</a> scrollport may end at
4242
after a scrolling operation has completed.
4343

4444
Module interactions {#placement}
@@ -77,7 +77,7 @@ Motivating Examples {#examples}
7777
are used to build a photo gallery. In this example the <a>scroll container</a>
7878
is larger than the photos contained within (such that multiple images may be seen simultaneously), and the image
7979
sizes vary. Using mandatory element-based snap
80-
positions, scrolling will always complete with an image centered in the <a>scroll container's</a> visual viewport.
80+
positions, scrolling will always complete with an image centered in the <a>scroll container's</a> scrollport.
8181

8282
<pre class="lang-css">
8383
img {
@@ -113,7 +113,7 @@ Motivating Examples {#examples}
113113

114114
<figcaption>
115115
The layout of the scroll container's contents in the example.
116-
The snap alignment container is represented by the red rectangle, and the snap area is represented by the yellow rectangle. Since the scroll-snap-align is "center" in the X axis, a snap position is established at each scroll offset which aligns the X-center of the snap alignment container (represented by a red dotted line) with the X-center of a snap area (represented by a yellow dotted line).
116+
The snapport is represented by the red rectangle, and the snap area is represented by the yellow rectangle. Since the scroll-snap-align is "center" in the X axis, a snap position is established at each scroll offset which aligns the X-center of the snapport (represented by a red dotted line) with the X-center of a snap area (represented by a yellow dotted line).
117117
</figcaption>
118118
</figure>
119119
</div>
@@ -158,7 +158,7 @@ Motivating Examples {#examples}
158158

159159
<figcaption>
160160
The layout of the scroll container's contents in the example.
161-
The snap alignment container is represented by the red rectangle (inset from the top by 100px due to the scroll-snap-padding), and the snap area is represented by the yellow rectangle. Since the scroll-snap-align is "start" in the Y axis, a snap position is established at each scroll offset which aligns the Y-start of the snap alignment container (represented by a red dotted line) with the Y-start of a snap area (represented by a yellow dotted line).
161+
The snapport is represented by the red rectangle (inset from the top by 100px due to the scroll-snap-padding), and the snap area is represented by the yellow rectangle. Since the scroll-snap-align is "start" in the Y axis, a snap position is established at each scroll offset which aligns the Y-start of the snapport (represented by a red dotted line) with the Y-start of a snap area (represented by a yellow dotted line).
162162
</figcaption>
163163
</figure>
164164
</div>
@@ -187,8 +187,8 @@ Overview {#overview}
187187
<a>Snap positions</a> can be specified
188188
as a particular alignment ('scroll-snap-align')
189189
of an element's <a>scroll snap area</a> ('scroll-snap-margin', defaulting to its border box)
190-
within the <a>scroll container</a>’s <a>snap alignment container</a>
191-
(its visual viewport, as reduced by its 'scroll-snap-padding').
190+
within the <a>scroll container</a>’s <a>snapport</a>
191+
(its scrollport, as reduced by its 'scroll-snap-padding').
192192
This is conceptually equivalent to specifying the alignment of
193193
an <a>alignment subject</a> within an <a>alignment container</a>.
194194
A scroll position that satisfies the specified alignment
@@ -216,9 +216,9 @@ Definitions {#definitions}
216216
<dd>
217217
An element which provides a scrolling user interface as described in [[!CSS21]], particularly in the section on overflow.
218218

219-
<dt><dfn export>snap alignment container</dfn>
219+
<dt><dfn export>snapport</dfn>
220220
<dd>
221-
A scroll container's snap alignment container is the rectangle obtained by reducing its visual viewport by its 'scroll-snap-padding'.
221+
A scroll container's snapport is the rectangle obtained by reducing its scrollport by its 'scroll-snap-padding'.
222222

223223
Issue: Better name for this concept?
224224

@@ -228,19 +228,19 @@ Definitions {#definitions}
228228

229229
<dt><dfn lt="scroll snap position" local-lt="snap position" export>snap position</dfn>
230230
<dd>
231-
For a scroll container, a particular value for its scroll offset is a snap position if when scrolled to that offset the visual viewport of the scroll container would align with a descendent element in the manner specified by the scroll snap properties.
231+
For a scroll container, a particular value for its scroll offset is a snap position if when scrolled to that offset the scrollport of the scroll container would align with a descendent element in the manner specified by the scroll snap properties.
232232

233233
<dt><dfn lt="scroll snapped" local-lt="snapped" export>snapped</dfn>
234234
<dd>
235-
A scroll container is said to be snapped to a snap position if its visual viewport's scroll offset is that snap position and there is no active scrolling operation.
235+
A scroll container is said to be snapped to a snap position if its scrollport's scroll offset is that snap position and there is no active scrolling operation.
236236

237237
<dt><dfn lt="scroll snap" local-lt="snap|snapping" export>snap</dfn>
238238
<dd>
239-
The act of adjusting the scroll offset of a scroll container's visual viewport such that it is snapped to a snap position is called snapping.
239+
The act of adjusting the scroll offset of a scroll container's scrollport such that it is snapped to a snap position is called snapping.
240240
</dl>
241241

242-
Properties on the scroll container {#properties-on-the-scroll-container}
243-
========================================================================
242+
Capturing Scroll Snap Areas: Properties on the scroll container {#properties-on-the-scroll-container}
243+
======================================================================================================
244244

245245
<!--
246246
████████ ██ ██ ████████ ████████
@@ -252,8 +252,8 @@ Properties on the scroll container {#properties-on-the-scroll-container}
252252
██ ██ ██ ████████
253253
-->
254254

255-
Scroll Snap Types: the 'scroll-snap-type' property {#scroll-snap-type}
256-
----------------------------------------------------------------------
255+
Snapping Rules: the 'scroll-snap-type' property {#scroll-snap-type}
256+
-------------------------------------------------------------------
257257

258258
<pre class="propdef">
259259
Name: scroll-snap-type
@@ -310,22 +310,22 @@ Scroll Snap Types: the 'scroll-snap-type' property {#scroll-snap-type}
310310
██ ██ ██ ████████ ████████ ████ ██ ██ ██████
311311
-->
312312

313-
Scroll Snap Padding: the 'scroll-snap-padding' property {#scroll-snap-padding}
314-
------------------------------------------------------------------------------
313+
Scroll Snapport: the 'scroll-snap-padding' property {#scroll-snap-padding}
314+
-------------------------------------------------------------------
315315

316316
<pre class="propdef">
317317
Name: scroll-snap-padding
318318
Value: [ <<length>> | <<percentage>> ]{1,4}
319319
Initial: 0
320320
Applies to: <a>scroll containers</a>
321321
Inherited: no
322-
Percentages: relative to the corresponding dimension of the scroll container's visual viewport
322+
Percentages: relative to the corresponding dimension of the scroll container's scrollport
323323
Media: interactive
324324
Computed value: as specified, with lengths made absolute
325325
Animatable: as length, percentage, or calc
326326
</pre>
327327

328-
The 'scroll-snap-padding' property defines the <a>snap alignment container</a>, a region inset from the visual viewport of a <a>scroll container</a> used in calculating its <a>snap positions</a>. The snap alignment container is used as the alignment container when calculating <a>snap positions</a>. Values are interpreted as for 'padding', and specify inward offsets from each edge of the visual viewport.
328+
The 'scroll-snap-padding' property defines the <dfn local-lt="snapport">scroll snapport</dfn>, a region inset from the scrollport of a <a>scroll container</a> used in calculating its <a>snap positions</a>. The snapport is used as the alignment container when calculating <a>snap positions</a>. Values are interpreted as for 'padding', and specify inward offsets from each edge of the scrollport.
329329

330330
<div class="example">
331331
In this example, scroll-snap-padding is used to center slideshow images within the portion of the viewport that is not obscured by a fixed-position toolbar.
@@ -351,8 +351,8 @@ Scroll Snap Padding: the 'scroll-snap-padding' property {#scroll-snap-padding}
351351

352352
This property is a <a>shorthand property</a> that sets all of the <a href="#longhands"><css>scroll-snap-padding-*</css> longhands</a> in one declaration.
353353

354-
Properties on the elements {#properties-on-the-elements}
355-
========================================================
354+
Aligning Scroll Snap Areas: Properties on the elements {#properties-on-the-elements}
355+
=====================================================================================
356356

357357
<!--
358358
███ ████████ ████████ ███
@@ -364,8 +364,8 @@ Properties on the elements {#properties-on-the-elements}
364364
██ ██ ██ ██ ████████ ██ ██
365365
-->
366366

367-
Scroll Snap Area: the 'scroll-snap-margin' property {#scroll-snap-margin}
368-
---------------------------------------------------------------------------
367+
Scroll Snapping Area: the 'scroll-snap-margin' property {#scroll-snap-margin}
368+
-----------------------------------------------------------------------------
369369

370370
<pre class="propdef">
371371
Name: scroll-snap-margin
@@ -404,8 +404,8 @@ Scroll Snap Area: the 'scroll-snap-margin' property {#scroll-snap-margin}
404404
██ ██ ████████ ████ ██████ ██ ██
405405
-->
406406

407-
Scroll Snap Alignment: the 'scroll-snap-align' property {#scroll-snap-align}
408-
----------------------------------------------------------------------------
407+
Scroll Snapping Alignment: the 'scroll-snap-align' property {#scroll-snap-align}
408+
--------------------------------------------------------------------------------
409409

410410
<pre class="propdef">
411411
Name: scroll-snap-align
@@ -419,7 +419,10 @@ Scroll Snap Alignment: the 'scroll-snap-align' property {#scroll-snap-align}
419419
Animatable: no
420420
</pre>
421421

422-
The 'scroll-snap-align' property specifies how an element's scroll snap area should align with its ancestor scroll container's snap alignment container. The two values specify the snapping behavior in the x and y axes, respectively. If only one value is specified, the second value defaults to the same value.
422+
The 'scroll-snap-align' property specifies
423+
the box's <a>snap position</a> as an alignment of
424+
its <a>snap area</a> (as the <a>alignment subject</a>)
425+
within its <a>snap container's</a> <a>snapport</a> (as the <a>alignment container</a>). The two values specify the snapping behavior in the x and y axes, respectively. If only one value is specified, the second value defaults to the same value.
423426

424427
Issue: Should this be x/y axes, or inline/block? Starting with x/y axes for consistency with padding/area, otherwise a writing mode change would result in a axis mismatch (since padding is physical by default).
425428

@@ -463,13 +466,13 @@ Physical Longhands for 'scroll-snap-padding' {#padding-longhands-physical}
463466
Initial: 0
464467
Applies to: <a>scroll containers</a>
465468
Inherited: no
466-
Percentages: relative to the scroll container's visual viewport
469+
Percentages: relative to the scroll container's scrollport
467470
Media: interactive
468471
Computed value: as specified, with lengths made absolute
469472
Animatable: as length, percentage, or calc
470473
</pre>
471474

472-
These <a>longhands</a> of 'scroll-snap-padding' specify the top, right, bottom, and left edges of the <a>snap alignment container</a>, respectively.
475+
These <a>longhands</a> of 'scroll-snap-padding' specify the top, right, bottom, and left edges of the <a>snapport</a>, respectively.
473476

474477
Flow-relative Longhands for 'scroll-snap-padding' {#padding-longhands-logical}
475478
-------------------------------------------------------------------------------
@@ -480,27 +483,27 @@ Flow-relative Longhands for 'scroll-snap-padding' {#padding-longhands-logical}
480483
Initial: 0
481484
Applies to: <a>scroll containers</a>
482485
Inherited: no
483-
Percentages: relative to the scroll container's visual viewport
486+
Percentages: relative to the scroll container's scrollport
484487
Media: interactive
485488
Computed value: as specified, with lengths made absolute
486489
Animatable: as length, percentage, or calc
487490
</pre>
488491

489-
These <a>longhands</a> of 'scroll-snap-padding' specify the block-start, inline-start, block-end, and inline-end edges of the <a>snap alignment container</a>, respectively.
492+
These <a>longhands</a> of 'scroll-snap-padding' specify the block-start, inline-start, block-end, and inline-end edges of the <a>snapport</a>, respectively.
490493

491494
<pre class="propdef">
492495
Name: scroll-snap-padding-block, scroll-snap-padding-inline
493496
Value: [ <<length>> | <<percentage>> ]{1,2}
494497
Initial: 0
495498
Applies to: all elements
496499
Inherited: no
497-
Percentages: relative to the scroll container's visual viewport
500+
Percentages: relative to the scroll container's scrollport
498501
Media: interactive
499502
Computed value: as specified, with lengths made absolute
500503
Animatable: as length, percentage, or calc
501504
</pre>
502505

503-
These <a>shorthands</a> of 'scroll-snap-padding-block-start' + 'scroll-snap-padding-block-end' and 'scroll-snap-padding-inline-start' + 'scroll-snap-padding-inline-end' are <a>longhands</a> of 'scroll-snap-padding', and specify the block-axis and inline-axis edges of the <a>snap alignment container</a>, respectively.
506+
These <a>shorthands</a> of 'scroll-snap-padding-block-start' + 'scroll-snap-padding-block-end' and 'scroll-snap-padding-inline-start' + 'scroll-snap-padding-inline-end' are <a>longhands</a> of 'scroll-snap-padding', and specify the block-axis and inline-axis edges of the <a>snapport</a>, respectively.
504507

505508
If two values are specified, the first gives the start value and the second gives the end value.
506509

0 commit comments

Comments
 (0)