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

Wyświetl plik

@ -1,8 +1,4 @@
/**
* Search Helper Library for the Cloud9
*
* @copyright 2013, Ajax.org B.V.
*/
/*global apf*/
define(function(require, exports, module) {
@ -139,7 +135,7 @@ module.exports = function(settings, execFind, toggleDialog, restore, toggleOptio
}
catch (e) {
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);
tooltip.$ext.style.left = pos[0] + txtFind.getLeft() + "px";

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

@ -2377,7 +2377,7 @@ apf.plane = {
var toOpacity = parseFloat(options && options.opacity) || 1;
if (this.animate) {
var _self = this;
apf.setOpacity(this.plane, 0);
this.plane.style.opacity = 0;
setTimeout(function(){
apf.tween.single(_self.plane, {
steps: 5,
@ -2389,7 +2389,7 @@ apf.plane = {
}, 100);
}
else
apf.setOpacity(this.plane, toOpacity);
this.plane.style.opacity = toOpacity;
var diff = apf.getDiff(plane);
this.plane.style.width = "100%";//(pWidth - diff[0]) + "px";
@ -2421,7 +2421,7 @@ apf.plane = {
steps: 5,
interval: 10,
type: "fade",
from: apf.getOpacity(_self.plane),
from: apf.getStyle(_self.plane, "opacity"),
to: 0,
onfinish: function(){
_self.plane.style.display = "none";
@ -2433,7 +2433,7 @@ apf.plane = {
}, 100);
}
else {
apf.setOpacity(this.plane, 0);
this.plane.style.opacity = 0;
if (this.current)
apf.window.zManager.clear(this.plane, this.current);
this.plane.style.display = "none";
@ -8516,7 +8516,6 @@ apf.GuiElement.propHandlers = {
// crazy stuff!
!function(){
if (apf.isO3) return;
var prot = apf.XhtmlElement.prototype;
prot.implement(
@ -12036,9 +12035,6 @@ apf.window = new apf.window();
* @private
*/
apf.runGecko = function(){
if (apf.runNonIe)
apf.runNonIe();
apf.getHtmlLeft = function(oHtml) {
return (oHtml.offsetLeft
+ (parseInt(apf.getStyle(oHtml.parentNode, "borderLeftWidth")) || 0));
@ -12209,20 +12205,6 @@ function findNodes(htmlNode, textNode, result, re) {
/**
* @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
@ -12246,75 +12228,14 @@ apf.runNonIe = function (){
});
}
/* ******** 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);
};
}
//HTMLElement.removeNode
HTMLElement.prototype.removeNode = function(){
if (!this.parentNode) return;
this.parentNode.removeChild(this);
};
}
/* ******** XML Compatibility ************************************************
Giving the Mozilla XML Parser the same interface as IE's Parser
****************************************************************************/
var ASYNCNOTSUPPORTED = false;
//Test if Async is supported
try {
XMLDocument.prototype.async = true;
ASYNCNOTSUPPORTED = true;
} catch (e) {/*trap*/}
//Document.prototype.onreadystatechange = null;
Document.prototype.parseError = 0;
@ -12323,15 +12244,6 @@ apf.runNonIe = function (){
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
@ -12404,18 +12316,6 @@ apf.runNonIe = function (){
};
apf.getOpacity = function(oHtml) {
return apf.getStyle(oHtml, "opacity");
};
apf.setOpacity = function(oHtml, value) {
oHtml.style.opacity = value;
};
};
@ -12452,9 +12352,6 @@ apf.runWebkit = function(){
- (parseInt(apf.getStyle(p, "borderTopWidth")) || 0)
- (parseInt(apf.getStyle(p, "borderBottomWidth")) || 0));
};
if (apf.runNonIe)
apf.runNonIe();
};
@ -12472,7 +12369,6 @@ apf.runWebkit = function(){
apf.application = function(){
this.$init("application", apf.NODE_HIDDEN);
if (!apf.isO3) {
this.$int = document.body;
this.$tabList = []; //Prevents documentElement from being focussed
// this.$focussable = apf.KEYBOARD;
@ -12482,10 +12378,7 @@ apf.application = function(){
this.focus = function(){ this.dispatchEvent("focus"); };
this.blur = function(){ this.dispatchEvent("blur"); };
apf.window.$addFocus(this);
}
};
apf.application.prototype = new apf.AmlElement();
apf.aml.setElement("application", apf.application);

Wyświetl plik

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