DisgruntledGoat
DisgruntledGoat

Reputation: 72560

Are these Mozilla-specific CSS styles doing anything?

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?

Upvotes: 0

Views: 632

Answers (4)

bobince
bobince

Reputation: 536479

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.

Upvotes: 5

Matt
Matt

Reputation: 7222

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?

Upvotes: -1

Steve Hill
Steve Hill

Reputation: 2321

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.

Upvotes: 1

Rich Bradshaw
Rich Bradshaw

Reputation: 72985

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.

Upvotes: 0

Related Questions