diff --git a/testing/marionette/atom.js b/testing/marionette/atom.js index 0a803cf1204a..53ebd380bcde 100644 --- a/testing/marionette/atom.js +++ b/testing/marionette/atom.js @@ -17,91 +17,6 @@ this.EXPORTED_SYMBOLS = ["atom"]; /** @namespace */ this.atom = {}; -// https://github.com/SeleniumHQ/selenium/blob/master/javascript/atoms/action.js#L83 -atom.clearElement = function(element, window){return function(){var g,k=this;function m(a){return void 0!==a}function n(a){return"string"==typeof a}function aa(a){return"number"==typeof a}function ba(a,b){a=a.split(".");var c=k;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&m(b)?c[d]=b:c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}} -function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; -else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function da(a){return"function"==ca(a)}function ea(a,b,c){return a.call.apply(a.bind,arguments)}function fa(a,b,c){if(!a)throw Error();if(2b||a.indexOf("Error",b)!=b)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""}p(ja,Error);var ka="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=ka;r[30]=ka;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state"; -r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=ka;r[9]="unknown command";ja.prototype.toString=function(){return this.name+": "+this.message};var la={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400", -darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc", -ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a", -lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1", -moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57", -seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function ma(a,b){this.width=a;this.height=b}g=ma.prototype;g.toString=function(){return"("+this.width+" x "+this.height+")"};g.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};g.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};g.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};g.scale=function(a,b){b=aa(b)?b:a;this.width*=a;this.height*=b;return this};function oa(a){var b=pa;return Object.prototype.hasOwnProperty.call(b,"1.9.2")?b["1.9.2"]:b["1.9.2"]=a("1.9.2")};var qa=String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};function ra(a,b){return ab?1:0}function sa(a){return String(a).replace(/\-([a-z])/g,function(a,c){return c.toUpperCase()})}; -function ta(a,b,c){this.a=a;this.b=b||1;this.f=c||1};function ua(a){this.b=a;this.a=0}function va(a){a=a.match(wa);for(var b=0;b]=|\s+|./g,xa=/^\s/;function t(a,b){return a.b[a.a+(b||0)]}function u(a){return a.b[a.a++]}function ya(a){return a.b.length<=a.a};var za;a:{var Aa=k.navigator;if(Aa){var Ba=Aa.userAgent;if(Ba){za=Ba;break a}}za=""};function x(a,b){this.j=a;this.c=m(b)?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Ca(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}x.prototype.a=function(a){return null===this.b||this.b==a.nodeType};x.prototype.f=function(){return this.j}; -x.prototype.toString=function(){var a="Kind Test: "+this.j;null===this.c||(a+=y(this.c));return a};function Da(a,b){this.o=a.toLowerCase();a="*"==this.o?"*":"http://www.w3.org/1999/xhtml";this.b=b?b.toLowerCase():a}Da.prototype.a=function(a){var b=a.nodeType;if(1!=b&&2!=b)return!1;b=m(a.localName)?a.localName:a.nodeName;return"*"!=this.o&&this.o!=b.toLowerCase()?!1:"*"==this.b?!0:this.b==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};Da.prototype.f=function(){return this.o}; -Da.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.b?"":this.b+":")+this.o};function Ea(a){switch(a.nodeType){case 1:return ha(Fa,a);case 9:return Ea(a.documentElement);case 11:case 10:case 6:case 12:return Ga;default:return a.parentNode?Ea(a.parentNode):Ga}}function Ga(){return null}function Fa(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?Fa(a.parentNode,b):null};function Ha(a,b){if(n(a))return n(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var Ma="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),Na=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,Oa=/^#(?:[0-9a-f]{3}){1,2}$/i,Pa=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,Qa=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function Ra(a,b){this.x=m(a)?a:0;this.y=m(b)?b:0}g=Ra.prototype;g.toString=function(){return"("+this.x+", "+this.y+")"};g.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};g.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};g.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};g.scale=function(a,b){b=aa(b)?b:a;this.x*=a;this.y*=b;return this};var Sa=-1!=za.indexOf("Macintosh"),Ta=-1!=za.indexOf("Windows"),Ua,Va="",Wa=/rv\:([^\);]+)(\)|;)/.exec(za);Wa&&(Va=Wa?Wa[1]:"");Ua=Va;var pa={}; -function Xa(){return oa(function(){for(var a=0,b=qa(String(Ua)).split("."),c=qa("1.9.2").split("."),d=Math.max(b.length,c.length),e=0;!a&&e=this.f&&a.a<=this.a&&a.c>=this.c&&a.b<=this.b:a.x>=this.f&&a.x<=this.a&&a.y>=this.c&&a.y<=this.b:!1};g.ceil=function(){this.c=Math.ceil(this.c);this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.f=Math.ceil(this.f);return this}; -g.floor=function(){this.c=Math.floor(this.c);this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.f=Math.floor(this.f);return this};g.round=function(){this.c=Math.round(this.c);this.a=Math.round(this.a);this.b=Math.round(this.b);this.f=Math.round(this.f);return this};g.scale=function(a,b){b=aa(b)?b:a;this.f*=a;this.a*=a;this.c*=b;this.b*=b;return this};function Za(a,b){this.w={};this.m=[];this.a=0;var c=arguments.length;if(1=this.a&&a.x<=this.a+this.width&&a.y>=this.b&&a.y<=this.b+this.height:this.a<=a.a&&this.a+this.width>=a.a+a.width&&this.b<=a.b&&this.b+this.height>=a.b+a.height}; -g.ceil=function(){this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};g.floor=function(){this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};g.round=function(){this.a=Math.round(this.a);this.b=Math.round(this.b);this.width=Math.round(this.width);this.height=Math.round(this.height);return this}; -g.scale=function(a,b){b=aa(b)?b:a;this.a*=a;this.width*=a;this.b*=b;this.height*=b;return this};var bb,cb,db=function(){var a=k.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var b=a.classes,a=a.interfaces,c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),b=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo),d=b.platformVersion,e=b.version;bb=function(a){return 0<=c.compare(d,""+a)};cb=function(a){c.compare(e,""+a)};return!0}();function eb(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function fb(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a} -function gb(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?hb(a,b):!c&&fb(e,b)?-1*ib(a,b):!d&&fb(f,a)?ib(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=C(a);c=d.createRange();c.selectNode(a);c.collapse(!0);a=d.createRange();a.selectNode(b); -a.collapse(!0);return c.compareBoundaryPoints(k.Range.START_TO_END,a)}function ib(a,b){var c=a.parentNode;if(c==b)return-1;for(;b.parentNode!=c;)b=b.parentNode;return hb(b,a)}function hb(a,b){for(;b=b.previousSibling;)if(b==a)return-1;return 1}function C(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function jb(a,b,c){a&&!c&&(a=a.parentNode);for(c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}function kb(a){try{return a&&a.activeElement}catch(b){}return null} -function lb(a){this.a=a||k.document||document}lb.prototype.getElementsByTagName=function(a,b){return(b||this.a).getElementsByTagName(String(a))};lb.prototype.contains=fb;function E(a){var b=null,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?"":b);if("string"!=typeof b)if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;for(var c=0,d=[],b="";a;){do 1!=a.nodeType&&(b+=a.nodeValue),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return""+b} -function mb(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}return null==c?!!a.getAttribute(b):a.getAttribute(b,2)==c}function nb(a,b,c,d,e){return ob.call(null,a,b,n(c)?c:null,n(d)?d:null,e||new F)} -function ob(a,b,c,d,e){b.getElementsByName&&d&&"name"==c?(b=b.getElementsByName(d),z(b,function(b){a.a(b)&&G(e,b)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),z(b,function(b){b.className==d&&a.a(b)&&G(e,b)})):a instanceof x?pb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),z(b,function(a){mb(a,c,d)&&G(e,a)}));return e}function pb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)mb(b,c,d)&&a.a(b)&&G(e,b),pb(a,b,c,d,e)};function qb(a){var b="tabindex";return"style"==b?rb(a.style.cssText):(a=a.getAttributeNode(b))&&a.specified?a.value:null}var sb=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/;function rb(a){var b=[];z(a.split(sb),function(a){var c=a.indexOf(":");0",4,2,function(a,b,c){return Gb(function(a,b){return a>b},a,b,c)});N("<=",4,2,function(a,b,c){return Gb(function(a,b){return a<=b},a,b,c)});N(">=",4,2,function(a,b,c){return Gb(function(a,b){return a>=b},a,b,c)});var Fb=N("=",3,2,function(a,b,c){return Gb(function(a,b){return a==b},a,b,c,!0)});N("!=",3,2,function(a,b,c){return Gb(function(a,b){return a!=b},a,b,c,!0)});N("and",2,2,function(a,b,c){return Db(a,c)&&Db(b,c)});N("or",1,2,function(a,b,c){return Db(a,c)||Db(b,c)});function Jb(a,b){if(b.a.length&&4!=a.l)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");K.call(this,a.l);this.c=a;this.j=b;this.i=a.i;this.b=a.b}p(Jb,K);Jb.prototype.a=function(a){a=this.c.a(a);return Kb(this.j,a)};Jb.prototype.toString=function(){var a="Filter:"+y(this.c);return a+=y(this.j)};function Lb(a,b){if(b.lengtha.F)throw Error("Function "+a.o+" expects at most "+a.F+" arguments, "+b.length+" given");a.N&&z(b,function(b,d){if(4!=b.l)throw Error("Argument "+d+" to function "+a.o+" is not of type Nodeset: "+b);});K.call(this,a.l);this.C=a;this.c=b;Bb(this,a.i||A(b,function(a){return a.i}));Cb(this,a.M&&!b.length||a.L&&!!b.length||A(b,function(a){return a.b}))}p(Lb,K); -Lb.prototype.a=function(a){return this.C.u.apply(null,Ka(a,this.c))};Lb.prototype.toString=function(){var a="Function: "+this.C;if(this.c.length)var b=Ia(this.c,function(a,b){return a+y(b)},"Arguments:"),a=a+y(b);return a};function Mb(a,b,c,d,e,f,h,l,v){this.o=a;this.l=b;this.i=c;this.M=d;this.L=e;this.u=f;this.J=h;this.F=m(l)?l:h;this.N=!!v}Mb.prototype.toString=function(){return this.o};var Nb={}; -function O(a,b,c,d,e,f,h,l){if(Nb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Nb[a]=new Mb(a,b,c,d,!1,e,f,h,l)}O("boolean",2,!1,!1,function(a,b){return Db(b,a)},1);O("ceiling",1,!1,!1,function(a,b){return Math.ceil(L(b,a))},1);O("concat",3,!1,!1,function(a,b){return Ia(La(arguments,1),function(b,d){return b+M(d,a)},"")},2,null);O("contains",2,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);return-1!=b.indexOf(a)},2);O("count",1,!1,!1,function(a,b){return b.a(a).s},1,1,!0); -O("false",2,!1,!1,function(){return!1},0);O("floor",1,!1,!1,function(a,b){return Math.floor(L(b,a))},1);O("id",4,!1,!1,function(a,b){var c=a.a,d=9==c.nodeType?c:c.ownerDocument;a=M(b,a).split(/\s+/);var e=[];z(a,function(a){a=d.getElementById(a);!a||0<=Ha(e,a)||e.push(a)});e.sort(gb);var f=new F;z(e,function(a){G(f,a)});return f},1);O("lang",2,!1,!1,function(){return!1},1);O("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0); -O("local-name",3,!1,!0,function(a,b){return(a=b?wb(b.a(a)):a.a)?a.localName||a.nodeName.toLowerCase():""},0,1,!0);O("name",3,!1,!0,function(a,b){return(a=b?wb(b.a(a)):a.a)?a.nodeName.toLowerCase():""},0,1,!0);O("namespace-uri",3,!0,!1,function(){return""},0,1,!0);O("normalize-space",3,!1,!0,function(a,b){return(b?M(b,a):E(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);O("not",2,!1,!1,function(a,b){return!Db(b,a)},1);O("number",1,!1,!0,function(a,b){return b?L(b,a):+E(a.a)},0,1); -O("position",1,!0,!1,function(a){return a.b},0);O("round",1,!1,!1,function(a,b){return Math.round(L(b,a))},1);O("starts-with",2,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);return!b.lastIndexOf(a,0)},2);O("string",3,!1,!0,function(a,b){return b?M(b,a):E(a.a)},0,1);O("string-length",1,!1,!0,function(a,b){return(b?M(b,a):E(a.a)).length},0,1); -O("substring",3,!1,!1,function(a,b,c,d){c=L(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?L(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=M(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);O("substring-after",3,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); -O("substring-before",3,!1,!1,function(a,b,c){b=M(b,a);a=M(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);O("sum",1,!1,!1,function(a,b){a=I(b.a(a));b=0;for(var c=J(a);c;c=J(a))b+=+E(c);return b},1,1,!0);O("translate",3,!1,!1,function(a,b,c,d){b=M(b,a);c=M(c,a);var e=M(d,a);d={};for(var f=0;fa.length)throw Error("Unclosed literal string");return new Ob(a)} -function lc(a){var b=[];if(Ub(t(a.a))){var c=u(a.a);var d=t(a.a);if("/"==c&&(ya(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Sb;d=new Sb;S(a,"Missing next location step.");c=mc(a,c);b.push(c)}else{a:{c=t(a.a);d=c.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":u(a.a);c=gc(a);S(a,'unclosed "("');ic(a,")");break;case '"':case "'":c=kc(a);break;default:if(isNaN(+c))if(!Ca(c)&&/(?![0-9])[\w]/.test(d)&&"("==t(a.a,1)){c=u(a.a); -c=Nb[c]||null;u(a.a);for(d=[];")"!=t(a.a);){S(a,"Missing function argument list.");d.push(gc(a));if(","!=t(a.a))break;u(a.a)}S(a,"Unclosed function argument list.");jc(a);c=new Lb(c,d)}else{c=null;break a}else c=new Pb(+u(a.a))}"["==t(a.a)&&(d=new Xb(nc(a)),c=new Jb(c,d))}if(c)if(Ub(t(a.a)))d=c;else return c;else c=mc(a,"/"),d=new Tb,b.push(c)}for(;Ub(t(a.a));)c=u(a.a),S(a,"Missing next location step."),c=mc(a,c),b.push(c);return new Qb(d,b)} -function mc(a,b){if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==t(a.a)){var c=new Q(ec,new x("node"));u(a.a);return c}if(".."==t(a.a))return c=new Q(dc,new x("node")),u(a.a),c;if("@"==t(a.a)){var d=Rb;u(a.a);S(a,"Missing attribute name")}else if("::"==t(a.a,1)){if(!/(?![0-9])[\w]/.test(t(a.a).charAt(0)))throw Error("Bad token: "+u(a.a));var e=u(a.a);d=cc[e]||null;if(!d)throw Error("No axis with name: "+e);u(a.a);S(a,"Missing node name")}else d=$b;e=t(a.a);if(/(?![0-9])[\w\*]/.test(e.charAt(0)))if("("== -t(a.a,1)){if(!Ca(e))throw Error("Invalid node type: "+e);e=u(a.a);if(!Ca(e))throw Error("Invalid type name: "+e);ic(a,"(");S(a,"Bad nodetype");var f=t(a.a).charAt(0),h=null;if('"'==f||"'"==f)h=kc(a);S(a,"Bad nodetype");jc(a);e=new x(e,h)}else if(e=u(a.a),f=e.indexOf(":"),-1==f)e=new Da(e);else{var h=e.substring(0,f);if("*"==h)var l="*";else if(l=a.b(h),!l)throw Error("Namespace prefix not declared: "+h);e=e.substr(f+1);e=new Da(e,l)}else throw Error("Bad token: "+u(a.a));a=new Xb(nc(a),d.A);return c|| -new Q(d,e,a,"//"==b)}function nc(a){for(var b=[];"["==t(a.a);){u(a.a);S(a,"Missing predicate expression.");var c=gc(a);b.push(c);S(a,"Unclosed predicate expression.");ic(a,"]")}return b}function hc(a){if("-"==t(a.a))return u(a.a),new Yb(hc(a));var b=lc(a);if("|"!=t(a.a))a=b;else{for(b=[b];"|"==u(a.a);)S(a,"Missing next union location path."),b.push(lc(a));a.a.a--;a=new Zb(b)}return a};function oc(a,b){if(!a.length)throw Error("Empty XPath expression.");a=va(a);if(ya(a))throw Error("Invalid XPath expression.");b?da(b)||(b=ga(b.lookupNamespaceURI,b)):b=function(){return null};var c=gc(new fc(a,b));if(!ya(a))throw Error("Bad token: "+u(a));this.evaluate=function(a,b){a=c.a(new ta(a));return new T(a,b)}} -function T(a,b){if(!b)if(a instanceof F)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof F))throw Error("value could not be converted to the specified type");this.resultType=b;switch(b){case 2:this.stringValue=a instanceof F?xb(a):""+a;break;case 1:this.numberValue=a instanceof F?+xb(a):+a;break;case 3:this.booleanValue=a instanceof F?0=d.length?null:d[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=d.length||0>a?null:d[a]}}T.ANY_TYPE=0; -T.NUMBER_TYPE=1;T.STRING_TYPE=2;T.BOOLEAN_TYPE=3;T.UNORDERED_NODE_ITERATOR_TYPE=4;T.ORDERED_NODE_ITERATOR_TYPE=5;T.UNORDERED_NODE_SNAPSHOT_TYPE=6;T.ORDERED_NODE_SNAPSHOT_TYPE=7;T.ANY_UNORDERED_NODE_TYPE=8;T.FIRST_ORDERED_NODE_TYPE=9;function pc(a){this.lookupNamespaceURI=Ea(a)} -ba("wgxpath.install",function(a,b){a=a||k;var c=a.Document&&a.Document.prototype||a.document;if(!c.evaluate||b)a.XPathResult=T,c.evaluate=function(a,b,c,h){return(new oc(a,c)).evaluate(b,h)},c.createExpression=function(a,b){return new oc(a,b)},c.createNSResolver=function(a){return new pc(a)}});var U={};U.G=function(){var a={V:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}(); -U.u=function(a,b,c){var d=C(a);if(!d.documentElement)return null;try{for(var e=d.createNSResolver?d.createNSResolver(d.documentElement):U.G,f={},h=d.getElementsByTagName("*"),l=0;l=b&&0<=c&&255>=c&&0<=d&&255>=d&&0<=e&&1>=e)){b=[b,c,d,e];break b}b=null}if(!b)b:{if(d=a.match(Qa))if(b=Number(d[1]), -c=Number(d[2]),d=Number(d[3]),0<=b&&255>=b&&0<=c&&255>=c&&0<=d&&255>=d){b=[b,c,d,1];break b}b=null}if(!b)b:{b=a.toLowerCase();c=la[b.toLowerCase()];if(!c&&(c="#"==b.charAt(0)?b:"#"+b,4==c.length&&(c=c.replace(Na,"#$1$1$2$2$3$3")),!Oa.test(c))){b=null;break b}b=[parseInt(c.substr(1,2),16),parseInt(c.substr(3,2),16),parseInt(c.substr(5,2),16),1]}a=b?"rgba("+b.join(", ")+")":a}return a} -function zc(a,b){var c=a.currentStyle||a.style,d=c[b];!m(d)&&da(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?m(d)?d:null:(a=yc(a))?zc(a,b):null} -function Ac(a,b,c){function d(a){var b=Bc(a);return 0=D.a+D.width;D=e.c>=D.b+D.height;if(P&&"hidden"==q.x||D&&"hidden"==q.y)return X;if(P&&"visible"!=q.x||D&&"visible"!=q.y){if(w&&(q=d(a),e.f>=h.scrollWidth-q.x||e.a>=h.scrollHeight-q.y))return X;e=Cc(a);return e==X?X:"scroll"}}}return"none"} -function Bc(a){var b=Dc(a);if(b)return b.rect;if(H(a,"HTML"))return a=C(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new ma(a.clientWidth,a.clientHeight),new B(0,0,a.width,a.height);try{var c=a.getBoundingClientRect()}catch(d){return new B(0,0,0,0)}return new B(c.left,c.top,c.right-c.left,c.bottom-c.top)} -function Dc(a){var b=H(a,"MAP");if(!b&&!H(a,"AREA"))return null;var c=b?a:H(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=U.P('/descendant::*[@usemap = "#'+c.name+'"]',C(c)))&&(e=Bc(d),b||"default"==a.shape.toLowerCase()||(a=Hc(a),b=Math.min(Math.max(a.a,0),e.width),c=Math.min(Math.max(a.b,0),e.height),e=new B(b+e.a,c+e.b,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{I:d,rect:e||new B(0,0,0,0)}} -function Hc(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){var b=a[0],c=a[1];return new B(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new B(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2");Y(191,"/","?"); -Y(192,"`","~");Y(219,"[","{");Y(220,"\\","|");Y(221,"]","}");Y({g:59,h:186},";",":");Y(222,"'",'"');var Rc=new Za;Rc.set(1,Nc);Rc.set(2,Oc);Rc.set(4,Pc);Rc.set(8,Qc);(function(a){var b=new Za;z($a(a),function(c){b.set(a.get(c).code,c)});return b})(Rc);db&&bb(12);function Z(){Ic.call(this)}p(Z,Ic);Z.a=void 0;Z.b=function(){return Z.a?Z.a:Z.a=new Z};ba("_",function(a){var b;(b=!Fc(a)||!vc(a))||(b=(db?bb("1.9.2"):Xa())?"none"==V(a,"pointer-events"):!1);if(b)throw new ja(12,"Element is not currently interactable and may not be manipulated");if(!(tc(a)||H(a,"INPUT")&&"file"==a.type.toLowerCase())||a.readOnly)throw new ja(12,"Element must be user-editable in order to clear it.");b=Z.b();Jc(b,a);Kc(b);a.value?(a.value="",b=Ab.create(a,void 0),"isTrusted"in b||(b.isTrusted=!1),a.dispatchEvent(b)):H(a,"INPUT")&&a.getAttribute("type")&&"number"==a.getAttribute("type").toLowerCase()&& -(a.value="");xc(a)&&(a.innerHTML=" ")});; return this._.apply(null,arguments);}.apply({navigator:typeof window!='undefined'?window.navigator:null,document:typeof window!='undefined'?window.document:null}, arguments);} - // https://github.com/SeleniumHQ/selenium/blob/master/javascript/atoms/dom.js#L979 atom.getElementText = function(element, window){return function(){var g,l=this;function n(a){return void 0!==a}function p(a){return"string"==typeof a}function aa(a){return"number"==typeof a}function ba(a,b){a=a.split(".");var c=l;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&n(b)?c[d]=b:c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}} function ca(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";