You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Carlos Rovira <ca...@apache.org> on 2018/09/28 08:16:42 UTC

Re: [royale-asjs] 21/21: refactor popuphost to have a reference from the effective parent back to the popuphost. this is better than walking the parent chain because in JS we are going to host the popups off the system manager so there is no parent chain to walk. Using systemmanager moves the popups out of the childlist in the application where the layouts try to run on the popup, which may not be a UIComponent (if it is a re-used UIBase from Basic).

Hi Alex,

this change breaks build in different points. I still didn't look at what
the change implies, and sure that is good, but I think this kind of changes
that breaks code in other libs should be do with the fix for that libs in
the same commit or in the next one. If not possible, at least and email
explaining in few lines the change and posting how to fix the code would be
great, so I can fix for example in Jewel where compilation is failing in
various classes.

thanks






El vie., 28 sept. 2018 a las 5:42, <ah...@apache.org> escribió:

> This is an automated email from the ASF dual-hosted git repository.
>
> aharui pushed a commit to branch develop
> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
>
> commit 642e35c553023301c01e2ff63d01780a6702a708
> Author: Alex Harui <ah...@apache.org>
> AuthorDate: Thu Sep 27 20:40:39 2018 -0700
>
>     refactor popuphost to have a reference from the effective parent back
> to the popuphost.  this is better than walking the parent chain because in
> JS we are going to host the popups off the system manager so there is no
> parent chain to walk.  Using systemmanager moves the popups out of the
> childlist in the application where the layouts try to run on the popup,
> which may not be a UIComponent (if it is a re-used UIBase from Basic).
> ---
>  .../royale/org/apache/royale/core/Application.as   | 10 +++-
>  .../main/royale/org/apache/royale/core/ViewBase.as | 11 ++++-
>  .../royale/core/ContainerBaseStrandChildren.as     | 10 +++-
>  .../royale/org/apache/royale/core/IPopUpHost.as    |  2 +-
>  .../core/{IPopUpHost.as => IPopUpHostParent.as}    | 10 ++--
>  .../main/royale/org/apache/royale/utils/UIUtils.as | 13 +++---
>  .../src/main/royale/mx/core/Application.as         | 29 ++++++++++--
>  .../src/main/royale/mx/managers/SystemManager.as   | 53
> ++++++++++++++++++++--
>  8 files changed, 113 insertions(+), 25 deletions(-)
>
> diff --git
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
> index 6304126..efa7459 100644
> ---
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
> +++
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
> @@ -105,7 +105,7 @@ package org.apache.royale.core
>       *  @playerversion AIR 2.6
>       *  @productversion Royale 0.0
>       */
> -    public class Application extends ApplicationBase implements IStrand,
> IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost,
> IRenderedObject
> +    public class Application extends ApplicationBase implements IStrand,
> IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost,
> IPopUpHostParent, IRenderedObject
>      {
>          /**
>           *  Constructor.
> @@ -329,7 +329,7 @@ package org.apache.royale.core
>           *  @playerversion AIR 2.6
>           *  @productversion Royale 0.0
>           */
> -        public function get popUpParent():IParent
> +        public function get popUpParent():IPopUpHostParent
>          {
>              return this;
>          }
> @@ -723,5 +723,11 @@ package org.apache.royale.core
>              // Setting this directly doesn't do anything
>          }
>
> +        /**
> +         */
> +        public function get popUpHost():IPopUpHost
> +        {
> +            return this;
> +        }
>      }
>  }
> diff --git
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
> index 33d9bcd..8bc8876 100644
> ---
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
> +++
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
> @@ -48,7 +48,7 @@ package org.apache.royale.core
>       *  @playerversion AIR 2.6
>       *  @productversion Royale 0.0
>       */
> -       public class ViewBase extends GroupBase implements IPopUpHost,
> IApplicationView
> +       public class ViewBase extends GroupBase implements IPopUpHost,
> IPopUpHostParent, IApplicationView
>         {
>          /**
>           *  Constructor.
> @@ -101,10 +101,17 @@ package org.apache.royale.core
>           *  @playerversion AIR 2.6
>           *  @productversion Royale 0.0
>           */
> -        public function get popUpParent():IParent
> +        public function get popUpParent():IPopUpHostParent
>          {
>              return this;
>          }
>
> +        /**
> +         */
> +        public function get popUpHost():IPopUpHost
> +        {
> +            return this;
> +        }
> +
>      }
>  }
> diff --git
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
> index a3b4601..6689b1e 100644
> ---
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
> +++
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
> @@ -30,7 +30,7 @@ package org.apache.royale.core
>       *
>       *  @royalesuppresspublicvarwarning
>       */
> -       public class ContainerBaseStrandChildren implements IParent
> +       public class ContainerBaseStrandChildren implements
> IPopUpHostParent
>         {
>          /**
>           *  Constructor.
> @@ -98,5 +98,13 @@ package org.apache.royale.core
>                 {
>                         return owner.$getElementAt(index);
>                 }
> +
> +        /**
> +         */
> +        public function get popUpHost():IPopUpHost
> +        {
> +            return owner as IPopUpHost;
> +        }
> +
>      }
>  }
> diff --git
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
> index 6b62b10..b08ef88 100755
> ---
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
> +++
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
> @@ -29,6 +29,6 @@ package org.apache.royale.core
>       */
>      public interface IPopUpHost
>         {
> -        function get popUpParent():IParent;
> +        function get popUpParent():IPopUpHostParent;
>         }
>  }
> diff --git
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
> similarity index 77%
> copy from
> frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
> copy to
> frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
> index 6b62b10..cbec474 100755
> ---
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
> +++
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
> @@ -19,16 +19,18 @@
>  package org.apache.royale.core
>  {
>      /**
> -     *  The IPopUpHost interface is a "marker" interface for a component
> that
> -     *  parents components that implement IPopUp.
> +     *  The IPopUpHostParent is the effective parent of popups.
> +     *  The actual parent may not be the effective parent in some
> +     *  implementations, so the effective parent provides a reference
> +     *  back to the IPopUpHost for removing
>       *
>       *  @langversion 3.0
>       *  @playerversion Flash 10.2
>       *  @playerversion AIR 2.6
>       *  @productversion Royale 0.0
>       */
> -    public interface IPopUpHost
> +    public interface IPopUpHostParent extends IParent
>         {
> -        function get popUpParent():IParent;
> +        function get popUpHost():IPopUpHost;
>         }
>  }
> diff --git
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
> index c5ea044..de6d827 100644
> ---
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
> +++
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
> @@ -21,6 +21,7 @@ package org.apache.royale.utils
>         import org.apache.royale.core.IChild;
>         import org.apache.royale.core.IParent;
>         import org.apache.royale.core.IPopUpHost;
> +    import org.apache.royale.core.IPopUpHostParent;
>         import org.apache.royale.core.IUIBase;
>
>         /**
> @@ -81,6 +82,9 @@ package org.apache.royale.utils
>                  */
>                 public static function
> findPopUpHost(start:IUIBase):IPopUpHost
>                 {
> +            if (start.parent is IPopUpHostParent)
> +                return (start.parent as IPopUpHostParent).popUpHost;
> +
>                         while( start && !(start is IPopUpHost) ) {
>                                 // start.parent will be undefined in js if
> it's not an IChild and return null
>                                 COMPILE::SWF
> @@ -105,16 +109,11 @@ package org.apache.royale.utils
>                  *  @playerversion AIR 2.6
>                  *  @productversion Royale 0.9
>                  *  @royaleignorecoercion org.apache.royale.core.IChild
> -                *  @royaleignorecoercion org.apache.royale.core.IPopUpHost
> +                *  @royaleignorecoercion
> org.apache.royale.core.IPopUpHostParent
>                  */
>                 public static function removePopUp(popUp:IChild):void
>                 {
> -                       //TODO (harbs) The loop appears to not be needed.
> If removeElement is being called, it seems like the IPopUpHost would be the
> direct parent.
> -                       var start:IParent = popUp.parent;
> -                       while(!(start is IPopUpHost)) {
> -                               start = IChild(start).parent;
> -                       }
> -                       (start as
> IPopUpHost).popUpParent.removeElement(popUp);
> +                       (popUp.parent as
> IPopUpHostParent).popUpHost.popUpParent.removeElement(popUp);
>                 }
>         }
>  }
> diff --git
> a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
> b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
> index 59fe205..a1fae52 100644
> --- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
> +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
> @@ -39,7 +39,6 @@ import mx.effects.EffectManager;
>  import mx.events.FlexEvent;
>  import mx.managers.IActiveWindowManager;
>  import mx.managers.ILayoutManager;
> -import mx.managers.ISystemManager;
>  import mx.styles.CSSStyleDeclaration;
>  import mx.styles.IStyleClient;
>  import mx.utils.LoaderUtil;
> @@ -61,6 +60,7 @@ import
> org.apache.royale.events.utils.MouseEventConverter;
>  import mx.containers.beads.ApplicationLayout;
>  import mx.containers.beads.BoxLayout;
>  import mx.managers.FocusManager;
> +import mx.managers.ISystemManager;
>
>  import org.apache.royale.binding.ApplicationDataBinding;
>  import org.apache.royale.binding.ContainerDataBinding;
> @@ -72,6 +72,7 @@ import org.apache.royale.core.IInitialViewApplication;
>  import org.apache.royale.core.ILayoutChild;
>  import org.apache.royale.core.IParent;
>  import org.apache.royale.core.IPopUpHost;
> +import org.apache.royale.core.IPopUpHostParent;
>  import org.apache.royale.core.IRenderedObject;
>  import org.apache.royale.core.IStatesImpl;
>  import org.apache.royale.core.IStrand;
> @@ -231,7 +232,7 @@ import
> org.apache.royale.utils.loadBeadFromValuesManager;
>   *  @playerversion AIR 1.1
>   *  @productversion Flex 3
>   */
> -public class Application extends Container implements IStrand, IParent,
> IEventDispatcher, IPopUpHost, IRenderedObject, IFlexInfo
> +public class Application extends Container implements IStrand, IParent,
> IEventDispatcher, IPopUpHost, IPopUpHostParent, IRenderedObject, IFlexInfo
>  {
>
>
>  //--------------------------------------------------------------------------
> @@ -642,10 +643,30 @@ public class Application extends Container
> implements IStrand, IParent, IEventDi
>       *  @playerversion AIR 2.6
>       *  @productversion Royale 0.0
>       */
> -    public function get popUpParent():IParent
> +    public function get popUpParent():IPopUpHostParent
>      {
> -        return strandChildren;
> +        COMPILE::JS
> +        {
> +            return systemManager as IPopUpHostParent;
> +        }
> +        COMPILE::SWF
> +        {
> +            return strandChildren as IPopUpHostParent;
> +        }
>      }
> +
> +    override public function get systemManager():ISystemManager
> +    {
> +        return parent as ISystemManager;
> +    }
> +
> +    /**
> +     */
> +    public function get popUpHost():IPopUpHost
> +    {
> +        return this;
> +    }
> +
>  }
>
>  }
> diff --git
> a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
> b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
> index c341008..7542e15 100644
> ---
> a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
> +++
> b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
> @@ -87,14 +87,16 @@ import mx.utils.LoaderUtil;
>  use namespace mx_internal;
>  */
>
> -import org.apache.royale.geom.Rectangle;
> -
>  import mx.core.IChildList;
>  import mx.core.IFlexDisplayObject;
>  import mx.core.IUIComponent;
>
> +import org.apache.royale.core.IChild;
> +import org.apache.royale.core.IPopUpHost;
> +import org.apache.royale.core.IPopUpHostParent;
>  import org.apache.royale.core.IUIBase;
>  import org.apache.royale.events.IEventDispatcher;
> +import org.apache.royale.geom.Rectangle;
>
>  //--------------------------------------
>  //  Events
> @@ -189,7 +191,7 @@ import org.apache.royale.events.IEventDispatcher;
>   *  @playerversion AIR 1.1
>   *  @productversion Royale 0.9.4
>   */
> -public class SystemManager extends SystemManagerBase implements
> ISystemManager, IEventDispatcher, IChildList
> +public class SystemManager extends SystemManagerBase implements
> ISystemManager, IEventDispatcher, IPopUpHostParent, IChildList
>  { //extends MovieClip implements IFlexDisplayObject,IFlexModuleFactory,
> ISystemManager
>     // include "../core/Version.as";
>
> @@ -1821,7 +1823,43 @@ public class SystemManager extends
> SystemManagerBase implements ISystemManager,
>              return ret as IUIComponent;
>          }
>      }
> -
> +
> +    COMPILE::SWF
> +    public function addElement(c:IChild, dispatchEvent:Boolean =
> true):void
> +    {
> +        trace("SystemManager:addElement should not be called");
> +    }
> +    COMPILE::SWF
> +    public function addElementAt(c:IChild, index:int,
> dispatchEvent:Boolean = true):void
> +    {
> +        trace("SystemManager:addElementAt should not be called");
> +
> +    }
> +    COMPILE::SWF
> +    public function removeElement(c:IChild, dispatchEvent:Boolean =
> true):void
> +    {
> +        trace("SystemManager:removeElement should not be called");
> +
> +    }
> +    COMPILE::SWF
> +    public function getElementIndex(c:IChild):int
> +    {
> +        trace("SystemManager:getElementIndex should not be called");
> +        return 0;
> +    }
> +    COMPILE::SWF
> +    public function get numElements():int
> +    {
> +        trace("SystemManager:numElements should not be called");
> +        return 0;
> +    }
> +    COMPILE::SWF
> +    public function getElementAt(index:int):IChild
> +    {
> +        trace("SystemManager:getElementAt should not be called");
> +        return null;
> +    }
> +
>
>  //--------------------------------------------------------------------------
>      //
>      //  Methods: IFlexModuleFactory
> @@ -3667,6 +3705,13 @@ public class SystemManager extends
> SystemManagerBase implements ISystemManager,
>          return true;
>      }
>
> +    /**
> +     * @royaleignorecoercion org.apache.royale.core.IPopUpHost;
> +     */
> +    public function get popUpHost():IPopUpHost
> +    {
> +        return component as IPopUpHost;
> +    }
>
>  }
>
>
>

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

