Hi Carlos,

In my PAYG perspective, there would be an HTMLAlertVIew (or AlertViewForHTML or 
some other good name) that would take the "message" string from the model and 
hand it to the HTML APIs in the runtime.  Basic Alert/AlertView would just hand 
it the text APIs in the runtime.  The user would swap in the view if they were 
passing in a string that should be interpreted as HTML.

Jewel's Alert can do other things.  It could offer a flag as to whether the 
string should be interpreted as HTML or not.  There is no one right way for the 
higher-level components.

IMO, it is difficult for the framework to guess whether the string should be 
interpreted or not, so the application programmer will probably have to specify 
one way or another.  I think of any web site that tries to teach others how to 
use HTML.  In trying to display uninterpreted HTML in example code it can't let 
every string just get passed into the HTML properties of the elements.

My 2 cents,
-Alex

On 4/4/19, 2:55 PM, "Carlos Rovira" <carlosrov...@apache.org> wrote:

    Hi Alex
    
    I understand that some platforms can need those two apis, but in that case,
    I think something should be done to use both since, right now I think most
    of the times we use "text" and html is just an API that is never pulled in
    the view. For example Jewel Alert was using message but not htmlMessage and
    text but never html in the AlertView label component
    
    
    El jue., 4 abr. 2019 a las 19:30, Alex Harui (<aha...@adobe.com.invalid>)
    escribió:
    
    > There might be a need for some changes related to this topic, but when I
    > originally wrote this code, I assumed there were going to be instances
    > where the "label" of a button should and should not be interpreted as HTML
    > so that is why there are two APIs.  Some platforms (Flash TextField) may
    > have separate platform APIs for displaying strings as interpreted vs
    > un-interpreted.
    >
    > HTH,
    > -Alex
    >
    > On 4/4/19, 10:24 AM, "Harbs" <harbs.li...@gmail.com> wrote:
    >
    >     innerHTML is dangerous.[1] You definitely should not use that for
    > “text”.
    >
    >     Text should either be textContent[2] or innerText[3].
    >
    >     InnerText makes more sense from my perspective.
    >
    >     [1]
    > 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FElement%2FinnerHTML%23Security_considerations&amp;data=02%7C01%7Caharui%40adobe.com%7Cf5d7968f56ea43642dee08d6b9483cf8%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636900117243033715&amp;sdata=e5A8aK5uoPUa5NbunJUSOGgjxNjUfUig00Aw8GD0j8w%3D&amp;reserved=0
    > <
    > 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FElement%2FinnerHTML%23Security_considerations&amp;data=02%7C01%7Caharui%40adobe.com%7Cf5d7968f56ea43642dee08d6b9483cf8%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636900117243033715&amp;sdata=e5A8aK5uoPUa5NbunJUSOGgjxNjUfUig00Aw8GD0j8w%3D&amp;reserved=0
    > >
    >     [2]
    > 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FNode%2FtextContent&amp;data=02%7C01%7Caharui%40adobe.com%7Cf5d7968f56ea43642dee08d6b9483cf8%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636900117243033715&amp;sdata=jhFhTwDk7eLO%2Byw%2FTE4%2FWCTKBw9CT5OnO61N3vnsJCk%3D&amp;reserved=0
    > <
    > 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FNode%2FtextContent&amp;data=02%7C01%7Caharui%40adobe.com%7Cf5d7968f56ea43642dee08d6b9483cf8%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636900117243033715&amp;sdata=jhFhTwDk7eLO%2Byw%2FTE4%2FWCTKBw9CT5OnO61N3vnsJCk%3D&amp;reserved=0
    > >
    >     [3]
    > 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FHTMLElement%2FinnerText&amp;data=02%7C01%7Caharui%40adobe.com%7Cf5d7968f56ea43642dee08d6b9483cf8%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636900117243033715&amp;sdata=H2JJBiWnJO%2BrOhIZLmBt0e0f6KHODLU3hQzeZ6w0PcA%3D&amp;reserved=0
    > <
    > 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FAPI%2FHTMLElement%2FinnerText&amp;data=02%7C01%7Caharui%40adobe.com%7Cf5d7968f56ea43642dee08d6b9483cf8%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636900117243033715&amp;sdata=H2JJBiWnJO%2BrOhIZLmBt0e0f6KHODLU3hQzeZ6w0PcA%3D&amp;reserved=0
    > >
    >
    >     > On Apr 4, 2019, at 8:00 PM, Carlos Rovira <carlosrov...@apache.org>
    > wrote:
    >     >
    >     > ok I'm talking about Jewel components that uses same arq as Basic
    > since are
    >     > based on it. So, for example TextInput, TextArea, Alert, Label,
    > CheckBox,
    >     > RadioButton, Button, and some more has text() and html() getters
    > setters.
    >     >
    >     > I recently changed Jewel Alert to use html instead of text, I'm
    > thinking if
    >     > I should make all Jewel components to have just one property (maybe
    > better
    >     > "text" than "html") that can get just text or text with tags. This
    > will
    >     > save many bytes I think
    >     >
    >     > For example in Jewel Button we have the same code, so html seems not
    > needed
    >     > at all:
    >     >
    >     > [Bindable("textChange")]
    >     > /**
    >     > * @copy org.apache.royale.html.Label#text
    >     > *
    >     > * @langversion 3.0
    >     > * @playerversion Flash 10.2
    >     > * @playerversion AIR 2.6
    >     > * @productversion Royale 0.9.4
    >     > */
    >     >        public function get text():String
    >     >        {
    >     > return (element as HTMLButtonElement).innerHTML;
    >     >        }
    >     >
    >     > /**
    >     > * @private
    >     > */
    >     >        public function set text(value:String):void
    >     >        {
    >     > (element as HTMLButtonElement).innerHTML = value;
    >     > this.dispatchEvent(new Event('textChange'));
    >     >        }
    >     >
    >     > [Bindable("htmlChange")]
    >     > /**
    >     > * @copy org.apache.royale.html.Label#html
    >     > *
    >     > * @langversion 3.0
    >     > * @playerversion Flash 10.2
    >     > * @playerversion AIR 2.6
    >     > * @productversion Royale 0.9.4
    >     > */
    >     >        public function get html():String
    >     >        {
    >     > return (element as HTMLButtonElement).innerHTML;
    >     >        }
    >     >
    >     > /**
    >     > * @private
    >     > */
    >     >        public function set html(value:String):void
    >     >        {
    >     > (element as HTMLButtonElement).innerHTML = value;
    >     > this.dispatchEvent(new Event('textChange'));
    >     >        }
    >     >
    >     > El jue., 4 abr. 2019 a las 16:14, Harbs (<harbs.li...@gmail.com>)
    > escribió:
    >     >
    >     >> The HTML elements have text and innerHTML which correspond to the
    > HTML
    >     >> element properties.
    >     >>
    >     >> I’m not sure what the logic of the basic components is.
    >     >>
    >     >>> On Apr 4, 2019, at 3:18 PM, Kessler CTR Mark J <
    >     >> mark.kessler....@usmc.mil.INVALID> wrote:
    >     >>>
    >     >>>   The "text" property is probably just for compatibility with the
    > flex
    >     >> components if we are talking about things like "TextInput".   Is
    > the "text"
    >     >> property just syntax sugar / wrapping for the html property?
    >     >>>
    >     >>>
    >     >>> -Mark K
    >     >>>
    >     >>>
    >     >>> -----Original Message-----
    >     >>> From: Carlos Rovira [mailto:carlosrov...@apache.org]
    >     >>> Sent: Thursday, April 4, 2019 4:59 AM
    >     >>> To: dev@royale.apache.org
    >     >>> Subject: [Non-DoD Source] text vs html
    >     >>>
    >     >>> Hi
    >     >>>
    >     >>> in many components we have properties "text" and "html", and I was
    > trying
    >     >>> to figure what we need this duplicate currently.
    >     >>> My bet is that just html (or text with html tags support) will be
    >     >>> sufficient.
    >     >>> Is there any need to have this double property, it seems to me not
    > PAYG
    >     >> and
    >     >>> html supports text with more things, so not reason for this, at
    > least
    >     >> that
    >     >>> I know
    >     >>>
    >     >>> thanks
    >     >>>
    >     >>> --
    >     >>> Carlos Rovira
    >     >>>
    > 
https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7Cf5d7968f56ea43642dee08d6b9483cf8%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636900117243033715&amp;sdata=7P9bGZofZkH7PyQZGe7vP8HIljeV3EFCX9oBJ%2BOaB7E%3D&amp;reserved=0
    >     >>
    >     >>
    >     >
    >     > --
    >     > Carlos Rovira
    >     >
    > 
https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7Cf5d7968f56ea43642dee08d6b9483cf8%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636900117243043724&amp;sdata=OTNVzHDjI3HmyjA4QQHmB5RJ48MLv42XuciyEbJUhcE%3D&amp;reserved=0
    >
    >
    >
    >
    
    -- 
    Carlos Rovira
    
https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7Cf5d7968f56ea43642dee08d6b9483cf8%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636900117243043724&amp;sdata=OTNVzHDjI3HmyjA4QQHmB5RJ48MLv42XuciyEbJUhcE%3D&amp;reserved=0
    

Reply via email to