Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #25995

Re: DOM style object property names with vendor prefixes

From "Chris Beall" <Chris_Beall@prodigy.net>
Newsgroups comp.lang.javascript
Subject Re: DOM style object property names with vendor prefixes
Date 2014-10-27 17:43 -0400
Organization minimal
Message-ID <op.xoery3butnmj2w@cbealls-imac.local> (permalink)
References <op.xoeolsddtnmj2w@cbealls-imac.local> <c6d81b56-55e8-417f-bae1-d7bb9c375160@googlegroups.com>

Show all headers | View raw


On Mon, 27 Oct 2014 17:07:56 -0400, Michael Haufe (TNO)  
<tno@thenewobjective.com> wrote:

> On Monday, October 27, 2014 3:31:03 PM UTC-5, Chris Beall wrote:
>> I occasionally use JavaScript to dynamically modify style sheets.  This
>> requires that I know the DOM equivalent of CSS property names.  For
>> example: CSS property name 'animation-duration' becomes DOM name
>> 'animationDuration'.  The general conversion formula seems to be: remove
>> hyphens and capitalize the next letter (camel case).
>>
>> But, for bleeding-edge functions, it often becomes necessary to add
>> vendor-specific prefixes.  If there's a standard rule for that syntax, I
>> haven't found it and would appreciate a pointer or two.  Example:
>> '-moz-animation-duration' seems to become 'MozAnimationDuration', but
>> '-webkit-animation-duration' seems to become 'webkitAnimationDuration',
>> i.e. a different case pattern.  When I say 'seems to become' I am
>> referring to the results of experimentation on my part, which may be
>> erroneous and which is complicated by the fact that some browsers don't
>> seem to support modification of vendor-specific values at all.
>>
>> I would appreciate authoritative references.
>
> You can use the browsers' built-in DOM inspectors. For example, in  
> Firefox type document.documentElement in the console then click the  
> reference. In the properties window expand the style object and you'll  
> see a list of properties.

Yes, that's how I got the answer for Firefox.  I've had less success with  
the others, probably because I'm unfamiliar with their inspection tools.   
I will continue trying, but it seems (to me, anyway) that documentation of  
the DOM names should appear right along with that for the vendor's CSS  
prefix names, rather than forcing the developer to inspect the resulting  
structure.

But thanks for the suggestion.

Chris Beall

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

DOM style object property names with vendor prefixes "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-27 16:30 -0400
  Re: DOM style object property names with vendor prefixes "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-10-27 14:07 -0700
    Re: DOM style object property names with vendor prefixes "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-27 17:43 -0400
    Re: DOM style object property names with vendor prefixes Andrew Poulos <ap_prog@hotmail.com> - 2014-10-28 09:48 +1100
      Re: DOM style object property names with vendor prefixes "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-10-27 22:45 -0700
        Re: DOM style object property names with vendor prefixes Andrew Poulos <ap_prog@hotmail.com> - 2014-10-28 19:31 +1100
          Re: DOM style object property names with vendor prefixes "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-28 09:59 -0400
          Re: DOM style object property names with vendor prefixes Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-28 15:26 +0100
          Re: DOM style object property names with vendor prefixes Andrew Poulos <ap_prog@hotmail.com> - 2014-10-31 12:29 +1100
  Re: DOM style object property names with vendor prefixes Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-27 22:20 +0100
    Re: DOM style object property names with vendor prefixes "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-27 18:11 -0400
      Re: DOM style object property names with vendor prefixes Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-27 23:45 +0100
        Re: DOM style object property names with vendor prefixes "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-27 20:38 -0400
          Re: DOM style object property names with vendor prefixes Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-28 19:49 +0100
            Re: DOM style object property names with vendor prefixes "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-28 17:56 -0400
              Re: DOM style object property names with vendor prefixes Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-29 21:07 +0100
                Re: DOM style object property names with vendor prefixes "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-30 12:50 -0400
                Re: DOM style object property names with vendor prefixes Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-30 19:13 +0100
                Re: DOM style object property names with vendor prefixes "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-30 17:17 -0400
                Re: DOM style object property names with vendor prefixes Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-31 20:35 +0100
        Re: DOM style object property names with vendor prefixes "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-27 23:19 -0400
          Re: DOM style object property names with vendor prefixes John Harris <niam@jghnorth.org.uk.invalid> - 2014-10-28 10:11 +0000
            Re: DOM style object property names with vendor prefixes Tim Streater <timstreater@greenbee.net> - 2014-10-28 11:42 +0000
              Re: DOM style object property names with vendor prefixes "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-28 09:52 -0400
            Re: DOM style object property names with vendor prefixes "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-28 09:49 -0400
              Re: DOM style object property names with vendor prefixes John Harris <niam@jghnorth.org.uk.invalid> - 2014-10-29 15:48 +0000
          Re: DOM style object property names with vendor prefixes Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-28 15:54 +0100
        Re: DOM style object property names with vendor prefixes Scott Sauyet <scott.sauyet@gmail.com> - 2014-10-30 08:12 -0700
  Re: DOM style object property names with vendor prefixes Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-10-29 15:23 -0200
    Re: DOM style object property names with vendor prefixes Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-29 21:47 +0100
      Re: DOM style object property names with vendor prefixes Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-10-30 07:32 +0100
    Re: DOM style object property names with vendor prefixes "Chris Beall" <Chris_Beall@prodigy.net> - 2014-10-30 10:47 -0400

csiph-web