Skip to content

Commit 04f5119

Browse files
committed
Swapped keywords back to their earlier meaning and added an issue over them, for WD publication.
1 parent c297b9f commit 04f5119

2 files changed

Lines changed: 57 additions & 73 deletions

File tree

css3-images/Overview.html

Lines changed: 39 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<h1>CSS Image Values and Replaced Content Module Level 3</h1>
2222

23-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 9 June 2011</h2>
23+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 1 July 2011</h2>
2424

2525
<dl>
2626
<dt>Latest Version:
@@ -433,10 +433,11 @@ <h3 id=url><span class=secno>4.1. </span> Image References and Image
433433
the SVG directly.</small></p>
434434
</div>
435435

436-
<p class=note>Note however that a UA that doesn't understand the media
437-
fragments notation will display the entirety an image specified with
438-
&lsquo;<code class=css>url</code>&rsquo;. However, since URLs with media
439-
fragment identifiers can also be used in the &lsquo;<code
436+
<p class=note>Unfortunately, a UA that doesn't understand the media
437+
fragments notation will ignore the fragment and simply display the
438+
entirety of an image specified with &lsquo;<code
439+
class=css>url</code>&rsquo;. However, since URLs with media fragment
440+
identifiers can also be used in the &lsquo;<code
440441
class=css>image()</code>&rsquo; notation defined below, authors can take
441442
advantage of CSS's forward-compatible parsing rules to provide a fallback
442443
when using an image fragment URL:
@@ -780,28 +781,22 @@ <h4 class=no-toc id=linear-gradient-syntax><span class=secno>5.1.1. </span>
780781
<a href="#gradient-line"><i>gradient-line</i></a> are determined by
781782
extending a line in both directions from the center of the box. If a
782783
single keyword is specified, the line assumes the necessary angle to place
783-
the ending-point of the <a href="#gradient-line"><i>gradient-line</i></a>
784-
in the center of the side specified by the keyword; if two keywords are
785-
specified, the line assumes the necessary angle to place the ending-point
786-
of the <a href="#gradient-line"><i>gradient-line</i></a> in the specified
787-
corner of the box. The starting-point of the gradient-line is then where
788-
the line intersects the opposite side or corner of the box.
789-
790-
<p class=note>This means that the keyword &lsquo;<code
791-
class=property>bottom</code>&rsquo; (the default) makes the gradient point
792-
towards the bottom, equivalent to specifying &lsquo;<code
793-
class=css>180deg</code>&rsquo;. The keywords &lsquo;<code class=css>top
794-
left</code>&rsquo; make the gradient point towards the top-left corner of
795-
the box, which is equivalent to an angle somewhere between 0deg and 90deg
796-
(exclusive).
797-
798-
<p class=note>The behavior of keywords is now exactly opposite what it has
799-
been for a long time. Previously, specifying &lsquo;<code
800-
class=property>top</code>&rsquo; made it start at the top and point down,
801-
but feedback suggests that this was confusingly different from how
802-
&lt;angle>s worked: giving an &lt;angle> makes the gradient point towards
803-
the specified direction, while giving keywords made the gradient point
804-
<em>away</em> from the specified side/corner.
784+
the starting-point of the <a
785+
href="#gradient-line"><i>gradient-line</i></a> in the center of the side
786+
specified by the keyword; if two keywords are specified, the line assumes
787+
the necessary angle to place the starting-point of the <a
788+
href="#gradient-line"><i>gradient-line</i></a> in the specified corner of
789+
the box. The ending-point of the gradient-line is then where the line
790+
intersects the opposite side or corner of the box.
791+
792+
<p class=issue>This usage of keywords appears to be subtly confusing. When
793+
you ask solely about how keywords should work, most people prefer the
794+
above model (keyword denotes starting point). Similarly, most people
795+
prefer the way angles currently work. When you ask about whether "bottom"
796+
and "0deg" should be the same direction or opposite, though, most people
797+
prefer them to be opposite, despite that being contradictory with one of
798+
their previous answers. I am exploring alternate solutions that resolve
799+
this problem of expectations.
805800

806801
<div class=example>
807802
<div style="overflow: hidden"> <img alt="[An image showing a box with a
@@ -849,18 +844,18 @@ <h4 class=no-toc id=linear-gradient-examples><span class=secno>5.1.2.
849844
<p>Below are various ways of specifying a basic vertical gradient:</p>
850845

851846
<pre><code>linear-gradient(yellow, blue);
852-
linear-gradient(bottom, yellow, blue);
847+
linear-gradient(top, yellow, blue);
853848
linear-gradient(180deg, yellow, blue);
854-
linear-gradient(top, blue, yellow);
855-
linear-gradient(bottom, yellow 0%, blue 100%);</code></pre>
849+
linear-gradient(bottom, blue, yellow);
850+
linear-gradient(top, yellow 0%, blue 100%);</code></pre>
856851

