|
|
|
[
Permlink
| « Hide
]
Benjamin Shine - 06/Oct/06 04:47 PM
Test case checked in to trunk as test/style/constraints/subclassing.lzx
* high P2 -- not a stop ship, but really bad. Will probably drive people crazy.
note that this does work:
<canvas> <stylesheet> styledview { bgcolor: "0x3980F4"; } </stylesheet> <class name="styledview" bgcolor="$style{'bgcolor'}" width="200" height="100"/> <styledview bgcolor="$once{'0xff0000'}"/> </canvas> r3313 | ptw | 2007-01-07 09:08:56 -0500 (Sun, 07 Jan 2007) | 27 lines
Changed paths: M /openlaszlo/trunk/WEB-INF/lps/lfc/core/LzNode.as M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/css/CSSHandler.java M /openlaszlo/trunk/test/style/constraints/subclassing.lzx Change 20070104-ptw-n by ptw@dueling-banjos.local on 2007-01-04 15:50:27 EST in /Users/ptw/OpenLaszlo/trunk Summary: Make style constraints play nice Bugs Fixed: Technical Reviewer: ben (Message-Id: <F52C2076-08E8-4869-BB03-22F38C99BC6F@laszlosystems.com>) QA Reviewer: adam (pending) Doc Reviewer: (pending) Details: subclassing.lzx: Added styleinnercolor, just so I can understand what the test was trying to do. Added a more complex dependency, using an `attr()` style to 'stress-test' style constraints LzNode.as: __LZapplyStyle map now checks to make sure to _not_ constrain an attribute that has an explicit value. It splits style constraints into constant and computed constraints, the computed constraints are applied after the node is init-ed, since those constraints may depend on other node attributes. CSSHandler.java: SAC_ATTR and SAC_IDENT values should be computed values. Tests: test/style/constraints/subclassing.lzx Needs to be checked on a changeset after 5309.
Misread Ben's comments. Reopen and assign to Ben.
This is blocked awaiting some compiler re-org that I am doing. (cf., LPP-2302)
This is currently manifesting as a failure in wafflecone, in http://localhost:8080/wafflecone/test/style/constraints/main.lzx
Author: max
Date: 2007-08-06 19:38:56 -0700 (Mon, 06 Aug 2007) New Revision: 5951 Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs Log: Change 20070806-maxcarlson-l by maxcarlson@plastik on 2007-08-06 18:53:14 PDT in /Users/maxcarlson/openlaszlo/wafflecone for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone Summary: Only set style constraints if the existing value is null New Features: Bugs Fixed: Technical Reviewer: promanik QA Reviewer: ben, ptw Doc Reviewer: (pending) Documentation: Release Notes: Details: LzNode.lzs - Only set styleConstraints[k] if this[k] is null. Tests: http://localhost:8080/wafflecone/test/style/constraints/main.lzx?lzr=swf8 now passes. Modified: openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs =================================================================== --- openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs 2007-08-07 01:57:02 UTC (rev 5950) +++ openlaszlo/branches/wafflecone/WEB-INF/lps/lfc/core/LzNode.lzs 2007-08-07 02:38:56 UTC (rev 5951) @@ -514,7 +514,10 @@ if (! (k in initialArgs)) { // A style that is a function is a constraint if (v instanceof Function) { - styleConstraints[k] = v; + if (this[k] == null) { +// Debug.warn("setting %w[%w] to %w, was %w", this, k, v, this[k]); + styleConstraints[k] = v; + } } else { // Debug.format("%w[%s] (%#w) %#w -> %#w", this, k, stylemap[k], this.k, v); if (v != null) this.setAttribute(k, v); _______________________________________________ Laszlo-checkins mailing list Laszlo-checkins@openlaszlo.org http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins I am testing in r6938 running Firefox 2.0.0.8 in Windows and seem to be seeing bad behavior in both of the attached tests (taken from the bug notes).
It seems that styles applied to subclasses do not override styles applied to the superclass in this build. The stuff I am working on for
The test case given in the initial bug is incomplete/inaccurate, which is why this bug keeps getting re-opened. Here is a complete testcase, but this test is also already included in test/style/constraints/subclassing.lzx:
<canvas> <stylesheet> styledbox { stylebgcolor : purple; } </stylesheet> <class name="styledbox" width="70" height="70" bgcolor="$style{'stylebgcolor'}" /> <class name="subclassbox" extends="styledbox"> <attribute name="bgcolor" value="green" /> <attribute name="width" value="150" /> </class> <subclassbox id="sb2" /> </canvas> Correct: green rectangle Incorrect: purple rectangle (4.2alpha build r10620)
Fixed rectangle is green. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||