views:

163

answers:

4

I'm working with some CSS (from a Joomla template) like this:

div#logo {
    -moz-background-clip: border;
    -moz-background-inline-policy: continuous;
    -moz-background-origin: padding;
    background: transparent url(../images/head.png) no-repeat scroll 0 0;
    ...
}

I've looked up some of those -moz- properties and they seem to be assigned their default values, and if I turn them off in Firebug nothing happens visibly.

Would there be a reason to add them to a CSS file? Are they for an old version of Firefox perhaps?

A: 

If I turn them off in Firebug nothing happens visibly.

I'm not sure on those particular attributes, but have you checked that the browser isn't using a cached style sheet?

Matt
Um...don't think you read my question. I'm asking if the `-moz` properties need to be there or not.
DisgruntledGoat
Yeah and you mentioned "If I turn them off in Firebug nothing happens visibly." I had a similar situation where clearing the cache solved that problem.
Matt
A: 

background-clip isn't supported on current Firefox builds AFAIK, so the author has probably put them in preempting a problem (though that would be odd as they are all set to the default anyway, and they haven't included the opera or webkit prefixes...)

background-inline-policy is default as continuous in all Firefoxes, and background-origin is default as padding in them all too.

I'd say pointless code for this one.

Rich Bradshaw
+1  A: 

Chances are good that these properties don't need to be there. I'd suspect that they're included to ensure consistent rendering across different versions of Firefox. I guess the answer is, if you're seeing no difference from disabling them in the versions of Firefox you're interested in supporting, take them out.

Stephen Orr
+5  A: 

I think what's happened is someone's set a background shortcut rule and then looked at the ‘computed style’ resulting from that shortcut rule in the DOM inspector. They've noticed that setting the style also sets Mozilla's background-clip, -origin and -inline-policy properties, and tried to reproduce these rules without understanding what they're for (namely a detail of Mozilla's CSS implementation, and potentially CSS3 in future).

Certainly changing -moz-background-inline-policy would only have any effect on elements that were display: inline (which div isn't by default), and changing the clip/origin properties around the border would only make any difference if the element actually had a border.

Get rid of them.

bobince
Much better answer than mine! And I suspect 100% correct.
Stephen Orr