857852
<p><img alt="" src=linear1.png></p>
858853
</div>
859854

860855
<div class=example>
861856
<p>This gradient goes from the top-left to the bottom-right corner.</p>
862857

863-
<pre><code>linear-gradient(bottom right, yellow, blue);</code></pre>
858+
<pre><code>linear-gradient(top left, yellow, blue);</code></pre>
864859

865860
<p><img alt="" src=linear2.png></p>
866861
</div>
@@ -2355,34 +2350,34 @@ <h3 id=interpolating-gradients><span class=secno>9.3. </span> Interpolating
23552350
explicit form.
23562351

23572352
<li>Otherwise, if the direction is specified as a single keyword, change
2358-
&lsquo;<code class=property>top</code>&rsquo; to &lsquo;<code
2353+
&lsquo;<code class=property>bottom</code>&rsquo; to &lsquo;<code
23592354
class=css>0deg</code>&rsquo;, &lsquo;<code
2360-
class=property>right</code>&rsquo; to &lsquo;<code
2355+
class=property>left</code>&rsquo; to &lsquo;<code
23612356
class=css>90deg</code>&rsquo;, &lsquo;<code
2362-
class=property>bottom</code>&rsquo; to &lsquo;<code
2357+
class=property>top</code>&rsquo; to &lsquo;<code
23632358
class=css>180deg</code>&rsquo;, or &lsquo;<code
2364-
class=property>left</code>&rsquo; to &lsquo;<code
2359+
class=property>right</code>&rsquo; to &lsquo;<code
23652360
class=css>270deg</code>&rsquo;.
23662361

23672362
<li>Otherwise, if the direction is specified as two keywords, change the
23682363
direction to an &lt;angle> in the following ranges that would produce
2369-
an equivalent gradient: for &lsquo;<code class=css>top
2370-
right</code>&rsquo; or &lsquo;<code class=css>right top</code>&rsquo;,
2364+
an equivalent gradient: for &lsquo;<code class=css>bottom
2365+
left</code>&rsquo; or &lsquo;<code class=css>left bottom</code>&rsquo;,
23712366
the angle must be between 0deg and 90deg; for &lsquo;<code
2372-
class=css>bottom right</code>&rsquo; or &lsquo;<code class=css>right
2373-
bottom</code>&rsquo;, the angle must be between 90deg and 180deg; for
2374-
&lsquo;<code class=css>bottom left</code>&rsquo; or &lsquo;<code
2375-
class=css>left bottom</code>&rsquo;, the angle must be between 180deg
2376-
and 270deg; for &lsquo;<code class=css>top left</code>&rsquo; or
2377-
&lsquo;<code class=css>left top</code>&rsquo;, the angle must be
2367+
class=css>top left</code>&rsquo; or &lsquo;<code class=css>left
2368+
top</code>&rsquo;, the angle must be between 90deg and 180deg; for
2369+
&lsquo;<code class=css>top right</code>&rsquo; or &lsquo;<code
2370+
class=css>right top</code>&rsquo;, the angle must be between 180deg and
2371+
270deg; for &lsquo;<code class=css>bottom right</code>&rsquo; or
2372+
&lsquo;<code class=css>right bottom</code>&rsquo;, the angle must be
23782373
between 270deg and 360deg.
23792374
</ul>
23802375

23812376
<p>If both the start and end gradients had their direction specified with
23822377
keywords, and the absolute difference between the angles their
23832378
directions mapped to is greater than 180deg, add 360deg to the direction
23842379
of the gradient with the smaller angle. <span class=note>This ensures
2385-
that a transition from, for example, "left" (270deg) to "top" (0deg)
2380+
that a transition from, for example, "right" (270deg) to "bottom" (0deg)
23862381
rotates the gradient a quarter-turn clockwise, as expected, rather than
23872382
rotating three-quarters of a turn counter-clockwise.</span></p>
23882383

css3-images/Overview.src.html

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -519,25 +519,14 @@ <h4 class='no-toc' id='linear-gradient-syntax'>
519519
Similar to the previous case, the starting-point and ending-point of the
520520
<i>gradient-line</i> are determined by extending a line in both directions
521521
from the center of the box. If a single keyword is specified, the line
522-
assumes the necessary angle to place the ending-point of the <i>gradient-line</i>
522+
assumes the necessary angle to place the starting-point of the <i>gradient-line</i>
523523
in the center of the side specified by the keyword; if two keywords are specified,
524-
the line assumes the necessary angle to place the ending-point of the
525-
<i>gradient-line</i> in the specified corner of the box. The starting-point
524+
the line assumes the necessary angle to place the starting-point of the
525+
<i>gradient-line</i> in the specified corner of the box. The ending-point
526526
of the gradient-line is then where the line intersects the opposite side or
527527
corner of the box.</p>
528528

