Re: XBL in CSS

Ian Hickson wrote:
> On Mon, 14 Aug 2006, Anne van Kesteren wrote:
>> On Mon, 14 Aug 2006 00:50:30 -0700, Ian Hickson <ian@hixie.ch> wrote
>> <http://lists.w3.org/Archives/Public/www-style/2006Aug/0030.html>:
>>>
>>> Second, a pseudo-class ':xbl-bound-element' that matches an XBL bound
>>> element.
>>
>> Can't we make that ':bound-element'? And let other binding languages, if 
>> ever, reuse that pseudo-class just as they can reuse the proposed 
>> 'binding' property? Would make sense to me.
> 
> I would be fine with that, if the rest of the community is ok with it.

Well, either both things should get "namespaced" nor neither of them should.

Mm, does the spec address these?

   :bound-element { binding: none;}

   foo { binding: something-with-value-pseudo; }
   ::value { binding: something-else; }

   ::value { binding: something-with-value-pseudo; }

# each time a binding is applied it can change the computed values of
# properties of elements that are descendants of the bound element

By "properties" do you mean just "CSS properties", or does that include
the 'binding' property as well?

I'm not convinced that XBL binding statements should be mixed indiscriminately
with the rest of CSS. The XBL binding process happens before CSS styling takes
effect. These bindings are something very different from CSS styling, and
binding elements puts loops back into the selection process. No other CSS
property affects the matching of selectors. No other CSS property imports
scripting. I don't mind putting these bindings in a text/css file, but I would
like to see them explicitly separated out from the rest of the CSS rules,
perhaps in an @rule that is always placed before any regular CSS rules.

   @import "foo";
   @bindings {
      input.special { binding: url("mybinding"); }
   }
   input::value {
     background: yellow;
     color: blue;
   }

In addition to highlighting the separation between what a binding does and
what CSS properties do, this makes the order of processing clearer, and it
makes it easier to restrict what selectors are used with the 'binding'
property:
   "The :bound-element pseudo-class is invalid when used in an @bindings rule."

~fantasai

Received on Wednesday, 16 August 2006 15:42:13 UTC