- From: Ian Hickson <ian@hixie.ch>
- Date: Wed, 29 Oct 2003 21:43:21 +0000 (UTC)
- To: Dylan Schiemann <dylans@yahoo.com>
- Cc: www-style@w3.org
On Wed, 29 Oct 2003, Dylan Schiemann wrote: >>> >>> Yes, but the flexibility of XBL seems to encourage it (the script >>> element for example). >> >> No more so than the flexibility of class attributes encourages its own >> abuse, IMHO. > > 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. >> <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); } > 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). > So css selectors then are only to be used for style? I thought that one > of the goals of css selectors was to create a general selection > mechanism. If that's the case, then where would one use such a > selection mechanism for non-styling purposes. Selectors, like XPath, can be used for anything. text/css, on the other hand, should only be used for styling. > 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. > 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. Selectors can be used whenever you want a selection language, much like XPath (although they serve subtly different, albeit overlapping, roles). -- Ian Hickson )\._.,--....,'``. fL U+1047E /, _.. \ _\ ;`._ ,. http://index.hixie.ch/ `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 29 October 2003 16:43:23 UTC