Re: [royale-asjs] 21/21: refactor popuphost to have a reference from the effective parent back to the popuphost. this is better than walking the parent chain because in JS we are going to host the popups off the system manager so there is no parent cha...

Posted by Carlos Rovira <ca...@apache.org>.
Yes, Alex, don't worry, is just that I'd like in the future have that kind
of email description so we can figure easily a change, or maybe we can run
into some time needed to fix things and maybe we could not have that at
that time. I fixed things and test that was ok :)

Thanks

El vie., 28 sept. 2018 a las 17:32, Alex Harui (<ah...@adobe.com.invalid>)
escribió:

> Hi Carlos,
>
> Sorry, I thought I'd run the full build before checking in, but I guess I
> didn't.  Looks like you figured out the required changes.
>
> Thanks,
> -Alex
>
> On 9/28/18, 1:17 AM, "Carlos Rovira" <ca...@apache.org> wrote:
>
>     Hi Alex,
>
>     this change breaks build in different points. I still didn't look at
> what
>     the change implies, and sure that is good, but I think this kind of
> changes
>     that breaks code in other libs should be do with the fix for that libs
> in
>     the same commit or in the next one. If not possible, at least and email
>     explaining in few lines the change and posting how to fix the code
> would be
>     great, so I can fix for example in Jewel where compilation is failing
> in
>     various classes.
>
>     thanks
>
>
>
>
>
>
>     El vie., 28 sept. 2018 a las 5:42, <ah...@apache.org> escribió:
>
>     > This is an automated email from the ASF dual-hosted git repository.
>     >
>     > aharui pushed a commit to branch develop
>     > in repository
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C2ab6f17b33f4437d017f08d6251ac54a%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636737194235332646&amp;sdata=lSjVFtsakM9VGgH8vBaqb7GWquxgl%2BV5D4StogmAdMs%3D&amp;reserved=0
>     >
>     > commit 642e35c553023301c01e2ff63d01780a6702a708
>     > Author: Alex Harui <ah...@apache.org>
>     > AuthorDate: Thu Sep 27 20:40:39 2018 -0700
>     >
>     >     refactor popuphost to have a reference from the effective parent
> back
>     > to the popuphost.  this is better than walking the parent chain
> because in
>     > JS we are going to host the popups off the system manager so there
> is no
>     > parent chain to walk.  Using systemmanager moves the popups out of
> the
>     > childlist in the application where the layouts try to run on the
> popup,
>     > which may not be a UIComponent (if it is a re-used UIBase from
> Basic).
>     > ---
>     >  .../royale/org/apache/royale/core/Application.as   | 10 +++-
>     >  .../main/royale/org/apache/royale/core/ViewBase.as | 11 ++++-
>     >  .../royale/core/ContainerBaseStrandChildren.as     | 10 +++-
>     >  .../royale/org/apache/royale/core/IPopUpHost.as    |  2 +-
>     >  .../core/{IPopUpHost.as => IPopUpHostParent.as}    | 10 ++--
>     >  .../main/royale/org/apache/royale/utils/UIUtils.as | 13 +++---
>     >  .../src/main/royale/mx/core/Application.as         | 29 ++++++++++--
>     >  .../src/main/royale/mx/managers/SystemManager.as   | 53
>     > ++++++++++++++++++++--
>     >  8 files changed, 113 insertions(+), 25 deletions(-)
>     >
>     > diff --git
>     >
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
>     >
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
>     > index 6304126..efa7459 100644
>     > ---
>     >
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
>     > +++
>     >
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
>     > @@ -105,7 +105,7 @@ package org.apache.royale.core
>     >       *  @playerversion AIR 2.6
>     >       *  @productversion Royale 0.0
>     >       */
>     > -    public class Application extends ApplicationBase implements
> IStrand,
>     > IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost,
>     > IRenderedObject
>     > +    public class Application extends ApplicationBase implements
> IStrand,
>     > IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost,
>     > IPopUpHostParent, IRenderedObject
>     >      {
>     >          /**
>     >           *  Constructor.
>     > @@ -329,7 +329,7 @@ package org.apache.royale.core
>     >           *  @playerversion AIR 2.6
>     >           *  @productversion Royale 0.0
>     >           */
>     > -        public function get popUpParent():IParent
>     > +        public function get popUpParent():IPopUpHostParent
>     >          {
>     >              return this;
>     >          }
>     > @@ -723,5 +723,11 @@ package org.apache.royale.core
>     >              // Setting this directly doesn't do anything
>     >          }
>     >
>     > +        /**
>     > +         */
>     > +        public function get popUpHost():IPopUpHost
>     > +        {
>     > +            return this;
>     > +        }
>     >      }
>     >  }
>     > diff --git
>     >
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
>     >
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
>     > index 33d9bcd..8bc8876 100644
>     > ---
>     >
> a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
>     > +++
>     >
> b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
>     > @@ -48,7 +48,7 @@ package org.apache.royale.core
>     >       *  @playerversion AIR 2.6
>     >       *  @productversion Royale 0.0
>     >       */
>     > -       public class ViewBase extends GroupBase implements
> IPopUpHost,
>     > IApplicationView
>     > +       public class ViewBase extends GroupBase implements
> IPopUpHost,
>     > IPopUpHostParent, IApplicationView
>     >         {
>     >          /**
>     >           *  Constructor.
>     > @@ -101,10 +101,17 @@ package org.apache.royale.core
>     >           *  @playerversion AIR 2.6
>     >           *  @productversion Royale 0.0
>     >           */
>     > -        public function get popUpParent():IParent
>     > +        public function get popUpParent():IPopUpHostParent
>     >          {
>     >              return this;
>     >          }
>     >
>     > +        /**
>     > +         */
>     > +        public function get popUpHost():IPopUpHost
>     > +        {
>     > +            return this;
>     > +        }
>     > +
>     >      }
>     >  }
>     > diff --git
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
>     > index a3b4601..6689b1e 100644
>     > ---
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
>     > +++
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
>     > @@ -30,7 +30,7 @@ package org.apache.royale.core
>     >       *
>     >       *  @royalesuppresspublicvarwarning
>     >       */
>     > -       public class ContainerBaseStrandChildren implements IParent
>     > +       public class ContainerBaseStrandChildren implements
>     > IPopUpHostParent
>     >         {
>     >          /**
>     >           *  Constructor.
>     > @@ -98,5 +98,13 @@ package org.apache.royale.core
>     >                 {
>     >                         return owner.$getElementAt(index);
>     >                 }
>     > +
>     > +        /**
>     > +         */
>     > +        public function get popUpHost():IPopUpHost
>     > +        {
>     > +            return owner as IPopUpHost;
>     > +        }
>     > +
>     >      }
>     >  }
>     > diff --git
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
>     > index 6b62b10..b08ef88 100755
>     > ---
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
>     > +++
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
>     > @@ -29,6 +29,6 @@ package org.apache.royale.core
>     >       */
>     >      public interface IPopUpHost
>     >         {
>     > -        function get popUpParent():IParent;
>     > +        function get popUpParent():IPopUpHostParent;
>     >         }
>     >  }
>     > diff --git
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
>     > similarity index 77%
>     > copy from
>     >
> frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
>     > copy to
>     >
> frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
>     > index 6b62b10..cbec474 100755
>     > ---
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
>     > +++
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
>     > @@ -19,16 +19,18 @@
>     >  package org.apache.royale.core
>     >  {
>     >      /**
>     > -     *  The IPopUpHost interface is a "marker" interface for a
> component
>     > that
>     > -     *  parents components that implement IPopUp.
>     > +     *  The IPopUpHostParent is the effective parent of popups.
>     > +     *  The actual parent may not be the effective parent in some
>     > +     *  implementations, so the effective parent provides a
> reference
>     > +     *  back to the IPopUpHost for removing
>     >       *
>     >       *  @langversion 3.0
>     >       *  @playerversion Flash 10.2
>     >       *  @playerversion AIR 2.6
>     >       *  @productversion Royale 0.0
>     >       */
>     > -    public interface IPopUpHost
>     > +    public interface IPopUpHostParent extends IParent
>     >         {
>     > -        function get popUpParent():IParent;
>     > +        function get popUpHost():IPopUpHost;
>     >         }
>     >  }
>     > diff --git
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
>     > index c5ea044..de6d827 100644
>     > ---
>     >
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
>     > +++
>     >
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
>     > @@ -21,6 +21,7 @@ package org.apache.royale.utils
>     >         import org.apache.royale.core.IChild;
>     >         import org.apache.royale.core.IParent;
>     >         import org.apache.royale.core.IPopUpHost;
>     > +    import org.apache.royale.core.IPopUpHostParent;
>     >         import org.apache.royale.core.IUIBase;
>     >
>     >         /**
>     > @@ -81,6 +82,9 @@ package org.apache.royale.utils
>     >                  */
>     >                 public static function
>     > findPopUpHost(start:IUIBase):IPopUpHost
>     >                 {
>     > +            if (start.parent is IPopUpHostParent)
>     > +                return (start.parent as IPopUpHostParent).popUpHost;
>     > +
>     >                         while( start && !(start is IPopUpHost) ) {
>     >                                 // start.parent will be undefined in
> js if
>     > it's not an IChild and return null
>     >                                 COMPILE::SWF
>     > @@ -105,16 +109,11 @@ package org.apache.royale.utils
>     >                  *  @playerversion AIR 2.6
>     >                  *  @productversion Royale 0.9
>     >                  *  @royaleignorecoercion
> org.apache.royale.core.IChild
>     > -                *  @royaleignorecoercion
> org.apache.royale.core.IPopUpHost
>     > +                *  @royaleignorecoercion
>     > org.apache.royale.core.IPopUpHostParent
>     >                  */
>     >                 public static function removePopUp(popUp:IChild):void
>     >                 {
>     > -                       //TODO (harbs) The loop appears to not be
> needed.
>     > If removeElement is being called, it seems like the IPopUpHost would
> be the
>     > direct parent.
>     > -                       var start:IParent = popUp.parent;
>     > -                       while(!(start is IPopUpHost)) {
>     > -                               start = IChild(start).parent;
>     > -                       }
>     > -                       (start as
>     > IPopUpHost).popUpParent.removeElement(popUp);
>     > +                       (popUp.parent as
>     > IPopUpHostParent).popUpHost.popUpParent.removeElement(popUp);
>     >                 }
>     >         }
>     >  }
>     > diff --git
>     > a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
>     > b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
>     > index 59fe205..a1fae52 100644
>     > ---
> a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
>     > +++
> b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
>     > @@ -39,7 +39,6 @@ import mx.effects.EffectManager;
>     >  import mx.events.FlexEvent;
>     >  import mx.managers.IActiveWindowManager;
>     >  import mx.managers.ILayoutManager;
>     > -import mx.managers.ISystemManager;
>     >  import mx.styles.CSSStyleDeclaration;
>     >  import mx.styles.IStyleClient;
>     >  import mx.utils.LoaderUtil;
>     > @@ -61,6 +60,7 @@ import
>     > org.apache.royale.events.utils.MouseEventConverter;
>     >  import mx.containers.beads.ApplicationLayout;
>     >  import mx.containers.beads.BoxLayout;
>     >  import mx.managers.FocusManager;
>     > +import mx.managers.ISystemManager;
>     >
>     >  import org.apache.royale.binding.ApplicationDataBinding;
>     >  import org.apache.royale.binding.ContainerDataBinding;
>     > @@ -72,6 +72,7 @@ import
> org.apache.royale.core.IInitialViewApplication;
>     >  import org.apache.royale.core.ILayoutChild;
>     >  import org.apache.royale.core.IParent;
>     >  import org.apache.royale.core.IPopUpHost;
>     > +import org.apache.royale.core.IPopUpHostParent;
>     >  import org.apache.royale.core.IRenderedObject;
>     >  import org.apache.royale.core.IStatesImpl;
>     >  import org.apache.royale.core.IStrand;
>     > @@ -231,7 +232,7 @@ import
>     > org.apache.royale.utils.loadBeadFromValuesManager;
>     >   *  @playerversion AIR 1.1
>     >   *  @productversion Flex 3
>     >   */
>     > -public class Application extends Container implements IStrand,
> IParent,
>     > IEventDispatcher, IPopUpHost, IRenderedObject, IFlexInfo
>     > +public class Application extends Container implements IStrand,
> IParent,
>     > IEventDispatcher, IPopUpHost, IPopUpHostParent, IRenderedObject,
> IFlexInfo
>     >  {
>     >
>     >
>     >
> //--------------------------------------------------------------------------
>     > @@ -642,10 +643,30 @@ public class Application extends Container
>     > implements IStrand, IParent, IEventDi
>     >       *  @playerversion AIR 2.6
>     >       *  @productversion Royale 0.0
>     >       */
>     > -    public function get popUpParent():IParent
>     > +    public function get popUpParent():IPopUpHostParent
>     >      {
>     > -        return strandChildren;
>     > +        COMPILE::JS
>     > +        {
>     > +            return systemManager as IPopUpHostParent;
>     > +        }
>     > +        COMPILE::SWF
>     > +        {
>     > +            return strandChildren as IPopUpHostParent;
>     > +        }
>     >      }
>     > +
>     > +    override public function get systemManager():ISystemManager
>     > +    {
>     > +        return parent as ISystemManager;
>     > +    }
>     > +
>     > +    /**
>     > +     */
>     > +    public function get popUpHost():IPopUpHost
>     > +    {
>     > +        return this;
>     > +    }
>     > +
>     >  }
>     >
>     >  }
>     > diff --git
>     >
> a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
>     >
> b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
>     > index c341008..7542e15 100644
>     > ---
>     >
> a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
>     > +++
>     >
> b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
>     > @@ -87,14 +87,16 @@ import mx.utils.LoaderUtil;
>     >  use namespace mx_internal;
>     >  */
>     >
>     > -import org.apache.royale.geom.Rectangle;
>     > -
>     >  import mx.core.IChildList;
>     >  import mx.core.IFlexDisplayObject;
>     >  import mx.core.IUIComponent;
>     >
>     > +import org.apache.royale.core.IChild;
>     > +import org.apache.royale.core.IPopUpHost;
>     > +import org.apache.royale.core.IPopUpHostParent;
>     >  import org.apache.royale.core.IUIBase;
>     >  import org.apache.royale.events.IEventDispatcher;
>     > +import org.apache.royale.geom.Rectangle;
>     >
>     >  //--------------------------------------
>     >  //  Events
>     > @@ -189,7 +191,7 @@ import org.apache.royale.events.IEventDispatcher;
>     >   *  @playerversion AIR 1.1
>     >   *  @productversion Royale 0.9.4
>     >   */
>     > -public class SystemManager extends SystemManagerBase implements
>     > ISystemManager, IEventDispatcher, IChildList
>     > +public class SystemManager extends SystemManagerBase implements
>     > ISystemManager, IEventDispatcher, IPopUpHostParent, IChildList
>     >  { //extends MovieClip implements
> IFlexDisplayObject,IFlexModuleFactory,
>     > ISystemManager
>     >     // include "../core/Version.as";
>     >
>     > @@ -1821,7 +1823,43 @@ public class SystemManager extends
>     > SystemManagerBase implements ISystemManager,
>     >              return ret as IUIComponent;
>     >          }
>     >      }
>     > -
>     > +
>     > +    COMPILE::SWF
>     > +    public function addElement(c:IChild, dispatchEvent:Boolean =
>     > true):void
>     > +    {
>     > +        trace("SystemManager:addElement should not be called");
>     > +    }
>     > +    COMPILE::SWF
>     > +    public function addElementAt(c:IChild, index:int,
>     > dispatchEvent:Boolean = true):void
>     > +    {
>     > +        trace("SystemManager:addElementAt should not be called");
>     > +
>     > +    }
>     > +    COMPILE::SWF
>     > +    public function removeElement(c:IChild, dispatchEvent:Boolean =
>     > true):void
>     > +    {
>     > +        trace("SystemManager:removeElement should not be called");
>     > +
>     > +    }
>     > +    COMPILE::SWF
>     > +    public function getElementIndex(c:IChild):int
>     > +    {
>     > +        trace("SystemManager:getElementIndex should not be called");
>     > +        return 0;
>     > +    }
>     > +    COMPILE::SWF
>     > +    public function get numElements():int
>     > +    {
>     > +        trace("SystemManager:numElements should not be called");
>     > +        return 0;
>     > +    }
>     > +    COMPILE::SWF
>     > +    public function getElementAt(index:int):IChild
>     > +    {
>     > +        trace("SystemManager:getElementAt should not be called");
>     > +        return null;
>     > +    }
>     > +
>     >
>     >
> //--------------------------------------------------------------------------
>     >      //
>     >      //  Methods: IFlexModuleFactory
>     > @@ -3667,6 +3705,13 @@ public class SystemManager extends
>     > SystemManagerBase implements ISystemManager,
>     >          return true;
>     >      }
>     >
>     > +    /**
>     > +     * @royaleignorecoercion org.apache.royale.core.IPopUpHost;
>     > +     */
>     > +    public function get popUpHost():IPopUpHost
>     > +    {
>     > +        return component as IPopUpHost;
>     > +    }
>     >
>     >  }
>     >
>     >
>     >
>
>     --
>     Carlos Rovira
>
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C2ab6f17b33f4437d017f08d6251ac54a%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636737194235332646&amp;sdata=JUvqd6YKFW3MJC%2BuBOxTJm%2FK2qi2h62QiHLzhXhLO5Q%3D&amp;reserved=0
>
>
>

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

