[Laszlo-dev] [UPDATED] For Review: Change 20070102-ptw-s Summary: Better typing for styles
ben at laszlosystems.com
Wed Jan 3 08:50:05 PST 2007
Frisco, please retest with this new change. To re-apply a changeset,
$ svn revert -R .
and then apply the changeset as usual.
This also fixes LPP-2954, Make hex color (#FFFFFF), named color
(red), and rgb(x,x,x) color specification work in CSS
I realized we can and should check this in to trunk, and we can
separately make the call about whether to merge it to 3.4alpha.
(Except I haven't technically reviewed it yet.) I think it *should*
go into 3.4alpha, because it is so clearly the Right Thing correcting
a previous Wrong Thing.
BTW, Frisco is Our Man for CSS qa and documentation. You can draft
him for qa reviewer and doc reviewer for css changes.
On Jan 3, 2007, at 4:44 AM, P T Withington wrote:
> [Updated CSSHandler to functions, reals, and percentages. `rgb
> (10%, 25%, 30%)` works now.]
> Change 20070102-ptw-s by ptw at dueling-banjos.local on 2007-01-02
> 10:14:51 EST
> in /Users/ptw/OpenLaszlo/trunk
> Summary: Better typing for styles
> Bugs Fixed:
> LPP-3356: 'can't make bgcolor transparent with css'
> Technical Reviewer: ben (pending)
> QA Reviewer: adam (pending)
> Doc Reviewer: jsundman (Message-Id: <65BC51A6-BFF2-4589-
> A18D-476E9CDB2DEE at laszlosystems.com>)
> It seems that people want to write CSS colors as 0xFF00DD. But that
> is not valid CSS. So they wrote them as "0xFF00DD" and then were
> disappointed that the runtime did not recognize those strings as
> numbers. So a kludge was added to the style applicator to convert
> strings to numbers. But this kludge did not consider that the string
> "null" would coerce nicely to the number 0, which for a color is
> black. And thereby hangs a tale.
> Release Notes:
> You will get a warning if you use "OxXXXXXX" to specify a color in a
> CSS style sheet. You should be using #XXXXXX instead.
> LzCSSStyle.js: Consider the case where the value of the property
> may be 0, or null, which coerce to false in a boolean context.
> LzNode.as: Only do the string->int conversion if the string is
> really parseable as a number. Warn the user that there is a
> better way.
> LaszloView.as: Fix the code that was trying to warn you when you
> set bgcolor to a non-number to actually detect and report that.
> StyleProperty.java: Add a toString method to support
> CSSHandler.java: Use the LexicalUnitType information to store the
> StyleSheetCompiler: Use ScriptCompiler.writeObject to write the
> style map, so that type information encoded in the literals is
> Bug test and failing cases both pass now. That is, once I
> corrected the failing test case to specify CSS bgcolor as the
> token `null`, rather than the string `"null"`.
> M WEB-INF/lps/lfc/services/LzCSSStyle.js
> M WEB-INF/lps/lfc/core/LzNode.as
> M WEB-INF/lps/lfc/views/LaszloView.as
> M WEB-INF/lps/server/src/org/openlaszlo/css/StyleProperty.java
> M WEB-INF/lps/server/src/org/openlaszlo/css/CSSHandler.java
> M WEB-INF/lps/server/src/org/openlaszlo/compiler/
> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20070102-
ben at laszlosystems.com
More information about the Laszlo-dev