<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: CSS Masks</title>
	<atom:link href="http://webkit.org/blog/181/css-masks/feed/" rel="self" type="application/rss+xml" />
	<link>http://webkit.org/blog/181/css-masks/</link>
	<description>All about WebKit development</description>
	<lastBuildDate>Sat, 21 Nov 2009 23:00:28 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mark Rowe</title>
		<link>http://webkit.org/blog/181/css-masks/comment-page-1/#comment-24898</link>
		<dc:creator>Mark Rowe</dc:creator>
		<pubDate>Thu, 19 Jun 2008 05:26:08 +0000</pubDate>
		<guid isPermaLink="false">http://webkit.org/blog/?p=181#comment-24898</guid>
		<description>@Joel: That sounds like a topic that could be suggested on the W3Cs &lt;a href=&#039;http://lists.w3.org/Archives/Public/www-style/&#039; rel=&quot;nofollow&quot;&gt;www-style mailing list&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>@Joel: That sounds like a topic that could be suggested on the W3Cs <a href='http://lists.w3.org/Archives/Public/www-style/' rel="nofollow">www-style mailing list</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel@MMCC</title>
		<link>http://webkit.org/blog/181/css-masks/comment-page-1/#comment-24897</link>
		<dc:creator>Joel@MMCC</dc:creator>
		<pubDate>Thu, 19 Jun 2008 04:12:18 +0000</pubDate>
		<guid isPermaLink="false">http://webkit.org/blog/?p=181#comment-24897</guid>
		<description>Where would one go to propose new ideas for CSS extensions?

I would like to see “-webkit-border-radius-style:” — this could take parameters such as “convex” (default), “concave”, “flat” (or perhaps “beveled” or “angled” for the same effect), and “cutout” (as well as standard CSS keywords such as “inherit”).

“convex”, the default, means a convex rounded corner, rounded away from the center of the block node.

&quot;concave&quot; would be rounded towards the center. Imagine the corners of an old-fashioned photographic print.

&quot;flat&quot; / &quot;beveled&quot; / &quot;angled&quot; isn&#039;t rounded at all, but instead renders a straight diagonal. If the X and Y size of the radius are the same (as is the case if only one radius is specified instead of two), then the angle would be 45°. But just as elliptical rounded corners can be done in CSS3 Borders and Webkit (but not Gecko, let alone Presto [Opera] nor Trident [WinIE] at present) by specifying two separate radius values per corner (one for X and one for Y), using this would allow any desired angle to be specified.

&quot;cutout&quot; (or perhaps &quot;inset&quot;) would be a square (or rectangular) inset.

Also, if X and Y radii are specified separately (on a per-corner basis), then either (but not both) should also be allowed to be negative. If negative, then the corner would be reversed in that dimension (in effect, the corner radius ellipse would be outside the box instead of inside). For example, if the X radius of the bottom two corners of a box were negative but its Y were positive, while both X and Y were positive for the top two corners, and the default &quot;convex&quot; style were used then the resulting box would be shaped like a file-folder tab. Instant tabbed navigation bar, without graphic files of any kind (not even SVG)!

a.navtab { 
  height: 18px;
  border: 1px outset #color;
  border-bottom: 0;
  -webkit-border-top-left-radius: 9px;
  -webkit-border-top-right-radius: 9px;
  -webkit-border-bottom-left-radius: -4px 4px;
  -webkit-border-bottom-right-radius: -4px 4px;
}

Using just these two enhancements, a very wide variety of box shapes could be done without using graphics. Want an octagon (perhaps for a “STOP” sign)?

div.stopsign {
  background-color: #900;
  -webkit-outline: solid medium white;
  border: solid medium #900;
  color: white;
  height: 100px;
  width: 100px;
  -webkit-border-radius: 25px;
  -webkit-border-radius-style: flat;
}

Want a diamond? A hexagon? Not much different: just change the radii!

That old-fashioned photographic print I referred to earlier?

img.borderedPhoto {
  border: solid thick white;
  -webkit-border-radius: 10px;
  -webkit-border-radius-style: concave;
}

