mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge mozilla-central into mozilla-inbound
This commit is contained in:
commit
13792204c3
@ -107,12 +107,17 @@ let gDrag = {
|
|||||||
* @return Whether we should handle this drag and drop operation.
|
* @return Whether we should handle this drag and drop operation.
|
||||||
*/
|
*/
|
||||||
isValid: function Drag_isValid(aEvent) {
|
isValid: function Drag_isValid(aEvent) {
|
||||||
let dt = aEvent.dataTransfer;
|
let link = gDragDataHelper.getLinkFromDragEvent(aEvent);
|
||||||
let mimeType = "text/x-moz-url";
|
|
||||||
|
|
||||||
// Check that the drag data is non-empty.
|
// Check that the drag data is non-empty.
|
||||||
// Can happen when dragging places folders.
|
// Can happen when dragging places folders.
|
||||||
return dt && dt.types.contains(mimeType) && dt.getData(mimeType);
|
if (!link || !link.url) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check that we're not accepting URLs which would inherit the caller's
|
||||||
|
// principal (such as javascript: or data:).
|
||||||
|
return gLinkChecker.checkLoadURI(link.url);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
22
browser/base/content/newtab/dragDataHelper.js
Normal file
22
browser/base/content/newtab/dragDataHelper.js
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#ifdef 0
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
let gDragDataHelper = {
|
||||||
|
get mimeType() {
|
||||||
|
return "text/x-moz-url";
|
||||||
|
},
|
||||||
|
|
||||||
|
getLinkFromDragEvent: function DragDataHelper_getLinkFromDragEvent(aEvent) {
|
||||||
|
let dt = aEvent.dataTransfer;
|
||||||
|
if (!dt || !dt.types.contains(this.mimeType)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
let data = dt.getData(this.mimeType) || "";
|
||||||
|
let [url, title] = data.split(/[\r\n]+/);
|
||||||
|
return {url: url, title: title};
|
||||||
|
}
|
||||||
|
};
|
@ -90,14 +90,14 @@ let gDrop = {
|
|||||||
if (aCell != draggedSite.cell)
|
if (aCell != draggedSite.cell)
|
||||||
draggedSite.pin(index);
|
draggedSite.pin(index);
|
||||||
} else {
|
} else {
|
||||||
// A new link was dragged onto the grid. Create it by pinning its URL.
|
let link = gDragDataHelper.getLinkFromDragEvent(aEvent);
|
||||||
let dt = aEvent.dataTransfer;
|
if (link) {
|
||||||
let [url, title] = dt.getData("text/x-moz-url").split(/[\r\n]+/);
|
// A new link was dragged onto the grid. Create it by pinning its URL.
|
||||||
let link = {url: url, title: title};
|
gPinnedLinks.pin(link, index);
|
||||||
gPinnedLinks.pin(link, index);
|
|
||||||
|
|
||||||
// Make sure the newly added link is not blocked.
|
// Make sure the newly added link is not blocked.
|
||||||
gBlockedLinks.unblock(link);
|
gBlockedLinks.unblock(link);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Rect",
|
|||||||
let {
|
let {
|
||||||
links: gLinks,
|
links: gLinks,
|
||||||
allPages: gAllPages,
|
allPages: gAllPages,
|
||||||
|
linkChecker: gLinkChecker,
|
||||||
pinnedLinks: gPinnedLinks,
|
pinnedLinks: gPinnedLinks,
|
||||||
blockedLinks: gBlockedLinks
|
blockedLinks: gBlockedLinks
|
||||||
} = NewTabUtils;
|
} = NewTabUtils;
|
||||||
@ -53,6 +54,7 @@ const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
|||||||
#include cells.js
|
#include cells.js
|
||||||
#include sites.js
|
#include sites.js
|
||||||
#include drag.js
|
#include drag.js
|
||||||
|
#include dragDataHelper.js
|
||||||
#include drop.js
|
#include drop.js
|
||||||
#include dropTargetShim.js
|
#include dropTargetShim.js
|
||||||
#include dropPreview.js
|
#include dropPreview.js
|
||||||
|
@ -28,6 +28,7 @@ _BROWSER_FILES = \
|
|||||||
browser_newtab_bug725996.js \
|
browser_newtab_bug725996.js \
|
||||||
browser_newtab_bug734043.js \
|
browser_newtab_bug734043.js \
|
||||||
browser_newtab_bug735987.js \
|
browser_newtab_bug735987.js \
|
||||||
|
browser_newtab_bug765628.js \
|
||||||
head.js \
|
head.js \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
27
browser/base/content/test/newtab/browser_newtab_bug765628.js
Normal file
27
browser/base/content/test/newtab/browser_newtab_bug765628.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
|
const BAD_DRAG_DATA = "javascript:alert('h4ck0rz');\nbad stuff";
|
||||||
|
const GOOD_DRAG_DATA = "http://example.com/#99\nsite 99";
|
||||||
|
|
||||||
|
function runTests() {
|
||||||
|
yield setLinks("0,1,2,3,4,5,6,7,8");
|
||||||
|
setPinnedLinks("");
|
||||||
|
|
||||||
|
yield addNewTabPageTab();
|
||||||
|
checkGrid("0,1,2,3,4,5,6,7,8");
|
||||||
|
|
||||||
|
sendDropEvent(0, BAD_DRAG_DATA);
|
||||||
|
sendDropEvent(1, GOOD_DRAG_DATA);
|
||||||
|
|
||||||
|
yield whenPagesUpdated();
|
||||||
|
checkGrid("0,99p,1,2,3,4,5,6,7");
|
||||||
|
}
|
||||||
|
|
||||||
|
function sendDropEvent(aCellIndex, aDragData) {
|
||||||
|
let ifaceReq = getContentWindow().QueryInterface(Ci.nsIInterfaceRequestor);
|
||||||
|
let windowUtils = ifaceReq.getInterface(Ci.nsIDOMWindowUtils);
|
||||||
|
|
||||||
|
let event = createDragEvent("drop", aDragData);
|
||||||
|
windowUtils.dispatchDOMEventViaPresShell(getCell(aCellIndex).node, event, true);
|
||||||
|
}
|
@ -373,17 +373,24 @@ Rule.prototype = {
|
|||||||
this._title += ":" + this.ruleLine;
|
this._title += ":" + this.ruleLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return this._title + (this.mediaText ? " @media " + this.mediaText : "");
|
||||||
|
},
|
||||||
|
|
||||||
|
get inheritedSource()
|
||||||
|
{
|
||||||
|
if (this._inheritedSource) {
|
||||||
|
return this._inheritedSource;
|
||||||
|
}
|
||||||
|
this._inheritedSource = "";
|
||||||
if (this.inherited) {
|
if (this.inherited) {
|
||||||
let eltText = this.inherited.tagName.toLowerCase();
|
let eltText = this.inherited.tagName.toLowerCase();
|
||||||
if (this.inherited.id) {
|
if (this.inherited.id) {
|
||||||
eltText += "#" + this.inherited.id;
|
eltText += "#" + this.inherited.id;
|
||||||
}
|
}
|
||||||
let args = [eltText, this._title];
|
this._inheritedSource =
|
||||||
this._title = CssLogic._strings.formatStringFromName("rule.inheritedSource",
|
CssLogic._strings.formatStringFromName("rule.inheritedSource", [eltText], 1);
|
||||||
args, args.length);
|
|
||||||
}
|
}
|
||||||
|
return this._inheritedSource;
|
||||||
return this._title + (this.mediaText ? " @media " + this.mediaText : "");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -958,6 +965,8 @@ CssRuleView.prototype = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._clearRules();
|
||||||
|
|
||||||
// Repopulate the element style.
|
// Repopulate the element style.
|
||||||
this._elementStyle.populate();
|
this._elementStyle.populate();
|
||||||
|
|
||||||
@ -1023,23 +1032,23 @@ CssRuleView.prototype = {
|
|||||||
{
|
{
|
||||||
// Run through the current list of rules, attaching
|
// Run through the current list of rules, attaching
|
||||||
// their editors in order. Create editors if needed.
|
// their editors in order. Create editors if needed.
|
||||||
let last = null;
|
let lastInheritedSource = "";
|
||||||
for each (let rule in this._elementStyle.rules) {
|
for each (let rule in this._elementStyle.rules) {
|
||||||
|
|
||||||
|
let inheritedSource = rule.inheritedSource;
|
||||||
|
if (inheritedSource != lastInheritedSource) {
|
||||||
|
let h2 = this.doc.createElementNS(HTML_NS, "div");
|
||||||
|
h2.className = "ruleview-rule-inheritance";
|
||||||
|
h2.textContent = inheritedSource;
|
||||||
|
lastInheritedSource = inheritedSource;
|
||||||
|
this.element.appendChild(h2);
|
||||||
|
}
|
||||||
|
|
||||||
if (!rule.editor) {
|
if (!rule.editor) {
|
||||||
new RuleEditor(this, rule);
|
new RuleEditor(this, rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
let target = last ? last.nextSibling : this.element.firstChild;
|
this.element.appendChild(rule.editor.element);
|
||||||
this.element.insertBefore(rule.editor.element, target);
|
|
||||||
last = rule.editor.element;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ... and now editors for rules that don't exist anymore
|
|
||||||
// have been pushed to the end of the list, go ahead and
|
|
||||||
// delete their nodes. The rules they edit have already been
|
|
||||||
// forgotten.
|
|
||||||
while (last && last.nextSibling) {
|
|
||||||
this.element.removeChild(last.nextSibling);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1154,16 +1163,6 @@ CssRuleView.prototype = {
|
|||||||
let rx = new RegExp("^" + inline + "\\r?\\n?", "g");
|
let rx = new RegExp("^" + inline + "\\r?\\n?", "g");
|
||||||
text = text.replace(rx, "");
|
text = text.replace(rx, "");
|
||||||
|
|
||||||
// Remove file:line
|
|
||||||
text = text.replace(/[\w\.]+:\d+(\r?\n)/g, "$1");
|
|
||||||
|
|
||||||
// Remove inherited from: line
|
|
||||||
let inheritedFrom = _strings.
|
|
||||||
GetStringFromName("rule.inheritedSource");
|
|
||||||
inheritedFrom = inheritedFrom.replace(/\s%S\s\(%S\)/g, "");
|
|
||||||
rx = new RegExp("(\r?\n)" + inheritedFrom + ".*", "g");
|
|
||||||
text = text.replace(rx, "$1");
|
|
||||||
|
|
||||||
clipboardHelper.copyString(text, this.doc);
|
clipboardHelper.copyString(text, this.doc);
|
||||||
|
|
||||||
if (aEvent) {
|
if (aEvent) {
|
||||||
@ -1184,9 +1183,9 @@ CssRuleView.prototype = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.className != "rule-view-row") {
|
if (node.className != "ruleview-rule") {
|
||||||
while (node = node.parentElement) {
|
while (node = node.parentElement) {
|
||||||
if (node.className == "rule-view-row") {
|
if (node.className == "ruleview-rule") {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1332,7 +1331,7 @@ RuleEditor.prototype = {
|
|||||||
_create: function RuleEditor_create()
|
_create: function RuleEditor_create()
|
||||||
{
|
{
|
||||||
this.element = this.doc.createElementNS(HTML_NS, "div");
|
this.element = this.doc.createElementNS(HTML_NS, "div");
|
||||||
this.element.className = "rule-view-row";
|
this.element.className = "ruleview-rule";
|
||||||
this.element._ruleEditor = this;
|
this.element._ruleEditor = this;
|
||||||
|
|
||||||
// Give a relative position for the inplace editor's measurement
|
// Give a relative position for the inplace editor's measurement
|
||||||
@ -1705,6 +1704,7 @@ TextPropertyEditor.prototype = {
|
|||||||
textContent: computed.name
|
textContent: computed.name
|
||||||
});
|
});
|
||||||
appendText(li, ": ");
|
appendText(li, ": ");
|
||||||
|
|
||||||
createChild(li, "span", {
|
createChild(li, "span", {
|
||||||
class: "ruleview-propertyvalue",
|
class: "ruleview-propertyvalue",
|
||||||
textContent: computed.value
|
textContent: computed.value
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-property:not(:hover) > .ruleview-enableproperty {
|
.ruleview-property:not(:hover) > .ruleview-enableproperty {
|
||||||
visibility: hidden;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-namecontainer {
|
.ruleview-namecontainer {
|
||||||
|
@ -122,7 +122,7 @@ function checkCopyRule() {
|
|||||||
function checkCopyRuleWithEditorSelected()
|
function checkCopyRuleWithEditorSelected()
|
||||||
{
|
{
|
||||||
let contentDoc = ruleViewFrame().contentDocument;
|
let contentDoc = ruleViewFrame().contentDocument;
|
||||||
let rows = contentDoc.querySelectorAll(".rule-view-row");
|
let rules = contentDoc.querySelectorAll(".ruleview-rule");
|
||||||
let propNodes = contentDoc.querySelectorAll(".ruleview-property");
|
let propNodes = contentDoc.querySelectorAll(".ruleview-property");
|
||||||
let propNode = propNodes[2];
|
let propNode = propNodes[2];
|
||||||
let propNameNode = propNode.querySelector(".ruleview-propertyname");
|
let propNameNode = propNode.querySelector(".ruleview-propertyname");
|
||||||
@ -137,7 +137,7 @@ function checkCopyRuleWithEditorSelected()
|
|||||||
" color: rgb\\(170, 170, 170\\);[\\r\\n]+" +
|
" color: rgb\\(170, 170, 170\\);[\\r\\n]+" +
|
||||||
"}[\\r\\n]*";
|
"}[\\r\\n]*";
|
||||||
|
|
||||||
let elementRuleEditor = rows[0]._ruleEditor;
|
let elementRuleEditor = rules[0]._ruleEditor;
|
||||||
waitForEditorFocus(elementRuleEditor.element, function onNewElement(aEditor) {
|
waitForEditorFocus(elementRuleEditor.element, function onNewElement(aEditor) {
|
||||||
ok(aEditor, "we have the editor");
|
ok(aEditor, "we have the editor");
|
||||||
|
|
||||||
|
@ -1176,12 +1176,13 @@ let ConsoleAPIObserver = {
|
|||||||
aRemoteMessage.objectsCacheId = Manager.sequenceId;
|
aRemoteMessage.objectsCacheId = Manager.sequenceId;
|
||||||
aRemoteMessage.argumentsToString = [];
|
aRemoteMessage.argumentsToString = [];
|
||||||
let mapFunction = function(aItem) {
|
let mapFunction = function(aItem) {
|
||||||
aRemoteMessage.argumentsToString.push(this._formatObject(aItem));
|
let formattedObject = this._formatObject(aItem);
|
||||||
|
aRemoteMessage.argumentsToString.push(formattedObject);
|
||||||
if (WebConsoleUtils.isObjectInspectable(aItem)) {
|
if (WebConsoleUtils.isObjectInspectable(aItem)) {
|
||||||
return JSTerm.prepareObjectForRemote(aItem,
|
return JSTerm.prepareObjectForRemote(aItem,
|
||||||
aRemoteMessage.objectsCacheId);
|
aRemoteMessage.objectsCacheId);
|
||||||
}
|
}
|
||||||
return aItem;
|
return formattedObject;
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
aRemoteMessage.apiMessage.arguments =
|
aRemoteMessage.apiMessage.arguments =
|
||||||
|
@ -4236,7 +4236,7 @@ ConsoleUtils = {
|
|||||||
treeView.data = {
|
treeView.data = {
|
||||||
rootCacheId: body.cacheId,
|
rootCacheId: body.cacheId,
|
||||||
panelCacheId: body.cacheId,
|
panelCacheId: body.cacheId,
|
||||||
remoteObject: body.remoteObject,
|
remoteObject: Array.isArray(body.remoteObject) ? body.remoteObject : [],
|
||||||
remoteObjectProvider: body.remoteObjectProvider,
|
remoteObjectProvider: body.remoteObjectProvider,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -111,6 +111,7 @@ MOCHITEST_BROWSER_FILES = \
|
|||||||
browser_webconsole_menustatus.js \
|
browser_webconsole_menustatus.js \
|
||||||
browser_result_format_as_string.js \
|
browser_result_format_as_string.js \
|
||||||
browser_webconsole_bug_737873_mixedcontent.js \
|
browser_webconsole_bug_737873_mixedcontent.js \
|
||||||
|
browser_output_breaks_after_console_dir_uninspectable.js \
|
||||||
head.js \
|
head.js \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
@ -0,0 +1,55 @@
|
|||||||
|
/* vim:set ts=2 sw=2 sts=2 et: */
|
||||||
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
|
|
||||||
|
// Make sure that the Web Console output does not break after we try to call
|
||||||
|
// console.dir() for objects that are not inspectable.
|
||||||
|
|
||||||
|
function test()
|
||||||
|
{
|
||||||
|
waitForExplicitFinish();
|
||||||
|
|
||||||
|
addTab("data:text/html;charset=utf8,test for bug 773466");
|
||||||
|
|
||||||
|
gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
|
||||||
|
gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
|
||||||
|
openConsole(null, performTest);
|
||||||
|
}, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function performTest(hud)
|
||||||
|
{
|
||||||
|
hud.jsterm.clearOutput(true);
|
||||||
|
|
||||||
|
content.console.log("fooBug773466a");
|
||||||
|
content.console.dir(function funBug773466(){});
|
||||||
|
waitForSuccess({
|
||||||
|
name: "eval results are shown",
|
||||||
|
validatorFn: function()
|
||||||
|
{
|
||||||
|
return hud.outputNode.textContent.indexOf("funBug773466") > -1;
|
||||||
|
},
|
||||||
|
successFn: function()
|
||||||
|
{
|
||||||
|
isnot(hud.outputNode.textContent.indexOf("fooBug773466a"), -1,
|
||||||
|
"fooBug773466a shows");
|
||||||
|
ok(hud.outputNode.querySelector(".webconsole-msg-inspector"),
|
||||||
|
"the console.dir() tree shows");
|
||||||
|
|
||||||
|
content.console.log("fooBug773466b");
|
||||||
|
|
||||||
|
waitForSuccess(waitForAnotherConsoleLogCall);
|
||||||
|
},
|
||||||
|
failureFn: finishTest,
|
||||||
|
});
|
||||||
|
|
||||||
|
let waitForAnotherConsoleLogCall = {
|
||||||
|
name: "eval result after console.dir()",
|
||||||
|
validatorFn: function()
|
||||||
|
{
|
||||||
|
return hud.outputNode.textContent.indexOf("fooBug773466b") > -1;
|
||||||
|
},
|
||||||
|
successFn: finishTest,
|
||||||
|
failureFn: finishTest,
|
||||||
|
};
|
||||||
|
}
|
@ -33,8 +33,8 @@ rule.sourceElement=element
|
|||||||
# LOCALIZATION NOTE (rule.inheritedSource): Shown for CSS rules
|
# LOCALIZATION NOTE (rule.inheritedSource): Shown for CSS rules
|
||||||
# that were inherited from a parent node. Will be passed a node
|
# that were inherited from a parent node. Will be passed a node
|
||||||
# identifier and a source location.
|
# identifier and a source location.
|
||||||
# e.g "Inherited from body#bodyID (styles.css:20)"
|
# e.g "Inherited from body#bodyID"
|
||||||
rule.inheritedSource=Inherited from %S (%S)
|
rule.inheritedSource=Inherited from %S
|
||||||
|
|
||||||
# LOCALIZATION NOTE (style.highlighter.button): These strings are used inside
|
# LOCALIZATION NOTE (style.highlighter.button): These strings are used inside
|
||||||
# sidebar of the Highlighter for the style inspector button.
|
# sidebar of the Highlighter for the style inspector button.
|
||||||
|
@ -16,6 +16,11 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
|||||||
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
|
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
|
||||||
"resource://gre/modules/PlacesUtils.jsm");
|
"resource://gre/modules/PlacesUtils.jsm");
|
||||||
|
|
||||||
|
XPCOMUtils.defineLazyGetter(this, "gPrincipal", function () {
|
||||||
|
let uri = Services.io.newURI("about:newtab", null, null);
|
||||||
|
return Services.scriptSecurityManager.getCodebasePrincipal(uri);
|
||||||
|
});
|
||||||
|
|
||||||
// The preference that tells whether this feature is enabled.
|
// The preference that tells whether this feature is enabled.
|
||||||
const PREF_NEWTAB_ENABLED = "browser.newtabpage.enabled";
|
const PREF_NEWTAB_ENABLED = "browser.newtabpage.enabled";
|
||||||
|
|
||||||
@ -33,11 +38,8 @@ let Storage = {
|
|||||||
* The dom storage instance used to persist data belonging to the New Tab Page.
|
* The dom storage instance used to persist data belonging to the New Tab Page.
|
||||||
*/
|
*/
|
||||||
get domStorage() {
|
get domStorage() {
|
||||||
let uri = Services.io.newURI("about:newtab", null, null);
|
|
||||||
let principal = Services.scriptSecurityManager.getCodebasePrincipal(uri);
|
|
||||||
|
|
||||||
let sm = Services.domStorageManager;
|
let sm = Services.domStorageManager;
|
||||||
let storage = sm.getLocalStorageForPrincipal(principal, "");
|
let storage = sm.getLocalStorageForPrincipal(gPrincipal, "");
|
||||||
|
|
||||||
// Cache this value, overwrite the getter.
|
// Cache this value, overwrite the getter.
|
||||||
let descriptor = {value: storage, enumerable: true};
|
let descriptor = {value: storage, enumerable: true};
|
||||||
@ -363,8 +365,10 @@ let PlacesProvider = {
|
|||||||
|
|
||||||
while (row = aResultSet.getNextRow()) {
|
while (row = aResultSet.getNextRow()) {
|
||||||
let url = row.getResultByIndex(1);
|
let url = row.getResultByIndex(1);
|
||||||
let title = row.getResultByIndex(2);
|
if (LinkChecker.checkLoadURI(url)) {
|
||||||
links.push({url: url, title: title});
|
let title = row.getResultByIndex(2);
|
||||||
|
links.push({url: url, title: title});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -549,6 +553,37 @@ let Telemetry = {
|
|||||||
|
|
||||||
Telemetry.init();
|
Telemetry.init();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Singleton that checks if a given link should be displayed on about:newtab
|
||||||
|
* or if we should rather not do it for security reasons. URIs that inherit
|
||||||
|
* their caller's principal will be filtered.
|
||||||
|
*/
|
||||||
|
let LinkChecker = {
|
||||||
|
_cache: {},
|
||||||
|
|
||||||
|
get flags() {
|
||||||
|
return Ci.nsIScriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL;
|
||||||
|
},
|
||||||
|
|
||||||
|
checkLoadURI: function LinkChecker_checkLoadURI(aURI) {
|
||||||
|
if (!(aURI in this._cache))
|
||||||
|
this._cache[aURI] = this._doCheckLoadURI(aURI);
|
||||||
|
|
||||||
|
return this._cache[aURI];
|
||||||
|
},
|
||||||
|
|
||||||
|
_doCheckLoadURI: function Links_doCheckLoadURI(aURI) {
|
||||||
|
try {
|
||||||
|
Services.scriptSecurityManager.
|
||||||
|
checkLoadURIStrWithPrincipal(gPrincipal, aURI, this.flags);
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
// We got a weird URI or one that would inherit the caller's principal.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Singleton that provides the public API of this JSM.
|
* Singleton that provides the public API of this JSM.
|
||||||
*/
|
*/
|
||||||
@ -567,8 +602,9 @@ let NewTabUtils = {
|
|||||||
}, true);
|
}, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
allPages: AllPages,
|
|
||||||
links: Links,
|
links: Links,
|
||||||
|
allPages: AllPages,
|
||||||
|
linkChecker: LinkChecker,
|
||||||
pinnedLinks: PinnedLinks,
|
pinnedLinks: PinnedLinks,
|
||||||
blockedLinks: BlockedLinks
|
blockedLinks: BlockedLinks
|
||||||
};
|
};
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 882 B After Width: | Height: | Size: 804 B |
@ -143,22 +143,38 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
.ruleview {
|
.ruleview {
|
||||||
background-color: #FFF;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-rule-source {
|
.ruleview-rule-source {
|
||||||
background-color: -moz-dialog;
|
color: hsl(121,42%,43%); /* green */
|
||||||
color: -moz-dialogText;
|
-moz-padding-start: 5px;
|
||||||
padding: 2px 5px;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
text-align: right;
|
||||||
|
float: right;
|
||||||
|
-moz-user-select: -moz-none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ruleview-rule-inheritance {
|
||||||
|
background-color: hsl(0,0%,90%);
|
||||||
|
color: hsl(0,0%,50%);
|
||||||
|
border-top: 1px solid hsl(0,0%,65%);
|
||||||
|
border-bottom: 1px solid hsl(0,0%,65%);
|
||||||
|
padding: 1px 4px;
|
||||||
|
margin-top: 4px;
|
||||||
|
-moz-user-select: -moz-none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-rule-source:hover {
|
.ruleview-rule-source:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-code {
|
.ruleview-rule {
|
||||||
padding: 2px 5px;
|
padding: 2px 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ruleview-rule + .ruleview-rule {
|
||||||
|
border-top: 1px dotted #cddae5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-warning {
|
.ruleview-warning {
|
||||||
@ -187,8 +203,15 @@
|
|||||||
.ruleview-enableproperty {
|
.ruleview-enableproperty {
|
||||||
height: 10px;
|
height: 10px;
|
||||||
width: 10px;
|
width: 10px;
|
||||||
-moz-margin-start: 2px;
|
-moz-margin-start: 1px;
|
||||||
-moz-margin-end: 0;
|
-moz-margin-end: 0;
|
||||||
|
transition: opacity 100ms;
|
||||||
|
transition-delay: 200ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ruleview-property:not(:hover) > .ruleview-enableproperty {
|
||||||
|
opacity: 0;
|
||||||
|
transition: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-expander {
|
.ruleview-expander {
|
||||||
@ -211,7 +234,11 @@
|
|||||||
|
|
||||||
.ruleview-propertyname {
|
.ruleview-propertyname {
|
||||||
padding: 1px 0;
|
padding: 1px 0;
|
||||||
color: #0060C0;
|
color: hsl(210,100%,38%); /* blue */
|
||||||
|
}
|
||||||
|
|
||||||
|
.ruleview-propertyvalue {
|
||||||
|
padding: 1px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-namecontainer,
|
.ruleview-namecontainer,
|
||||||
@ -250,10 +277,10 @@
|
|||||||
|
|
||||||
.ruleview-namecontainer > .ruleview-propertyname,
|
.ruleview-namecontainer > .ruleview-propertyname,
|
||||||
.ruleview-propertycontainer > .ruleview-propertyvalue {
|
.ruleview-propertycontainer > .ruleview-propertyvalue {
|
||||||
border-bottom: 1px dotted transparent;
|
border-bottom: 1px dashed transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-namecontainer:hover > .ruleview-propertyname,
|
.ruleview-namecontainer:hover > .ruleview-propertyname,
|
||||||
.ruleview-propertycontainer:hover > .ruleview-propertyvalue {
|
.ruleview-propertycontainer:hover > .ruleview-propertyvalue {
|
||||||
border-bottom-color: black;
|
border-bottom-color: hsl(0,0%,50%);
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 882 B After Width: | Height: | Size: 804 B |
@ -145,22 +145,38 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
.ruleview {
|
.ruleview {
|
||||||
background-color: #FFF;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-rule-source {
|
.ruleview-rule-source {
|
||||||
background-color: -moz-dialog;
|
color: hsl(121,42%,43%); /* green */
|
||||||
color: -moz-dialogText;
|
-moz-padding-start: 5px;
|
||||||
padding: 2px 5px;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
text-align: right;
|
||||||
|
float: right;
|
||||||
|
-moz-user-select: -moz-none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ruleview-rule-inheritance {
|
||||||
|
background-color: hsl(0,0%,90%);
|
||||||
|
color: hsl(0,0%,50%);
|
||||||
|
border-top: 1px solid hsl(0,0%,65%);
|
||||||
|
border-bottom: 1px solid hsl(0,0%,65%);
|
||||||
|
padding: 1px 4px;
|
||||||
|
margin-top: 4px;
|
||||||
|
-moz-user-select: -moz-none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-rule-source:hover {
|
.ruleview-rule-source:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-code {
|
.ruleview-rule {
|
||||||
padding: 2px 5px;
|
padding: 2px 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ruleview-rule + .ruleview-rule {
|
||||||
|
border-top: 1px dotted #cddae5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-warning {
|
.ruleview-warning {
|
||||||
@ -189,8 +205,15 @@
|
|||||||
.ruleview-enableproperty {
|
.ruleview-enableproperty {
|
||||||
height: 10px;
|
height: 10px;
|
||||||
width: 10px;
|
width: 10px;
|
||||||
-moz-margin-start: 2px;
|
-moz-margin-start: 1px;
|
||||||
-moz-margin-end: 0;
|
-moz-margin-end: 0;
|
||||||
|
transition: opacity 100ms;
|
||||||
|
transition-delay: 200ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ruleview-property:not(:hover) > .ruleview-enableproperty {
|
||||||
|
opacity: 0;
|
||||||
|
transition: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-expander {
|
.ruleview-expander {
|
||||||
@ -213,7 +236,11 @@
|
|||||||
|
|
||||||
.ruleview-propertyname {
|
.ruleview-propertyname {
|
||||||
padding: 1px 0;
|
padding: 1px 0;
|
||||||
color: #0060C0;
|
color: hsl(210,100%,38%); /* blue */
|
||||||
|
}
|
||||||
|
|
||||||
|
.ruleview-propertyvalue {
|
||||||
|
padding: 1px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-namecontainer,
|
.ruleview-namecontainer,
|
||||||
@ -252,10 +279,10 @@
|
|||||||
|
|
||||||
.ruleview-namecontainer > .ruleview-propertyname,
|
.ruleview-namecontainer > .ruleview-propertyname,
|
||||||
.ruleview-propertycontainer > .ruleview-propertyvalue {
|
.ruleview-propertycontainer > .ruleview-propertyvalue {
|
||||||
border-bottom: 1px dotted transparent;
|
border-bottom: 1px dashed transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-namecontainer:hover > .ruleview-propertyname,
|
.ruleview-namecontainer:hover > .ruleview-propertyname,
|
||||||
.ruleview-propertycontainer:hover > .ruleview-propertyvalue {
|
.ruleview-propertycontainer:hover > .ruleview-propertyvalue {
|
||||||
border-bottom-color: black;
|
border-bottom-color: hsl(0,0%,50%);
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 882 B After Width: | Height: | Size: 804 B |
@ -144,22 +144,38 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
.ruleview {
|
.ruleview {
|
||||||
background-color: #FFF;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-rule-source {
|
.ruleview-rule-source {
|
||||||
background-color: -moz-dialog;
|
color: hsl(121,42%,43%); /* green */
|
||||||
color: -moz-dialogText;
|
-moz-padding-start: 5px;
|
||||||
padding: 2px 5px;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
text-align: right;
|
||||||
|
float: right;
|
||||||
|
-moz-user-select: -moz-none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ruleview-rule-inheritance {
|
||||||
|
background-color: hsl(0,0%,90%);
|
||||||
|
color: hsl(0,0%,50%);
|
||||||
|
border-top: 1px solid hsl(0,0%,65%);
|
||||||
|
border-bottom: 1px solid hsl(0,0%,65%);
|
||||||
|
padding: 1px 4px;
|
||||||
|
margin-top: 4px;
|
||||||
|
-moz-user-select: -moz-none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-rule-source:hover {
|
.ruleview-rule-source:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-code {
|
.ruleview-rule {
|
||||||
padding: 2px 5px;
|
padding: 2px 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ruleview-rule + .ruleview-rule {
|
||||||
|
border-top: 1px dotted #cddae5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-warning {
|
.ruleview-warning {
|
||||||
@ -188,8 +204,15 @@
|
|||||||
.ruleview-enableproperty {
|
.ruleview-enableproperty {
|
||||||
height: 10px;
|
height: 10px;
|
||||||
width: 10px;
|
width: 10px;
|
||||||
-moz-margin-start: 2px;
|
-moz-margin-start: 1px;
|
||||||
-moz-margin-end: 0;
|
-moz-margin-end: 0;
|
||||||
|
transition: opacity 100ms;
|
||||||
|
transition-delay: 200ms;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ruleview-property:not(:hover) > .ruleview-enableproperty {
|
||||||
|
opacity: 0;
|
||||||
|
transition: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-expander {
|
.ruleview-expander {
|
||||||
@ -212,7 +235,11 @@
|
|||||||
|
|
||||||
.ruleview-propertyname {
|
.ruleview-propertyname {
|
||||||
padding: 1px 0;
|
padding: 1px 0;
|
||||||
color: #0060C0;
|
color: hsl(210,100%,38%); /* blue */
|
||||||
|
}
|
||||||
|
|
||||||
|
.ruleview-propertyvalue {
|
||||||
|
padding: 1px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-namecontainer,
|
.ruleview-namecontainer,
|
||||||
@ -251,10 +278,10 @@
|
|||||||
|
|
||||||
.ruleview-namecontainer > .ruleview-propertyname,
|
.ruleview-namecontainer > .ruleview-propertyname,
|
||||||
.ruleview-propertycontainer > .ruleview-propertyvalue {
|
.ruleview-propertycontainer > .ruleview-propertyvalue {
|
||||||
border-bottom: 1px dotted transparent;
|
border-bottom: 1px dashed transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ruleview-namecontainer:hover > .ruleview-propertyname,
|
.ruleview-namecontainer:hover > .ruleview-propertyname,
|
||||||
.ruleview-propertycontainer:hover > .ruleview-propertyvalue {
|
.ruleview-propertycontainer:hover > .ruleview-propertyvalue {
|
||||||
border-bottom-color: black;
|
border-bottom-color: hsl(0,0%,50%);
|
||||||
}
|
}
|
||||||
|
@ -649,7 +649,47 @@ nsRange::ComparePoint(nsIDOMNode* aParent, PRInt32 aOffset, PRInt16* aResult)
|
|||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsRange::IntersectsNode(nsIDOMNode* aNode, bool* aResult)
|
||||||
|
{
|
||||||
|
*aResult = false;
|
||||||
|
|
||||||
|
nsCOMPtr<nsINode> node = do_QueryInterface(aNode);
|
||||||
|
// TODO: This should throw a TypeError.
|
||||||
|
NS_ENSURE_ARG(node);
|
||||||
|
|
||||||
|
NS_ENSURE_TRUE(mIsPositioned, NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
||||||
|
// Step 3.
|
||||||
|
nsINode* parent = node->GetNodeParent();
|
||||||
|
if (!parent) {
|
||||||
|
// Steps 2 and 4.
|
||||||
|
// |parent| is null, so |node|'s root is |node| itself.
|
||||||
|
*aResult = (GetRoot() == node);
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Step 5.
|
||||||
|
PRInt32 nodeIndex = parent->IndexOf(node);
|
||||||
|
|
||||||
|
// Steps 6-7.
|
||||||
|
// Note: if disconnected is true, ComparePoints returns 1.
|
||||||
|
bool disconnected = false;
|
||||||
|
*aResult = nsContentUtils::ComparePoints(mStartParent, mStartOffset,
|
||||||
|
parent, nodeIndex + 1,
|
||||||
|
&disconnected) < 0 &&
|
||||||
|
nsContentUtils::ComparePoints(parent, nodeIndex,
|
||||||
|
mEndParent, mEndOffset,
|
||||||
|
&disconnected) < 0;
|
||||||
|
|
||||||
|
// Step 2.
|
||||||
|
if (disconnected) {
|
||||||
|
*aResult = false;
|
||||||
|
}
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************
|
/******************************************************
|
||||||
* Private helper routines
|
* Private helper routines
|
||||||
******************************************************/
|
******************************************************/
|
||||||
|
@ -524,13 +524,12 @@ nsDOMEvent::PreventDefault()
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
void
|
||||||
nsDOMEvent::SetEventType(const nsAString& aEventTypeArg)
|
nsDOMEvent::SetEventType(const nsAString& aEventTypeArg)
|
||||||
{
|
{
|
||||||
mEvent->userType =
|
mEvent->userType =
|
||||||
nsContentUtils::GetEventIdAndAtom(aEventTypeArg, mEvent->eventStructType,
|
nsContentUtils::GetEventIdAndAtom(aEventTypeArg, mEvent->eventStructType,
|
||||||
&(mEvent->message));
|
&(mEvent->message));
|
||||||
return NS_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
@ -551,7 +550,7 @@ nsDOMEvent::InitEvent(const nsAString& aEventTypeArg, bool aCanBubbleArg, bool a
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_ENSURE_SUCCESS(SetEventType(aEventTypeArg), NS_ERROR_FAILURE);
|
SetEventType(aEventTypeArg);
|
||||||
|
|
||||||
if (aCanBubbleArg) {
|
if (aCanBubbleArg) {
|
||||||
mEvent->flags &= ~NS_EVENT_FLAG_CANT_BUBBLE;
|
mEvent->flags &= ~NS_EVENT_FLAG_CANT_BUBBLE;
|
||||||
|
@ -224,7 +224,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Internal helper functions
|
// Internal helper functions
|
||||||
nsresult SetEventType(const nsAString& aEventTypeArg);
|
void SetEventType(const nsAString& aEventTypeArg);
|
||||||
already_AddRefed<nsIContent> GetTargetFromFrame();
|
already_AddRefed<nsIContent> GetTargetFromFrame();
|
||||||
|
|
||||||
nsEvent* mEvent;
|
nsEvent* mEvent;
|
||||||
|
@ -6,6 +6,7 @@ DEPTH = ../..
|
|||||||
topsrcdir = @top_srcdir@
|
topsrcdir = @top_srcdir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
|
FAIL_ON_WARNINGS := 1
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ DEPTH = ../../..
|
|||||||
topsrcdir = @top_srcdir@
|
topsrcdir = @top_srcdir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
|
FAIL_ON_WARNINGS := 1
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ DEPTH = ../../..
|
|||||||
topsrcdir = @top_srcdir@
|
topsrcdir = @top_srcdir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
|
FAIL_ON_WARNINGS := 1
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ DEPTH = ../../..
|
|||||||
topsrcdir = @top_srcdir@
|
topsrcdir = @top_srcdir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
|
FAIL_ON_WARNINGS := 1
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ DEPTH = ../../..
|
|||||||
topsrcdir = @top_srcdir@
|
topsrcdir = @top_srcdir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
|
FAIL_ON_WARNINGS := 1
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ DEPTH = ../../..
|
|||||||
topsrcdir = @top_srcdir@
|
topsrcdir = @top_srcdir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
|
FAIL_ON_WARNINGS := 1
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ DOMSVGLengthList::InsertItemBefore(nsIDOMSVGLength *newItem,
|
|||||||
if (mAList->IsAnimating()) {
|
if (mAList->IsAnimating()) {
|
||||||
Element()->AnimationNeedsResample();
|
Element()->AnimationNeedsResample();
|
||||||
}
|
}
|
||||||
*_retval = domItem.forget().get();
|
domItem.forget(_retval);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ DOMSVGNumberList::InsertItemBefore(nsIDOMSVGNumber *newItem,
|
|||||||
if (mAList->IsAnimating()) {
|
if (mAList->IsAnimating()) {
|
||||||
Element()->AnimationNeedsResample();
|
Element()->AnimationNeedsResample();
|
||||||
}
|
}
|
||||||
*_retval = domItem.forget().get();
|
domItem.forget(_retval);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,7 +384,7 @@ DOMSVGPathSegList::InsertItemBefore(nsIDOMSVGPathSeg *aNewItem,
|
|||||||
if (AttrIsAnimating()) {
|
if (AttrIsAnimating()) {
|
||||||
Element()->AnimationNeedsResample();
|
Element()->AnimationNeedsResample();
|
||||||
}
|
}
|
||||||
*_retval = domItem.forget().get();
|
domItem.forget(_retval);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ DOMSVGPointList::InsertItemBefore(nsIDOMSVGPoint *aNewItem,
|
|||||||
if (AttrIsAnimating()) {
|
if (AttrIsAnimating()) {
|
||||||
Element()->AnimationNeedsResample();
|
Element()->AnimationNeedsResample();
|
||||||
}
|
}
|
||||||
*_retval = domItem.forget().get();
|
domItem.forget(_retval);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ DOMSVGTransformList::InsertItemBefore(nsIDOMSVGTransform *newItem,
|
|||||||
if (mAList->IsAnimating()) {
|
if (mAList->IsAnimating()) {
|
||||||
Element()->AnimationNeedsResample();
|
Element()->AnimationNeedsResample();
|
||||||
}
|
}
|
||||||
*_retval = domItem.forget().get();
|
domItem.forget(_retval);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -588,8 +588,6 @@ NS_NewSVG##_elementName##Element(nsIContent **aResult, \
|
|||||||
{ \
|
{ \
|
||||||
nsRefPtr<nsSVG##_elementName##Element> it = \
|
nsRefPtr<nsSVG##_elementName##Element> it = \
|
||||||
new nsSVG##_elementName##Element(aNodeInfo); \
|
new nsSVG##_elementName##Element(aNodeInfo); \
|
||||||
if (!it) \
|
|
||||||
return NS_ERROR_OUT_OF_MEMORY; \
|
|
||||||
\
|
\
|
||||||
nsresult rv = it->Init(); \
|
nsresult rv = it->Init(); \
|
||||||
\
|
\
|
||||||
@ -597,7 +595,7 @@ NS_NewSVG##_elementName##Element(nsIContent **aResult, \
|
|||||||
return rv; \
|
return rv; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
*aResult = it.forget().get(); \
|
it.forget(aResult); \
|
||||||
\
|
\
|
||||||
return rv; \
|
return rv; \
|
||||||
}
|
}
|
||||||
@ -610,8 +608,6 @@ NS_NewSVG##_elementName##Element(nsIContent **aResult, \
|
|||||||
{ \
|
{ \
|
||||||
nsRefPtr<nsSVG##_elementName##Element> it = \
|
nsRefPtr<nsSVG##_elementName##Element> it = \
|
||||||
new nsSVG##_elementName##Element(aNodeInfo, aFromParser); \
|
new nsSVG##_elementName##Element(aNodeInfo, aFromParser); \
|
||||||
if (!it) \
|
|
||||||
return NS_ERROR_OUT_OF_MEMORY; \
|
|
||||||
\
|
\
|
||||||
nsresult rv = it->Init(); \
|
nsresult rv = it->Init(); \
|
||||||
\
|
\
|
||||||
@ -619,7 +615,7 @@ NS_NewSVG##_elementName##Element(nsIContent **aResult, \
|
|||||||
return rv; \
|
return rv; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
*aResult = it.forget().get(); \
|
it.forget(aResult); \
|
||||||
\
|
\
|
||||||
return rv; \
|
return rv; \
|
||||||
}
|
}
|
||||||
|
@ -472,7 +472,7 @@ NS_ScriptErrorReporter(JSContext *cx,
|
|||||||
const PRUnichar* m = static_cast<const PRUnichar*>(report->ucmessage);
|
const PRUnichar* m = static_cast<const PRUnichar*>(report->ucmessage);
|
||||||
if (m) {
|
if (m) {
|
||||||
const PRUnichar* n = static_cast<const PRUnichar*>
|
const PRUnichar* n = static_cast<const PRUnichar*>
|
||||||
(js::GetErrorTypeNameFromNumber(cx, report->errorNumber));
|
(js::GetErrorTypeName(cx, report->exnType));
|
||||||
if (n) {
|
if (n) {
|
||||||
msg.Assign(n);
|
msg.Assign(n);
|
||||||
msg.AppendLiteral(": ");
|
msg.AppendLiteral(": ");
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include "BindingUtils.h"
|
#include "BindingUtils.h"
|
||||||
|
|
||||||
#include "xpcprivate.h"
|
#include "xpcprivate.h"
|
||||||
@ -12,6 +14,32 @@
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
|
JSErrorFormatString ErrorFormatString[] = {
|
||||||
|
#define MSG_DEF(_name, _argc, _str) \
|
||||||
|
{ _str, _argc, JSEXN_TYPEERR },
|
||||||
|
#include "mozilla/dom/Errors.msg"
|
||||||
|
#undef MSG_DEF
|
||||||
|
};
|
||||||
|
|
||||||
|
const JSErrorFormatString*
|
||||||
|
GetErrorMessage(void* aUserRef, const char* aLocale,
|
||||||
|
const unsigned aErrorNumber)
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(aErrorNumber < ArrayLength(ErrorFormatString));
|
||||||
|
return &ErrorFormatString[aErrorNumber];
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ThrowErrorMessage(JSContext* aCx, const ErrNum aErrorNumber, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
va_start(ap, aErrorNumber);
|
||||||
|
JS_ReportErrorNumberVA(aCx, GetErrorMessage, NULL,
|
||||||
|
static_cast<const unsigned>(aErrorNumber), ap);
|
||||||
|
va_end(ap);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
DefineConstants(JSContext* cx, JSObject* obj, ConstantSpec* cs)
|
DefineConstants(JSContext* cx, JSObject* obj, ConstantSpec* cs)
|
||||||
{
|
{
|
||||||
|
@ -29,6 +29,17 @@ class nsGlobalWindow;
|
|||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
|
enum ErrNum {
|
||||||
|
#define MSG_DEF(_name, _argc, _str) \
|
||||||
|
_name,
|
||||||
|
#include "mozilla/dom/Errors.msg"
|
||||||
|
#undef MSG_DEF
|
||||||
|
Err_Limit
|
||||||
|
};
|
||||||
|
|
||||||
|
bool
|
||||||
|
ThrowErrorMessage(JSContext* aCx, const ErrNum aErrorNumber, ...);
|
||||||
|
|
||||||
template<bool mainThread>
|
template<bool mainThread>
|
||||||
inline bool
|
inline bool
|
||||||
Throw(JSContext* cx, nsresult rv)
|
Throw(JSContext* cx, nsresult rv)
|
||||||
@ -414,8 +425,38 @@ struct EnumEntry {
|
|||||||
size_t length;
|
size_t length;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<bool Fatal>
|
||||||
|
inline bool
|
||||||
|
EnumValueNotFound(JSContext* cx, const jschar* chars, size_t length,
|
||||||
|
const char* type)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline bool
|
||||||
|
EnumValueNotFound<false>(JSContext* cx, const jschar* chars, size_t length,
|
||||||
|
const char* type)
|
||||||
|
{
|
||||||
|
// TODO: Log a warning to the console.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
inline bool
|
||||||
|
EnumValueNotFound<true>(JSContext* cx, const jschar* chars, size_t length,
|
||||||
|
const char* type)
|
||||||
|
{
|
||||||
|
NS_LossyConvertUTF16toASCII deflated(static_cast<const PRUnichar*>(chars),
|
||||||
|
length);
|
||||||
|
return ThrowErrorMessage(cx, MSG_INVALID_ENUM_VALUE, deflated.get(), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<bool InvalidValueFatal>
|
||||||
inline int
|
inline int
|
||||||
FindEnumStringIndex(JSContext* cx, JS::Value v, const EnumEntry* values, bool* ok)
|
FindEnumStringIndex(JSContext* cx, JS::Value v, const EnumEntry* values,
|
||||||
|
const char* type, bool* ok)
|
||||||
{
|
{
|
||||||
// JS_StringEqualsAscii is slow as molasses, so don't use it here.
|
// JS_StringEqualsAscii is slow as molasses, so don't use it here.
|
||||||
JSString* str = JS_ValueToString(cx, v);
|
JSString* str = JS_ValueToString(cx, v);
|
||||||
@ -451,7 +492,7 @@ FindEnumStringIndex(JSContext* cx, JS::Value v, const EnumEntry* values, bool* o
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*ok = true;
|
*ok = EnumValueNotFound<InvalidValueFatal>(cx, chars, length, type);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2006,20 +2006,27 @@ for (uint32_t i = 0; i < length; ++i) {
|
|||||||
raise TypeError("We don't support nullable enumerated arguments "
|
raise TypeError("We don't support nullable enumerated arguments "
|
||||||
"yet")
|
"yet")
|
||||||
enum = type.inner.identifier.name
|
enum = type.inner.identifier.name
|
||||||
|
if invalidEnumValueFatal:
|
||||||
|
handleInvalidEnumValueCode = " MOZ_ASSERT(index >= 0);\n"
|
||||||
|
else:
|
||||||
|
handleInvalidEnumValueCode = (
|
||||||
|
" if (index < 0) {\n"
|
||||||
|
" return true;\n"
|
||||||
|
" }\n")
|
||||||
|
|
||||||
return (
|
return (
|
||||||
"{\n"
|
"{\n"
|
||||||
" bool ok;\n"
|
" bool ok;\n"
|
||||||
" int index = FindEnumStringIndex(cx, ${val}, %(values)s, &ok);\n"
|
" int index = FindEnumStringIndex<%(invalidEnumValueFatal)s>(cx, ${val}, %(values)s, \"%(enumtype)s\", &ok);\n"
|
||||||
" if (!ok) {\n"
|
" if (!ok) {\n"
|
||||||
" return false;\n"
|
" return false;\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
" if (index < 0) {\n"
|
"%(handleInvalidEnumValueCode)s"
|
||||||
" return %(failureCode)s;\n"
|
|
||||||
" }\n"
|
|
||||||
" ${declName} = static_cast<%(enumtype)s>(index);\n"
|
" ${declName} = static_cast<%(enumtype)s>(index);\n"
|
||||||
"}" % { "enumtype" : enum,
|
"}" % { "enumtype" : enum,
|
||||||
"values" : enum + "Values::strings",
|
"values" : enum + "Values::strings",
|
||||||
"failureCode" : "Throw<false>(cx, NS_ERROR_XPC_BAD_CONVERT_JS)" if invalidEnumValueFatal else "true" },
|
"invalidEnumValueFatal" : toStringBool(invalidEnumValueFatal),
|
||||||
|
"handleInvalidEnumValueCode" : handleInvalidEnumValueCode },
|
||||||
CGGeneric(enum), None, isOptional)
|
CGGeneric(enum), None, isOptional)
|
||||||
|
|
||||||
if type.isCallback():
|
if type.isCallback():
|
||||||
@ -2762,6 +2769,8 @@ class CGMethodCall(CGThing):
|
|||||||
def __init__(self, argsPre, nativeMethodName, static, descriptor, method):
|
def __init__(self, argsPre, nativeMethodName, static, descriptor, method):
|
||||||
CGThing.__init__(self)
|
CGThing.__init__(self)
|
||||||
|
|
||||||
|
methodName = '"%s.%s"' % (descriptor.interface.identifier.name, method.identifier.name)
|
||||||
|
|
||||||
def requiredArgCount(signature):
|
def requiredArgCount(signature):
|
||||||
arguments = signature[1]
|
arguments = signature[1]
|
||||||
if len(arguments) == 0:
|
if len(arguments) == 0:
|
||||||
@ -2785,18 +2794,15 @@ class CGMethodCall(CGThing):
|
|||||||
signature = signatures[0]
|
signature = signatures[0]
|
||||||
self.cgRoot = CGList([ CGIndenter(getPerSignatureCall(signature)) ])
|
self.cgRoot = CGList([ CGIndenter(getPerSignatureCall(signature)) ])
|
||||||
requiredArgs = requiredArgCount(signature)
|
requiredArgs = requiredArgCount(signature)
|
||||||
|
|
||||||
|
|
||||||
if requiredArgs > 0:
|
if requiredArgs > 0:
|
||||||
|
code = (
|
||||||
|
"if (argc < %d) {\n"
|
||||||
|
" return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, %s);\n"
|
||||||
|
"}" % (requiredArgs, methodName))
|
||||||
self.cgRoot.prepend(
|
self.cgRoot.prepend(
|
||||||
CGWrapper(
|
CGWrapper(CGIndenter(CGGeneric(code)), pre="\n", post="\n"))
|
||||||
CGIndenter(
|
|
||||||
CGGeneric(
|
|
||||||
"if (argc < %d) {\n"
|
|
||||||
" return Throw<%s>(cx, NS_ERROR_XPC_NOT_ENOUGH_ARGS);\n"
|
|
||||||
"}" % (requiredArgs,
|
|
||||||
toStringBool(not descriptor.workers)))
|
|
||||||
),
|
|
||||||
pre="\n", post="\n")
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# Need to find the right overload
|
# Need to find the right overload
|
||||||
@ -2978,11 +2984,10 @@ class CGMethodCall(CGThing):
|
|||||||
overloadCGThings.append(
|
overloadCGThings.append(
|
||||||
CGSwitch("argcount",
|
CGSwitch("argcount",
|
||||||
argCountCases,
|
argCountCases,
|
||||||
CGGeneric("return Throw<%s>(cx, NS_ERROR_XPC_NOT_ENOUGH_ARGS);" %
|
CGGeneric("return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, %s);\n" % methodName)))
|
||||||
toStringBool(not descriptor.workers))))
|
|
||||||
overloadCGThings.append(
|
overloadCGThings.append(
|
||||||
CGGeneric('MOZ_NOT_REACHED("We have an always-returning default case");\n'
|
CGGeneric('MOZ_NOT_REACHED("We have an always-returning default case");\n'
|
||||||
'return false;'))
|
'return false;'))
|
||||||
self.cgRoot = CGWrapper(CGIndenter(CGList(overloadCGThings, "\n")),
|
self.cgRoot = CGWrapper(CGIndenter(CGList(overloadCGThings, "\n")),
|
||||||
pre="\n")
|
pre="\n")
|
||||||
|
|
||||||
|
23
dom/bindings/Errors.msg
Normal file
23
dom/bindings/Errors.msg
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The format for each error message is:
|
||||||
|
*
|
||||||
|
* MSG_DEF(<SYMBOLIC_NAME>, <ARGUMENT_COUNT>, <FORMAT_STRING>)
|
||||||
|
*
|
||||||
|
* where
|
||||||
|
*
|
||||||
|
* <SYMBOLIC_NAME> is a legal C++ identifer that will be used in the source.
|
||||||
|
*
|
||||||
|
* <ARGUMENT_COUNT> is an integer literal specifying the total number of
|
||||||
|
* replaceable arguments in the following format string.
|
||||||
|
*
|
||||||
|
* <FORMAT_STRING> is a string literal, containing <ARGUMENT_COUNT> sequences
|
||||||
|
* {X} where X is an integer representing the argument number that will
|
||||||
|
* be replaced with a string value when the error is reported.
|
||||||
|
*/
|
||||||
|
|
||||||
|
MSG_DEF(MSG_INVALID_ENUM_VALUE, 2, "Value '{0}' is not a valid value for enumeration '{1}'.")
|
||||||
|
MSG_DEF(MSG_MISSING_ARGUMENTS, 1, "Not enough arguments to {0}.")
|
@ -63,6 +63,7 @@ EXPORTS_mozilla = \
|
|||||||
|
|
||||||
EXPORTS_$(binding_include_path) = \
|
EXPORTS_$(binding_include_path) = \
|
||||||
DOMJSClass.h \
|
DOMJSClass.h \
|
||||||
|
Errors.msg \
|
||||||
PrototypeList.h \
|
PrototypeList.h \
|
||||||
RegisterBindings.h \
|
RegisterBindings.h \
|
||||||
Nullable.h \
|
Nullable.h \
|
||||||
@ -156,4 +157,4 @@ GARBAGE += \
|
|||||||
# don't have issues with .cpp files being compiled before we've generated the
|
# don't have issues with .cpp files being compiled before we've generated the
|
||||||
# headers they depend on. This is really only needed for the test files, since
|
# headers they depend on. This is really only needed for the test files, since
|
||||||
# the non-test headers are all exported above anyway.
|
# the non-test headers are all exported above anyway.
|
||||||
export:: $(binding_header_files)
|
export:: $(binding_header_files)
|
||||||
|
@ -49,6 +49,18 @@ Source; Usage and purpose; License
|
|||||||
use with outstanding changes in either directory.
|
use with outstanding changes in either directory.
|
||||||
MPL
|
MPL
|
||||||
|
|
||||||
|
* parseFailures.py
|
||||||
|
Parses failures out of a mochitest log and writes out JSON files and Makefiles
|
||||||
|
into the correct failures/ folder.
|
||||||
|
The mochitest log should be produced by setting the 'dumpFailures' flag in
|
||||||
|
testharnessreport.js; this will print out the encountered failures, marked
|
||||||
|
by @ signs.
|
||||||
|
MPL
|
||||||
|
|
||||||
|
* writeMakefile.py
|
||||||
|
Helper functions to write out Makefiles.
|
||||||
|
MPL
|
||||||
|
|
||||||
* Makefile.in
|
* Makefile.in
|
||||||
Integration with our build system. Installs support files into /resources and
|
Integration with our build system. Installs support files into /resources and
|
||||||
includes a .mk file for each repository.
|
includes a .mk file for each repository.
|
||||||
|
@ -14,13 +14,12 @@ DIRS = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
MOCHITEST_FILES = \
|
_FILES = \
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
MOCHITEST_FILES += \
|
|
||||||
implementation.js \
|
implementation.js \
|
||||||
tests.js \
|
tests.js \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
libs:: $(_FILES)
|
||||||
|
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||||
|
@ -11,14 +11,13 @@ DIRS = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
MOCHITEST_FILES = \
|
_FILES = \
|
||||||
test_runtest.html \
|
test_runtest.html \
|
||||||
test_event.html \
|
test_event.html \
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
MOCHITEST_FILES += \
|
|
||||||
data.js \
|
data.js \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
libs:: $(_FILES)
|
||||||
|
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||||
|
@ -11,12 +11,11 @@ DIRS = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
MOCHITEST_FILES = \
|
_FILES = \
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
MOCHITEST_FILES += \
|
|
||||||
reset.css \
|
reset.css \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
libs:: $(_FILES)
|
||||||
|
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||||
|
@ -11,8 +11,9 @@ DIRS = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
MOCHITEST_FILES = \
|
_FILES = \
|
||||||
test_addRange.html \
|
test_addRange.html \
|
||||||
test_collapse.html \
|
test_collapse.html \
|
||||||
test_collapseToStartEnd.html \
|
test_collapseToStartEnd.html \
|
||||||
@ -25,11 +26,9 @@ MOCHITEST_FILES = \
|
|||||||
test_isCollapsed.html \
|
test_isCollapsed.html \
|
||||||
test_removeAllRanges.html \
|
test_removeAllRanges.html \
|
||||||
test_selectAllChildren.html \
|
test_selectAllChildren.html \
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
MOCHITEST_FILES += \
|
|
||||||
common.js \
|
common.js \
|
||||||
test-iframe.html \
|
test-iframe.html \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
libs:: $(_FILES)
|
||||||
|
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -378,7 +378,6 @@
|
|||||||
"Range interface: attribute endOffset": true,
|
"Range interface: attribute endOffset": true,
|
||||||
"Range interface: attribute collapsed": true,
|
"Range interface: attribute collapsed": true,
|
||||||
"Range interface: attribute commonAncestorContainer": true,
|
"Range interface: attribute commonAncestorContainer": true,
|
||||||
"Range interface: operation intersectsNode(Node)": true,
|
|
||||||
"Range interface: calling setStart(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError": true,
|
"Range interface: calling setStart(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError": true,
|
||||||
"Range interface: calling setEnd(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError": true,
|
"Range interface: calling setEnd(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError": true,
|
||||||
"Range interface: calling setStartBefore(Node) on document.createRange() with too few arguments must throw TypeError": true,
|
"Range interface: calling setStartBefore(Node) on document.createRange() with too few arguments must throw TypeError": true,
|
||||||
@ -393,7 +392,6 @@
|
|||||||
"Range interface: calling surroundContents(Node) on document.createRange() with too few arguments must throw TypeError": true,
|
"Range interface: calling surroundContents(Node) on document.createRange() with too few arguments must throw TypeError": true,
|
||||||
"Range interface: calling isPointInRange(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError": true,
|
"Range interface: calling isPointInRange(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError": true,
|
||||||
"Range interface: calling comparePoint(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError": true,
|
"Range interface: calling comparePoint(Node,unsigned long) on document.createRange() with too few arguments must throw TypeError": true,
|
||||||
"Range interface: document.createRange() must inherit property \"intersectsNode\" with the proper type (29)": true,
|
|
||||||
"Range interface: calling intersectsNode(Node) on document.createRange() with too few arguments must throw TypeError": true,
|
"Range interface: calling intersectsNode(Node) on document.createRange() with too few arguments must throw TypeError": true,
|
||||||
"Range interface: calling setStart(Node,unsigned long) on detachedRange with too few arguments must throw TypeError": true,
|
"Range interface: calling setStart(Node,unsigned long) on detachedRange with too few arguments must throw TypeError": true,
|
||||||
"Range interface: calling setEnd(Node,unsigned long) on detachedRange with too few arguments must throw TypeError": true,
|
"Range interface: calling setEnd(Node,unsigned long) on detachedRange with too few arguments must throw TypeError": true,
|
||||||
@ -409,7 +407,6 @@
|
|||||||
"Range interface: calling surroundContents(Node) on detachedRange with too few arguments must throw TypeError": true,
|
"Range interface: calling surroundContents(Node) on detachedRange with too few arguments must throw TypeError": true,
|
||||||
"Range interface: calling isPointInRange(Node,unsigned long) on detachedRange with too few arguments must throw TypeError": true,
|
"Range interface: calling isPointInRange(Node,unsigned long) on detachedRange with too few arguments must throw TypeError": true,
|
||||||
"Range interface: calling comparePoint(Node,unsigned long) on detachedRange with too few arguments must throw TypeError": true,
|
"Range interface: calling comparePoint(Node,unsigned long) on detachedRange with too few arguments must throw TypeError": true,
|
||||||
"Range interface: detachedRange must inherit property \"intersectsNode\" with the proper type (29)": true,
|
|
||||||
"Range interface: calling intersectsNode(Node) on detachedRange with too few arguments must throw TypeError": true,
|
"Range interface: calling intersectsNode(Node) on detachedRange with too few arguments must throw TypeError": true,
|
||||||
"NodeIterator interface: existence and properties of interface object": true,
|
"NodeIterator interface: existence and properties of interface object": true,
|
||||||
"NodeIterator interface: existence and properties of interface prototype object": true,
|
"NodeIterator interface: existence and properties of interface prototype object": true,
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
{
|
{
|
||||||
"XMLHttpRequest interface constructor": true,
|
"XMLHttpRequest interface constructor": true,
|
||||||
"XMLHttpRequest interface: calling open(DOMString,DOMString,boolean,DOMString,DOMString) on new XMLHttpRequest() with too few arguments must throw TypeError": true,
|
|
||||||
"XMLHttpRequest interface: calling setRequestHeader(DOMString,DOMString) on new XMLHttpRequest() with too few arguments must throw TypeError": true,
|
|
||||||
"XMLHttpRequest interface: calling getResponseHeader(DOMString) on new XMLHttpRequest() with too few arguments must throw TypeError": true,
|
|
||||||
"XMLHttpRequest interface: calling overrideMimeType(DOMString) on new XMLHttpRequest() with too few arguments must throw TypeError": true,
|
|
||||||
"FormData interface: existence and properties of interface object": true,
|
"FormData interface: existence and properties of interface object": true,
|
||||||
"FormData interface constructor": true,
|
"FormData interface constructor": true,
|
||||||
"FormData interface: existence and properties of interface prototype object": true,
|
"FormData interface: existence and properties of interface prototype object": true,
|
||||||
|
@ -11,8 +11,9 @@ DIRS = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
MOCHITEST_FILES = \
|
_FILES = \
|
||||||
test_body-onload.html \
|
test_body-onload.html \
|
||||||
test_pageload-image.html \
|
test_pageload-image.html \
|
||||||
test_pageload-video.html \
|
test_pageload-video.html \
|
||||||
@ -20,10 +21,8 @@ MOCHITEST_FILES = \
|
|||||||
test_window-onerror-parse-error.html \
|
test_window-onerror-parse-error.html \
|
||||||
test_window-onerror-runtime-error.html \
|
test_window-onerror-runtime-error.html \
|
||||||
test_window-onerror-runtime-error-throw.html \
|
test_window-onerror-runtime-error-throw.html \
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
MOCHITEST_FILES += \
|
|
||||||
nested-document-write-external.js \
|
nested-document-write-external.js \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
libs:: $(_FILES)
|
||||||
|
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||||
|
@ -11,12 +11,11 @@ DIRS = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
MOCHITEST_FILES = \
|
_FILES = \
|
||||||
test_001.html \
|
test_001.html \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
MOCHITEST_FILES += \
|
libs:: $(_FILES)
|
||||||
$(NULL)
|
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
|
||||||
|
@ -17,6 +17,7 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
import parseManifest
|
import parseManifest
|
||||||
|
import writeMakefile
|
||||||
|
|
||||||
def parseManifestFile(dest, dir):
|
def parseManifestFile(dest, dir):
|
||||||
subdirs, mochitests, _, __, supportfiles = parseManifest.parseManifestFile("hg-%s/%s/MANIFEST" % (dest, dir))
|
subdirs, mochitests, _, __, supportfiles = parseManifest.parseManifestFile("hg-%s/%s/MANIFEST" % (dest, dir))
|
||||||
@ -77,11 +78,6 @@ def copy(thissrcdir, dest, directories):
|
|||||||
# Empty directory, i.e., the repository root
|
# Empty directory, i.e., the repository root
|
||||||
importDirs(thissrcdir, dest, subdirs)
|
importDirs(thissrcdir, dest, subdirs)
|
||||||
|
|
||||||
def makefileString(entries):
|
|
||||||
if not len(entries):
|
|
||||||
return " $(NULL)"
|
|
||||||
return "\n".join([" %s \\" % (entry, ) for entry in entries]) + "\n $(NULL)"
|
|
||||||
|
|
||||||
def printMakefile(dest, directories):
|
def printMakefile(dest, directories):
|
||||||
"""Create a .mk file to be included into the main Makefile.in, which lists the
|
"""Create a .mk file to be included into the main Makefile.in, which lists the
|
||||||
directories with tests.
|
directories with tests.
|
||||||
@ -90,37 +86,11 @@ def printMakefile(dest, directories):
|
|||||||
path = dest + ".mk"
|
path = dest + ".mk"
|
||||||
fp = open(path, "wb")
|
fp = open(path, "wb")
|
||||||
fp.write("DIRS += \\\n")
|
fp.write("DIRS += \\\n")
|
||||||
fp.write(makefileString([makePath(dest, d) for d in directories]))
|
fp.write(writeMakefile.makefileString([makePath(dest, d) for d in directories]))
|
||||||
fp.write("\n")
|
fp.write("\n")
|
||||||
fp.close()
|
fp.close()
|
||||||
subprocess.check_call(["hg", "add", path])
|
subprocess.check_call(["hg", "add", path])
|
||||||
|
|
||||||
makefileTemplate = """# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
|
|
||||||
|
|
||||||
DEPTH = ${depth}
|
|
||||||
|
|
||||||
topsrcdir = @top_srcdir@
|
|
||||||
srcdir = @srcdir@
|
|
||||||
VPATH = @srcdir@
|
|
||||||
relativesrcdir = ${relativesrcdir}
|
|
||||||
|
|
||||||
DIRS = \\
|
|
||||||
${dirs}
|
|
||||||
|
|
||||||
include $$(DEPTH)/config/autoconf.mk
|
|
||||||
include $$(topsrcdir)/config/rules.mk
|
|
||||||
"""
|
|
||||||
testsTemplate = """
|
|
||||||
_TESTS = \\
|
|
||||||
${tests}
|
|
||||||
|
|
||||||
_TESTS += \\
|
|
||||||
${support}
|
|
||||||
|
|
||||||
libs:: $$(_TESTS)
|
|
||||||
\t$$(INSTALL) $$(foreach f,$$^,"$$f") $$(DEPTH)/_tests/testing/mochitest/tests/$$(relativesrcdir)
|
|
||||||
"""
|
|
||||||
|
|
||||||
def printMakefiles(thissrcdir, dest, directories):
|
def printMakefiles(thissrcdir, dest, directories):
|
||||||
"""Create Makefile.in files for each directory that contains tests we import.
|
"""Create Makefile.in files for each directory that contains tests we import.
|
||||||
"""
|
"""
|
||||||
@ -131,24 +101,17 @@ def printMakefiles(thissrcdir, dest, directories):
|
|||||||
else:
|
else:
|
||||||
# Empty directory, i.e., the repository root
|
# Empty directory, i.e., the repository root
|
||||||
path = dest
|
path = dest
|
||||||
abspath = "%s/%s" % (thissrcdir, path)
|
|
||||||
print "Creating Makefile.in in %s..." % (path, )
|
print "Creating Makefile.in in %s..." % (path, )
|
||||||
|
|
||||||
subdirs, mochitests, supportfiles = parseManifestFile(dest, d)
|
subdirs, mochitests, supportfiles = parseManifestFile(dest, d)
|
||||||
|
|
||||||
|
abspath = "%s/%s" % (thissrcdir, path)
|
||||||
|
files = ["test_%s" % (mochitest, ) for mochitest in mochitests]
|
||||||
|
files.extend(supportfiles)
|
||||||
|
|
||||||
|
result = writeMakefile.substMakefile("importTestsuite.py", abspath, subdirs, files)
|
||||||
|
|
||||||
fp = open(path + "/Makefile.in", "wb")
|
fp = open(path + "/Makefile.in", "wb")
|
||||||
result = string.Template(makefileTemplate).substitute({
|
|
||||||
"depth": "..%s" % ("/.." * abspath.count("/"), ),
|
|
||||||
"relativesrcdir": "%s/%s" % (thissrcdir, path),
|
|
||||||
"dirs": makefileString(subdirs)
|
|
||||||
})
|
|
||||||
|
|
||||||
if len(mochitests) + len(supportfiles):
|
|
||||||
result += string.Template(testsTemplate).substitute({
|
|
||||||
"tests": makefileString(["test_%s" % (mochitest, ) for mochitest in mochitests]),
|
|
||||||
"support": makefileString(supportfiles)
|
|
||||||
})
|
|
||||||
|
|
||||||
fp.write(result)
|
fp.write(result)
|
||||||
fp.close()
|
fp.close()
|
||||||
|
|
||||||
|
68
dom/imptests/parseFailures.py
Normal file
68
dom/imptests/parseFailures.py
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import writeMakefile
|
||||||
|
|
||||||
|
def extractLines(fp):
|
||||||
|
lines = []
|
||||||
|
watch = False
|
||||||
|
for line in fp:
|
||||||
|
if line == '@@@ @@@ Failures\n':
|
||||||
|
watch = True
|
||||||
|
elif watch:
|
||||||
|
watch = False
|
||||||
|
idx = line.index('@@@')
|
||||||
|
lines.append((line[:idx], line[idx + 3:]))
|
||||||
|
return lines
|
||||||
|
|
||||||
|
def ensuredir(path):
|
||||||
|
dir = path[:path.rfind('/')]
|
||||||
|
if not os.path.exists(dir):
|
||||||
|
os.makedirs(dir)
|
||||||
|
|
||||||
|
def dumpFailures(lines):
|
||||||
|
files = []
|
||||||
|
for url, objstr in lines:
|
||||||
|
if objstr == '{}\n':
|
||||||
|
continue
|
||||||
|
|
||||||
|
jsonpath = 'failures/' + url + '.json'
|
||||||
|
files.append(jsonpath)
|
||||||
|
ensuredir(jsonpath)
|
||||||
|
obj = json.loads(objstr)
|
||||||
|
formattedobj = json.dumps(obj, sort_keys=True, indent=2, separators=(',', ': '))
|
||||||
|
fp = open(jsonpath, 'w')
|
||||||
|
fp.write(formattedobj + '\n')
|
||||||
|
fp.close()
|
||||||
|
return files
|
||||||
|
|
||||||
|
def writeMakefiles(files):
|
||||||
|
pathmap = {}
|
||||||
|
for path in files:
|
||||||
|
dirp, leaf = path.rsplit('/', 1)
|
||||||
|
pathmap.setdefault(dirp, []).append(leaf)
|
||||||
|
|
||||||
|
for k, v in pathmap.iteritems():
|
||||||
|
result = writeMakefile.substMakefile('parseFailures.py', 'dom/imptests/' + k, [], v)
|
||||||
|
|
||||||
|
fp = open(k + '/Makefile.in', 'wb')
|
||||||
|
fp.write(result)
|
||||||
|
fp.close()
|
||||||
|
|
||||||
|
def main(logPath):
|
||||||
|
fp = open(logPath, 'rb')
|
||||||
|
lines = extractLines(fp)
|
||||||
|
fp.close()
|
||||||
|
|
||||||
|
files = dumpFailures(lines)
|
||||||
|
writeMakefiles(files)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
if len(sys.argv) < 2:
|
||||||
|
print "Please pass the path to the logfile from which failures should be extracted."
|
||||||
|
main(sys.argv[1])
|
@ -12,6 +12,17 @@ var W3CTest = {
|
|||||||
*/
|
*/
|
||||||
"expectedFailures": {},
|
"expectedFailures": {},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If set to true, we will dump the test failures to the console.
|
||||||
|
*/
|
||||||
|
"dumpFailures": false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If dumpFailures is true, this holds a structure like necessary for
|
||||||
|
* expectedFailures, for ease of updating the expectations.
|
||||||
|
*/
|
||||||
|
"failures": {},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of test results, needed by TestRunner to update the UI.
|
* List of test results, needed by TestRunner to update the UI.
|
||||||
*/
|
*/
|
||||||
@ -58,6 +69,17 @@ var W3CTest = {
|
|||||||
this.runner[(test.result === !test.todo) ? "log" : "error"](msg);
|
this.runner[(test.result === !test.todo) ? "log" : "error"](msg);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"_logCollapsedMessages": function() {
|
||||||
|
if (this.collapsedMessages) {
|
||||||
|
this._log({
|
||||||
|
"result": true,
|
||||||
|
"todo": false,
|
||||||
|
"message": "Elided " + this.collapsedMessages + " passes or known failures."
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.collapsedMessages = 0;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maybe logs a result, eliding up to MAX_COLLAPSED_MESSAGES consecutive
|
* Maybe logs a result, eliding up to MAX_COLLAPSED_MESSAGES consecutive
|
||||||
* passes.
|
* passes.
|
||||||
@ -67,14 +89,7 @@ var W3CTest = {
|
|||||||
if (success && ++this.collapsedMessages < this.MAX_COLLAPSED_MESSAGES) {
|
if (success && ++this.collapsedMessages < this.MAX_COLLAPSED_MESSAGES) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.collapsedMessages) {
|
this._logCollapsedMessages();
|
||||||
this._log({
|
|
||||||
"result": true,
|
|
||||||
"todo": false,
|
|
||||||
"message": "Elided " + this.collapsedMessages + " passes or known failures."
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.collapsedMessages = 0;
|
|
||||||
this._log(test);
|
this._log(test);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -113,6 +128,9 @@ var W3CTest = {
|
|||||||
"result": test.status === test.PASS,
|
"result": test.status === test.PASS,
|
||||||
"todo": this._todo(test)
|
"todo": this._todo(test)
|
||||||
});
|
});
|
||||||
|
if (this.dumpFailures && test.status !== test.PASS) {
|
||||||
|
this.failures[test.name] = true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -128,6 +146,13 @@ var W3CTest = {
|
|||||||
url in this.expectedFailures &&
|
url in this.expectedFailures &&
|
||||||
this.expectedFailures[url] === "error"
|
this.expectedFailures[url] === "error"
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this._logCollapsedMessages();
|
||||||
|
|
||||||
|
if (this.dumpFailures) {
|
||||||
|
dump("@@@ @@@ Failures\n");
|
||||||
|
dump(url + "@@@" + JSON.stringify(this.failures) + "\n");
|
||||||
|
}
|
||||||
this.runner.testFinished(this.tests);
|
this.runner.testFinished(this.tests);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -148,6 +173,7 @@ var W3CTest = {
|
|||||||
* from tests.
|
* from tests.
|
||||||
*/
|
*/
|
||||||
"timeout": function() {
|
"timeout": function() {
|
||||||
|
this.logFailure("Test runner timed us out.");
|
||||||
timeout();
|
timeout();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
DIRS += \
|
DIRS += \
|
||||||
webapps/DOMCore/tests/approved \
|
webapps/DOMCore/tests/approved \
|
||||||
webapps/DOMCore/tests/submissions/Opera \
|
webapps/DOMCore/tests/submissions/Opera \
|
||||||
webapps/XMLHttpRequest/tests/submissions/Ms2ger \
|
|
||||||
webapps/WebStorage/tests/submissions \
|
webapps/WebStorage/tests/submissions \
|
||||||
|
webapps/XMLHttpRequest/tests/submissions/Ms2ger \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
@ -11,8 +11,9 @@ DIRS = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
MOCHITEST_FILES = \
|
_FILES = \
|
||||||
test_interfaces.html \
|
test_interfaces.html \
|
||||||
test_Range-cloneContents.html \
|
test_Range-cloneContents.html \
|
||||||
test_Range-cloneRange.html \
|
test_Range-cloneRange.html \
|
||||||
@ -29,11 +30,9 @@ MOCHITEST_FILES = \
|
|||||||
test_Range-selectNode.html \
|
test_Range-selectNode.html \
|
||||||
test_Range-set.html \
|
test_Range-set.html \
|
||||||
test_Range-surroundContents.html \
|
test_Range-surroundContents.html \
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
MOCHITEST_FILES += \
|
|
||||||
common.js \
|
common.js \
|
||||||
Range-test-iframe.html \
|
Range-test-iframe.html \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
libs:: $(_FILES)
|
||||||
|
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||||
|
@ -11,8 +11,9 @@ DIRS = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
MOCHITEST_FILES = \
|
_FILES = \
|
||||||
test_getElementsByClassName-01.htm \
|
test_getElementsByClassName-01.htm \
|
||||||
test_getElementsByClassName-02.htm \
|
test_getElementsByClassName-02.htm \
|
||||||
test_getElementsByClassName-03.htm \
|
test_getElementsByClassName-03.htm \
|
||||||
@ -33,7 +34,5 @@ MOCHITEST_FILES = \
|
|||||||
test_getElementsByClassName-18.htm \
|
test_getElementsByClassName-18.htm \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
MOCHITEST_FILES += \
|
libs:: $(_FILES)
|
||||||
$(NULL)
|
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
|
||||||
|
@ -12,8 +12,9 @@ DIRS = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
MOCHITEST_FILES = \
|
_FILES = \
|
||||||
test_event_constructor.html \
|
test_event_constructor.html \
|
||||||
test_event_local_key.html \
|
test_event_local_key.html \
|
||||||
test_event_local_newvalue.html \
|
test_event_local_newvalue.html \
|
||||||
@ -42,7 +43,5 @@ MOCHITEST_FILES = \
|
|||||||
test_storage_session_setitem.html \
|
test_storage_session_setitem.html \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
MOCHITEST_FILES += \
|
libs:: $(_FILES)
|
||||||
$(NULL)
|
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
|
||||||
|
@ -11,11 +11,9 @@ DIRS = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
MOCHITEST_FILES = \
|
_FILES = \
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
MOCHITEST_FILES += \
|
|
||||||
local_change_item_iframe.html \
|
local_change_item_iframe.html \
|
||||||
local_security_iframe.html \
|
local_security_iframe.html \
|
||||||
local_set_item_clear_iframe.html \
|
local_set_item_clear_iframe.html \
|
||||||
@ -25,4 +23,5 @@ MOCHITEST_FILES += \
|
|||||||
session_set_item_iframe.html \
|
session_set_item_iframe.html \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
libs:: $(_FILES)
|
||||||
|
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||||
|
@ -11,8 +11,9 @@ DIRS = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
MOCHITEST_FILES = \
|
_FILES = \
|
||||||
test_event_constructor_js.html \
|
test_event_constructor_js.html \
|
||||||
test_missing_arguments.html \
|
test_missing_arguments.html \
|
||||||
test_storage_local_clear_js.html \
|
test_storage_local_clear_js.html \
|
||||||
@ -31,7 +32,5 @@ MOCHITEST_FILES = \
|
|||||||
test_storage_session_setitem_js.html \
|
test_storage_session_setitem_js.html \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
MOCHITEST_FILES += \
|
libs:: $(_FILES)
|
||||||
$(NULL)
|
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
|
||||||
|
@ -11,13 +11,12 @@ DIRS = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
MOCHITEST_FILES = \
|
_FILES = \
|
||||||
test_interfaces.html \
|
test_interfaces.html \
|
||||||
test_setrequestheader-invalid-arguments.htm \
|
test_setrequestheader-invalid-arguments.htm \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
MOCHITEST_FILES += \
|
libs:: $(_FILES)
|
||||||
$(NULL)
|
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
|
||||||
|
49
dom/imptests/writeMakefile.py
Normal file
49
dom/imptests/writeMakefile.py
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
import string
|
||||||
|
|
||||||
|
makefileTemplate = """# THIS FILE IS AUTOGENERATED BY ${caller} - DO NOT EDIT
|
||||||
|
|
||||||
|
DEPTH = ${depth}
|
||||||
|
|
||||||
|
topsrcdir = @top_srcdir@
|
||||||
|
srcdir = @srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
relativesrcdir = ${relativesrcdir}
|
||||||
|
|
||||||
|
DIRS = \\
|
||||||
|
${dirs}
|
||||||
|
|
||||||
|
include $$(DEPTH)/config/autoconf.mk
|
||||||
|
include $$(topsrcdir)/config/rules.mk
|
||||||
|
"""
|
||||||
|
|
||||||
|
filesTemplate = """
|
||||||
|
_FILES = \\
|
||||||
|
${files}
|
||||||
|
|
||||||
|
libs:: $$(_FILES)
|
||||||
|
\t$$(INSTALL) $$(foreach f,$$^,"$$f") $$(DEPTH)/_tests/testing/mochitest/tests/$$(relativesrcdir)
|
||||||
|
"""
|
||||||
|
|
||||||
|
def makefileString(entries):
|
||||||
|
if not len(entries):
|
||||||
|
return " $(NULL)"
|
||||||
|
return "\n".join([" %s \\" % (entry, ) for entry in entries]) + "\n $(NULL)"
|
||||||
|
|
||||||
|
def substMakefile(caller, path, subdirs, files):
|
||||||
|
result = string.Template(makefileTemplate).substitute({
|
||||||
|
"caller": caller,
|
||||||
|
"depth": "..%s" % ("/.." * path.count("/"), ),
|
||||||
|
"relativesrcdir": path,
|
||||||
|
"dirs": makefileString(subdirs)
|
||||||
|
})
|
||||||
|
|
||||||
|
if files:
|
||||||
|
result += string.Template(filesTemplate).substitute({
|
||||||
|
"files": makefileString(files)
|
||||||
|
})
|
||||||
|
|
||||||
|
return result
|
@ -12,7 +12,7 @@
|
|||||||
* http://www.w3.org/TR/DOM-Level-2-Traversal-Range/
|
* http://www.w3.org/TR/DOM-Level-2-Traversal-Range/
|
||||||
*/
|
*/
|
||||||
|
|
||||||
[scriptable, builtinclass, uuid(a059eea8-fece-4c14-93d3-7f50a944ae43)]
|
[scriptable, builtinclass, uuid(1f94055c-42e7-4a30-96a1-6a804f1c2d1e)]
|
||||||
interface nsIDOMRange : nsISupports
|
interface nsIDOMRange : nsISupports
|
||||||
{
|
{
|
||||||
readonly attribute nsIDOMNode startContainer;
|
readonly attribute nsIDOMNode startContainer;
|
||||||
@ -65,6 +65,11 @@ interface nsIDOMRange : nsISupports
|
|||||||
// Sort of a strcmp for ranges.
|
// Sort of a strcmp for ranges.
|
||||||
short comparePoint(in nsIDOMNode parent, in long offset);
|
short comparePoint(in nsIDOMNode parent, in long offset);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the range intersects node.
|
||||||
|
*/
|
||||||
|
boolean intersectsNode(in nsIDOMNode node);
|
||||||
|
|
||||||
// These methods come from
|
// These methods come from
|
||||||
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-range-interface
|
// http://dev.w3.org/csswg/cssom-view/#extensions-to-the-range-interface
|
||||||
nsIDOMClientRectList getClientRects();
|
nsIDOMClientRectList getClientRects();
|
||||||
|
@ -1,28 +1,25 @@
|
|||||||
#
|
|
||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
DEPTH = ../../..
|
DEPTH := ../../..
|
||||||
topsrcdir = @top_srcdir@
|
topsrcdir := @top_srcdir@
|
||||||
srcdir = @srcdir@
|
srcdir := @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH := @srcdir@
|
||||||
relativesrcdir = dom/tests/browser
|
relativesrcdir := dom/tests/browser
|
||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
|
MOCHITEST_BROWSER_FILES := \
|
||||||
|
browser_focus_steal_from_chrome.js \
|
||||||
|
browser_focus_steal_from_chrome_during_mousedown.js \
|
||||||
|
browser_autofocus_background.js \
|
||||||
|
browser_ConsoleAPITests.js \
|
||||||
|
test-console-api.html \
|
||||||
|
browser_ConsoleStorageAPITests.js \
|
||||||
|
browser_ConsoleStoragePBTest.js \
|
||||||
|
browser_autofocus_preference.js \
|
||||||
|
browser_bug396843.js \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
_BROWSER_FILES = \
|
|
||||||
browser_focus_steal_from_chrome.js \
|
|
||||||
browser_focus_steal_from_chrome_during_mousedown.js \
|
|
||||||
browser_autofocus_background.js \
|
|
||||||
browser_ConsoleAPITests.js \
|
|
||||||
test-console-api.html \
|
|
||||||
browser_ConsoleStorageAPITests.js \
|
|
||||||
browser_ConsoleStoragePBTest.js \
|
|
||||||
browser_autofocus_preference.js \
|
|
||||||
browser_bug396843.js \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
libs:: $(_BROWSER_FILES)
|
|
||||||
$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
|
|
||||||
|
@ -318,6 +318,44 @@ var WifiManager = (function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getConnectionInfoGB(callback) {
|
||||||
|
var rval = {};
|
||||||
|
getRssiApproxCommand(function(rssi) {
|
||||||
|
rval.rssi = rssi;
|
||||||
|
getLinkSpeedCommand(function(linkspeed) {
|
||||||
|
rval.linkspeed = linkspeed;
|
||||||
|
callback(rval);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getConnectionInfoICS(callback) {
|
||||||
|
doStringCommand("SIGNAL_POLL", function(reply) {
|
||||||
|
if (!reply) {
|
||||||
|
callback(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let rval = {};
|
||||||
|
var lines = reply.split("\n");
|
||||||
|
for (let i = 0; i < lines.length; ++i) {
|
||||||
|
let [key, value] = lines[i].split("=");
|
||||||
|
switch (key.toUpperCase()) {
|
||||||
|
case "RSSI":
|
||||||
|
rval.rssi = value | 0;
|
||||||
|
break;
|
||||||
|
case "LINKSPEED":
|
||||||
|
rval.linkspeed = value | 0;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// Ignore.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
callback(rval);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function getMacAddressCommand(callback) {
|
function getMacAddressCommand(callback) {
|
||||||
doStringCommand("DRIVER MACADDR", function(reply) {
|
doStringCommand("DRIVER MACADDR", function(reply) {
|
||||||
if (reply)
|
if (reply)
|
||||||
@ -1096,6 +1134,9 @@ var WifiManager = (function() {
|
|||||||
manager.getRssiApprox = getRssiApproxCommand;
|
manager.getRssiApprox = getRssiApproxCommand;
|
||||||
manager.getLinkSpeed = getLinkSpeedCommand;
|
manager.getLinkSpeed = getLinkSpeedCommand;
|
||||||
manager.getDhcpInfo = function() { return dhcpInfo; }
|
manager.getDhcpInfo = function() { return dhcpInfo; }
|
||||||
|
manager.getConnectionInfo = (sdkVersion >= 15)
|
||||||
|
? getConnectionInfoICS
|
||||||
|
: getConnectionInfoGB;
|
||||||
return manager;
|
return manager;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
@ -1591,8 +1632,9 @@ WifiWorker.prototype = {
|
|||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
function getConnectionInformation() {
|
function getConnectionInformation() {
|
||||||
WifiManager.getRssiApprox(function(rssi) {
|
WifiManager.getConnectionInfo(function(info) {
|
||||||
// See comments in calculateSignal for information about this.
|
// See comments in calculateSignal for information about this.
|
||||||
|
let { rssi, linkspeed } = info;
|
||||||
if (rssi > 0)
|
if (rssi > 0)
|
||||||
rssi -= 256;
|
rssi -= 256;
|
||||||
if (rssi <= MIN_RSSI)
|
if (rssi <= MIN_RSSI)
|
||||||
@ -1600,24 +1642,23 @@ WifiWorker.prototype = {
|
|||||||
else if (rssi >= MAX_RSSI)
|
else if (rssi >= MAX_RSSI)
|
||||||
rssi = MAX_RSSI;
|
rssi = MAX_RSSI;
|
||||||
|
|
||||||
WifiManager.getLinkSpeed(function(linkspeed) {
|
let info = { signalStrength: rssi,
|
||||||
let info = { signalStrength: rssi,
|
relSignalStrength: calculateSignal(rssi),
|
||||||
relSignalStrength: calculateSignal(rssi),
|
linkSpeed: linkspeed };
|
||||||
linkSpeed: linkspeed };
|
let last = self._lastConnectionInfo;
|
||||||
let last = self._lastConnectionInfo;
|
|
||||||
|
|
||||||
// Only fire the event if the link speed changed or the signal
|
// Only fire the event if the link speed changed or the signal
|
||||||
// strength changed by more than 10%.
|
// strength changed by more than 10%.
|
||||||
function tensPlace(percent) ((percent / 10) | 0)
|
function tensPlace(percent) ((percent / 10) | 0)
|
||||||
|
|
||||||
if (last && last.linkSpeed === info.linkSpeed &&
|
if (last && last.linkSpeed === info.linkSpeed &&
|
||||||
tensPlace(last.relSignalStrength) === tensPlace(info.relSignalStrength)) {
|
tensPlace(last.relSignalStrength) === tensPlace(info.relSignalStrength)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
self._lastConnectionInfo = info;
|
self._lastConnectionInfo = info;
|
||||||
self._fireEvent("connectionInfoUpdate", info);
|
debug("Firing connectionInfoUpdate: " + uneval(info));
|
||||||
});
|
self._fireEvent("connectionInfoUpdate", info);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6308,12 +6308,19 @@ JS_ReportErrorNumber(JSContext *cx, JSErrorCallback errorCallback,
|
|||||||
void *userRef, const unsigned errorNumber, ...)
|
void *userRef, const unsigned errorNumber, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
AssertHeapIsIdle(cx);
|
|
||||||
va_start(ap, errorNumber);
|
va_start(ap, errorNumber);
|
||||||
|
JS_ReportErrorNumberVA(cx, errorCallback, userRef, errorNumber, ap);
|
||||||
|
va_end(ap);
|
||||||
|
}
|
||||||
|
|
||||||
|
JS_PUBLIC_API(void)
|
||||||
|
JS_ReportErrorNumberVA(JSContext *cx, JSErrorCallback errorCallback,
|
||||||
|
void *userRef, const unsigned errorNumber,
|
||||||
|
va_list ap)
|
||||||
|
{
|
||||||
|
AssertHeapIsIdle(cx);
|
||||||
js_ReportErrorNumberVA(cx, JSREPORT_ERROR, errorCallback, userRef,
|
js_ReportErrorNumberVA(cx, JSREPORT_ERROR, errorCallback, userRef,
|
||||||
errorNumber, JS_TRUE, ap);
|
errorNumber, JS_TRUE, ap);
|
||||||
va_end(ap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JS_PUBLIC_API(void)
|
JS_PUBLIC_API(void)
|
||||||
|
@ -5650,6 +5650,12 @@ extern JS_PUBLIC_API(void)
|
|||||||
JS_ReportErrorNumber(JSContext *cx, JSErrorCallback errorCallback,
|
JS_ReportErrorNumber(JSContext *cx, JSErrorCallback errorCallback,
|
||||||
void *userRef, const unsigned errorNumber, ...);
|
void *userRef, const unsigned errorNumber, ...);
|
||||||
|
|
||||||
|
#ifdef va_start
|
||||||
|
extern JS_PUBLIC_API(void)
|
||||||
|
JS_ReportErrorNumberVA(JSContext *cx, JSErrorCallback errorCallback,
|
||||||
|
void *userRef, const unsigned errorNumber, va_list ap);
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Use an errorNumber to retrieve the format string, args are jschar *
|
* Use an errorNumber to retrieve the format string, args are jschar *
|
||||||
*/
|
*/
|
||||||
@ -5700,6 +5706,7 @@ struct JSErrorReport {
|
|||||||
unsigned errorNumber; /* the error number, e.g. see js.msg */
|
unsigned errorNumber; /* the error number, e.g. see js.msg */
|
||||||
const jschar *ucmessage; /* the (default) error message */
|
const jschar *ucmessage; /* the (default) error message */
|
||||||
const jschar **messageArgs; /* arguments for the error message */
|
const jschar **messageArgs; /* arguments for the error message */
|
||||||
|
int16_t exnType; /* One of the JSExnType constants */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -594,6 +594,8 @@ js_ExpandErrorArguments(JSContext *cx, JSErrorCallback callback,
|
|||||||
else
|
else
|
||||||
efs = callback(userRef, NULL, errorNumber);
|
efs = callback(userRef, NULL, errorNumber);
|
||||||
if (efs) {
|
if (efs) {
|
||||||
|
reportp->exnType = efs->exnType;
|
||||||
|
|
||||||
size_t totalArgsLength = 0;
|
size_t totalArgsLength = 0;
|
||||||
size_t argLengths[10]; /* only {0} thru {9} supported */
|
size_t argLengths[10]; /* only {0} thru {9} supported */
|
||||||
argCount = efs->argCount;
|
argCount = efs->argCount;
|
||||||
|
@ -217,6 +217,7 @@ CopyErrorReport(JSContext *cx, JSErrorReport *report)
|
|||||||
/* Copy non-pointer members. */
|
/* Copy non-pointer members. */
|
||||||
copy->lineno = report->lineno;
|
copy->lineno = report->lineno;
|
||||||
copy->errorNumber = report->errorNumber;
|
copy->errorNumber = report->errorNumber;
|
||||||
|
copy->exnType = report->exnType;
|
||||||
|
|
||||||
/* Note that this is before it gets flagged with JSREPORT_EXCEPTION */
|
/* Note that this is before it gets flagged with JSREPORT_EXCEPTION */
|
||||||
copy->flags = report->flags;
|
copy->flags = report->flags;
|
||||||
@ -865,19 +866,18 @@ js_GetLocalizedErrorMessage(JSContext* cx, void *userRef, const char *locale,
|
|||||||
namespace js {
|
namespace js {
|
||||||
|
|
||||||
JS_FRIEND_API(const jschar*)
|
JS_FRIEND_API(const jschar*)
|
||||||
GetErrorTypeNameFromNumber(JSContext* cx, const unsigned errorNumber)
|
GetErrorTypeName(JSContext* cx, int16_t exnType)
|
||||||
{
|
{
|
||||||
const JSErrorFormatString *efs = js_GetErrorMessage(NULL, NULL, errorNumber);
|
|
||||||
/*
|
/*
|
||||||
* JSEXN_INTERNALERR returns null to prevent that "InternalError: "
|
* JSEXN_INTERNALERR returns null to prevent that "InternalError: "
|
||||||
* is prepended before "uncaught exception: "
|
* is prepended before "uncaught exception: "
|
||||||
*/
|
*/
|
||||||
if (!efs || efs->exnType <= JSEXN_NONE || efs->exnType >= JSEXN_LIMIT ||
|
if (exnType <= JSEXN_NONE || exnType >= JSEXN_LIMIT ||
|
||||||
efs->exnType == JSEXN_INTERNALERR)
|
exnType == JSEXN_INTERNALERR)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
JSProtoKey key = GetExceptionProtoKey(efs->exnType);
|
JSProtoKey key = GetExceptionProtoKey(exnType);
|
||||||
return cx->runtime->atomState.classAtoms[key]->chars();
|
return cx->runtime->atomState.classAtoms[key]->chars();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1109,6 +1109,7 @@ js_ReportUncaughtException(JSContext *cx)
|
|||||||
PodZero(&report);
|
PodZero(&report);
|
||||||
report.filename = filename.ptr();
|
report.filename = filename.ptr();
|
||||||
report.lineno = (unsigned) lineno;
|
report.lineno = (unsigned) lineno;
|
||||||
|
report.exnType = int16_t(JSEXN_NONE);
|
||||||
if (str) {
|
if (str) {
|
||||||
if (JSFixedString *fixed = str->ensureFixed(cx))
|
if (JSFixedString *fixed = str->ensureFixed(cx))
|
||||||
report.ucmessage = fixed->chars();
|
report.ucmessage = fixed->chars();
|
||||||
|
@ -809,11 +809,11 @@ CastToJSFreeOp(FreeOp *fop)
|
|||||||
/* Implemented in jsexn.cpp. */
|
/* Implemented in jsexn.cpp. */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get an error type name from a number.
|
* Get an error type name from a JSExnType constant.
|
||||||
* If no exception is associated, return NULL.
|
* Returns NULL for invalid arguments and JSEXN_INTERNALERR
|
||||||
*/
|
*/
|
||||||
extern JS_FRIEND_API(const jschar*)
|
extern JS_FRIEND_API(const jschar*)
|
||||||
GetErrorTypeNameFromNumber(JSContext* cx, const unsigned errorNumber);
|
GetErrorTypeName(JSContext* cx, int16_t exnType);
|
||||||
|
|
||||||
/* Implemented in jswrapper.cpp. */
|
/* Implemented in jswrapper.cpp. */
|
||||||
typedef enum NukeReferencesToWindow {
|
typedef enum NukeReferencesToWindow {
|
||||||
|
@ -15,15 +15,9 @@ PARALLEL_DIRS += \
|
|||||||
chrome \
|
chrome \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
# We can't use CPP_UNIT_TESTS for TestPoisonArea because libxpcom
|
TOOL_DIRS := \
|
||||||
# (which it does not need) isn't available at this point in the build.
|
cpp-tests \
|
||||||
|
$(NULL)
|
||||||
BARE_UNIT_TESTS = \
|
|
||||||
TestPoisonArea.cpp \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
CPPSRCS += $(BARE_UNIT_TESTS)
|
|
||||||
SIMPLE_PROGRAMS += $(BARE_UNIT_TESTS:.cpp=$(BIN_SUFFIX))
|
|
||||||
|
|
||||||
MOCHITEST_FILES = \
|
MOCHITEST_FILES = \
|
||||||
border_radius_hit_testing_iframe.html \
|
border_radius_hit_testing_iframe.html \
|
||||||
@ -358,11 +352,3 @@ MOCHITEST_BROWSER_FILES = \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
DEFINES += -D_IMPL_NS_LAYOUT
|
|
||||||
|
|
||||||
check::
|
|
||||||
@$(EXIT_ON_ERROR) \
|
|
||||||
for f in $(subst .cpp,$(BIN_SUFFIX),$(BARE_UNIT_TESTS)); do \
|
|
||||||
$(RUN_TEST_PROGRAM) $(DIST)/bin/$$f; \
|
|
||||||
done
|
|
||||||
|
16
layout/base/tests/cpp-tests/Makefile.in
Normal file
16
layout/base/tests/cpp-tests/Makefile.in
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
DEPTH := ../../../..
|
||||||
|
topsrcdir := @top_srcdir@
|
||||||
|
srcdir := @srcdir@
|
||||||
|
VPATH := @srcdir@
|
||||||
|
|
||||||
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
|
CPP_UNIT_TESTS := \
|
||||||
|
TestPoisonArea.cpp \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
include $(topsrcdir)/config/rules.mk
|
@ -1,3 +1,7 @@
|
|||||||
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
DEPTH = ../../../..
|
DEPTH = ../../../..
|
||||||
topsrcdir = @top_srcdir@
|
topsrcdir = @top_srcdir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
|
@ -1,18 +1,23 @@
|
|||||||
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
DEPTH = ../../../../..
|
DEPTH = ../../../../..
|
||||||
topsrcdir = @top_srcdir@
|
topsrcdir = @top_srcdir@
|
||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
relativesrcdir = toolkit/components/osfile/tests/mochi
|
relativesrcdir = toolkit/components/osfile/tests/mochi
|
||||||
|
|
||||||
MODULE = osfile
|
include $(DEPTH)/config/autoconf.mk
|
||||||
MOCHITEST_CHROME_FILES = \
|
|
||||||
test_osfile_back.xul \
|
|
||||||
worker_test_osfile_unix.js \
|
|
||||||
worker_test_osfile_win.js \
|
|
||||||
test_osfile_front.xul \
|
|
||||||
worker_test_osfile_front.js \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
MODULE = osfile
|
||||||
|
|
||||||
|
MOCHITEST_CHROME_FILES := \
|
||||||
|
test_osfile_back.xul \
|
||||||
|
worker_test_osfile_unix.js \
|
||||||
|
worker_test_osfile_win.js \
|
||||||
|
test_osfile_front.xul \
|
||||||
|
worker_test_osfile_front.js \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
Loading…
Reference in New Issue
Block a user