RE: I18n comment: inheritance of :lang and |=

On Thu, 2 Feb 2006, Richard Ishida wrote:
>
> I think this explanation is still a little obscure for the average 
> person, so I suggest adding an example.
> 
> How about this:
> 
> Original: The difference between :lang(C) and the '|=' operator is that 
> the '|=' operator only performs a comparison against a given attribute 
> on the element, while the :lang(C) pseudo-class uses the UA's knowledge 
> of the document's semantics to perform the comparison.
> 
> Proposal: The difference between ... perform the comparison.  For 
> example, in HTML :lang(ja) would apply styling to an element even if the 
> language was only declared to be Japanese further up the document tree.  
> The '|=' operator would require the language attribute on the element 
> itself.

I've added the example from the CSS 2.1 spec (which is even more 
explicit). Let me know if that's ok or not:

  The difference between :lang(C) and the '|=' operator is that the '|=' 
  operator only performs a comparison against a given attribute on the 
  element, while the :lang(C) pseudo-class uses the UA's knowledge of the 
  document's semantics to perform the comparison.

  In this HTML example, only the BODY matches [lang|=fr] (because it has a 
  LANG attribute) but both the BODY and the P match :lang(fr) (because 
  both are in French).

  <body lang=fr>
    <p>Je suis fran&ccedil;§ais.</p>
  </body>

Cheers,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Monday, 13 March 2006 23:24:53 UTC