Bug 801703: iframe elements instead of using window.frames; r=mdas
authorDavid Burns <dburns@mozilla.com>
Fri, 19 Oct 2012 19:46:58 +0100
changeset 110936 77e5b3ac81e91da18020d854e3759181f504f733
parent 110935 c395a0974676355687e14f81d59b5280fbe27a94
child 110937 ebdaddbe9b7be4c68024a05cbcdf6f90573d95bc
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersmdas
bugs801703
milestone19.0a1
Bug 801703: iframe elements instead of using window.frames; r=mdas
testing/marionette/marionette-listener.js
--- a/testing/marionette/marionette-listener.js
+++ b/testing/marionette/marionette-listener.js
@@ -733,20 +733,20 @@ function switchToFrame(msg) {
     curWindow = content;
     curWindow.focus();
     sendOk();
     return;
   }
   if (msg.json.element != undefined) {
     if (elementManager.seenItems[msg.json.element] != undefined) {
       let wantedFrame = elementManager.getKnownElement(msg.json.element, curWindow); //HTMLIFrameElement
-      let numFrames = curWindow.frames.length;
-      for (let i = 0; i < numFrames; i++) {
-        if (curWindow.frames[i].frameElement == wantedFrame) {
-          curWindow = curWindow.frames[i]; 
+      let frames = curWindow.document.getElementsByTagName("iframe");
+      for (let i = 0; i < frames.length; i++) {
+        if (frames[i] == wantedFrame) {
+          curWindow = frames[i]; 
           curWindow.focus();
           sendOk();
           return;
         }
       }
     }
   }
   let frames = curWindow.document.getElementsByTagName("iframe");