Skip to content

Commit 297b97a

Browse files
committed
Percentage values on transform properties are relative to the bounding box of the referencing element on resources.
1 parent dc2c938 commit 297b97a

3 files changed

Lines changed: 22 additions & 63 deletions

File tree

css3-transforms/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2012-10-26 dschulze@adobe.com
2+
Percentage values on transform properties are relative to the bounding box of the referencing element on resources.
3+
https://www.w3.org/Bugs/Public/show_bug.cgi?id=19638
4+
15
2012-10-21 dschulze@adobe.com
26
Define that translation units on matrices are in CSS pixel in the current coordinate system.
37

css3-transforms/Overview.html

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
rel=dcterms.rights>
1313
<meta content="CSS Transforms" name=dcterms.title>
1414
<meta content=text name=dcterms.type>
15-
<meta content=2012-10-22 name=dcterms.issued>
15+
<meta content=2012-10-26 name=dcterms.issued>
1616
<meta content="http://dev.w3.org/csswg/css3-transforms/"
1717
name=dcterms.creator>
1818
<meta content=W3C name=dcterms.publisher>
19-
<meta content="http://www.w3.org/TR/2012/ED-css3-transforms-20121022/"
19+
<meta content="http://www.w3.org/TR/2012/ED-css3-transforms-20121026/"
2020
name=dcterms.identifier>
2121
<link href="../default.css" rel=stylesheet type="text/css">
2222
<script defer=defer
@@ -26,19 +26,6 @@
2626
.term {
2727
font-style: italic;
2828
}
29-
30-
.todo {
31-
font-weight: bold;
32-
border-left: 0.5em solid #f44;
33-
padding-left: 1em;
34-
margin-top: 0.5em;
35-
color: #a0a0a0;
36-
}
37-
38-
.todo:before {
39-
content: "TO DO : ";
40-
color: #f44;
41-
}
4229
</style>
4330
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
4431
type="text/css">
@@ -50,15 +37,15 @@
5037

5138
<h1>CSS Transforms</h1>
5239

53-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 22 October
40+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 26 October
5441
2012</h2>
5542

5643
<dl>
5744
<dt>This version:
5845

5946
<dd> <a
60-
href="http://www.w3.org/TR/2012/ED-css3-transforms-20121022/">http://dev.w3.org/csswg/css3-transforms/</a>
61-
<!--http://www.w3.org/TR/2012/WD-css3-transforms-20121022/-->
47+
href="http://www.w3.org/TR/2012/ED-css3-transforms-20121026/">http://dev.w3.org/csswg/css3-transforms/</a>
48+
<!--http://www.w3.org/TR/2012/WD-css3-transforms-20121026/-->
6249

6350
<dt>Latest version:
6451

@@ -2045,14 +2032,9 @@ <h3 id=svg-user-coordinate-space><span class=secno>13.6. </span> User
20452032
time when these elements are referenced (i.e., the user coordinate system
20462033
for the element referencing the ‘<code class=property>pattern</code>
20472034
element via a ‘<code class=property>fill</code>’ or ‘<code
2048-
class=property>stroke</code>’ property).
2049-
2050-
<p class=issue> Should percentage values on transforms be relative the
2051-
viewport (the case for all other attributes on the mentioned attributes),
2052-
or should the be reletive the referencing objects bounding box (like it is
2053-
for all other transformable elements). The later choice seems to be more
2054-
consistent within CSS Transforms. See <a
2055-
href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=19638">Bug 19638</a>.
2035+
class=property>stroke</code>’ property). Percentage values are relative
2036+
to the <a href="#bounding-box">bounding box</a> of the referencing
2037+
element.
20562038

20572039
<p> In particualar the ‘<code class=property>patternUnit</code>’,
20582040
<code class=property>gradientUnit</code>’ and ‘<code
@@ -2069,11 +2051,6 @@ <h3 id=svg-user-coordinate-space><span class=secno>13.6. </span> User
20692051
to the element's <a class=term href="#bounding-box">bounding box</a>.
20702052

20712053
<div class=example>
2072-
<p class=issue> The result in the example below depends on the decision
2073-
made on the previous issue. See <a
2074-
href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=19638">Bug
2075-
19638</a>.
2076-
20772054
<p> The ‘<a href="#transform-origin"><code
20782055
class=property>transform-origin</code></a>’ property on the pattern in
20792056
the following example specifies a ‘<code class=css>50%</code>
@@ -2095,7 +2072,7 @@ <h3 id=svg-user-coordinate-space><span class=secno>13.6. </span> User
20952072
&lt;/pattern&gt;
20962073
&lt;/defs&gt;
20972074

2098-
&lt;rect width="100" height="100" fill="url(#pattern-1)" /&gt;
2075+
&lt;rect width="200" height="200" fill="url(#pattern-1)" /&gt;
20992076
&lt;/svg&gt;</pre>
21002077

