Skip to content

Commit 43b2e46

Browse files
committed
[motion-1] Per WG resolution, add offset-position:normal that doesn't override the normal position defaulting, and add an 'at ' to ray(). #504
1 parent 33b2f8e commit 43b2e46

File tree

1 file changed

+47
-17
lines changed

1 file changed

+47
-17
lines changed

motion-1/Overview.bs

Lines changed: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Values have the following meanings:
165165
: <>
166166
::
167167
The [=offset path=] is a line
168-
extending from the [=offset starting position=]
168+
extending from the [=ray()/origin=]
169169
at some angle.
170170
See [[#ray-function]] for details.
171171

@@ -197,10 +197,14 @@ Values have the following meanings:
197197
The [=offset path=] is the [=<basic-shape>/equivalent path=]
198198
of the <> function.
199199

200-
If ''circle()'' or ''ellipse()'' is used,
201-
and an explicit center position is not given,
202-
they default to using the [=offset starting position=],
203-
rather than their standard default.
200+
For all <>s,
201+
if they accept an ''at <>'' argument
202+
but that argument is omitted,
203+
and the element defines an [=offset starting position=]
204+
via 'offset-position',
205+
it uses the specified [=offset starting position=]
206+
for that argument.
207+
Otherwise it defaults as specified for each function.
204208

205209
The <> provides the [=/reference box=]
206210
for the <>.
@@ -236,7 +240,7 @@ The ''ray()'' function defines an [=offset path=]
236240
as a straight line emerging from a point at some defined angle:
237241

238242
239-
ray() = ray( <> && <>? && contain? )
243+
ray() = ray( <> && <>? && contain? && [at <>]? )
240244
241245
<ray-size> = closest-side | closest-corner | farthest-side | farthest-corner | sides
242246
@@ -338,6 +342,28 @@ Its arguments are:
338342
In other conditions this will act similarly
339343
but might not give quite as optimal a result.
340344
345+
346+
: at <>
347+
::
348+
Specifies the origin of the ray,
349+
where the ray's line begins
350+
(the 0% position).
351+
It's resolved by using the <>
352+
to position a 0x0 object area
353+
within the box's [=containing block=].
354+
355+
If omitted, it uses the [=offset starting position=]
356+
of the element,
357+
given by 'offset-position'.
358+
359+
If the element doesn't have an [=offset starting position=] either,
360+
it behaves as ''at center''.
361+
362+
Note: ''ray()'' is currently only usable as an [=offset path=].
363+
If it ever gets extended to other uses,
364+
its usage of 'offset-position'
365+
will be limited solely to when it's an [=offset path=],
366+
similar to other <> functions.
341367
342368

343369
Issue: all of these examples need to be rewritten.
@@ -752,34 +778,38 @@ Starting Point Of The Path: the 'offset-position' property {#offset-position-pro
752778

753779
754780
Name: offset-position
755-
Value: auto | <>
781+
Value: normal | auto | <>
756782
Initial: auto
757783
Media: visual
758784
Inherited: no
759785
Applies to: [=transformable elements=]
760786
Percentages: Refer to the size of containing block
761-
Computed value: The ''offset-position/auto'' keyword or a computed <>
787+
Computed value: The ''offset-position/normal'' or ''offset-position/auto'' keywords, or a computed <>
762788
Animation type: by computed value
763789
764790

765791
Specifies the offset starting position
766-
that is used by some of the <> functions,
767-
generally as a starting or "central" point.
768-
769-
Issue: Currently, ''circle()'' and ''ellipse()'' [=offset paths=]
770-
use this position as their center,
771-
if the center position is omitted from their arguments.
772-
This is not an initial position, obviously.
773-
Whether this is desired is being discussed in
774-
792+
that is used by the <> functions
793+
if they don't specify their own starting position.
775794

776795
Values are defined as follows:
777796

778797
798+
: normal
799+
::
800+
The element does not have an [=offset starting position=].
801+
779802
: auto
780803
::
781804
The [=offset starting position=] is the top-left corner of the box.
782805

806+
Note: This is the top-left corner of the element's own box,
807+
not that of its [=containing block=]!
808+
It's completely different from specifiying ''top left''.
809+
It's meant, for example,
810+
to allow a ''path()'' to start relative
811+
to the element's own position.
812+
783813
: <>
784814
::
785815
The [=offset starting position=] is the result of using the <>

0 commit comments

Comments
 (0)