Renaming 'filter' member of CSSStyleDeclaration

View: New views
4 Messages — Rating Filter:   Alert me  

Renaming 'filter' member of CSSStyleDeclaration

by Robert O'Callahan-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

According to Webkit people (whom I have no reason to doubt), exposing 'filter' as a member of CSSStyleDeclaration in browsers is perilous because many Web sites do
  if (typeof(element.style.filter) == 'string') { ... set opacity using IE's DirectX filters }
  else { ... set opacity using standard CSS 'opacity' ... }

They've worked around it by making 'filter' undetectable with magic JS hacks similar to what multiple browsers do with "document.all". But a much simpler solution is to name the CSSStyleDeclaration member instead, say 'svgFilter'. How do people feel about that? I'm not sure if any spec needs to be changed since apparently the names of the CSSStyleDeclaration SVG members aren't actually in any spec...

Rob
--
"He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all." [Isaiah 53:5-6]

Re: Renaming 'filter' member of CSSStyleDeclaration

by Anne van Kesteren-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 18 Oct 2009 23:17:44 +0200, Robert O'Callahan  
<robert@...> wrote:
> They've worked around it by making 'filter' undetectable with magic JS  
> hacks similar to what multiple browsers do with "document.all". But a  
> much simpler solution is to name the CSSStyleDeclaration member instead,  
> say 'svgFilter'.
> How do people feel about that? I'm not sure if any spec needs to be  
> changed since apparently the names of the CSSStyleDeclaration SVG  
> members aren't
> actually in any spec...

cssFilter would be better for consistency with cssFloat, I think; also  
since properties are not restricted to particular languages.


--
Anne van Kesteren
http://annevankesteren.nl/


Re: Renaming 'filter' member of CSSStyleDeclaration

by Robert O'Callahan-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Oct 19, 2009 at 10:29 AM, Anne van Kesteren <annevk@...> wrote:
On Sun, 18 Oct 2009 23:17:44 +0200, Robert O'Callahan <robert@...> wrote:
They've worked around it by making 'filter' undetectable with magic JS hacks similar to what multiple browsers do with "document.all". But a much simpler solution is to name the CSSStyleDeclaration member instead, say 'svgFilter'.
How do people feel about that? I'm not sure if any spec needs to be changed since apparently the names of the CSSStyleDeclaration SVG members aren't
actually in any spec...

cssFilter would be better for consistency with cssFloat, I think;

I guess, although the reasons are different...
 
also since properties are not restricted to particular languages.

'filter' has to refer to an SVG filter element, though.

Personally I'm wavering ... I think perhaps given that we already have to have black magic in JS engines to support undetectability for document.all, maybe we should just reuse it here for the sake of consistency of the property name.

Rob
--
"He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all." [Isaiah 53:5-6]

Re: Renaming 'filter' member of CSSStyleDeclaration

by Anne van Kesteren-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 18 Oct 2009 23:57:41 +0200, Robert O'Callahan  
<robert@...> wrote:
> Personally I'm wavering ... I think perhaps given that we already have to
> have black magic in JS engines to support undetectability for  
> document.all,
> maybe we should just reuse it here for the sake of consistency of the
> property name.

 From a recent thread on public-script-coord/public-html it seems that  
Bredan Eich and others from TC39 think this is something we should  
absolutely avoid. I'd personally much prefer it if all attributes that  
were supported are listed on the object as well. Seems better for authors.


--
Anne van Kesteren
http://annevankesteren.nl/