W3C home > Mailing lists > Public > public-fx@w3.org > January to March 2013

[filter-effects] drop-shadow inset shadow

From: Dirk Schulze <dschulze@adobe.com>
Date: Sat, 30 Mar 2013 07:28:38 -0700
To: "public-fx@w3.org" <public-fx@w3.org>
CC: Dean Jackson <dino@apple.com>, Alexandru Chiculita <achicu@adobe.com>
Message-ID: <1D0530E8-DC65-43F1-A2DE-AE4105467CDA@adobe.com>
Hi,

Currently the drop-shadow shorthand filter does not support inset shadows and the inset keyword (in comparison to box-shadow for instance). I wonder if this could be added to the spec and would like to hear implementers input.

Most shorthands have the advantage that they can easily be HW accelerated. This already seems not always be the case for drop-shadow on some platforms. However,  I do not think that it is harder to implement inset shadow, even if it will be of course slower than other filters.

Here is a short example how to use inset shadows with SVG Filters today[1]:

		<filter id="innershadow" x0="-50%" y0="-50%" width="200%" height="200%">
			<feGaussianBlur in="SourceAlpha" stdDeviation="2" result="blur"/>
			<feOffset dy="3" dx="3"/>
			<feComposite in2="SourceAlpha" operator="arithmetic"
					k2="-1" k3="1" result="shadowDiff"/>
			<feFlood flood-color="black" flood-opacity="1"/>
			<feComposite in2="shadowDiff" operator="in"/>
			<feComposite in2="SourceGraphic" operator="over"/>
		</filter>

Implementations could replace the inset shadow in the CSS string with an equivalent filter chain as above.

Greetings,
Dirk

[1] http://ledrug.wordpress.com/2010/09/30/learning-svg-lesson-2/
Received on Saturday, 30 March 2013 14:29:06 UTC

This archive was generated by hypermail 2.3.1 : Saturday, 30 March 2013 14:29:08 UTC