Skip to content

Commit 59967dc

Browse files
committed
Resolve ambiguity in transform-origin syntax
As resolved in bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=15432
1 parent 82d0ca1 commit 59967dc

2 files changed

Lines changed: 45 additions & 66 deletions

File tree

css3-transforms/Overview.html

Lines changed: 27 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,12 +1510,16 @@ <h2 id=transform-origin-property><span class=secno>8. </span> The &lsquo;<a
15101510
<tr>
15111511
<td> <em>Value:</em>
15121512

1513-
<td> [ top | bottom ] |<br>
1514-
[ &lt;percentage> | &lt;length&gt; | left | center | right ] [
1515-
&lt;percentage> | &lt;length&gt; | top | center | bottom ]? |<br>
1516-
[ center | [ left | right ] [ &lt;percentage> | &lt;length&gt; ]? ]
1517-
&amp;&amp; [ center | [ top | bottom ] [ &lt;percentage> |
1518-
&lt;length&gt; ]? ]<br>
1513+
<td> [ &lt;percentage> | &lt;length> | left | center | right | top |
1514+
bottom]<br>
1515+
|<br>
1516+
[<br>
1517+
&nbsp;&nbsp;[ &lt;percentage> | &lt;length&gt; | left | center | right
1518+
]<br>
1519+
&nbsp;&nbsp;&amp;&amp;<br>
1520+
&nbsp;&nbsp;[ &lt;percentage> | &lt;length&gt; | top | center | bottom
1521+
]<br>
1522+
] &lt;length&gt;?<br>
15191523

15201524
<tr>
15211525
<td> <em>Initial:</em>
@@ -1557,37 +1561,22 @@ <h2 id=transform-origin-property><span class=secno>8. </span> The &lsquo;<a
15571561
matrix</i></a>, as described above.
15581562

15591563
<p>If only one value is specified, the second value is assumed to be
1560-
&lsquo;<code class=property>center</code>&rsquo;. If two values are given
1561-
and at least one value is not a keyword, then the first value represents
1562-
the horizontal position (or offset) and the second represents the vertical
1563-
position (or offset). <var>&lt;percentage&gt;</var> and
1564-
<var>&lt;length&gt;</var> values here represent an offset of the transform
1565-
origin from the top left corner of the element's bounding box.
1564+
&lsquo;<code class=property>center</code>&rsquo;. If one or two values are
1565+
specified, the third value is assumed to be &lsquo;<code
1566+
class=css>0px</code>&rsquo;.
1567+
1568+
<p>If at least one of the first two values is not a keyword, then the first
1569+
value represents the horizontal position (or offset) and the second
1570+
represents the vertical position (or offset). The third value always
1571+
represents the Z position (or offset).
1572+
1573+
<p><var>&lt;percentage&gt;</var> and <var>&lt;length&gt;</var> for the
1574+
first two values represent an offset of the transform origin from the top
1575+
left corner of the element's bounding box.
15661576

15671577
<p>For SVG elements without an associated CSS layout box the
15681578
<var>&lt;length&gt;</var> values represent an offset from the point of
1569-
origin of the element's local coordinate space.
1570-
1571-
<p>If three or four values are given, then each
1572-
<var>&lt;percentage&gt;</var> or<var>&lt;length&gt;</var> represents an
1573-
offset and must be preceded by a keyword, which specifies from which edge
1574-
of the bounding box the offset is given. For example, &lsquo;<code
1575-
class=css>transform-origin: bottom 10px right 20px</code>&rsquo;
1576-
represents a &lsquo;<code class=css>10px</code>&rsquo; vertical offset up
1577-
from the bottom edge and a &lsquo;<code class=css>20px</code>&rsquo;
1578-
horizontal offset leftward from the right edge. If three values are given,
1579-
the missing offset is assumed to be zero.
1580-
1581-
<p>Positive values represent an offset <em>inward</em> from the edge of the
1582-
bounding box. Negative values represent an offset <em>outward</em> from
1583-
the edge of the bounding box.
1584-
1585-
<div class=issue>
1586-
<p class=desc>Need to add 3D transform-origin variant in a way that is not
1587-
ambiguous with the background-origin syntax (<a
1588-
href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15432">bug
1589-
15432</a>).</p>
1590-
</div>
1579+
origin of the element's local coordinate space.</p>
15911580
<!-- ======================================================================================================= -->
15921581

15931582
<h2 id=transform-style-property><span class=secno>9. </span> The &lsquo;<a
@@ -2570,11 +2559,10 @@ <h2 class=no-num id=property-index>Property index</h2>
25702559
<tr>
25712560
<th><a class=property href="#transform-origin">transform-origin</a>
25722561

