You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Alex Harui <ah...@adobe.com> on 2017/02/06 17:36:13 UTC

Re: [1/2] git commit: [flex-asjs] [refs/heads/develop] - Remove css prefixing whitespaces in UIBase when value is empty

I just noticed this.  What does it mean "value is empty"?  Trim() can be
really expensive, so should this code just test for value is empty and do
something else?

Thanks,
-Alex

On 1/3/17, 10:39 AM, "carlosrovira@apache.org" <ca...@apache.org>
wrote:

>Repository: flex-asjs
>Updated Branches:
>  refs/heads/develop 354c8dc08 -> b1f2493e3
>
>
>Remove css prefixing whitespaces in UIBase when value is empty
>
>
>Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
>Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/632b4937
>Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/632b4937
>Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/632b4937
>
>Branch: refs/heads/develop
>Commit: 632b4937da0b8253dc32706eb862a426ad7babd9
>Parents: ffd738d
>Author: Carlos Rovira <ca...@apache.org>
>Authored: Tue Jan 3 19:38:48 2017 +0100
>Committer: Carlos Rovira <ca...@apache.org>
>Committed: Tue Jan 3 19:38:48 2017 +0100
>
>----------------------------------------------------------------------
> .../projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as    | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>----------------------------------------------------------------------
>
>
>http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/632b4937/frameworks/
>projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as
>----------------------------------------------------------------------
>diff --git 
>a/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as
>b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as
>index 1c825d6..b075e72 100644
>--- 
>a/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as
>+++ 
>b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as
>@@ -33,6 +33,7 @@ package org.apache.flex.core
> 	    import flash.display.InteractiveObject;
> 	    import org.apache.flex.events.utils.MouseEventConverter;
> 	}
>+    import org.apache.flex.utils.StringUtil;
> 	
> 	/**
> 	 *  Set a different class for click events so that
>@@ -950,7 +951,7 @@ package org.apache.flex.core
> 			{
>                 COMPILE::JS
>                 {
>-                    setClassName(typeNames ? value + ' ' + typeNames :
>value);           
>+                    setClassName(typeNames ? StringUtil.trim(value + ' '
>+ typeNames) : value);
>                 }
> 				_className = value;
> 				dispatchEvent(new Event("classNameChanged"));
>


Re: [1/2] git commit: [flex-asjs] [refs/heads/develop] - Remove css prefixing whitespaces in UIBase when value is empty

Posted by Carlos Rovira <ca...@apache.org>.
Hi Alex,

the problem is that many times we end modifying className we end with empty
spacing prepending the className (for example: class=" some class other",
so if you want to make some check to avoid to trim always is ok for me.

The effects of this could be checked quickly in MDLExample html output. If
you see all class selectors are starting with white spaces, something would
be wrong

Thanks!



2017-02-06 18:36 GMT+01:00 Alex Harui <ah...@adobe.com>:

> I just noticed this.  What does it mean "value is empty"?  Trim() can be
> really expensive, so should this code just test for value is empty and do
> something else?
>
> Thanks,
> -Alex
>
> On 1/3/17, 10:39 AM, "carlosrovira@apache.org" <ca...@apache.org>
> wrote:
>
> >Repository: flex-asjs
> >Updated Branches:
> >  refs/heads/develop 354c8dc08 -> b1f2493e3
> >
> >
> >Remove css prefixing whitespaces in UIBase when value is empty
> >
> >
> >Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> >Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/632b4937
> >Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/632b4937
> >Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/632b4937
> >
> >Branch: refs/heads/develop
> >Commit: 632b4937da0b8253dc32706eb862a426ad7babd9
> >Parents: ffd738d
> >Author: Carlos Rovira <ca...@apache.org>
> >Authored: Tue Jan 3 19:38:48 2017 +0100
> >Committer: Carlos Rovira <ca...@apache.org>
> >Committed: Tue Jan 3 19:38:48 2017 +0100
> >
> >----------------------------------------------------------------------
> > .../projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as    | 3
> ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >----------------------------------------------------------------------
> >
> >
> >http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
> 632b4937/frameworks/
> >projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as
> >----------------------------------------------------------------------
> >diff --git
> >a/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as
> >b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as
> >index 1c825d6..b075e72 100644
> >---
> >a/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as
> >+++
> >b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as
> >@@ -33,6 +33,7 @@ package org.apache.flex.core
> >           import flash.display.InteractiveObject;
> >           import org.apache.flex.events.utils.MouseEventConverter;
> >       }
> >+    import org.apache.flex.utils.StringUtil;
> >
> >       /**
> >        *  Set a different class for click events so that
> >@@ -950,7 +951,7 @@ package org.apache.flex.core
> >                       {
> >                 COMPILE::JS
> >                 {
> >-                    setClassName(typeNames ? value + ' ' + typeNames :
> >value);
> >+                    setClassName(typeNames ? StringUtil.trim(value + ' '
> >+ typeNames) : value);
> >                 }
> >                               _className = value;
> >                               dispatchEvent(new
> Event("classNameChanged"));
> >
>
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [1/2] git commit: [flex-asjs] [refs/heads/develop] - Remove css prefixing whitespaces in UIBase when value is empty

Posted by Carlos Rovira <ca...@apache.org>.
Hi Alex,

the problem is that many times we end modifying className we end with empty
spacing prepending the className (for example: class=" some class other",
so if you want to make some check to avoid to trim always is ok for me.

The effects of this could be checked quickly in MDLExample html output. If
you see all class selectors are starting with white spaces, something would
be wrong

Thanks!



2017-02-06 18:36 GMT+01:00 Alex Harui <ah...@adobe.com>:

> I just noticed this.  What does it mean "value is empty"?  Trim() can be
> really expensive, so should this code just test for value is empty and do
> something else?
>
> Thanks,
> -Alex
>
> On 1/3/17, 10:39 AM, "carlosrovira@apache.org" <ca...@apache.org>
> wrote:
>
> >Repository: flex-asjs
> >Updated Branches:
> >  refs/heads/develop 354c8dc08 -> b1f2493e3
> >
> >
> >Remove css prefixing whitespaces in UIBase when value is empty
> >
> >
> >Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
> >Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/632b4937
> >Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/632b4937
> >Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/632b4937
> >
> >Branch: refs/heads/develop
> >Commit: 632b4937da0b8253dc32706eb862a426ad7babd9
> >Parents: ffd738d
> >Author: Carlos Rovira <ca...@apache.org>
> >Authored: Tue Jan 3 19:38:48 2017 +0100
> >Committer: Carlos Rovira <ca...@apache.org>
> >Committed: Tue Jan 3 19:38:48 2017 +0100
> >
> >----------------------------------------------------------------------
> > .../projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as    | 3
> ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >----------------------------------------------------------------------
> >
> >
> >http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/
> 632b4937/frameworks/
> >projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as
> >----------------------------------------------------------------------
> >diff --git
> >a/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as
> >b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as
> >index 1c825d6..b075e72 100644
> >---
> >a/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as
> >+++
> >b/frameworks/projects/HTML/src/main/flex/org/apache/flex/core/UIBase.as
> >@@ -33,6 +33,7 @@ package org.apache.flex.core
> >           import flash.display.InteractiveObject;
> >           import org.apache.flex.events.utils.MouseEventConverter;
> >       }
> >+    import org.apache.flex.utils.StringUtil;
> >
> >       /**
> >        *  Set a different class for click events so that
> >@@ -950,7 +951,7 @@ package org.apache.flex.core
> >                       {
> >                 COMPILE::JS
> >                 {
> >-                    setClassName(typeNames ? value + ' ' + typeNames :
> >value);
> >+                    setClassName(typeNames ? StringUtil.trim(value + ' '
> >+ typeNames) : value);
> >                 }
> >                               _className = value;
> >                               dispatchEvent(new
> Event("classNameChanged"));
> >
>
>


-- 
Carlos Rovira
http://about.me/carlosrovira