And that’s not even getting into the really cool effects that could be done with independent per-corner border radius styles!

My other idea is even more powerful than this.</description>
		<content:encoded><![CDATA[<p>Where would one go to propose new ideas for CSS extensions?</p>
<p>I would like to see “-webkit-border-radius-style:” — this could take parameters such as “convex” (default), “concave”, “flat” (or perhaps “beveled” or “angled” for the same effect), and “cutout” (as well as standard CSS keywords such as “inherit”).</p>
<p>“convex”, the default, means a convex rounded corner, rounded away from the center of the block node.</p>
<p>&#8220;concave&#8221; would be rounded towards the center. Imagine the corners of an old-fashioned photographic print.</p>
<p>&#8220;flat&#8221; / &#8220;beveled&#8221; / &#8220;angled&#8221; isn&#8217;t rounded at all, but instead renders a straight diagonal. If the X and Y size of the radius are the same (as is the case if only one radius is specified instead of two), then the angle would be 45°. But just as elliptical rounded corners can be done in CSS3 Borders and Webkit (but not Gecko, let alone Presto [Opera] nor Trident [WinIE] at present) by specifying two separate radius values per corner (one for X and one for Y), using this would allow any desired angle to be specified.</p>
<p>&#8220;cutout&#8221; (or perhaps &#8220;inset&#8221;) would be a square (or rectangular) inset.</p>
<p>Also, if X and Y radii are specified separately (on a per-corner basis), then either (but not both) should also be allowed to be negative. If negative, then the corner would be reversed in that dimension (in effect, the corner radius ellipse would be outside the box instead of inside). For example, if the X radius of the bottom two corners of a box were negative but its Y were positive, while both X and Y were positive for the top two corners, and the default &#8220;convex&#8221; style were used then the resulting box would be shaped like a file-folder tab. Instant tabbed navigation bar, without graphic files of any kind (not even SVG)!</p>
<p>a.navtab {<br />
  height: 18px;<br />
  border: 1px outset #color;<br />
  border-bottom: 0;<br />
  -webkit-border-top-left-radius: 9px;<br />
  -webkit-border-top-right-radius: 9px;<br />
  -webkit-border-bottom-left-radius: -4px 4px;<br />
  -webkit-border-bottom-right-radius: -4px 4px;<br />
}</p>
<p>Using just these two enhancements, a very wide variety of box shapes could be done without using graphics. Want an octagon (perhaps for a “STOP” sign)?</p>
<p>div.stopsign {<br />
  background-color: #900;<br />
  -webkit-outline: solid medium white;<br />
  border: solid medium #900;<br />
  color: white;<br />
  height: 100px;<br />
  width: 100px;<br />
  -webkit-border-radius: 25px;<br />
  -webkit-border-radius-style: flat;<br />
}</p>
<p>Want a diamond? A hexagon? Not much different: just change the radii!</p>
<p>That old-fashioned photographic print I referred to earlier?</p>
<p>img.borderedPhoto {<br />
  border: solid thick white;<br />
  -webkit-border-radius: 10px;<br />
  -webkit-border-radius-style: concave;<br />
}</p>
<p>And that’s not even getting into the really cool effects that could be done with independent per-corner border radius styles!</p>
<p>My other idea is even more powerful than this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hawkman</title>
		<link>http://webkit.org/blog/181/css-masks/comment-page-1/#comment-24585</link>
		<dc:creator>hawkman</dc:creator>
		<pubDate>Thu, 08 May 2008 06:54:15 +0000</pubDate>
		<guid isPermaLink="false">http://webkit.org/blog/?p=181#comment-24585</guid>
		<description>@ Dave Hyatt

That makes sense. Thanks for the explanation.</description>
		<content:encoded><![CDATA[<p>@ Dave Hyatt</p>
<p>That makes sense. Thanks for the explanation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Rowe</title>
		<link>http://webkit.org/blog/181/css-masks/comment-page-1/#comment-24510</link>
		<dc:creator>Mark Rowe</dc:creator>
		<pubDate>Thu, 01 May 2008 20:15:44 +0000</pubDate>
		<guid isPermaLink="false">http://webkit.org/blog/?p=181#comment-24510</guid>
		<description>@Ryan Cannon: Does http://developer.apple.com/documentation/AppleApplications/Reference/SafariCSSRef/Introduction.html provide the information that you&#039;re after?  If you feel that it could do with more information, please take advantage of the feedback links at the bottom of each page on developer.apple.com.</description>
		<content:encoded><![CDATA[<p>@Ryan Cannon: Does <a href="http://developer.apple.com/documentation/AppleApplications/Reference/SafariCSSRef/Introduction.html" rel="nofollow">http://developer.apple.com/documentation/AppleApplications/Reference/SafariCSSRef/Introduction.html</a> provide the information that you&#8217;re after?  If you feel that it could do with more information, please take advantage of the feedback links at the bottom of each page on developer.apple.com.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Cannon</title>
		<link>http://webkit.org/blog/181/css-masks/comment-page-1/#comment-24503</link>
		<dc:creator>Ryan Cannon</dc:creator>
		<pubDate>Thu, 01 May 2008 09:20:48 +0000</pubDate>
		<guid isPermaLink="false">http://webkit.org/blog/?p=181#comment-24503</guid>
		<description>@scripto: thanks, but that only gets me halfway there.

What I&#039;m looking for is a matrix of all -webkit CSS additions and in what version of *shipping* products they appear. This is more of an Apple &amp; friends thing than a Webkit thing, but suddenly we have Safari, MobileSafari, OmniWeb, Adobe Air, and (soon) Android, all with different versions of WebKit. We need to get all of this information down.</description>
		<content:encoded><![CDATA[<p>@scripto: thanks, but that only gets me halfway there.</p>
<p>What I&#8217;m looking for is a matrix of all -webkit CSS additions and in what version of *shipping* products they appear. This is more of an Apple &amp; friends thing than a Webkit thing, but suddenly we have Safari, MobileSafari, OmniWeb, Adobe Air, and (soon) Android, all with different versions of WebKit. We need to get all of this information down.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliv</title>
		<link>http://webkit.org/blog/181/css-masks/comment-page-1/#comment-24467</link>
		<dc:creator>tomliv</dc:creator>
		<pubDate>Tue, 29 Apr 2008 13:19:41 +0000</pubDate>
		<guid isPermaLink="false">http://webkit.org/blog/?p=181#comment-24467</guid>
		<description>I guess READING is in order before posting :-P. Got teh gradient working now... parentheses are incorrect in code example.

So... this is frickin&#039; COOL!</description>
		<content:encoded><![CDATA[<p>I guess READING is in order before posting <img src='http://webkit.org/blog/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> . Got teh gradient working now&#8230; parentheses are incorrect in code example.</p>
<p>So&#8230; this is frickin&#8217; COOL!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomliv</title>
		<link>http://webkit.org/blog/181/css-masks/comment-page-1/#comment-24466</link>
		<dc:creator>tomliv</dc:creator>
		<pubDate>Tue, 29 Apr 2008 13:11:40 +0000</pubDate>
		<guid isPermaLink="false">http://webkit.org/blog/?p=181#comment-24466</guid>
		<description>OK. What am I doing wrong? I pulled down the original image here and copied the code for the gradient and nothing happens.</description>
		<content:encoded><![CDATA[<p>OK. What am I doing wrong? I pulled down the original image here and copied the code for the gradient and nothing happens.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Hyatt</title>
		<link>http://webkit.org/blog/181/css-masks/comment-page-1/#comment-24462</link>
		<dc:creator>Dave Hyatt</dc:creator>
		<pubDate>Mon, 28 Apr 2008 19:57:30 +0000</pubDate>
		<guid isPermaLink="false">http://webkit.org/blog/?p=181#comment-24462</guid>
		<description>@hawkman,

Right now the current values of background-clip are border, padding and content.  Therefore at a minimum the mask is going to clip out everything outside the border (since it takes the same values).  There really needs to be a new value for mask-clip that lets you specify that nothing should be clipped out initially.  That&#039;s basically the problem you&#039;re running into with the shadow vanishing once you apply a mask.

As for images not respecting border-radius, they shouldn&#039;t if overflow is visible, since the portions of the image that stick out of the border box are overflowing, and so clipping that in the visible case would be wrong. However, clipping the foreground content to the border radius when overflow is hidden is (I believe) a reasonable thing to do.  We have a bug filed on that.</description>
		<content:encoded><![CDATA[<p>@hawkman,</p>
<p>Right now the current values of background-clip are border, padding and content.  Therefore at a minimum the mask is going to clip out everything outside the border (since it takes the same values).  There really needs to be a new value for mask-clip that lets you specify that nothing should be clipped out initially.  That&#8217;s basically the problem you&#8217;re running into with the shadow vanishing once you apply a mask.</p>
<p>As for images not respecting border-radius, they shouldn&#8217;t if overflow is visible, since the portions of the image that stick out of the border box are overflowing, and so clipping that in the visible case would be wrong. However, clipping the foreground content to the border radius when overflow is hidden is (I believe) a reasonable thing to do.  We have a bug filed on that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maciej Stachowiak</title>
		<link>http://webkit.org/blog/181/css-masks/comment-page-1/#comment-24460</link>
		<dc:creator>Maciej Stachowiak</dc:creator>
		<pubDate>Mon, 28 Apr 2008 15:47:07 +0000</pubDate>
		<guid isPermaLink="false">http://webkit.org/blog/?p=181#comment-24460</guid>
		<description>@jdaggett

In general, you can think of these as shortcuts to avoid the need for an external SVG file to achieve simple presentational effects like gradients and image masks in CSS. Masks are a bit of a special case, because SVG has confusingly weird semantics for &quot;mask&quot;. Most masking operations use either only a grayscale color channel or only the color channel. SVG&#039;s masks convert RGB color channels to luminosity (using a different coefficient for each color channel) and then multiply by the alpha to get the final alpha mask. This is confusing and usually not what you want.

I do think allowing SVG styling properties on any element is a neat idea, but I don&#039;t think it is a substitute for making the simple cases easy.</description>
		<content:encoded><![CDATA[<p>@jdaggett</p>
<p>In general, you can think of these as shortcuts to avoid the need for an external SVG file to achieve simple presentational effects like gradients and image masks in CSS. Masks are a bit of a special case, because SVG has confusingly weird semantics for &#8220;mask&#8221;. Most masking operations use either only a grayscale color channel or only the color channel. SVG&#8217;s masks convert RGB color channels to luminosity (using a different coefficient for each color channel) and then multiply by the alpha to get the final alpha mask. This is confusing and usually not what you want.</p>
<p>I do think allowing SVG styling properties on any element is a neat idea, but I don&#8217;t think it is a substitute for making the simple cases easy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hawkman</title>
		<link>http://webkit.org/blog/181/css-masks/comment-page-1/#comment-24459</link>
		<dc:creator>hawkman</dc:creator>
		<pubDate>Mon, 28 Apr 2008 11:15:06 +0000</pubDate>
		<guid isPermaLink="false">http://webkit.org/blog/?p=181#comment-24459</guid>
		<description>Ok, got the gradient example working (brackets are wrong).

One problem seems to be that if -webkit-box-shadow is specified, it won&#039;t render if you&#039;re using masks... Is this by design?

Another question is about consistency of -webkit-border-radius application. Images &lt;i&gt;don&#039;t&lt;/i&gt; respect it, but -webkit-box-shadow (on an image) and -webkit-mask-image &lt;i&gt;do&lt;/i&gt; respect it. Any chance this could be harmonised, one way or the other?</description>
		<content:encoded><![CDATA[<p>Ok, got the gradient example working (brackets are wrong).</p>
<p>One problem seems to be that if -webkit-box-shadow is specified, it won&#8217;t render if you&#8217;re using masks&#8230; Is this by design?</p>
<p>Another question is about consistency of -webkit-border-radius application. Images <i>don&#8217;t</i> respect it, but -webkit-box-shadow (on an image) and -webkit-mask-image <i>do</i> respect it. Any chance this could be harmonised, one way or the other?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