2573-
<td>[ top | bottom ] | [ &lt;percentage> | &lt;length&gt; | left |
2574-
center | right ] [ &lt;percentage> | &lt;length&gt; | top | center |
2575-
bottom ]? | [ center | [ left | right ] [ &lt;percentage> |
2576-
&lt;length&gt; ]? ] &amp;&amp; [ center | [ top | bottom ] [
2577-
&lt;percentage> | &lt;length&gt; ]? ]
2562+
<td>[ &lt;percentage> | &lt;length> | left | center | right | top |
2563+
bottom] | [ &nbsp;&nbsp;[ &lt;percentage> | &lt;length&gt; | left |
2564+
center | right ] &nbsp;&nbsp;&amp;&amp; &nbsp;&nbsp;[ &lt;percentage> |
2565+
&lt;length&gt; | top | center | bottom ] ] &lt;length&gt;?
25782566

25792567
<td>0 0 for SVG elements without associated CSS layout box, 50% 50% for
25802568
all other elements

css3-transforms/Transforms.src.html

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,9 +1045,13 @@ <h2 id="transform-origin-property">
10451045
<em>Value:</em>
10461046
</td>
10471047
<td>
1048-
[ top | bottom ] |<br>
1049-
[ &lt;percentage> | &lt;length&gt; | left | center | right ] [ &lt;percentage> | &lt;length&gt; | top | center | bottom ]? |<br>
1050-
[ center | [ left | right ] [ &lt;percentage> | &lt;length&gt; ]? ] &amp;&amp; [ center | [ top | bottom ] [ &lt;percentage> | &lt;length&gt; ]? ]<br>
1048+
[ &lt;percentage> | &lt;length> | left | center | right | top | bottom]<br>
1049+
|<br>
1050+
[<br>
1051+
&nbsp;&nbsp;[ &lt;percentage> | &lt;length&gt; | left | center | right ]<br>
1052+
&nbsp;&nbsp;&amp;&amp;<br>
1053+
&nbsp;&nbsp;[ &lt;percentage> | &lt;length&gt; | top | center | bottom ]<br>
1054+
] &lt;length&gt;?<br>
10511055
</td>
10521056
</tr>
10531057
<tr>
@@ -1108,38 +1112,25 @@ <h2 id="transform-origin-property">
11081112
</p>
11091113

11101114
<p>If only one value is specified, the second value is assumed to be
1111-
'center'. If two values are given and at least one value is not a keyword,
1112-
then the first value represents the horizontal position (or offset) and
1113-
the second represents the vertical position (or
1114-
offset). <var>&lt;percentage&gt;</var> and <var>&lt;length&gt;</var>
1115-
values here represent an offset of the transform origin from the top left corner
1116-
of the element's bounding box.
1115+
'center'. If one or two values are specified, the third value is
1116+
assumed to be '0px'.
11171117
</p>
11181118

1119-
<p>For SVG elements without an associated CSS layout box the <var>&lt;length&gt;</var>
1120-
values represent an offset from the point of origin of the element's local coordinate space.
1119+
<p>If at least one of the first two values is not a keyword, then
1120+
the first value represents the horizontal position (or offset)
1121+
and the second represents the vertical position (or offset). The
1122+
third value always represents the Z position (or offset).
11211123
</p>
11221124

1123-
<p>If three or four values are given, then
1124-
each <var>&lt;percentage&gt;</var> or<var>&lt;length&gt;</var>
1125-
represents an offset and must be preceded by a keyword,
1126-
which specifies from which edge of the bounding box the offset is given. For example,
1127-
''transform-origin: bottom 10px right 20px'' represents a
1128-
''10px'' vertical offset up from the bottom edge and a
1129-
''20px'' horizontal offset leftward from the right edge. If
1130-
three values are given, the missing offset is assumed to be zero.
1125+
<p><var>&lt;percentage&gt;</var> and <var>&lt;length&gt;</var>
1126+
for the first two values represent an offset of the transform
1127+
origin from the top left corner of the element's bounding box.
11311128
</p>
11321129

1133-
<p>Positive values represent an offset <em>inward</em> from the edge of
1134-
the bounding box. Negative values represent an offset
1135-
<em>outward</em> from the edge of the bounding box.
1130+
<p>For SVG elements without an associated CSS layout box the <var>&lt;length&gt;</var>
1131+
values represent an offset from the point of origin of the element's local coordinate space.
11361132
</p>
11371133

1138-
<div class="issue">
1139-
<p class="desc">Need to add 3D transform-origin variant in a way that is not ambiguous
1140-
with the background-origin syntax (<a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=15432">bug 15432</a>).</p>
1141-
</div>
1142-
11431134
<!-- ======================================================================================================= -->
11441135

11451136
<h2 id="transform-style-property">

0 commit comments

Comments
 (0)