[reviews -> dev]
I have been able to correct this regression, so I'm going to check in my change.
But I think the "inheritance" of font properties is not working as intended.
There are these two whacky lines after the call to the super constructor:
// Set to sensible values so text style cascading will work
if (this.fgcolor == null) this.fgcolor = 0;
// Must be set to a number for swf9/10
if (this.fontsize == null) this.fontsize = 11;
If you take these out, swf10 totally breaks, even though at this point the
super call should have applied either the style constraints or the fallback
values.
Do we have a bug already to make fonts inheritance work through CSS? Perhaps
with this improved implementation it's time to investigate that to get a more
uniform implementation.
The current canvas implementation is confusing to me. Because the way it is
implemented, an explicit value in the canvas tag will be overridden by a style
sheet (because of the code that pulls the explicit values out and sticks them
into the fallback slot). This doesn't seem like the correct CSS precedence.
Everywhere else, explicit values in a tag take precedence over any style.
On 2011-01-07, at 21:37, Max Carlson wrote:
> This is great stuff! I see a ~10% improvement when running
> test/style/metasuite.lzx in dhtml.
>
> I see a regression in components/demos/house.lzx - with your change, the
> font-size on the canvas no longer causes the value to be inherited:
>
> <canvas height="1000">
> ...
> <stylesheet>
> canvas {
> font-size: 24;
> font-family: Helvetica,Sans;
> }
> ...
>
> Otherwise, approved!