529-
<p class='note'>This means that the keyword 'bottom' (the default) makes the
530-
gradient point towards the bottom, equivalent to specifying '180deg'. The
531-
keywords 'top left' make the gradient point towards the top-left corner of
532-
the box, which is equivalent to an angle somewhere between 0deg and 90deg
533-
(exclusive).</p>
534-
535-
<p class='note'>The behavior of keywords is now exactly opposite what it has
536-
been for a long time. Previously, specifying 'top' made it start at the top
537-
and point down, but feedback suggests that this was confusingly different
538-
from how &lt;angle>s worked: giving an &lt;angle> makes the gradient point
539-
towards the specified direction, while giving keywords made the gradient
540-
point <em>away</em> from the specified side/corner.</p>
529+
<p class='issue'>This usage of keywords appears to be subtly confusing. When you ask solely about how keywords should work, most people prefer the above model (keyword denotes starting point). Similarly, most people prefer the way angles currently work. When you ask about whether "bottom" and "0deg" should be the same direction or opposite, though, most people prefer them to be opposite, despite that being contradictory with one of their previous answers. I am exploring alternate solutions that resolve this problem of expectations.</p>
541530

542531
<div class=example>
543532
<div style="overflow: hidden">
@@ -575,18 +564,18 @@ <h4 class='no-toc' id='linear-gradient-examples'>
575564
<p>Below are various ways of specifying a basic vertical gradient:</p>
576565

577566
<pre><code>linear-gradient(yellow, blue);
578-
linear-gradient(bottom, yellow, blue);
567+
linear-gradient(top, yellow, blue);
579568
linear-gradient(180deg, yellow, blue);
580-
linear-gradient(top, blue, yellow);
581-
linear-gradient(bottom, yellow 0%, blue 100%);</code></pre>
569+
linear-gradient(bottom, blue, yellow);
570+
linear-gradient(top, yellow 0%, blue 100%);</code></pre>
582571

583572
<p><img src="linear1.png" alt="" ></p>
584573
</div>
585574

586575
<div class=example>
587576
<p>This gradient goes from the top-left to the bottom-right corner.</p>
588577

589-
<pre><code>linear-gradient(bottom right, yellow, blue);</code></pre>
578+
<pre><code>linear-gradient(top left, yellow, blue);</code></pre>
590579

591580
<p><img src="linear2.png" alt="" ></p>
592581
</div>
@@ -1865,26 +1854,26 @@ <h3 id='interpolating-gradients'>
18651854
is already in its explicit form.</li>
18661855

18671856
<li>Otherwise, if the direction is specified as a single
1868-
keyword, change 'top' to '0deg', 'right' to '90deg',
1869-
'bottom' to '180deg', or 'left' to '270deg'.</li>
1857+
keyword, change 'bottom' to '0deg', 'left' to '90deg',
1858+
'top' to '180deg', or 'right' to '270deg'.</li>
18701859

18711860
<li>Otherwise, if the direction is specified as two
18721861
keywords, change the direction to an &lt;angle> in the
18731862
following ranges that would produce an equivalent
1874-
gradient: for 'top right' or 'right top', the angle must
1875-
be between 0deg and 90deg; for 'bottom right' or
1876-
'right bottom', the angle must be between 90deg and
1877-
180deg; for 'bottom left' or 'left bottom', the angle
1878-
must be between 180deg and 270deg; for 'top left' or
1879-
'left top', the angle must be between 270deg and 360deg.</li>
1863+
gradient: for 'bottom left' or 'left bottom', the angle must
1864+
be between 0deg and 90deg; for 'top left' or
1865+
'left top', the angle must be between 90deg and
1866+
180deg; for 'top right' or 'right top', the angle
1867+
must be between 180deg and 270deg; for 'bottom right' or
1868+
'right bottom', the angle must be between 270deg and 360deg.</li>
18801869

18811870
<p>If both the start and end gradients had their direction
18821871
specified with keywords, and the absolute difference
18831872
between the angles their directions mapped to is greater
18841873
than 180deg, add 360deg to the direction of the gradient
18851874
with the smaller angle. <span class='note'>This ensures
1886-
that a transition from, for example, "left" (270deg) to
1887-
"top" (0deg) rotates the gradient a quarter-turn
1875+
that a transition from, for example, "right" (270deg) to
1876+
"bottom" (0deg) rotates the gradient a quarter-turn
18881877
clockwise, as expected, rather than rotating
18891878
three-quarters of a turn counter-clockwise.</span></p>
18901879
</ul>

0 commit comments

Comments
 (0)