This also appears to fix LPP-7278.

I'd use "else if (when.equals(WHEN_STYLE)) { ... "
@@ -1664,6 +1641,12 @@
                 if (when.equals("")) {
                     when = WHEN_ALWAYS;
                 }
+                if (when.equals(WHEN_STYLE)) {
+                  // Handle old-school `$style{'prop'}` value
+                  // That value is a constant will be checked later
+                  // But we need to record the property now
+                  CSSAttributeProperties.put(name, value);
+                }


Parent model fallbacks supersede current model's fallbacks, etc.?
+    if (parentNodeModel != null) {
+ CSSAttributeProperties.putAll(parentNodeModel.CSSAttributeProperties);
+      CSSAttributeTypes.putAll(parentNodeModel.CSSAttributeTypes);
+ CSSAttributeFallbacks.putAll(parentNodeModel.CSSAttributeFallbacks);
+    }
same here...
+    if (parentNodeModel != null) {
+      CSSPropertyExpanders.putAll(parentNodeModel.CSSPropertyExpanders);
+ CSSPropertyInheritable.putAll(parentNodeModel.CSSPropertyInheritable);
+    }




On 1/8/2011 1:59 AM, P T Withington wrote:
Change ptw-20110107-ucB by [email protected] on 2011-01-07 19:29:45 EST
     in /Users/ptw/OpenLaszlo/trunk-3
     for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Improve CSS performance and function

Bugs Fixed:

     LPP-9617 Need a way to define CSS property abbreviations (and their 
expansion)
     LPP-9567 Attribute init order is non-deterministic (partial)

Technical Reviewer: [email protected] (pending)
QA Reviewer: [email protected] (pending)
Doc Reviewer: [email protected] (pending)

Release Notes:

     You can now rely on attributes being initialize according to the
     kind of initial value they have.  Attributes with immediate values
     are initialized first, followed by attributes with style bindings,
     followed by attributes with constraints.  Within those groupings,
     the ordering is indeterminite.

     As a consequence of this change, you can now reliably created
     constraints that depend on style bindings.

Overview:

     Completely revamped the way CSS styles are applied to nodes,
     maintaining the defaulting and overriding semantics, but allowing
     style-bindings to be applied /en masse/ rather than as individual
     constraints.  The result should be the style bindings are
     significantly more efficient than constraints.

     Added support for CSS property "expanders" to handle CSS
     abbreviated properties with correct inheritance and overriding.

     Added support for nodes to know at runtime the type of their
     attributes.  There is a single data structure that describes
     attributes' type, style-binding, and fallback value.

Details:
     lfc-undeclared:  Add $attributeDescriptor and $CDDSescriptor

     LzCSSStyle:  Handle property expanders.

     LzDebug: Improve explainStyleBindings to display local overrides
     of CSS bindings (whether by constraint or explicit value), and to
     understand attribute types and property expanders.

     LzNode: Process style bindings separately from constraints using
     the new batch mechanism.

     LzNode, LzDefs, LzState, LzReplicationManager: Remove previous
     attribute descriptor mechanism which was not fully implemented and
     was inefficient.  Use new compile-time evaluator to simplify
     debug/profile decisions.  StyleConstraints are now just a marker
     that is used to determine inheritance and overriding, not to carry
     the actual style binding.

     PresentationTypes: add a way to create a presentation type value
     from a presentation value for debugging.

     LaszloCanvas: update style binding suppor to new mechanism.

     LzDebugStub: Let's allow a bigger stack.

     ViewSchema:  Add new attribute property `expander`.

     NodeModel, ClassModel: Impement expander.  Handle nodes that are
     not in the DOM (for debugging).  Implement new style binding
     scheme, gather attribute descriptor information, compute
     inheritance at compile time and install in class.  Only install in
     instances when necessary.  Fake type information for built-in's.
     Handle legacy $style bindings compatibly.  Do common subr
     elimination on init args by hand.

     boxmodel:  Implement expanders for abbreviated properties

Tests:
     Test case from bug.  styles/metasuite, smokecheck

Files:
M       WEB-INF/lps/schema/lfc-undeclared.lzx
M       WEB-INF/lps/lfc/services/LzCSSStyle.lzs
M       WEB-INF/lps/lfc/debugger/LzDebug.lzs
M       WEB-INF/lps/lfc/core/LzNode.lzs
M       WEB-INF/lps/lfc/core/PresentationTypes.lzs
M       WEB-INF/lps/lfc/core/LzDefs.lzs
M       WEB-INF/lps/lfc/views/LaszloCanvas.lzs
M       WEB-INF/lps/lfc/helpers/LzState.lzs
M       WEB-INF/lps/lfc/data/LzReplicationManager.lzs
M       WEB-INF/lps/lfc/compiler/LzDebugStub.lzs
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java
M       lps/components/mixins/boxmodel.lzx

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/ptw-20110107-ucB.tar


Reply via email to