Re: [royale-asjs] 21/21: refactor popuphost to have a reference from the effective parent back to the popuphost. this is better than walking the parent chain because in JS we are going to host the popups off the system manager so there is no parent cha...

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Hi Carlos,

Sorry, I thought I'd run the full build before checking in, but I guess I didn't.  Looks like you figured out the required changes.

Thanks,
-Alex

On 9/28/18, 1:17 AM, "Carlos Rovira" <ca...@apache.org> wrote:

    Hi Alex,
    
    this change breaks build in different points. I still didn't look at what
    the change implies, and sure that is good, but I think this kind of changes
    that breaks code in other libs should be do with the fix for that libs in
    the same commit or in the next one. If not possible, at least and email
    explaining in few lines the change and posting how to fix the code would be
    great, so I can fix for example in Jewel where compilation is failing in
    various classes.
    
    thanks
    
    
    
    
    
    
    El vie., 28 sept. 2018 a las 5:42, <ah...@apache.org> escribió:
    
    > This is an automated email from the ASF dual-hosted git repository.
    >
    > aharui pushed a commit to branch develop
    > in repository https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&amp;data=02%7C01%7Caharui%40adobe.com%7C2ab6f17b33f4437d017f08d6251ac54a%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636737194235332646&amp;sdata=lSjVFtsakM9VGgH8vBaqb7GWquxgl%2BV5D4StogmAdMs%3D&amp;reserved=0
    >
    > commit 642e35c553023301c01e2ff63d01780a6702a708
    > Author: Alex Harui <ah...@apache.org>
    > AuthorDate: Thu Sep 27 20:40:39 2018 -0700
    >
    >     refactor popuphost to have a reference from the effective parent back
    > to the popuphost.  this is better than walking the parent chain because in
    > JS we are going to host the popups off the system manager so there is no
    > parent chain to walk.  Using systemmanager moves the popups out of the
    > childlist in the application where the layouts try to run on the popup,
    > which may not be a UIComponent (if it is a re-used UIBase from Basic).
    > ---
    >  .../royale/org/apache/royale/core/Application.as   | 10 +++-
    >  .../main/royale/org/apache/royale/core/ViewBase.as | 11 ++++-
    >  .../royale/core/ContainerBaseStrandChildren.as     | 10 +++-
    >  .../royale/org/apache/royale/core/IPopUpHost.as    |  2 +-
    >  .../core/{IPopUpHost.as => IPopUpHostParent.as}    | 10 ++--
    >  .../main/royale/org/apache/royale/utils/UIUtils.as | 13 +++---
    >  .../src/main/royale/mx/core/Application.as         | 29 ++++++++++--
    >  .../src/main/royale/mx/managers/SystemManager.as   | 53
    > ++++++++++++++++++++--
    >  8 files changed, 113 insertions(+), 25 deletions(-)
    >
    > diff --git
    > a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
    > b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
    > index 6304126..efa7459 100644
    > ---
    > a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
    > +++
    > b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/Application.as
    > @@ -105,7 +105,7 @@ package org.apache.royale.core
    >       *  @playerversion AIR 2.6
    >       *  @productversion Royale 0.0
    >       */
    > -    public class Application extends ApplicationBase implements IStrand,
    > IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost,
    > IRenderedObject
    > +    public class Application extends ApplicationBase implements IStrand,
    > IParent, IEventDispatcher, IInitialViewApplication, IPopUpHost,
    > IPopUpHostParent, IRenderedObject
    >      {
    >          /**
    >           *  Constructor.
    > @@ -329,7 +329,7 @@ package org.apache.royale.core
    >           *  @playerversion AIR 2.6
    >           *  @productversion Royale 0.0
    >           */
    > -        public function get popUpParent():IParent
    > +        public function get popUpParent():IPopUpHostParent
    >          {
    >              return this;
    >          }
    > @@ -723,5 +723,11 @@ package org.apache.royale.core
    >              // Setting this directly doesn't do anything
    >          }
    >
    > +        /**
    > +         */
    > +        public function get popUpHost():IPopUpHost
    > +        {
    > +            return this;
    > +        }
    >      }
    >  }
    > diff --git
    > a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
    > b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
    > index 33d9bcd..8bc8876 100644
    > ---
    > a/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
    > +++
    > b/frameworks/projects/Basic/src/main/royale/org/apache/royale/core/ViewBase.as
    > @@ -48,7 +48,7 @@ package org.apache.royale.core
    >       *  @playerversion AIR 2.6
    >       *  @productversion Royale 0.0
    >       */
    > -       public class ViewBase extends GroupBase implements IPopUpHost,
    > IApplicationView
    > +       public class ViewBase extends GroupBase implements IPopUpHost,
    > IPopUpHostParent, IApplicationView
    >         {
    >          /**
    >           *  Constructor.
    > @@ -101,10 +101,17 @@ package org.apache.royale.core
    >           *  @playerversion AIR 2.6
    >           *  @productversion Royale 0.0
    >           */
    > -        public function get popUpParent():IParent
    > +        public function get popUpParent():IPopUpHostParent
    >          {
    >              return this;
    >          }
    >
    > +        /**
    > +         */
    > +        public function get popUpHost():IPopUpHost
    > +        {
    > +            return this;
    > +        }
    > +
    >      }
    >  }
    > diff --git
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
    > index a3b4601..6689b1e 100644
    > ---
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
    > +++
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ContainerBaseStrandChildren.as
    > @@ -30,7 +30,7 @@ package org.apache.royale.core
    >       *
    >       *  @royalesuppresspublicvarwarning
    >       */
    > -       public class ContainerBaseStrandChildren implements IParent
    > +       public class ContainerBaseStrandChildren implements
    > IPopUpHostParent
    >         {
    >          /**
    >           *  Constructor.
    > @@ -98,5 +98,13 @@ package org.apache.royale.core
    >                 {
    >                         return owner.$getElementAt(index);
    >                 }
    > +
    > +        /**
    > +         */
    > +        public function get popUpHost():IPopUpHost
    > +        {
    > +            return owner as IPopUpHost;
    > +        }
    > +
    >      }
    >  }
    > diff --git
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
    > index 6b62b10..b08ef88 100755
    > ---
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
    > +++
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
    > @@ -29,6 +29,6 @@ package org.apache.royale.core
    >       */
    >      public interface IPopUpHost
    >         {
    > -        function get popUpParent():IParent;
    > +        function get popUpParent():IPopUpHostParent;
    >         }
    >  }
    > diff --git
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
    > similarity index 77%
    > copy from
    > frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
    > copy to
    > frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
    > index 6b62b10..cbec474 100755
    > ---
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHost.as
    > +++
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/IPopUpHostParent.as
    > @@ -19,16 +19,18 @@
    >  package org.apache.royale.core
    >  {
    >      /**
    > -     *  The IPopUpHost interface is a "marker" interface for a component
    > that
    > -     *  parents components that implement IPopUp.
    > +     *  The IPopUpHostParent is the effective parent of popups.
    > +     *  The actual parent may not be the effective parent in some
    > +     *  implementations, so the effective parent provides a reference
    > +     *  back to the IPopUpHost for removing
    >       *
    >       *  @langversion 3.0
    >       *  @playerversion Flash 10.2
    >       *  @playerversion AIR 2.6
    >       *  @productversion Royale 0.0
    >       */
    > -    public interface IPopUpHost
    > +    public interface IPopUpHostParent extends IParent
    >         {
    > -        function get popUpParent():IParent;
    > +        function get popUpHost():IPopUpHost;
    >         }
    >  }
    > diff --git
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
    > index c5ea044..de6d827 100644
    > ---
    > a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
    > +++
    > b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/UIUtils.as
    > @@ -21,6 +21,7 @@ package org.apache.royale.utils
    >         import org.apache.royale.core.IChild;
    >         import org.apache.royale.core.IParent;
    >         import org.apache.royale.core.IPopUpHost;
    > +    import org.apache.royale.core.IPopUpHostParent;
    >         import org.apache.royale.core.IUIBase;
    >
    >         /**
    > @@ -81,6 +82,9 @@ package org.apache.royale.utils
    >                  */
    >                 public static function
    > findPopUpHost(start:IUIBase):IPopUpHost
    >                 {
    > +            if (start.parent is IPopUpHostParent)
    > +                return (start.parent as IPopUpHostParent).popUpHost;
    > +
    >                         while( start && !(start is IPopUpHost) ) {
    >                                 // start.parent will be undefined in js if
    > it's not an IChild and return null
    >                                 COMPILE::SWF
    > @@ -105,16 +109,11 @@ package org.apache.royale.utils
    >                  *  @playerversion AIR 2.6
    >                  *  @productversion Royale 0.9
    >                  *  @royaleignorecoercion org.apache.royale.core.IChild
    > -                *  @royaleignorecoercion org.apache.royale.core.IPopUpHost
    > +                *  @royaleignorecoercion
    > org.apache.royale.core.IPopUpHostParent
    >                  */
    >                 public static function removePopUp(popUp:IChild):void
    >                 {
    > -                       //TODO (harbs) The loop appears to not be needed.
    > If removeElement is being called, it seems like the IPopUpHost would be the
    > direct parent.
    > -                       var start:IParent = popUp.parent;
    > -                       while(!(start is IPopUpHost)) {
    > -                               start = IChild(start).parent;
    > -                       }
    > -                       (start as
    > IPopUpHost).popUpParent.removeElement(popUp);
    > +                       (popUp.parent as
    > IPopUpHostParent).popUpHost.popUpParent.removeElement(popUp);
    >                 }
    >         }
    >  }
    > diff --git
    > a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
    > b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
    > index 59fe205..a1fae52 100644
    > --- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
    > +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/Application.as
    > @@ -39,7 +39,6 @@ import mx.effects.EffectManager;
    >  import mx.events.FlexEvent;
    >  import mx.managers.IActiveWindowManager;
    >  import mx.managers.ILayoutManager;
    > -import mx.managers.ISystemManager;
    >  import mx.styles.CSSStyleDeclaration;
    >  import mx.styles.IStyleClient;
    >  import mx.utils.LoaderUtil;
    > @@ -61,6 +60,7 @@ import
    > org.apache.royale.events.utils.MouseEventConverter;
    >  import mx.containers.beads.ApplicationLayout;
    >  import mx.containers.beads.BoxLayout;
    >  import mx.managers.FocusManager;
    > +import mx.managers.ISystemManager;
    >
    >  import org.apache.royale.binding.ApplicationDataBinding;
    >  import org.apache.royale.binding.ContainerDataBinding;
    > @@ -72,6 +72,7 @@ import org.apache.royale.core.IInitialViewApplication;
    >  import org.apache.royale.core.ILayoutChild;
    >  import org.apache.royale.core.IParent;
    >  import org.apache.royale.core.IPopUpHost;
    > +import org.apache.royale.core.IPopUpHostParent;
    >  import org.apache.royale.core.IRenderedObject;
    >  import org.apache.royale.core.IStatesImpl;
    >  import org.apache.royale.core.IStrand;
    > @@ -231,7 +232,7 @@ import
    > org.apache.royale.utils.loadBeadFromValuesManager;
    >   *  @playerversion AIR 1.1
    >   *  @productversion Flex 3
    >   */
    > -public class Application extends Container implements IStrand, IParent,
    > IEventDispatcher, IPopUpHost, IRenderedObject, IFlexInfo
    > +public class Application extends Container implements IStrand, IParent,
    > IEventDispatcher, IPopUpHost, IPopUpHostParent, IRenderedObject, IFlexInfo
    >  {
    >
    >
    >  //--------------------------------------------------------------------------
    > @@ -642,10 +643,30 @@ public class Application extends Container
    > implements IStrand, IParent, IEventDi
    >       *  @playerversion AIR 2.6
    >       *  @productversion Royale 0.0
    >       */
    > -    public function get popUpParent():IParent
    > +    public function get popUpParent():IPopUpHostParent
    >      {
    > -        return strandChildren;
    > +        COMPILE::JS
    > +        {
    > +            return systemManager as IPopUpHostParent;
    > +        }
    > +        COMPILE::SWF
    > +        {
    > +            return strandChildren as IPopUpHostParent;
    > +        }
    >      }
    > +
    > +    override public function get systemManager():ISystemManager
    > +    {
    > +        return parent as ISystemManager;
    > +    }
    > +
    > +    /**
    > +     */
    > +    public function get popUpHost():IPopUpHost
    > +    {
    > +        return this;
    > +    }
    > +
    >  }
    >
    >  }
    > diff --git
    > a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
    > b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
    > index c341008..7542e15 100644
    > ---
    > a/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
    > +++
    > b/frameworks/projects/MXRoyale/src/main/royale/mx/managers/SystemManager.as
    > @@ -87,14 +87,16 @@ import mx.utils.LoaderUtil;
    >  use namespace mx_internal;
    >  */
    >
    > -import org.apache.royale.geom.Rectangle;
    > -
    >  import mx.core.IChildList;
    >  import mx.core.IFlexDisplayObject;
    >  import mx.core.IUIComponent;
    >
    > +import org.apache.royale.core.IChild;
    > +import org.apache.royale.core.IPopUpHost;
    > +import org.apache.royale.core.IPopUpHostParent;
    >  import org.apache.royale.core.IUIBase;
    >  import org.apache.royale.events.IEventDispatcher;
    > +import org.apache.royale.geom.Rectangle;
    >
    >  //--------------------------------------
    >  //  Events
    > @@ -189,7 +191,7 @@ import org.apache.royale.events.IEventDispatcher;
    >   *  @playerversion AIR 1.1
    >   *  @productversion Royale 0.9.4
    >   */
    > -public class SystemManager extends SystemManagerBase implements
    > ISystemManager, IEventDispatcher, IChildList
    > +public class SystemManager extends SystemManagerBase implements
    > ISystemManager, IEventDispatcher, IPopUpHostParent, IChildList
    >  { //extends MovieClip implements IFlexDisplayObject,IFlexModuleFactory,
    > ISystemManager
    >     // include "../core/Version.as";
    >
    > @@ -1821,7 +1823,43 @@ public class SystemManager extends
    > SystemManagerBase implements ISystemManager,
    >              return ret as IUIComponent;
    >          }
    >      }
    > -
    > +
    > +    COMPILE::SWF
    > +    public function addElement(c:IChild, dispatchEvent:Boolean =
    > true):void
    > +    {
    > +        trace("SystemManager:addElement should not be called");
    > +    }
    > +    COMPILE::SWF
    > +    public function addElementAt(c:IChild, index:int,
    > dispatchEvent:Boolean = true):void
    > +    {
    > +        trace("SystemManager:addElementAt should not be called");
    > +
    > +    }
    > +    COMPILE::SWF
    > +    public function removeElement(c:IChild, dispatchEvent:Boolean =
    > true):void
    > +    {
    > +        trace("SystemManager:removeElement should not be called");
    > +
    > +    }
    > +    COMPILE::SWF
    > +    public function getElementIndex(c:IChild):int
    > +    {
    > +        trace("SystemManager:getElementIndex should not be called");
    > +        return 0;
    > +    }
    > +    COMPILE::SWF
    > +    public function get numElements():int
    > +    {
    > +        trace("SystemManager:numElements should not be called");
    > +        return 0;
    > +    }
    > +    COMPILE::SWF
    > +    public function getElementAt(index:int):IChild
    > +    {
    > +        trace("SystemManager:getElementAt should not be called");
    > +        return null;
    > +    }
    > +
    >
    >  //--------------------------------------------------------------------------
    >      //
    >      //  Methods: IFlexModuleFactory
    > @@ -3667,6 +3705,13 @@ public class SystemManager extends
    > SystemManagerBase implements ISystemManager,
    >          return true;
    >      }
    >
    > +    /**
    > +     * @royaleignorecoercion org.apache.royale.core.IPopUpHost;
    > +     */
    > +    public function get popUpHost():IPopUpHost
    > +    {
    > +        return component as IPopUpHost;
    > +    }
    >
    >  }
    >
    >
    >
    
    -- 
    Carlos Rovira
    https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C2ab6f17b33f4437d017f08d6251ac54a%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636737194235332646&amp;sdata=JUvqd6YKFW3MJC%2BuBOxTJm%2FK2qi2h62QiHLzhXhLO5Q%3D&amp;reserved=0