Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DOM bug or feature?

14 views
Skip to first unread message

Colin Kincaid Williams

unread,
Dec 1, 2011, 5:37:34 PM12/1/11
to dev-te...@lists.mozilla.org
Hi,

I'm setting my page background via javascript by DOM reference
document.body.style.background="#f3f3f3 url('/images/xenopus.jpg')
no-repeat center fixed";

It sets the background image properties as expected . I'm also trying to
change the background image size

body {
background-size: 20% auto;
}

however, the background image size does not seem affected. However it does
seem to work in webkit browsers. I tested chrome, and somebody else told me
it works in safari.

Document.body.style.background doesn't have option for background size, why
is the background-size not applying? Is this a bug or does it have to do
with firefoxen dom traversal? The page in question is
http://freediscord.com/usingBodyBkgrnd.html .

Furthermore, I noticed in firebug it shows the CSS set as:

element.style { background: url("/images/xenopus.jpg") no-repeat fixed
center center #F3F3F3; }
body { background-size: 20% auto;}

So shouldn't my background-size be set? Is this a bug or is this how its
supposed to work. I'd really like to get it working in both webkit and
gecko....
Sorry if this is the wrong place for my question.

Best,

Colin Williams

Boris Zbarsky

unread,
Dec 1, 2011, 8:31:25 PM12/1/11
to
On 12/1/11 5:37 PM, Colin Kincaid Williams wrote:
> Document.body.style.background doesn't have option for background size, why
> is the background-size not applying? Is this a bug or does it have to do
> with firefoxen dom traversal? The page in question is
> http://freediscord.com/usingBodyBkgrnd.html .

This seems to work fine for me in both Firefox 8 and a current Aurora
build. What Firefox version did you test?

> element.style { background: url("/images/xenopus.jpg") no-repeat fixed
> center center #F3F3F3; }
> body { background-size: 20% auto;}
>
> So shouldn't my background-size be set?

Set where?

-Boris
0 new messages