W3C home > Mailing lists > Public > public-tt@w3.org > December 2008

Re: Specification problem - referential style chaining.

From: Glenn A. Adams <gadams@xfsi.com>
Date: Mon, 08 Dec 2008 13:16:07 +0800
To: Public TTWG List <public-tt@w3.org>
Message-ID: <C562CE97.6D31%gadams@xfsi.com>


OK, we can clean up or augment this language a bit to make more clear. I
introduced LEFT-PRECEDENCE as a didactic device in this case (not coming
from spec) in order to show order of application.

On 12/7/08 8:42 PM, "Sean Hayes" <Sean.Hayes@microsoft.com> wrote:

> Well as you once said, understanding a spec is the art of reading carefully
> <grin/>. However notwithstanding that, I believe we should try and make things
> as clear as possible. My argument is not with the algorithm, which I think we
> both agree on, but the manner in which it is expressed.
> 
> I note also in 8.4.1 it defines inline as "direct specification of an
> attribute from the TT Style Namespace or TT Style Extension Namespace on the
> affected element".
> Which, since the intro to 8.4 is defining association to content matter, I
> would take to mean that style attributes on style elements are not 'inline',
> and this rule is not applicable in the manner you state.
> 
> Also, where does LEFT-PRECEDENCE come from? I don't see how that is related
> to:
> " If the same style property is specified in more than one referenced
> specification, then the last referenced style specification applies, where the
> order of application starts from the affected element and proceeds to
> referenced style specifications, and, in turn, to subsequent referenced style
> specifications.";
> 
> My reading of this phrase would be a RIGHT-PRECEDENCE operator, wherein lies
> my issue. I believe that defining referential style application in terms of a
> tree walk is a clearer exposition.
> 
> Sean Hayes
> Media Accessibility Strategist
> Accessibility Business Unit
> Microsoft
> 
> Office:  +44 118 909 5867,
> Mobile: +44 7875 091385
> 
> 
> -----Original Message-----
> From: Glenn A. Adams [mailto:gadams@xfsi.com]
> Sent: 07 December 2008 00:52
> To: Sean Hayes; Public TTWG List
> Subject: Re: Specification problem - referential style chaining.
> 
> Ah, I misunderstood you. In any case, let's decode your example a bit more
> carefully:
> 
>>>             <style id="s1" tts:color="brown" />
>>>             <style id="s2" style="s1" tts:color="black"/>
>>>             <style id="s3" style="s2" />
> 
> s1 is easy, and it means:
> 
> s1 -> { <tts:color,brown> }
> 
> s2 on the other hand, is derived as follows:
> 
> s2 -> LEFT-PRECENDENCE < { <tts:color,black> }, s1 >
>    -> LEFT-PRECENDENCE < { <tts:color,black> }, { <tts:color,brown> } >
>    -> { tts:color,black }
> 
> [N.B. Section 8.4.1 says "Style properties associated by inline styling are
> afforded a higher priority than all other forms of style association.", so
> that in resolving s2, the inline style tts:color has precedence over
> referential styling style="s1".]
> 
> s3 -> s2
>    -> { tts:color,black }
> 
> We get black, and not brown. So perhaps there is no problem here.
> 
> G.
> 
> On 12/7/08 7:19 AM, "Sean Hayes" <Sean.Hayes@microsoft.com> wrote:
> 
>> I wasn't talking about lexical order of elements, but of chains with multiple
>> links. In a single chain the last referenced style would be the most distant
>> from the affected element; which is wrong.
>> 
>> Sean Hayes
>> Media Accessibility Strategist
>> Accessibility Business Unit
>> Microsoft
>> 
>> Office:  +44 118 909 5867,
>> Mobile: +44 7875 091385
>> 
>> 
>> -----Original Message-----
>> From: Glenn A. Adams [mailto:gadams@xfsi.com]
>> Sent: 06 December 2008 22:49
>> To: Sean Hayes; Public TTWG List
>> Subject: Re: Specification problem - referential style chaining.
>> 
>> I disagree. The lexical order of the style element in the document should
>> have no affect on the order of style resolution in the case of multiple
>> style chains. The reason for this is that these style specification chains
>> are semantically ordered via id references, and not lexically ordered
>> (according to appearance in document order).
>> 
>> It would also be more difficult for a processor to resolve styles using a
>> combination of style id references and the order of appearance of the
>> defining element.
>> 
>> The spec should not be changed.
>> 
>> Glenn
>> 
>> 
>> On 12/6/08 10:01 PM, "Sean Hayes" <Sean.Hayes@microsoft.com> wrote:
>> 
>>> 
>>> The spec currently says:
>>> 
>>> " If the same style property is specified in more than one referenced
>>> specification, then the last referenced style specification applies, where
>>> the
>>> order of application starts from the affected element and proceeds to
>>> referenced style specifications, and, in turn, to subsequent referenced
>>> style
>>> specifications."
>>> 
>>> I don't think this is clear enough on how referential styling is supposed to
>>> work.I think it works for cases such as the following:
>>> 
>>>             <style id="s1" tts:color="brown" />
>>>             <style id="s2" tts:color="black"/>
>>>             <style id="s3" style="s1 s2" />
>>> 
>>> An element referencing s3, would have color black.
>>> 
>>> But in this case:
>>>             <style id="s1" tts:color="brown" />
>>>             <style id="s2" style="s1" tts:color="black"/>
>>>             <style id="s3" style="s2" />
>>> 
>>> The 'last' referenced style here is s1, and thus an element referencing s3,
>>> would have color brown.
>>> 
>>> This is not my understanding of how it is supposed to work, which is that
>>> the
>>> order is a linearization of the tree in a depth first pre-order. Such that
>>> the
>>> 'last' element is black in both cases.
>>> 
>>> To clarify this I suggest we edit the last sentence to:
>>> 
>>> where the order of application is a depth first pre-order tree walk starting
>>> from the affected element including referenced style specifications, and all
>>> subsequent referenced style specifications."
>>> 
>>> Example:
>>> 
>>>             <style id="s1" tts:color="brown" />
>>>             <style id="s2" style="s1" tts:color="black"/>
>>>             <style id="s3" tts:color="green" />
>>>             <style id="s4" style="s3" tts:color="yellow"/>
>>>             <style id="s5" style="s4 s2" tts:color="pink" />
>>> 
>>>             <p style="s5" tts:color="red">...</p>
>>> 
>>> The depth first pre order for color here would be:
>>>    green, yellow, brown, black, pink, red.
>>> 
>>> The last and therefore applied color being red.
>>> 
>>> 
>>> Sean Hayes
>>> Media Accessibility Strategist
>>> Accessibility Business Unit
>>> Microsoft
>>> 
>>> Office:  +44 118 909 5867,
>>> Mobile: +44 7875 091385
>>> 
>>> 
>> 
>> 
> 
> 
Received on Monday, 8 December 2008 05:16:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 2 November 2009 22:41:39 GMT