Changeset 29505 in legacy


Ignore:
Timestamp:
Aug 20, 2012 3:43:02 AM (5 years ago)
Author:
bill
Message:

Various DOH robot updates:

  • Don't include dijit code into page with robot test code; dijit should only be loaded in the content iframe.
  • Fix double scrollbar on tests (on IE8) caused by overflow:visible setting on <html>
  • Prefer dojo/domReady! to dojo/ready, in order to support other AMD loaders. However, dojo/ready is still needed for the outer frame to detect when the inner frame (with the content) has completed initializing.
  • Since robot depends on dojo, use domClass.add() and remove() to add dohRobot class to <html> node, to avoid getting a space character in the class string.


Fixes #15865, refs #15616 on trunk/ !strict.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • dijit/trunk/robot.js

    r27778 r29505  
    11define([
    2         "./main",
    32        "dojo/robot"
    4 ], function(dijit){
     3], function(){
    54        // module:
    65        //              dijit/robot
    76        // summary:
    87        //              Used to have code needed by robot test harness, but no longer
    9 
    10         return dijit;
    118});
  • dijit/trunk/robotx.js

    r28336 r29505  
    11define([
    22        "dojo/_base/kernel", // kernel.experimental
    3         "./main",                       // original dijit variable in main window
    43        "dojo/robotx"           // includes doh/robot, dojo/robot, and dojo/robotx, all of which affect and return doh/robot module
    5 ], function(kernel, dijit_, robot){
     4], function(kernel, robot){
    65
    76        // module:
     
    2423                }
    2524        };
    26 
    27         return dijit_;
    2825});
  • dojo/trunk/robotx.js

    r29371 r29505  
    11define([
     2        "require",
    23        "doh/main",
    34        "./aspect",
     
    78        "./_base/lang",
    89        "./on",
    9         "./ready",
    1010        "./robot",
    1111        "./sniff",
    1212        "./_base/window"
    13 ], function(doh, aspect, construct, style, kernel, lang, on, ready, robot, has, win){
     13], function(require, doh, aspect, construct, style, kernel, lang, on, robot, has, win){
    1414
    1515kernel.experimental("dojo.robotx");
     
    3535        groupStarted.remove();
    3636        iframe.style.visibility = "visible";
    37         iframe.style.visibility = "visible";
    3837}, true);
    3938
     
    4443        //              Create iframe to load external app at specified url, and call iframeLoad() when that URL finishes loading
    4544
    46         ready(function(){
     45        require(["./domReady!"], function(){
    4746                var emptyStyle = {
    48                         overflow: has("webkit") ? "hidden" : "visible",
     47                        overflow: "hidden",
    4948                        margin: "0px",
    5049                        borderWidth: "0px",
     
    5857                // console.log("creating iframe for external document");
    5958                iframe = document.createElement("iframe");
    60                 iframe.src = url;
    6159                iframe.setAttribute("ALLOWTRANSPARENCY","true");
    6260                iframe.scrolling = has("ie") ? "yes" : "auto";
     
    7169                        height: consoleHeight ? (scrollRoot.clientHeight - consoleHeight)+"px" : "100%"
    7270                });
     71                iframe.src = url;
    7372                if(iframe.attachEvent !== undefined){
    7473                        iframe.attachEvent("onload", iframeLoad);
  • util/trunk/doh/robot.js

    r29358 r29505  
    11define([
    22        "doh/_browserRunner", "require",
    3         "dojo/aspect", "dojo/Deferred", "dojo/dom-construct", "dojo/dom-geometry", "dojo/_base/lang", "dojo/ready",
     3        "dojo/aspect", "dojo/Deferred", "dojo/dom-class", "dojo/dom-construct", "dojo/dom-geometry", "dojo/_base/lang", "dojo/ready",
    44        "dojo/_base/unload", "dojo/when", "dojo/_base/window"
    5 ], function(doh, require, aspect, Deferred, construct, geom, lang, ready, unload, when, win){
     5], function(doh, require, aspect, Deferred, domClass, construct, geom, lang, ready, unload, when, win){
    66
    77// loading state
     
    6262                if(robot._robotLoaded){
    6363                        robot._robotLoaded = false;
    64                         document.documentElement.className = document.documentElement.className.replace(/ ?dohRobot/, "");
     64                        domClass.remove(document.documentElement, "dohRobot");
    6565                        robot._killApplet();
    6666                }
     
    108108
    109109                // add dohRobot class to HTML element so tests can use that in CSS rules if desired
    110                 document.documentElement.className += " dohRobot";
     110                domClass.add(document.documentElement, "dohRobot");
    111111                window.scrollTo(0, 0);
    112112//              document.documentElement.scrollTop = document.documentElement.scrollLeft = 0;
Note: See TracChangeset for help on using the changeset viewer.