I transcribed your test a closely as possible into html, and your  
intuition is born out (I'll send you my code if you like).

$style should look up the value of the css attribute on the enclosing  
node (edgar).  Assuming that by default attributes should inherit,  
the cascade for testdata in edgar should be:

rule 3  (tag selector on ancestor node)
rule 1  (attribute selector on ancestor node)
rule 2  (tag selector on this node)

If you are getting something else, that seems like a bug to me.  This  
doesn't seem like that subtle a case, so I would be concerned.

On  2006-09-08, at 22:34 EDT, Benjamin Shine wrote:

> LPP-2618, combined with an example from Gregor, started an inquiry,  
> which led me to something weird.
>
> Take these three rules:
>
>         /* rule 1, specificity 10 */
>         [name="thename"] {
>             testdata: "i am thename";
>         }
>
>         /* rule 2, specificity 1 */
>         testclass {
>             testdata: "i am testclass";
>         }
>
>         /* rule 3, specificity 1 */
>         view {
>             testdata: "i am view";
>         }
>
> And this view structure:
>
>         <view name="thename">
>             <testclass id="edgar">
>                 <attribute name="testdata" value="$style 
> {'testdata'}" />
>             </testclass>
>         </view>
>
>
> What should the value of edgar.testdata be?
> Intuitively, I want edgar.testdata to be "i am testclass". What  
> *edgar* is should matter more than one of edgar's ancestors'  
> attributes.
> That's not what happens.
> edgar.getAttribute("testdata") returns "i am view"
>
> All the nearby screw cases I can think of seem to be handled the  
> way I expect them to be, but inconsistently with the edgar case.
>
> I'm attaching a tar with the test cases, and a couple other test  
> cases I've been working on. Adam and Gregor -- what do you think?  
> Am I perseverating here, or is this really a sign of a problem that  
> we care about?
>
> This test is in
> http://localhost:8080/trunk-csswork/test/style/attrselector/main.lzx
>
>
> _______________________________________________
> Laszlo-dev mailing list
> [email protected]
> http://www.openlaszlo.org/mailman/listinfo/laszlo-dev



_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to