You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ha...@apache.org on 2019/12/30 21:40:01 UTC

[royale-asjs] branch develop updated: Removed bubbling event from HTMLElementWrapper

This is an automated email from the ASF dual-hosted git repository.

harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new ddd5620  Removed bubbling event from HTMLElementWrapper
ddd5620 is described below

commit ddd562018fd2c6e3214490c72847ef0a9893ec78
Author: Harbs <ha...@in-tools.com>
AuthorDate: Mon Dec 30 23:39:48 2019 +0200

    Removed bubbling event from HTMLElementWrapper
---
 .../royale/org/apache/royale/core/HTMLElementWrapper.as  | 16 ----------------
 .../royale/org/apache/royale/crux/beads/JSStageEvents.as | 12 +++++++++++-
 2 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
index 1081848..4bcbe71 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/HTMLElementWrapper.as
@@ -207,21 +207,5 @@ package org.apache.royale.core
 			}
 	        super.addBead(bead);
 		}
-                                		
-        /**
-         * @royaleignorecoercion org.apache.royale.events.IEventDispatcher
-         */
-		public function dispatchBubblingEvent(source:Object, e:Object):Boolean
-		{
-			// build the ancestors tree without setting the actual parentEventTarget
-			var ancestorsTree:Array = [];
-			var t:IEventDispatcher = source["parent"] as IEventDispatcher;
-			while (t != null) {
-				ancestorsTree.push(t);
-				t = t["parent"] as IEventDispatcher;
-			}
-			
-			return goog.events.EventTarget.dispatchEventInternal_(source, e, ancestorsTree);
-		}
 	}
 }
diff --git a/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/beads/JSStageEvents.as b/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/beads/JSStageEvents.as
index 5418d86..dfbfd8a 100644
--- a/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/beads/JSStageEvents.as
+++ b/frameworks/projects/Crux/src/main/royale/org/apache/royale/crux/beads/JSStageEvents.as
@@ -149,6 +149,7 @@ package org.apache.royale.crux.beads
          *  @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
          *  @royaleignorecoercion MutationRecord
          *  @royaleignorecoercion NodeList
+         *  @royaleemitcoercion org.apache.royale.events.IEventDispatcher
          */
         COMPILE::JS
         private function mutationDetected(mutationsList:Array):void
@@ -196,7 +197,16 @@ package org.apache.royale.crux.beads
                             }
                         }
                         //dispatch a non-bubbling event, but support capture phase listeners
-                        royaleInstance.dispatchBubblingEvent(royaleInstance,new Event('addedToStage', false));
+                        // build the ancestors tree without setting the actual parentEventTarget
+                        var e:Object = new Event('addedToStage', false);
+                        var ancestorsTree:Array = [];
+                        var t:IEventDispatcher = royaleInstance["parent"] as IEventDispatcher;
+                        while (t != null) {
+                            ancestorsTree.push(t);
+                            t = t["parent"] as IEventDispatcher;
+                        }
+                        
+                        goog.events.EventTarget.dispatchEventInternal_(royaleInstance, e, ancestorsTree);
                     }
                 }
             }