fix tests failing on phantomjs

pull/428/merge
nightwing 2017-05-23 01:38:52 +04:00
rodzic 09f595723a
commit c3f362e796
6 zmienionych plików z 123 dodań i 234 usunięć

Wyświetl plik

@ -512,7 +512,7 @@ function checkCache() {
config.useCache = ideCachePromiss = ideCache = null; config.useCache = ideCachePromiss = ideCache = null;
}).then(function(ideCache_) { }).then(function(ideCache_) {
ideCache = ideCache_; ideCache = ideCache_;
return ideCache.keys(); return ideCache ? ideCache.keys() : [];
}).then(function(keys) { }).then(function(keys) {
baseUrl = config.baseUrl; baseUrl = config.baseUrl;
if (baseUrl[0] == "/") if (baseUrl[0] == "/")
@ -525,7 +525,7 @@ function checkCache() {
return ""; return "";
return r.headers.get("etag") + " " + url; return r.headers.get("etag") + " " + url;
}).join("\n") + "\n"; }).join("\n") + "\n";
if (val.length == 1) { if (val.length <= 1) {
ideCachePromiss = null; ideCachePromiss = null;
return ideCache; return ideCache;
} }

Wyświetl plik

@ -1,8 +1,4 @@
/** /*global apf*/
* Search Helper Library for the Cloud9
*
* @copyright 2013, Ajax.org B.V.
*/
define(function(require, exports, module) { define(function(require, exports, module) {
@ -139,7 +135,7 @@ module.exports = function(settings, execFind, toggleDialog, restore, toggleOptio
} }
catch (e) { catch (e) {
tooltip.$ext.innerHTML = apf.escapeXML(e.message.replace(": /" + searchTxt + "/", "")); tooltip.$ext.innerHTML = apf.escapeXML(e.message.replace(": /" + searchTxt + "/", ""));
apf.setOpacity(tooltip.$ext, 1); tooltip.$ext.style.opacity = 1;
var pos = apf.getAbsolutePosition(win.$ext); var pos = apf.getAbsolutePosition(win.$ext);
tooltip.$ext.style.left = pos[0] + txtFind.getLeft() + "px"; tooltip.$ext.style.left = pos[0] + txtFind.getLeft() + "px";

Wyświetl plik

@ -45,7 +45,7 @@ define(function(require, exports, module) {
this.data = v; this.data = v;
}, },
toString: function() { toString: function() {
return this.xml; return this.json;
} }
}; };

Wyświetl plik

@ -1527,7 +1527,6 @@ apf.BaseTab = function() {
//Skin changing support //Skin changing support
if (this.$int) { if (this.$int) {
//apf.AmlParser.replaceNode(this.oPages, oPages);
this.$int = this.oPages; this.$int = this.oPages;
page = true; page = true;

Wyświetl plik

@ -2377,7 +2377,7 @@ apf.plane = {
var toOpacity = parseFloat(options && options.opacity) || 1; var toOpacity = parseFloat(options && options.opacity) || 1;
if (this.animate) { if (this.animate) {
var _self = this; var _self = this;
apf.setOpacity(this.plane, 0); this.plane.style.opacity = 0;
setTimeout(function(){ setTimeout(function(){
apf.tween.single(_self.plane, { apf.tween.single(_self.plane, {
steps: 5, steps: 5,
@ -2389,7 +2389,7 @@ apf.plane = {
}, 100); }, 100);
} }
else else
apf.setOpacity(this.plane, toOpacity); this.plane.style.opacity = toOpacity;
var diff = apf.getDiff(plane); var diff = apf.getDiff(plane);
this.plane.style.width = "100%";//(pWidth - diff[0]) + "px"; this.plane.style.width = "100%";//(pWidth - diff[0]) + "px";
@ -2421,7 +2421,7 @@ apf.plane = {
steps: 5, steps: 5,
interval: 10, interval: 10,
type: "fade", type: "fade",
from: apf.getOpacity(_self.plane), from: apf.getStyle(_self.plane, "opacity"),
to: 0, to: 0,
onfinish: function(){ onfinish: function(){
_self.plane.style.display = "none"; _self.plane.style.display = "none";
@ -2433,7 +2433,7 @@ apf.plane = {
}, 100); }, 100);
} }
else { else {
apf.setOpacity(this.plane, 0); this.plane.style.opacity = 0;
if (this.current) if (this.current)
apf.window.zManager.clear(this.plane, this.current); apf.window.zManager.clear(this.plane, this.current);
this.plane.style.display = "none"; this.plane.style.display = "none";
@ -8516,7 +8516,6 @@ apf.GuiElement.propHandlers = {
// crazy stuff! // crazy stuff!
!function(){ !function(){
if (apf.isO3) return;
var prot = apf.XhtmlElement.prototype; var prot = apf.XhtmlElement.prototype;
prot.implement( prot.implement(
@ -12036,9 +12035,6 @@ apf.window = new apf.window();
* @private * @private
*/ */
apf.runGecko = function(){ apf.runGecko = function(){
if (apf.runNonIe)
apf.runNonIe();
apf.getHtmlLeft = function(oHtml) { apf.getHtmlLeft = function(oHtml) {
return (oHtml.offsetLeft return (oHtml.offsetLeft
+ (parseInt(apf.getStyle(oHtml.parentNode, "borderLeftWidth")) || 0)); + (parseInt(apf.getStyle(oHtml.parentNode, "borderLeftWidth")) || 0));
@ -12209,22 +12205,8 @@ function findNodes(htmlNode, textNode, result, re) {
// *** XML Serialization *** //
if (XMLDocument.prototype.__defineGetter__) {
/**
* @private
*/
apf.runNonIe = function (){
DocumentFragment.prototype.getElementById = function(id) {
return this.childNodes.length ? this.childNodes[0].ownerDocument.getElementById(id) : null;
};
// *** XML Serialization *** //
if (XMLDocument.prototype.__defineGetter__) {
//XMLDocument.xml //XMLDocument.xml
XMLDocument.prototype.__defineGetter__("xml", function(){ XMLDocument.prototype.__defineGetter__("xml", function(){
return (new XMLSerializer()).serializeToString(this); return (new XMLSerializer()).serializeToString(this);
@ -12244,114 +12226,44 @@ apf.runNonIe = function (){
Element.prototype.__defineGetter__("xml", function(){ Element.prototype.__defineGetter__("xml", function(){
return (new XMLSerializer()).serializeToString(this); return (new XMLSerializer()).serializeToString(this);
}); });
} }
/* ******** HTML Interfaces **************************************************
insertAdjacentHTML(), insertAdjacentText() and insertAdjacentElement()
****************************************************************************/
if (typeof HTMLElement!="undefined") {
if (!HTMLElement.prototype.insertAdjacentElement) {
Text.prototype.insertAdjacentElement =
HTMLElement.prototype.insertAdjacentElement = function(where,parsedNode) {
switch (where.toLowerCase()) {
case "beforebegin":
this.parentNode.insertBefore(parsedNode,this);
break;
case "afterbegin":
this.insertBefore(parsedNode,this.firstChild);
break;
case "beforeend":
this.appendChild(parsedNode);
break;
case "afterend":
if (this.nextSibling)
this.parentNode.insertBefore(parsedNode,this.nextSibling);
else
this.parentNode.appendChild(parsedNode);
break;
}
};
}
if (!HTMLElement.prototype.insertAdjacentHTML) {
Text.prototype.insertAdjacentHTML =
HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr) {
var r = this.ownerDocument.createRange();
r.setStartBefore(apf.isWebkit
? document.body
: (self.document ? document.body : this));
var parsedHTML = r.createContextualFragment(htmlStr);
this.insertAdjacentElement(where, parsedHTML);
};
}
if (!HTMLBodyElement.prototype.insertAdjacentHTML) //apf.isWebkit)
HTMLBodyElement.prototype.insertAdjacentHTML = HTMLElement.prototype.insertAdjacentHTML;
if (!HTMLElement.prototype.insertAdjacentText) {
Text.prototype.insertAdjacentText =
HTMLElement.prototype.insertAdjacentText = function(where,txtStr) {
var parsedText = document.createTextNode(txtStr);
this.insertAdjacentElement(where,parsedText);
};
}
if (typeof HTMLElement!="undefined") {
//HTMLElement.removeNode //HTMLElement.removeNode
HTMLElement.prototype.removeNode = function(){ HTMLElement.prototype.removeNode = function(){
if (!this.parentNode) return; if (!this.parentNode) return;
this.parentNode.removeChild(this); this.parentNode.removeChild(this);
}; };
} }
/* ******** XML Compatibility ************************************************ //Document.prototype.onreadystatechange = null;
Giving the Mozilla XML Parser the same interface as IE's Parser Document.prototype.parseError = 0;
****************************************************************************/
var ASYNCNOTSUPPORTED = false;
//Test if Async is supported defineProp(Array.prototype, "item", function(i){return this[i];});
try { defineProp(Array.prototype, "expr", "");
XMLDocument.prototype.async = true;
ASYNCNOTSUPPORTED = true;
} catch (e) {/*trap*/}
//Document.prototype.onreadystatechange = null; Node.prototype.getElementById = function(id) {};
Document.prototype.parseError = 0;
defineProp(Array.prototype, "item", function(i){return this[i];});
defineProp(Array.prototype, "expr", "");
Node.prototype.getElementById = function(id) {};
HTMLElement.prototype.replaceNode =
Element.prototype.replaceNode = function(xmlNode) {
if (!this.parentNode) return;
this.parentNode.insertBefore(xmlNode, this);
this.parentNode.removeChild(this);
};
/**
/**
* This method retrieves the current value of a property on a HTML element * This method retrieves the current value of a property on a HTML element
* @param {HTMLElement} el the element to read the property from * @param {HTMLElement} el the element to read the property from
* @param {String} prop the property to read * @param {String} prop the property to read
* @returns {String} * @returns {String}
*/ */
var getStyle = apf.getStyle = function(el, prop) { var getStyle = apf.getStyle = function(el, prop) {
try{ try{
return (window.getComputedStyle(el, "") || {})[prop] || ""; return (window.getComputedStyle(el, "") || {})[prop] || "";
}catch(e) {} }catch(e) {}
}; };
//XMLDocument.setProperty //XMLDocument.setProperty
HTMLDocument.prototype.setProperty = HTMLDocument.prototype.setProperty =
XMLDocument.prototype.setProperty = function(x,y) {}; XMLDocument.prototype.setProperty = function(x,y) {};
/* ******** XML Compatibility ************************************************ /* ******** XML Compatibility ************************************************
****************************************************************************/ ****************************************************************************/
apf.getXmlDom = function(message, noError, preserveWhiteSpaces) { apf.getXmlDom = function(message, noError, preserveWhiteSpaces) {
var xmlParser; var xmlParser;
if (message) { if (message) {
if (preserveWhiteSpaces === false) if (preserveWhiteSpaces === false)
@ -12369,9 +12281,9 @@ apf.runNonIe = function (){
} }
return xmlParser; return xmlParser;
}; };
apf.xmlParseError = function(xml) { apf.xmlParseError = function(xml) {
//if (xml.documentElement.tagName == "parsererror") { //if (xml.documentElement.tagName == "parsererror") {
if (xml.getElementsByTagName("parsererror").length) { if (xml.getElementsByTagName("parsererror").length) {
var nodeValue = xml.documentElement.firstChild.nodeValue; var nodeValue = xml.documentElement.firstChild.nodeValue;
@ -12401,16 +12313,6 @@ apf.runNonIe = function (){
} }
return xml; return xml;
};
apf.getOpacity = function(oHtml) {
return apf.getStyle(oHtml, "opacity");
};
apf.setOpacity = function(oHtml, value) {
oHtml.style.opacity = value;
};
}; };
@ -12418,8 +12320,6 @@ apf.runNonIe = function (){
/** /**
* Compatibility layer for Webkit based browsers. * Compatibility layer for Webkit based browsers.
* @private * @private
@ -12452,9 +12352,6 @@ apf.runWebkit = function(){
- (parseInt(apf.getStyle(p, "borderTopWidth")) || 0) - (parseInt(apf.getStyle(p, "borderTopWidth")) || 0)
- (parseInt(apf.getStyle(p, "borderBottomWidth")) || 0)); - (parseInt(apf.getStyle(p, "borderBottomWidth")) || 0));
}; };
if (apf.runNonIe)
apf.runNonIe();
}; };
@ -12472,7 +12369,6 @@ apf.runWebkit = function(){
apf.application = function(){ apf.application = function(){
this.$init("application", apf.NODE_HIDDEN); this.$init("application", apf.NODE_HIDDEN);
if (!apf.isO3) {
this.$int = document.body; this.$int = document.body;
this.$tabList = []; //Prevents documentElement from being focussed this.$tabList = []; //Prevents documentElement from being focussed
// this.$focussable = apf.KEYBOARD; // this.$focussable = apf.KEYBOARD;
@ -12482,10 +12378,7 @@ apf.application = function(){
this.focus = function(){ this.dispatchEvent("focus"); }; this.focus = function(){ this.dispatchEvent("focus"); };
this.blur = function(){ this.dispatchEvent("blur"); }; this.blur = function(){ this.dispatchEvent("blur"); };
apf.window.$addFocus(this); apf.window.$addFocus(this);
}
}; };
apf.application.prototype = new apf.AmlElement(); apf.application.prototype = new apf.AmlElement();
apf.aml.setElement("application", apf.application); apf.aml.setElement("application", apf.application);

Wyświetl plik

@ -1,3 +1,4 @@
/*global apf*/
define(function(require, exports, module) { define(function(require, exports, module) {
main.consumes = ["Plugin", "ui"]; main.consumes = ["Plugin", "ui"];
main.provides = ["tooltip"]; main.provides = ["tooltip"];
@ -85,7 +86,7 @@ define(function(require, exports, module) {
if (options.control) if (options.control)
options.control.stop(); options.control.stop();
apf.setOpacity(this, 1); this.style.display = "none";
} }
function ttmouseout(e) { function ttmouseout(e) {
@ -134,7 +135,7 @@ define(function(require, exports, module) {
control: options.control = {}}); control: options.control = {}});
} }
else { else {
apf.setOpacity(options.tooltip, 1); options.tooltip.style.opacity = 1;
} }
}, options.timeout); }, options.timeout);
} }