[webkit-help] How to change background-repeat-x CSS property ?
Nicolas Ramz
nicolas.ramz at gmail.com
Wed Sep 26 08:44:55 PDT 2012
Hi,
Thanks for the explanation.
Any reason why rules.style is splitting 'background-repeat' into these
properties then ?
Nicolas
On Wed, Sep 26, 2012 at 5:27 PM, Simon Fraser <simon.fraser at apple.com>wrote:
> There is no background-repeat-x CSS property <
> http://dev.w3.org/csswg/css3-background/>. Background-repeat is one of
> those properties with X, Y values that sound like they should be
> shorthands, but actually are not. The CSS WG has talked a few times about
> whether it's useful to expose separate properties for the -x and -y values,
> but in general we tend to avoid adding new CSS properties.
>
> Simon
>
> On Sep 26, 2012, at 6:33 AM, Nicolas Ramz wrote:
>
> Hi,
>
> 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.
>
>
> Thanks,
> --
> *Nicolas RAMZ*
> *Développeur Web*
> www.warpdesign.fr | @ <http://www.pixowl.com/>warpdesign<http://www.twitter.com/warpdesign_>
> _ <http://www.pixowl.com/> | www.wpfun.fr
> nicolas.ramz at gmail.com | +33 6 43 34 73 47
>
> _______________________________________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo/webkit-help
>
>
>
--
*Nicolas RAMZ*
*Développeur Web*
www.warpdesign.fr | @
<http://www.pixowl.com/>warpdesign<http://www.twitter.com/warpdesign_>
_ <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/854a989b/attachment.html>
More information about the webkit-help
mailing list