Approved.

Couple of comments:

1) Why not cache the classname -> class lookup when parsing the rule,  
instead of having to re-ask it?
2) _selTypes.class is what CSS would call a 'tag' selector, which  
confuses me -- if/when we offer the orthogonal CSS 'class' selector,  
it will get more confusing.

On 2006-09-13, at 20:08 EDT, Adam Wolff wrote:

> Change change.XXXXXXXXX.4kLDyQqX.txt by [EMAIL PROTECTED] /Users/adam/ 
> laszlo/src/svn/openlaszlo/trunk/ on 2006-09-13 16:30:54 PDT
>
> Summary: Fix specificity implementation for CSS rules. Implement  
> new "applicability" logic without resorting to poking at private  
> aspects of the class implementation.
>
> New Features:
>
> Bugs Fixed:
>
> Technical Reviewer: ptw
> QA Reviewer: (pending)
> Doc Reviewer: (pending)
>
> Documentation:
>
> Release Notes:
> In cases where two rules have the same specificity, Laszlo defines  
> an additional "applicability" rule, which attempts to prefer rules  
> which select subclasses over rules which select superclasses.
>
> In the case of descendant selectors, descendants are compared in  
> lock-step. If two steps in the descendant selector select for non- 
> equivalent classes, the subclass will be considered higher  
> specificity than the superclass.
>
> In cases where one of the two descendants being compared is not a  
> class selector, the selector is skipped for the purposes of this  
> comparison. If the comparison process walks off the end of either  
> selector chain, last-one-wins lexical order applies.
>
> Details:
> This is a refactor of the specificity rule calculation in addition  
> to a removal of the skanky classhops count.
>
> Tests:
>    New test:
>     http://localhost:8080/trunk/test/style/specificity/ 
> newspecificity.lzx
>
>    Updated (to show how redefined applicability works) :
>     http://localhost:8080/trunk/test/style/specificity/ 
> applicability.lzx
>
>    Ran:
>     http://localhost:8080/trunk/diamond/client/test/speedtest.lzx
>     http://localhost:8080/trunk/test/style/descendantselector/ 
> complex-descendant-selector-test.lzx
>     http://localhost:8080/trunk/test/style/constraints/constraint- 
> test.lzx
>     http://localhost:8080/trunk/test/style/specificity/specificity- 
> tests.lzx
>
>
> Files:
> M      test/style/specificity/applicability.lzx
> A      test/style/specificity/newspecificity.lzx
> M      WEB-INF/lps/lfc/services/LzCSSStyle.js
> <patch.adam.0YHE.tgz>


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

Reply via email to