[webkit-help] How to change background-repeat-x CSS property ?

Nicolas Ramz nicolas.ramz at gmail.com
Wed Sep 26 06:33:45 PDT 2012


When playing with Style rules I have accountered a weird behaviour.

Let's say I have a single stylesheet. I may access it using
document.styleSheets[0] and I can access the first rule
using document.styleSheets[0].rules[0]

Now, if the first rule equals to something like: "body{ width:100%; height:
100%; background-repeat: no-repeat; }", it seems internally,
background-repeat is splited into two separate properties:
background-repeat-x and background-repeat-y

That sounds ok (even though I couldn't find anywhere a reference to the
background-repeat-x/y properties: are they standard CSS ?). The problem is
it isn't possible to set this values.

Doing something like: myRule.style.setProperty('background-repeat-x',
'repeat') won't work.

I know I may use the shorthand (valid) CSS property background-repeat to
set my properties but I'm wondering: why is background-repeat property
split like this ? It makes it impossible to iterate through all styles
since there's no way to set background-repeat-x/y values.

*Nicolas RAMZ*
*Développeur Web*
www.warpdesign.fr | @
_ <http://www.pixowl.com/> | www.wpfun.fr
nicolas.ramz at gmail.com | +33 6 43 34 73 47
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20120926/a98b392c/attachment.html>

More information about the webkit-help mailing list