Re: CSS 4?

Ian Hickson wrote:
> On Wed, 29 Oct 2003, Dylan Schiemann wrote:
> 
>>For annoying abusive cases, I feel that this obfuscates the fact that it
>>is JavaScript that is causing the annoying behavior.
> 
> 
> I don't understand what you mean by this.

Say you're a somewhat technically inclined end user and you visit a page 
that has an annoying behavior that is caused by JavaScript added through 
xbl.  A simple view source of the document shows only an html document 
with a style sheet link.  The end user turns off css in their browser 
and the annoying behavior goes away.  Hence they now think that css is 
"at fault" for this, rather than JavaScript or xbl.

>>>   <script type="text/javascript">
>>>    var sections = document.getElementsByTagNameNS('http://example.net/',
>>>                                                   'section');
>>>    for (var index = 0; index < sections.length; ++index)
>>>       sections.addBinding('bindings#collapsable-sections');
>>>   </script>
>>
>>Perhaps it could be simplified to something like
>>
>>document.addBindingByNS('http://example.net/','section','bindings#collapsable-sections');
>>
>>or
>>
>>document.getElementsByTagNameNS('http://example.net/','section').addBinding('bindings#collapsable-sections');
> 
> 
> Interesting, I'll think about that.
> 
> 
> 
>>>The result of:
>>>   div { content: url(http://example.com/#test); }
>>>...is _visually_ equivalent to:
>>>   <iframe src="http://example.com/#test"/>
>>>...although of course the semantics are very different.
>>
>>interesting.  I had not realized content could allow so much to be
>>added.  Makese sense... just never considered it.
> 
> 
> In that case you may also have overlooked the technically valid:
> 
>    div { background: url(webpage.html); }

could be interesting to use this to do some interesting looking 
recursion... a squareral or concetric squares come to mind.

>>It wasn't clear after a quick read.  For example, I read this "A binding
>>attached through CSS cannot be removed using removeBinding.", but wonder
>>what would happen if I used deleteRule.  I'm assuming that it would
>>remove the binding, and fire any binding related events, but it is
>>unclear how the interaction with DOM 2 CSS works from the spec.
> 
> 
> The spec shouldn't need to define that. deleteRule() works the same way as
> removing the style rule any other way (e.g. it no longer matching the
> document).

Fair enough.  The reason I thought it should be was that the css 
mechanism and dom mechanism are not exactly equivalent...  removeBinding 
only removes bindings added through the DOM.

> Selectors, like XPath, can be used for anything.
> 
> text/css, on the other hand, should only be used for styling.

So presumably other purposes can defined their own text/foo , and DOM 3 
CSS could have a getElementsBySelector interface.

>>I'm not convinced that I'm right either.  I just feel that the lines of
>>style and structure are being blurred.
> 
> 
> Oh, they are, there's no doubt about that. But BECSS is not the start of
> the blur, it's merely that because it involves scripting, people suddenly
> become more skeptical that it can be used for styling.
> 
> It is quite easy to show pure CSS1 being used in non-stylistic ways. It is
> even easier with CSS2. As you add more power to the language, it becomes
> easier to abuse it.
> 
> But this is the case with any technology. The key is to see whether the
> technology can be used correctly, and whether that is the use that has
> been optimised (i.e. is it easier to do the right thing or the wrong
> thing). I think with the BECSS proposal (the XBL-like version that hasn't
> been published yet) that it is indeed easier to do the right thing.

Whether it is true or not, css is generally perceiveded to be "safe". 
I'd hate to see css be thought of like JavaScript and disabled in a 
significant percentage of browsers.  Though in general I'm all for 
adding useful features and flexibility.

>>My secondary points are wondering if selectors can/should be used for
>>other purposes and how, and the interaction of DOM XBL with DOM CSS.
> 
> 
> The integration of DOM XBL with DOM CSS should be "obvious" from the
> definitions of DOM CSS wrt to CSS and DOM XBL wrt CSS.

Except for the case of removeBinding, yes.

> Selectors can be used whenever you want a selection language, much like
> XPath (although they serve subtly different, albeit overlapping, roles).

Are there any known implementations?

Thanks,
-Dylan

--
Dylan Schiemann
http://www.dylanschiemann.com/
http://www.sitepen.com/

Received on Wednesday, 29 October 2003 17:33:13 UTC