Not Approved.

I'm not sure this is correct.

Comment:

1) This is sort of a brute-force approach to where we were going to add default 
styles to all views.  Seems like you ought to link the two issues and revisit 
this if/when we figure out how to make the "all view" solution efficient enough 
no?

Issue:

1) As implemented here, CSS styles will take precedence over "inline" canvas 
attributes, which is not the expected behavior of styles.  Normally, if I were 
to say:

  <div style="background-color: blue" />

that would have the strongest binding and override any other CSS applicable to 
div background.  By analogy, I would expect:

  <canvas bgcolor="blue">

to override any other CSS applicable to canvas bgcolor.  But as implemented, 
you have made the initargs the CSS fallback, rather than overriding the CSS 
binding.

What we really want to do is to specify the canvas attributes in the schema as:

  <canvas>
    <attribute name="bgcolor" type="color" style="background-color" 
value="null" />

etc. and let the compiler insert the style binder or the inline value as 
appropriate.  If we can't have the compiler pick up this default automatically 
from the schema, then we need to either handle this in CanvasCompiler, or at 
the very least, straighten out your runtime implementation to give init args 
precedence over the default style binders.

On 2010-04-23, at 19:54, Max Carlson wrote:

> Change 20100330-maxcarlson-Y by maxcarl...@bank on 2010-03-30 12:29:16 PDT
>    in /Users/maxcarlson/openlaszlo/trunk-clean
>    for http://svn.openlaszlo.org/openlaszlo/trunk
> 
> Summary: UPDATED AGAIN: Make canvas understand background colors, width, 
> height and font settings.
> 
> Bugs Fixed: LPP-3469 - CSS: Canvas can't be styled
> 
> Technical Reviewer: ptw
> QA Reviewer: hminsky
> 
> Release Notes: The canvas background-color, width, height, font-family, 
> font-size, font-style and font-color CSS attributes can now be styled, e.g.:
> <stylesheet>
>    canvas {
>        background-color: #828282;
>        font-size: 11;
>        font-style: bold;
>        font-family: Helvetica,Sans;
>    }
> </stylesheet>
> 
> Details: 
> swf9/LzSprite - Set id early so calls to setRoot*() will work.
> 
> LzCSSStyle - Don't exclude canvas from style evaluation.  
> 
> LaszloCanvas - Add LzStyleConstraintExpr to set canvas CSS properties.  
> Update constructor to read canvas defaults provided by the compiler and 
> ensure font style defaults are set so text style cascading works.
> 
> Tests: See LPP-3469 across runtimes
> 
> Files:
> M       WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
> M       WEB-INF/lps/lfc/services/LzCSSStyle.lzs
> M       WEB-INF/lps/lfc/views/LaszloCanvas.lzs
> 
> Changeset: 
> http://svn.openlaszlo.org/openlaszlo/patches/20100330-maxcarlson-Y.tar
> 


Reply via email to