Not approved.
We need to have a consensus on what the right approach is here. IMO, having a
flag is _not_ the right approach (because that flag is essentially changing the
type of the `text` attribute from 'text' to 'html', see LPP-9027 and it's
references). I think the HTML approach of having two different accessors (one
for plain text, one for markup) is a better approach.
Whatever we do is going to break some applications because it is clear from the
bug reports that no one knows whether <text>.text is CDATA or content, so we
might as well get this change right.
I'd like to see an API change proposal to laszlo-user before we make any
changes.
Issues:
1) Why is htmltext not supported in DHTML? That should be trivial.
2) What is htmlp?
> LzTextSprite.prototype.setHTML = function (enabled) {
> this.__LZtextclip.html = htmlp;
> }
3) The warning refers to setHTML, it should refer to setAttribute('html', ...)
> override function $lzc$set_html(enabled) {
> this.html = enabled;
> if (this.capabilities['htmlinputtext']) {
> this.isprite.setHTML(enabled);
> } else if ($debug) {
> LzView.__warnCapability('inputtext.setHTML()', 'htmlinputtext');
> }
> if (this.onhtml.ready) this.onhtml.sendEvent(enabled);
4) Same for the setter in LzText.
5) There is no isprite in LzText, did this actually compile?
On 2010-06-18, at 17:50, Max Carlson wrote:
> Change 20100618-maxcarlson-7 by maxcarl...@friendly on 2010-06-18 14:43:16 PDT
> in /Users/maxcarlson/openlaszlo/trunk-clean
> for http://svn.openlaszlo.org/openlaszlo/trunk
>
> Summary: Add setter for html text
>
> New Features: setHTML() has been replaced by the html attribute for text and
> inputtext.
>
> Bugs Fixed: LPP-6617 - Text should be able to be plain or html (partial)
>
> Technical Reviewer: hminsky
> QA Reviewer: ptw
>
> Details: This change attempts to rationalize setting the html display flag
> across text and inputtext.
>
> swf/LzTextSprite - Add setHTML() implementation
>
> */LzSprite.as - Add htmltext capability, set to true.
>
> dhtml/LzSprite - Add htmltext capability, set to false.
>
> LzInputText - Move getDefaultWidth() to property that initted in the
> constructor - AS3 is lame and doesn't allow property overrides - WTF?
> Deprecate setHTML() in favor of html attribute.
>
> LzText - Use __defaultWidth instead of getDefaultWidth(). Add html
> attribute, setter and event.
>
> Tests: HTML text displays as before in SWF. DHTML will continue to warn.
> This lays the groundwork for turning this on/off dynamically
>
> Files:
> M WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as
> M WEB-INF/lps/lfc/kernel/swf/LzSprite.as
> M WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
> M WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
> M WEB-INF/lps/lfc/views/LzInputText.lzs
> M WEB-INF/lps/lfc/views/LzText.lzs
>
> Changeset:
> http://svn.openlaszlo.org/openlaszlo/patches/20100618-maxcarlson-7.tar