21012078
<p> An SVG ‘<code class=property>pattern</code>’ element doesn't have
@@ -2104,7 +2081,7 @@ <h3 id=svg-user-coordinate-space><span class=secno>13.6. </span> User
21042081
instead to solve the relative values of the ‘<a
21052082
href="#transform-origin"><code
21062083
class=property>transform-origin</code></a>’ property. Therefore the
2107-
point of origin will get translated by 50 pixels temporarily to rotate
2084+
point of origin will get translated by 100 pixels temporarily to rotate
21082085
the user space of the ‘<code class=property>pattern</code>’ elements
21092086
content.
21102087
</div>
@@ -3176,7 +3153,7 @@ <h2 id=mathematical-description><span class=secno>21. </span> Mathematical
31763153
alt="\begin{bmatrix} m11 & m21 & m31 & m41 \\ m12 & m22 & m32 & m42 \\ m13 & m23 & m33 & m43 \\ m14 & m24 & m34 & m44 \end{bmatrix}"
31773154
height=106 src=4x4matrix.png width=222>
31783155

3179-
<p>One translation unit on a matrix is equivalent to 1 pixel in the local
3156+
<p> One translation unit on a matrix is equivalent to 1 pixel in the local
31803157
coordinate system of the element.
31813158

31823159
<ul>

css3-transforms/Transforms.src.html

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,6 @@
1010
.term {
1111
font-style: italic;
1212
}
13-
14-
.todo {
15-
font-weight: bold;
16-
border-left: 0.5em solid #f44;
17-
padding-left: 1em;
18-
margin-top: 0.5em;
19-
color: #a0a0a0;
20-
}
21-
22-
.todo:before {
23-
content: "TO DO : ";
24-
color: #f44;
25-
}
2613
</style>
2714
<link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" >
2815

@@ -1912,14 +1899,8 @@ <h3 id="svg-user-coordinate-space">
19121899
attributes represents values in the current user coordinate system in place at the
19131900
time when these elements are referenced (i.e., the user coordinate system for the
19141901
element referencing the 'pattern' element via a 'fill' or 'stroke' property).
1915-
</p>
1916-
1917-
<p class="issue">
1918-
Should percentage values on transforms be relative the viewport (the case for all
1919-
other attributes on the mentioned attributes), or should the be reletive the
1920-
referencing objects bounding box (like it is for all other transformable elements).
1921-
The later choice seems to be more consistent within CSS Transforms.
1922-
See <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=19638">Bug 19638</a>.
1902+
Percentage values are relative to the <span>bounding box</span> of the
1903+
referencing element.
19231904
</p>
19241905

19251906
<p>
@@ -1935,11 +1916,6 @@ <h3 id="svg-user-coordinate-space">
19351916
</p>
19361917

19371918
<div class="example">
1938-
<p class="issue">
1939-
The result in the example below depends on the decision made on the previous issue.
1940-
See <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=19638">Bug 19638</a>.
1941-
</p>
1942-
19431919
<p>
19441920
The 'transform-origin' property on the pattern in the following example specifies
19451921
a ''50%'' translation of the origin in the horizontal and vertical dimension. The
@@ -1960,14 +1936,14 @@ <h3 id="svg-user-coordinate-space">
19601936
&lt;/pattern&gt;
19611937
&lt;/defs&gt;
19621938

1963-
&lt;rect width="100" height="100" fill="url(#pattern-1)" /&gt;
1939+
&lt;rect width="200" height="200" fill="url(#pattern-1)" /&gt;
19641940
&lt;/svg&gt;</pre>
19651941

19661942
<p>
19671943
An SVG 'pattern' element doesn't have a bounding box. The <span
19681944
class="term">bounding box</span> of the referencing 'rect' element is used
19691945
instead to solve the relative values of the 'transform-origin' property. Therefore
1970-
the point of origin will get translated by 50 pixels temporarily to rotate the
1946+
the point of origin will get translated by 100 pixels temporarily to rotate the
19711947
user space of the 'pattern' elements content.
19721948
</p>
19731949
</div>
@@ -3060,7 +3036,9 @@ <h2 id="mathematical-description">
30603036
</p>
30613037
<p>
30623038
<img src="4x4matrix.png" alt="\begin{bmatrix} m11 & m21 & m31 & m41 \\ m12 & m22 & m32 & m42 \\ m13 & m23 & m33 & m43 \\ m14 & m24 & m34 & m44 \end{bmatrix}" width="222" height="106">
3063-
<p>One translation unit on a matrix is equivalent to 1 pixel in the local coordinate system of the element.</p>
3039+
<p>
3040+
One translation unit on a matrix is equivalent to 1 pixel in the local coordinate system of the element.
3041+
</p>
30643042

30653043
<ul>
30663044
<li id="MatrixDefined">

0 commit comments

Comments
 (0)