Bug 1360466 - Use target instead of originalTarget in handleEvent. r=ato, a=test-only
authorHenrik Skupin <mail@hskupin.info>
Fri, 28 Apr 2017 17:36:42 +0200
changeset 394009 e4dcd08a921c33c34d408f578e152380dd0a2844
parent 394008 c2d65528b868147534410064afd98cb93ac066f0
child 394010 0eea0b75aeb5e2257b94ac4d444934198d6a833f
push id7331
push userryanvm@gmail.com
push dateFri, 19 May 2017 17:36:20 +0000
treeherdermozilla-beta@72da880beaeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato, test-only
bugs1360466
milestone54.0
Bug 1360466 - Use target instead of originalTarget in handleEvent. r=ato, a=test-only originalTarget seems to be outdated and not used anymore for each navigation related event. But target is, and as such handleEvent has to make use of that instead. MozReview-Commit-ID: AN2H1PbCt7A
testing/marionette/listener.js
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -209,17 +209,17 @@ var loadListener = {
     logger.debug(`Received DOM event "${event.type}" for "${event.originalTarget.baseURI}"`);
 
     switch (event.type) {
       case "unload":
         this.seenUnload = true;
         break;
 
       case "pagehide":
-        if (event.originalTarget === curContainer.frame.document) {
+        if (event.target === curContainer.frame.document) {
           this.seenUnload = true;
 
           removeEventListener("hashchange", this);
           removeEventListener("pagehide", this);
 
           // Now wait until the target page has been loaded
           addEventListener("DOMContentLoaded", this, false);
           addEventListener("pageshow", this, false);
@@ -227,35 +227,35 @@ var loadListener = {
         break;
 
       case "hashchange":
         this.stop();
         sendOk(this.command_id);
         break;
 
       case "DOMContentLoaded":
-        if (event.originalTarget.baseURI.startsWith("about:certerror")) {
+        if (event.target.baseURI.startsWith("about:certerror")) {
           this.stop();
           sendError(new InsecureCertificateError(), this.command_id);
 
-        } else if (/about:.*(error)\?/.exec(event.originalTarget.baseURI)) {
+        } else if (/about:.*(error)\?/.exec(event.target.baseURI)) {
           this.stop();
           sendError(new UnknownError("Reached error page: " +
-              event.originalTarget.baseURI), this.command_id);
+              event.target.baseURI), this.command_id);
 
         // Special-case about:blocked pages which should be treated as non-error
         // pages but do not raise a pageshow event.
-        } else if (/about:blocked\?/.exec(event.originalTarget.baseURI)) {
+        } else if (/about:blocked\?/.exec(event.target.baseURI)) {
           this.stop();
           sendOk(this.command_id);
         }
         break;
 
       case "pageshow":
-        if (event.originalTarget === curContainer.frame.document) {
+        if (event.target === curContainer.frame.document) {
           this.stop();
           sendOk(this.command_id);
         }
         break;
     }
   },
 
   /**