You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ca...@apache.org on 2016/12/10 16:36:18 UTC
flex-asjs git commit: Change innerHTML for a textNode to avoid remove text when using beads that “append” html tags
Repository: flex-asjs
Updated Branches:
refs/heads/develop 07dfd97bb -> 9b467ea51
Change innerHTML for a textNode to avoid remove text when using beads that \u201cappend\u201d html tags
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9b467ea5
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9b467ea5
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9b467ea5
Branch: refs/heads/develop
Commit: 9b467ea5129b93d12e785b7a73de7a60303a01c2
Parents: 07dfd97
Author: Carlos Rovira <ca...@apache.org>
Authored: Sat Dec 10 17:36:13 2016 +0100
Committer: Carlos Rovira <ca...@apache.org>
Committed: Sat Dec 10 17:36:13 2016 +0100
----------------------------------------------------------------------
.../HTML/src/main/flex/org/apache/flex/html/Span.as | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9b467ea5/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
index 1771948..7dbe220 100644
--- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
+++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
@@ -70,13 +70,23 @@ package org.apache.flex.html
COMPILE::JS
{
- if(MXMLDescriptor == null) {
- element.innerHTML = text;
+ if(MXMLDescriptor == null)
+ {
+ if(textNode == null)
+ {
+ textNode = document.createTextNode('') as Text;
+ element.appendChild(textNode);
+ }
+
+ textNode.nodeValue = value;
}
}
}
+ COMPILE::JS
+ private var textNode:Text;
+
/**
* @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
*/
Re: flex-asjs git commit: Change innerHTML for a textNode to avoid remove text when using beads that “append” html tags
Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi Piotr,
this change is to handle the case where a tag node has mxml inner elements
or has simple text. So normaly what you say is true, but here we are
handling if user wants text (so creating a text node) or if he wants other
nested tags (something I was struggling to get for the last month and
finaly this is the way to do it)
2016-12-10 17:49 GMT+01:00 Piotr Zarzycki <pi...@gmail.com>:
> Hi Carlos,
>
> Is it creation of internal elements shouldn't be in createElement instead
> in some setter?
>
> Piotr
>
> On Sat, Dec 10, 2016, 17:36 <ca...@apache.org> wrote:
>
> > Repository: flex-asjs
> > Updated Branches:
> > refs/heads/develop 07dfd97bb -> 9b467ea51
> >
> >
> > Change innerHTML for a textNode to avoid remove text when using beads
> that
> > “append” html tags
> >
> >
> > Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> > Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9b467ea5
> > Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9b467ea5
> > Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9b467ea5
> >
> > Branch: refs/heads/develop
> > Commit: 9b467ea5129b93d12e785b7a73de7a60303a01c2
> > Parents: 07dfd97
> > Author: Carlos Rovira <ca...@apache.org>
> > Authored: Sat Dec 10 17:36:13 2016 +0100
> > Committer: Carlos Rovira <ca...@apache.org>
> > Committed: Sat Dec 10 17:36:13 2016 +0100
> >
> > ----------------------------------------------------------------------
> > .../HTML/src/main/flex/org/apache/flex/html/Span.as | 14
> ++++++++++++--
> > 1 file changed, 12 insertions(+), 2 deletions(-)
> > ----------------------------------------------------------------------
> >
> >
> >
> > http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
> 9b467ea5/frameworks/projects/HTML/src/main/flex/org/apache/
> flex/html/Span.as
> > ----------------------------------------------------------------------
> > diff --git
> > a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
> > b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
> > index 1771948..7dbe220 100644
> > --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/
> html/Span.as
> > +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/
> html/Span.as
> > @@ -70,13 +70,23 @@ package org.apache.flex.html
> >
> > COMPILE::JS
> > {
> > - if(MXMLDescriptor == null) {
> > - element.innerHTML = text;
> > + if(MXMLDescriptor == null)
> > + {
> > + if(textNode == null)
> > + {
> > + textNode = document.createTextNode('') as Text;
> > + element.appendChild(textNode);
> > + }
> > +
> > + textNode.nodeValue = value;
> > }
> > }
> >
> > }
> >
> > + COMPILE::JS
> > + private var textNode:Text;
> > +
> > /**
> > * @flexjsignorecoercion org.apache.flex.core.
> WrappedHTMLElement
> > */
> >
> >
>
--
Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es
Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.
De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.
Re: flex-asjs git commit: Change innerHTML for a textNode to avoid remove text when using beads that “append” html tags
Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi Piotr,
this change is to handle the case where a tag node has mxml inner elements
or has simple text. So normaly what you say is true, but here we are
handling if user wants text (so creating a text node) or if he wants other
nested tags (something I was struggling to get for the last month and
finaly this is the way to do it)
2016-12-10 17:49 GMT+01:00 Piotr Zarzycki <pi...@gmail.com>:
> Hi Carlos,
>
> Is it creation of internal elements shouldn't be in createElement instead
> in some setter?
>
> Piotr
>
> On Sat, Dec 10, 2016, 17:36 <ca...@apache.org> wrote:
>
> > Repository: flex-asjs
> > Updated Branches:
> > refs/heads/develop 07dfd97bb -> 9b467ea51
> >
> >
> > Change innerHTML for a textNode to avoid remove text when using beads
> that
> > “append” html tags
> >
> >
> > Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> > Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9b467ea5
> > Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9b467ea5
> > Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9b467ea5
> >
> > Branch: refs/heads/develop
> > Commit: 9b467ea5129b93d12e785b7a73de7a60303a01c2
> > Parents: 07dfd97
> > Author: Carlos Rovira <ca...@apache.org>
> > Authored: Sat Dec 10 17:36:13 2016 +0100
> > Committer: Carlos Rovira <ca...@apache.org>
> > Committed: Sat Dec 10 17:36:13 2016 +0100
> >
> > ----------------------------------------------------------------------
> > .../HTML/src/main/flex/org/apache/flex/html/Span.as | 14
> ++++++++++++--
> > 1 file changed, 12 insertions(+), 2 deletions(-)
> > ----------------------------------------------------------------------
> >
> >
> >
> > http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
> 9b467ea5/frameworks/projects/HTML/src/main/flex/org/apache/
> flex/html/Span.as
> > ----------------------------------------------------------------------
> > diff --git
> > a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
> > b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
> > index 1771948..7dbe220 100644
> > --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/
> html/Span.as
> > +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/
> html/Span.as
> > @@ -70,13 +70,23 @@ package org.apache.flex.html
> >
> > COMPILE::JS
> > {
> > - if(MXMLDescriptor == null) {
> > - element.innerHTML = text;
> > + if(MXMLDescriptor == null)
> > + {
> > + if(textNode == null)
> > + {
> > + textNode = document.createTextNode('') as Text;
> > + element.appendChild(textNode);
> > + }
> > +
> > + textNode.nodeValue = value;
> > }
> > }
> >
> > }
> >
> > + COMPILE::JS
> > + private var textNode:Text;
> > +
> > /**
> > * @flexjsignorecoercion org.apache.flex.core.
> WrappedHTMLElement
> > */
> >
> >
>
--
Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es
Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.
De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.
Re: flex-asjs git commit: Change innerHTML for a textNode to avoid remove text when using beads that “append” html tags
Posted by Piotr Zarzycki <pi...@gmail.com>.
Hi Carlos,
Is it creation of internal elements shouldn't be in createElement instead
in some setter?
Piotr
On Sat, Dec 10, 2016, 17:36 <ca...@apache.org> wrote:
> Repository: flex-asjs
> Updated Branches:
> refs/heads/develop 07dfd97bb -> 9b467ea51
>
>
> Change innerHTML for a textNode to avoid remove text when using beads that
> “append” html tags
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9b467ea5
> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9b467ea5
> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9b467ea5
>
> Branch: refs/heads/develop
> Commit: 9b467ea5129b93d12e785b7a73de7a60303a01c2
> Parents: 07dfd97
> Author: Carlos Rovira <ca...@apache.org>
> Authored: Sat Dec 10 17:36:13 2016 +0100
> Committer: Carlos Rovira <ca...@apache.org>
> Committed: Sat Dec 10 17:36:13 2016 +0100
>
> ----------------------------------------------------------------------
> .../HTML/src/main/flex/org/apache/flex/html/Span.as | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
> ----------------------------------------------------------------------
>
>
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9b467ea5/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
> ----------------------------------------------------------------------
> diff --git
> a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
> b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
> index 1771948..7dbe220 100644
> --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
> +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
> @@ -70,13 +70,23 @@ package org.apache.flex.html
>
> COMPILE::JS
> {
> - if(MXMLDescriptor == null) {
> - element.innerHTML = text;
> + if(MXMLDescriptor == null)
> + {
> + if(textNode == null)
> + {
> + textNode = document.createTextNode('') as Text;
> + element.appendChild(textNode);
> + }
> +
> + textNode.nodeValue = value;
> }
> }
>
> }
>
> + COMPILE::JS
> + private var textNode:Text;
> +
> /**
> * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
> */
>
>
Re: flex-asjs git commit: Change innerHTML for a textNode to avoid remove text when using beads that “append” html tags
Posted by Piotr Zarzycki <pi...@gmail.com>.
Hi Carlos,
Is it creation of internal elements shouldn't be in createElement instead
in some setter?
Piotr
On Sat, Dec 10, 2016, 17:36 <ca...@apache.org> wrote:
> Repository: flex-asjs
> Updated Branches:
> refs/heads/develop 07dfd97bb -> 9b467ea51
>
>
> Change innerHTML for a textNode to avoid remove text when using beads that
> “append” html tags
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9b467ea5
> Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9b467ea5
> Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9b467ea5
>
> Branch: refs/heads/develop
> Commit: 9b467ea5129b93d12e785b7a73de7a60303a01c2
> Parents: 07dfd97
> Author: Carlos Rovira <ca...@apache.org>
> Authored: Sat Dec 10 17:36:13 2016 +0100
> Committer: Carlos Rovira <ca...@apache.org>
> Committed: Sat Dec 10 17:36:13 2016 +0100
>
> ----------------------------------------------------------------------
> .../HTML/src/main/flex/org/apache/flex/html/Span.as | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
> ----------------------------------------------------------------------
>
>
>
> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9b467ea5/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
> ----------------------------------------------------------------------
> diff --git
> a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
> b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
> index 1771948..7dbe220 100644
> --- a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
> +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/Span.as
> @@ -70,13 +70,23 @@ package org.apache.flex.html
>
> COMPILE::JS
> {
> - if(MXMLDescriptor == null) {
> - element.innerHTML = text;
> + if(MXMLDescriptor == null)
> + {
> + if(textNode == null)
> + {
> + textNode = document.createTextNode('') as Text;
> + element.appendChild(textNode);
> + }
> +
> + textNode.nodeValue = value;
> }
> }
>
> }
>
> + COMPILE::JS
> + private var textNode:Text;
> +
> /**
> * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
> */
>
>