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


Groups > comp.lang.javascript > #25996

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 18:11 -0400
Organization minimal
Message-ID <op.xoes9kehtnmj2w@cbealls-imac.local> (permalink)
References <op.xoeolsddtnmj2w@cbealls-imac.local> <83210457.YLdJyC3XC5@PointedEars.de>

Show all headers | View raw


On Mon, 27 Oct 2014 17:20:22 -0400, Thomas 'PointedEars' Lahn  
<PointedEars@web.de> wrote:

> Chris Beall wrote:
>
>> But, for bleeding-edge functions, it often becomes necessary to add
>> vendor-specific prefixes.
>
> But preferably not with client-side DOM scripting.  In general, CSS
> properties should be specified in a stylesheet that is merely triggered  
> with
> scripting, for example by toggling CSS class names on elements.

I've noticed that modifying style sheets seems to be less used, but I'm  
uncertain as to why modifying element attributes would be preferred.   
Could you elaborate?
Usage example: A long list, such as a timeline of events.  Events fall  
into different buckets, some of which are not mutually exclusive, and  
these are identified by class names on each list item.  To allow the user  
to filter the list, excluding (hiding) items in a certain bucket, I can  
either (and I'm sure there are other ways...):
  - find each item in the list with class'X' and change it to class  
'Xprime' (which has been previously styled as display: none)
  - find the CSS style for the specified class and change its display  
property to 'none'.
I've chosen the latter, and have detected no downside.  Note that I am  
changing only a single property in a single DOM object, rather than  
changing the class in many DOM objects.

> Also be
> aware that you can generate and append those stylesheets with client-side
> DOM scripting, should it be necessary:
>
> <http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-2141741547>

Yes.  I can see the value of that if many style properties are to be  
changed.  I haven't had the need to do that.

> You can also use the getPropertyValue(), removeProperty(), and  
> setProperty()
> methods of the CSSStyleDeclaration interface, which take the original
> (hyphenated) CSS property names as arguments:

That might simplify my life in the future.  I'll take a look.

> <http://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/css.html#CSS-CSSStyleDeclaration>
> <http://www.w3.org/TR/2011/WD-cssom-20110712/>
> <http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface>
> <https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration>
>
>> 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.
>
> Such as?

So far: IE, Chrome, Safari.  I'm probably not using the right DOM names.   
More investigation needed.

>
>> I would appreciate authoritative references.
>
> Since both are OSS: UTSL.  You can also use the auto-completion built  
> into
> the corresponding developer tools to find out.
>
> <http://devtoolsecrets.com/> (also in the FAQ)
>

Excellent!  Thanks you,

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