Bug 38878 - Unrecognized arguments cause multiple box-shadows to fail.
Summary: Unrecognized arguments cause multiple box-shadows to fail.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 525.x (Safari 3.2)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-10 17:57 PDT by Trevor Downs
Modified: 2010-08-19 04:06 PDT (History)
1 user (show)

See Also:


Attachments
Shadow example (612 bytes, text/html)
2010-05-10 17:57 PDT, Trevor Downs
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Trevor Downs 2010-05-10 17:57:00 PDT
Created attachment 55629 [details]
Shadow example

The "inset" argument for -webkit-box-shadow (implemented in the nightly) causes the entire statement to break in Safari.

For example, taken from <http://dev.opera.com/articles/view/beautiful-ui-styling-with-css3-text-shadow-box-shadow-and-border-radius/> (where I learned about inset in the first place):

div {
	width: 100px;
	height: 100px;
	margin: 10px;
	padding: 10px;
	background: #6fb2e5;
	box-shadow: 0 1px 5px #0061aa, inset 0 10px 20px #b6f9ff;
	-o-box-shadow: 0 1px 5px #0061aa, inset 0 10px 20px #b6f9ff;
	-webkit-box-shadow: 0 1px 5px #0061aa, inset 0 10px 20px #b6f9ff; /*The inset argument here causes all of the shadows to fail in Safari 4 */
	-moz-box-shadow: 0 1px 5px #0061aa, inset 0 10px 20px #b6f9ff;
}

The workaround for the designers is simple enough, they just need to change the declaration to:
	-webkit-box-shadow: 0 1px 5px #0061aa; /* Working box shadow */
	-webkit-box-shadow: 0 1px 5px #0061aa, inset 0 10px 20px #b6f9ff !important; /* inset shadow for compliant versions of webkit */


I don't know if inset shadows are ready to be included in the next release of Safari, but I was wondering if some change could be made to the parser so that bad arguments only cause that particular instance to fail instead of all of the instances in a declaration?
Comment 1 Rob Buis 2010-08-15 09:24:25 PDT
Hello Trevor,

I checked with a recent build and the testcase seems fixed to me. Can you check with a nightly?
Cheers,

Rob.
Comment 2 Trevor Downs 2010-08-15 17:41:00 PDT
The nightly and current versions of Safari work fine with the inset argument.
Comment 3 Rob Buis 2010-08-15 23:06:51 PDT
Hello Trevor,

Thanks for the initial report and for checking! I'll close the bug now.
Cheers,

Rob.
Comment 4 Trevor Downs 2010-08-19 04:06:22 PDT
The *inset* argument works, but the underlying issue with the parser remains. Let me see if I can explain my position better.

Given a property 'p'

e {
	p: foo, foo bar, err foo;
}

Now 'err' is not recognized by the parser as valid. This causes p to fail in e. Ideally what would happen is that given that each declaration inside of p is independent of the others, "foo" and "foo bar" would be applied to e and "err foo" would be ignored and logged in the console as an error.