[UPDATED: Per André's last suggestion, I am not trying to sort out the text/html issues here. I am only splitting string from text/html, so that attributes with type string can have literal values expressed as ECMAScript String literals.
] Change 20100525-ptw-1 by [email protected] on 2010-05-25 09:56:35 EDT in /Users/ptw/OpenLaszlo/trunk for http://svn.openlaszlo.org/openlaszlo/trunk Summary: Correct quoting of string-typed attributes Bugs Fixed: LPP-9027 pattern attribute on text doesn't work as expected in trunk Technical Reviewer: [email protected] (pending) QA Reviewer: [email protected] (pending) Release Notes: The LZX `string` attribute type is no longer a synonym for `text` and `html`. The `string` type implies an ECMAScript string. Literal values assigned to attributes of that type will be interpreted as ECMAScript `String` literals, meaning that the ECMAScript single-character (\t, \n, etc.) and short (\xNN) and long (\uNNNN) escapes will be interpreted as defined in the ECMAScript standard. The `text` and `html` types imply XML content. Literal values assigned to attributes of that type will (continue to) be interpreted as verbatim text. ECMAScript escapes will not be interpreted. The `<text>/text` attribute is now declared to be of type `text`, to indicate that it represents HTML content, not an ECMAScript string. If you redeclare the `text` attribute in a subclass of `<text>` you should omit any type declaration as it is redundant. (If you had declared the type as `string`, the compiler will issue a warning.) Overview: Split the `string` LZX type from the `text` and `html` types (leaving the latter two as synonyms for now). Declare the type of `<text>/text` to be `text` (which is the popular concensus in components, although perhaps incorrect because <text> behaves as if it were `html`; that is, it interprets markup). With this split, we are able to have the LZX compiler interpret literal `string` values as ECMAScript `String`s and solve the original bug. In a future change we will address the `<text>/text` `text`/`html` issue. Details: lztest-node: Added tests to verify that setting a string attribute using a literal or expression is the same as setting an expression attribute to a literal string using the failing pattern from the bug (which verifies the use of \u escapes to specify unicode characters works). LzNode: Added mapping for text and html presentation types.. PresentationTypes: Added text presentation type which escapes/unescapes the 5 XML entities. This presentation type should eventually replace the many copies of xml escaping code. LzText: Change the @lzxtype of the `text` attribute from `string` to `text`. LzDataset: Correct spelling of @lzxtype noticed in passing SchemaBuilder: Handle `text` and `html` types Schema, ViewSchema, NodeModel: Added real types for 'text' and 'html', distinct from 'string', which affects how immediate values of those types are interpreted by the tag compiler: 'string' implies an ECMAScript string (i.e., interpreted as an ECMAScript String literal), 'text' implies XML CDATA and 'html' implies XML content. In this change, the latter two remain synonyms (as they currently are), and are _not_ interpreted as ECMAScript strings, but as XML content. In a later change the implied distinction between `text` and `html` will be addressed debugger: Remove unused `escapeText` noticed in passing. basecombobox: Remove redundant (conflicting) attribute declaration. photo, classes: Remove redundant (conflicting) attrbute type specification. Tests: ant lztest with new node attribute tests, smokecheck, various combinations of demos and runtimes. Files: M test/lztest/lztest-node.lzx M WEB-INF/lps/lfc/core/LzNode.lzs M WEB-INF/lps/lfc/core/PresentationTypes.lzs M WEB-INF/lps/lfc/views/LzText.lzs M WEB-INF/lps/lfc/data/LzDataset.lzs M WEB-INF/lps/server/src/org/openlaszlo/js2doc/SchemaBuilder.java M WEB-INF/lps/server/src/org/openlaszlo/xml/internal/Schema.java M WEB-INF/lps/server/src/org/openlaszlo/compiler/ViewSchema.java M WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java M lps/components/debugger/debugger.lzx M lps/components/base/basecombobox.lzx M demos/lzpix/classes/photo.lzx M demos/lzpix/classes/classes.lzx M demos/lzpix/classes/clipboard.lzx Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20100525-ptw-1.tar
