From 4d9da746694e35f905a3ed758fac233affb2719c Mon Sep 17 00:00:00 2001 From: Mihai Sucan Date: Thu, 3 Nov 2011 22:12:27 +0200 Subject: [PATCH 001/127] Bug 699541 - Pasted HTML shows twice in Orion; r=rcampbell --- browser/devtools/sourceeditor/orion/README | 3 +++ browser/devtools/sourceeditor/orion/orion.js | 7 +++++-- .../sourceeditor/test/browser_bug684862_paste_html.js | 7 +++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/browser/devtools/sourceeditor/orion/README b/browser/devtools/sourceeditor/orion/README index 0b3cdb75962..7459f63fc7e 100644 --- a/browser/devtools/sourceeditor/orion/README +++ b/browser/devtools/sourceeditor/orion/README @@ -22,6 +22,9 @@ Orion version: git clone from 2011-10-26 + patch for Eclipse Bug 362428 - _getXToOffset() throws: https://github.com/mihaisucan/orion.client/tree/bug-362428 see https://bugs.eclipse.org/bugs/show_bug.cgi?id=362428 + + patch for Eclipse Bug 362835 - Pasted HTML shows twice: + https://github.com/mihaisucan/orion.client/tree/bug-362835 + see https://bugs.eclipse.org/bugs/show_bug.cgi?id=362835 # License diff --git a/browser/devtools/sourceeditor/orion/orion.js b/browser/devtools/sourceeditor/orion/orion.js index 1dbfdcd93f9..1a304615b0d 100644 --- a/browser/devtools/sourceeditor/orion/orion.js +++ b/browser/devtools/sourceeditor/orion/orion.js @@ -1952,7 +1952,7 @@ if (typeof window !== "undefined" && typeof window.define !== "undefined") { * Contributors: * Felipe Heidrich (IBM Corporation) - initial API and implementation * Silenio Quarti (IBM Corporation) - initial API and implementation - * Mihai Sucan (Mozilla Foundation) - fix for Bug#334583 Bug#348471 Bug#349485 Bug#350595 Bug#360726 Bug#361180 Bug#358623 Bug#362286 Bug#362107 Bug#362428 + * Mihai Sucan (Mozilla Foundation) - fix for Bug#334583 Bug#348471 Bug#349485 Bug#350595 Bug#360726 Bug#361180 Bug#358623 Bug#362286 Bug#362107 Bug#362428 Bug#362835 ******************************************************************************/ /*global window document navigator setTimeout clearTimeout XMLHttpRequest define */ @@ -5673,7 +5673,10 @@ orion.textview.TextView = (function() { this._ignorePaste = true; try { result = document.execCommand("paste", false, null); - } catch (ex) {} + } catch (ex) { + // Firefox can throw even when execCommand() works, see bug 362835 + result = clipboardDiv.childNodes.length > 1 || clipboardDiv.firstChild && clipboardDiv.firstChild.childNodes.length > 0; + } this._ignorePaste = false; if (!result) { /* diff --git a/browser/devtools/sourceeditor/test/browser_bug684862_paste_html.js b/browser/devtools/sourceeditor/test/browser_bug684862_paste_html.js index 49938be17cc..6e7d1da54a7 100644 --- a/browser/devtools/sourceeditor/test/browser_bug684862_paste_html.js +++ b/browser/devtools/sourceeditor/test/browser_bug684862_paste_html.js @@ -73,7 +73,10 @@ function editorLoaded() let text = editor.getText(); ok(text, "editor has content after paste"); - isnot(text.indexOf("foobarBug684862"), -1, "editor content is correct"); + let pos = text.indexOf("foobarBug684862"); + isnot(pos, -1, "editor content is correct"); + // Test for bug 699541 - Pasted HTML shows twice in Orion. + is(text.lastIndexOf("foobarBug684862"), pos, "editor content is correct (no duplicate)"); executeSoon(function() { editor.setCaretOffset(4); @@ -82,7 +85,7 @@ function editorLoaded() text = editor.getText(); - isnot(text.indexOf("foobarBug684862"), -1, + is(text.indexOf("foobarBug684862"), pos + 1, "editor content is correct after navigation"); is(editor.getCaretOffset(), 6, "caret location"); From 4f978005455a69e7b46dcb9a4033159f4dba6389 Mon Sep 17 00:00:00 2001 From: Dave Camp Date: Fri, 4 Nov 2011 13:42:26 -0300 Subject: [PATCH 002/127] Bug 698921 - Rule view override calculation misses disabled properties; r=rcampbell --- .../devtools/styleinspector/CssRuleView.jsm | 3 ++- .../test/browser/browser_ruleview_override.js | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/browser/devtools/styleinspector/CssRuleView.jsm b/browser/devtools/styleinspector/CssRuleView.jsm index 151e1bf3788..b2b91b4f9e0 100644 --- a/browser/devtools/styleinspector/CssRuleView.jsm +++ b/browser/devtools/styleinspector/CssRuleView.jsm @@ -214,7 +214,7 @@ ElementStyle.prototype = { computedProp._overriddenDirty = (!!computedProp.overridden != overridden); computedProp.overridden = overridden; - if (!computedProp.overridden) { + if (!computedProp.overridden && computedProp.textProp.enabled) { taken[computedProp.name] = computedProp; } } @@ -478,6 +478,7 @@ TextProperty.prototype = { for (let i = 0, n = dummyStyle.length; i < n; i++) { let prop = dummyStyle.item(i); this.computed.push({ + textProp: this, name: prop, value: dummyStyle.getPropertyValue(prop), priority: dummyStyle.getPropertyPriority(prop), diff --git a/browser/devtools/styleinspector/test/browser/browser_ruleview_override.js b/browser/devtools/styleinspector/test/browser/browser_ruleview_override.js index 763cfb11889..261156a5bb3 100644 --- a/browser/devtools/styleinspector/test/browser/browser_ruleview_override.js +++ b/browser/devtools/styleinspector/test/browser/browser_ruleview_override.js @@ -110,6 +110,33 @@ function importantOverride() ok(classProp.overridden, "New important prop should override class property."); ok(!elementProp.overridden, "New important prop should not be overriden."); + disableOverride(); +} + +function disableOverride() +{ + let style = '' + + '#testid {' + + ' background-color: blue;' + + '}' + + '.testclass {' + + ' background-color: green;' + + '}'; + let styleNode = addStyle(doc, style); + doc.body.innerHTML = '
Styled Node
'; + + let elementStyle = new _ElementStyle(doc.getElementById("testid")); + + let idRule = elementStyle.rules[1]; + let idProp = idRule.textProps[0]; + idProp.setEnabled(false); + + let classRule = elementStyle.rules[2]; + let classProp = classRule.textProps[0]; + ok(!classProp.overridden, "Class prop should not be overridden after id prop was disabled."); + + styleNode.parentNode.removeChild(styleNode); + finishTest(); } From 5300b50a8caa01ea50835fee6fa75d01fadaf254 Mon Sep 17 00:00:00 2001 From: Panos Astithas Date: Wed, 1 Jun 2011 09:33:22 +0300 Subject: [PATCH 003/127] Bug 658368 - Expand console object with time and timeEnd methods that add a simple timer implementation; r=msucan,sdwilsh sr=gavin --- browser/devtools/webconsole/HUDService.jsm | 28 +++- .../webconsole/test/browser/Makefile.in | 2 + ...wser_webconsole_bug_658368_time_methods.js | 87 +++++++++++++ .../browser/test-bug-658368-time-methods.html | 23 ++++ .../test/browser/test-console-extras.html | 2 - .../browser/devtools/webconsole.properties | 12 ++ dom/base/ConsoleAPI.js | 100 ++++++++++++++- dom/tests/browser/browser_ConsoleAPITests.js | 120 +++++++++++++++++- dom/tests/browser/test-console-api.html | 16 +++ .../mochitest/general/test_consoleAPI.html | 2 + 10 files changed, 381 insertions(+), 11 deletions(-) create mode 100644 browser/devtools/webconsole/test/browser/browser_webconsole_bug_658368_time_methods.js create mode 100644 browser/devtools/webconsole/test/browser/test-bug-658368-time-methods.html diff --git a/browser/devtools/webconsole/HUDService.jsm b/browser/devtools/webconsole/HUDService.jsm index b2bd0eb232f..5e4fea8b6a5 100644 --- a/browser/devtools/webconsole/HUDService.jsm +++ b/browser/devtools/webconsole/HUDService.jsm @@ -198,7 +198,9 @@ const LEVELS = { dir: SEVERITY_LOG, group: SEVERITY_LOG, groupCollapsed: SEVERITY_LOG, - groupEnd: SEVERITY_LOG + groupEnd: SEVERITY_LOG, + time: SEVERITY_LOG, + timeEnd: SEVERITY_LOG }; // The lowest HTTP response code (inclusive) that is considered an error. @@ -2094,6 +2096,30 @@ HUD_SERVICE.prototype = } return; + case "time": + if (!args) { + return; + } + if (args.error) { + Cu.reportError(this.getStr(args.error)); + return; + } + body = this.getFormatStr("timerStarted", [args.name]); + clipboardText = body; + sourceURL = aMessage.filename; + sourceLine = aMessage.lineNumber; + break; + + case "timeEnd": + if (!args) { + return; + } + body = this.getFormatStr("timeEnd", [args.name, args.duration]); + clipboardText = body; + sourceURL = aMessage.filename; + sourceLine = aMessage.lineNumber; + break; + default: Cu.reportError("Unknown Console API log level: " + level); return; diff --git a/browser/devtools/webconsole/test/browser/Makefile.in b/browser/devtools/webconsole/test/browser/Makefile.in index 7bb12573c5b..06f43b751db 100644 --- a/browser/devtools/webconsole/test/browser/Makefile.in +++ b/browser/devtools/webconsole/test/browser/Makefile.in @@ -149,6 +149,7 @@ _BROWSER_TEST_FILES = \ browser_gcli_integrate.js \ browser_gcli_require.js \ browser_gcli_web.js \ + browser_webconsole_bug_658368_time_methods.js \ head.js \ $(NULL) @@ -220,6 +221,7 @@ _BROWSER_TEST_PAGES = \ test-bug-678816-content.js \ test-file-location.js \ browser_gcli_inspect.html \ + test-bug-658368-time-methods.html \ $(NULL) libs:: $(_BROWSER_TEST_FILES) diff --git a/browser/devtools/webconsole/test/browser/browser_webconsole_bug_658368_time_methods.js b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_658368_time_methods.js new file mode 100644 index 00000000000..32b85dfa488 --- /dev/null +++ b/browser/devtools/webconsole/test/browser/browser_webconsole_bug_658368_time_methods.js @@ -0,0 +1,87 @@ +/* vim:set ts=2 sw=2 sts=2 et: */ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +// Tests that the Console API implements the time() and timeEnd() methods. + +function test() { + addTab("http://example.com/browser/browser/devtools/webconsole/" + + "test/browser/test-bug-658368-time-methods.html"); + openConsole(); + browser.addEventListener("load", onLoad, true); +} + +function onLoad(aEvent) { + browser.removeEventListener(aEvent.type, onLoad, true); + + let hudId = HUDService.getHudIdByWindow(content); + let hud = HUDService.hudReferences[hudId]; + outputNode = hud.outputNode; + + executeSoon(function() { + findLogEntry("aTimer: timer started"); + findLogEntry("ms"); + + // The next test makes sure that timers with the same name but in separate + // tabs, do not contain the same value. + addTab("data:text/html,"); + openConsole(); + browser.addEventListener("load", testTimerIndependenceInTabs, true); + }); +} + +function testTimerIndependenceInTabs(aEvent) { + browser.removeEventListener(aEvent.type, testTimerIndependenceInTabs, true); + + let hudId = HUDService.getHudIdByWindow(content); + let hud = HUDService.hudReferences[hudId]; + outputNode = hud.outputNode; + + executeSoon(function() { + testLogEntry(outputNode, "bTimer: timer started", "bTimer was not started", + false, true); + + // The next test makes sure that timers with the same name but in separate + // pages, do not contain the same value. + browser.addEventListener("load", testTimerIndependenceInSameTab, true); + content.location = "data:text/html,"; + }); +} + +function testTimerIndependenceInSameTab(aEvent) { + browser.removeEventListener(aEvent.type, testTimerIndependenceInSameTab, true); + + let hudId = HUDService.getHudIdByWindow(content); + let hud = HUDService.hudReferences[hudId]; + outputNode = hud.outputNode; + + executeSoon(function() { + findLogEntry("bTimer: timer started"); + hud.jsterm.clearOutput(); + + // Now the following console.timeEnd() call shouldn't display anything, + // if the timers in different pages are not related. + browser.addEventListener("load", testTimerIndependenceInSameTabAgain, true); + content.location = "data:text/html,"; + }); +} + +function testTimerIndependenceInSameTabAgain(aEvent) { + browser.removeEventListener(aEvent.type, testTimerIndependenceInSameTabAgain, true); + + let hudId = HUDService.getHudIdByWindow(content); + let hud = HUDService.hudReferences[hudId]; + outputNode = hud.outputNode; + + executeSoon(function() { + testLogEntry(outputNode, "bTimer: timer started", "bTimer was not started", + false, true); + + finishTest(); + }); +} diff --git a/browser/devtools/webconsole/test/browser/test-bug-658368-time-methods.html b/browser/devtools/webconsole/test/browser/test-bug-658368-time-methods.html new file mode 100644 index 00000000000..f1754d600bc --- /dev/null +++ b/browser/devtools/webconsole/test/browser/test-bug-658368-time-methods.html @@ -0,0 +1,23 @@ + + + + + Test for bug 658368: Expand console object with time and timeEnd + methods + + +

Test for bug 658368: Expand console object with time and timeEnd + methods

+ + + + + diff --git a/browser/devtools/webconsole/test/browser/test-console-extras.html b/browser/devtools/webconsole/test/browser/test-console-extras.html index ff23b644211..ab40b108920 100644 --- a/browser/devtools/webconsole/test/browser/test-console-extras.html +++ b/browser/devtools/webconsole/test/browser/test-console-extras.html @@ -4,8 +4,6 @@ + + + +Mozilla Bug 698551 +

+ +
+
+
+ + diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 0c670ffe01b..1f1ef983e99 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -3833,11 +3833,18 @@ JS_SetUCPropertyAttributes(JSContext *cx, JSObject *obj, const jschar *name, siz JS_PUBLIC_API(JSBool) JS_GetPropertyById(JSContext *cx, JSObject *obj, jsid id, jsval *vp) +{ + return JS_ForwardGetPropertyTo(cx, obj, id, obj, vp); +} + +JS_PUBLIC_API(JSBool) +JS_ForwardGetPropertyTo(JSContext *cx, JSObject *obj, jsid id, JSObject *onBehalfOf, jsval *vp) { CHECK_REQUEST(cx); assertSameCompartment(cx, obj, id); + assertSameCompartment(cx, onBehalfOf); JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED); - return obj->getGeneric(cx, id, vp); + return obj->getGeneric(cx, onBehalfOf, id, vp); } JS_PUBLIC_API(JSBool) @@ -3848,12 +3855,17 @@ JS_GetPropertyByIdDefault(JSContext *cx, JSObject *obj, jsid id, jsval def, jsva JS_PUBLIC_API(JSBool) JS_GetElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp) +{ + return JS_ForwardGetElementTo(cx, obj, index, obj, vp); +} + +JS_PUBLIC_API(JSBool) +JS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32 index, JSObject *onBehalfOf, jsval *vp) { CHECK_REQUEST(cx); - jsid id; - if (!IndexToId(cx, index, &id)) - return false; - return JS_GetPropertyById(cx, obj, id, vp); + assertSameCompartment(cx, obj); + JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED); + return obj->getElement(cx, onBehalfOf, index, vp); } JS_PUBLIC_API(JSBool) @@ -3909,10 +3921,9 @@ JS_PUBLIC_API(JSBool) JS_SetElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp) { CHECK_REQUEST(cx); - jsid id; - if (!IndexToId(cx, index, &id)) - return false; - return JS_SetPropertyById(cx, obj, INT_TO_JSID(index), vp); + assertSameCompartment(cx, obj); + JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED | JSRESOLVE_ASSIGNING); + return obj->setElement(cx, index, vp, false); } JS_PUBLIC_API(JSBool) diff --git a/js/src/jsapi.h b/js/src/jsapi.h index f004601d852..9641cf841a0 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -3431,6 +3431,9 @@ JS_GetPropertyById(JSContext *cx, JSObject *obj, jsid id, jsval *vp); extern JS_PUBLIC_API(JSBool) JS_GetPropertyByIdDefault(JSContext *cx, JSObject *obj, jsid id, jsval def, jsval *vp); +extern JS_PUBLIC_API(JSBool) +JS_ForwardGetPropertyTo(JSContext *cx, JSObject *obj, jsid id, JSObject *onBehalfOf, jsval *vp); + extern JS_PUBLIC_API(JSBool) JS_GetMethodById(JSContext *cx, JSObject *obj, jsid id, JSObject **objp, jsval *vp); @@ -3563,6 +3566,9 @@ JS_LookupElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp); extern JS_PUBLIC_API(JSBool) JS_GetElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp); +extern JS_PUBLIC_API(JSBool) +JS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32 index, JSObject *onBehalfOf, jsval *vp); + extern JS_PUBLIC_API(JSBool) JS_SetElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp); diff --git a/js/xpconnect/src/dombindings.cpp b/js/xpconnect/src/dombindings.cpp index b1f38681622..55f120594e9 100644 --- a/js/xpconnect/src/dombindings.cpp +++ b/js/xpconnect/src/dombindings.cpp @@ -975,7 +975,7 @@ ListBase::getPropertyOnPrototype(JSContext *cx, JSObject *proxy, jsid id, bo if (!hasProp || !vp) return true; - return JS_GetPropertyById(cx, proto, id, vp); + return JS_ForwardGetPropertyTo(cx, proto, id, proxy, vp); } template From 445e95a3eeb642816e96b66b297aa4dc29f4b29c Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 4 Nov 2011 12:18:52 -0400 Subject: [PATCH 005/127] Bug 698495 part 1. Create a getElementIfPresent method on JSObject with a generic implementation and use it from JSArray code. r=waldo --- js/src/jsarray.cpp | 55 ++++++++++++++++++++++++++++++------------- js/src/jsobj.h | 4 ++++ js/src/jsobjinlines.h | 27 +++++++++++++++++++++ 3 files changed, 69 insertions(+), 17 deletions(-) diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index a2c06a95111..24a552e2de6 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -362,22 +362,9 @@ JSObject::arrayGetOwnDataElement(JSContext *cx, size_t i, Value *vp) * to JSVAL_VOID. This function assumes that the location pointed by vp is * properly rooted and can be used as GC-protected storage for temporaries. */ -static JSBool -GetElement(JSContext *cx, JSObject *obj, jsdouble index, JSBool *hole, Value *vp) +static inline JSBool +DoGetElement(JSContext *cx, JSObject *obj, jsdouble index, JSBool *hole, Value *vp) { - JS_ASSERT(index >= 0); - if (obj->isDenseArray() && index < obj->getDenseArrayInitializedLength() && - !(*vp = obj->getDenseArrayElement(uint32(index))).isMagic(JS_ARRAY_HOLE)) { - *hole = JS_FALSE; - return JS_TRUE; - } - if (obj->isArguments()) { - if (obj->asArguments()->getElement(uint32(index), vp)) { - *hole = JS_FALSE; - return true; - } - } - AutoIdRooter idr(cx); *hole = JS_FALSE; @@ -393,8 +380,8 @@ GetElement(JSContext *cx, JSObject *obj, jsdouble index, JSBool *hole, Value *vp if (!obj->lookupGeneric(cx, idr.id(), &obj2, &prop)) return JS_FALSE; if (!prop) { - *hole = JS_TRUE; vp->setUndefined(); + *hole = JS_TRUE; } else { if (!obj->getGeneric(cx, idr.id(), vp)) return JS_FALSE; @@ -403,6 +390,40 @@ GetElement(JSContext *cx, JSObject *obj, jsdouble index, JSBool *hole, Value *vp return JS_TRUE; } +static inline JSBool +DoGetElement(JSContext *cx, JSObject *obj, uint32 index, JSBool *hole, Value *vp) +{ + bool present; + if (!obj->getElementIfPresent(cx, obj, index, vp, &present)) + return false; + + *hole = !present; + if (*hole) + vp->setUndefined(); + + return true; +} + +template +static JSBool +GetElement(JSContext *cx, JSObject *obj, IndexType index, JSBool *hole, Value *vp) +{ + JS_ASSERT(index >= 0); + if (obj->isDenseArray() && index < obj->getDenseArrayInitializedLength() && + !(*vp = obj->getDenseArrayElement(uint32(index))).isMagic(JS_ARRAY_HOLE)) { + *hole = JS_FALSE; + return JS_TRUE; + } + if (obj->isArguments()) { + if (obj->asArguments()->getElement(uint32(index), vp)) { + *hole = JS_FALSE; + return true; + } + } + + return DoGetElement(cx, obj, index, hole, vp); +} + namespace js { static bool @@ -2663,7 +2684,7 @@ js::array_shift(JSContext *cx, uintN argc, Value *vp) } JSBool hole; - if (!GetElement(cx, obj, 0, &hole, &args.rval())) + if (!GetElement(cx, obj, 0u, &hole, &args.rval())) return JS_FALSE; /* Slide down the array above the first element. */ diff --git a/js/src/jsobj.h b/js/src/jsobj.h index 89500f5145d..91cb9c4b955 100644 --- a/js/src/jsobj.h +++ b/js/src/jsobj.h @@ -1374,6 +1374,10 @@ struct JSObject : js::gc::Cell { inline JSBool getProperty(JSContext *cx, JSObject *receiver, js::PropertyName *name, js::Value *vp); inline JSBool getElement(JSContext *cx, JSObject *receiver, uint32 index, js::Value *vp); + /* If element is not present (e.g. array hole) *present is set to + false and the contents of *vp are unusable garbage. */ + inline JSBool getElementIfPresent(JSContext *cx, JSObject *receiver, uint32 index, + js::Value *vp, bool *present); inline JSBool getSpecial(JSContext *cx, JSObject *receiver, js::SpecialId sid, js::Value *vp); inline JSBool getGeneric(JSContext *cx, jsid id, js::Value *vp); diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h index e07f5468dc7..4e4ae74a239 100644 --- a/js/src/jsobjinlines.h +++ b/js/src/jsobjinlines.h @@ -1254,6 +1254,33 @@ JSObject::getElement(JSContext *cx, uint32 index, js::Value *vp) return getElement(cx, this, index, vp); } +inline JSBool +JSObject::getElementIfPresent(JSContext *cx, JSObject *receiver, uint32 index, js::Value *vp, + bool *present) +{ + /* For now, do the index-to-id conversion just once, then use + * lookupGeneric/getGeneric. Once lookupElement and getElement stop both + * doing index-to-id conversions, we can use those here. + */ + jsid id; + if (!js::IndexToId(cx, index, &id)) + return false; + + JSObject *obj2; + JSProperty *prop; + if (!lookupGeneric(cx, id, &obj2, &prop)) + return false; + + if (!prop) { + *present = false; + js::Debug_SetValueRangeToCrashOnTouch(vp, 1); + return true; + } + + *present = true; + return getGeneric(cx, receiver, id, vp); +} + inline JSBool JSObject::getSpecial(JSContext *cx, js::SpecialId sid, js::Value *vp) { From 12f0cece05191d9aee634610d1680fc6636e0222 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 4 Nov 2011 12:19:00 -0400 Subject: [PATCH 006/127] Bug 698495 part 2. Add an optional getElementIfPresent ObjectOps hook. r=waldo --- js/src/jsarray.cpp | 2 ++ js/src/jsclass.h | 5 ++- js/src/jsobj.cpp | 1 + js/src/jsobjinlines.h | 4 +++ js/src/jsproxy.cpp | 37 ++++++++++++++++++++++ js/src/jsproxy.h | 4 +++ js/src/jstypedarray.cpp | 2 ++ js/src/jsxml.cpp | 1 + js/xpconnect/src/XPCWrappedNativeJSOps.cpp | 1 + js/xpconnect/src/xpcprivate.h | 2 ++ 10 files changed, 58 insertions(+), 1 deletion(-) diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index 24a552e2de6..75764cb33c9 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -1296,6 +1296,8 @@ Class js::ArrayClass = { array_getGeneric, array_getProperty, array_getElement, + NULL, /* getElementIfPresent, because this is hard for now for + slow arrays */ array_getSpecial, array_setGeneric, array_setProperty, diff --git a/js/src/jsclass.h b/js/src/jsclass.h index a2a8a843041..674a4d8591a 100644 --- a/js/src/jsclass.h +++ b/js/src/jsclass.h @@ -208,6 +208,8 @@ typedef JSBool typedef JSBool (* ElementIdOp)(JSContext *cx, JSObject *obj, JSObject *receiver, uint32 index, Value *vp); typedef JSBool +(* ElementIfPresentOp)(JSContext *cx, JSObject *obj, JSObject *receiver, uint32 index, Value *vp, bool* present); +typedef JSBool (* SpecialIdOp)(JSContext *cx, JSObject *obj, JSObject *receiver, SpecialId sid, Value *vp); typedef JSBool (* StrictGenericIdOp)(JSContext *cx, JSObject *obj, jsid id, Value *vp, JSBool strict); @@ -313,6 +315,7 @@ struct ObjectOps GenericIdOp getGeneric; PropertyIdOp getProperty; ElementIdOp getElement; + ElementIfPresentOp getElementIfPresent; /* can be null */ SpecialIdOp getSpecial; StrictGenericIdOp setGeneric; StrictPropertyIdOp setProperty; @@ -341,7 +344,7 @@ struct ObjectOps #define JS_NULL_OBJECT_OPS \ {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, \ NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, \ - NULL,NULL,NULL,NULL,NULL} + NULL,NULL,NULL,NULL,NULL,NULL} struct Class { diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp index 0842417808f..8b240da5a9b 100644 --- a/js/src/jsobj.cpp +++ b/js/src/jsobj.cpp @@ -3457,6 +3457,7 @@ Class js::WithClass = { with_GetGeneric, with_GetProperty, with_GetElement, + NULL, /* getElementIfPresent */ with_GetSpecial, with_SetGeneric, with_SetProperty, diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h index 4e4ae74a239..1611a41b1e8 100644 --- a/js/src/jsobjinlines.h +++ b/js/src/jsobjinlines.h @@ -1258,6 +1258,10 @@ inline JSBool JSObject::getElementIfPresent(JSContext *cx, JSObject *receiver, uint32 index, js::Value *vp, bool *present) { + js::ElementIfPresentOp op = getOps()->getElementIfPresent; + if (op) + return op(cx, this, receiver, index, vp, present); + /* For now, do the index-to-id conversion just once, then use * lookupGeneric/getGeneric. Once lookupElement and getElement stop both * doing index-to-id conversions, we can use those here. diff --git a/js/src/jsproxy.cpp b/js/src/jsproxy.cpp index bba8d71f48f..ad454c48a37 100644 --- a/js/src/jsproxy.cpp +++ b/js/src/jsproxy.cpp @@ -139,6 +139,24 @@ ProxyHandler::get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, V return CallJSPropertyOp(cx, desc.getter, receiver, id, vp); } +bool +ProxyHandler::getElementIfPresent(JSContext *cx, JSObject *proxy, JSObject *receiver, uint32 index, Value *vp, bool *present) +{ + jsid id; + if (!IndexToId(cx, index, &id)) + return false; + + if (!has(cx, proxy, id, present)) + return false; + + if (!*present) { + Debug_SetValueRangeToCrashOnTouch(vp, 1); + return true; + } + + return get(cx, proxy, receiver, id, vp); +} + bool ProxyHandler::set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict, Value *vp) @@ -809,6 +827,15 @@ Proxy::get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, Value *v return GetProxyHandler(proxy)->get(cx, proxy, receiver, id, vp); } +bool +Proxy::getElementIfPresent(JSContext *cx, JSObject *proxy, JSObject *receiver, uint32 index, + Value *vp, bool *present) +{ + JS_CHECK_RECURSION(cx, return false); + AutoPendingProxyOperation pending(cx, proxy); + return GetProxyHandler(proxy)->getElementIfPresent(cx, proxy, receiver, index, vp, present); +} + bool Proxy::set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict, Value *vp) { @@ -1017,6 +1044,13 @@ proxy_GetElement(JSContext *cx, JSObject *obj, JSObject *receiver, uint32 index, return proxy_GetGeneric(cx, obj, receiver, id, vp); } +static JSBool +proxy_GetElementIfPresent(JSContext *cx, JSObject *obj, JSObject *receiver, uint32 index, + Value *vp, bool *present) +{ + return Proxy::getElementIfPresent(cx, obj, receiver, index, vp, present); +} + static JSBool proxy_GetSpecial(JSContext *cx, JSObject *obj, JSObject *receiver, SpecialId sid, Value *vp) { @@ -1251,6 +1285,7 @@ JS_FRIEND_DATA(Class) js::ObjectProxyClass = { proxy_GetGeneric, proxy_GetProperty, proxy_GetElement, + proxy_GetElementIfPresent, proxy_GetSpecial, proxy_SetGeneric, proxy_SetProperty, @@ -1312,6 +1347,7 @@ JS_FRIEND_DATA(Class) js::OuterWindowProxyClass = { proxy_GetGeneric, proxy_GetProperty, proxy_GetElement, + proxy_GetElementIfPresent, proxy_GetSpecial, proxy_SetGeneric, proxy_SetProperty, @@ -1385,6 +1421,7 @@ JS_FRIEND_DATA(Class) js::FunctionProxyClass = { proxy_GetGeneric, proxy_GetProperty, proxy_GetElement, + proxy_GetElementIfPresent, proxy_GetSpecial, proxy_SetGeneric, proxy_SetProperty, diff --git a/js/src/jsproxy.h b/js/src/jsproxy.h index 2fcf214d46d..2f3b374f3ba 100644 --- a/js/src/jsproxy.h +++ b/js/src/jsproxy.h @@ -88,6 +88,8 @@ class JS_FRIEND_API(ProxyHandler) { virtual bool defaultValue(JSContext *cx, JSObject *obj, JSType hint, Value *vp); virtual void finalize(JSContext *cx, JSObject *proxy); virtual void trace(JSTracer *trc, JSObject *proxy); + virtual bool getElementIfPresent(JSContext *cx, JSObject *obj, JSObject *receiver, + uint32 index, Value *vp, bool *present); virtual bool isOuterWindow() { return false; @@ -120,6 +122,8 @@ class Proxy { static bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp); static bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp); static bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, Value *vp); + static bool getElementIfPresent(JSContext *cx, JSObject *proxy, JSObject *receiver, + uint32 index, Value *vp, bool *present); static bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict, Value *vp); static bool keys(JSContext *cx, JSObject *proxy, AutoIdVector &props); diff --git a/js/src/jstypedarray.cpp b/js/src/jstypedarray.cpp index 56b8a3c25fb..a63e036b632 100644 --- a/js/src/jstypedarray.cpp +++ b/js/src/jstypedarray.cpp @@ -2105,6 +2105,7 @@ Class js::ArrayBufferClass = { ArrayBuffer::obj_getGeneric, ArrayBuffer::obj_getProperty, ArrayBuffer::obj_getElement, + NULL, /* getElementIfPresent */ ArrayBuffer::obj_getSpecial, ArrayBuffer::obj_setGeneric, ArrayBuffer::obj_setProperty, @@ -2217,6 +2218,7 @@ JSFunctionSpec _typedArray::jsfuncs[] = { \ _typedArray::obj_getGeneric, \ _typedArray::obj_getProperty, \ _typedArray::obj_getElement, \ + NULL, /* getElementIfPresent */ \ _typedArray::obj_getSpecial, \ _typedArray::obj_setGeneric, \ _typedArray::obj_setProperty, \ diff --git a/js/src/jsxml.cpp b/js/src/jsxml.cpp index 0dd1babcbf9..c9873505547 100644 --- a/js/src/jsxml.cpp +++ b/js/src/jsxml.cpp @@ -5361,6 +5361,7 @@ JS_FRIEND_DATA(Class) js::XMLClass = { xml_getGeneric, xml_getProperty, xml_getElement, + NULL, /* getElementIfPresent */ xml_getSpecial, xml_setGeneric, xml_setProperty, diff --git a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp index 4e185e5c317..b1e3864d2a5 100644 --- a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp +++ b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp @@ -866,6 +866,7 @@ js::Class XPC_WN_NoHelper_JSClass = { nsnull, // getGeneric nsnull, // getProperty nsnull, // getElement + nsnull, // getElementIfPresent nsnull, // getSpecial nsnull, // setGeneric nsnull, // setProperty diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index c006b7e4b7e..8bc15d22157 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -1407,6 +1407,7 @@ XPC_WN_JSOp_ThisObject(JSContext *cx, JSObject *obj); nsnull, /* getGeneric */ \ nsnull, /* getProperty */ \ nsnull, /* getElement */ \ + nsnull, /* getElementIfPresent */ \ nsnull, /* getSpecial */ \ nsnull, /* setGeneric */ \ nsnull, /* setProperty */ \ @@ -1444,6 +1445,7 @@ XPC_WN_JSOp_ThisObject(JSContext *cx, JSObject *obj); nsnull, /* getGeneric */ \ nsnull, /* getProperty */ \ nsnull, /* getElement */ \ + nsnull, /* getElementIfPresent */ \ nsnull, /* getSpecial */ \ nsnull, /* setGeneric */ \ nsnull, /* setProperty */ \ From 73fb7982247e60625bdfdb7193608372956f5493 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 4 Nov 2011 12:19:07 -0400 Subject: [PATCH 007/127] Bug 698495 part 3. Expose IndexToId to API consumers. r=waldo --- js/src/jsapi.cpp | 6 ++++++ js/src/jsapi.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 1f1ef983e99..62f55ef9eb1 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -6296,3 +6296,9 @@ BOOL WINAPI DllMain (HINSTANCE hDLL, DWORD dwReason, LPVOID lpReserved) } #endif + +JS_PUBLIC_API(JSBool) +JS_IndexToId(JSContext *cx, uint32 index, jsid *id) +{ + return IndexToId(cx, index, id); +} diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 9641cf841a0..bd171955a1b 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -4893,6 +4893,12 @@ extern JS_PUBLIC_API(void) JS_ScheduleGC(JSContext *cx, uint32 count, JSBool compartment); #endif +/* + * Convert a uint32 index into a jsid. + */ +extern JS_PUBLIC_API(JSBool) +JS_IndexToId(JSContext *cx, uint32 index, jsid *id); + JS_END_EXTERN_C #endif /* jsapi_h___ */ From 1dde154a8f4d05cef11ee0677bb7dfbd9e219653 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 4 Nov 2011 12:19:13 -0400 Subject: [PATCH 008/127] Bug 698495 part 4. Implement a JS_GetElementIfPresent API. r=waldo --- js/src/jsapi.cpp | 13 +++++++++++++ js/src/jsapi.h | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 62f55ef9eb1..f013a2b949c 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -3868,6 +3868,19 @@ JS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32 index, JSObject *onB return obj->getElement(cx, onBehalfOf, index, vp); } +JS_PUBLIC_API(JSBool) +JS_GetElementIfPresent(JSContext *cx, JSObject *obj, uint32 index, JSObject *onBehalfOf, jsval *vp, JSBool* present) +{ + CHECK_REQUEST(cx); + assertSameCompartment(cx, obj); + JSAutoResolveFlags rf(cx, JSRESOLVE_QUALIFIED); + bool isPresent; + if (!obj->getElementIfPresent(cx, onBehalfOf, index, vp, &isPresent)) + return false; + *present = isPresent; + return true; +} + JS_PUBLIC_API(JSBool) JS_GetProperty(JSContext *cx, JSObject *obj, const char *name, jsval *vp) { diff --git a/js/src/jsapi.h b/js/src/jsapi.h index bd171955a1b..129e0c24f0b 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -3569,6 +3569,15 @@ JS_GetElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp); extern JS_PUBLIC_API(JSBool) JS_ForwardGetElementTo(JSContext *cx, JSObject *obj, uint32 index, JSObject *onBehalfOf, jsval *vp); +/* + * Get the property with name given by |index|, if it has one. If + * not, |*present| will be set to false and the value of |vp| must not + * be relied on. + */ +extern JS_PUBLIC_API(JSBool) +JS_GetElementIfPresent(JSContext *cx, JSObject *obj, uint32 index, JSObject *onBehalfOf, + jsval *vp, JSBool* present); + extern JS_PUBLIC_API(JSBool) JS_SetElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp); From 38477a5c7aef95e3c1028be6f952549fca681932 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 4 Nov 2011 12:25:18 -0400 Subject: [PATCH 009/127] Bug 698495 part 5. Implement getElementIfPresent on nodelist proxies. r=peterv --- js/xpconnect/src/dombindings.cpp | 46 ++++++++++++++++++++++++++++++++ js/xpconnect/src/dombindings.h | 2 ++ 2 files changed, 48 insertions(+) diff --git a/js/xpconnect/src/dombindings.cpp b/js/xpconnect/src/dombindings.cpp index 55f120594e9..455f0889746 100644 --- a/js/xpconnect/src/dombindings.cpp +++ b/js/xpconnect/src/dombindings.cpp @@ -1042,6 +1042,52 @@ ListBase::get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, V return true; } +template +bool +ListBase::getElementIfPresent(JSContext *cx, JSObject *proxy, JSObject *receiver, + uint32 index, Value *vp, bool *present) +{ + if (hasIndexGetter) { + IndexGetterType result; + *present = getItemAt(getListObject(proxy), index, result); + if (*present) + return Wrap(cx, proxy, result, vp); + + vp->setUndefined(); + return true; + } + + jsid id; + if (!JS_IndexToId(cx, index, &id)) + return false; + + JSObject *expando = getExpandoObject(proxy); + if (expando) { + JSBool isPresent; + if (!JS_GetElementIfPresent(cx, expando, index, expando, vp, &isPresent)) + return false; + if (isPresent) { + *present = true; + return true; + } + } + + // No need to worry about name getters here, so just check the proto. + + JSObject *proto = js::GetObjectProto(proxy); + if (proto) { + JSBool isPresent; + if (!JS_GetElementIfPresent(cx, proto, index, proxy, vp, &isPresent)) + return false; + *present = isPresent; + return true; + } + + *present = false; + // Can't Debug_SetValueRangeToCrashOnTouch because it's not public + return true; +} + template bool ListBase::set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict, diff --git a/js/xpconnect/src/dombindings.h b/js/xpconnect/src/dombindings.h index 86b31e3453e..bb4fb057edf 100644 --- a/js/xpconnect/src/dombindings.h +++ b/js/xpconnect/src/dombindings.h @@ -225,6 +225,8 @@ public: bool has(JSContext *cx, JSObject *proxy, jsid id, bool *bp); bool hasOwn(JSContext *cx, JSObject *proxy, jsid id, bool *bp); bool get(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, js::Value *vp); + bool getElementIfPresent(JSContext *cx, JSObject *proxy, JSObject *receiver, + uint32 index, js::Value *vp, bool *present); bool set(JSContext *cx, JSObject *proxy, JSObject *receiver, jsid id, bool strict, js::Value *vp); bool keys(JSContext *cx, JSObject *proxy, js::AutoIdVector &props); From d0ba603bd6f78f58f714e42f08c043ea741c39a9 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 4 Nov 2011 12:25:52 -0400 Subject: [PATCH 010/127] Bug 699237. Add a getElementIfPresent on typed arrays. r=waldo --- js/src/jstypedarray.cpp | 44 +++++++++++++++++++++++++++++++++++++++-- js/src/jstypedarray.h | 3 +++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/js/src/jstypedarray.cpp b/js/src/jstypedarray.cpp index a63e036b632..761280c06f4 100644 --- a/js/src/jstypedarray.cpp +++ b/js/src/jstypedarray.cpp @@ -392,6 +392,16 @@ ArrayBuffer::obj_getElement(JSContext *cx, JSObject *obj, JSObject *receiver, ui return js_GetElement(cx, delegate, receiver, index, vp); } +JSBool +ArrayBuffer::obj_getElementIfPresent(JSContext *cx, JSObject *obj, JSObject *receiver, + uint32 index, Value *vp, bool *present) +{ + JSObject *delegate = DelegateObject(cx, getArrayBuffer(obj)); + if (!delegate) + return false; + return delegate->getElementIfPresent(cx, receiver, index, vp, present); +} + JSBool ArrayBuffer::obj_getSpecial(JSContext *cx, JSObject *obj, JSObject *receiver, SpecialId sid, Value *vp) { @@ -1073,6 +1083,36 @@ class TypedArrayTemplate return js_NativeGet(cx, obj, obj2, shape, JSGET_METHOD_BARRIER, vp); } + static JSBool + obj_getElementIfPresent(JSContext *cx, JSObject *obj, JSObject *receiver, uint32 index, Value *vp, bool *present) + { + // Fast-path the common case of index < length + JSObject *tarray = getTypedArray(obj); + + if (index < getLength(tarray)) { + // this inline function is specialized for each type + copyIndexToValue(cx, tarray, index, vp); + *present = true; + return true; + } + + // Just fall back on obj_getElement so we pick up whatever + // wacky semantics that has. + JSObject *obj2; + JSProperty *prop; + if (!obj_lookupElement(cx, obj, index, &obj2, &prop)) + return false; + + if (!prop) { + *present = false; + Debug_SetValueRangeToCrashOnTouch(vp, 1); + return true; + } + + *present = true; + return obj_getElement(cx, obj, receiver, index, vp); + } + static JSBool obj_getSpecial(JSContext *cx, JSObject *obj, JSObject *receiver, SpecialId sid, Value *vp) { @@ -2105,7 +2145,7 @@ Class js::ArrayBufferClass = { ArrayBuffer::obj_getGeneric, ArrayBuffer::obj_getProperty, ArrayBuffer::obj_getElement, - NULL, /* getElementIfPresent */ + ArrayBuffer::obj_getElementIfPresent, ArrayBuffer::obj_getSpecial, ArrayBuffer::obj_setGeneric, ArrayBuffer::obj_setProperty, @@ -2218,7 +2258,7 @@ JSFunctionSpec _typedArray::jsfuncs[] = { \ _typedArray::obj_getGeneric, \ _typedArray::obj_getProperty, \ _typedArray::obj_getElement, \ - NULL, /* getElementIfPresent */ \ + _typedArray::obj_getElementIfPresent, \ _typedArray::obj_getSpecial, \ _typedArray::obj_setGeneric, \ _typedArray::obj_setProperty, \ diff --git a/js/src/jstypedarray.h b/js/src/jstypedarray.h index 11893b16638..4320edea10a 100644 --- a/js/src/jstypedarray.h +++ b/js/src/jstypedarray.h @@ -109,6 +109,9 @@ struct JS_FRIEND_API(ArrayBuffer) { static JSBool obj_getElement(JSContext *cx, JSObject *obj, JSObject *receiver, uint32 index, Value *vp); + static JSBool + obj_getElementIfPresent(JSContext *cx, JSObject *obj, JSObject *receiver, uint32 index, + Value *vp, bool *present); static JSBool obj_getSpecial(JSContext *cx, JSObject *obj, JSObject *receiver, SpecialId sid, Value *vp); From 526b768bfe9354ea8c6d4db7b85aa00a2d00fee4 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 4 Nov 2011 12:26:03 -0400 Subject: [PATCH 011/127] Bug 699705. When forwarding property gets to the proto for arrays, send along the right receiver even if the property lives on a non-native object. r=waldo --- js/src/jsarray.cpp | 32 +--------- js/src/jstypedarray.cpp | 64 ++++--------------- ...his-for-nonnatives-on-array-proto-chain.js | 42 ++++++++++++ js/src/tests/js1_8_5/extensions/jstests.list | 1 + 4 files changed, 58 insertions(+), 81 deletions(-) create mode 100644 js/src/tests/js1_8_5/extensions/correct-this-for-nonnatives-on-array-proto-chain.js diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index 75764cb33c9..9ceb5ed4b4d 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -820,26 +820,13 @@ array_getGeneric(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, Valu if (!js_IdIsIndex(id, &i) || i >= obj->getDenseArrayInitializedLength() || obj->getDenseArrayElement(i).isMagic(JS_ARRAY_HOLE)) { - JSObject *obj2; - JSProperty *prop; - const Shape *shape; - JSObject *proto = obj->getProto(); if (!proto) { vp->setUndefined(); return JS_TRUE; } - vp->setUndefined(); - if (!LookupPropertyWithFlags(cx, proto, id, cx->resolveFlags, &obj2, &prop)) - return JS_FALSE; - - if (prop && obj2->isNative()) { - shape = (const Shape *) prop; - if (!js_NativeGet(cx, obj, obj2, shape, JSGET_METHOD_BARRIER, vp)) - return JS_FALSE; - } - return JS_TRUE; + return proto->getGeneric(cx, receiver, id, vp); } *vp = obj->getDenseArrayElement(i); @@ -876,22 +863,7 @@ array_getElement(JSContext *cx, JSObject *obj, JSObject *receiver, uint32 index, return true; } - vp->setUndefined(); - - jsid id; - if (!IndexToId(cx, index, &id)) - return false; - - JSObject *obj2; - JSProperty *prop; - if (!LookupPropertyWithFlags(cx, proto, id, cx->resolveFlags, &obj2, &prop)) - return false; - - if (!prop || !obj2->isNative()) - return true; - - const Shape *shape = (const Shape *) prop; - return js_NativeGet(cx, obj, obj2, shape, JSGET_METHOD_BARRIER, vp); + return proto->getElement(cx, receiver, index, vp); } static JSBool diff --git a/js/src/jstypedarray.cpp b/js/src/jstypedarray.cpp index 761280c06f4..0ed6c5e94c3 100644 --- a/js/src/jstypedarray.cpp +++ b/js/src/jstypedarray.cpp @@ -1014,31 +1014,16 @@ class TypedArrayTemplate if (isArrayIndex(cx, tarray, id, &index)) { // this inline function is specialized for each type copyIndexToValue(cx, tarray, index, vp); - } else { - JSObject *obj2; - JSProperty *prop; - const Shape *shape; - - JSObject *proto = obj->getProto(); - if (!proto) { - vp->setUndefined(); - return true; - } - - vp->setUndefined(); - if (!LookupPropertyWithFlags(cx, proto, id, cx->resolveFlags, &obj2, &prop)) - return false; - - if (prop) { - if (obj2->isNative()) { - shape = (Shape *) prop; - if (!js_NativeGet(cx, obj, obj2, shape, JSGET_METHOD_BARRIER, vp)) - return false; - } - } + return true; } - return true; + JSObject *proto = obj->getProto(); + if (!proto) { + vp->setUndefined(); + return true; + } + + return proto->getGeneric(cx, receiver, id, vp); } static JSBool @@ -1065,22 +1050,7 @@ class TypedArrayTemplate return true; } - vp->setUndefined(); - - jsid id; - if (!IndexToId(cx, index, &id)) - return false; - - JSObject *obj2; - JSProperty *prop; - if (!LookupPropertyWithFlags(cx, proto, id, cx->resolveFlags, &obj2, &prop)) - return false; - - if (!prop || !obj2->isNative()) - return true; - - const Shape *shape = (Shape *) prop; - return js_NativeGet(cx, obj, obj2, shape, JSGET_METHOD_BARRIER, vp); + return proto->getElement(cx, receiver, index, vp); } static JSBool @@ -1096,21 +1066,13 @@ class TypedArrayTemplate return true; } - // Just fall back on obj_getElement so we pick up whatever - // wacky semantics that has. - JSObject *obj2; - JSProperty *prop; - if (!obj_lookupElement(cx, obj, index, &obj2, &prop)) - return false; - - if (!prop) { - *present = false; - Debug_SetValueRangeToCrashOnTouch(vp, 1); + JSObject *proto = obj->getProto(); + if (!proto) { + vp->setUndefined(); return true; } - *present = true; - return obj_getElement(cx, obj, receiver, index, vp); + return proto->getElementIfPresent(cx, receiver, index, vp, present); } static JSBool diff --git a/js/src/tests/js1_8_5/extensions/correct-this-for-nonnatives-on-array-proto-chain.js b/js/src/tests/js1_8_5/extensions/correct-this-for-nonnatives-on-array-proto-chain.js new file mode 100644 index 00000000000..08877852470 --- /dev/null +++ b/js/src/tests/js1_8_5/extensions/correct-this-for-nonnatives-on-array-proto-chain.js @@ -0,0 +1,42 @@ +// Any copyright is dedicated to the Public Domain. +// http://creativecommons.org/licenses/publicdomain/ + +//----------------------------------------------------------------------------- +var BUGNUMBER = 699705; +var summary = + "When getting a property from a dense array that lives on the proto chain "+ + "and in particular lives on a non-native object, we should still invoke "+ + "property getter"; + +print(BUGNUMBER + ": " + summary); + +/************** + * BEGIN TEST * + **************/ + +var protoArr = Proxy.create({ + getOwnPropertyDescriptor: function(name) { + if (name == "foo") return { get: function() { return this[0]; } }; + return (void 0); + }, + getPropertyDescriptor: function(name) { + return this.getOwnPropertyDescriptor(name); + }, +}, null); +void (Array.prototype.__proto__ = protoArr); +var testArr = [ "PASS" ]; +// Make sure we don't optimize the get to a .foo get, so do the dance +// with passing in a string. +function f(name) { + return testArr[name]; +} +var propValue = f("foo"); +assertEq(propValue, "PASS", + "expected to get 'PASS' out of the getter, got: " + propValue); + +/******************************************************************************/ + +if (typeof reportCompare === "function") + reportCompare(true, true); + +print("All tests passed!"); diff --git a/js/src/tests/js1_8_5/extensions/jstests.list b/js/src/tests/js1_8_5/extensions/jstests.list index 337eadd0d24..0a65eb71e18 100644 --- a/js/src/tests/js1_8_5/extensions/jstests.list +++ b/js/src/tests/js1_8_5/extensions/jstests.list @@ -61,3 +61,4 @@ script regress-677924.js skip-if(!xulRuntime.shell) script regress-696109.js script regress-691746.js script regress-697515.js +script correct-this-for-nonnatives-on-array-proto-chain.js From 164e14278ba32d27a285cb307c61077ffa19b101 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Fri, 4 Nov 2011 09:24:04 -0700 Subject: [PATCH 012/127] Bug 699143: Force a synchronous SMIL sample when we register the first animation element in a document. r=birtles --- content/smil/nsSMILAnimationController.cpp | 3 +- content/smil/test/Makefile.in | 1 + .../test_smilDynamicDelayedBeginElement.xhtml | 96 +++++++++++++++++++ 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 content/smil/test/test_smilDynamicDelayedBeginElement.xhtml diff --git a/content/smil/nsSMILAnimationController.cpp b/content/smil/nsSMILAnimationController.cpp index 678d3d1bcd8..3939b78b925 100644 --- a/content/smil/nsSMILAnimationController.cpp +++ b/content/smil/nsSMILAnimationController.cpp @@ -208,6 +208,7 @@ nsSMILAnimationController::RegisterAnimationElement( "we shouldn't have deferred sampling if we already had " "animations registered"); StartSampling(GetRefreshDriver()); + Sample(); // Run the first sample manually } // else, don't sample until a time container is registered (via AddChild) } } @@ -817,8 +818,8 @@ nsSMILAnimationController::AddChild(nsSMILTimeContainer& aChild) NS_ENSURE_TRUE(key, NS_ERROR_OUT_OF_MEMORY); if (!mPauseState && mChildContainerTable.Count() == 1) { - Sample(); // Run the first sample manually MaybeStartSampling(GetRefreshDriver()); + Sample(); // Run the first sample manually } return NS_OK; diff --git a/content/smil/test/Makefile.in b/content/smil/test/Makefile.in index f0799d33129..a0a88f5a55e 100644 --- a/content/smil/test/Makefile.in +++ b/content/smil/test/Makefile.in @@ -69,6 +69,7 @@ _TEST_FILES = \ test_smilCSSInherit.xhtml \ test_smilCSSInvalidValues.xhtml \ test_smilCSSPaced.xhtml \ + test_smilDynamicDelayedBeginElement.xhtml \ test_smilMappedAttrFromTo.xhtml \ test_smilMappedAttrFromBy.xhtml \ test_smilMappedAttrPaced.xhtml \ diff --git a/content/smil/test/test_smilDynamicDelayedBeginElement.xhtml b/content/smil/test/test_smilDynamicDelayedBeginElement.xhtml new file mode 100644 index 00000000000..c454d39f7cd --- /dev/null +++ b/content/smil/test/test_smilDynamicDelayedBeginElement.xhtml @@ -0,0 +1,96 @@ + + + + Test for Bug 699143 + + + + + +Mozilla Bug 699143 +

+ +
+
+
+ + From 78b33ae37900f169cf040fb1c603f2a309eaf51b Mon Sep 17 00:00:00 2001 From: Ben Turner Date: Fri, 4 Nov 2011 09:32:17 -0700 Subject: [PATCH 013/127] Bug 699633 - "Inline workers broken". r=sicking, test by Jussi Kalliokoski . --- dom/workers/ScriptLoader.cpp | 3 +- dom/workers/WorkerPrivate.cpp | 67 +++++++++++--------------- dom/workers/WorkerPrivate.h | 2 +- dom/workers/test/Makefile.in | 1 + dom/workers/test/test_blobWorkers.html | 35 ++++++++++++++ 5 files changed, 67 insertions(+), 41 deletions(-) create mode 100644 dom/workers/test/test_blobWorkers.html diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp index 1cf45b73542..8381ce86a23 100644 --- a/dom/workers/ScriptLoader.cpp +++ b/dom/workers/ScriptLoader.cpp @@ -460,8 +460,7 @@ public: // worker's primary script. if (mIsWorkerScript) { // Take care of the base URI first. - rv = mWorkerPrivate->SetBaseURI(finalURI); - NS_ENSURE_SUCCESS(rv, rv); + mWorkerPrivate->SetBaseURI(finalURI); // Now to figure out which principal to give this worker. WorkerPrivate* parent = mWorkerPrivate->GetParent(); diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 5fccee66c38..2538b64b0a5 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -2082,69 +2082,62 @@ WorkerPrivateParent::UpdateGCZeal(JSContext* aCx, PRUint8 aGCZeal) #endif template -nsresult +void WorkerPrivateParent::SetBaseURI(nsIURI* aBaseURI) { AssertIsOnMainThread(); mBaseURI = aBaseURI; - nsCOMPtr url(do_QueryInterface(aBaseURI)); - NS_ENSURE_TRUE(url, NS_ERROR_NO_INTERFACE); + if (NS_FAILED(aBaseURI->GetSpec(mLocationInfo.mHref))) { + mLocationInfo.mHref.Truncate(); + } - nsresult rv = url->GetSpec(mLocationInfo.mHref); - NS_ENSURE_SUCCESS(rv, rv); + if (NS_FAILED(aBaseURI->GetHost(mLocationInfo.mHostname))) { + mLocationInfo.mHostname.Truncate(); + } - rv = url->GetHost(mLocationInfo.mHostname); - NS_ENSURE_SUCCESS(rv, rv); - - rv = url->GetPath(mLocationInfo.mPathname); - NS_ENSURE_SUCCESS(rv, rv); + if (NS_FAILED(aBaseURI->GetPath(mLocationInfo.mPathname))) { + mLocationInfo.mPathname.Truncate(); + } nsCString temp; - rv = url->GetQuery(temp); - NS_ENSURE_SUCCESS(rv, rv); - - if (!temp.IsEmpty()) { + nsCOMPtr url(do_QueryInterface(aBaseURI)); + if (url && NS_SUCCEEDED(url->GetQuery(temp)) && !temp.IsEmpty()) { mLocationInfo.mSearch.AssignLiteral("?"); mLocationInfo.mSearch.Append(temp); } - rv = url->GetRef(temp); - NS_ENSURE_SUCCESS(rv, rv); - - if (!temp.IsEmpty()) { - nsAutoString unicodeRef; - + if (NS_SUCCEEDED(aBaseURI->GetRef(temp)) && !temp.IsEmpty()) { nsCOMPtr converter = - do_GetService(NS_ITEXTTOSUBURI_CONTRACTID, &rv); - if (NS_SUCCEEDED(rv)) { + do_GetService(NS_ITEXTTOSUBURI_CONTRACTID); + if (converter) { nsCString charset; - rv = url->GetOriginCharset(charset); - if (NS_SUCCEEDED(rv)) { - rv = converter->UnEscapeURIForUI(charset, temp, unicodeRef); - if (NS_SUCCEEDED(rv)) { - mLocationInfo.mHash.AssignLiteral("#"); - mLocationInfo.mHash.Append(NS_ConvertUTF16toUTF8(unicodeRef)); - } + nsAutoString unicodeRef; + if (NS_SUCCEEDED(aBaseURI->GetOriginCharset(charset)) && + NS_SUCCEEDED(converter->UnEscapeURIForUI(charset, temp, + unicodeRef))) { + mLocationInfo.mHash.AssignLiteral("#"); + mLocationInfo.mHash.Append(NS_ConvertUTF16toUTF8(unicodeRef)); } } - if (NS_FAILED(rv)) { + if (mLocationInfo.mHash.IsEmpty()) { mLocationInfo.mHash.AssignLiteral("#"); mLocationInfo.mHash.Append(temp); } } - rv = url->GetScheme(mLocationInfo.mProtocol); - NS_ENSURE_SUCCESS(rv, rv); - - mLocationInfo.mProtocol.AppendLiteral(":"); + if (NS_SUCCEEDED(aBaseURI->GetScheme(mLocationInfo.mProtocol))) { + mLocationInfo.mProtocol.AppendLiteral(":"); + } + else { + mLocationInfo.mProtocol.Truncate(); + } PRInt32 port; - rv = url->GetPort(&port); - if (NS_SUCCEEDED(rv) && port != -1) { + if (NS_SUCCEEDED(aBaseURI->GetPort(&port)) && port != -1) { mLocationInfo.mPort.AppendInt(port); nsCAutoString host(mLocationInfo.mHostname); @@ -2156,8 +2149,6 @@ WorkerPrivateParent::SetBaseURI(nsIURI* aBaseURI) else { mLocationInfo.mHost.Assign(mLocationInfo.mHostname); } - - return NS_OK; } template diff --git a/dom/workers/WorkerPrivate.h b/dom/workers/WorkerPrivate.h index 9812d2c580f..c1fa0046d6e 100644 --- a/dom/workers/WorkerPrivate.h +++ b/dom/workers/WorkerPrivate.h @@ -375,7 +375,7 @@ public: return mBaseURI; } - nsresult + void SetBaseURI(nsIURI* aBaseURI); nsIURI* diff --git a/dom/workers/test/Makefile.in b/dom/workers/test/Makefile.in index 2b73b74043f..ea7b2ab0006 100644 --- a/dom/workers/test/Makefile.in +++ b/dom/workers/test/Makefile.in @@ -55,6 +55,7 @@ _TEST_FILES = \ test_404.html \ test_atob.html \ atob_worker.js \ + test_blobWorkers.html \ test_close.html \ close_worker.js \ test_errorPropagation.html \ diff --git a/dom/workers/test/test_blobWorkers.html b/dom/workers/test/test_blobWorkers.html new file mode 100644 index 00000000000..dba65ad1bec --- /dev/null +++ b/dom/workers/test/test_blobWorkers.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + From aba35a0387c0ad70ef09105f6eb0009c9e7e5026 Mon Sep 17 00:00:00 2001 From: Tom Schuster Date: Thu, 3 Nov 2011 21:57:32 +0100 Subject: [PATCH 014/127] Bug 698584 - Fix crash in RegExp.test in case of OOM. r=mrbkap --HG-- extra : rebase_source : 832a69bf6a5e3d8d5f4e334646850ad3207714a9 --- js/src/builtin/RegExp.cpp | 2 ++ js/src/jit-test/tests/basic/bug698584.js | 14 ++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 js/src/jit-test/tests/basic/bug698584.js diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp index 6b38e772988..6829db9d868 100644 --- a/js/src/builtin/RegExp.cpp +++ b/js/src/builtin/RegExp.cpp @@ -535,6 +535,8 @@ ExecuteRegExp(JSContext *cx, Native native, uintN argc, Value *vp) /* Step 3. */ JSLinearString *linearInput = input->ensureLinear(cx); + if (!linearInput) + return false; const jschar *chars = linearInput->chars(); size_t length = input->length(); diff --git a/js/src/jit-test/tests/basic/bug698584.js b/js/src/jit-test/tests/basic/bug698584.js new file mode 100644 index 00000000000..b575900d1e6 --- /dev/null +++ b/js/src/jit-test/tests/basic/bug698584.js @@ -0,0 +1,14 @@ +// |jit-test| allow-oom +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + */ + +const MAX = 10000; +var str = ""; +for (var i = 0; i < MAX; ++i) { + /x/.test(str); + str += str + 'xxxxxxxxxxxxxx'; +} + +/* Don't crash */ From 4d3a0a1061bea1170055d83424aafe1a2a048d6e Mon Sep 17 00:00:00 2001 From: Tom Schuster Date: Thu, 3 Nov 2011 21:58:06 +0100 Subject: [PATCH 015/127] Bug 430927 - Don't decompile to \0 as it was incorrectly interpreted as octal. r=waldo --HG-- extra : rebase_source : 354646d3fd2a28fd5b538f988f3b51aa98925728 --- js/src/jsopcode.cpp | 3 +-- js/src/tests/js1_8_5/extensions/jstests.list | 1 + js/src/tests/js1_8_5/extensions/toSource-0.js | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 js/src/tests/js1_8_5/extensions/toSource-0.js diff --git a/js/src/jsopcode.cpp b/js/src/jsopcode.cpp index a432bbbf6aa..5f76e63a8de 100644 --- a/js/src/jsopcode.cpp +++ b/js/src/jsopcode.cpp @@ -804,7 +804,6 @@ const char js_EscapeMap[] = { '"', '"', '\'', '\'', '\\', '\\', - '\0', '0' }; #define DONT_ESCAPE 0x10000 @@ -852,7 +851,7 @@ QuoteString(Sprinter *sp, JSString *str, uint32 quote) /* Use js_EscapeMap, \u, or \x only if necessary. */ bool ok; const char *e; - if (!(c >> 8) && (e = strchr(js_EscapeMap, (int)c)) != NULL) { + if (!(c >> 8) && c != 0 && (e = strchr(js_EscapeMap, (int)c)) != NULL) { ok = dontEscape ? Sprint(sp, "%c", (char)c) >= 0 : Sprint(sp, "\\%c", e[1]) >= 0; diff --git a/js/src/tests/js1_8_5/extensions/jstests.list b/js/src/tests/js1_8_5/extensions/jstests.list index 0a65eb71e18..8328ad2782e 100644 --- a/js/src/tests/js1_8_5/extensions/jstests.list +++ b/js/src/tests/js1_8_5/extensions/jstests.list @@ -62,3 +62,4 @@ skip-if(!xulRuntime.shell) script regress-696109.js script regress-691746.js script regress-697515.js script correct-this-for-nonnatives-on-array-proto-chain.js +script toSource-0.js diff --git a/js/src/tests/js1_8_5/extensions/toSource-0.js b/js/src/tests/js1_8_5/extensions/toSource-0.js new file mode 100644 index 00000000000..cdec97be4c9 --- /dev/null +++ b/js/src/tests/js1_8_5/extensions/toSource-0.js @@ -0,0 +1,14 @@ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + */ + +assertEq(eval(uneval('\x001')), '\x001'); + +f = eval('(' + (function () { return '\x001'; }).toString() + ')'); +assertEq(f(), '\x001'); + +assertEq(eval('\x001'.toSource()) == '\x001', true); + +if (typeof reportCompare === 'function') + reportCompare(true, true); From 05faba4b37f509a2b97727874aac3f113c1f2c66 Mon Sep 17 00:00:00 2001 From: Taras Glek Date: Fri, 4 Nov 2011 10:07:24 -0700 Subject: [PATCH 016/127] Bug 697860: Telemetry prompt should be tri-state r=gavin --- browser/components/nsBrowserGlue.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index f02916608e1..d851d67119b 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -761,6 +761,7 @@ BrowserGlue.prototype = { _showTelemetryNotification: function BG__showTelemetryNotification() { const PREF_TELEMETRY_PROMPTED = "toolkit.telemetry.prompted"; const PREF_TELEMETRY_ENABLED = "toolkit.telemetry.enabled"; + const PREF_TELEMETRY_REJECTED = "toolkit.telemetry.rejected"; const PREF_TELEMETRY_INFOURL = "toolkit.telemetry.infoURL"; const PREF_TELEMETRY_SERVER_OWNER = "toolkit.telemetry.server_owner"; // This is used to reprompt users when privacy message changes @@ -803,7 +804,9 @@ BrowserGlue.prototype = { label: browserBundle.GetStringFromName("telemetryNoButtonLabel"), accessKey: browserBundle.GetStringFromName("telemetryNoButtonAccessKey"), popup: null, - callback: function(aNotificationBar, aButton) {} + callback: function(aNotificationBar, aButton) { + Services.prefs.setBoolPref(PREF_TELEMETRY_REJECTED, true); + } } ]; @@ -811,6 +814,7 @@ BrowserGlue.prototype = { Services.prefs.setIntPref(PREF_TELEMETRY_PROMPTED, TELEMETRY_PROMPT_REV); var notification = notifyBox.appendNotification(telemetryPrompt, "telemetry", null, notifyBox.PRIORITY_INFO_LOW, buttons); + notification.setAttribute("hideclose", true); notification.persistence = 6; // arbitrary number, just so bar sticks around for a bit let XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; From 78842b8d6a61d74e6ad2ace6fc54dbae7bc5c641 Mon Sep 17 00:00:00 2001 From: Tom Schuster Date: Fri, 4 Nov 2011 18:50:09 +0100 Subject: [PATCH 017/127] Backout 8b394bdb306f because of test failures --- js/src/builtin/RegExp.cpp | 2 -- js/src/jit-test/tests/basic/bug698584.js | 14 -------------- 2 files changed, 16 deletions(-) delete mode 100644 js/src/jit-test/tests/basic/bug698584.js diff --git a/js/src/builtin/RegExp.cpp b/js/src/builtin/RegExp.cpp index 6829db9d868..6b38e772988 100644 --- a/js/src/builtin/RegExp.cpp +++ b/js/src/builtin/RegExp.cpp @@ -535,8 +535,6 @@ ExecuteRegExp(JSContext *cx, Native native, uintN argc, Value *vp) /* Step 3. */ JSLinearString *linearInput = input->ensureLinear(cx); - if (!linearInput) - return false; const jschar *chars = linearInput->chars(); size_t length = input->length(); diff --git a/js/src/jit-test/tests/basic/bug698584.js b/js/src/jit-test/tests/basic/bug698584.js deleted file mode 100644 index b575900d1e6..00000000000 --- a/js/src/jit-test/tests/basic/bug698584.js +++ /dev/null @@ -1,14 +0,0 @@ -// |jit-test| allow-oom -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - */ - -const MAX = 10000; -var str = ""; -for (var i = 0; i < MAX; ++i) { - /x/.test(str); - str += str + 'xxxxxxxxxxxxxx'; -} - -/* Don't crash */ From 7db3eee58c718610d70f9fdeddec0765ce31aefd Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 4 Nov 2011 13:57:39 -0400 Subject: [PATCH 018/127] Bug 698495 followup: deal with uint32 being inconsistently defined by JS and NSPR in ways that break the Win64 build. r=waldo pending --- js/src/jsproxy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/jsproxy.h b/js/src/jsproxy.h index 2f3b374f3ba..3b8c4feb2ae 100644 --- a/js/src/jsproxy.h +++ b/js/src/jsproxy.h @@ -89,7 +89,7 @@ class JS_FRIEND_API(ProxyHandler) { virtual void finalize(JSContext *cx, JSObject *proxy); virtual void trace(JSTracer *trc, JSObject *proxy); virtual bool getElementIfPresent(JSContext *cx, JSObject *obj, JSObject *receiver, - uint32 index, Value *vp, bool *present); + JSUint32 index, Value *vp, bool *present); virtual bool isOuterWindow() { return false; From 50cabf49cbd39c1a79712cf55a18d63273c09350 Mon Sep 17 00:00:00 2001 From: Ben Turner Date: Fri, 4 Nov 2011 10:57:42 -0700 Subject: [PATCH 019/127] Bug 699857 - 'Workers: Allow data urls'. r=sicking. --- dom/workers/ScriptLoader.cpp | 31 +++++++++++++++++++----- dom/workers/test/Makefile.in | 1 + dom/workers/test/importScripts_worker.js | 5 +++- dom/workers/test/test_dataURLWorker.html | 31 ++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 7 deletions(-) create mode 100644 dom/workers/test/test_dataURLWorker.html diff --git a/dom/workers/ScriptLoader.cpp b/dom/workers/ScriptLoader.cpp index 8381ce86a23..92f2d860a60 100644 --- a/dom/workers/ScriptLoader.cpp +++ b/dom/workers/ScriptLoader.cpp @@ -329,10 +329,21 @@ public: // If this script loader is being used to make a new worker then we need // to do a same-origin check. Otherwise we need to clear the load with the // security manager. - rv = mIsWorkerScript ? - principal->CheckMayLoad(uri, false): - secMan->CheckLoadURIWithPrincipal(principal, uri, 0); - NS_ENSURE_SUCCESS(rv, rv); + if (mIsWorkerScript) { + nsCString scheme; + rv = uri->GetScheme(scheme); + NS_ENSURE_SUCCESS(rv, rv); + + // We exempt data URLs from the same origin check. + if (!scheme.EqualsLiteral("data")) { + rv = principal->CheckMayLoad(uri, false); + NS_ENSURE_SUCCESS(rv, rv); + } + } + else { + rv = secMan->CheckLoadURIWithPrincipal(principal, uri, 0); + NS_ENSURE_SUCCESS(rv, rv); + } // We need to know which index we're on in OnStreamComplete so we know // where to put the result. @@ -505,8 +516,16 @@ public: return NS_ERROR_DOM_BAD_URI; } } - else if (NS_FAILED(loadPrincipal->CheckMayLoad(finalURI, false))) { - return NS_ERROR_DOM_BAD_URI; + else { + nsCString scheme; + rv = finalURI->GetScheme(scheme); + NS_ENSURE_SUCCESS(rv, rv); + + // We exempt data urls again. + if (!scheme.EqualsLiteral("data") && + NS_FAILED(loadPrincipal->CheckMayLoad(finalURI, false))) { + return NS_ERROR_DOM_BAD_URI; + } } mWorkerPrivate->SetPrincipal(channelPrincipal); diff --git a/dom/workers/test/Makefile.in b/dom/workers/test/Makefile.in index ea7b2ab0006..990d9431d46 100644 --- a/dom/workers/test/Makefile.in +++ b/dom/workers/test/Makefile.in @@ -58,6 +58,7 @@ _TEST_FILES = \ test_blobWorkers.html \ test_close.html \ close_worker.js \ + test_dataURLWorker.html \ test_errorPropagation.html \ errorPropagation_iframe.html \ errorPropagation_worker.js \ diff --git a/dom/workers/test/importScripts_worker.js b/dom/workers/test/importScripts_worker.js index 48660d1df68..e14e934660f 100644 --- a/dom/workers/test/importScripts_worker.js +++ b/dom/workers/test/importScripts_worker.js @@ -40,13 +40,16 @@ function tryBadScripts() { } } +const url = "data:text/plain,const startResponse = 'started';"; +importScripts(url); + onmessage = function(event) { switch (event.data) { case 'start': importScripts("importScripts_worker_imported2.js"); importedScriptFunction2(); tryBadScripts(); - postMessage('started'); + postMessage(startResponse); break; case 'stop': tryBadScripts(); diff --git a/dom/workers/test/test_dataURLWorker.html b/dom/workers/test/test_dataURLWorker.html new file mode 100644 index 00000000000..1ff72424ff2 --- /dev/null +++ b/dom/workers/test/test_dataURLWorker.html @@ -0,0 +1,31 @@ + + + + + + + + + + + + From ba20334bf782edaa3fb2184e3ab7792a21cef983 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Fri, 4 Nov 2011 19:05:35 +0100 Subject: [PATCH 020/127] Bug 699383 - Remove unused 'aboveTextDecorations'. r=roc --- layout/generic/nsBlockFrame.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index bf7b9de51ee..560c892c44b 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -6122,7 +6122,6 @@ DisplayLine(nsDisplayListBuilder* aBuilder, const nsRect& aLineArea, nsDisplayListCollection collection; nsresult rv; - nsDisplayList aboveTextDecorations; // Block-level child backgrounds go on the blockBorderBackgrounds list ... // Inline-level child backgrounds go on the regular child content list. @@ -6137,8 +6136,6 @@ DisplayLine(nsDisplayListBuilder* aBuilder, const nsRect& aLineArea, kid = kid->GetNextSibling(); } - collection.Content()->AppendToTop(&aboveTextDecorations); - if (lineMayHaveTextOverflow) { aTextOverflow->ProcessLine(collection, aLine.get()); } From f38527e6da1be5c195ff5ee6631b5ff33ae03435 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Fri, 4 Nov 2011 19:05:35 +0100 Subject: [PATCH 021/127] Bug 671484 - Change 'ABORT: root should not have auto-height containing block' into an assertion for now to avoid aborting fuzz testing. r=roc --- layout/svg/base/src/nsSVGOuterSVGFrame.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp index 877fd154e27..efc9b066ded 100644 --- a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp @@ -337,8 +337,8 @@ nsSVGOuterSVGFrame::ComputeSize(nsRenderingContext *aRenderingContext, nsSVGLength2 &height = content->mLengthAttributes[nsSVGSVGElement::HEIGHT]; - NS_ABORT_IF_FALSE(aCBSize.height != NS_AUTOHEIGHT, - "root should not have auto-height containing block"); + NS_ASSERTION(aCBSize.height != NS_AUTOHEIGHT, + "root should not have auto-height containing block"); if (height.IsPercentage()) { NS_ABORT_IF_FALSE(intrinsicSize.height.GetUnit() == eStyleUnit_None, "GetIntrinsicSize should have reported no " From 8182182f64a6fa6d04022939850500522d1db986 Mon Sep 17 00:00:00 2001 From: Andreas Gal Date: Fri, 4 Nov 2011 19:05:35 +0100 Subject: [PATCH 022/127] Bug 693212 - Fix "Assertion failure: !cx->isExceptionPending()" by adding a missing ReportPendingException() call. r=bzbarsky --- dom/base/nsJSEnvironment.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 23e4324935f..79e62392c5f 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -1917,6 +1917,7 @@ nsJSContext::CallEventHandler(nsISupports* aTarget, JSObject* aScope, js::ForceFrame ff(mContext, funobj); if (!ac.enter(mContext, funobj) || !ff.enter() || !JS_WrapObject(mContext, &target)) { + ReportPendingException(); sSecurityManager->PopContextPrincipal(mContext); return NS_ERROR_FAILURE; } From f8fd4fce77aa89556cc5681855f0b20d95d75e25 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Fri, 4 Nov 2011 19:05:35 +0100 Subject: [PATCH 023/127] Bug 693212 - crash test. r=test-only --- content/base/crashtests/693212.xhtml | 16 ++++++++++++++++ content/base/crashtests/crashtests.list | 1 + 2 files changed, 17 insertions(+) create mode 100644 content/base/crashtests/693212.xhtml diff --git a/content/base/crashtests/693212.xhtml b/content/base/crashtests/693212.xhtml new file mode 100644 index 00000000000..6cc600d3b43 --- /dev/null +++ b/content/base/crashtests/693212.xhtml @@ -0,0 +1,16 @@ + + + + + + + + + diff --git a/content/base/crashtests/crashtests.list b/content/base/crashtests/crashtests.list index 7be996bc54a..263de8206d7 100644 --- a/content/base/crashtests/crashtests.list +++ b/content/base/crashtests/crashtests.list @@ -96,4 +96,5 @@ load 667336-1.html load 679459.html load 679689-1.html load 682463.html +load 693212.xhtml load 698974-1.html From 6215d8d96e511bc130aadf173e606e185cadba1e Mon Sep 17 00:00:00 2001 From: Felix Fung Date: Thu, 3 Nov 2011 15:25:55 -0700 Subject: [PATCH 024/127] Bug 397424 - Downloads cause high CPU usage. r=gavin This addresses an issue with the download manager that can cause high CPU usage when there is an active download. The underlying issue is the frequency of updates that the download progress listener receives. Things changed: - reduced the number of null checks in DownloadUtils.jsm's getDownloadStatus function by one (down to two from three). - obtain and format strings from the nsIStringBundle. This removes all the calls to String.replace in DownloadUtils.jsm. - modifies the download manager back-end to update the percentComplete and size property on downloads before dispatching a state changed notification for downloads entering the DOWNLOAD_DOWNLOADING state. This saves us two calls to setAttribute on downloads that we know how big they are, and saves us the same two calls to setAttribute for indeterminate downloads as well as not dispatching a ValueChange event on the progressmeter every time onProgressChange is called on the DownloadProgressListener. - has nsDownload implement nsIClassInfo so we do not need to QueryInterface when going through the list of active downloads in both the download manager's UI and the browser's taskbar UI. --- browser/base/content/browser.js | 2 +- .../downloads/nsDownloadManager.cpp | 16 +- .../mozapps/downloads/downloads.properties | 40 ++-- toolkit/mozapps/downloads/DownloadUtils.jsm | 195 ++++++------------ .../content/DownloadProgressListener.js | 40 ++-- .../mozapps/downloads/content/downloads.js | 2 +- 6 files changed, 130 insertions(+), 165 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 286d46faac1..13a8c8103a0 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -8190,7 +8190,7 @@ let DownloadMonitorPanel = { let maxTime = -Infinity; let dls = gDownloadMgr.activeDownloads; while (dls.hasMoreElements()) { - let dl = dls.getNext().QueryInterface(Ci.nsIDownload); + let dl = dls.getNext(); if (dl.state == gDownloadMgr.DOWNLOAD_DOWNLOADING) { // Figure out if this download takes longer if (dl.speed > 0 && dl.size > 0) diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp index 179768ad0f3..b41a2469a1f 100644 --- a/toolkit/components/downloads/nsDownloadManager.cpp +++ b/toolkit/components/downloads/nsDownloadManager.cpp @@ -46,6 +46,7 @@ #include "mozIStorageService.h" #include "nsIAlertsService.h" +#include "nsIClassInfoImpl.h" #include "nsIDOMWindow.h" #include "nsIDownloadHistory.h" #include "nsIDownloadManagerUI.h" @@ -2130,8 +2131,14 @@ nsDownloadManager::ConfirmCancelDownloads(PRInt32 aCount, //////////////////////////////////////////////////////////////////////////////// //// nsDownload -NS_IMPL_ISUPPORTS4(nsDownload, nsIDownload, nsITransfer, nsIWebProgressListener, - nsIWebProgressListener2) +NS_IMPL_CLASSINFO(nsDownload, NULL, 0, NS_DOWNLOAD_CID); +NS_IMPL_ISUPPORTS4_CI( + nsDownload + , nsIDownload + , nsITransfer + , nsIWebProgressListener + , nsIWebProgressListener2 +) nsDownload::nsDownload() : mDownloadState(nsIDownloadManager::DOWNLOAD_NOTSTARTED), mID(0), @@ -2399,6 +2406,11 @@ nsDownload::OnProgressChange64(nsIWebProgress *aWebProgress, if (resumableChannel) (void)resumableChannel->GetEntityID(mEntityID); + // Before we update the state and dispatch state notifications, we want to + // ensure that we have the correct state for this download with regards to + // its percent completion and size. + SetProgressBytes(0, aMaxTotalProgress); + // Update the state and the database rv = SetState(nsIDownloadManager::DOWNLOAD_DOWNLOADING); NS_ENSURE_SUCCESS(rv, rv); diff --git a/toolkit/locales/en-US/chrome/mozapps/downloads/downloads.properties b/toolkit/locales/en-US/chrome/mozapps/downloads/downloads.properties index c04dd51c13c..920fcde7b64 100644 --- a/toolkit/locales/en-US/chrome/mozapps/downloads/downloads.properties +++ b/toolkit/locales/en-US/chrome/mozapps/downloads/downloads.properties @@ -42,31 +42,37 @@ dontLeavePrivateBrowsingButton=Stay in Private Browsing Mode downloadsCompleteTitle=Downloads Complete downloadsCompleteMsg=All files have finished downloading. -# LOCALIZATION NOTE (statusFormat2): — is the "em dash" (long dash) -# #1 transfer progress; #2 rate number; #3 rate unit; #4 time left +# LOCALIZATION NOTE (statusFormat3): — is the "em dash" (long dash) +# %1$S transfer progress; %2$S rate number; %3$S rate unit; %4$S time left # example: 4 minutes left — 1.1 of 11.1 GB (2.2 MB/sec) -statusFormat2=#4 — #1 (#2 #3/sec) +statusFormat3=%4$S — %1$S (%2$S %3$S/sec) bytes=bytes kilobyte=KB megabyte=MB gigabyte=GB -# LOCALIZATION NOTE (transferSameUnits, transferDiffUnits, transferNoTotal): -# #1 progress number; #2 progress unit; #3 total number; #4 total unit -# examples: 1.1 of 333 MB; 11.1 MB of 3.3 GB; 111 KB -transferSameUnits=#1 of #3 #4 -transferDiffUnits=#1 #2 of #3 #4 -transferNoTotal=#1 #2 +# LOCALIZATION NOTE (transferSameUnits2): +# %1$S progress number; %2$S total number; %3$S total unit +# example: 1.1 of 333 MB +transferSameUnits2=%1$S of %2$S %3$S +# LOCALIZATION NOTE (transferDiffUnits2): +# %1$S progress number; %2$S progress unit; %3$S total number; %4$S total unit +# example: 11.1 MB of 3.3 GB +transferDiffUnits2=%1$S %2$S of %3$S %4$S +# LOCALIZATION NOTE (transferNoTotal2): +# %1$S progress number; %2$S unit +# example: 111 KB +transferNoTotal2=%1$S %2$S -# LOCALIZATION NOTE (timePair): #1 time number; #2 time unit +# LOCALIZATION NOTE (timePair2): %1$S time number; %2$S time unit # example: 1 minute; 11 hours -timePair=#1 #2 -# LOCALIZATION NOTE (timeLeftSingle): #1 time left +timePair2=%1$S %2$S +# LOCALIZATION NOTE (timeLeftSingle2): %1$S time left # example: 1 minute remaining; 11 hours remaining -timeLeftSingle=#1 remaining -# LOCALIZATION NOTE (timeLeftDouble): #1 time left; #2 time left sub units +timeLeftSingle2=%1$S remaining +# LOCALIZATION NOTE (timeLeftDouble2): %1$S time left; %2$S time left sub units # example: 11 hours, 2 minutes remaining; 1 day, 22 hours remaining -timeLeftDouble=#1, #2 remaining +timeLeftDouble2=%1$S, %2$S remaining timeFewSeconds=A few seconds remaining timeUnknown=Unknown time remaining @@ -79,7 +85,7 @@ doneStatus=#1 — #2 doneSize=#1 #2 doneSizeUnknown=Unknown size # LOCALIZATION NOTE (doneScheme): #1 URI scheme like data: jar: about: -doneScheme=#1 resource +doneScheme2=%1$S resource # LOCALIZATION NOTE (doneFileScheme): Special case of doneScheme for file: # This is used as an eTLD replacement for local files, so make it lower case doneFileScheme=local file @@ -95,7 +101,7 @@ stateDirty=Blocked: Download may contain a virus or spyware # LOCALIZATION NOTE (yesterday): Displayed time for files finished yesterday yesterday=Yesterday # LOCALIZATION NOTE (monthDate): #1 month name; #2 date number; e.g., January 22 -monthDate=#1 #2 +monthDate2=%1$S %2$S fileDoesNotExistOpenTitle=Cannot Open %S fileDoesNotExistShowTitle=Cannot Show %S diff --git a/toolkit/mozapps/downloads/DownloadUtils.jsm b/toolkit/mozapps/downloads/DownloadUtils.jsm index 39d925872ba..81b682f5921 100644 --- a/toolkit/mozapps/downloads/DownloadUtils.jsm +++ b/toolkit/mozapps/downloads/DownloadUtils.jsm @@ -1,4 +1,5 @@ -/* ***** BEGIN LICENSE BLOCK ***** +/* vim: sw=2 ts=2 sts=2 expandtab filetype=javascript + * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version @@ -84,76 +85,32 @@ __defineGetter__("gDecimalSymbol", function() { const kDownloadProperties = "chrome://mozapps/locale/downloads/downloads.properties"; -// These strings will be converted to the corresponding ones from the string -// bundle on use -let kStrings = { - statusFormat: "statusFormat2", - transferSameUnits: "transferSameUnits", - transferDiffUnits: "transferDiffUnits", - transferNoTotal: "transferNoTotal", - timePair: "timePair", - timeLeftSingle: "timeLeftSingle", - timeLeftDouble: "timeLeftDouble", +let gStr = { + statusFormat: "statusFormat3", + transferSameUnits: "transferSameUnits2", + transferDiffUnits: "transferDiffUnits2", + transferNoTotal: "transferNoTotal2", + timePair: "timePair2", + timeLeftSingle: "timeLeftSingle2", + timeLeftDouble: "timeLeftDouble2", timeFewSeconds: "timeFewSeconds", timeUnknown: "timeUnknown", - monthDate: "monthDate", + monthDate: "monthDate2", yesterday: "yesterday", - doneScheme: "doneScheme", + doneScheme: "doneScheme2", doneFileScheme: "doneFileScheme", units: ["bytes", "kilobyte", "megabyte", "gigabyte"], // Update timeSize in convertTimeUnits if changing the length of this array timeUnits: ["seconds", "minutes", "hours", "days"], }; -// This object will lazily load the strings defined in kStrings -let gStr = { - /** - * Initialize lazy string getters - */ - _init: function() - { - // Make each "name" a lazy-loading string that knows how to load itself. We - // need to locally scope name and value to keep them around for the getter. - for (let [name, value] in Iterator(kStrings)) - let ([n, v] = [name, value]) - gStr.__defineGetter__(n, function() gStr._getStr(n, v)); - }, - - /** - * Convert strings to those in the string bundle. This lazily loads the - * string bundle *once* only when used the first time. - */ - get _getStr() - { - // Delete the getter to be overwritten - delete gStr._getStr; - - // Lazily load the bundle into the closure on first call to _getStr - let getStr = Cc["@mozilla.org/intl/stringbundle;1"]. - getService(Ci.nsIStringBundleService). - createBundle(kDownloadProperties). - GetStringFromName; - - // _getStr is a function that sets string "name" to stringbundle's "value" - return gStr._getStr = function(name, value) { - // Delete the getter to be overwritten - delete gStr[name]; - - try { - // "name" is a string or array of the stringbundle-loaded "value" - return gStr[name] = typeof value == "string" ? - getStr(value) : - value.map(getStr); - } catch (e) { - log(["Couldn't get string '", name, "' from property '", value, "'"]); - // Don't return anything (undefined), and because we deleted ourselves, - // future accesses will also be undefined - } - }; - }, -}; -// Initialize the lazy string getters! -gStr._init(); +// This lazily initializes the string bundle upon first use. +__defineGetter__("gBundle", function() { + delete gBundle; + return this.gBundle = Cc["@mozilla.org/intl/stringbundle;1"]. + getService(Ci.nsIStringBundleService). + createBundle(kDownloadProperties); +}); // Keep track of at most this many second/lastSec pairs so that multiple calls // to getTimeLeft produce the same time left @@ -189,28 +146,14 @@ let DownloadUtils = { let seconds = (aSpeed > 0) && (aMaxBytes > 0) ? (aMaxBytes - aCurrBytes) / aSpeed : -1; - // Update the bytes transferred and bytes total - let status; - let (transfer = DownloadUtils.getTransferTotal(aCurrBytes, aMaxBytes)) { - // Insert 1 is the download progress - status = replaceInsert(gStr.statusFormat, 1, transfer); - } + let transfer = DownloadUtils.getTransferTotal(aCurrBytes, aMaxBytes); + let [rate, unit] = DownloadUtils.convertByteUnits(aSpeed); + let [timeLeft, newLast] = DownloadUtils.getTimeLeft(seconds, aLastSec); - // Update the download rate - let ([rate, unit] = DownloadUtils.convertByteUnits(aSpeed)) { - // Insert 2 is the download rate - status = replaceInsert(status, 2, rate); - // Insert 3 is the |unit|/sec - status = replaceInsert(status, 3, unit); - } - - // Update time remaining - let ([timeLeft, newLast] = DownloadUtils.getTimeLeft(seconds, aLastSec)) { - // Insert 4 is the time remaining - status = replaceInsert(status, 4, timeLeft); - - return [status, newLast]; - } + let params = [transfer, rate, unit, timeLeft]; + let status = gBundle.formatStringFromName(gStr.statusFormat, params, + params.length); + return [status, newLast]; }, /** @@ -233,20 +176,31 @@ let DownloadUtils = { let [total, totalUnits] = DownloadUtils.convertByteUnits(aMaxBytes); // Figure out which byte progress string to display - let transfer; - if (aMaxBytes < 0) - transfer = gStr.transferNoTotal; - else if (progressUnits == totalUnits) - transfer = gStr.transferSameUnits; - else - transfer = gStr.transferDiffUnits; + let name, values; + if (aMaxBytes < 0) { + name = gStr.transferNoTotal; + values = [ + progress, + progressUnits, + ]; + } else if (progressUnits == totalUnits) { + name = gStr.transferSameUnits; + values = [ + progress, + total, + totalUnits, + ]; + } else { + name = gStr.transferDiffUnits; + values = [ + progress, + progressUnits, + total, + totalUnits, + ]; + } - transfer = replaceInsert(transfer, 1, progress); - transfer = replaceInsert(transfer, 2, progressUnits); - transfer = replaceInsert(transfer, 3, total); - transfer = replaceInsert(transfer, 4, totalUnits); - - return transfer; + return gBundle.formatStringFromName(name, values, values.length); }, /** @@ -267,7 +221,7 @@ let DownloadUtils = { aLastSec = Infinity; if (aSeconds < 0) - return [gStr.timeUnknown, aLastSec]; + return [gBundle.GetStringFromName(gStr.timeUnknown), aLastSec]; // Try to find a cached lastSec for the given second aLastSec = gCachedLast.reduce(function(aResult, aItem) @@ -300,25 +254,26 @@ let DownloadUtils = { let timeLeft; if (aSeconds < 4) { // Be friendly in the last few seconds - timeLeft = gStr.timeFewSeconds; + timeLeft = gBundle.GetStringFromName(gStr.timeFewSeconds); } else { // Convert the seconds into its two largest units to display let [time1, unit1, time2, unit2] = DownloadUtils.convertTimeUnits(aSeconds); - let pair1 = replaceInsert(gStr.timePair, 1, time1); - pair1 = replaceInsert(pair1, 2, unit1); - let pair2 = replaceInsert(gStr.timePair, 1, time2); - pair2 = replaceInsert(pair2, 2, unit2); + let pair1 = + gBundle.formatStringFromName(gStr.timePair, [time1, unit1], 2); + let pair2 = + gBundle.formatStringFromName(gStr.timePair, [time2, unit2], 2); // Only show minutes for under 1 hour unless there's a few minutes left; // or the second pair is 0. if ((aSeconds < 3600 && time1 >= 4) || time2 == 0) { - timeLeft = replaceInsert(gStr.timeLeftSingle, 1, pair1); + timeLeft = gBundle.formatStringFromName(gStr.timeLeftSingle, + [pair1], 1); } else { // We've got 2 pairs of times to display - timeLeft = replaceInsert(gStr.timeLeftDouble, 1, pair1); - timeLeft = replaceInsert(timeLeft, 2, pair2); + timeLeft = gBundle.formatStringFromName(gStr.timeLeftDouble, + [pair1, pair2], 2); } } @@ -364,7 +319,7 @@ let DownloadUtils = { 0); } else if (today - aDate < (24 * 60 * 60 * 1000)) { // After yesterday started, show yesterday - dateTimeCompact = gStr.yesterday; + dateTimeCompact = gBundle.GetStringFromName(gStr.yesterday); } else if (today - aDate < (6 * 24 * 60 * 60 * 1000)) { // After last week started, show day of week dateTimeCompact = aDate.toLocaleFormat("%A"); @@ -373,8 +328,7 @@ let DownloadUtils = { let month = aDate.toLocaleFormat("%B"); // Remove leading 0 by converting the date string to a number let date = Number(aDate.toLocaleFormat("%d")); - dateTimeCompact = replaceInsert(gStr.monthDate, 1, month); - dateTimeCompact = replaceInsert(dateTimeCompact, 2, date); + dateTimeCompact = gBundle.formatStringFromName(gStr.monthDate, [month, date], 2); } let dateTimeFull = dts.FormatDateTime("", @@ -437,11 +391,12 @@ let DownloadUtils = { // Check if we need to show something else for the host if (uri.scheme == "file") { // Display special text for file protocol - displayHost = gStr.doneFileScheme; + displayHost = gBundle.GetStringFromName(gStr.doneFileScheme); fullHost = displayHost; } else if (displayHost.length == 0) { // Got nothing; show the scheme (data: about: moz-icon:) - displayHost = replaceInsert(gStr.doneScheme, 1, uri.scheme); + displayHost = + gBundle.formatStringFromName(gStr.doneScheme, [uri.scheme], 1); fullHost = displayHost; } else if (uri.port != -1) { // Tack on the port if it's not the default port @@ -479,7 +434,7 @@ let DownloadUtils = { if (gDecimalSymbol != ".") aBytes = aBytes.replace(".", gDecimalSymbol); - return [aBytes, gStr.units[unitIndex]]; + return [aBytes, gBundle.GetStringFromName(gStr.units[unitIndex])]; }, /** @@ -552,23 +507,7 @@ function convertTimeUnitsUnits(aTime, aIndex) if (aIndex < 0) return ""; - return PluralForm.get(aTime, gStr.timeUnits[aIndex]); -} - -/** - * Private helper function to replace a placeholder string with a real string - * - * @param aText - * Source text containing placeholder (e.g., #1) - * @param aIndex - * Index number of placeholder to replace - * @param aValue - * New string to put in place of placeholder - * @return The string with placeholder replaced with the new string - */ -function replaceInsert(aText, aIndex, aValue) -{ - return aText.replace("#" + aIndex, aValue); + return PluralForm.get(aTime, gBundle.GetStringFromName(gStr.timeUnits[aIndex])); } /** diff --git a/toolkit/mozapps/downloads/content/DownloadProgressListener.js b/toolkit/mozapps/downloads/content/DownloadProgressListener.js index d1ae908f294..b345b36ac38 100644 --- a/toolkit/mozapps/downloads/content/DownloadProgressListener.js +++ b/toolkit/mozapps/downloads/content/DownloadProgressListener.js @@ -63,6 +63,7 @@ DownloadProgressListener.prototype = { // Update window title in-case we don't get all progress notifications onUpdateProgress(); + let dl; let state = aDownload.state; switch (state) { case nsIDM.DOWNLOAD_QUEUED: @@ -82,16 +83,26 @@ DownloadProgressListener.prototype = { if (state == nsIDM.DOWNLOAD_FINISHED) autoRemoveAndClose(aDownload); break; + case nsIDM.DOWNLOAD_DOWNLOADING: { + dl = getDownload(aDownload.id); + + // At this point, we know if we are an indeterminate download or not + dl.setAttribute("progressmode", aDownload.percentComplete == -1 ? + "undetermined" : "normal"); + + // As well as knowing the referrer + let referrer = aDownload.referrer; + if (referrer) + dl.setAttribute("referrer", referrer.spec); + + break; + } } // autoRemoveAndClose could have already closed our window... try { - let dl = getDownload(aDownload.id); - - // We should eventually know the referrer at some point - let referrer = aDownload.referrer; - if (referrer) - dl.setAttribute("referrer", referrer.spec); + if (!dl) + dl = getDownload(aDownload.id); // Update to the new state dl.setAttribute("state", state); @@ -112,18 +123,15 @@ DownloadProgressListener.prototype = { var download = getDownload(aDownload.id); // Update this download's progressmeter - if (aDownload.percentComplete == -1) { - download.setAttribute("progressmode", "undetermined"); - } else { - download.setAttribute("progressmode", "normal"); + if (aDownload.percentComplete != -1) { download.setAttribute("progress", aDownload.percentComplete); - } - // Dispatch ValueChange for a11y - var event = document.createEvent("Events"); - event.initEvent("ValueChange", true, true); - document.getAnonymousElementByAttribute(download, "anonid", "progressmeter") - .dispatchEvent(event); + // Dispatch ValueChange for a11y + let event = document.createEvent("Events"); + event.initEvent("ValueChange", true, true); + document.getAnonymousElementByAttribute(download, "anonid", "progressmeter") + .dispatchEvent(event); + } // Update the progress so the status can be correctly updated download.setAttribute("currBytes", aDownload.amountTransferred); diff --git a/toolkit/mozapps/downloads/content/downloads.js b/toolkit/mozapps/downloads/content/downloads.js index 481594d486c..7bd7ec8109c 100644 --- a/toolkit/mozapps/downloads/content/downloads.js +++ b/toolkit/mozapps/downloads/content/downloads.js @@ -411,7 +411,7 @@ function onUpdateProgress() var base = 0; var dls = gDownloadManager.activeDownloads; while (dls.hasMoreElements()) { - let dl = dls.getNext().QueryInterface(Ci.nsIDownload); + let dl = dls.getNext(); if (dl.percentComplete < 100 && dl.size > 0) { mean += dl.amountTransferred; base += dl.size; From b64e5ed6389f71bb82cb9eb9424dff5627b0f41a Mon Sep 17 00:00:00 2001 From: Kai Engert Date: Fri, 4 Nov 2011 20:01:14 +0100 Subject: [PATCH 025/127] Bug 698753, Distrust two Malaysian Sub-CAs. r=rrelyea --- security/nss/lib/ckfw/builtins/certdata.c | 286 +++++++++++++++++++- security/nss/lib/ckfw/builtins/certdata.txt | 281 +++++++++++++++++++ security/nss/lib/ckfw/builtins/nssckbi.h | 4 +- 3 files changed, 564 insertions(+), 7 deletions(-) diff --git a/security/nss/lib/ckfw/builtins/certdata.c b/security/nss/lib/ckfw/builtins/certdata.c index 3bbdde29e06..e5aed96303b 100644 --- a/security/nss/lib/ckfw/builtins/certdata.c +++ b/security/nss/lib/ckfw/builtins/certdata.c @@ -35,7 +35,7 @@ * * ***** END LICENSE BLOCK ***** */ #ifdef DEBUG -static const char CVS_ID[] = "@(#) $RCSfile: certdata.c,v $ $Revision: 1.82 $ $Date: 2011/09/02 19:40:56 $""; @(#) $RCSfile: certdata.c,v $ $Revision: 1.82 $ $Date: 2011/09/02 19:40:56 $"; +static const char CVS_ID[] = "@(#) $RCSfile: certdata.txt,v $ $Revision: 1.79 $ $Date: 2011/09/02 19:40:56 $""; @(#) $RCSfile: certdata.perl,v $ $Revision: 1.13 $ $Date: 2010/03/26 22:06:47 $"; #endif /* DEBUG */ #ifndef BUILTINS_H @@ -1075,6 +1075,18 @@ static const CK_ATTRIBUTE_TYPE nss_builtins_types_338 [] = { static const CK_ATTRIBUTE_TYPE nss_builtins_types_339 [] = { CKA_CLASS, CKA_TOKEN, CKA_PRIVATE, CKA_MODIFIABLE, CKA_LABEL, CKA_CERT_SHA1_HASH, CKA_CERT_MD5_HASH, CKA_ISSUER, CKA_SERIAL_NUMBER, CKA_TRUST_SERVER_AUTH, CKA_TRUST_EMAIL_PROTECTION, CKA_TRUST_CODE_SIGNING, CKA_TRUST_STEP_UP_APPROVED }; +static const CK_ATTRIBUTE_TYPE nss_builtins_types_340 [] = { + CKA_CLASS, CKA_TOKEN, CKA_PRIVATE, CKA_MODIFIABLE, CKA_LABEL, CKA_CERTIFICATE_TYPE, CKA_SUBJECT, CKA_ID, CKA_ISSUER, CKA_SERIAL_NUMBER, CKA_VALUE +}; +static const CK_ATTRIBUTE_TYPE nss_builtins_types_341 [] = { + CKA_CLASS, CKA_TOKEN, CKA_PRIVATE, CKA_MODIFIABLE, CKA_LABEL, CKA_CERT_SHA1_HASH, CKA_CERT_MD5_HASH, CKA_ISSUER, CKA_SERIAL_NUMBER, CKA_TRUST_SERVER_AUTH, CKA_TRUST_EMAIL_PROTECTION, CKA_TRUST_CODE_SIGNING, CKA_TRUST_STEP_UP_APPROVED +}; +static const CK_ATTRIBUTE_TYPE nss_builtins_types_342 [] = { + CKA_CLASS, CKA_TOKEN, CKA_PRIVATE, CKA_MODIFIABLE, CKA_LABEL, CKA_CERTIFICATE_TYPE, CKA_SUBJECT, CKA_ID, CKA_ISSUER, CKA_SERIAL_NUMBER, CKA_VALUE +}; +static const CK_ATTRIBUTE_TYPE nss_builtins_types_343 [] = { + CKA_CLASS, CKA_TOKEN, CKA_PRIVATE, CKA_MODIFIABLE, CKA_LABEL, CKA_CERT_SHA1_HASH, CKA_CERT_MD5_HASH, CKA_ISSUER, CKA_SERIAL_NUMBER, CKA_TRUST_SERVER_AUTH, CKA_TRUST_EMAIL_PROTECTION, CKA_TRUST_CODE_SIGNING, CKA_TRUST_STEP_UP_APPROVED +}; #ifdef DEBUG static const NSSItem nss_builtins_items_0 [] = { { (void *)&cko_data, (PRUint32)sizeof(CK_OBJECT_CLASS) }, @@ -1083,7 +1095,7 @@ static const NSSItem nss_builtins_items_0 [] = { { (void *)&ck_false, (PRUint32)sizeof(CK_BBOOL) }, { (void *)"CVS ID", (PRUint32)7 }, { (void *)"NSS", (PRUint32)4 }, - { (void *)"@(#) $RCSfile: certdata.c,v $ $Revision: 1.82 $ $Date: 2011/09/02 19:40:56 $""; @(#) $RCSfile: certdata.c,v $ $Revision: 1.82 $ $Date: 2011/09/02 19:40:56 $", (PRUint32)160 } + { (void *)"@(#) $RCSfile: certdata.txt,v $ $Revision: 1.79 $ $Date: 2011/09/02 19:40:56 $""; @(#) $RCSfile: certdata.perl,v $ $Revision: 1.13 $ $Date: 2010/03/26 22:06:47 $", (PRUint32)160 } }; #endif /* DEBUG */ static const NSSItem nss_builtins_items_1 [] = { @@ -22600,6 +22612,266 @@ static const NSSItem nss_builtins_items_339 [] = { { (void *)&ckt_nss_not_trusted, (PRUint32)sizeof(CK_TRUST) }, { (void *)&ck_false, (PRUint32)sizeof(CK_BBOOL) } }; +static const NSSItem nss_builtins_items_340 [] = { + { (void *)&cko_certificate, (PRUint32)sizeof(CK_OBJECT_CLASS) }, + { (void *)&ck_true, (PRUint32)sizeof(CK_BBOOL) }, + { (void *)&ck_false, (PRUint32)sizeof(CK_BBOOL) }, + { (void *)&ck_false, (PRUint32)sizeof(CK_BBOOL) }, + { (void *)"Explicitly Distrusted Malaysian Digicert Sdn. Bhd. (cyb)", (PRUint32)57 }, + { (void *)&ckc_x_509, (PRUint32)sizeof(CK_CERTIFICATE_TYPE) }, + { (void *)"\060\143\061\013\060\011\006\003\125\004\006\023\002\115\131\061" +"\033\060\031\006\003\125\004\012\023\022\104\151\147\151\143\145" +"\162\164\040\123\144\156\056\040\102\150\144\056\061\021\060\017" +"\006\003\125\004\013\023\010\064\065\067\066\060\070\055\113\061" +"\044\060\042\006\003\125\004\003\023\033\104\151\147\151\163\151" +"\147\156\040\123\145\162\166\145\162\040\111\104\040\050\105\156" +"\162\151\143\150\051" +, (PRUint32)101 }, + { (void *)"0", (PRUint32)2 }, + { (void *)"\060\165\061\013\060\011\006\003\125\004\006\023\002\125\123\061" +"\030\060\026\006\003\125\004\012\023\017\107\124\105\040\103\157" +"\162\160\157\162\141\164\151\157\156\061\047\060\045\006\003\125" +"\004\013\023\036\107\124\105\040\103\171\142\145\162\124\162\165" +"\163\164\040\123\157\154\165\164\151\157\156\163\054\040\111\156" +"\143\056\061\043\060\041\006\003\125\004\003\023\032\107\124\105" +"\040\103\171\142\145\162\124\162\165\163\164\040\107\154\157\142" +"\141\154\040\122\157\157\164" +, (PRUint32)119 }, + { (void *)"\002\006\007\377\377\377\377\377" +, (PRUint32)8 }, + { (void *)"\060\202\003\315\060\202\003\066\240\003\002\001\002\002\006\007" +"\377\377\377\377\377\060\015\006\011\052\206\110\206\367\015\001" +"\001\005\005\000\060\165\061\013\060\011\006\003\125\004\006\023" +"\002\125\123\061\030\060\026\006\003\125\004\012\023\017\107\124" +"\105\040\103\157\162\160\157\162\141\164\151\157\156\061\047\060" +"\045\006\003\125\004\013\023\036\107\124\105\040\103\171\142\145" +"\162\124\162\165\163\164\040\123\157\154\165\164\151\157\156\163" +"\054\040\111\156\143\056\061\043\060\041\006\003\125\004\003\023" +"\032\107\124\105\040\103\171\142\145\162\124\162\165\163\164\040" +"\107\154\157\142\141\154\040\122\157\157\164\060\036\027\015\060" +"\067\060\067\061\067\061\065\061\067\064\071\132\027\015\061\062" +"\060\067\061\067\061\065\061\066\065\065\132\060\143\061\013\060" +"\011\006\003\125\004\006\023\002\115\131\061\033\060\031\006\003" +"\125\004\012\023\022\104\151\147\151\143\145\162\164\040\123\144" +"\156\056\040\102\150\144\056\061\021\060\017\006\003\125\004\013" +"\023\010\064\065\067\066\060\070\055\113\061\044\060\042\006\003" +"\125\004\003\023\033\104\151\147\151\163\151\147\156\040\123\145" +"\162\166\145\162\040\111\104\040\050\105\156\162\151\143\150\051" +"\060\201\237\060\015\006\011\052\206\110\206\367\015\001\001\001" +"\005\000\003\201\215\000\060\201\211\002\201\201\000\255\250\144" +"\113\115\207\307\204\131\271\373\220\106\240\246\211\300\361\376" +"\325\332\124\202\067\015\231\053\105\046\012\350\126\260\177\312" +"\250\364\216\107\204\001\202\051\343\263\152\265\221\363\373\225" +"\205\274\162\250\144\350\012\100\234\305\364\161\256\173\173\152" +"\007\352\220\024\117\215\211\257\224\253\262\006\324\002\152\173" +"\230\037\131\271\072\315\124\372\040\337\262\052\012\351\270\335" +"\151\220\300\051\323\116\320\227\355\146\314\305\031\111\006\177" +"\372\136\054\174\173\205\033\062\102\337\173\225\045\002\003\001" +"\000\001\243\202\001\170\060\202\001\164\060\022\006\003\125\035" +"\023\001\001\377\004\010\060\006\001\001\377\002\001\000\060\134" +"\006\003\125\035\040\004\125\060\123\060\110\006\011\053\006\001" +"\004\001\261\076\001\000\060\073\060\071\006\010\053\006\001\005" +"\005\007\002\001\026\055\150\164\164\160\072\057\057\143\171\142" +"\145\162\164\162\165\163\164\056\157\155\156\151\162\157\157\164" +"\056\143\157\155\057\162\145\160\157\163\151\164\157\162\171\056" +"\143\146\155\060\007\006\005\140\203\112\001\001\060\016\006\003" +"\125\035\017\001\001\377\004\004\003\002\001\346\060\201\211\006" +"\003\125\035\043\004\201\201\060\177\241\171\244\167\060\165\061" +"\013\060\011\006\003\125\004\006\023\002\125\123\061\030\060\026" +"\006\003\125\004\012\023\017\107\124\105\040\103\157\162\160\157" +"\162\141\164\151\157\156\061\047\060\045\006\003\125\004\013\023" +"\036\107\124\105\040\103\171\142\145\162\124\162\165\163\164\040" +"\123\157\154\165\164\151\157\156\163\054\040\111\156\143\056\061" +"\043\060\041\006\003\125\004\003\023\032\107\124\105\040\103\171" +"\142\145\162\124\162\165\163\164\040\107\154\157\142\141\154\040" +"\122\157\157\164\202\002\001\245\060\105\006\003\125\035\037\004" +"\076\060\074\060\072\240\070\240\066\206\064\150\164\164\160\072" +"\057\057\167\167\167\056\160\165\142\154\151\143\055\164\162\165" +"\163\164\056\143\157\155\057\143\147\151\055\142\151\156\057\103" +"\122\114\057\062\060\061\070\057\143\144\160\056\143\162\154\060" +"\035\006\003\125\035\016\004\026\004\024\306\026\223\116\026\027" +"\354\026\256\214\224\166\363\206\155\305\164\156\204\167\060\015" +"\006\011\052\206\110\206\367\015\001\001\005\005\000\003\201\201" +"\000\166\000\173\246\170\053\146\035\216\136\066\306\244\216\005" +"\362\043\222\174\223\147\323\364\300\012\175\213\055\331\352\325" +"\157\032\363\341\112\051\132\042\204\115\120\057\113\014\362\377" +"\205\302\173\125\324\104\202\276\155\254\147\216\274\264\037\222" +"\234\121\200\032\024\366\156\253\141\210\013\255\034\177\367\113" +"\120\121\326\145\033\246\107\161\025\136\260\161\363\065\024\362" +"\067\275\143\310\325\360\223\132\064\137\330\075\350\135\367\305" +"\036\300\345\317\037\206\044\251\074\007\146\315\301\322\066\143" +"\131" +, (PRUint32)977 } +}; +static const NSSItem nss_builtins_items_341 [] = { + { (void *)&cko_nss_trust, (PRUint32)sizeof(CK_OBJECT_CLASS) }, + { (void *)&ck_true, (PRUint32)sizeof(CK_BBOOL) }, + { (void *)&ck_false, (PRUint32)sizeof(CK_BBOOL) }, + { (void *)&ck_false, (PRUint32)sizeof(CK_BBOOL) }, + { (void *)"Explicitly Distrusted Malaysian Digicert Sdn. Bhd. (cyb)", (PRUint32)57 }, + { (void *)"\125\120\257\354\277\350\303\255\304\013\343\255\014\247\344\025" +"\214\071\131\117" +, (PRUint32)20 }, + { (void *)"\322\336\256\120\244\230\055\157\067\267\206\122\310\055\113\152" +, (PRUint32)16 }, + { (void *)"\060\165\061\013\060\011\006\003\125\004\006\023\002\125\123\061" +"\030\060\026\006\003\125\004\012\023\017\107\124\105\040\103\157" +"\162\160\157\162\141\164\151\157\156\061\047\060\045\006\003\125" +"\004\013\023\036\107\124\105\040\103\171\142\145\162\124\162\165" +"\163\164\040\123\157\154\165\164\151\157\156\163\054\040\111\156" +"\143\056\061\043\060\041\006\003\125\004\003\023\032\107\124\105" +"\040\103\171\142\145\162\124\162\165\163\164\040\107\154\157\142" +"\141\154\040\122\157\157\164" +, (PRUint32)119 }, + { (void *)"\002\006\007\377\377\377\377\377" +, (PRUint32)8 }, + { (void *)&ckt_nss_not_trusted, (PRUint32)sizeof(CK_TRUST) }, + { (void *)&ckt_nss_not_trusted, (PRUint32)sizeof(CK_TRUST) }, + { (void *)&ckt_nss_not_trusted, (PRUint32)sizeof(CK_TRUST) }, + { (void *)&ck_false, (PRUint32)sizeof(CK_BBOOL) } +}; +static const NSSItem nss_builtins_items_342 [] = { + { (void *)&cko_certificate, (PRUint32)sizeof(CK_OBJECT_CLASS) }, + { (void *)&ck_true, (PRUint32)sizeof(CK_BBOOL) }, + { (void *)&ck_false, (PRUint32)sizeof(CK_BBOOL) }, + { (void *)&ck_false, (PRUint32)sizeof(CK_BBOOL) }, + { (void *)"Explicitly Distrusted Malaysian Digicert Sdn. Bhd. (en)", (PRUint32)56 }, + { (void *)&ckc_x_509, (PRUint32)sizeof(CK_CERTIFICATE_TYPE) }, + { (void *)"\060\145\061\013\060\011\006\003\125\004\006\023\002\115\131\061" +"\033\060\031\006\003\125\004\012\023\022\104\151\147\151\143\145" +"\162\164\040\123\144\156\056\040\102\150\144\056\061\021\060\017" +"\006\003\125\004\013\023\010\064\065\067\066\060\070\055\113\061" +"\046\060\044\006\003\125\004\003\023\035\104\151\147\151\163\151" +"\147\156\040\123\145\162\166\145\162\040\111\104\040\055\040\050" +"\105\156\162\151\143\150\051" +, (PRUint32)103 }, + { (void *)"0", (PRUint32)2 }, + { (void *)"\060\201\264\061\024\060\022\006\003\125\004\012\023\013\105\156" +"\164\162\165\163\164\056\156\145\164\061\100\060\076\006\003\125" +"\004\013\024\067\167\167\167\056\145\156\164\162\165\163\164\056" +"\156\145\164\057\103\120\123\137\062\060\064\070\040\151\156\143" +"\157\162\160\056\040\142\171\040\162\145\146\056\040\050\154\151" +"\155\151\164\163\040\154\151\141\142\056\051\061\045\060\043\006" +"\003\125\004\013\023\034\050\143\051\040\061\071\071\071\040\105" +"\156\164\162\165\163\164\056\156\145\164\040\114\151\155\151\164" +"\145\144\061\063\060\061\006\003\125\004\003\023\052\105\156\164" +"\162\165\163\164\056\156\145\164\040\103\145\162\164\151\146\151" +"\143\141\164\151\157\156\040\101\165\164\150\157\162\151\164\171" +"\040\050\062\060\064\070\051" +, (PRUint32)183 }, + { (void *)"\002\006\007\377\377\377\377\377" +, (PRUint32)8 }, + { (void *)"\060\202\004\320\060\202\003\270\240\003\002\001\002\002\006\007" +"\377\377\377\377\377\060\015\006\011\052\206\110\206\367\015\001" +"\001\005\005\000\060\201\264\061\024\060\022\006\003\125\004\012" +"\023\013\105\156\164\162\165\163\164\056\156\145\164\061\100\060" +"\076\006\003\125\004\013\024\067\167\167\167\056\145\156\164\162" +"\165\163\164\056\156\145\164\057\103\120\123\137\062\060\064\070" +"\040\151\156\143\157\162\160\056\040\142\171\040\162\145\146\056" +"\040\050\154\151\155\151\164\163\040\154\151\141\142\056\051\061" +"\045\060\043\006\003\125\004\013\023\034\050\143\051\040\061\071" +"\071\071\040\105\156\164\162\165\163\164\056\156\145\164\040\114" +"\151\155\151\164\145\144\061\063\060\061\006\003\125\004\003\023" +"\052\105\156\164\162\165\163\164\056\156\145\164\040\103\145\162" +"\164\151\146\151\143\141\164\151\157\156\040\101\165\164\150\157" +"\162\151\164\171\040\050\062\060\064\070\051\060\036\027\015\061" +"\060\060\067\061\066\061\067\062\063\063\070\132\027\015\061\065" +"\060\067\061\066\061\067\065\063\063\070\132\060\145\061\013\060" +"\011\006\003\125\004\006\023\002\115\131\061\033\060\031\006\003" +"\125\004\012\023\022\104\151\147\151\143\145\162\164\040\123\144" +"\156\056\040\102\150\144\056\061\021\060\017\006\003\125\004\013" +"\023\010\064\065\067\066\060\070\055\113\061\046\060\044\006\003" +"\125\004\003\023\035\104\151\147\151\163\151\147\156\040\123\145" +"\162\166\145\162\040\111\104\040\055\040\050\105\156\162\151\143" +"\150\051\060\202\001\042\060\015\006\011\052\206\110\206\367\015" +"\001\001\001\005\000\003\202\001\017\000\060\202\001\012\002\202" +"\001\001\000\305\211\344\364\015\006\100\222\131\307\032\263\065" +"\321\016\114\052\063\371\370\257\312\236\177\356\271\247\155\140" +"\364\124\350\157\325\233\363\033\143\061\004\150\162\321\064\026" +"\214\264\027\054\227\336\163\305\330\220\025\240\032\053\365\313" +"\263\110\206\104\360\035\210\114\316\101\102\032\357\365\014\336" +"\376\100\332\071\040\367\006\125\072\152\235\106\301\322\157\245" +"\262\310\127\076\051\243\234\340\351\205\167\146\350\230\247\044" +"\176\276\300\131\040\345\104\157\266\127\330\276\316\302\145\167" +"\130\306\141\101\321\164\004\310\177\111\102\305\162\251\162\026" +"\356\214\335\022\135\264\112\324\321\257\120\267\330\252\165\166" +"\150\255\076\135\252\060\155\141\250\253\020\133\076\023\277\063" +"\340\257\104\235\070\042\133\357\114\057\246\161\046\025\046\312" +"\050\214\331\372\216\216\251\242\024\065\342\233\044\210\264\364" +"\177\205\235\203\117\007\241\266\024\220\066\304\064\034\215\046" +"\141\155\023\157\170\276\350\217\047\307\113\204\226\243\206\150" +"\014\043\276\013\354\214\224\000\251\004\212\023\220\367\337\205" +"\154\014\261\002\003\001\000\001\243\202\001\064\060\202\001\060" +"\060\016\006\003\125\035\017\001\001\377\004\004\003\002\001\006" +"\060\022\006\003\125\035\023\001\001\377\004\010\060\006\001\001" +"\377\002\001\000\060\047\006\003\125\035\045\004\040\060\036\006" +"\010\053\006\001\005\005\007\003\001\006\010\053\006\001\005\005" +"\007\003\002\006\010\053\006\001\005\005\007\003\004\060\063\006" +"\010\053\006\001\005\005\007\001\001\004\047\060\045\060\043\006" +"\010\053\006\001\005\005\007\060\001\206\027\150\164\164\160\072" +"\057\057\157\143\163\160\056\145\156\164\162\165\163\164\056\156" +"\145\164\060\104\006\003\125\035\040\004\075\060\073\060\071\006" +"\005\140\203\112\001\001\060\060\060\056\006\010\053\006\001\005" +"\005\007\002\001\026\042\150\164\164\160\072\057\057\167\167\167" +"\056\144\151\147\151\143\145\162\164\056\143\157\155\056\155\171" +"\057\143\160\163\056\150\164\155\060\062\006\003\125\035\037\004" +"\053\060\051\060\047\240\045\240\043\206\041\150\164\164\160\072" +"\057\057\143\162\154\056\145\156\164\162\165\163\164\056\156\145" +"\164\057\062\060\064\070\143\141\056\143\162\154\060\021\006\003" +"\125\035\016\004\012\004\010\114\116\314\045\050\003\051\201\060" +"\037\006\003\125\035\043\004\030\060\026\200\024\125\344\201\321" +"\021\200\276\330\211\271\010\243\061\371\241\044\011\026\271\160" +"\060\015\006\011\052\206\110\206\367\015\001\001\005\005\000\003" +"\202\001\001\000\227\114\357\112\072\111\254\162\374\060\040\153" +"\264\051\133\247\305\225\004\220\371\062\325\302\205\152\336\003" +"\241\067\371\211\000\260\132\254\125\176\333\103\065\377\311\001" +"\370\121\276\314\046\312\310\152\244\304\124\076\046\036\347\014" +"\243\315\227\147\224\335\246\102\353\134\315\217\071\171\153\063" +"\171\041\006\171\372\202\104\025\231\314\301\267\071\323\106\142" +"\174\262\160\353\157\316\040\252\076\031\267\351\164\202\234\264" +"\245\113\115\141\000\067\344\207\322\362\024\072\144\174\270\251" +"\173\141\340\223\042\347\325\237\076\107\346\066\166\240\123\330" +"\000\003\072\017\265\063\376\226\312\323\322\202\072\056\335\327" +"\110\341\344\247\151\314\034\351\231\112\347\312\160\105\327\013" +"\007\016\232\165\033\320\057\222\157\366\244\007\303\275\034\113" +"\246\204\266\175\250\232\251\322\247\051\361\013\127\151\036\227" +"\127\046\354\053\103\254\324\105\203\005\000\351\343\360\106\100" +"\007\372\352\261\121\163\223\034\245\335\123\021\067\310\052\247" +"\025\047\035\264\252\314\177\252\061\060\374\270\105\237\110\011" +"\355\020\342\305" +, (PRUint32)1236 } +}; +static const NSSItem nss_builtins_items_343 [] = { + { (void *)&cko_nss_trust, (PRUint32)sizeof(CK_OBJECT_CLASS) }, + { (void *)&ck_true, (PRUint32)sizeof(CK_BBOOL) }, + { (void *)&ck_false, (PRUint32)sizeof(CK_BBOOL) }, + { (void *)&ck_false, (PRUint32)sizeof(CK_BBOOL) }, + { (void *)"Explicitly Distrusted Malaysian Digicert Sdn. Bhd. (en)", (PRUint32)56 }, + { (void *)"\153\074\073\200\255\312\246\272\212\237\124\246\172\355\022\151" +"\005\155\061\046" +, (PRUint32)20 }, + { (void *)"\327\151\141\177\065\017\234\106\243\252\353\370\125\374\204\362" +, (PRUint32)16 }, + { (void *)"\060\201\264\061\024\060\022\006\003\125\004\012\023\013\105\156" +"\164\162\165\163\164\056\156\145\164\061\100\060\076\006\003\125" +"\004\013\024\067\167\167\167\056\145\156\164\162\165\163\164\056" +"\156\145\164\057\103\120\123\137\062\060\064\070\040\151\156\143" +"\157\162\160\056\040\142\171\040\162\145\146\056\040\050\154\151" +"\155\151\164\163\040\154\151\141\142\056\051\061\045\060\043\006" +"\003\125\004\013\023\034\050\143\051\040\061\071\071\071\040\105" +"\156\164\162\165\163\164\056\156\145\164\040\114\151\155\151\164" +"\145\144\061\063\060\061\006\003\125\004\003\023\052\105\156\164" +"\162\165\163\164\056\156\145\164\040\103\145\162\164\151\146\151" +"\143\141\164\151\157\156\040\101\165\164\150\157\162\151\164\171" +"\040\050\062\060\064\070\051" +, (PRUint32)183 }, + { (void *)"\002\006\007\377\377\377\377\377" +, (PRUint32)8 }, + { (void *)&ckt_nss_not_trusted, (PRUint32)sizeof(CK_TRUST) }, + { (void *)&ckt_nss_not_trusted, (PRUint32)sizeof(CK_TRUST) }, + { (void *)&ckt_nss_not_trusted, (PRUint32)sizeof(CK_TRUST) }, + { (void *)&ck_false, (PRUint32)sizeof(CK_BBOOL) } +}; builtinsInternalObject nss_builtins_data[] = { @@ -22944,11 +23216,15 @@ nss_builtins_data[] = { { 11, nss_builtins_types_336, nss_builtins_items_336, {NULL} }, { 13, nss_builtins_types_337, nss_builtins_items_337, {NULL} }, { 11, nss_builtins_types_338, nss_builtins_items_338, {NULL} }, - { 13, nss_builtins_types_339, nss_builtins_items_339, {NULL} } + { 13, nss_builtins_types_339, nss_builtins_items_339, {NULL} }, + { 11, nss_builtins_types_340, nss_builtins_items_340, {NULL} }, + { 13, nss_builtins_types_341, nss_builtins_items_341, {NULL} }, + { 11, nss_builtins_types_342, nss_builtins_items_342, {NULL} }, + { 13, nss_builtins_types_343, nss_builtins_items_343, {NULL} } }; const PRUint32 #ifdef DEBUG - nss_builtins_nObjects = 339+1; + nss_builtins_nObjects = 343+1; #else - nss_builtins_nObjects = 339; + nss_builtins_nObjects = 343; #endif /* DEBUG */ diff --git a/security/nss/lib/ckfw/builtins/certdata.txt b/security/nss/lib/ckfw/builtins/certdata.txt index d81be890324..ef6ab23f078 100644 --- a/security/nss/lib/ckfw/builtins/certdata.txt +++ b/security/nss/lib/ckfw/builtins/certdata.txt @@ -23299,3 +23299,284 @@ CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_NOT_TRUSTED CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_NOT_TRUSTED CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_NOT_TRUSTED CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE + +# +# Certificate "Explicitly Distrusted Malaysian Digicert Sdn. Bhd. (cyb)" +# +CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "Explicitly Distrusted Malaysian Digicert Sdn. Bhd. (cyb)" +CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 +CKA_SUBJECT MULTILINE_OCTAL +\060\143\061\013\060\011\006\003\125\004\006\023\002\115\131\061 +\033\060\031\006\003\125\004\012\023\022\104\151\147\151\143\145 +\162\164\040\123\144\156\056\040\102\150\144\056\061\021\060\017 +\006\003\125\004\013\023\010\064\065\067\066\060\070\055\113\061 +\044\060\042\006\003\125\004\003\023\033\104\151\147\151\163\151 +\147\156\040\123\145\162\166\145\162\040\111\104\040\050\105\156 +\162\151\143\150\051 +END +CKA_ID UTF8 "0" +CKA_ISSUER MULTILINE_OCTAL +\060\165\061\013\060\011\006\003\125\004\006\023\002\125\123\061 +\030\060\026\006\003\125\004\012\023\017\107\124\105\040\103\157 +\162\160\157\162\141\164\151\157\156\061\047\060\045\006\003\125 +\004\013\023\036\107\124\105\040\103\171\142\145\162\124\162\165 +\163\164\040\123\157\154\165\164\151\157\156\163\054\040\111\156 +\143\056\061\043\060\041\006\003\125\004\003\023\032\107\124\105 +\040\103\171\142\145\162\124\162\165\163\164\040\107\154\157\142 +\141\154\040\122\157\157\164 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\006\007\377\377\377\377\377 +END +CKA_VALUE MULTILINE_OCTAL +\060\202\003\315\060\202\003\066\240\003\002\001\002\002\006\007 +\377\377\377\377\377\060\015\006\011\052\206\110\206\367\015\001 +\001\005\005\000\060\165\061\013\060\011\006\003\125\004\006\023 +\002\125\123\061\030\060\026\006\003\125\004\012\023\017\107\124 +\105\040\103\157\162\160\157\162\141\164\151\157\156\061\047\060 +\045\006\003\125\004\013\023\036\107\124\105\040\103\171\142\145 +\162\124\162\165\163\164\040\123\157\154\165\164\151\157\156\163 +\054\040\111\156\143\056\061\043\060\041\006\003\125\004\003\023 +\032\107\124\105\040\103\171\142\145\162\124\162\165\163\164\040 +\107\154\157\142\141\154\040\122\157\157\164\060\036\027\015\060 +\067\060\067\061\067\061\065\061\067\064\071\132\027\015\061\062 +\060\067\061\067\061\065\061\066\065\065\132\060\143\061\013\060 +\011\006\003\125\004\006\023\002\115\131\061\033\060\031\006\003 +\125\004\012\023\022\104\151\147\151\143\145\162\164\040\123\144 +\156\056\040\102\150\144\056\061\021\060\017\006\003\125\004\013 +\023\010\064\065\067\066\060\070\055\113\061\044\060\042\006\003 +\125\004\003\023\033\104\151\147\151\163\151\147\156\040\123\145 +\162\166\145\162\040\111\104\040\050\105\156\162\151\143\150\051 +\060\201\237\060\015\006\011\052\206\110\206\367\015\001\001\001 +\005\000\003\201\215\000\060\201\211\002\201\201\000\255\250\144 +\113\115\207\307\204\131\271\373\220\106\240\246\211\300\361\376 +\325\332\124\202\067\015\231\053\105\046\012\350\126\260\177\312 +\250\364\216\107\204\001\202\051\343\263\152\265\221\363\373\225 +\205\274\162\250\144\350\012\100\234\305\364\161\256\173\173\152 +\007\352\220\024\117\215\211\257\224\253\262\006\324\002\152\173 +\230\037\131\271\072\315\124\372\040\337\262\052\012\351\270\335 +\151\220\300\051\323\116\320\227\355\146\314\305\031\111\006\177 +\372\136\054\174\173\205\033\062\102\337\173\225\045\002\003\001 +\000\001\243\202\001\170\060\202\001\164\060\022\006\003\125\035 +\023\001\001\377\004\010\060\006\001\001\377\002\001\000\060\134 +\006\003\125\035\040\004\125\060\123\060\110\006\011\053\006\001 +\004\001\261\076\001\000\060\073\060\071\006\010\053\006\001\005 +\005\007\002\001\026\055\150\164\164\160\072\057\057\143\171\142 +\145\162\164\162\165\163\164\056\157\155\156\151\162\157\157\164 +\056\143\157\155\057\162\145\160\157\163\151\164\157\162\171\056 +\143\146\155\060\007\006\005\140\203\112\001\001\060\016\006\003 +\125\035\017\001\001\377\004\004\003\002\001\346\060\201\211\006 +\003\125\035\043\004\201\201\060\177\241\171\244\167\060\165\061 +\013\060\011\006\003\125\004\006\023\002\125\123\061\030\060\026 +\006\003\125\004\012\023\017\107\124\105\040\103\157\162\160\157 +\162\141\164\151\157\156\061\047\060\045\006\003\125\004\013\023 +\036\107\124\105\040\103\171\142\145\162\124\162\165\163\164\040 +\123\157\154\165\164\151\157\156\163\054\040\111\156\143\056\061 +\043\060\041\006\003\125\004\003\023\032\107\124\105\040\103\171 +\142\145\162\124\162\165\163\164\040\107\154\157\142\141\154\040 +\122\157\157\164\202\002\001\245\060\105\006\003\125\035\037\004 +\076\060\074\060\072\240\070\240\066\206\064\150\164\164\160\072 +\057\057\167\167\167\056\160\165\142\154\151\143\055\164\162\165 +\163\164\056\143\157\155\057\143\147\151\055\142\151\156\057\103 +\122\114\057\062\060\061\070\057\143\144\160\056\143\162\154\060 +\035\006\003\125\035\016\004\026\004\024\306\026\223\116\026\027 +\354\026\256\214\224\166\363\206\155\305\164\156\204\167\060\015 +\006\011\052\206\110\206\367\015\001\001\005\005\000\003\201\201 +\000\166\000\173\246\170\053\146\035\216\136\066\306\244\216\005 +\362\043\222\174\223\147\323\364\300\012\175\213\055\331\352\325 +\157\032\363\341\112\051\132\042\204\115\120\057\113\014\362\377 +\205\302\173\125\324\104\202\276\155\254\147\216\274\264\037\222 +\234\121\200\032\024\366\156\253\141\210\013\255\034\177\367\113 +\120\121\326\145\033\246\107\161\025\136\260\161\363\065\024\362 +\067\275\143\310\325\360\223\132\064\137\330\075\350\135\367\305 +\036\300\345\317\037\206\044\251\074\007\146\315\301\322\066\143 +\131 +END + +# Trust for Certificate "Explicitly Distrusted Malaysian Digicert Sdn. Bhd. (cyb)" +CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "Explicitly Distrusted Malaysian Digicert Sdn. Bhd. (cyb)" +CKA_CERT_SHA1_HASH MULTILINE_OCTAL +\125\120\257\354\277\350\303\255\304\013\343\255\014\247\344\025 +\214\071\131\117 +END +CKA_CERT_MD5_HASH MULTILINE_OCTAL +\322\336\256\120\244\230\055\157\067\267\206\122\310\055\113\152 +END +CKA_ISSUER MULTILINE_OCTAL +\060\165\061\013\060\011\006\003\125\004\006\023\002\125\123\061 +\030\060\026\006\003\125\004\012\023\017\107\124\105\040\103\157 +\162\160\157\162\141\164\151\157\156\061\047\060\045\006\003\125 +\004\013\023\036\107\124\105\040\103\171\142\145\162\124\162\165 +\163\164\040\123\157\154\165\164\151\157\156\163\054\040\111\156 +\143\056\061\043\060\041\006\003\125\004\003\023\032\107\124\105 +\040\103\171\142\145\162\124\162\165\163\164\040\107\154\157\142 +\141\154\040\122\157\157\164 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\006\007\377\377\377\377\377 +END +CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_NOT_TRUSTED +CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_NOT_TRUSTED +CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_NOT_TRUSTED +CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE + +# +# Certificate "Explicitly Distrusted Malaysian Digicert Sdn. Bhd. (en)" +# +CKA_CLASS CK_OBJECT_CLASS CKO_CERTIFICATE +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "Explicitly Distrusted Malaysian Digicert Sdn. Bhd. (en)" +CKA_CERTIFICATE_TYPE CK_CERTIFICATE_TYPE CKC_X_509 +CKA_SUBJECT MULTILINE_OCTAL +\060\145\061\013\060\011\006\003\125\004\006\023\002\115\131\061 +\033\060\031\006\003\125\004\012\023\022\104\151\147\151\143\145 +\162\164\040\123\144\156\056\040\102\150\144\056\061\021\060\017 +\006\003\125\004\013\023\010\064\065\067\066\060\070\055\113\061 +\046\060\044\006\003\125\004\003\023\035\104\151\147\151\163\151 +\147\156\040\123\145\162\166\145\162\040\111\104\040\055\040\050 +\105\156\162\151\143\150\051 +END +CKA_ID UTF8 "0" +CKA_ISSUER MULTILINE_OCTAL +\060\201\264\061\024\060\022\006\003\125\004\012\023\013\105\156 +\164\162\165\163\164\056\156\145\164\061\100\060\076\006\003\125 +\004\013\024\067\167\167\167\056\145\156\164\162\165\163\164\056 +\156\145\164\057\103\120\123\137\062\060\064\070\040\151\156\143 +\157\162\160\056\040\142\171\040\162\145\146\056\040\050\154\151 +\155\151\164\163\040\154\151\141\142\056\051\061\045\060\043\006 +\003\125\004\013\023\034\050\143\051\040\061\071\071\071\040\105 +\156\164\162\165\163\164\056\156\145\164\040\114\151\155\151\164 +\145\144\061\063\060\061\006\003\125\004\003\023\052\105\156\164 +\162\165\163\164\056\156\145\164\040\103\145\162\164\151\146\151 +\143\141\164\151\157\156\040\101\165\164\150\157\162\151\164\171 +\040\050\062\060\064\070\051 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\006\007\377\377\377\377\377 +END +CKA_VALUE MULTILINE_OCTAL +\060\202\004\320\060\202\003\270\240\003\002\001\002\002\006\007 +\377\377\377\377\377\060\015\006\011\052\206\110\206\367\015\001 +\001\005\005\000\060\201\264\061\024\060\022\006\003\125\004\012 +\023\013\105\156\164\162\165\163\164\056\156\145\164\061\100\060 +\076\006\003\125\004\013\024\067\167\167\167\056\145\156\164\162 +\165\163\164\056\156\145\164\057\103\120\123\137\062\060\064\070 +\040\151\156\143\157\162\160\056\040\142\171\040\162\145\146\056 +\040\050\154\151\155\151\164\163\040\154\151\141\142\056\051\061 +\045\060\043\006\003\125\004\013\023\034\050\143\051\040\061\071 +\071\071\040\105\156\164\162\165\163\164\056\156\145\164\040\114 +\151\155\151\164\145\144\061\063\060\061\006\003\125\004\003\023 +\052\105\156\164\162\165\163\164\056\156\145\164\040\103\145\162 +\164\151\146\151\143\141\164\151\157\156\040\101\165\164\150\157 +\162\151\164\171\040\050\062\060\064\070\051\060\036\027\015\061 +\060\060\067\061\066\061\067\062\063\063\070\132\027\015\061\065 +\060\067\061\066\061\067\065\063\063\070\132\060\145\061\013\060 +\011\006\003\125\004\006\023\002\115\131\061\033\060\031\006\003 +\125\004\012\023\022\104\151\147\151\143\145\162\164\040\123\144 +\156\056\040\102\150\144\056\061\021\060\017\006\003\125\004\013 +\023\010\064\065\067\066\060\070\055\113\061\046\060\044\006\003 +\125\004\003\023\035\104\151\147\151\163\151\147\156\040\123\145 +\162\166\145\162\040\111\104\040\055\040\050\105\156\162\151\143 +\150\051\060\202\001\042\060\015\006\011\052\206\110\206\367\015 +\001\001\001\005\000\003\202\001\017\000\060\202\001\012\002\202 +\001\001\000\305\211\344\364\015\006\100\222\131\307\032\263\065 +\321\016\114\052\063\371\370\257\312\236\177\356\271\247\155\140 +\364\124\350\157\325\233\363\033\143\061\004\150\162\321\064\026 +\214\264\027\054\227\336\163\305\330\220\025\240\032\053\365\313 +\263\110\206\104\360\035\210\114\316\101\102\032\357\365\014\336 +\376\100\332\071\040\367\006\125\072\152\235\106\301\322\157\245 +\262\310\127\076\051\243\234\340\351\205\167\146\350\230\247\044 +\176\276\300\131\040\345\104\157\266\127\330\276\316\302\145\167 +\130\306\141\101\321\164\004\310\177\111\102\305\162\251\162\026 +\356\214\335\022\135\264\112\324\321\257\120\267\330\252\165\166 +\150\255\076\135\252\060\155\141\250\253\020\133\076\023\277\063 +\340\257\104\235\070\042\133\357\114\057\246\161\046\025\046\312 +\050\214\331\372\216\216\251\242\024\065\342\233\044\210\264\364 +\177\205\235\203\117\007\241\266\024\220\066\304\064\034\215\046 +\141\155\023\157\170\276\350\217\047\307\113\204\226\243\206\150 +\014\043\276\013\354\214\224\000\251\004\212\023\220\367\337\205 +\154\014\261\002\003\001\000\001\243\202\001\064\060\202\001\060 +\060\016\006\003\125\035\017\001\001\377\004\004\003\002\001\006 +\060\022\006\003\125\035\023\001\001\377\004\010\060\006\001\001 +\377\002\001\000\060\047\006\003\125\035\045\004\040\060\036\006 +\010\053\006\001\005\005\007\003\001\006\010\053\006\001\005\005 +\007\003\002\006\010\053\006\001\005\005\007\003\004\060\063\006 +\010\053\006\001\005\005\007\001\001\004\047\060\045\060\043\006 +\010\053\006\001\005\005\007\060\001\206\027\150\164\164\160\072 +\057\057\157\143\163\160\056\145\156\164\162\165\163\164\056\156 +\145\164\060\104\006\003\125\035\040\004\075\060\073\060\071\006 +\005\140\203\112\001\001\060\060\060\056\006\010\053\006\001\005 +\005\007\002\001\026\042\150\164\164\160\072\057\057\167\167\167 +\056\144\151\147\151\143\145\162\164\056\143\157\155\056\155\171 +\057\143\160\163\056\150\164\155\060\062\006\003\125\035\037\004 +\053\060\051\060\047\240\045\240\043\206\041\150\164\164\160\072 +\057\057\143\162\154\056\145\156\164\162\165\163\164\056\156\145 +\164\057\062\060\064\070\143\141\056\143\162\154\060\021\006\003 +\125\035\016\004\012\004\010\114\116\314\045\050\003\051\201\060 +\037\006\003\125\035\043\004\030\060\026\200\024\125\344\201\321 +\021\200\276\330\211\271\010\243\061\371\241\044\011\026\271\160 +\060\015\006\011\052\206\110\206\367\015\001\001\005\005\000\003 +\202\001\001\000\227\114\357\112\072\111\254\162\374\060\040\153 +\264\051\133\247\305\225\004\220\371\062\325\302\205\152\336\003 +\241\067\371\211\000\260\132\254\125\176\333\103\065\377\311\001 +\370\121\276\314\046\312\310\152\244\304\124\076\046\036\347\014 +\243\315\227\147\224\335\246\102\353\134\315\217\071\171\153\063 +\171\041\006\171\372\202\104\025\231\314\301\267\071\323\106\142 +\174\262\160\353\157\316\040\252\076\031\267\351\164\202\234\264 +\245\113\115\141\000\067\344\207\322\362\024\072\144\174\270\251 +\173\141\340\223\042\347\325\237\076\107\346\066\166\240\123\330 +\000\003\072\017\265\063\376\226\312\323\322\202\072\056\335\327 +\110\341\344\247\151\314\034\351\231\112\347\312\160\105\327\013 +\007\016\232\165\033\320\057\222\157\366\244\007\303\275\034\113 +\246\204\266\175\250\232\251\322\247\051\361\013\127\151\036\227 +\127\046\354\053\103\254\324\105\203\005\000\351\343\360\106\100 +\007\372\352\261\121\163\223\034\245\335\123\021\067\310\052\247 +\025\047\035\264\252\314\177\252\061\060\374\270\105\237\110\011 +\355\020\342\305 +END + +# Trust for Certificate "Explicitly Distrusted Malaysian Digicert Sdn. Bhd. (en)" +CKA_CLASS CK_OBJECT_CLASS CKO_NSS_TRUST +CKA_TOKEN CK_BBOOL CK_TRUE +CKA_PRIVATE CK_BBOOL CK_FALSE +CKA_MODIFIABLE CK_BBOOL CK_FALSE +CKA_LABEL UTF8 "Explicitly Distrusted Malaysian Digicert Sdn. Bhd. (en)" +CKA_CERT_SHA1_HASH MULTILINE_OCTAL +\153\074\073\200\255\312\246\272\212\237\124\246\172\355\022\151 +\005\155\061\046 +END +CKA_CERT_MD5_HASH MULTILINE_OCTAL +\327\151\141\177\065\017\234\106\243\252\353\370\125\374\204\362 +END +CKA_ISSUER MULTILINE_OCTAL +\060\201\264\061\024\060\022\006\003\125\004\012\023\013\105\156 +\164\162\165\163\164\056\156\145\164\061\100\060\076\006\003\125 +\004\013\024\067\167\167\167\056\145\156\164\162\165\163\164\056 +\156\145\164\057\103\120\123\137\062\060\064\070\040\151\156\143 +\157\162\160\056\040\142\171\040\162\145\146\056\040\050\154\151 +\155\151\164\163\040\154\151\141\142\056\051\061\045\060\043\006 +\003\125\004\013\023\034\050\143\051\040\061\071\071\071\040\105 +\156\164\162\165\163\164\056\156\145\164\040\114\151\155\151\164 +\145\144\061\063\060\061\006\003\125\004\003\023\052\105\156\164 +\162\165\163\164\056\156\145\164\040\103\145\162\164\151\146\151 +\143\141\164\151\157\156\040\101\165\164\150\157\162\151\164\171 +\040\050\062\060\064\070\051 +END +CKA_SERIAL_NUMBER MULTILINE_OCTAL +\002\006\007\377\377\377\377\377 +END +CKA_TRUST_SERVER_AUTH CK_TRUST CKT_NSS_NOT_TRUSTED +CKA_TRUST_EMAIL_PROTECTION CK_TRUST CKT_NSS_NOT_TRUSTED +CKA_TRUST_CODE_SIGNING CK_TRUST CKT_NSS_NOT_TRUSTED +CKA_TRUST_STEP_UP_APPROVED CK_BBOOL CK_FALSE + diff --git a/security/nss/lib/ckfw/builtins/nssckbi.h b/security/nss/lib/ckfw/builtins/nssckbi.h index 01fbc3176b1..3e470905859 100644 --- a/security/nss/lib/ckfw/builtins/nssckbi.h +++ b/security/nss/lib/ckfw/builtins/nssckbi.h @@ -77,8 +77,8 @@ * of the comment in the CK_VERSION type definition. */ #define NSS_BUILTINS_LIBRARY_VERSION_MAJOR 1 -#define NSS_BUILTINS_LIBRARY_VERSION_MINOR 87 -#define NSS_BUILTINS_LIBRARY_VERSION "1.87" +#define NSS_BUILTINS_LIBRARY_VERSION_MINOR 88 +#define NSS_BUILTINS_LIBRARY_VERSION "1.88" /* These version numbers detail the semantic changes to the ckfw engine. */ #define NSS_BUILTINS_HARDWARE_VERSION_MAJOR 1 From cd58c1d983ce038cc7e53a8f6199a04e9b43554b Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Sat, 5 Nov 2011 08:05:16 +1300 Subject: [PATCH 026/127] Bug 695935 - Make document.mozRequestFullScreen() asynchronous. r=bz --- content/base/public/nsIDocument.h | 6 +- content/base/src/nsDocument.cpp | 81 ++++++++++++++----- content/base/src/nsDocument.h | 15 +++- .../html/content/src/nsGenericHTMLElement.cpp | 27 +------ content/html/content/test/Makefile.in | 1 + .../test/file_fullscreen-api-keys.html | 18 +++-- .../content/test/file_fullscreen-api.html | 57 ++++++++----- .../test/file_fullscreen-denied-inner.html | 22 +++++ .../content/test/file_fullscreen-denied.html | 25 ++---- .../content/test/file_fullscreen-plugins.html | 11 +++ 10 files changed, 168 insertions(+), 95 deletions(-) create mode 100644 content/html/content/test/file_fullscreen-denied-inner.html diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 32be2842c8f..18b5e397993 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -745,10 +745,10 @@ public: virtual Element* GetFullScreenElement() = 0; /** - * Requests that the document make aElement the full-screen element, - * and move into full-screen mode. + * Asynchronously requests that the document make aElement the full-screen + * element, and move into full-screen mode. */ - virtual void RequestFullScreen(Element* aElement) = 0; + virtual void AsyncRequestFullScreen(Element* aElement) = 0; /** * Requests that the document, and all documents in its hierarchy exit diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 560f8569975..e58277f46a5 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -8557,18 +8557,53 @@ GetRootDocument(nsIDocument* aDoc) return doc; } -void -nsDocument::RequestFullScreen(Element* aElement) +class nsCallRequestFullScreen : public nsRunnable { - if (!aElement || !nsContentUtils::IsFullScreenApiEnabled() || !GetWindow()) { - if (aElement) { - nsRefPtr e = - new nsPLDOMEvent(aElement, - NS_LITERAL_STRING("mozfullscreenerror"), - true, - false); - e->PostDOMEvent(); - } +public: + nsCallRequestFullScreen(Element* aElement) + : mElement(aElement), + mDoc(aElement->OwnerDoc()), + mWasCallerChrome(nsContentUtils::IsCallerChrome()) + { + } + + NS_IMETHOD Run() + { + nsDocument* doc = static_cast(mDoc.get()); + doc->RequestFullScreen(mElement, mWasCallerChrome); + return NS_OK; + } + + nsRefPtr mElement; + nsCOMPtr mDoc; + bool mWasCallerChrome; +}; + +void +nsDocument::AsyncRequestFullScreen(Element* aElement) +{ + if (!aElement) { + return; + } + // Request full-screen asynchronously. + nsCOMPtr event(new nsCallRequestFullScreen(aElement)); + NS_DispatchToCurrentThread(event); +} + +void +nsDocument::RequestFullScreen(Element* aElement, bool aWasCallerChrome) +{ + if (!aElement || + !aElement->IsInDoc() || + aElement->OwnerDoc() != this || + !IsFullScreenEnabled(aWasCallerChrome) || + !GetWindow()) { + nsRefPtr e = + new nsPLDOMEvent(this, + NS_LITERAL_STRING("mozfullscreenerror"), + true, + false); + e->PostDOMEvent(); return; } @@ -8663,20 +8698,25 @@ NS_IMETHODIMP nsDocument::GetMozFullScreenEnabled(bool *aFullScreen) { NS_ENSURE_ARG_POINTER(aFullScreen); - *aFullScreen = false; + *aFullScreen = IsFullScreenEnabled(nsContentUtils::IsCallerChrome()); + return NS_OK; +} - if (nsContentUtils::IsCallerChrome() && - nsContentUtils::IsFullScreenApiEnabled()) { +bool +nsDocument::IsFullScreenEnabled(bool aCallerIsChrome) +{ + if (nsContentUtils::IsFullScreenApiEnabled() && aCallerIsChrome) { // Chrome code can always use the full-screen API, provided it's not - // explicitly disabled. - *aFullScreen = true; - return NS_OK; + // explicitly disabled. Note IsCallerChrome() returns true when running + // in an nsRunnable, so don't use GetMozFullScreenEnabled() from an + // nsRunnable! + return true; } if (!nsContentUtils::IsFullScreenApiEnabled() || nsContentUtils::HasPluginWithUncontrolledEventDispatch(this) || !IsVisible()) { - return NS_OK; + return false; } // Ensure that all ancestor + +Mozilla Bug 685402 +

+ +
+
+
+ + diff --git a/content/html/content/test/test_fullscreen-api.html b/content/html/content/test/test_fullscreen-api.html index 1e64612f50d..60e95671d17 100644 --- a/content/html/content/test/test_fullscreen-api.html +++ b/content/html/content/test/test_fullscreen-api.html @@ -40,7 +40,8 @@ var gTestWindows = [ "file_fullscreen-api.html", "file_fullscreen-api-keys.html", "file_fullscreen-plugins.html", - "file_fullscreen-hidden.html" + "file_fullscreen-hidden.html", + "file_fullscreen-navigation.html" ]; var testWindow = null; From 693784182c6acd8bd26e632efe95ade6c5d6e60f Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Fri, 4 Nov 2011 20:32:11 +1300 Subject: [PATCH 032/127] Bug 685402 part 2 - Exit DOM full-screen on select/open/close tab and window deactivate. r=dao --- browser/base/content/browser.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 24ee6669f09..286d46faac1 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -3908,12 +3908,29 @@ var FullScreen = { } }, + exitDomFullScreen : function(e) { + document.mozCancelFullScreen(); + }, + enterDomFullScreen : function(event) { - if (!document.mozFullScreen) { + // We receive "mozfullscreenchange" events for each subdocument which + // is an ancestor of the document containing the element which requested + // full-screen. Only add listeners and show warning etc when the event we + // receive is targeted at the chrome document, i.e. only once every time + // we enter DOM full-screen mode. + if (!document.mozFullScreen || event.target.ownerDocument != document) { return; } this.showWarning(true); + // Exit DOM full-screen mode upon open, close, or change tab. + gBrowser.tabContainer.addEventListener("TabOpen", this.exitDomFullScreen); + gBrowser.tabContainer.addEventListener("TabClose", this.exitDomFullScreen); + gBrowser.tabContainer.addEventListener("TabSelect", this.exitDomFullScreen); + + // Exit DOM full-screen mode when the browser window loses focus (ALT+TAB, etc). + window.addEventListener("deactivate", this.exitDomFullScreen, true); + // Cancel any "hide the toolbar" animation which is in progress, and make // the toolbar hide immediately. clearInterval(this._animationInterval); @@ -3946,6 +3963,10 @@ var FullScreen = { fullScrToggler.removeEventListener("dragenter", this._expandCallback, false); } this.cancelWarning(); + gBrowser.tabContainer.removeEventListener("TabOpen", this.exitDomFullScreen); + gBrowser.tabContainer.removeEventListener("TabClose", this.exitDomFullScreen); + gBrowser.tabContainer.removeEventListener("TabSelect", this.exitDomFullScreen); + window.removeEventListener("deactivate", this.exitDomFullScreen, true); } }, From 09bb20c2b5789cd219c5a8610c2944fa3ed90c5c Mon Sep 17 00:00:00 2001 From: Makoto Kato Date: Fri, 4 Nov 2011 17:40:25 +0900 Subject: [PATCH 033/127] Bug 672324 - Fix test for bug 650509 (Other apps can read Firefox profile files). r=mak77 --- storage/test/test_file_perms.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/storage/test/test_file_perms.cpp b/storage/test/test_file_perms.cpp index 36b3f728b27..576700456bf 100644 --- a/storage/test/test_file_perms.cpp +++ b/storage/test/test_file_perms.cpp @@ -48,19 +48,24 @@ void test_file_perms() { - nsCOMPtr profDir; - (void)NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(profDir)); - nsCOMPtr sqlite_file = do_QueryInterface(profDir); - sqlite_file->Append(NS_LITERAL_STRING("places.sqlite")); + nsCOMPtr db(getDatabase()); + nsCOMPtr dbFile; + do_check_success(db->GetDatabaseFile(getter_AddRefs(dbFile))); + + nsCOMPtr localFile = do_QueryInterface(dbFile); + do_check_true(localFile); + PRUint32 perms = 0; - sqlite_file->GetPermissions(&perms); + do_check_success(localFile->GetPermissions(&perms)); // This reflexts the permissions defined by SQLITE_DEFAULT_FILE_PERMISSIONS in // db/sqlite3/src/Makefile.in and must be kept in sync with that #ifdef ANDROID - do_check_true(perms == PR_IRUSR | PR_IWUSR); + do_check_true(perms == (PR_IRUSR | PR_IWUSR)); +#elif defined(XP_WIN) + do_check_true(perms == (PR_IRUSR | PR_IWUSR | PR_IRGRP | PR_IWGRP | PR_IROTH | PR_IWOTH)); #else - do_check_true(perms == PR_IRUSR | PR_IWUSR | PR_IRGRP | PR_IWGRP | PR_IROTH | PR_IWOTH); + do_check_true(perms == (PR_IRUSR | PR_IWUSR | PR_IRGRP | PR_IROTH)); #endif } From a9c9463d53d7ea0858654eeb106127ccb47e8067 Mon Sep 17 00:00:00 2001 From: Makoto Kato Date: Fri, 4 Nov 2011 17:44:13 +0900 Subject: [PATCH 034/127] Bug 254298 - nsPlainTextSerializer.cpp should not use AssignWithConversion. r=smaug --- content/base/src/nsPlainTextSerializer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/content/base/src/nsPlainTextSerializer.cpp b/content/base/src/nsPlainTextSerializer.cpp index 65a91f42ed9..dfdf4b5270c 100644 --- a/content/base/src/nsPlainTextSerializer.cpp +++ b/content/base/src/nsPlainTextSerializer.cpp @@ -307,8 +307,6 @@ nsPlainTextSerializer::AppendText(nsIContent* aText, NS_ENSURE_ARG(aText); nsresult rv = NS_OK; - PRInt32 length = 0; - nsAutoString textstr; nsIContent* content = aText; const nsTextFragment* frag; @@ -319,16 +317,19 @@ nsPlainTextSerializer::AppendText(nsIContent* aText, PRInt32 endoffset = (aEndOffset == -1) ? frag->GetLength() : aEndOffset; NS_ASSERTION(aStartOffset <= endoffset, "A start offset is beyond the end of the text fragment!"); - length = endoffset - aStartOffset; + PRInt32 length = endoffset - aStartOffset; if (length <= 0) { return NS_OK; } + nsAutoString textstr; if (frag->Is2b()) { textstr.Assign(frag->Get2b() + aStartOffset, length); } else { - textstr.AssignWithConversion(frag->Get1b()+aStartOffset, length); + // AssignASCII is for 7-bit character only, so don't use it + const char *data = frag->Get1b(); + CopyASCIItoUTF16(Substring(data + aStartOffset, data + endoffset), textstr); } mOutputString = &aStr; From bb0053b9435eb042079d5e7ea50f0ee57e4dee33 Mon Sep 17 00:00:00 2001 From: Ginn Chen Date: Fri, 4 Nov 2011 16:55:21 +0800 Subject: [PATCH 035/127] Bug 693240 Use *((PRUint32*)ap) instead of *((bool*)ap) for big endian machines r=glandium --- .../src/md/unix/xptcinvoke_linux_m68k.cpp | 2 +- .../src/md/unix/xptcinvoke_netbsd_m68k.cpp | 2 +- .../xptcall/src/md/unix/xptcinvoke_pa32.cpp | 2 +- .../src/md/unix/xptcinvoke_ppc_aix.cpp | 2 +- .../src/md/unix/xptcinvoke_ppc_rhapsody.cpp | 4 ++-- .../src/md/unix/xptcinvoke_sparc_netbsd.cpp | 8 +++---- .../src/md/unix/xptcinvoke_sparc_openbsd.cpp | 2 +- .../src/md/unix/xptcinvoke_sparc_solaris.cpp | 8 +++---- .../md/unix/xptcinvoke_sparcv9_solaris.cpp | 2 +- .../src/md/unix/xptcstubs_linux_m68k.cpp | 2 +- .../src/md/unix/xptcstubs_netbsd_m68k.cpp | 2 +- .../xptcall/src/md/unix/xptcstubs_pa32.cpp | 2 +- .../src/md/unix/xptcstubs_sparc_netbsd.cpp | 6 ++--- .../src/md/unix/xptcstubs_sparc_openbsd.cpp | 6 ++--- .../src/md/unix/xptcstubs_sparc_solaris.cpp | 6 ++--- .../src/md/unix/xptcstubs_sparcv9_solaris.cpp | 24 +++++++++---------- 16 files changed, 40 insertions(+), 40 deletions(-) diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp index bd0d38139ba..7f4e9402438 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_m68k.cpp @@ -115,7 +115,7 @@ extern "C" { case nsXPTType::T_U64 : *((PRUint64*)d) = s->val.u64; d++; break; case nsXPTType::T_FLOAT : *((float*) d) = s->val.f; break; case nsXPTType::T_DOUBLE : *((double*) d) = s->val.d; d++; break; - case nsXPTType::T_BOOL : *((bool*) d) = s->val.b; break; + case nsXPTType::T_BOOL : *((PRUint32*)d) = s->val.b; break; case nsXPTType::T_CHAR : *((PRUint32*)d) = s->val.c; break; case nsXPTType::T_WCHAR : *((wchar_t*) d) = s->val.wc; break; diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_netbsd_m68k.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_netbsd_m68k.cpp index a7ecfb7b7f2..c3db74a979c 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_netbsd_m68k.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_netbsd_m68k.cpp @@ -119,7 +119,7 @@ extern "C" { case nsXPTType::T_U64 : *((PRUint64*)d) = s->val.u64; d++; break; case nsXPTType::T_FLOAT : *((float*) d) = s->val.f; break; case nsXPTType::T_DOUBLE : *((double*) d) = s->val.d; d++; break; - case nsXPTType::T_BOOL : *((bool*) d) = s->val.b; break; + case nsXPTType::T_BOOL : *((PRUint32*)d) = s->val.b; break; case nsXPTType::T_CHAR : *((PRUint32*)d) = s->val.c; break; // wchar_t is an int (32 bits) on NetBSD case nsXPTType::T_WCHAR : *((wchar_t*) d) = s->val.wc; break; diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_pa32.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_pa32.cpp index e63027d72ba..088ef5e691f 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_pa32.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_pa32.cpp @@ -166,7 +166,7 @@ invoke_copy_to_stack(PRUint32* d, case nsXPTType::T_U8 : *((PRUint32*) (dest)) = source->val.u8; break; case nsXPTType::T_U16 : *((PRUint32*) (dest)) = source->val.u16; break; case nsXPTType::T_U32 : *((PRUint32*) (dest)) = source->val.u32; break; - case nsXPTType::T_BOOL : *((bool*) (dest)) = source->val.b; break; + case nsXPTType::T_BOOL : *((PRUint32*) (dest)) = source->val.b; break; case nsXPTType::T_CHAR : *((PRUint32*) (dest)) = source->val.c; break; case nsXPTType::T_WCHAR : *((PRInt32*) (dest)) = source->val.wc; break; diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_aix.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_aix.cpp index 6c450611dd7..5724d6c4211 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_aix.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_aix.cpp @@ -93,7 +93,7 @@ invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, nsXPTCVariant* s, double if(fpCount < 13) l_fprData[fpCount++] = l_s->val.f; break; - case nsXPTType::T_BOOL : *((bool*) l_d) = l_s->val.b; break; + case nsXPTType::T_BOOL : *((uint32*) l_d) = l_s->val.b; break; case nsXPTType::T_CHAR : *((uint32*) l_d) = l_s->val.c; break; case nsXPTType::T_WCHAR : *((int32*) l_d) = l_s->val.wc; break; default: diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_rhapsody.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_rhapsody.cpp index 0ee2d2ba140..c374f32e9c7 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_rhapsody.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_ppc_rhapsody.cpp @@ -122,8 +122,8 @@ invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, nsXPTCVariant* s, double if (fpCount < 13) fprData[fpCount++] = s->val.d; break; - case nsXPTType::T_BOOL : *((bool*) d) = s->val.b; break; - case nsXPTType::T_CHAR : *((PRInt32*) d) = s->val.c; break; + case nsXPTType::T_BOOL : *((PRUint32*) d) = s->val.b; break; + case nsXPTType::T_CHAR : *((PRInt32*) d) = s->val.c; break; case nsXPTType::T_WCHAR : *((PRUint32*) d) = s->val.wc; break; default: // all the others are plain pointer types diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_netbsd.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_netbsd.cpp index fbfd8846902..7ec57345fc2 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_netbsd.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_netbsd.cpp @@ -138,13 +138,13 @@ invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, nsXPTCVariant* s) if (regCount < 5) regCount++; *((uint32*) l_d) = ((DU *)l_s)->lo; break; - case nsXPTType::T_U8 : *((uint32*) l_d) = l_s->val.u8; break; + case nsXPTType::T_U8 : *((uint32*) l_d) = l_s->val.u8; break; case nsXPTType::T_U16 : *((uint32*) l_d) = l_s->val.u16; break; case nsXPTType::T_U32 : *((uint32*) l_d) = l_s->val.u32; break; case nsXPTType::T_FLOAT : *((float*) l_d) = l_s->val.f; break; - case nsXPTType::T_BOOL : *((bool*) l_d) = l_s->val.b; break; - case nsXPTType::T_CHAR : *((uint32*) l_d) = l_s->val.c; break; - case nsXPTType::T_WCHAR : *((int32*)l_d) = l_s->val.wc; break; + case nsXPTType::T_BOOL : *((uint32*) l_d) = l_s->val.b; break; + case nsXPTType::T_CHAR : *((uint32*) l_d) = l_s->val.c; break; + case nsXPTType::T_WCHAR : *((int32*) l_d) = l_s->val.wc; break; default: // all the others are plain pointer types *((void**)l_d) = l_s->val.p; diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_openbsd.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_openbsd.cpp index f6b01ab5ee8..45f31090e03 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_openbsd.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_openbsd.cpp @@ -139,7 +139,7 @@ invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, nsXPTCVariant* s) case nsXPTType::T_U16 : *((uint32*) l_d) = l_s->val.u16; break; case nsXPTType::T_U32 : *((uint32*) l_d) = l_s->val.u32; break; case nsXPTType::T_FLOAT : *((float*) l_d) = l_s->val.f; break; - case nsXPTType::T_BOOL : *((bool*) l_d) = l_s->val.b; break; + case nsXPTType::T_BOOL : *((uint32*) l_d) = l_s->val.b; break; case nsXPTType::T_CHAR : *((uint32*) l_d) = l_s->val.c; break; case nsXPTType::T_WCHAR : *((int32*) l_d) = l_s->val.wc; break; default: diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_solaris.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_solaris.cpp index fbfd8846902..7ec57345fc2 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_solaris.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc_solaris.cpp @@ -138,13 +138,13 @@ invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount, nsXPTCVariant* s) if (regCount < 5) regCount++; *((uint32*) l_d) = ((DU *)l_s)->lo; break; - case nsXPTType::T_U8 : *((uint32*) l_d) = l_s->val.u8; break; + case nsXPTType::T_U8 : *((uint32*) l_d) = l_s->val.u8; break; case nsXPTType::T_U16 : *((uint32*) l_d) = l_s->val.u16; break; case nsXPTType::T_U32 : *((uint32*) l_d) = l_s->val.u32; break; case nsXPTType::T_FLOAT : *((float*) l_d) = l_s->val.f; break; - case nsXPTType::T_BOOL : *((bool*) l_d) = l_s->val.b; break; - case nsXPTType::T_CHAR : *((uint32*) l_d) = l_s->val.c; break; - case nsXPTType::T_WCHAR : *((int32*)l_d) = l_s->val.wc; break; + case nsXPTType::T_BOOL : *((uint32*) l_d) = l_s->val.b; break; + case nsXPTType::T_CHAR : *((uint32*) l_d) = l_s->val.c; break; + case nsXPTType::T_WCHAR : *((int32*) l_d) = l_s->val.wc; break; default: // all the others are plain pointer types *((void**)l_d) = l_s->val.p; diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparcv9_solaris.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparcv9_solaris.cpp index 1fc414ee536..1cc5fe508fc 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparcv9_solaris.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparcv9_solaris.cpp @@ -92,7 +92,7 @@ invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount, nsXPTCVariant* s) */ case nsXPTType::T_FLOAT : *(((float*)l_d) + 1) = l_s->val.f; break; case nsXPTType::T_DOUBLE: *((double*)l_d) = l_s->val.d; break; - case nsXPTType::T_BOOL : *((bool*)l_d) = l_s->val.b; break; + case nsXPTType::T_BOOL : *((PRUint64*)l_d) = l_s->val.b; break; case nsXPTType::T_CHAR : *((PRUint64*)l_d) = l_s->val.c; break; case nsXPTType::T_WCHAR : *((PRInt64*)l_d) = l_s->val.wc; break; diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp index c396dcc2775..c8e583d33b5 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_linux_m68k.cpp @@ -95,7 +95,7 @@ extern "C" { case nsXPTType::T_U64 : dp->val.u64 = *((PRUint64*)ap); ap++; break; case nsXPTType::T_FLOAT : dp->val.f = *((float*) ap); break; case nsXPTType::T_DOUBLE : dp->val.d = *((double*) ap); ap++; break; - case nsXPTType::T_BOOL : dp->val.b = *((bool*) ap); break; + case nsXPTType::T_BOOL : dp->val.b = *((PRUint32* ap); break; case nsXPTType::T_CHAR : dp->val.c = *(((char*) ap) + 3); break; case nsXPTType::T_WCHAR : dp->val.wc = *((wchar_t*) ap); break; default: diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_netbsd_m68k.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_netbsd_m68k.cpp index 046178fa068..546598a5c29 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_netbsd_m68k.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_netbsd_m68k.cpp @@ -102,7 +102,7 @@ extern "C" { case nsXPTType::T_U64 : dp->val.u64 = *((PRUint64*)ap); ap++; break; case nsXPTType::T_FLOAT : dp->val.f = *((float*) ap); break; case nsXPTType::T_DOUBLE : dp->val.d = *((double*) ap); ap++; break; - case nsXPTType::T_BOOL : dp->val.b = *((bool*) ap); break; + case nsXPTType::T_BOOL : dp->val.b = *(((char*) ap) + 3); break; case nsXPTType::T_CHAR : dp->val.c = *(((char*) ap) + 3); break; // wchar_t is an int (32 bits) on NetBSD case nsXPTType::T_WCHAR : dp->val.wc = *((wchar_t*) ap); break; diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_pa32.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_pa32.cpp index 4d28f986154..288d4b8ddb0 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_pa32.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_pa32.cpp @@ -138,7 +138,7 @@ PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, case nsXPTType::T_U8 : dp->val.u8 = *((PRUint32*) args); break; case nsXPTType::T_U16 : dp->val.u16 = *((PRUint32*) args); break; case nsXPTType::T_U32 : dp->val.u32 = *((PRUint32*) args); break; - case nsXPTType::T_BOOL : dp->val.b = *((bool*) args); break; + case nsXPTType::T_BOOL : dp->val.b = *((PRUint32*) args); break; case nsXPTType::T_CHAR : dp->val.c = *((PRUint32*) args); break; case nsXPTType::T_WCHAR : dp->val.wc = *((PRInt32*) args); break; default: diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_netbsd.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_netbsd.cpp index bfd6cb25d7b..89892c00fed 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_netbsd.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_netbsd.cpp @@ -102,12 +102,12 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32* args) ((DU *)dp)->lo = ((DU *)ap)->lo; ap++; break; - case nsXPTType::T_U8 : dp->val.u8 = *((PRUint32*) ap); break; + case nsXPTType::T_U8 : dp->val.u8 = *((PRUint32*)ap); break; case nsXPTType::T_U16 : dp->val.u16 = *((PRUint32*)ap); break; case nsXPTType::T_U32 : dp->val.u32 = *((PRUint32*)ap); break; case nsXPTType::T_FLOAT : dp->val.f = *((float*) ap); break; - case nsXPTType::T_BOOL : dp->val.b = *((bool*) ap); break; - case nsXPTType::T_CHAR : dp->val.c = *((PRUint32*) ap); break; + case nsXPTType::T_BOOL : dp->val.b = *((PRUint32*)ap); break; + case nsXPTType::T_CHAR : dp->val.c = *((PRUint32*)ap); break; case nsXPTType::T_WCHAR : dp->val.wc = *((PRInt32*) ap); break; default: NS_ERROR("bad type"); diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_openbsd.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_openbsd.cpp index 1ec53cf6edd..55d27d2c1e2 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_openbsd.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_openbsd.cpp @@ -105,12 +105,12 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32* args) ((DU *)dp)->lo = ((DU *)ap)->lo; ap++; break; - case nsXPTType::T_U8 : dp->val.u8 = *((PRUint32*) ap); break; + case nsXPTType::T_U8 : dp->val.u8 = *((PRUint32*)ap); break; case nsXPTType::T_U16 : dp->val.u16 = *((PRUint32*)ap); break; case nsXPTType::T_U32 : dp->val.u32 = *((PRUint32*)ap); break; case nsXPTType::T_FLOAT : dp->val.f = *((float*) ap); break; - case nsXPTType::T_BOOL : dp->val.b = *((bool*) ap); break; - case nsXPTType::T_CHAR : dp->val.c = *((PRUint32*) ap); break; + case nsXPTType::T_BOOL : dp->val.b = *((PRUint32*)ap); break; + case nsXPTType::T_CHAR : dp->val.c = *((PRUint32*)ap); break; case nsXPTType::T_WCHAR : dp->val.wc = *((PRInt32*) ap); break; default: NS_ERROR("bad type"); diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp index fe9e63f9e4b..32e82f7233e 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc_solaris.cpp @@ -99,12 +99,12 @@ PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, uint32* args) ((DU *)dp)->lo = ((DU *)ap)->lo; ap++; break; - case nsXPTType::T_U8 : dp->val.u8 = *((PRUint32*) ap); break; + case nsXPTType::T_U8 : dp->val.u8 = *((PRUint32*)ap); break; case nsXPTType::T_U16 : dp->val.u16 = *((PRUint32*)ap); break; case nsXPTType::T_U32 : dp->val.u32 = *((PRUint32*)ap); break; case nsXPTType::T_FLOAT : dp->val.f = *((float*) ap); break; - case nsXPTType::T_BOOL : dp->val.b = *((bool*) ap); break; - case nsXPTType::T_CHAR : dp->val.c = *((PRUint32*) ap); break; + case nsXPTType::T_BOOL : dp->val.b = *((PRUint32*)ap); break; + case nsXPTType::T_CHAR : dp->val.c = *((PRUint32*)ap); break; case nsXPTType::T_WCHAR : dp->val.wc = *((PRInt32*) ap); break; default: NS_ERROR("bad type"); diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparcv9_solaris.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparcv9_solaris.cpp index f5db6d054be..f966c8cb983 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparcv9_solaris.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparcv9_solaris.cpp @@ -86,19 +86,19 @@ PrepareAndDispatch(nsXPTCStubBase* self, PRUint64 methodIndex, PRUint64* args) // else switch(type) { - case nsXPTType::T_I8 : dp->val.i8 = *((PRInt32*) ap); break; - case nsXPTType::T_I16 : dp->val.i16 = *((PRInt32*) ap); break; - case nsXPTType::T_I32 : dp->val.i32 = *((PRInt32*) ap); break; - case nsXPTType::T_DOUBLE : dp->val.d = *((double*) ap); break; - case nsXPTType::T_U64 : dp->val.u64 = *((PRUint64*) ap); break; + case nsXPTType::T_I8 : dp->val.i8 = *((PRInt64*) ap); break; + case nsXPTType::T_I16 : dp->val.i16 = *((PRInt64*) ap); break; + case nsXPTType::T_I32 : dp->val.i32 = *((PRInt64*) ap); break; + case nsXPTType::T_DOUBLE : dp->val.d = *((double*) ap); break; + case nsXPTType::T_U64 : dp->val.u64 = *((PRUint64*)ap); break; case nsXPTType::T_I64 : dp->val.i64 = *((PRInt64*) ap); break; - case nsXPTType::T_U8 : dp->val.u8 = *((PRUint32*) ap); break; - case nsXPTType::T_U16 : dp->val.u16 = *((PRUint32*)ap); break; - case nsXPTType::T_U32 : dp->val.u32 = *((PRUint32*)ap); break; - case nsXPTType::T_FLOAT : dp->val.f = *((float*) ap); break; - case nsXPTType::T_BOOL : dp->val.b = *((bool*) ap); break; - case nsXPTType::T_CHAR : dp->val.c = *((PRUint32*) ap); break; - case nsXPTType::T_WCHAR : dp->val.wc = *((PRInt32*) ap); break; + case nsXPTType::T_U8 : dp->val.u8 = *((PRUint64*)ap); break; + case nsXPTType::T_U16 : dp->val.u16 = *((PRUint64*)ap); break; + case nsXPTType::T_U32 : dp->val.u32 = *((PRUint64*)ap); break; + case nsXPTType::T_FLOAT : dp->val.f = ((float*) ap)[1]; break; + case nsXPTType::T_BOOL : dp->val.b = *((PRUint64*)ap); break; + case nsXPTType::T_CHAR : dp->val.c = *((PRUint64*)ap); break; + case nsXPTType::T_WCHAR : dp->val.wc = *((PRInt64*) ap); break; default: NS_ERROR("bad type"); break; From c42c7da44a5c856a9c5b65a7790faa8e7d414ab9 Mon Sep 17 00:00:00 2001 From: Ed Morley Date: Fri, 4 Nov 2011 10:50:16 +0000 Subject: [PATCH 037/127] Backout 1f551298a760 (bug 697312) and b31507c8ca17 (bug 697246) for 25-30% Ts regression on multiple platforms Except this time enter the changesets in the correct order in Mak's backout script, so the changeset isn't empty :/ --- toolkit/mozapps/extensions/XPIProvider.jsm | 134 ++++-------------- .../test/xpcshell/test_bootstrap.js | 18 --- .../test/xpcshell/test_bug563256.js | 16 +-- .../extensions/test/xpcshell/test_startup.js | 18 --- 4 files changed, 36 insertions(+), 150 deletions(-) diff --git a/toolkit/mozapps/extensions/XPIProvider.jsm b/toolkit/mozapps/extensions/XPIProvider.jsm index 6ce80de99fd..f6f44f326fd 100644 --- a/toolkit/mozapps/extensions/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/XPIProvider.jsm @@ -1759,7 +1759,7 @@ var XPIProvider = { } // Ensure any changes to the add-ons list are flushed to disk - XPIDatabase.writeAddonsList(); + XPIDatabase.writeAddonsList([]); Services.prefs.setBoolPref(PREF_PENDING_OPERATIONS, false); }, @@ -2942,18 +2942,16 @@ var XPIProvider = { let state = this.getInstallLocationStates(); + // If the database exists then the previous file cache can be trusted + // otherwise the database needs to be recreated + let dbFile = FileUtils.getFile(KEY_PROFILEDIR, [FILE_DATABASE], true); + updateDatabase |= !dbFile.exists(); if (!updateDatabase) { // If the state has changed then we must update the database let cache = Prefs.getCharPref(PREF_INSTALL_CACHE, null); updateDatabase |= cache != JSON.stringify(state); } - // If the database doesn't exist and there are add-ons installed then we - // must update the database however if there are no add-ons then there is - // no need to update the database. - if (!XPIDatabase.dbfile.exists()) - updateDatabase = state.length > 0; - if (!updateDatabase) { let bootstrapDescriptors = [this.bootstrappedAddons[b].descriptor for (b in this.bootstrappedAddons)]; @@ -2965,7 +2963,7 @@ var XPIProvider = { bootstrapDescriptors.splice(pos, 1); } }); - + if (bootstrapDescriptors.length > 0) { WARN("Bootstrap state is invalid (missing add-ons: " + bootstrapDescriptors.toSource() + ")"); updateDatabase = true; @@ -2979,7 +2977,7 @@ var XPIProvider = { // If the database needs to be updated then open it and then update it // from the filesystem if (updateDatabase || hasPendingChanges) { - let migrateData = XPIDatabase.openConnection(false, true); + let migrateData = XPIDatabase.openConnection(false); try { extensionListChanged = this.processFileChanges(state, manifests, @@ -3034,8 +3032,8 @@ var XPIProvider = { // Check that the add-ons list still exists let addonsList = FileUtils.getFile(KEY_PROFILEDIR, [FILE_XPI_ADDONS_LIST], true); - if (addonsList.exists() == (state.length == 0)) { - LOG("Add-ons list is invalid, rebuilding"); + if (!addonsList.exists()) { + LOG("Add-ons list is missing, recreating"); XPIDatabase.writeAddonsList(); } @@ -4024,8 +4022,6 @@ var XPIDatabase = { addonCache: [], // The nested transaction count transactionCount: 0, - // The database file - dbfile: FileUtils.getFile(KEY_PROFILEDIR, [FILE_DATABASE], true), // The statements used by the database statements: { @@ -4075,8 +4071,7 @@ var XPIDatabase = { "type<>'theme' AND bootstrap=0", getActiveTheme: "SELECT " + FIELDS_ADDON + " FROM addon WHERE " + "internalName=:internalName AND type='theme'", - getThemes: "SELECT " + FIELDS_ADDON + " FROM addon WHERE type='theme' AND " + - "internalName<>:defaultSkin", + getThemes: "SELECT " + FIELDS_ADDON + " FROM addon WHERE type='theme'", getAddonInLocation: "SELECT " + FIELDS_ADDON + " FROM addon WHERE id=:id " + "AND location=:location", @@ -4218,17 +4213,12 @@ var XPIDatabase = { * @return the migration data from the database if it was an old schema or * null otherwise. */ - openConnection: function XPIDB_openConnection(aRebuildOnError, aForceOpen) { + openConnection: function XPIDB_openConnection(aRebuildOnError) { + this.initialized = true; + let dbfile = FileUtils.getFile(KEY_PROFILEDIR, [FILE_DATABASE], true); delete this.connection; - if (!aForceOpen && !this.dbfile.exists()) { - this.connection = null; - return {}; - } - - this.initialized = true; - - this.connection = this.openDatabaseFile(this.dbfile); + this.connection = this.openDatabaseFile(dbfile); let migrateData = null; // If the database was corrupt or missing then the new blank database will @@ -4245,11 +4235,11 @@ var XPIDatabase = { // Delete the existing database this.connection.close(); try { - if (this.dbfile.exists()) - this.dbfile.remove(true); + if (dbfile.exists()) + dbfile.remove(true); // Reopen an empty database - this.connection = this.openDatabaseFile(this.dbfile); + this.connection = this.openDatabaseFile(dbfile); } catch (e) { ERROR("Failed to remove old database", e); @@ -4260,6 +4250,7 @@ var XPIDatabase = { } else if (Prefs.getIntPref(PREF_DB_SCHEMA, 0) == 0) { // Only migrate data from the RDF if we haven't done it before + LOG("Migrating data from extensions.rdf"); migrateData = this.getMigrateDataFromRDF(); } @@ -4359,7 +4350,6 @@ var XPIDatabase = { // Migrate data from extensions.rdf let rdffile = FileUtils.getFile(KEY_PROFILEDIR, [FILE_OLD_DATABASE], true); if (rdffile.exists()) { - LOG("Migrating data from extensions.rdf"); let ds = gRDF.GetDataSourceBlocking(Services.io.newFileURI(rdffile).spec); let root = Cc["@mozilla.org/rdf/container;1"]. createInstance(Ci.nsIRDFContainer); @@ -4973,9 +4963,6 @@ var XPIDatabase = { * @return an array of names of install locations */ getInstallLocations: function XPIDB_getInstallLocations() { - if (!this.connection) - return []; - let stmt = this.getStatement("getInstallLocations"); return [row.location for each (row in resultRows(stmt))]; @@ -4989,9 +4976,6 @@ var XPIDatabase = { * @return an array of DBAddonInternals */ getAddonsInLocation: function XPIDB_getAddonsInLocation(aLocation) { - if (!this.connection) - return []; - let stmt = this.getStatement("getAddonsInLocation"); stmt.params.location = aLocation; @@ -5010,11 +4994,6 @@ var XPIDatabase = { * A callback to pass the DBAddonInternal to */ getAddonInLocation: function XPIDB_getAddonInLocation(aId, aLocation, aCallback) { - if (!this.connection) { - aCallback(null); - return; - } - let stmt = this.getStatement("getAddonInLocation"); stmt.params.id = aId; @@ -5041,11 +5020,6 @@ var XPIDatabase = { * A callback to pass the DBAddonInternal to */ getVisibleAddonForID: function XPIDB_getVisibleAddonForID(aId, aCallback) { - if (!this.connection) { - aCallback(null); - return; - } - let stmt = this.getStatement("getVisibleAddonForID"); stmt.params.id = aId; @@ -5071,11 +5045,6 @@ var XPIDatabase = { * A callback to pass the array of DBAddonInternals to */ getVisibleAddons: function XPIDB_getVisibleAddons(aTypes, aCallback) { - if (!this.connection) { - aCallback([]); - return; - } - let stmt = null; if (!aTypes || aTypes.length == 0) { stmt = this.getStatement("getVisibleAddons"); @@ -5107,9 +5076,6 @@ var XPIDatabase = { * @return an array of DBAddonInternals */ getAddonsByType: function XPIDB_getAddonsByType(aType) { - if (!this.connection) - return []; - let stmt = this.getStatement("getAddonsByType"); stmt.params.type = aType; @@ -5124,9 +5090,6 @@ var XPIDatabase = { * @return a DBAddonInternal */ getVisibleAddonForInternalName: function XPIDB_getVisibleAddonForInternalName(aInternalName) { - if (!this.connection) - return null; - let stmt = this.getStatement("getVisibleAddonForInternalName"); let addon = null; @@ -5149,11 +5112,6 @@ var XPIDatabase = { */ getVisibleAddonsWithPendingOperations: function XPIDB_getVisibleAddonsWithPendingOperations(aTypes, aCallback) { - if (!this.connection) { - aCallback([]); - return; - } - let stmt = null; if (!aTypes || aTypes.length == 0) { stmt = this.getStatement("getVisibleAddonsWithPendingOperations"); @@ -5185,9 +5143,6 @@ var XPIDatabase = { * @return an array of DBAddonInternals */ getAddons: function XPIDB_getAddons() { - if (!this.connection) - return []; - let stmt = this.getStatement("getAddons"); return [this.makeAddonFromRow(row) for each (row in resultRows(stmt))];; @@ -5202,10 +5157,6 @@ var XPIDatabase = { * The file descriptor of the add-on */ addAddonMetadata: function XPIDB_addAddonMetadata(aAddon, aDescriptor) { - // If there is no DB yet then forcibly create one - if (!this.connection) - this.openConnection(false, true); - this.beginTransaction(); var self = this; @@ -5471,24 +5422,14 @@ var XPIDatabase = { * Writes out the XPI add-ons list for the platform to read. */ writeAddonsList: function XPIDB_writeAddonsList() { + LOG("Writing add-ons list"); Services.appinfo.invalidateCachesOnRestart(); - let addonsList = FileUtils.getFile(KEY_PROFILEDIR, [FILE_XPI_ADDONS_LIST], true); - if (!this.connection) { - if (addonsList.exists()) { - LOG("Deleting add-ons list"); - addonsList.remove(false); - } - - Services.prefs.clearUserPref(PREF_EM_ENABLED_ADDONS); - return; - } let enabledAddons = []; let text = "[ExtensionDirs]\r\n"; let count = 0; - let fullCount = 0; let stmt = this.getStatement("getActiveAddons"); @@ -5496,47 +5437,28 @@ var XPIDatabase = { text += "Extension" + (count++) + "=" + row.descriptor + "\r\n"; enabledAddons.push(row.id + ":" + row.version); } - fullCount += count; // The selected skin may come from an inactive theme (the default theme // when a lightweight theme is applied for example) text += "\r\n[ThemeDirs]\r\n"; - - stmt = null; if (Prefs.getBoolPref(PREF_EM_DSS_ENABLED)) { stmt = this.getStatement("getThemes"); - stmt.params.defaultSkin = XPIProvider.defaultSkin; } - else if (XPIProvider.selectedSkin != XPIProvider.defaultSkin) { + else { stmt = this.getStatement("getActiveTheme"); stmt.params.internalName = XPIProvider.selectedSkin; } - - if (stmt) { - count = 0; - for (let row in resultRows(stmt)) { - text += "Extension" + (count++) + "=" + row.descriptor + "\r\n"; - enabledAddons.push(row.id + ":" + row.version); - } - fullCount += count; + count = 0; + for (let row in resultRows(stmt)) { + text += "Extension" + (count++) + "=" + row.descriptor + "\r\n"; + enabledAddons.push(row.id + ":" + row.version); } - if (fullCount > 0) { - LOG("Writing add-ons list"); - var fos = FileUtils.openSafeFileOutputStream(addonsList); - fos.write(text, text.length); - FileUtils.closeSafeFileOutputStream(fos); + var fos = FileUtils.openSafeFileOutputStream(addonsList); + fos.write(text, text.length); + FileUtils.closeSafeFileOutputStream(fos); - Services.prefs.setCharPref(PREF_EM_ENABLED_ADDONS, enabledAddons.join(",")); - } - else { - if (addonsList.exists()) { - LOG("Deleting add-ons list"); - addonsList.remove(false); - } - - Services.prefs.clearUserPref(PREF_EM_ENABLED_ADDONS); - } + Services.prefs.setCharPref(PREF_EM_ENABLED_ADDONS, enabledAddons.join(",")); } }; diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap.js b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap.js index 8e7c7bc9214..d5cdf2a70fc 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap.js @@ -125,13 +125,6 @@ function run_test() { startupManager(); - let file = gProfD.clone(); - file.append("extensions.sqlite"); - do_check_false(file.exists()); - - file.leafName = "extensions.ini"; - do_check_false(file.exists()); - run_test_1(); } @@ -174,13 +167,6 @@ function run_test_1() { } function check_test_1() { - let file = gProfD.clone(); - file.append("extensions.sqlite"); - do_check_true(file.exists()); - - file.leafName = "extensions.ini"; - do_check_false(file.exists()); - AddonManager.getAllInstalls(function(installs) { // There should be no active installs now since the install completed and // doesn't require a restart. @@ -261,10 +247,6 @@ function run_test_3() { do_check_eq(getShutdownReason(), ADDON_DISABLE); do_check_not_in_crash_annotation("bootstrap1@tests.mozilla.org", "1.0"); - let file = gProfD.clone(); - file.append("extensions.ini"); - do_check_false(file.exists()); - AddonManager.getAddonByID("bootstrap1@tests.mozilla.org", function(b1) { do_check_neq(b1, null); do_check_eq(b1.version, "1.0"); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_bug563256.js b/toolkit/mozapps/extensions/test/xpcshell/test_bug563256.js index b51a3d6fd18..c9b5234bcdf 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_bug563256.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug563256.js @@ -48,7 +48,7 @@ function run_test() { do_check_false(d.userDisabled); do_check_false(d.appDisabled); do_check_true(d.isActive); - do_check_false(isThemeInAddonsList(profileDir, d.id)); + do_check_true(isThemeInAddonsList(profileDir, d.id)); do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE)); do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE)); @@ -76,7 +76,7 @@ function run_test_1(d, a) { do_check_true(d.userDisabled); do_check_false(d.appDisabled); do_check_true(d.isActive); - do_check_false(isThemeInAddonsList(profileDir, d.id)); + do_check_true(isThemeInAddonsList(profileDir, d.id)); do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE)); do_check_true(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE)); @@ -94,7 +94,7 @@ function run_test_1(d, a) { do_check_false(d.userDisabled); do_check_false(d.appDisabled); do_check_true(d.isActive); - do_check_false(isThemeInAddonsList(profileDir, d.id)); + do_check_true(isThemeInAddonsList(profileDir, d.id)); do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE)); do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE)); @@ -121,7 +121,7 @@ function run_test_2() { do_check_false(d.userDisabled); do_check_false(d.appDisabled); do_check_true(d.isActive); - do_check_false(isThemeInAddonsList(profileDir, d.id)); + do_check_true(isThemeInAddonsList(profileDir, d.id)); do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE)); do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE)); @@ -140,7 +140,7 @@ function run_test_2() { do_check_true(d.userDisabled); do_check_false(d.appDisabled); do_check_true(d.isActive); - do_check_false(isThemeInAddonsList(profileDir, d.id)); + do_check_true(isThemeInAddonsList(profileDir, d.id)); do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE)); do_check_true(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE)); @@ -158,7 +158,7 @@ function run_test_2() { do_check_false(d.userDisabled); do_check_false(d.appDisabled); do_check_true(d.isActive); - do_check_false(isThemeInAddonsList(profileDir, d.id)); + do_check_true(isThemeInAddonsList(profileDir, d.id)); do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE)); do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE)); @@ -176,7 +176,7 @@ function run_test_2() { do_check_true(d.userDisabled); do_check_false(d.appDisabled); do_check_true(d.isActive); - do_check_false(isThemeInAddonsList(profileDir, d.id)); + do_check_true(isThemeInAddonsList(profileDir, d.id)); do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE)); do_check_true(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE)); @@ -241,7 +241,7 @@ function check_test_2() { do_check_false(d.userDisabled); do_check_false(d.appDisabled); do_check_true(d.isActive); - do_check_false(isThemeInAddonsList(profileDir, d.id)); + do_check_true(isThemeInAddonsList(profileDir, d.id)); do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_DISABLE)); do_check_false(hasFlag(d.permissions, AddonManager.PERM_CAN_ENABLE)); diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_startup.js b/toolkit/mozapps/extensions/test/xpcshell/test_startup.js index f4412a6bbcb..71f41b6775f 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_startup.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_startup.js @@ -132,13 +132,6 @@ function run_test() { check_startup_changes(AddonManager.STARTUP_CHANGE_DISABLED, []); check_startup_changes(AddonManager.STARTUP_CHANGE_ENABLED, []); - let file = gProfD.clone(); - file.append("extensions.sqlite"); - do_check_false(file.exists()); - - file.leafName = "extensions.ini"; - do_check_false(file.exists()); - AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org", "addon2@tests.mozilla.org", "addon3@tests.mozilla.org", @@ -190,13 +183,6 @@ function run_test_1() { check_startup_changes(AddonManager.STARTUP_CHANGE_ENABLED, []); do_check_true(gCachePurged); - let file = gProfD.clone(); - file.append("extensions.sqlite"); - do_check_true(file.exists()); - - file.leafName = "extensions.ini"; - do_check_true(file.exists()); - AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org", "addon2@tests.mozilla.org", "addon3@tests.mozilla.org", @@ -298,10 +284,6 @@ function run_test_2() { check_startup_changes(AddonManager.STARTUP_CHANGE_ENABLED, []); do_check_true(gCachePurged); - var file = gProfD.clone(); - file.append("extensions.ini"); - do_check_true(file.exists()); - AddonManager.getAddonsByIDs(["addon1@tests.mozilla.org", "addon2@tests.mozilla.org", "addon3@tests.mozilla.org", From 7e954ee9403f12dd76f7e48d8b12378bf2b9419c Mon Sep 17 00:00:00 2001 From: Henri Sivonen Date: Fri, 4 Nov 2011 15:36:29 +0200 Subject: [PATCH 038/127] Bug 698935 addendum - Rename the errStrayStartTag string key because the value changed. r=l10n. --- dom/locales/en-US/chrome/layout/htmlparser.properties | 2 +- parser/html/nsHtml5TreeBuilderCppSupplement.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/locales/en-US/chrome/layout/htmlparser.properties b/dom/locales/en-US/chrome/layout/htmlparser.properties index be806aeb62f..4191e9182f4 100644 --- a/dom/locales/en-US/chrome/layout/htmlparser.properties +++ b/dom/locales/en-US/chrome/layout/htmlparser.properties @@ -104,7 +104,7 @@ errNoSpaceBetweenPublicAndSystemIds=No space between the doctype public and syst errNoSpaceBetweenDoctypePublicKeywordAndQuote=No space between the doctype \u201CPUBLIC\u201D keyword and the quote. # Tree builder errors -errStrayStartTag=Stray start tag \u201C%1$S\u201D. +errStrayStartTag2=Stray start tag \u201C%1$S\u201D. errStrayEndTag=Stray end tag \u201C%1$S\u201D. errUnclosedElements=End tag \u201C%1$S\u201D seen, but there were open elements. errUnclosedElementsImplied=End tag \u201C%1$S\u201D implied, but there were open elements. diff --git a/parser/html/nsHtml5TreeBuilderCppSupplement.h b/parser/html/nsHtml5TreeBuilderCppSupplement.h index c108106292f..d12a00b1f7c 100644 --- a/parser/html/nsHtml5TreeBuilderCppSupplement.h +++ b/parser/html/nsHtml5TreeBuilderCppSupplement.h @@ -730,7 +730,7 @@ void nsHtml5TreeBuilder::errStrayStartTag(nsIAtom* aName) { if (NS_UNLIKELY(mViewSource)) { - mViewSource->AddErrorToCurrentRun("errStrayStartTag", aName); + mViewSource->AddErrorToCurrentRun("errStrayStartTag2", aName); } } From 064b00666862de83be212158f0ecc0537ba99444 Mon Sep 17 00:00:00 2001 From: Henri Sivonen Date: Fri, 4 Nov 2011 15:36:29 +0200 Subject: [PATCH 039/127] Bug 699745 - Use UTF-8 instead of escapes in htmlparser.properties. r=l10n. --- .../en-US/chrome/layout/htmlparser.properties | 132 +++++++++--------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/dom/locales/en-US/chrome/layout/htmlparser.properties b/dom/locales/en-US/chrome/layout/htmlparser.properties index 4191e9182f4..944bf27b9e6 100644 --- a/dom/locales/en-US/chrome/layout/htmlparser.properties +++ b/dom/locales/en-US/chrome/layout/htmlparser.properties @@ -40,41 +40,41 @@ # which is available under the MIT license. # Tokenizer errors -errGarbageAfterLtSlash=Garbage after \u201C\u201D. Probable causes: Unescaped \u201C<\u201D (escape as \u201C<\u201D) or mistyped end tag. +errGarbageAfterLtSlash=Garbage after “”. Probable causes: Unescaped “<” (escape as “<”) or mistyped end tag. errCharRefLacksSemicolon=Character reference was not terminated by a semicolon. errNoDigitsInNCR=No digits in numeric character reference. -errGtInSystemId=\u201C>\u201D in system identifier. -errGtInPublicId=\u201C>\u201D in public identifier. +errGtInSystemId=“>” in system identifier. +errGtInPublicId=“>” in public identifier. errNamelessDoctype=Nameless doctype. -errConsecutiveHyphens=Consecutive hyphens did not terminate a comment. \u201C--\u201D is not permitted inside a comment, but e.g. \u201C- -\u201D is. -errPrematureEndOfComment=Premature end of comment. Use \u201C-->\u201D to end a comment properly. +errConsecutiveHyphens=Consecutive hyphens did not terminate a comment. “--” is not permitted inside a comment, but e.g. “- -” is. +errPrematureEndOfComment=Premature end of comment. Use “-->” to end a comment properly. errBogusComment=Bogus comment. -errUnquotedAttributeLt=\u201C<\u201D in an unquoted attribute value. Probable cause: Missing \u201C>\u201D immediately before. -errUnquotedAttributeGrave=\u201C`\u201D in an unquoted attribute value. Probable cause: Using the wrong character as a quote. +errUnquotedAttributeLt=“<” in an unquoted attribute value. Probable cause: Missing “>” immediately before. +errUnquotedAttributeGrave=“`” in an unquoted attribute value. Probable cause: Using the wrong character as a quote. errUnquotedAttributeQuote=Quote in an unquoted attribute value. Probable causes: Attributes running together or a URL query string in an unquoted attribute value. -errUnquotedAttributeEquals=\u201C=\u201D in an unquoted attribute value. Probable causes: Attributes running together or a URL query string in an unquoted attribute value. -errSlashNotFollowedByGt=A slash was not immediate followed by \u201C>\u201D. +errUnquotedAttributeEquals=“=” in an unquoted attribute value. Probable causes: Attributes running together or a URL query string in an unquoted attribute value. +errSlashNotFollowedByGt=A slash was not immediate followed by “>”. errNoSpaceBetweenAttributes=No space between attributes. -errUnquotedAttributeStartLt=\u201C<\u201D at the start of an unquoted attribute value. Probable cause: Missing \u201C>\u201D immediately before -errUnquotedAttributeStartGrave=\u201C`\u201D at the start of an unquoted attribute value. Probable cause: Using the wrong character as a quote. -errUnquotedAttributeStartEquals=\u201C=\u201D at the start of an unquoted attribute value. Probable cause: Stray duplicate equals sign. +errUnquotedAttributeStartLt=“<” at the start of an unquoted attribute value. Probable cause: Missing “>” immediately before +errUnquotedAttributeStartGrave=“`” at the start of an unquoted attribute value. Probable cause: Using the wrong character as a quote. +errUnquotedAttributeStartEquals=“=” at the start of an unquoted attribute value. Probable cause: Stray duplicate equals sign. errAttributeValueMissing=Attribute value missing. -errBadCharBeforeAttributeNameLt=Saw \u201C<\u201D when expecting an attribute name. Probable cause: Missing \u201C>\u201D immediately before. -errEqualsSignBeforeAttributeName=Saw \u201C=\u201D when expecting an attribute name. Probable cause: Attribute name missing. -errBadCharAfterLt=Bad character after \u201C<\u201D. Probable cause: Unescaped \u201C<\u201D. Try escaping it as \u201C<\u201D. -errLtGt=Saw \u201C<>\u201D. Probable causes: Unescaped \u201C<\u201D (escape as \u201C<\u201D) or mistyped start tag. -errProcessingInstruction=Saw \u201C\u201D missing immediately before. +errBadCharBeforeAttributeNameLt=Saw “<” when expecting an attribute name. Probable cause: Missing “>” immediately before. +errEqualsSignBeforeAttributeName=Saw “=” when expecting an attribute name. Probable cause: Attribute name missing. +errBadCharAfterLt=Bad character after “<”. Probable cause: Unescaped “<”. Try escaping it as “<”. +errLtGt=Saw “<>”. Probable causes: Unescaped “<” (escape as “<”) or mistyped start tag. +errProcessingInstruction=Saw “” missing immediately before. errQuoteInAttributeName=Quote in attribute name. Probable cause: Matching quote missing somewhere earlier. errExpectedPublicId=Expected a public identifier but the doctype ended. errBogusDoctype=Bogus doctype. maybeErrAttributesOnEndTag=End tag had attributes. -maybeErrSlashInEndTag=Stray \u201C/\u201D at the end of an end tag. +maybeErrSlashInEndTag=Stray “/” at the end of an end tag. errNcrNonCharacter=Character reference expands to a non-character. errAstralNonCharacter=Character reference expands to an astral non-character. errNcrSurrogate=Character reference expands to a surrogate. @@ -86,67 +86,67 @@ errEofInComment=End of file inside comment. errEofInDoctype=End of file inside doctype. errEofInAttributeValue=End of file reached when inside an attribute value. Ignoring tag. errEofInAttributeName=End of file occurred in an attribute name. Ignoring tag. -errEofWithoutGt=Saw end of file without the previous tag ending with \u201C>\u201D. Ignoring tag. +errEofWithoutGt=Saw end of file without the previous tag ending with “>”. Ignoring tag. errEofInTagName=End of file seen when looking for tag name. Ignoring tag. errEofInEndTag=End of file inside end tag. Ignoring tag. -errEofAfterLt=End of file after \u201C<\u201D. +errEofAfterLt=End of file after “<”. errNcrOutOfRange=Character reference outside the permissible Unicode range. errNcrUnassigned=Character reference expands to a permanently unassigned code point. errDuplicateAttribute=Duplicate attribute. errEofInSystemId=End of file inside system identifier. errExpectedSystemId=Expected a system identifier but the doctype ended. errMissingSpaceBeforeDoctypeName=Missing space before doctype name. -errHyphenHyphenBang=\u201C--!\u201D found in comment. +errHyphenHyphenBang=“--!” found in comment. errNcrControlChar=Character reference expands to a control character. errNcrZero=Character reference expands to zero. -errNoSpaceBetweenDoctypeSystemKeywordAndQuote=No space between the doctype \u201CSYSTEM\u201D keyword and the quote. +errNoSpaceBetweenDoctypeSystemKeywordAndQuote=No space between the doctype “SYSTEM” keyword and the quote. errNoSpaceBetweenPublicAndSystemIds=No space between the doctype public and system identifiers. -errNoSpaceBetweenDoctypePublicKeywordAndQuote=No space between the doctype \u201CPUBLIC\u201D keyword and the quote. +errNoSpaceBetweenDoctypePublicKeywordAndQuote=No space between the doctype “PUBLIC” keyword and the quote. # Tree builder errors -errStrayStartTag2=Stray start tag \u201C%1$S\u201D. -errStrayEndTag=Stray end tag \u201C%1$S\u201D. -errUnclosedElements=End tag \u201C%1$S\u201D seen, but there were open elements. -errUnclosedElementsImplied=End tag \u201C%1$S\u201D implied, but there were open elements. +errStrayStartTag2=Stray start tag “%1$S”. +errStrayEndTag=Stray end tag “%1$S”. +errUnclosedElements=End tag “%1$S” seen, but there were open elements. +errUnclosedElementsImplied=End tag “%1$S” implied, but there were open elements. errUnclosedElementsCell=A table cell was implicitly closed, but there were open elements. errStrayDoctype=Stray doctype. -errAlmostStandardsDoctype=Almost standards mode doctype. Expected \u201C\u201D. -errQuirkyDoctype=Quirky doctype. Expected \u201C\u201D. +errAlmostStandardsDoctype=Almost standards mode doctype. Expected “”. +errQuirkyDoctype=Quirky doctype. Expected “”. errNonSpaceInTrailer=Non-space character in page trailer. -errNonSpaceAfterFrameset=Non-space after \u201Cframeset\u201D. -errNonSpaceInFrameset=Non-space in \u201Cframeset\u201D. +errNonSpaceAfterFrameset=Non-space after “frameset”. +errNonSpaceInFrameset=Non-space in “frameset”. errNonSpaceAfterBody=Non-space character after body. -errNonSpaceInColgroupInFragment=Non-space in \u201Ccolgroup\u201D when parsing fragment. -errNonSpaceInNoscriptInHead=Non-space character inside \u201Cnoscript\u201D inside \u201Chead\u201D. -errFooBetweenHeadAndBody=\u201C%1$S\u201D element between \u201Chead\u201D and \u201Cbody\u201D. -errStartTagWithoutDoctype=Start tag seen without seeing a doctype first. Expected \u201C\u201D. -errNoSelectInTableScope=No \u201Cselect\u201D in table scope. -errStartSelectWhereEndSelectExpected=\u201Cselect\u201D start tag where end tag expected. -errStartTagWithSelectOpen=\u201C%1$S\u201D start tag with \u201Cselect\u201D open. -errBadStartTagInHead=Bad start tag in \u201C%1$S\u201D in \u201Chead\u201D. -errImage=Saw a start tag \u201Cimage\u201D. -errIsindex=\u201Cisindex\u201D seen. -errFooSeenWhenFooOpen=An \u201C%1$S\u201D start tag seen but an element of the same type was already open. +errNonSpaceInColgroupInFragment=Non-space in “colgroup” when parsing fragment. +errNonSpaceInNoscriptInHead=Non-space character inside “noscript” inside “head”. +errFooBetweenHeadAndBody=“%1$S” element between “head” and “body”. +errStartTagWithoutDoctype=Start tag seen without seeing a doctype first. Expected “”. +errNoSelectInTableScope=No “select” in table scope. +errStartSelectWhereEndSelectExpected=“select” start tag where end tag expected. +errStartTagWithSelectOpen=“%1$S” start tag with “select” open. +errBadStartTagInHead=Bad start tag in “%1$S” in “head”. +errImage=Saw a start tag “image”. +errIsindex=“isindex” seen. +errFooSeenWhenFooOpen=An “%1$S” start tag seen but an element of the same type was already open. errHeadingWhenHeadingOpen=Heading cannot be a child of another heading. -errFramesetStart=\u201Cframeset\u201D start tag seen. +errFramesetStart=“frameset” start tag seen. errNoCellToClose=No cell to close. -errStartTagInTable=Start tag \u201C%1$S\u201D seen in \u201Ctable\u201D. -errFormWhenFormOpen=Saw a \u201Cform\u201D start tag, but there was already an active \u201Cform\u201D element. Nested forms are not allowed. Ignoring the tag. -errTableSeenWhileTableOpen=Start tag for \u201Ctable\u201D seen but the previous \u201Ctable\u201D is still open. -errStartTagInTableBody=\u201C%1$S\u201D start tag in table body. -errEndTagSeenWithoutDoctype=End tag seen without seeing a doctype first. Expected \u201C\u201D. -errEndTagAfterBody=Saw an end tag after \u201Cbody\u201D had been closed. -errEndTagSeenWithSelectOpen=\u201C%1$S\u201D end tag with \u201Cselect\u201D open. -errGarbageInColgroup=Garbage in \u201Ccolgroup\u201D fragment. -errEndTagBr=End tag \u201Cbr\u201D. -errNoElementToCloseButEndTagSeen=No \u201C%1$S\u201D element in scope but a \u201C%1$S\u201D end tag seen. -errHtmlStartTagInForeignContext=HTML start tag \u201C%1$S\u201D in a foreign namespace context. -errTableClosedWhileCaptionOpen=\u201Ctable\u201D closed but \u201Ccaption\u201D was still open. +errStartTagInTable=Start tag “%1$S” seen in “table”. +errFormWhenFormOpen=Saw a “form” start tag, but there was already an active “form” element. Nested forms are not allowed. Ignoring the tag. +errTableSeenWhileTableOpen=Start tag for “table” seen but the previous “table” is still open. +errStartTagInTableBody=“%1$S” start tag in table body. +errEndTagSeenWithoutDoctype=End tag seen without seeing a doctype first. Expected “”. +errEndTagAfterBody=Saw an end tag after “body” had been closed. +errEndTagSeenWithSelectOpen=“%1$S” end tag with “select” open. +errGarbageInColgroup=Garbage in “colgroup” fragment. +errEndTagBr=End tag “br”. +errNoElementToCloseButEndTagSeen=No “%1$S” element in scope but a “%1$S” end tag seen. +errHtmlStartTagInForeignContext=HTML start tag “%1$S” in a foreign namespace context. +errTableClosedWhileCaptionOpen=“table” closed but “caption” was still open. errNoTableRowToClose=No table row to close. errNonSpaceInTable=Misplaced non-space characters inside a table. -errUnclosedChildrenInRuby=Unclosed children in \u201Cruby\u201D. -errStartTagSeenWithoutRuby=Start tag \u201C%1$S\u201D seen without a \u201Cruby\u201D element being open. -errSelfClosing=Self-closing syntax (\u201C/>\u201D) used on a non-void HTML element. Ignoring the slash and treating as a start tag. +errUnclosedChildrenInRuby=Unclosed children in “ruby”. +errStartTagSeenWithoutRuby=Start tag “%1$S” seen without a “ruby” element being open. +errSelfClosing=Self-closing syntax (“/>”) used on a non-void HTML element. Ignoring the slash and treating as a start tag. errNoCheckUnclosedElementsOnStack=Unclosed elements on stack. -errEndTagDidNotMatchCurrentOpenElement=End tag \u201C%1$S\u201D did not match the name of the current open element (\u201C%2$S\u201D). -errEndTagViolatesNestingRules=End tag \u201C%1$S\u201D violates nesting rules. +errEndTagDidNotMatchCurrentOpenElement=End tag “%1$S” did not match the name of the current open element (“%2$S”). +errEndTagViolatesNestingRules=End tag “%1$S” violates nesting rules. From 3b83c07a1caf6aaf07c574d9c800207f491d4a70 Mon Sep 17 00:00:00 2001 From: Henri Sivonen Date: Fri, 4 Nov 2011 15:36:29 +0200 Subject: [PATCH 040/127] Bug 699749 - Avoid the term "astral" in error messages. r=l10n. --- dom/locales/en-US/chrome/layout/htmlparser.properties | 1 - parser/html/nsHtml5TokenizerCppSupplement.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dom/locales/en-US/chrome/layout/htmlparser.properties b/dom/locales/en-US/chrome/layout/htmlparser.properties index 944bf27b9e6..0b61b1002d1 100644 --- a/dom/locales/en-US/chrome/layout/htmlparser.properties +++ b/dom/locales/en-US/chrome/layout/htmlparser.properties @@ -76,7 +76,6 @@ errBogusDoctype=Bogus doctype. maybeErrAttributesOnEndTag=End tag had attributes. maybeErrSlashInEndTag=Stray “/” at the end of an end tag. errNcrNonCharacter=Character reference expands to a non-character. -errAstralNonCharacter=Character reference expands to an astral non-character. errNcrSurrogate=Character reference expands to a surrogate. errNcrControlChar=Character reference expands to a control character. errNcrCr=A numeric character reference expanded to carriage return. diff --git a/parser/html/nsHtml5TokenizerCppSupplement.h b/parser/html/nsHtml5TokenizerCppSupplement.h index 45542c59abe..2aac5f31b43 100644 --- a/parser/html/nsHtml5TokenizerCppSupplement.h +++ b/parser/html/nsHtml5TokenizerCppSupplement.h @@ -179,7 +179,7 @@ void nsHtml5Tokenizer::errAstralNonCharacter(int ch) { if (NS_UNLIKELY(mViewSource)) { - mViewSource->AddErrorToCurrentNode("errAstralNonCharacter"); + mViewSource->AddErrorToCurrentNode("errNcrNonCharacter"); } } From fe8bc2a6c0f3f326e7fac533d7fd132bf9dc93aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Fri, 4 Nov 2011 09:49:48 -0400 Subject: [PATCH 041/127] Bug 696376 - If stacks_enabled is false, only walk the stack on OS X 32 bits. r= dbaron. The 64 bit stack walks lack the InCriticalRange functionality and it looks like the extra walks are causing an orange on leaktest on the bot. --HG-- extra : rebase_source : 4c0a75892e30a6e522ed981a1ff12df99d2a0464 --- tools/trace-malloc/lib/nsTraceMalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/trace-malloc/lib/nsTraceMalloc.c b/tools/trace-malloc/lib/nsTraceMalloc.c index 72098ace3d3..8f47110222a 100644 --- a/tools/trace-malloc/lib/nsTraceMalloc.c +++ b/tools/trace-malloc/lib/nsTraceMalloc.c @@ -957,7 +957,7 @@ backtrace(tm_thread *t, int skip, int *immediate_abort) t->suppress_tracing++; if (!stacks_enabled) { -#if defined(XP_MACOSX) +#if defined(XP_MACOSX) && defined(__i386) /* Walk the stack, even if stacks_enabled is false. We do this to check if we must set immediate_abort. */ info->entries = 0; From 805464c4b423aee18878166550fa069c8b27714c Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Fri, 4 Nov 2011 09:56:17 -0400 Subject: [PATCH 042/127] Bug 695421 - Fixed crash for ICO files that have a large (and wrong) width specified. r=joe --- image/decoders/nsICODecoder.cpp | 65 ++++++++++++++++++++++++++++++--- image/decoders/nsICODecoder.h | 10 ++++- 2 files changed, 68 insertions(+), 7 deletions(-) diff --git a/image/decoders/nsICODecoder.cpp b/image/decoders/nsICODecoder.cpp index 83d025ac20d..6151d511f00 100644 --- a/image/decoders/nsICODecoder.cpp +++ b/image/decoders/nsICODecoder.cpp @@ -166,12 +166,57 @@ bool nsICODecoder::FillBitmapFileHeaderBuffer(PRInt8 *bfh) // A BMP inside of an ICO has *2 height because of the AND mask // that follows the actual bitmap. The BMP shouldn't know about // this difference though. -void -nsICODecoder::FillBitmapInformationBufferHeight(PRInt8 *bih) +bool +nsICODecoder::FixBitmapHeight(PRInt8 *bih) { - PRInt32 height = GetRealHeight(); + // Get the height from the BMP file information header + PRInt32 height; + memcpy(&height, bih + 8, sizeof(height)); + height = LITTLE_TO_NATIVE32(height); + + // The bitmap height is by definition * 2 what it should be to account for + // the 'AND mask'. It is * 2 even if the `AND mask` is not present. + height /= 2; + + if (height > 256) { + return false; + } + + // We should always trust the height from the bitmap itself instead of + // the ICO height. So fix the ICO height. + if (height == 256) { + mDirEntry.mHeight = 0; + } else { + mDirEntry.mHeight = (PRInt8)height; + } + + // Fix the BMP height in the BIH so that the BMP decoder can work properly height = NATIVE32_TO_LITTLE(height); memcpy(bih + 8, &height, sizeof(height)); + return true; +} + +// We should always trust the contained resource for the width +// information over our own information. +bool +nsICODecoder::FixBitmapWidth(PRInt8 *bih) +{ + // Get the width from the BMP file information header + PRInt32 width; + memcpy(&width, bih + 4, sizeof(width)); + width = LITTLE_TO_NATIVE32(width); + if (width > 256) { + return false; + } + + // We should always trust the width from the bitmap itself instead of + // the ICO width. + if (width == 256) { + mDirEntry.mWidth = 0; + } else { + mDirEntry.mWidth = (PRInt8)width; + } + return true; } // The BMP information header's bits per pixel should be trusted @@ -410,8 +455,18 @@ nsICODecoder::WriteInternal(const char* aBuffer, PRUint32 aCount) // Setup the cursor hot spot if one is present SetHotSpotIfCursor(); - // Fix the height on the BMP resource - FillBitmapInformationBufferHeight((PRInt8*)mBIHraw); + // Fix the ICO height from the BIH. + // Fix the height on the BIH to be /2 so our BMP decoder will understand. + if (!FixBitmapHeight(reinterpret_cast(mBIHraw))) { + PostDataError(); + return; + } + + // Fix the ICO width from the BIH. + if (!FixBitmapWidth(reinterpret_cast(mBIHraw))) { + PostDataError(); + return; + } // Write out the BMP's bitmap info header mContainedDecoder->Write(mBIHraw, sizeof(mBIHraw)); diff --git a/image/decoders/nsICODecoder.h b/image/decoders/nsICODecoder.h index 87dec0509c4..435b2699e4c 100644 --- a/image/decoders/nsICODecoder.h +++ b/image/decoders/nsICODecoder.h @@ -83,8 +83,14 @@ private: void SetHotSpotIfCursor(); // Creates a bitmap file header buffer, returns true if successful bool FillBitmapFileHeaderBuffer(PRInt8 *bfh); - // Fixes the height of a BMP information header field - void FillBitmapInformationBufferHeight(PRInt8 *bih); + // Fixes the ICO height to match that of the BIH. + // and also fixes the BIH height to be /2 of what it was. + // See definition for explanation. + // Returns false if invalid information is contained within. + bool FixBitmapHeight(PRInt8 *bih); + // Fixes the ICO width to match that of the BIH. + // Returns false if invalid information is contained within. + bool FixBitmapWidth(PRInt8 *bih); // Extract bitmap info header size count from BMP information header PRInt32 ExtractBIHSizeFromBitmap(PRInt8 *bih); // Extract bit count from BMP information header From aeb92c0fe703b4221d54b4ef3856a238b0a3981f Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Fri, 4 Nov 2011 09:57:24 -0400 Subject: [PATCH 043/127] Bug 695421 - Some reftests with invalid width and height in the ICO header. r=joe --- .../test/reftest/ico/ico-bmp-corrupted/16x16.png | Bin 0 -> 879 bytes .../ico/ico-bmp-corrupted/invalid_ico_height.ico | Bin 0 -> 894 bytes .../ico/ico-bmp-corrupted/invalid_ico_width.ico | Bin 0 -> 894 bytes .../reftest/ico/ico-bmp-corrupted/reftest.list | 4 ++++ 4 files changed, 4 insertions(+) create mode 100644 image/test/reftest/ico/ico-bmp-corrupted/16x16.png create mode 100644 image/test/reftest/ico/ico-bmp-corrupted/invalid_ico_height.ico create mode 100644 image/test/reftest/ico/ico-bmp-corrupted/invalid_ico_width.ico diff --git a/image/test/reftest/ico/ico-bmp-corrupted/16x16.png b/image/test/reftest/ico/ico-bmp-corrupted/16x16.png new file mode 100644 index 0000000000000000000000000000000000000000..c04869e728ed01902838c869fc437bf07ad8c5f4 GIT binary patch literal 879 zcmV-#1CacQP)El)7=Yo=`DvWALSnHexX~t=dQBH+h}%MAer~kH5s1^G#?!d1ZQMzmXoVwFP!?q(NO3Og^n+{zOd~J8@@vAD2{oQq3rAA{YA8+BAKVRkc%HAQpXFA6iNc`B^}%fxdha3AZxo`A5O#!9PZ)NE zfhTl5q3tO+UYuq}#p>u(y(P+Ck$m?yy0^xB=VRpZVS-6p7`wvA6?|71xI))eaNRhL zo1y7mqweM~+eON5g+hA`-EFYoeu`W?P?$KvxFrOR;5$O!5jw3HUu>sowKO)IMJ#89 zs#C#m*2y~!G-r!U>j5&o7bm(aoZCWRD-3Ogz8$C2Oyk-bJN6Q`U8HVTFzq$Uc7uYw ziQe30q4^M*eiS3BE1X*jztj|bD^9PL=IdIPwv}VYDq>p|toj<&dV`X6pL~4}&DtmP z;kU^2-8d6dIA2u=stNq6O3%#VRdckfD>!Ba+x!5_Y*01tQ#L=RVD6)v-!s4Z7@5AQ zFfoL%6yw=V6~C0FZ!FO?$j!ds7d6`uSHJw0P z@$=Sr)dy@TyXdYnwF>W5?`g4rWM1ftJvP#O! zrMh5m7vLj@VS=;A(F1BgS-f7r&%eK~RqibuMwzAuk9`xqX-6@b1`U#K-NC?Dd z`YykHANTuKEuy!H+9mQ9!FT&Y>A^WTDbNJy1ZW5}Ky<)TDo}En_UhDXI7W+V zYmU;T(x-GDeU*cofg6K&0)sJl0eA!CIjl!Gw{5)gwTbMLb#2> zb#~MdMurq>i=o^Y;Tul`_SqDo459?02}B`^e283#C`1IJb%;8p$Pi9caU$0yca&EXAW5gSqy0eSqRw>QV;%c zn2a!)jWP?ecbH5qWpzFkg_m=ce=bTFe^rWKOT{mh;-_-)s9bzgE*(oSo| zYiZodumj>&h+WumERHH}l@^zY+oak>f(z1Yv~h9jaw7ZzocMh7JckDW&Hl;jF!N>D zU;!2YU}?rI!Ic^R_Wv5<|Eh9-NZfOoJJzaCbnZKgd)VXlcKA)o-x_djpKFb|#)Q9; zaBuuxt(F&ZPJAKZco9d}q@xx-Y~w*!ayIeyo@9R^ng>{ajGM=}{v6{oQDB#*tdjEb z=_MsvRL09n&{DkiRoYd^ma?%cn-8xV2eSHDk&k8RS$z)O$U#k+X3SlCDmKHK>MyJA zTPkfg$t|_FrFM3;)qPDp(BvOgeAE=!cXBXNw0c(3BTf%RV_4U{W!-5R};}ML95V{aj2)9wV z&W<|5$dE#9F_ar4eEo^QKAS?6L6kr=fha_g50MKIg@{134pFBR8N!JwPUPAIFFh5| zuQ|ji#4*GZh({0);nYJ3MF~N%4Y37@&crHrT9;z{=BdEE%puDliy@653n3dq>cO85 zlMyDfQD#B*Hj}BPtj?#R@M5m=_eJUARi*f?RQysYekvD_%EdS3;`8doy-IPreEu<8 XyjMQISt*vd^UKxzHGm&h{ty2Ew&Oc2 literal 0 HcmV?d00001 diff --git a/image/test/reftest/ico/ico-bmp-corrupted/reftest.list b/image/test/reftest/ico/ico-bmp-corrupted/reftest.list index acff771efd3..69176e192f0 100644 --- a/image/test/reftest/ico/ico-bmp-corrupted/reftest.list +++ b/image/test/reftest/ico/ico-bmp-corrupted/reftest.list @@ -9,3 +9,7 @@ # Invalid compression value == wrapper.html?invalid-compression.ico about:blank +# Invalid ICO width and heigth should be ignored if the +# contained BMP is correct. +== invalid_ico_height.ico 16x16.png +== invalid_ico_width.ico 16x16.png From 66a5c67288ed5883c1470214b6d5c60d81033257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Fri, 4 Nov 2011 11:24:54 -0400 Subject: [PATCH 044/127] Bug 696478 - Use weak references. r=mak. --- toolkit/components/satchel/nsFormAutoComplete.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolkit/components/satchel/nsFormAutoComplete.js b/toolkit/components/satchel/nsFormAutoComplete.js index c730d91400f..be2142c33d1 100644 --- a/toolkit/components/satchel/nsFormAutoComplete.js +++ b/toolkit/components/satchel/nsFormAutoComplete.js @@ -73,7 +73,7 @@ FormAutoComplete.prototype = { // Preferences. Add observer so we get notified of changes. this._prefBranch = Services.prefs.getBranch("browser.formfill."); this._prefBranch.QueryInterface(Ci.nsIPrefBranch2); - this._prefBranch.addObserver("", this.observer, false); + this._prefBranch.addObserver("", this.observer, true); this.observer._self = this; this._debug = this._prefBranch.getBoolPref("debug"); @@ -86,7 +86,7 @@ FormAutoComplete.prototype = { this._dbStmts = []; - Services.obs.addObserver(this.observer, "xpcom-shutdown", false); + Services.obs.addObserver(this.observer, "xpcom-shutdown", true); }, observer : { From a2b486690b2435d563813546a580ee20424f71bc Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Fri, 4 Nov 2011 11:41:53 -0400 Subject: [PATCH 045/127] Bug 699101 - Warn when NO_MAC_JEMALLOC is set on i386 machines, because it doesn't work there. r=khuey --- memory/jemalloc/jemalloc.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/memory/jemalloc/jemalloc.c b/memory/jemalloc/jemalloc.c index 85c15803cf6..f676fb45852 100644 --- a/memory/jemalloc/jemalloc.c +++ b/memory/jemalloc/jemalloc.c @@ -6073,8 +6073,13 @@ MALLOC_OUT: default_zone->version == LION_MALLOC_ZONE_T_VERSION); /* Allow us dynamically turn off jemalloc for testing. */ - if (getenv("NO_MAC_JEMALLOC")) + if (getenv("NO_MAC_JEMALLOC")) { osx_use_jemalloc = false; +#ifdef __i386__ + malloc_printf("Warning: NO_MAC_JEMALLOC has no effect on " + "i386 machines (such as this one).\n"); +#endif + } if (osx_use_jemalloc) { /* @@ -6175,8 +6180,11 @@ wrap(strdup)(const char *src) { * allocators, we need to call the OSX allocators from the functions below, * when osx_use_jemalloc is not (dynamically) set. * - * memalign is unavailable on Leopard, so we can't dynamically do this there. - * However, we don't use jemalloc on Leopard, so we can ignore this. + * Note that we assume jemalloc is enabled on i386. This is safe because the + * only i386 versions of MacOS are 10.5 and 10.6, which we support. We have to + * do this because madvise isn't in the malloc zone struct for 10.5. + * + * This means that NO_MAC_JEMALLOC doesn't work on i386. */ #if defined(MOZ_MEMORY_DARWIN) && !defined(__i386__) #define DARWIN_ONLY(A) if (!osx_use_jemalloc) { A; } From 7bfdd358694aa6e6937bf47e95c262e8aca1dc6a Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Fri, 4 Nov 2011 13:47:28 -0400 Subject: [PATCH 046/127] Bug 695498. Backout 7aa60d6408b3. mDecoder can go NULL when we don't expect it. --- image/src/RasterImage.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/image/src/RasterImage.cpp b/image/src/RasterImage.cpp index 57940dbe839..ffb999751f8 100644 --- a/image/src/RasterImage.cpp +++ b/image/src/RasterImage.cpp @@ -2281,13 +2281,16 @@ RasterImage::WriteToDecoder(const char *aBuffer, PRUint32 aCount) curframe->UnlockImageData(); } - nsresult status = mDecoder->GetDecoderError(); - if (NS_SUCCEEDED(status)) { - // Keep track of the total number of bytes written over the lifetime of the - // decoder - mBytesDecoded += aCount; - } - return status; + if (!mDecoder) + return NS_ERROR_FAILURE; + + CONTAINER_ENSURE_SUCCESS(mDecoder->GetDecoderError()); + + // Keep track of the total number of bytes written over the lifetime of the + // decoder + mBytesDecoded += aCount; + + return NS_OK; } // This function is called in situations where it's clear that we want the From ee1456417aa2d934732bc08b7e5203d88e3ea645 Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Fri, 4 Nov 2011 19:17:19 +0200 Subject: [PATCH 047/127] Bug 698929 - Implement event.stopImmediatePropagation, r=jst --HG-- extra : rebase_source : 76d19175a58a4ac8113b144a19f9d7679ad54dd0 --- content/events/src/nsDOMEvent.cpp | 8 ++++ content/events/src/nsEventDispatcher.cpp | 11 +++-- content/events/src/nsEventListenerManager.cpp | 3 ++ content/events/test/Makefile.in | 1 + content/events/test/test_bug698929.html | 47 +++++++++++++++++++ dom/indexedDB/nsIIDBVersionChangeEvent.idl | 2 +- .../events/nsIDOMAnimationEvent.idl | 2 +- .../events/nsIDOMBeforeUnloadEvent.idl | 2 +- dom/interfaces/events/nsIDOMCloseEvent.idl | 2 +- dom/interfaces/events/nsIDOMCommandEvent.idl | 2 +- .../events/nsIDOMCompositionEvent.idl | 2 +- dom/interfaces/events/nsIDOMCustomEvent.idl | 2 +- .../events/nsIDOMDataContainerEvent.idl | 2 +- .../events/nsIDOMDeviceMotionEvent.idl | 2 +- .../events/nsIDOMDeviceOrientationEvent.idl | 2 +- dom/interfaces/events/nsIDOMDragEvent.idl | 2 +- dom/interfaces/events/nsIDOMEvent.idl | 8 +++- .../events/nsIDOMHashChangeEvent.idl | 2 +- dom/interfaces/events/nsIDOMKeyEvent.idl | 2 +- dom/interfaces/events/nsIDOMMessageEvent.idl | 2 +- dom/interfaces/events/nsIDOMMouseEvent.idl | 2 +- .../events/nsIDOMMouseScrollEvent.idl | 2 +- dom/interfaces/events/nsIDOMMozTouchEvent.idl | 2 +- dom/interfaces/events/nsIDOMMutationEvent.idl | 2 +- .../nsIDOMNotifyAudioAvailableEvent.idl | 2 +- .../events/nsIDOMNotifyPaintEvent.idl | 2 +- .../events/nsIDOMPageTransitionEvent.idl | 2 +- dom/interfaces/events/nsIDOMPopStateEvent.idl | 2 +- .../events/nsIDOMPopupBlockedEvent.idl | 2 +- dom/interfaces/events/nsIDOMProgressEvent.idl | 2 +- .../events/nsIDOMScrollAreaEvent.idl | 2 +- .../events/nsIDOMSimpleGestureEvent.idl | 2 +- .../events/nsIDOMSmartCardEvent.idl | 2 +- dom/interfaces/events/nsIDOMTouchEvent.idl | 2 +- .../events/nsIDOMTransitionEvent.idl | 2 +- dom/interfaces/events/nsIDOMUIEvent.idl | 2 +- .../load-save/nsIDOMLSProgressEvent.idl | 2 +- dom/interfaces/smil/nsIDOMTimeEvent.idl | 2 +- dom/interfaces/storage/nsIDOMStorageEvent.idl | 2 +- .../storage/nsIDOMStorageEventObsolete.idl | 2 +- dom/interfaces/svg/nsIDOMSVGEvent.idl | 2 +- dom/interfaces/svg/nsIDOMSVGZoomEvent.idl | 2 +- dom/interfaces/threads/nsIDOMWorkers.idl | 4 +- dom/interfaces/xul/nsIDOMXULCommandEvent.idl | 2 +- security/manager/ssl/src/nsSmartCardEvent.cpp | 6 +++ widget/public/nsGUIEvent.h | 2 + 46 files changed, 121 insertions(+), 43 deletions(-) create mode 100644 content/events/test/test_bug698929.html diff --git a/content/events/src/nsDOMEvent.cpp b/content/events/src/nsDOMEvent.cpp index ffd5802de55..6252eee1fb4 100644 --- a/content/events/src/nsDOMEvent.cpp +++ b/content/events/src/nsDOMEvent.cpp @@ -422,6 +422,14 @@ nsDOMEvent::StopPropagation() return NS_OK; } +NS_IMETHODIMP +nsDOMEvent::StopImmediatePropagation() +{ + mEvent->flags |= + (NS_EVENT_FLAG_STOP_DISPATCH_IMMEDIATELY | NS_EVENT_FLAG_STOP_DISPATCH); + return NS_OK; +} + static nsIDocument* GetDocumentForReport(nsEvent* aEvent) { nsCOMPtr node = do_QueryInterface(aEvent->currentTarget); diff --git a/content/events/src/nsEventDispatcher.cpp b/content/events/src/nsEventDispatcher.cpp index e0b5b8295f2..69e7154e393 100644 --- a/content/events/src/nsEventDispatcher.cpp +++ b/content/events/src/nsEventDispatcher.cpp @@ -376,9 +376,9 @@ nsEventTargetChainItem::HandleEventTargetChain(nsEventChainPostVisitor& aVisitor if (!(aFlags & NS_EVENT_FLAG_SYSTEM_EVENT)) { // Dispatch to the system event group. Make sure to clear the - // STOP_DISPATCH flag since this resets for each event group - // per DOM3 Events. - aVisitor.mEvent->flags &= ~NS_EVENT_FLAG_STOP_DISPATCH; + // STOP_DISPATCH flag since this resets for each event group. + aVisitor.mEvent->flags &= + ~(NS_EVENT_FLAG_STOP_DISPATCH | NS_EVENT_FLAG_STOP_DISPATCH_IMMEDIATELY); // Setting back the original target of the event. aVisitor.mEvent->target = aVisitor.mEvent->originalTarget; @@ -396,6 +396,11 @@ nsEventTargetChainItem::HandleEventTargetChain(nsEventChainPostVisitor& aVisitor aCallback, createdELMs != nsEventListenerManager::sCreatedCount, aPusher); + + // After dispatch, clear all the propagation flags so that + // system group listeners don't affect to the event. + aVisitor.mEvent->flags &= + ~(NS_EVENT_FLAG_STOP_DISPATCH | NS_EVENT_FLAG_STOP_DISPATCH_IMMEDIATELY); } return NS_OK; diff --git a/content/events/src/nsEventListenerManager.cpp b/content/events/src/nsEventListenerManager.cpp index 5692649c3af..84f509bad0f 100644 --- a/content/events/src/nsEventListenerManager.cpp +++ b/content/events/src/nsEventListenerManager.cpp @@ -764,6 +764,9 @@ nsEventListenerManager::HandleEventInternal(nsPresContext* aPresContext, nsAutoPopupStatePusher popupStatePusher(nsDOMEvent::GetEventPopupControlState(aEvent)); bool hasListener = false; while (iter.HasMore()) { + if (aEvent->flags & NS_EVENT_FLAG_STOP_DISPATCH_IMMEDIATELY) { + break; + } nsListenerStruct* ls = &iter.GetNext(); // Check that the phase is same in event and event listener. // Handle only trusted events, except when listener permits untrusted events. diff --git a/content/events/test/Makefile.in b/content/events/test/Makefile.in index 22155be630f..707613f0146 100644 --- a/content/events/test/Makefile.in +++ b/content/events/test/Makefile.in @@ -111,6 +111,7 @@ _TEST_FILES = \ test_bug667612.html \ empty.js \ test_bug689564.html \ + test_bug698929.html \ $(NULL) #bug 585630 diff --git a/content/events/test/test_bug698929.html b/content/events/test/test_bug698929.html new file mode 100644 index 00000000000..03c2ff0811a --- /dev/null +++ b/content/events/test/test_bug698929.html @@ -0,0 +1,47 @@ + + + + + Test for Bug 698929 + + + + +Mozilla Bug 698929 +

+ +
+
+
+ + diff --git a/dom/indexedDB/nsIIDBVersionChangeEvent.idl b/dom/indexedDB/nsIIDBVersionChangeEvent.idl index 73eb395006d..f1e8c456270 100644 --- a/dom/indexedDB/nsIIDBVersionChangeEvent.idl +++ b/dom/indexedDB/nsIIDBVersionChangeEvent.idl @@ -39,7 +39,7 @@ #include "nsIDOMEvent.idl" -[scriptable, builtinclass, uuid(2c5159dc-7d71-4fc6-a3b3-884ed7586456)] +[scriptable, builtinclass, uuid(52e21085-d6cd-4886-a5eb-19b47d13abf6)] interface nsIIDBVersionChangeEvent : nsIDOMEvent { readonly attribute unsigned long long oldVersion; diff --git a/dom/interfaces/events/nsIDOMAnimationEvent.idl b/dom/interfaces/events/nsIDOMAnimationEvent.idl index bca17389c38..10804786509 100644 --- a/dom/interfaces/events/nsIDOMAnimationEvent.idl +++ b/dom/interfaces/events/nsIDOMAnimationEvent.idl @@ -43,7 +43,7 @@ * http://dev.w3.org/csswg/css3-animations/#animation-events- */ -[scriptable, uuid(656d5f7c-c116-4154-8afd-f2c7458c7fb7)] +[scriptable, uuid(cf76ec40-85fb-4623-b637-59a50af36d60)] interface nsIDOMAnimationEvent : nsIDOMEvent { readonly attribute DOMString animationName; readonly attribute float elapsedTime; diff --git a/dom/interfaces/events/nsIDOMBeforeUnloadEvent.idl b/dom/interfaces/events/nsIDOMBeforeUnloadEvent.idl index 10c92e4dc53..e0968cf9970 100644 --- a/dom/interfaces/events/nsIDOMBeforeUnloadEvent.idl +++ b/dom/interfaces/events/nsIDOMBeforeUnloadEvent.idl @@ -48,7 +48,7 @@ * */ -[scriptable, uuid(da19e9dc-dea2-4a1d-a958-9be375c9799c)] +[scriptable, uuid(d286b454-0ed0-4e4b-b51d-3cf6d8c1299d)] interface nsIDOMBeforeUnloadEvent : nsIDOMEvent { /** diff --git a/dom/interfaces/events/nsIDOMCloseEvent.idl b/dom/interfaces/events/nsIDOMCloseEvent.idl index 8807705d2f8..feaecd48213 100644 --- a/dom/interfaces/events/nsIDOMCloseEvent.idl +++ b/dom/interfaces/events/nsIDOMCloseEvent.idl @@ -45,7 +45,7 @@ * For more information on this interface, please see * http://dev.w3.org/html5/websockets/#closeevent */ -[scriptable, uuid(f83d9d6d-6c0c-418c-b12a-438e76d5866b)] +[scriptable, uuid(07fb24d2-a102-41a2-bdaa-eb5e0d399eba)] interface nsIDOMCloseEvent : nsIDOMEvent { readonly attribute boolean wasClean; diff --git a/dom/interfaces/events/nsIDOMCommandEvent.idl b/dom/interfaces/events/nsIDOMCommandEvent.idl index 5c33cb49279..37023b3a5a5 100644 --- a/dom/interfaces/events/nsIDOMCommandEvent.idl +++ b/dom/interfaces/events/nsIDOMCommandEvent.idl @@ -37,7 +37,7 @@ #include "nsIDOMEvent.idl" -[scriptable, uuid(37fb1798-0f76-4870-af6f-0135b4d973c8)] +[scriptable, uuid(cfdbc647-847f-4bd9-8595-5dd0a1592b7b)] interface nsIDOMCommandEvent : nsIDOMEvent { readonly attribute DOMString command; diff --git a/dom/interfaces/events/nsIDOMCompositionEvent.idl b/dom/interfaces/events/nsIDOMCompositionEvent.idl index a31cf9cb6b5..08961ed0f95 100644 --- a/dom/interfaces/events/nsIDOMCompositionEvent.idl +++ b/dom/interfaces/events/nsIDOMCompositionEvent.idl @@ -39,7 +39,7 @@ #include "nsIDOMUIEvent.idl" -[scriptable, uuid(bf01c23c-cf5f-4a8e-86a7-040c6e45d685)] +[scriptable, uuid(9244a692-2827-4f98-8335-fff958d046fc)] interface nsIDOMCompositionEvent : nsIDOMUIEvent { readonly attribute DOMString data; diff --git a/dom/interfaces/events/nsIDOMCustomEvent.idl b/dom/interfaces/events/nsIDOMCustomEvent.idl index 06ea9f211f7..15769afe1cc 100644 --- a/dom/interfaces/events/nsIDOMCustomEvent.idl +++ b/dom/interfaces/events/nsIDOMCustomEvent.idl @@ -38,7 +38,7 @@ #include "nsIDOMEvent.idl" interface nsIVariant; -[scriptable, uuid(e93f84c5-e72f-4429-b797-f0c28d87890f)] +[scriptable, uuid(eee65f98-bb6f-489c-b7e3-40e5f0c90645)] interface nsIDOMCustomEvent : nsIDOMEvent { diff --git a/dom/interfaces/events/nsIDOMDataContainerEvent.idl b/dom/interfaces/events/nsIDOMDataContainerEvent.idl index 108b1e723f1..5cdfcd6f83c 100644 --- a/dom/interfaces/events/nsIDOMDataContainerEvent.idl +++ b/dom/interfaces/events/nsIDOMDataContainerEvent.idl @@ -39,7 +39,7 @@ #include "nsIDOMEvent.idl" #include "nsIVariant.idl" -[scriptable, uuid(3600d66c-b9ac-4c22-b39a-d64cce619921)] +[scriptable, uuid(ac70e6bd-1f52-45ce-9d63-0aa650480ba1)] interface nsIDOMDataContainerEvent : nsIDOMEvent { /** diff --git a/dom/interfaces/events/nsIDOMDeviceMotionEvent.idl b/dom/interfaces/events/nsIDOMDeviceMotionEvent.idl index e300578fe4f..736386028b5 100644 --- a/dom/interfaces/events/nsIDOMDeviceMotionEvent.idl +++ b/dom/interfaces/events/nsIDOMDeviceMotionEvent.idl @@ -53,7 +53,7 @@ interface nsIDOMDeviceRotationRate : nsISupports }; -[scriptable, uuid(66E8D2C9-0826-444C-8FB8-E509BC9615F8)] +[scriptable, uuid(b74dfd3f-0d16-4717-aaf7-8cadfe739532)] interface nsIDOMDeviceMotionEvent : nsIDOMEvent { void initDeviceMotionEvent(in DOMString eventTypeArg, diff --git a/dom/interfaces/events/nsIDOMDeviceOrientationEvent.idl b/dom/interfaces/events/nsIDOMDeviceOrientationEvent.idl index 7192bdb2e29..3173b26fcf8 100644 --- a/dom/interfaces/events/nsIDOMDeviceOrientationEvent.idl +++ b/dom/interfaces/events/nsIDOMDeviceOrientationEvent.idl @@ -36,7 +36,7 @@ #include "nsIDOMEvent.idl" -[scriptable, uuid(daf2d570-0ecc-4aa0-aba4-26f60dfcba6a)] +[scriptable, uuid(a9bd91fd-c0a7-44ed-9975-5a58faba3be3)] interface nsIDOMDeviceOrientationEvent : nsIDOMEvent { void initDeviceOrientationEvent(in DOMString eventTypeArg, diff --git a/dom/interfaces/events/nsIDOMDragEvent.idl b/dom/interfaces/events/nsIDOMDragEvent.idl index d5dc7d5febd..d668d727408 100644 --- a/dom/interfaces/events/nsIDOMDragEvent.idl +++ b/dom/interfaces/events/nsIDOMDragEvent.idl @@ -40,7 +40,7 @@ interface nsIDOMDataTransfer; -[scriptable, uuid(26b40393-c383-4e9a-977f-e8e1351926eb)] +[scriptable, uuid(74fb5f01-e473-4302-93f5-6f74bdaaddf2)] interface nsIDOMDragEvent : nsIDOMMouseEvent { readonly attribute nsIDOMDataTransfer dataTransfer; diff --git a/dom/interfaces/events/nsIDOMEvent.idl b/dom/interfaces/events/nsIDOMEvent.idl index b90af4cd950..3f892350fa4 100644 --- a/dom/interfaces/events/nsIDOMEvent.idl +++ b/dom/interfaces/events/nsIDOMEvent.idl @@ -49,7 +49,7 @@ interface nsIDOMEventTarget; * http://www.w3.org/TR/DOM-Level-2-Events/ */ -[scriptable, uuid(548137e8-fd2c-48c4-8635-3033f7db79e0)] +[scriptable, uuid(e85cff74-951f-45c1-be0c-89442ea2f500)] interface nsIDOMEvent : nsISupports { // PhaseType @@ -174,4 +174,10 @@ interface nsIDOMEvent : nsISupports * Used to indicate whether preventDefault() has been called for this event. */ readonly attribute boolean defaultPrevented; + + /** + * Prevents other event listeners from being triggered and, + * unlike Event.stopPropagation() its effect is immediate. + */ + void stopImmediatePropagation(); }; diff --git a/dom/interfaces/events/nsIDOMHashChangeEvent.idl b/dom/interfaces/events/nsIDOMHashChangeEvent.idl index c13405bfc36..08990a7f9e0 100644 --- a/dom/interfaces/events/nsIDOMHashChangeEvent.idl +++ b/dom/interfaces/events/nsIDOMHashChangeEvent.idl @@ -34,7 +34,7 @@ #include "nsIDOMEvent.idl" -[scriptable, uuid(34850f11-8b88-43ce-8d55-9aa8b18753bd)] +[scriptable, uuid(9fc4785c-b769-40e5-8f79-586e01413afd)] interface nsIDOMHashChangeEvent : nsIDOMEvent { readonly attribute DOMString oldURL; diff --git a/dom/interfaces/events/nsIDOMKeyEvent.idl b/dom/interfaces/events/nsIDOMKeyEvent.idl index fb7ef238506..d93023bfb9e 100644 --- a/dom/interfaces/events/nsIDOMKeyEvent.idl +++ b/dom/interfaces/events/nsIDOMKeyEvent.idl @@ -39,7 +39,7 @@ #include "nsIDOMUIEvent.idl" -[scriptable, uuid(ffcfb88a-d1d1-40b9-96e1-e338211d3511)] +[scriptable, uuid(def974c3-b491-481b-bc67-29174af4b26a)] interface nsIDOMKeyEvent : nsIDOMUIEvent { const unsigned long DOM_VK_CANCEL = 0x03; diff --git a/dom/interfaces/events/nsIDOMMessageEvent.idl b/dom/interfaces/events/nsIDOMMessageEvent.idl index 2981b864083..ce049fd9b93 100644 --- a/dom/interfaces/events/nsIDOMMessageEvent.idl +++ b/dom/interfaces/events/nsIDOMMessageEvent.idl @@ -45,7 +45,7 @@ * For more information on this interface, please see * http://www.whatwg.org/specs/web-apps/current-work/#messageevent */ -[scriptable, uuid(9ac4fa26-4d19-4f4e-807e-b30cd0dbe56a)] +[scriptable, uuid(3aca4a44-8e5f-4829-9d59-ce4adbba2b12)] interface nsIDOMMessageEvent : nsIDOMEvent { /** diff --git a/dom/interfaces/events/nsIDOMMouseEvent.idl b/dom/interfaces/events/nsIDOMMouseEvent.idl index c8768da78d0..3227d49523d 100644 --- a/dom/interfaces/events/nsIDOMMouseEvent.idl +++ b/dom/interfaces/events/nsIDOMMouseEvent.idl @@ -48,7 +48,7 @@ * http://www.w3.org/TR/DOM-Level-2-Events/ */ -[scriptable, uuid(7e6cb6e1-d3ba-4e60-a6ff-96350187a1e3)] +[scriptable, uuid(7f57aa45-6792-4d8b-ba5b-201533cf0b2f)] interface nsIDOMMouseEvent : nsIDOMUIEvent { readonly attribute long screenX; diff --git a/dom/interfaces/events/nsIDOMMouseScrollEvent.idl b/dom/interfaces/events/nsIDOMMouseScrollEvent.idl index ad3a003da36..52c80094e18 100644 --- a/dom/interfaces/events/nsIDOMMouseScrollEvent.idl +++ b/dom/interfaces/events/nsIDOMMouseScrollEvent.idl @@ -38,7 +38,7 @@ #include "nsIDOMMouseEvent.idl" -[scriptable, uuid(eac2ea89-7926-417a-bbc8-bb893e77bebb)] +[scriptable, uuid(159f24b9-2058-40b9-b5bc-6477d192955a)] interface nsIDOMMouseScrollEvent : nsIDOMMouseEvent { const long HORIZONTAL_AXIS = 1; diff --git a/dom/interfaces/events/nsIDOMMozTouchEvent.idl b/dom/interfaces/events/nsIDOMMozTouchEvent.idl index 2c9a650ff81..faa0a5035e6 100644 --- a/dom/interfaces/events/nsIDOMMozTouchEvent.idl +++ b/dom/interfaces/events/nsIDOMMozTouchEvent.idl @@ -40,7 +40,7 @@ #include "nsIDOMMouseEvent.idl" -[scriptable, uuid(e680bab6-740a-4097-b5e0-5e9d7d381cbc)] +[scriptable, uuid(268da07b-4c41-4deb-96a2-10985644e6b0)] interface nsIDOMMozTouchEvent : nsIDOMMouseEvent { readonly attribute unsigned long streamId; diff --git a/dom/interfaces/events/nsIDOMMutationEvent.idl b/dom/interfaces/events/nsIDOMMutationEvent.idl index 7b122765c25..e5580f4ffc9 100644 --- a/dom/interfaces/events/nsIDOMMutationEvent.idl +++ b/dom/interfaces/events/nsIDOMMutationEvent.idl @@ -39,7 +39,7 @@ #include "nsIDOMEvent.idl" -[scriptable, uuid(8e440d86-886a-4e76-9e59-c13b939c9a4b)] +[scriptable, uuid(72b3ddba-6cbb-4011-ac3b-50bd900b223d)] interface nsIDOMMutationEvent : nsIDOMEvent { const unsigned short MODIFICATION = 1; diff --git a/dom/interfaces/events/nsIDOMNotifyAudioAvailableEvent.idl b/dom/interfaces/events/nsIDOMNotifyAudioAvailableEvent.idl index 0cbe9958fa3..185cab8e805 100644 --- a/dom/interfaces/events/nsIDOMNotifyAudioAvailableEvent.idl +++ b/dom/interfaces/events/nsIDOMNotifyAudioAvailableEvent.idl @@ -40,7 +40,7 @@ #include "nsIDOMEvent.idl" #include "nsIVariant.idl" -[scriptable, uuid(6250652d-7a6a-49a4-a2ee-9114e1e83427)] +[scriptable, uuid(cd362d2f-a9a1-4127-940d-477ba0e82bd6)] interface nsIDOMNotifyAudioAvailableEvent : nsIDOMEvent { [implicit_jscontext] diff --git a/dom/interfaces/events/nsIDOMNotifyPaintEvent.idl b/dom/interfaces/events/nsIDOMNotifyPaintEvent.idl index a90a85004b4..2f94cf276b6 100644 --- a/dom/interfaces/events/nsIDOMNotifyPaintEvent.idl +++ b/dom/interfaces/events/nsIDOMNotifyPaintEvent.idl @@ -45,7 +45,7 @@ interface nsIDOMPaintRequestList; * event, which fires at a window when painting has happened in * that window. */ -[scriptable, uuid(792e5779-7c39-4817-91a7-fdb3fba6428f)] +[scriptable, uuid(5e9e91ad-8638-4e1c-bded-35b51b6df279)] interface nsIDOMNotifyPaintEvent : nsIDOMEvent { /** diff --git a/dom/interfaces/events/nsIDOMPageTransitionEvent.idl b/dom/interfaces/events/nsIDOMPageTransitionEvent.idl index f457665cb9f..dbec8ce90ec 100644 --- a/dom/interfaces/events/nsIDOMPageTransitionEvent.idl +++ b/dom/interfaces/events/nsIDOMPageTransitionEvent.idl @@ -44,7 +44,7 @@ * load/unload and saving/restoring a document from session history. */ -[scriptable, uuid(b712418b-376f-4f75-b156-5d9ad99fe51f)] +[scriptable, uuid(3ca21c34-8391-4c5b-891e-0540a675dbf4)] interface nsIDOMPageTransitionEvent : nsIDOMEvent { /** diff --git a/dom/interfaces/events/nsIDOMPopStateEvent.idl b/dom/interfaces/events/nsIDOMPopStateEvent.idl index dc7de0db791..7237b47b15b 100644 --- a/dom/interfaces/events/nsIDOMPopStateEvent.idl +++ b/dom/interfaces/events/nsIDOMPopStateEvent.idl @@ -36,7 +36,7 @@ interface nsIVariant; -[scriptable, uuid(f3834fd5-0ef5-4ccd-a741-0b6685414342)] +[scriptable, uuid(034f5fcc-9b41-433c-9795-64767051926a)] interface nsIDOMPopStateEvent : nsIDOMEvent { /** diff --git a/dom/interfaces/events/nsIDOMPopupBlockedEvent.idl b/dom/interfaces/events/nsIDOMPopupBlockedEvent.idl index 2962f7eabde..c13f1af9a11 100644 --- a/dom/interfaces/events/nsIDOMPopupBlockedEvent.idl +++ b/dom/interfaces/events/nsIDOMPopupBlockedEvent.idl @@ -44,7 +44,7 @@ interface nsIURI; * posted when a popup window is blocked. */ -[scriptable, uuid(05be571f-c3ea-4959-a340-c57b1591ae4b)] +[scriptable, uuid(853828af-eda7-459a-be7f-9011c20394ae)] interface nsIDOMPopupBlockedEvent : nsIDOMEvent { /** diff --git a/dom/interfaces/events/nsIDOMProgressEvent.idl b/dom/interfaces/events/nsIDOMProgressEvent.idl index c8b59e2ec4c..b37a210714f 100644 --- a/dom/interfaces/events/nsIDOMProgressEvent.idl +++ b/dom/interfaces/events/nsIDOMProgressEvent.idl @@ -45,7 +45,7 @@ * the specification is complete and is compatible with the WebKit ProgressEvent. */ -[scriptable, uuid(6af7022c-d7f8-414c-a11f-a7918f14052b)] +[scriptable, uuid(2377d8a6-9e27-4eb2-a377-9910772b33d3)] interface nsIDOMProgressEvent : nsIDOMEvent { readonly attribute boolean lengthComputable; diff --git a/dom/interfaces/events/nsIDOMScrollAreaEvent.idl b/dom/interfaces/events/nsIDOMScrollAreaEvent.idl index 6e788c0d5dd..fa5c0942cb5 100644 --- a/dom/interfaces/events/nsIDOMScrollAreaEvent.idl +++ b/dom/interfaces/events/nsIDOMScrollAreaEvent.idl @@ -37,7 +37,7 @@ #include "nsIDOMUIEvent.idl" -[scriptable, uuid(00028177-32a5-4ea3-b71d-8409beb15225)] +[scriptable, uuid(a382424b-464f-475f-8880-f4ceaca9fde9)] interface nsIDOMScrollAreaEvent : nsIDOMUIEvent { // Scroll area client rect diff --git a/dom/interfaces/events/nsIDOMSimpleGestureEvent.idl b/dom/interfaces/events/nsIDOMSimpleGestureEvent.idl index 1c69af0ee32..3115e1096d3 100644 --- a/dom/interfaces/events/nsIDOMSimpleGestureEvent.idl +++ b/dom/interfaces/events/nsIDOMSimpleGestureEvent.idl @@ -97,7 +97,7 @@ * consuming events. */ -[scriptable, uuid(0fdcef08-b4e8-4d41-91a0-4f5d259bfb81)] +[scriptable, uuid(e9bdcc53-1bc0-4cae-9eb3-b215b6be7f70)] interface nsIDOMSimpleGestureEvent : nsIDOMMouseEvent { /* Swipe direction constants */ diff --git a/dom/interfaces/events/nsIDOMSmartCardEvent.idl b/dom/interfaces/events/nsIDOMSmartCardEvent.idl index 4bd789dafd7..b0c203fa307 100644 --- a/dom/interfaces/events/nsIDOMSmartCardEvent.idl +++ b/dom/interfaces/events/nsIDOMSmartCardEvent.idl @@ -38,7 +38,7 @@ #include "nsIDOMEvent.idl" -[scriptable, uuid(52bdc7ca-a934-4a40-a2e2-ac83a70b4019)] +[scriptable, uuid(57e2dd86-3c70-4d9c-81d0-856d42e6bc7d)] interface nsIDOMSmartCardEvent : nsIDOMEvent { readonly attribute DOMString tokenName; diff --git a/dom/interfaces/events/nsIDOMTouchEvent.idl b/dom/interfaces/events/nsIDOMTouchEvent.idl index 815f15add6f..66d84c4947b 100644 --- a/dom/interfaces/events/nsIDOMTouchEvent.idl +++ b/dom/interfaces/events/nsIDOMTouchEvent.idl @@ -65,7 +65,7 @@ interface nsIDOMTouchList : nsISupports { nsIDOMTouch identifiedTouch(in long identifier); }; -[scriptable, uuid(df94b20b-7998-4f00-935c-ee2c6b179711)] +[scriptable, uuid(0cc687df-0ed5-4b7f-b89d-cbb99b21d23a)] interface nsIDOMTouchEvent : nsIDOMUIEvent { readonly attribute nsIDOMTouchList touches; readonly attribute nsIDOMTouchList targetTouches; diff --git a/dom/interfaces/events/nsIDOMTransitionEvent.idl b/dom/interfaces/events/nsIDOMTransitionEvent.idl index ffbdfcbc583..3588ceaf402 100644 --- a/dom/interfaces/events/nsIDOMTransitionEvent.idl +++ b/dom/interfaces/events/nsIDOMTransitionEvent.idl @@ -43,7 +43,7 @@ * http://dev.w3.org/csswg/css3-transitions/#transition-events- */ -[scriptable, uuid(3e49ea4c-6f23-4aff-bd8f-e587edf514ec)] +[scriptable, uuid(9ded6ca5-f5b2-4bf3-9250-e4f7808dc605)] interface nsIDOMTransitionEvent : nsIDOMEvent { readonly attribute DOMString propertyName; readonly attribute float elapsedTime; diff --git a/dom/interfaces/events/nsIDOMUIEvent.idl b/dom/interfaces/events/nsIDOMUIEvent.idl index 319acc0507b..ef5715bd215 100644 --- a/dom/interfaces/events/nsIDOMUIEvent.idl +++ b/dom/interfaces/events/nsIDOMUIEvent.idl @@ -47,7 +47,7 @@ * http://www.w3.org/TR/DOM-Level-2-Events/ */ -[scriptable, uuid(4f3032d1-bdc5-4f37-bece-af8056d71c5c)] +[scriptable, uuid(af3f130e-0c22-4613-a150-780a46c22e3a)] interface nsIDOMUIEvent : nsIDOMEvent { readonly attribute nsIDOMWindow view; diff --git a/dom/interfaces/load-save/nsIDOMLSProgressEvent.idl b/dom/interfaces/load-save/nsIDOMLSProgressEvent.idl index 4f8d6038c8d..198cd071711 100644 --- a/dom/interfaces/load-save/nsIDOMLSProgressEvent.idl +++ b/dom/interfaces/load-save/nsIDOMLSProgressEvent.idl @@ -40,7 +40,7 @@ interface nsIDOMLSInput; -[scriptable, uuid(b9a2371f-70e9-4657-b0e8-28e15b40857e)] +[scriptable, uuid(89477959-7ce6-4f6f-9885-942e0a2c93cc)] interface nsIDOMLSProgressEvent : nsIDOMEvent { readonly attribute nsIDOMLSInput input; diff --git a/dom/interfaces/smil/nsIDOMTimeEvent.idl b/dom/interfaces/smil/nsIDOMTimeEvent.idl index 086b7aebe23..96f21a4a34e 100644 --- a/dom/interfaces/smil/nsIDOMTimeEvent.idl +++ b/dom/interfaces/smil/nsIDOMTimeEvent.idl @@ -45,7 +45,7 @@ * http://www.w3.org/TR/SVG/animate.html#InterfaceTimeEvent */ -[scriptable, uuid(873785cc-d8be-48af-8b30-5c566e3f4e6e)] +[scriptable, uuid(5d7de21b-97c2-4a1d-a1f4-2ae527067660)] interface nsIDOMTimeEvent : nsIDOMEvent { readonly attribute long detail; diff --git a/dom/interfaces/storage/nsIDOMStorageEvent.idl b/dom/interfaces/storage/nsIDOMStorageEvent.idl index 25941ad5f53..f98da61b1e8 100644 --- a/dom/interfaces/storage/nsIDOMStorageEvent.idl +++ b/dom/interfaces/storage/nsIDOMStorageEvent.idl @@ -48,7 +48,7 @@ interface nsIDOMStorage; -[scriptable, uuid(AE0CB688-68B3-4fb3-9A11-2DA8E620E808)] +[scriptable, uuid(501d7dc8-5b8b-4cce-99ad-16ed1046030a)] interface nsIDOMStorageEvent : nsIDOMEvent { /** diff --git a/dom/interfaces/storage/nsIDOMStorageEventObsolete.idl b/dom/interfaces/storage/nsIDOMStorageEventObsolete.idl index 4bf94e7c1a0..7449696708b 100644 --- a/dom/interfaces/storage/nsIDOMStorageEventObsolete.idl +++ b/dom/interfaces/storage/nsIDOMStorageEventObsolete.idl @@ -46,7 +46,7 @@ * Event sent to a window when a storage area changes. */ -[scriptable, uuid(c0178907-847d-41c0-8a62-31301bb946fa)] +[scriptable, uuid(2b3b40fe-4734-4661-b7ff-dc555215db4e)] interface nsIDOMStorageEventObsolete : nsIDOMEvent { /** diff --git a/dom/interfaces/svg/nsIDOMSVGEvent.idl b/dom/interfaces/svg/nsIDOMSVGEvent.idl index a2af30873d2..14ac3bca865 100644 --- a/dom/interfaces/svg/nsIDOMSVGEvent.idl +++ b/dom/interfaces/svg/nsIDOMSVGEvent.idl @@ -42,7 +42,7 @@ * http://www.w3.org/TR/SVG11/script.html#InterfaceSVGEvent */ -[scriptable, uuid(13aed1cc-a505-45d5-bbc2-0052c6bf200f)] +[scriptable, uuid(40c55169-8b5e-456d-a58b-ee4518d93c40)] interface nsIDOMSVGEvent : nsIDOMEvent { }; diff --git a/dom/interfaces/svg/nsIDOMSVGZoomEvent.idl b/dom/interfaces/svg/nsIDOMSVGZoomEvent.idl index f3bce6223f8..c87f7afb6a2 100644 --- a/dom/interfaces/svg/nsIDOMSVGZoomEvent.idl +++ b/dom/interfaces/svg/nsIDOMSVGZoomEvent.idl @@ -45,7 +45,7 @@ interface nsIDOMSVGRect; interface nsIDOMSVGPoint; -[scriptable, uuid(91f381f0-65ba-4392-bbf9-381fda450d76)] +[scriptable, uuid(85ba3378-83eb-4d26-8917-c5c73c705669)] interface nsIDOMSVGZoomEvent : nsIDOMUIEvent { readonly attribute nsIDOMSVGRect zoomRectScreen; diff --git a/dom/interfaces/threads/nsIDOMWorkers.idl b/dom/interfaces/threads/nsIDOMWorkers.idl index a30f0a24b87..e406713e8b6 100644 --- a/dom/interfaces/threads/nsIDOMWorkers.idl +++ b/dom/interfaces/threads/nsIDOMWorkers.idl @@ -51,7 +51,7 @@ interface nsIWorkerMessagePort : nsISupports void postMessage(/* in JSObject aMessage */); }; -[scriptable, uuid(508f2d49-e9a0-4fe8-bd33-321820173b4a)] +[scriptable, uuid(c013e89d-467e-4e77-b011-d00da5c1d957)] interface nsIWorkerMessageEvent : nsIDOMEvent { readonly attribute DOMString data; @@ -67,7 +67,7 @@ interface nsIWorkerMessageEvent : nsIDOMEvent in nsISupports aSourceArg); }; -[scriptable, uuid(73d82c1d-05de-49c9-a23b-7121ff09a67a)] +[scriptable, uuid(963b856d-61b8-4c4d-bd6e-7bb3664a2993)] interface nsIWorkerErrorEvent : nsIDOMEvent { readonly attribute DOMString message; diff --git a/dom/interfaces/xul/nsIDOMXULCommandEvent.idl b/dom/interfaces/xul/nsIDOMXULCommandEvent.idl index 130414def56..bda620cd5e2 100644 --- a/dom/interfaces/xul/nsIDOMXULCommandEvent.idl +++ b/dom/interfaces/xul/nsIDOMXULCommandEvent.idl @@ -43,7 +43,7 @@ #include "nsIDOMUIEvent.idl" -[scriptable, uuid(da4922ca-6dbc-4df6-8187-91f3a71eb48f)] +[scriptable, uuid(980999ae-7702-4c8f-944d-77db4e99583c)] interface nsIDOMXULCommandEvent : nsIDOMUIEvent { /** diff --git a/security/manager/ssl/src/nsSmartCardEvent.cpp b/security/manager/ssl/src/nsSmartCardEvent.cpp index 8edf4a3153d..eeee5c24c89 100644 --- a/security/manager/ssl/src/nsSmartCardEvent.cpp +++ b/security/manager/ssl/src/nsSmartCardEvent.cpp @@ -232,6 +232,12 @@ NS_IMETHODIMP nsSmartCardEvent::StopPropagation() return mInner->StopPropagation(); } +NS_IMETHODIMP nsSmartCardEvent::StopImmediatePropagation() +{ + NS_ASSERTION(mInner, "SmartCardEvent called without Init"); + return mInner->StopImmediatePropagation(); +} + NS_IMETHODIMP nsSmartCardEvent::PreventDefault() { NS_ASSERTION(mInner, "SmartCardEvent called without Init"); diff --git a/widget/public/nsGUIEvent.h b/widget/public/nsGUIEvent.h index 61fcee4c619..d622a09df20 100644 --- a/widget/public/nsGUIEvent.h +++ b/widget/public/nsGUIEvent.h @@ -164,6 +164,8 @@ class nsHashKey; #define NS_EVENT_RETARGET_TO_NON_NATIVE_ANONYMOUS 0x40000 +#define NS_EVENT_FLAG_STOP_DISPATCH_IMMEDIATELY 0x80000 + #define NS_EVENT_CAPTURE_MASK (~(NS_EVENT_FLAG_BUBBLE | NS_EVENT_FLAG_NO_CONTENT_DISPATCH)) #define NS_EVENT_BUBBLE_MASK (~(NS_EVENT_FLAG_CAPTURE | NS_EVENT_FLAG_NO_CONTENT_DISPATCH)) From 939449aaba653945d605d139261be1df599dae2d Mon Sep 17 00:00:00 2001 From: Benjamin Smedberg Date: Fri, 4 Nov 2011 15:13:40 -0400 Subject: [PATCH 048/127] Disable the hang detector for bug 429592 while running the startup cache tests because they intentionally hang the browser to trigger the startup timeout. feedback=mwu on IRC --- startupcache/test/TestStartupCache.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/startupcache/test/TestStartupCache.cpp b/startupcache/test/TestStartupCache.cpp index 73c44cc6e9b..f1d6655c231 100644 --- a/startupcache/test/TestStartupCache.cpp +++ b/startupcache/test/TestStartupCache.cpp @@ -51,6 +51,8 @@ #include "nsIObjectOutputStream.h" #include "nsIURI.h" #include "nsStringAPI.h" +#include "nsIPrefBranch.h" +#include "nsIPrefService.h" namespace mozilla { namespace scache { @@ -91,6 +93,7 @@ WaitForStartupTimer() { bool complete; while (true) { + NS_ProcessPendingEvents(nsnull); rv = sc->StartupWriteComplete(&complete); if (NS_FAILED(rv) || complete) @@ -319,6 +322,9 @@ int main(int argc, char** argv) int rv = 0; nsresult rv2; ScopedXPCOM xpcom("Startup Cache"); + + nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); + prefs->SetIntPref("hangmonitor.timeout", 0); if (NS_FAILED(TestStartupWriteRead())) rv = 1; From 316807025ef57327cc7cea4c6a138a82bdc36b45 Mon Sep 17 00:00:00 2001 From: Benjamin Smedberg Date: Fri, 4 Nov 2011 15:13:58 -0400 Subject: [PATCH 049/127] Add MOZ_CRASHREPORTER ifdefs to the patch for bug 429592. r=captain bustage --- xpcom/threads/HangMonitor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xpcom/threads/HangMonitor.cpp b/xpcom/threads/HangMonitor.cpp index e5edece4383..bbe2932dbbb 100644 --- a/xpcom/threads/HangMonitor.cpp +++ b/xpcom/threads/HangMonitor.cpp @@ -38,10 +38,13 @@ #include "mozilla/HangMonitor.h" #include "mozilla/Monitor.h" #include "mozilla/Preferences.h" -#include "nsExceptionHandler.h" #include "nsXULAppAPI.h" #include "nsThreadUtils.h" +#ifdef MOZ_CRASHREPORTER +#include "nsExceptionHandler.h" +#endif + #ifdef XP_WIN #include #endif @@ -100,8 +103,10 @@ Crash() } #endif +#ifdef MOZ_CRASHREPORTER CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Hang"), NS_LITERAL_CSTRING("1")); +#endif NS_RUNTIMEABORT("HangMonitor triggered"); } From f6d4ecac95d772f13185fd7aa4727f50ec121295 Mon Sep 17 00:00:00 2001 From: Sriram Ramasubramanian Date: Fri, 4 Nov 2011 13:43:32 -0700 Subject: [PATCH 050/127] Bug 676621 - Toaster alert needs better Honeycomb styling --- mobile/themes/core/honeycomb/browser.css | 16 ++++++++-------- mobile/themes/core/honeycomb/defines.inc | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/mobile/themes/core/honeycomb/browser.css b/mobile/themes/core/honeycomb/browser.css index 0a61eace65a..7d5c5781a2f 100644 --- a/mobile/themes/core/honeycomb/browser.css +++ b/mobile/themes/core/honeycomb/browser.css @@ -1535,12 +1535,12 @@ setting[type="bool"]:hover:active .setting-input > checkbox[checked="true"] > .c /* alerts popup ----------------------------------------------------------- */ #alerts-container { - color: @color_text_default@; - background-color: #5e6166; - border: @border_width_small@ solid #767973; - border-radius: @border_radius_normal@; - padding: @padding_normal@; /* core spacing on top/bottom */ - margin-bottom: @margin_large@; + color: @color_text_header@; + background-color: @color_background_toaster@; + box-shadow: 0 0 @shadow_width_tiny@ @shadow_width_medium@ @color_shadow_light@; + border-radius: @border_radius_small@; + padding: @padding_xxnormal@ @padding_large@; /* core spacing on top/bottom */ + margin-bottom: @margin_toaster@; -moz-transition-property: opacity; -moz-transition-duration: 0.5s; opacity: 0; @@ -1551,11 +1551,11 @@ setting[type="bool"]:hover:active .setting-input > checkbox[checked="true"] > .c } #alerts-title { - font-size: @font_small@ !important; + font-size: @font_xtiny@ !important; } #alerts-text { - font-size: @font_xsmall@ !important; + font-size: @font_xtiny@ !important; white-space: pre; } diff --git a/mobile/themes/core/honeycomb/defines.inc b/mobile/themes/core/honeycomb/defines.inc index 70e3dccab81..309a6c82480 100644 --- a/mobile/themes/core/honeycomb/defines.inc +++ b/mobile/themes/core/honeycomb/defines.inc @@ -35,6 +35,7 @@ %define color_background_settings #efefef %define color_text_panel_header #999 %define color_text_panel_subheader #333 +%define color_background_toaster #000 %define color_background_highlight #a7c5f4 %define color_background_highlight_overlay rgba(167, 197, 244, 0.8) @@ -69,6 +70,7 @@ %define touch_button_minwidth 11.86mozmm %define touch_normal 6.77mozmm +%define margin_toaster 15.24mozmm %define margin_context_popup 3.39mozmm %define margin_xlarge 3.39mozmm %define margin_large 2.54mozmm From c36db4d23af4a90d69a5883b6cfd92ac6185c5ef Mon Sep 17 00:00:00 2001 From: Marco Bonardo Date: Fri, 4 Nov 2011 21:45:22 +0100 Subject: [PATCH 051/127] Bug 397424 follow-up - Remove extraneaous semicolon to fix Maemo bustage. --- toolkit/components/downloads/nsDownloadManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp index b41a2469a1f..00a6e7d5b34 100644 --- a/toolkit/components/downloads/nsDownloadManager.cpp +++ b/toolkit/components/downloads/nsDownloadManager.cpp @@ -2131,7 +2131,7 @@ nsDownloadManager::ConfirmCancelDownloads(PRInt32 aCount, //////////////////////////////////////////////////////////////////////////////// //// nsDownload -NS_IMPL_CLASSINFO(nsDownload, NULL, 0, NS_DOWNLOAD_CID); +NS_IMPL_CLASSINFO(nsDownload, NULL, 0, NS_DOWNLOAD_CID) NS_IMPL_ISUPPORTS4_CI( nsDownload , nsIDownload From 53b30e85e9213767868dbe9dcab9a883b0cf1218 Mon Sep 17 00:00:00 2001 From: Jens Hatlak Date: Fri, 4 Nov 2011 21:08:48 +0000 Subject: [PATCH 052/127] Bug 698524 - fix test_startup.js xpcshell test for SeaMonkey by excluding all non-test add-ons. r=Mossop --- toolkit/mozapps/extensions/test/xpcshell/head_addons.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js index 31937eecfd4..5478dba6e42 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js +++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js @@ -447,13 +447,9 @@ function check_startup_changes(aType, aIds) { var ids = aIds.slice(0); ids.sort(); var changes = AddonManager.getStartupChanges(aType); + changes = changes.filter(function(aEl) /@tests.mozilla.org$/.test(aEl)); changes.sort(); - // Remove the default theme if it is in the list - var pos = changes.indexOf("{972ce4c6-7e08-4474-a285-3208198ce6fd}"); - if (pos != -1) - changes.splice(pos, 1); - do_check_eq(JSON.stringify(ids), JSON.stringify(changes)); } From a2113b4d42219fd9677dfc0aa1f190c76e220edc Mon Sep 17 00:00:00 2001 From: Rail Aliiev Date: Fri, 4 Nov 2011 21:13:42 +0000 Subject: [PATCH 053/127] Bug 616542 - Shorten file path length of mochitest; r=ted --- Makefile.in | 1 + accessible/tests/mochitest/Makefile.in | 2 +- accessible/tests/mochitest/actions/Makefile.in | 2 +- .../tests/mochitest/attributes/Makefile.in | 2 +- .../tests/mochitest/editabletext/Makefile.in | 2 +- accessible/tests/mochitest/events/Makefile.in | 2 +- accessible/tests/mochitest/focus/Makefile.in | 2 +- .../tests/mochitest/hyperlink/Makefile.in | 2 +- .../tests/mochitest/hypertext/Makefile.in | 2 +- accessible/tests/mochitest/name/Makefile.in | 2 +- .../tests/mochitest/relations/Makefile.in | 2 +- .../tests/mochitest/selectable/Makefile.in | 2 +- accessible/tests/mochitest/states/Makefile.in | 2 +- accessible/tests/mochitest/table/Makefile.in | 2 +- accessible/tests/mochitest/text/Makefile.in | 2 +- .../tests/mochitest/textselection/Makefile.in | 2 +- accessible/tests/mochitest/tree/Makefile.in | 2 +- .../tests/mochitest/treeupdate/Makefile.in | 2 +- accessible/tests/mochitest/value/Makefile.in | 2 +- browser/base/content/test/Makefile.in | 4 ++-- browser/components/certerror/test/Makefile.in | 2 +- browser/components/feeds/test/Makefile.in | 2 +- .../components/feeds/test/chrome/Makefile.in | 4 ++-- .../components/places/tests/browser/Makefile.in | 2 +- .../components/places/tests/chrome/Makefile.in | 2 +- .../components/preferences/tests/Makefile.in | 2 +- .../privatebrowsing/test/browser/Makefile.in | 2 +- .../safebrowsing/content/test/Makefile.in | 2 +- browser/components/search/test/Makefile.in | 2 +- .../sessionstore/test/browser/Makefile.in | 2 +- browser/components/shell/test/Makefile.in | 2 +- browser/components/tabview/test/Makefile.in | 2 +- browser/components/test/browser/Makefile.in | 2 +- browser/components/wintaskbar/test/Makefile.in | 2 +- browser/devtools/highlighter/test/Makefile.in | 2 +- browser/devtools/scratchpad/test/Makefile.in | 2 +- browser/devtools/shared/test/Makefile.in | 4 ++-- browser/devtools/sourceeditor/test/Makefile.in | 2 +- .../styleinspector/test/browser/Makefile.in | 4 ++-- .../webconsole/test/browser/Makefile.in | 4 ++-- browser/fuel/test/Makefile.in | 2 +- caps/tests/mochitest/Makefile.in | 2 +- config/config.mk | 4 ++++ content/base/test/Makefile.in | 8 ++++---- content/base/test/chrome/Makefile.in | 4 ++-- content/canvas/test/Makefile.in | 2 +- content/canvas/test/crossorigin/Makefile.in | 2 +- content/canvas/test/webgl/Makefile.in | 4 ++-- content/events/test/Makefile.in | 4 ++-- content/html/content/test/Makefile.in | 2 +- content/html/content/test/bug649134/Makefile.in | 2 +- content/html/content/test/forms/Makefile.in | 2 +- content/html/document/test/Makefile.in | 4 ++-- content/media/test/Makefile.in | 2 +- content/smil/test/Makefile.in | 2 +- content/svg/content/test/Makefile.in | 2 +- content/xbl/test/Makefile.in | 4 ++-- content/xml/document/test/Makefile.in | 2 +- content/xslt/tests/mochitest/Makefile.in | 2 +- content/xul/content/test/Makefile.in | 4 ++-- content/xul/document/test/Makefile.in | 2 +- content/xul/templates/tests/chrome/Makefile.in | 2 +- docshell/test/Makefile.in | 2 +- docshell/test/browser/Makefile.in | 2 +- docshell/test/chrome/Makefile.in | 6 +++--- docshell/test/navigation/Makefile.in | 4 ++-- dom/indexedDB/test/Makefile.in | 4 ++-- dom/ipc/tests/Makefile.in | 2 +- dom/plugins/test/mochitest/Makefile.in | 4 ++-- dom/src/foo/Makefile.in | 2 +- dom/src/json/test/Makefile.in | 2 +- dom/src/jsurl/test/Makefile.in | 2 +- dom/tests/browser/Makefile.in | 2 +- dom/tests/mochitest/ajax/jquery/Makefile.in | 2 +- .../mochitest/ajax/jquery/dist/Makefile.in | 2 +- .../mochitest/ajax/jquery/test/Makefile.in | 2 +- .../mochitest/ajax/jquery/test/data/Makefile.in | 2 +- .../ajax/jquery/test/data/offset/Makefile.in | 2 +- .../mochitest/ajax/jquery/test/unit/Makefile.in | 2 +- dom/tests/mochitest/ajax/lib/Makefile.in | 2 +- dom/tests/mochitest/ajax/mochikit/Makefile.in | 2 +- .../ajax/mochikit/MochiKit/Makefile.in | 2 +- .../mochitest/ajax/mochikit/tests/Makefile.in | 2 +- .../ajax/mochikit/tests/SimpleTest/Makefile.in | 2 +- dom/tests/mochitest/ajax/offline/Makefile.in | 2 +- .../ajax/offline/namespace1/Makefile.in | 2 +- .../ajax/offline/namespace1/sub/Makefile.in | 2 +- .../ajax/offline/namespace1/sub2/Makefile.in | 2 +- .../ajax/offline/namespace2/Makefile.in | 2 +- dom/tests/mochitest/ajax/prototype/Makefile.in | 2 +- .../mochitest/ajax/prototype/dist/Makefile.in | 2 +- .../mochitest/ajax/prototype/test/Makefile.in | 2 +- .../ajax/prototype/test/functional/Makefile.in | 2 +- .../ajax/prototype/test/lib/Makefile.in | 2 +- .../ajax/prototype/test/unit/Makefile.in | 2 +- .../prototype/test/unit/fixtures/Makefile.in | 2 +- .../ajax/prototype/test/unit/tmp/Makefile.in | 2 +- .../mochitest/ajax/scriptaculous/Makefile.in | 2 +- .../ajax/scriptaculous/lib/Makefile.in | 2 +- .../ajax/scriptaculous/src/Makefile.in | 2 +- .../ajax/scriptaculous/test/unit/Makefile.in | 2 +- dom/tests/mochitest/bugs/Makefile.in | 2 +- dom/tests/mochitest/chrome/Makefile.in | 2 +- dom/tests/mochitest/dom-level0/Makefile.in | 2 +- dom/tests/mochitest/dom-level1-core/Makefile.in | 14 +++++++------- .../mochitest/dom-level1-core/files/Makefile.in | 2 +- dom/tests/mochitest/dom-level2-core/Makefile.in | 12 ++++++------ .../mochitest/dom-level2-core/files/Makefile.in | 2 +- dom/tests/mochitest/dom-level2-html/Makefile.in | 12 ++++++------ .../mochitest/dom-level2-html/files/Makefile.in | 4 ++-- dom/tests/mochitest/general/Makefile.in | 4 ++-- dom/tests/mochitest/geolocation/Makefile.in | 2 +- dom/tests/mochitest/globalstorage/Makefile.in | 2 +- dom/tests/mochitest/localstorage/Makefile.in | 4 ++-- dom/tests/mochitest/notification/Makefile.in | 2 +- dom/tests/mochitest/orientation/Makefile.in | 2 +- dom/tests/mochitest/sessionstorage/Makefile.in | 4 ++-- dom/tests/mochitest/storageevent/Makefile.in | 2 +- dom/tests/mochitest/whatwg/Makefile.in | 4 ++-- dom/workers/test/Makefile.in | 6 +++--- .../test/extensions/bootstrap/Makefile.in | 2 +- .../test/extensions/traditional/Makefile.in | 2 +- editor/composer/test/Makefile.in | 4 ++-- editor/libeditor/base/tests/Makefile.in | 4 ++-- editor/libeditor/html/tests/Makefile.in | 8 ++++---- editor/libeditor/text/tests/Makefile.in | 4 ++-- embedding/test/Makefile.in | 2 +- extensions/cookie/test/Makefile.in | 4 ++-- extensions/spellcheck/tests/chrome/Makefile.in | 2 +- .../spellcheck/tests/chrome/base/Makefile.in | 2 +- .../spellcheck/tests/chrome/map/Makefile.in | 2 +- extensions/universalchardet/tests/Makefile.in | 2 +- gfx/tests/Makefile.in | 2 +- image/test/browser/Makefile.in | 2 +- image/test/mochitest/Makefile.in | 4 ++-- intl/uconv/tests/Makefile.in | 2 +- js/jetpack/tests/Makefile.in | 2 +- js/jsd/test/Makefile.in | 2 +- js/src/config/config.mk | 4 ++++ js/xpconnect/tests/chrome/Makefile.in | 2 +- js/xpconnect/tests/mochitest/Makefile.in | 4 ++-- layout/base/tests/Makefile.in | 4 ++-- layout/base/tests/chrome/Makefile.in | 2 +- layout/forms/test/Makefile.in | 4 ++-- layout/generic/test/Makefile.in | 4 ++-- layout/inspector/tests/Makefile.in | 2 +- layout/inspector/tests/chrome/Makefile.in | 2 +- layout/reftests/fonts/Makefile.in | 2 +- layout/reftests/fonts/mplus/Makefile.in | 2 +- layout/style/test/Makefile.in | 6 +++--- layout/style/test/chrome/Makefile.in | 4 ++-- layout/tables/test/Makefile.in | 2 +- layout/xul/base/test/Makefile.in | 4 ++-- layout/xul/test/Makefile.in | 4 ++-- mobile/chrome/tests/Makefile.in | 4 ++-- modules/libjar/test/chrome/Makefile.in | 2 +- modules/libjar/test/mochitest/Makefile.in | 2 +- netwerk/test/browser/Makefile.in | 2 +- parser/htmlparser/tests/mochitest/Makefile.in | 2 +- .../tests/mochitest/dir_bug534293/Makefile.in | 2 +- .../html5lib_tree_construction/Makefile.in | 2 +- .../scripted/Makefile.in | 2 +- .../ssl/tests/mochitest/bugs/Makefile.in | 4 ++-- .../tests/mochitest/mixedcontent/Makefile.in | 2 +- .../stricttransportsecurity/Makefile.in | 2 +- testing/mochitest/Makefile.in | 17 ++++++++--------- testing/mochitest/MochiKit/Makefile.in | 4 ++-- testing/mochitest/chrome/Makefile.in | 4 ++-- testing/mochitest/dynamic/Makefile.in | 4 ++-- testing/mochitest/runtests.py | 2 +- testing/mochitest/specialpowers/Makefile.in | 4 ++-- testing/mochitest/static/Makefile.in | 4 ++-- testing/mochitest/tests/Makefile.in | 4 ++-- .../tests/MochiKit-1.4.2/MochiKit/Makefile.in | 4 ++-- .../tests/MochiKit-1.4.2/tests/Makefile.in | 4 ++-- .../MochiKit-1.4.2/tests/SimpleTest/Makefile.in | 4 ++-- testing/mochitest/tests/SimpleTest/Makefile.in | 4 ++-- testing/mochitest/tests/browser/Makefile.in | 4 ++-- testing/testsuite-targets.mk | 4 ++-- .../aboutmemory/tests/chrome/Makefile.in | 2 +- toolkit/components/alerts/test/Makefile.in | 2 +- toolkit/components/ctypes/tests/Makefile.in | 4 ++-- .../downloads/test/browser/Makefile.in | 2 +- toolkit/components/feeds/test/Makefile.in | 2 +- .../components/microformats/tests/Makefile.in | 2 +- toolkit/components/passwordmgr/test/Makefile.in | 2 +- .../passwordmgr/test/browser/Makefile.in | 2 +- toolkit/components/perf/Makefile.in | 2 +- toolkit/components/places/tests/Makefile.in | 2 +- .../components/places/tests/browser/Makefile.in | 4 ++-- .../components/places/tests/chrome/Makefile.in | 4 ++-- .../tests/mochitest/bug_411966/Makefile.in | 2 +- .../tests/mochitest/bug_461710/Makefile.in | 2 +- toolkit/components/prompts/test/Makefile.in | 2 +- toolkit/components/satchel/test/Makefile.in | 2 +- .../startup/tests/browser/Makefile.in | 2 +- .../url-classifier/tests/mochitest/Makefile.in | 2 +- toolkit/components/viewsource/test/Makefile.in | 2 +- toolkit/content/tests/browser/Makefile.in | 2 +- .../content/tests/browser/common/Makefile.in | 2 +- toolkit/content/tests/browser/data/Makefile.in | 2 +- toolkit/content/tests/chrome/Makefile.in | 2 +- .../content/tests/chrome/rtlchrome/Makefile.in | 6 +++--- .../content/tests/chrome/rtltest/Makefile.in | 4 ++-- toolkit/content/tests/widgets/Makefile.in | 6 +++--- toolkit/crashreporter/test/Makefile.in | 2 +- .../mozapps/downloads/tests/chrome/Makefile.in | 2 +- .../mozapps/extensions/test/browser/Makefile.in | 10 +++++----- .../extensions/test/mochitest/Makefile.in | 2 +- .../extensions/test/xpinstall/Makefile.in | 2 +- toolkit/mozapps/plugins/tests/Makefile.in | 2 +- toolkit/mozapps/shared/test/chrome/Makefile.in | 2 +- toolkit/mozapps/update/test/chrome/Makefile.in | 8 ++++---- toolkit/profile/test/Makefile.in | 2 +- toolkit/themes/pinstripe/mochitests/Makefile.in | 2 +- toolkit/xre/test/Makefile.in | 2 +- .../exthandler/tests/mochitest/Makefile.in | 2 +- widget/tests/Makefile.in | 4 ++-- xpinstall/tests/Makefile.in | 2 +- 219 files changed, 321 insertions(+), 313 deletions(-) diff --git a/Makefile.in b/Makefile.in index 2b1c3b88a62..7b7a6535fdf 100644 --- a/Makefile.in +++ b/Makefile.in @@ -93,6 +93,7 @@ default alldep all:: $(topsrcdir)/configure config.status $(RM) -r $(DIST)/public $(RM) -r $(DIST)/bin/components $(RM) -r _tests + $(RM) -r $(mochitestdir) $(topsrcdir)/configure: $(topsrcdir)/configure.in @echo "STOP! configure.in has changed, and your configure is out of date." diff --git a/accessible/tests/mochitest/Makefile.in b/accessible/tests/mochitest/Makefile.in index b019906c397..d7445af5b49 100644 --- a/accessible/tests/mochitest/Makefile.in +++ b/accessible/tests/mochitest/Makefile.in @@ -113,4 +113,4 @@ _TEST_FILES =\ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/actions/Makefile.in b/accessible/tests/mochitest/actions/Makefile.in index 51537d36e49..fdcfcbddbb7 100644 --- a/accessible/tests/mochitest/actions/Makefile.in +++ b/accessible/tests/mochitest/actions/Makefile.in @@ -61,4 +61,4 @@ _TEST_FILES =\ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/attributes/Makefile.in b/accessible/tests/mochitest/attributes/Makefile.in index 786438b640c..29972a22157 100644 --- a/accessible/tests/mochitest/attributes/Makefile.in +++ b/accessible/tests/mochitest/attributes/Makefile.in @@ -55,4 +55,4 @@ _TEST_FILES =\ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/editabletext/Makefile.in b/accessible/tests/mochitest/editabletext/Makefile.in index 1870bfe80a2..21999d81f65 100644 --- a/accessible/tests/mochitest/editabletext/Makefile.in +++ b/accessible/tests/mochitest/editabletext/Makefile.in @@ -52,4 +52,4 @@ _TEST_FILES =\ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/events/Makefile.in b/accessible/tests/mochitest/events/Makefile.in index 56041ec8655..34c6d0bf888 100644 --- a/accessible/tests/mochitest/events/Makefile.in +++ b/accessible/tests/mochitest/events/Makefile.in @@ -94,4 +94,4 @@ _TEST_FILES =\ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/focus/Makefile.in b/accessible/tests/mochitest/focus/Makefile.in index 61b766d1d2d..933abe11022 100644 --- a/accessible/tests/mochitest/focus/Makefile.in +++ b/accessible/tests/mochitest/focus/Makefile.in @@ -51,4 +51,4 @@ _TEST_FILES =\ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/hyperlink/Makefile.in b/accessible/tests/mochitest/hyperlink/Makefile.in index e59dcaf72b7..d561a29fb3f 100644 --- a/accessible/tests/mochitest/hyperlink/Makefile.in +++ b/accessible/tests/mochitest/hyperlink/Makefile.in @@ -52,4 +52,4 @@ _TEST_FILES =\ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/hypertext/Makefile.in b/accessible/tests/mochitest/hypertext/Makefile.in index be05ccff42f..c96d6917b99 100644 --- a/accessible/tests/mochitest/hypertext/Makefile.in +++ b/accessible/tests/mochitest/hypertext/Makefile.in @@ -51,4 +51,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/name/Makefile.in b/accessible/tests/mochitest/name/Makefile.in index 41a0ca99bcb..73adfc3af6d 100644 --- a/accessible/tests/mochitest/name/Makefile.in +++ b/accessible/tests/mochitest/name/Makefile.in @@ -62,4 +62,4 @@ _TEST_FILES =\ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/relations/Makefile.in b/accessible/tests/mochitest/relations/Makefile.in index de3d64cf206..cc98657d7eb 100644 --- a/accessible/tests/mochitest/relations/Makefile.in +++ b/accessible/tests/mochitest/relations/Makefile.in @@ -54,4 +54,4 @@ _TEST_FILES =\ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/selectable/Makefile.in b/accessible/tests/mochitest/selectable/Makefile.in index bcc960766b9..f210e8dcf22 100644 --- a/accessible/tests/mochitest/selectable/Makefile.in +++ b/accessible/tests/mochitest/selectable/Makefile.in @@ -55,4 +55,4 @@ _TEST_FILES =\ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/states/Makefile.in b/accessible/tests/mochitest/states/Makefile.in index 2f75339695b..42ced6f252f 100644 --- a/accessible/tests/mochitest/states/Makefile.in +++ b/accessible/tests/mochitest/states/Makefile.in @@ -71,4 +71,4 @@ _TEST_FILES =\ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/table/Makefile.in b/accessible/tests/mochitest/table/Makefile.in index 0f041935e64..650920a244b 100644 --- a/accessible/tests/mochitest/table/Makefile.in +++ b/accessible/tests/mochitest/table/Makefile.in @@ -69,4 +69,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/text/Makefile.in b/accessible/tests/mochitest/text/Makefile.in index 15b33314a2c..3612b6f345c 100644 --- a/accessible/tests/mochitest/text/Makefile.in +++ b/accessible/tests/mochitest/text/Makefile.in @@ -56,4 +56,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/textselection/Makefile.in b/accessible/tests/mochitest/textselection/Makefile.in index d4a8eacef24..1a9813c6039 100644 --- a/accessible/tests/mochitest/textselection/Makefile.in +++ b/accessible/tests/mochitest/textselection/Makefile.in @@ -50,4 +50,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/tree/Makefile.in b/accessible/tests/mochitest/tree/Makefile.in index 9b767a27a1f..6a346808f96 100644 --- a/accessible/tests/mochitest/tree/Makefile.in +++ b/accessible/tests/mochitest/tree/Makefile.in @@ -79,4 +79,4 @@ _TEST_FILES =\ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/treeupdate/Makefile.in b/accessible/tests/mochitest/treeupdate/Makefile.in index ca73261c52b..1ec8eb3ff65 100644 --- a/accessible/tests/mochitest/treeupdate/Makefile.in +++ b/accessible/tests/mochitest/treeupdate/Makefile.in @@ -63,4 +63,4 @@ _TEST_FILES =\ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/accessible/tests/mochitest/value/Makefile.in b/accessible/tests/mochitest/value/Makefile.in index 4f1bba5d549..0af305fd95e 100644 --- a/accessible/tests/mochitest/value/Makefile.in +++ b/accessible/tests/mochitest/value/Makefile.in @@ -52,4 +52,4 @@ _TEST_FILES =\ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/a11y/$(relativesrcdir) diff --git a/browser/base/content/test/Makefile.in b/browser/base/content/test/Makefile.in index 0be8be45af5..abaaa2a9071 100644 --- a/browser/base/content/test/Makefile.in +++ b/browser/base/content/test/Makefile.in @@ -265,7 +265,7 @@ _BROWSER_FILES += \ endif libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/components/certerror/test/Makefile.in b/browser/components/certerror/test/Makefile.in index a7539eea1b4..541e2acede5 100644 --- a/browser/components/certerror/test/Makefile.in +++ b/browser/components/certerror/test/Makefile.in @@ -49,5 +49,5 @@ _BROWSER_FILES = browser_bug431826.js \ $(NULL) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/components/feeds/test/Makefile.in b/browser/components/feeds/test/Makefile.in index a61978a6962..fb4687ab8b7 100644 --- a/browser/components/feeds/test/Makefile.in +++ b/browser/components/feeds/test/Makefile.in @@ -61,4 +61,4 @@ _TEST_FILES = bug408328-data.xml \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/browser/components/feeds/test/chrome/Makefile.in b/browser/components/feeds/test/chrome/Makefile.in index cf48dc6d4b5..9a668329d68 100644 --- a/browser/components/feeds/test/chrome/Makefile.in +++ b/browser/components/feeds/test/chrome/Makefile.in @@ -56,8 +56,8 @@ _CHROME_FILES = \ $(NULL) libs:: $(_HTTP_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/browser/components/places/tests/browser/Makefile.in b/browser/components/places/tests/browser/Makefile.in index 1ba7dccad0f..267559e682e 100644 --- a/browser/components/places/tests/browser/Makefile.in +++ b/browser/components/places/tests/browser/Makefile.in @@ -79,4 +79,4 @@ _BROWSER_TEST_FILES = \ $(NULL) libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/components/places/tests/chrome/Makefile.in b/browser/components/places/tests/chrome/Makefile.in index e4512a7de19..7f56971e05e 100644 --- a/browser/components/places/tests/chrome/Makefile.in +++ b/browser/components/places/tests/chrome/Makefile.in @@ -56,4 +56,4 @@ _CHROME_TEST_FILES = \ $(NULL) libs:: $(_CHROME_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/browser/components/preferences/tests/Makefile.in b/browser/components/preferences/tests/Makefile.in index 5c148b37511..9f93d562b85 100644 --- a/browser/components/preferences/tests/Makefile.in +++ b/browser/components/preferences/tests/Makefile.in @@ -60,4 +60,4 @@ _BROWSER_FILES = \ $(NULL) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/components/privatebrowsing/test/browser/Makefile.in b/browser/components/privatebrowsing/test/browser/Makefile.in index 11c3ac72f25..4e55e833c1b 100644 --- a/browser/components/privatebrowsing/test/browser/Makefile.in +++ b/browser/components/privatebrowsing/test/browser/Makefile.in @@ -99,4 +99,4 @@ _BROWSER_TEST_FILES += \ endif libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/components/safebrowsing/content/test/Makefile.in b/browser/components/safebrowsing/content/test/Makefile.in index 83ac5d724ac..99793530649 100644 --- a/browser/components/safebrowsing/content/test/Makefile.in +++ b/browser/components/safebrowsing/content/test/Makefile.in @@ -56,5 +56,5 @@ _BROWSER_FILES = browser_bug400731.js \ $(NULL) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/components/search/test/Makefile.in b/browser/components/search/test/Makefile.in index 1fe01b3f2d9..ebf70e8b88e 100644 --- a/browser/components/search/test/Makefile.in +++ b/browser/components/search/test/Makefile.in @@ -57,4 +57,4 @@ _BROWSER_TEST_FILES = browser_405664.js \ $(NULL) libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/components/sessionstore/test/browser/Makefile.in b/browser/components/sessionstore/test/browser/Makefile.in index e59fccc4514..532a09517d6 100644 --- a/browser/components/sessionstore/test/browser/Makefile.in +++ b/browser/components/sessionstore/test/browser/Makefile.in @@ -168,4 +168,4 @@ _BROWSER_TEST_FILES += \ endif libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/components/shell/test/Makefile.in b/browser/components/shell/test/Makefile.in index 2c87443e7f9..fb96b210155 100644 --- a/browser/components/shell/test/Makefile.in +++ b/browser/components/shell/test/Makefile.in @@ -52,4 +52,4 @@ _BROWSER_TEST_FILES = browser_420786.js \ $(NULL) libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/components/tabview/test/Makefile.in b/browser/components/tabview/test/Makefile.in index 7e858a7f5b2..e5f8b0a75d2 100644 --- a/browser/components/tabview/test/Makefile.in +++ b/browser/components/tabview/test/Makefile.in @@ -189,4 +189,4 @@ _BROWSER_FILES = \ $(NULL) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/components/test/browser/Makefile.in b/browser/components/test/browser/Makefile.in index 8d2a216110b..368900d99a3 100644 --- a/browser/components/test/browser/Makefile.in +++ b/browser/components/test/browser/Makefile.in @@ -49,4 +49,4 @@ _BROWSER_TEST_FILES = \ $(NULL) libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/components/wintaskbar/test/Makefile.in b/browser/components/wintaskbar/test/Makefile.in index 0230e41851e..7fc38db7386 100644 --- a/browser/components/wintaskbar/test/Makefile.in +++ b/browser/components/wintaskbar/test/Makefile.in @@ -49,6 +49,6 @@ _BROWSER_FILES = browser_taskbar_preview.js \ $(NULL) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/devtools/highlighter/test/Makefile.in b/browser/devtools/highlighter/test/Makefile.in index 0705e1d9cd8..8e1ec8a0d9a 100644 --- a/browser/devtools/highlighter/test/Makefile.in +++ b/browser/devtools/highlighter/test/Makefile.in @@ -71,4 +71,4 @@ _BROWSER_FILES = \ # browser_inspector_treePanel_click.js \ libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/devtools/scratchpad/test/Makefile.in b/browser/devtools/scratchpad/test/Makefile.in index 07298aff60b..978d24c9e97 100644 --- a/browser/devtools/scratchpad/test/Makefile.in +++ b/browser/devtools/scratchpad/test/Makefile.in @@ -58,4 +58,4 @@ _BROWSER_TEST_FILES = \ browser_scratchpad_bug_679467_falsy.js \ libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/devtools/shared/test/Makefile.in b/browser/devtools/shared/test/Makefile.in index 53a4fb5b506..329d47b576b 100644 --- a/browser/devtools/shared/test/Makefile.in +++ b/browser/devtools/shared/test/Makefile.in @@ -57,7 +57,7 @@ _BROWSER_TEST_PAGES = \ $(NULL) libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) libs:: $(_BROWSER_TEST_PAGES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/devtools/sourceeditor/test/Makefile.in b/browser/devtools/sourceeditor/test/Makefile.in index f72df271098..a69f3d357c8 100644 --- a/browser/devtools/sourceeditor/test/Makefile.in +++ b/browser/devtools/sourceeditor/test/Makefile.in @@ -52,4 +52,4 @@ _BROWSER_TEST_FILES = \ browser_bug687580_drag_and_drop.js \ libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/devtools/styleinspector/test/browser/Makefile.in b/browser/devtools/styleinspector/test/browser/Makefile.in index f53cc206d58..994365070da 100644 --- a/browser/devtools/styleinspector/test/browser/Makefile.in +++ b/browser/devtools/styleinspector/test/browser/Makefile.in @@ -65,7 +65,7 @@ _BROWSER_TEST_PAGES = \ $(NULL) libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) libs:: $(_BROWSER_TEST_PAGES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/devtools/webconsole/test/browser/Makefile.in b/browser/devtools/webconsole/test/browser/Makefile.in index 7bb12573c5b..2b6324304b3 100644 --- a/browser/devtools/webconsole/test/browser/Makefile.in +++ b/browser/devtools/webconsole/test/browser/Makefile.in @@ -223,7 +223,7 @@ _BROWSER_TEST_PAGES = \ $(NULL) libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) libs:: $(_BROWSER_TEST_PAGES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/browser/fuel/test/Makefile.in b/browser/fuel/test/Makefile.in index 87bf8d34d95..8c94cc39492 100644 --- a/browser/fuel/test/Makefile.in +++ b/browser/fuel/test/Makefile.in @@ -56,4 +56,4 @@ _BROWSER_FILES =browser_Application.js \ $(NULL) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/caps/tests/mochitest/Makefile.in b/caps/tests/mochitest/Makefile.in index c20666f58bb..910d99d4c6c 100644 --- a/caps/tests/mochitest/Makefile.in +++ b/caps/tests/mochitest/Makefile.in @@ -58,4 +58,4 @@ test_bug292789.html : % : %.in GARBAGE += test_bug292789.html libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/config/config.mk b/config/config.mk index eb99f1e6b68..f7d6503e6ce 100644 --- a/config/config.mk +++ b/config/config.mk @@ -56,6 +56,10 @@ ifndef topsrcdir topsrcdir = $(DEPTH) endif +ifndef mochitestdir +mochitestdir = _mochitest +endif + ifndef INCLUDED_AUTOCONF_MK include $(DEPTH)/config/autoconf.mk endif diff --git a/content/base/test/Makefile.in b/content/base/test/Makefile.in index ff89a7c1744..d251157242b 100644 --- a/content/base/test/Makefile.in +++ b/content/base/test/Makefile.in @@ -546,14 +546,14 @@ _BROWSER_TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES1) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES2) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/content/base/test/chrome/Makefile.in b/content/base/test/chrome/Makefile.in index df6d78df13f..81fe67d1fdc 100644 --- a/content/base/test/chrome/Makefile.in +++ b/content/base/test/chrome/Makefile.in @@ -74,7 +74,7 @@ _CHROME_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/content/canvas/test/Makefile.in b/content/canvas/test/Makefile.in index 1404414d537..33aacbae139 100644 --- a/content/canvas/test/Makefile.in +++ b/content/canvas/test/Makefile.in @@ -179,4 +179,4 @@ endif # split up into groups to work around command-line length limits libs:: $(_TEST_FILES_0) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/content/canvas/test/crossorigin/Makefile.in b/content/canvas/test/crossorigin/Makefile.in index ce009e1d836..2dbc037c722 100644 --- a/content/canvas/test/crossorigin/Makefile.in +++ b/content/canvas/test/crossorigin/Makefile.in @@ -54,4 +54,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/content/canvas/test/webgl/Makefile.in b/content/canvas/test/webgl/Makefile.in index 1af1623aa17..287d39d1f70 100644 --- a/content/canvas/test/webgl/Makefile.in +++ b/content/canvas/test/webgl/Makefile.in @@ -52,8 +52,8 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) $(TAR) -cf - -C $(srcdir) \ resources \ conformance \ - | $(TAR) -xf - -C $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + | $(TAR) -xf - -C $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/content/events/test/Makefile.in b/content/events/test/Makefile.in index 707613f0146..cff6c6009a2 100644 --- a/content/events/test/Makefile.in +++ b/content/events/test/Makefile.in @@ -147,7 +147,7 @@ _CHROME_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/content/html/content/test/Makefile.in b/content/html/content/test/Makefile.in index 104a8c7847e..1d6f5cc20cb 100644 --- a/content/html/content/test/Makefile.in +++ b/content/html/content/test/Makefile.in @@ -293,4 +293,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/content/html/content/test/bug649134/Makefile.in b/content/html/content/test/bug649134/Makefile.in index 732ba5dbcfe..1bbe1fb7b21 100644 --- a/content/html/content/test/bug649134/Makefile.in +++ b/content/html/content/test/bug649134/Makefile.in @@ -47,4 +47,4 @@ include $(topsrcdir)/config/rules.mk _TEST_FILES = file_bug649134-1.sjs file_bug649134-2.sjs index.html libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/content/html/content/test/forms/Makefile.in b/content/html/content/test/forms/Makefile.in index 3a9b9266284..204a9889867 100644 --- a/content/html/content/test/forms/Makefile.in +++ b/content/html/content/test/forms/Makefile.in @@ -67,5 +67,5 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/content/html/document/test/Makefile.in b/content/html/document/test/Makefile.in index 7edd3396430..a244143f029 100644 --- a/content/html/document/test/Makefile.in +++ b/content/html/document/test/Makefile.in @@ -115,9 +115,9 @@ _BROWSER_TEST_FILES = \ endif libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) ifneq (mobile,$(MOZ_BUILD_APP)) libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) endif diff --git a/content/media/test/Makefile.in b/content/media/test/Makefile.in index b1c20ffc5ac..a4b49bcded9 100644 --- a/content/media/test/Makefile.in +++ b/content/media/test/Makefile.in @@ -303,4 +303,4 @@ _TEST_FILES += \ endif libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/content/smil/test/Makefile.in b/content/smil/test/Makefile.in index a0a88f5a55e..e9e3258fc4a 100644 --- a/content/smil/test/Makefile.in +++ b/content/smil/test/Makefile.in @@ -96,4 +96,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/content/svg/content/test/Makefile.in b/content/svg/content/test/Makefile.in index 09aec53550d..98835b59d66 100644 --- a/content/svg/content/test/Makefile.in +++ b/content/svg/content/test/Makefile.in @@ -106,4 +106,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/content/xbl/test/Makefile.in b/content/xbl/test/Makefile.in index 83f26714898..b23e66b4774 100644 --- a/content/xbl/test/Makefile.in +++ b/content/xbl/test/Makefile.in @@ -82,8 +82,8 @@ _CHROME_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/content/xml/document/test/Makefile.in b/content/xml/document/test/Makefile.in index 1ac021be3c4..11a3d45bb7c 100644 --- a/content/xml/document/test/Makefile.in +++ b/content/xml/document/test/Makefile.in @@ -58,4 +58,4 @@ _TEST_FILES = test_bug232004.xhtml \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/content/xslt/tests/mochitest/Makefile.in b/content/xslt/tests/mochitest/Makefile.in index be1d8356ad5..123676e2898 100644 --- a/content/xslt/tests/mochitest/Makefile.in +++ b/content/xslt/tests/mochitest/Makefile.in @@ -60,4 +60,4 @@ _TEST_FILES = test_bug319374.xhtml \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/content/xul/content/test/Makefile.in b/content/xul/content/test/Makefile.in index 2057ea8c5ff..b9de02be034 100644 --- a/content/xul/content/test/Makefile.in +++ b/content/xul/content/test/Makefile.in @@ -56,7 +56,7 @@ _CHROME_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/content/xul/document/test/Makefile.in b/content/xul/document/test/Makefile.in index c2c85936dfe..94770ba6cc4 100644 --- a/content/xul/document/test/Makefile.in +++ b/content/xul/document/test/Makefile.in @@ -64,4 +64,4 @@ _CHROME_FILES = \ $(NULL) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/content/xul/templates/tests/chrome/Makefile.in b/content/xul/templates/tests/chrome/Makefile.in index a46c2998178..c6791c4407a 100644 --- a/content/xul/templates/tests/chrome/Makefile.in +++ b/content/xul/templates/tests/chrome/Makefile.in @@ -266,4 +266,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/docshell/test/Makefile.in b/docshell/test/Makefile.in index e8ce5c3e5ab..0742311fee6 100644 --- a/docshell/test/Makefile.in +++ b/docshell/test/Makefile.in @@ -132,4 +132,4 @@ _TEST_FILES += \ endif libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/docshell/test/browser/Makefile.in b/docshell/test/browser/Makefile.in index 14d3132d194..8284fa92318 100644 --- a/docshell/test/browser/Makefile.in +++ b/docshell/test/browser/Makefile.in @@ -68,4 +68,4 @@ _BROWSER_TEST_FILES = \ $(NULL) libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/docshell/test/chrome/Makefile.in b/docshell/test/chrome/Makefile.in index b92291c281f..06388c6c8af 100644 --- a/docshell/test/chrome/Makefile.in +++ b/docshell/test/chrome/Makefile.in @@ -130,10 +130,10 @@ _DOCSHELL_SUBHARNESS = \ $(NULL) libs:: $(_HTTP_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) libs:: $(_DOCSHELL_SUBHARNESS) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/docshell/test/navigation/Makefile.in b/docshell/test/navigation/Makefile.in index 3b4121b4a73..17d33f04420 100644 --- a/docshell/test/navigation/Makefile.in +++ b/docshell/test/navigation/Makefile.in @@ -94,9 +94,9 @@ _BROWSER_TEST_FILES = \ endif libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) ifneq (mobile,$(MOZ_BUILD_APP)) libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) endif diff --git a/dom/indexedDB/test/Makefile.in b/dom/indexedDB/test/Makefile.in index 1997f7ef262..cbbbf215625 100644 --- a/dom/indexedDB/test/Makefile.in +++ b/dom/indexedDB/test/Makefile.in @@ -124,9 +124,9 @@ BROWSER_TEST_FILES = \ $(NULL) libs:: $(BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) endif libs:: $(TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/ipc/tests/Makefile.in b/dom/ipc/tests/Makefile.in index 8d9f07b5144..f8cd3fa62ae 100644 --- a/dom/ipc/tests/Makefile.in +++ b/dom/ipc/tests/Makefile.in @@ -50,4 +50,4 @@ MOCHICHROME_FILES = \ $(NULL) libs:: $(MOCHICHROME_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/dom/plugins/test/mochitest/Makefile.in b/dom/plugins/test/mochitest/Makefile.in index 5d7d2e07a02..94268112fbf 100644 --- a/dom/plugins/test/mochitest/Makefile.in +++ b/dom/plugins/test/mochitest/Makefile.in @@ -169,7 +169,7 @@ _MOCHITEST_FILES += \ endif libs:: $(_MOCHICHROME_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) libs:: $(_MOCHITEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/src/foo/Makefile.in b/dom/src/foo/Makefile.in index 759adbf6132..194af9eafbf 100644 --- a/dom/src/foo/Makefile.in +++ b/dom/src/foo/Makefile.in @@ -52,4 +52,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/src/json/test/Makefile.in b/dom/src/json/test/Makefile.in index 2f5b7c2f479..f90aaa6feea 100644 --- a/dom/src/json/test/Makefile.in +++ b/dom/src/json/test/Makefile.in @@ -53,5 +53,5 @@ include $(topsrcdir)/config/rules.mk $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/src/jsurl/test/Makefile.in b/dom/src/jsurl/test/Makefile.in index 7d8fceff07f..a4361b31e1e 100644 --- a/dom/src/jsurl/test/Makefile.in +++ b/dom/src/jsurl/test/Makefile.in @@ -59,4 +59,4 @@ _TEST_FILES = pass.html \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/browser/Makefile.in b/dom/tests/browser/Makefile.in index e240e1b7998..08ec7000c57 100644 --- a/dom/tests/browser/Makefile.in +++ b/dom/tests/browser/Makefile.in @@ -58,4 +58,4 @@ _BROWSER_FILES = \ $(NULL) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/jquery/Makefile.in b/dom/tests/mochitest/ajax/jquery/Makefile.in index aef5a2de296..397e649cc97 100644 --- a/dom/tests/mochitest/ajax/jquery/Makefile.in +++ b/dom/tests/mochitest/ajax/jquery/Makefile.in @@ -56,4 +56,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/jquery/dist/Makefile.in b/dom/tests/mochitest/ajax/jquery/dist/Makefile.in index 60c3617ebfe..ddf4223697b 100644 --- a/dom/tests/mochitest/ajax/jquery/dist/Makefile.in +++ b/dom/tests/mochitest/ajax/jquery/dist/Makefile.in @@ -53,4 +53,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/jquery/test/Makefile.in b/dom/tests/mochitest/ajax/jquery/test/Makefile.in index 4e9518572df..ac87fd17daa 100644 --- a/dom/tests/mochitest/ajax/jquery/test/Makefile.in +++ b/dom/tests/mochitest/ajax/jquery/test/Makefile.in @@ -58,4 +58,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/jquery/test/data/Makefile.in b/dom/tests/mochitest/ajax/jquery/test/data/Makefile.in index 6236e51ef0a..34d796298d6 100644 --- a/dom/tests/mochitest/ajax/jquery/test/data/Makefile.in +++ b/dom/tests/mochitest/ajax/jquery/test/data/Makefile.in @@ -66,4 +66,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/jquery/test/data/offset/Makefile.in b/dom/tests/mochitest/ajax/jquery/test/data/offset/Makefile.in index acc7e4eea05..92d1ca1f803 100644 --- a/dom/tests/mochitest/ajax/jquery/test/data/offset/Makefile.in +++ b/dom/tests/mochitest/ajax/jquery/test/data/offset/Makefile.in @@ -58,4 +58,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/jquery/test/unit/Makefile.in b/dom/tests/mochitest/ajax/jquery/test/unit/Makefile.in index 47f51fd8edd..3296e63ef45 100644 --- a/dom/tests/mochitest/ajax/jquery/test/unit/Makefile.in +++ b/dom/tests/mochitest/ajax/jquery/test/unit/Makefile.in @@ -59,4 +59,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/lib/Makefile.in b/dom/tests/mochitest/ajax/lib/Makefile.in index 53507f12d74..8ef3626f624 100644 --- a/dom/tests/mochitest/ajax/lib/Makefile.in +++ b/dom/tests/mochitest/ajax/lib/Makefile.in @@ -50,4 +50,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/mochikit/Makefile.in b/dom/tests/mochitest/ajax/mochikit/Makefile.in index 3876c1f4713..d99d542682e 100644 --- a/dom/tests/mochitest/ajax/mochikit/Makefile.in +++ b/dom/tests/mochitest/ajax/mochikit/Makefile.in @@ -56,4 +56,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/mochikit/MochiKit/Makefile.in b/dom/tests/mochitest/ajax/mochikit/MochiKit/Makefile.in index d42a9452573..2fd675088ee 100644 --- a/dom/tests/mochitest/ajax/mochikit/MochiKit/Makefile.in +++ b/dom/tests/mochitest/ajax/mochikit/MochiKit/Makefile.in @@ -70,4 +70,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/mochikit/tests/Makefile.in b/dom/tests/mochitest/ajax/mochikit/tests/Makefile.in index 527b699d9fe..99c76d76aff 100644 --- a/dom/tests/mochitest/ajax/mochikit/tests/Makefile.in +++ b/dom/tests/mochitest/ajax/mochikit/tests/Makefile.in @@ -81,4 +81,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/mochikit/tests/SimpleTest/Makefile.in b/dom/tests/mochitest/ajax/mochikit/tests/SimpleTest/Makefile.in index a256437c29e..29135500a2d 100644 --- a/dom/tests/mochitest/ajax/mochikit/tests/SimpleTest/Makefile.in +++ b/dom/tests/mochitest/ajax/mochikit/tests/SimpleTest/Makefile.in @@ -54,4 +54,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/offline/Makefile.in b/dom/tests/mochitest/ajax/offline/Makefile.in index a8ea2b458d4..19ce9fba103 100644 --- a/dom/tests/mochitest/ajax/offline/Makefile.in +++ b/dom/tests/mochitest/ajax/offline/Makefile.in @@ -125,4 +125,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/offline/namespace1/Makefile.in b/dom/tests/mochitest/ajax/offline/namespace1/Makefile.in index 94f2caf8f59..479a62e5699 100644 --- a/dom/tests/mochitest/ajax/offline/namespace1/Makefile.in +++ b/dom/tests/mochitest/ajax/offline/namespace1/Makefile.in @@ -54,4 +54,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/offline/namespace1/sub/Makefile.in b/dom/tests/mochitest/ajax/offline/namespace1/sub/Makefile.in index 25ebc4f51d8..2a24f98324a 100644 --- a/dom/tests/mochitest/ajax/offline/namespace1/sub/Makefile.in +++ b/dom/tests/mochitest/ajax/offline/namespace1/sub/Makefile.in @@ -51,4 +51,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/offline/namespace1/sub2/Makefile.in b/dom/tests/mochitest/ajax/offline/namespace1/sub2/Makefile.in index a4987297ae1..f54dd11a48c 100644 --- a/dom/tests/mochitest/ajax/offline/namespace1/sub2/Makefile.in +++ b/dom/tests/mochitest/ajax/offline/namespace1/sub2/Makefile.in @@ -50,4 +50,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/offline/namespace2/Makefile.in b/dom/tests/mochitest/ajax/offline/namespace2/Makefile.in index 77164c9b53f..8ba98e0c574 100644 --- a/dom/tests/mochitest/ajax/offline/namespace2/Makefile.in +++ b/dom/tests/mochitest/ajax/offline/namespace2/Makefile.in @@ -50,4 +50,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/prototype/Makefile.in b/dom/tests/mochitest/ajax/prototype/Makefile.in index 6be8a162dfa..c5e4e92b300 100644 --- a/dom/tests/mochitest/ajax/prototype/Makefile.in +++ b/dom/tests/mochitest/ajax/prototype/Makefile.in @@ -57,4 +57,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/prototype/dist/Makefile.in b/dom/tests/mochitest/ajax/prototype/dist/Makefile.in index 7e58a7b15a4..ae754ddc2e3 100644 --- a/dom/tests/mochitest/ajax/prototype/dist/Makefile.in +++ b/dom/tests/mochitest/ajax/prototype/dist/Makefile.in @@ -50,4 +50,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/prototype/test/Makefile.in b/dom/tests/mochitest/ajax/prototype/test/Makefile.in index d33ec708689..cd30aea97fd 100644 --- a/dom/tests/mochitest/ajax/prototype/test/Makefile.in +++ b/dom/tests/mochitest/ajax/prototype/test/Makefile.in @@ -59,4 +59,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/prototype/test/functional/Makefile.in b/dom/tests/mochitest/ajax/prototype/test/functional/Makefile.in index 1eb181e0e19..994cacd3162 100644 --- a/dom/tests/mochitest/ajax/prototype/test/functional/Makefile.in +++ b/dom/tests/mochitest/ajax/prototype/test/functional/Makefile.in @@ -50,4 +50,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/prototype/test/lib/Makefile.in b/dom/tests/mochitest/ajax/prototype/test/lib/Makefile.in index 3586696d020..49af3c08e0c 100644 --- a/dom/tests/mochitest/ajax/prototype/test/lib/Makefile.in +++ b/dom/tests/mochitest/ajax/prototype/test/lib/Makefile.in @@ -51,4 +51,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/Makefile.in b/dom/tests/mochitest/ajax/prototype/test/unit/Makefile.in index eccf6094d00..36d0a41788e 100644 --- a/dom/tests/mochitest/ajax/prototype/test/unit/Makefile.in +++ b/dom/tests/mochitest/ajax/prototype/test/unit/Makefile.in @@ -70,4 +70,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/Makefile.in b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/Makefile.in index c36ec746218..02d593cf746 100644 --- a/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/Makefile.in +++ b/dom/tests/mochitest/ajax/prototype/test/unit/fixtures/Makefile.in @@ -74,4 +74,4 @@ _TEST_FILES= \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/prototype/test/unit/tmp/Makefile.in b/dom/tests/mochitest/ajax/prototype/test/unit/tmp/Makefile.in index 91342744a89..bac7c93a999 100644 --- a/dom/tests/mochitest/ajax/prototype/test/unit/tmp/Makefile.in +++ b/dom/tests/mochitest/ajax/prototype/test/unit/tmp/Makefile.in @@ -64,4 +64,4 @@ _TEST_FILES= \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/scriptaculous/Makefile.in b/dom/tests/mochitest/ajax/scriptaculous/Makefile.in index 469f94fc534..002a3aa4ebd 100644 --- a/dom/tests/mochitest/ajax/scriptaculous/Makefile.in +++ b/dom/tests/mochitest/ajax/scriptaculous/Makefile.in @@ -57,4 +57,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/scriptaculous/lib/Makefile.in b/dom/tests/mochitest/ajax/scriptaculous/lib/Makefile.in index d8781b82fcc..5da2c66fb4d 100644 --- a/dom/tests/mochitest/ajax/scriptaculous/lib/Makefile.in +++ b/dom/tests/mochitest/ajax/scriptaculous/lib/Makefile.in @@ -53,4 +53,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/scriptaculous/src/Makefile.in b/dom/tests/mochitest/ajax/scriptaculous/src/Makefile.in index 2b751c5ab79..b643613ae07 100644 --- a/dom/tests/mochitest/ajax/scriptaculous/src/Makefile.in +++ b/dom/tests/mochitest/ajax/scriptaculous/src/Makefile.in @@ -60,4 +60,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/ajax/scriptaculous/test/unit/Makefile.in b/dom/tests/mochitest/ajax/scriptaculous/test/unit/Makefile.in index e89b101b21f..abe4b30264d 100644 --- a/dom/tests/mochitest/ajax/scriptaculous/test/unit/Makefile.in +++ b/dom/tests/mochitest/ajax/scriptaculous/test/unit/Makefile.in @@ -71,4 +71,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/bugs/Makefile.in b/dom/tests/mochitest/bugs/Makefile.in index 62eaf858add..84058e944e8 100644 --- a/dom/tests/mochitest/bugs/Makefile.in +++ b/dom/tests/mochitest/bugs/Makefile.in @@ -155,4 +155,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/chrome/Makefile.in b/dom/tests/mochitest/chrome/Makefile.in index 2a6b90897cc..c2dbce246b4 100644 --- a/dom/tests/mochitest/chrome/Makefile.in +++ b/dom/tests/mochitest/chrome/Makefile.in @@ -82,4 +82,4 @@ _TEST_FILES += \ endif libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/dom/tests/mochitest/dom-level0/Makefile.in b/dom/tests/mochitest/dom-level0/Makefile.in index a08896bb4a8..8a12b0dae1d 100644 --- a/dom/tests/mochitest/dom-level0/Makefile.in +++ b/dom/tests/mochitest/dom-level0/Makefile.in @@ -59,4 +59,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/dom-level1-core/Makefile.in b/dom/tests/mochitest/dom-level1-core/Makefile.in index fec2f588e26..3135da79885 100644 --- a/dom/tests/mochitest/dom-level1-core/Makefile.in +++ b/dom/tests/mochitest/dom-level1-core/Makefile.in @@ -604,22 +604,22 @@ _TEST_FILES_G = \ # work around command-line length limits by splitting into groups libs:: $(_TEST_FILES_A) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_B) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_C) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_D) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_E) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_F) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_G) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/dom-level1-core/files/Makefile.in b/dom/tests/mochitest/dom-level1-core/files/Makefile.in index 0f0893ce71b..884c862bdd4 100644 --- a/dom/tests/mochitest/dom-level1-core/files/Makefile.in +++ b/dom/tests/mochitest/dom-level1-core/files/Makefile.in @@ -67,4 +67,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/dom-level2-core/Makefile.in b/dom/tests/mochitest/dom-level2-core/Makefile.in index 306efaf1ce8..72000b03ec8 100644 --- a/dom/tests/mochitest/dom-level2-core/Makefile.in +++ b/dom/tests/mochitest/dom-level2-core/Makefile.in @@ -330,19 +330,19 @@ _TEST_FILES_F = \ # work around nsinstall limits on windows by splitting into groups libs:: $(_TEST_FILES_A) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_B) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_C) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_D) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_E) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_F) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/dom-level2-core/files/Makefile.in b/dom/tests/mochitest/dom-level2-core/files/Makefile.in index b4f7986fd3d..de39f2cd2c2 100644 --- a/dom/tests/mochitest/dom-level2-core/files/Makefile.in +++ b/dom/tests/mochitest/dom-level2-core/files/Makefile.in @@ -72,4 +72,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/dom-level2-html/Makefile.in b/dom/tests/mochitest/dom-level2-html/Makefile.in index d788d1ddbbe..c0dcf7c7273 100644 --- a/dom/tests/mochitest/dom-level2-html/Makefile.in +++ b/dom/tests/mochitest/dom-level2-html/Makefile.in @@ -745,14 +745,14 @@ _TEST_FILES_F = \ # work around nsinstall limits on windows by splitting into groups libs:: $(_TEST_FILES_A) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_B) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_C) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_D) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_E) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) #libs:: $(_TEST_FILES_F) -# $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) +# $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/dom-level2-html/files/Makefile.in b/dom/tests/mochitest/dom-level2-html/files/Makefile.in index 4b672ca12fa..26b6c76a301 100644 --- a/dom/tests/mochitest/dom-level2-html/files/Makefile.in +++ b/dom/tests/mochitest/dom-level2-html/files/Makefile.in @@ -256,7 +256,7 @@ _TEST_FILES_J = \ applets/org/w3c/domts/DOMTSApplet.class \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_TEST_FILES_J) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)/applets/org/w3c/domts + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir)/applets/org/w3c/domts diff --git a/dom/tests/mochitest/general/Makefile.in b/dom/tests/mochitest/general/Makefile.in index d548a8ebfbf..839bff986b6 100644 --- a/dom/tests/mochitest/general/Makefile.in +++ b/dom/tests/mochitest/general/Makefile.in @@ -79,7 +79,7 @@ _CHROME_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/dom/tests/mochitest/geolocation/Makefile.in b/dom/tests/mochitest/geolocation/Makefile.in index becbf0b597a..d0bb989280c 100644 --- a/dom/tests/mochitest/geolocation/Makefile.in +++ b/dom/tests/mochitest/geolocation/Makefile.in @@ -67,5 +67,5 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/globalstorage/Makefile.in b/dom/tests/mochitest/globalstorage/Makefile.in index 199e7a68203..a94d5faf27b 100644 --- a/dom/tests/mochitest/globalstorage/Makefile.in +++ b/dom/tests/mochitest/globalstorage/Makefile.in @@ -51,4 +51,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/localstorage/Makefile.in b/dom/tests/mochitest/localstorage/Makefile.in index 76b805fca8b..f8b5fe88a9a 100644 --- a/dom/tests/mochitest/localstorage/Makefile.in +++ b/dom/tests/mochitest/localstorage/Makefile.in @@ -95,6 +95,6 @@ _CHROME_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/dom/tests/mochitest/notification/Makefile.in b/dom/tests/mochitest/notification/Makefile.in index 631f8f6b5f5..78e19ac04d6 100644 --- a/dom/tests/mochitest/notification/Makefile.in +++ b/dom/tests/mochitest/notification/Makefile.in @@ -52,5 +52,5 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/orientation/Makefile.in b/dom/tests/mochitest/orientation/Makefile.in index 26f070525b4..db6aaafa198 100644 --- a/dom/tests/mochitest/orientation/Makefile.in +++ b/dom/tests/mochitest/orientation/Makefile.in @@ -49,5 +49,5 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/sessionstorage/Makefile.in b/dom/tests/mochitest/sessionstorage/Makefile.in index 3036cbb703d..21472da3f5b 100644 --- a/dom/tests/mochitest/sessionstorage/Makefile.in +++ b/dom/tests/mochitest/sessionstorage/Makefile.in @@ -64,6 +64,6 @@ _CHROME_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/dom/tests/mochitest/storageevent/Makefile.in b/dom/tests/mochitest/storageevent/Makefile.in index 2cd91eff3ab..198d1ed6760 100644 --- a/dom/tests/mochitest/storageevent/Makefile.in +++ b/dom/tests/mochitest/storageevent/Makefile.in @@ -68,4 +68,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/dom/tests/mochitest/whatwg/Makefile.in b/dom/tests/mochitest/whatwg/Makefile.in index e9a1a5c3b91..356cefec25e 100644 --- a/dom/tests/mochitest/whatwg/Makefile.in +++ b/dom/tests/mochitest/whatwg/Makefile.in @@ -91,7 +91,7 @@ _CHROME_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/dom/workers/test/Makefile.in b/dom/workers/test/Makefile.in index 990d9431d46..f39bd9c1780 100644 --- a/dom/workers/test/Makefile.in +++ b/dom/workers/test/Makefile.in @@ -165,10 +165,10 @@ _TEST_FILES += \ endif libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_SUBDIR_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)/subdir + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir)/subdir libs:: $(_CHROME_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/dom/workers/test/extensions/bootstrap/Makefile.in b/dom/workers/test/extensions/bootstrap/Makefile.in index 982be6324a7..5b9a7af275b 100644 --- a/dom/workers/test/extensions/bootstrap/Makefile.in +++ b/dom/workers/test/extensions/bootstrap/Makefile.in @@ -50,7 +50,7 @@ DIST_FILES = \ worker.js \ $(NULL) -TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions +TEST_EXTENSIONS_DIR = $(DEPTH)/$(mochitestdir)/extensions include $(topsrcdir)/config/rules.mk diff --git a/dom/workers/test/extensions/traditional/Makefile.in b/dom/workers/test/extensions/traditional/Makefile.in index 2b12cb9ba9e..defa6794dd7 100644 --- a/dom/workers/test/extensions/traditional/Makefile.in +++ b/dom/workers/test/extensions/traditional/Makefile.in @@ -59,7 +59,7 @@ DIST_FILES = \ worker.js \ $(NULL) -TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions +TEST_EXTENSIONS_DIR = $(DEPTH)/$(mochitestdir)/extensions include $(topsrcdir)/config/rules.mk diff --git a/editor/composer/test/Makefile.in b/editor/composer/test/Makefile.in index 46274d28fef..57192607987 100644 --- a/editor/composer/test/Makefile.in +++ b/editor/composer/test/Makefile.in @@ -59,7 +59,7 @@ _CHROME_TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/editor/libeditor/base/tests/Makefile.in b/editor/libeditor/base/tests/Makefile.in index b697234bbbb..784d03626f7 100644 --- a/editor/libeditor/base/tests/Makefile.in +++ b/editor/libeditor/base/tests/Makefile.in @@ -59,8 +59,8 @@ _CHROME_TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/editor/libeditor/html/tests/Makefile.in b/editor/libeditor/html/tests/Makefile.in index c702714eafd..af1a43970ec 100644 --- a/editor/libeditor/html/tests/Makefile.in +++ b/editor/libeditor/html/tests/Makefile.in @@ -121,12 +121,12 @@ _CHROME_TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) - (cd $(srcdir) && tar $(TAR_CREATE_FLAGS) - browserscope 2> /dev/null) | (cd $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) && tar -xf -) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) + (cd $(srcdir) && tar $(TAR_CREATE_FLAGS) - browserscope 2> /dev/null) | (cd $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) && tar -xf -) libs:: $(_DATA_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)/data + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir)/data libs:: $(_CHROME_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/editor/libeditor/text/tests/Makefile.in b/editor/libeditor/text/tests/Makefile.in index 2b686d4811e..58f73f2e9f7 100644 --- a/editor/libeditor/text/tests/Makefile.in +++ b/editor/libeditor/text/tests/Makefile.in @@ -81,8 +81,8 @@ _CHROME_TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/embedding/test/Makefile.in b/embedding/test/Makefile.in index 735a6e96057..7ce0614ed52 100644 --- a/embedding/test/Makefile.in +++ b/embedding/test/Makefile.in @@ -55,4 +55,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/extensions/cookie/test/Makefile.in b/extensions/cookie/test/Makefile.in index 2bd0b08dda8..93fd9f9b93b 100644 --- a/extensions/cookie/test/Makefile.in +++ b/extensions/cookie/test/Makefile.in @@ -89,10 +89,10 @@ _BROWSER_TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) XPCSHELL_TESTS = unit diff --git a/extensions/spellcheck/tests/chrome/Makefile.in b/extensions/spellcheck/tests/chrome/Makefile.in index da60413beb7..d87d93dd653 100644 --- a/extensions/spellcheck/tests/chrome/Makefile.in +++ b/extensions/spellcheck/tests/chrome/Makefile.in @@ -51,4 +51,4 @@ _TEST_FILES = test_add_remove_dictionaries.xul \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/extensions/spellcheck/tests/chrome/base/Makefile.in b/extensions/spellcheck/tests/chrome/base/Makefile.in index 04159b2ca7a..669cdf5944f 100644 --- a/extensions/spellcheck/tests/chrome/base/Makefile.in +++ b/extensions/spellcheck/tests/chrome/base/Makefile.in @@ -49,4 +49,4 @@ _TEST_FILES = base_utf.dic \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/extensions/spellcheck/tests/chrome/map/Makefile.in b/extensions/spellcheck/tests/chrome/map/Makefile.in index f9da7553bee..ea89d52dd57 100644 --- a/extensions/spellcheck/tests/chrome/map/Makefile.in +++ b/extensions/spellcheck/tests/chrome/map/Makefile.in @@ -49,4 +49,4 @@ _TEST_FILES = maputf.dic \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/extensions/universalchardet/tests/Makefile.in b/extensions/universalchardet/tests/Makefile.in index 3dd12b787e3..81703d69626 100644 --- a/extensions/universalchardet/tests/Makefile.in +++ b/extensions/universalchardet/tests/Makefile.in @@ -79,4 +79,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/gfx/tests/Makefile.in b/gfx/tests/Makefile.in index 638f0c49e01..c2de2a37391 100644 --- a/gfx/tests/Makefile.in +++ b/gfx/tests/Makefile.in @@ -117,4 +117,4 @@ endif libs:: $(_TEST_FILES) $(INSTALL) $(foreach f,$^,"$f") \ - $(DEPTH)/_tests/testing/mochitest/tests/gfx + $(DEPTH)/$(mochitestdir)/tests/gfx diff --git a/image/test/browser/Makefile.in b/image/test/browser/Makefile.in index 43e2294035d..e72677b0d41 100644 --- a/image/test/browser/Makefile.in +++ b/image/test/browser/Makefile.in @@ -54,5 +54,5 @@ _BROWSER_FILES = head.js \ $(NULL) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/image/test/mochitest/Makefile.in b/image/test/mochitest/Makefile.in index 0e3651f3dcd..fe20d065c46 100644 --- a/image/test/mochitest/Makefile.in +++ b/image/test/mochitest/Makefile.in @@ -98,7 +98,7 @@ _CHROME_FILES = imgutils.js \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/intl/uconv/tests/Makefile.in b/intl/uconv/tests/Makefile.in index d1736003933..4cb995f7caf 100644 --- a/intl/uconv/tests/Makefile.in +++ b/intl/uconv/tests/Makefile.in @@ -73,6 +73,6 @@ _TEST_FILES = \ test_utf8_overconsumption.html \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) include $(topsrcdir)/config/rules.mk diff --git a/js/jetpack/tests/Makefile.in b/js/jetpack/tests/Makefile.in index 6794b6fb91f..7385f3e8f5f 100644 --- a/js/jetpack/tests/Makefile.in +++ b/js/jetpack/tests/Makefile.in @@ -56,5 +56,5 @@ MOCHICHROME_FILES = \ $(NULL) libs:: $(MOCHICHROME_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) endif diff --git a/js/jsd/test/Makefile.in b/js/jsd/test/Makefile.in index 22c6e76eb81..15f9f7e936f 100644 --- a/js/jsd/test/Makefile.in +++ b/js/jsd/test/Makefile.in @@ -53,4 +53,4 @@ _TEST_FILES = test_bug507448.html bug507448.js \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/js/src/config/config.mk b/js/src/config/config.mk index eb99f1e6b68..f7d6503e6ce 100644 --- a/js/src/config/config.mk +++ b/js/src/config/config.mk @@ -56,6 +56,10 @@ ifndef topsrcdir topsrcdir = $(DEPTH) endif +ifndef mochitestdir +mochitestdir = _mochitest +endif + ifndef INCLUDED_AUTOCONF_MK include $(DEPTH)/config/autoconf.mk endif diff --git a/js/xpconnect/tests/chrome/Makefile.in b/js/xpconnect/tests/chrome/Makefile.in index ad41e3027da..fde9c644f17 100644 --- a/js/xpconnect/tests/chrome/Makefile.in +++ b/js/xpconnect/tests/chrome/Makefile.in @@ -80,4 +80,4 @@ _CHROME_FILES = \ # test_wrappers-2.xul \ libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/js/xpconnect/tests/mochitest/Makefile.in b/js/xpconnect/tests/mochitest/Makefile.in index a2b24bab77c..4330393f13f 100644 --- a/js/xpconnect/tests/mochitest/Makefile.in +++ b/js/xpconnect/tests/mochitest/Makefile.in @@ -112,8 +112,8 @@ endif #test_bug484107.html \ libs:: $(_TEST_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/layout/base/tests/Makefile.in b/layout/base/tests/Makefile.in index 16154bf6e3d..abfc525ef47 100644 --- a/layout/base/tests/Makefile.in +++ b/layout/base/tests/Makefile.in @@ -358,9 +358,9 @@ _BROWSER_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) check:: @$(EXIT_ON_ERROR) \ diff --git a/layout/base/tests/chrome/Makefile.in b/layout/base/tests/chrome/Makefile.in index 7dbcaa0ec2e..f8aa76d074c 100644 --- a/layout/base/tests/chrome/Makefile.in +++ b/layout/base/tests/chrome/Makefile.in @@ -71,4 +71,4 @@ _CHROME_FILES = \ $(NULL) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/layout/forms/test/Makefile.in b/layout/forms/test/Makefile.in index 40c5681b7a0..d57deb9e4d6 100644 --- a/layout/forms/test/Makefile.in +++ b/layout/forms/test/Makefile.in @@ -87,7 +87,7 @@ _CHROME_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/layout/generic/test/Makefile.in b/layout/generic/test/Makefile.in index 0b41c8c70de..37979f09372 100644 --- a/layout/generic/test/Makefile.in +++ b/layout/generic/test/Makefile.in @@ -139,7 +139,7 @@ _CHROME_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/layout/inspector/tests/Makefile.in b/layout/inspector/tests/Makefile.in index 72e958cb695..0b2e25fc425 100644 --- a/layout/inspector/tests/Makefile.in +++ b/layout/inspector/tests/Makefile.in @@ -55,4 +55,4 @@ _TEST_FILES =\ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/layout/inspector/tests/chrome/Makefile.in b/layout/inspector/tests/chrome/Makefile.in index aac68770d0a..37154731126 100644 --- a/layout/inspector/tests/chrome/Makefile.in +++ b/layout/inspector/tests/chrome/Makefile.in @@ -53,4 +53,4 @@ _CHROME_FILES =\ $(NULL) libs:: $(_CHROME_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/layout/reftests/fonts/Makefile.in b/layout/reftests/fonts/Makefile.in index bc0be57c4c0..5d83fcb6671 100644 --- a/layout/reftests/fonts/Makefile.in +++ b/layout/reftests/fonts/Makefile.in @@ -47,4 +47,4 @@ _TEST_FILES = Ahem.ttf \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/fonts + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/fonts diff --git a/layout/reftests/fonts/mplus/Makefile.in b/layout/reftests/fonts/mplus/Makefile.in index 04468eb528a..22099e1c47e 100644 --- a/layout/reftests/fonts/mplus/Makefile.in +++ b/layout/reftests/fonts/mplus/Makefile.in @@ -47,4 +47,4 @@ _TEST_FILES = mplus-1p-regular.ttf \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/fonts/mplus + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/fonts/mplus diff --git a/layout/style/test/Makefile.in b/layout/style/test/Makefile.in index bb0c4d5bdec..d2ca0245d39 100644 --- a/layout/style/test/Makefile.in +++ b/layout/style/test/Makefile.in @@ -247,12 +247,12 @@ _BROWSER_FILES = \ endif libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_VISITED_REFTEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)/css-visited/ + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir)/css-visited/ ifneq (mobile,$(MOZ_BUILD_APP)) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) endif diff --git a/layout/style/test/chrome/Makefile.in b/layout/style/test/chrome/Makefile.in index 482fa6b1b58..edf4418b4a6 100644 --- a/layout/style/test/chrome/Makefile.in +++ b/layout/style/test/chrome/Makefile.in @@ -58,7 +58,7 @@ _TEST_FILES = \ $(NULL) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/layout/tables/test/Makefile.in b/layout/tables/test/Makefile.in index 9d8d459768a..481b3af2f82 100644 --- a/layout/tables/test/Makefile.in +++ b/layout/tables/test/Makefile.in @@ -50,4 +50,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/layout/xul/base/test/Makefile.in b/layout/xul/base/test/Makefile.in index 1fe3f355b9a..ee08e7c103e 100644 --- a/layout/xul/base/test/Makefile.in +++ b/layout/xul/base/test/Makefile.in @@ -64,7 +64,7 @@ _CHROME_FILES += test_resizer.xul \ endif libs:: $(_CHROME_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) libs:: $(_TEST_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/layout/xul/test/Makefile.in b/layout/xul/test/Makefile.in index 0c2ac2828be..501e2cdc6f2 100644 --- a/layout/xul/test/Makefile.in +++ b/layout/xul/test/Makefile.in @@ -57,7 +57,7 @@ _CHROME_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/mobile/chrome/tests/Makefile.in b/mobile/chrome/tests/Makefile.in index 70d82341506..3f1ce48db6b 100644 --- a/mobile/chrome/tests/Makefile.in +++ b/mobile/chrome/tests/Makefile.in @@ -40,7 +40,7 @@ topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ relativesrcdir = mobile/chrome/tests -TESTXPI = $(CURDIR)/$(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)/addons +TESTXPI = $(CURDIR)/$(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir)/addons ADDONSRC = $(srcdir)/addons include $(DEPTH)/config/autoconf.mk @@ -127,7 +127,7 @@ endif endif libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) libs:: rm -rf $(TESTXPI) diff --git a/modules/libjar/test/chrome/Makefile.in b/modules/libjar/test/chrome/Makefile.in index c25235a86a2..b5d4ce49039 100644 --- a/modules/libjar/test/chrome/Makefile.in +++ b/modules/libjar/test/chrome/Makefile.in @@ -54,4 +54,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/modules/libjar/test/mochitest/Makefile.in b/modules/libjar/test/mochitest/Makefile.in index ca7df17302e..9bb7590e400 100644 --- a/modules/libjar/test/mochitest/Makefile.in +++ b/modules/libjar/test/mochitest/Makefile.in @@ -52,4 +52,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/netwerk/test/browser/Makefile.in b/netwerk/test/browser/Makefile.in index 9f6547ece9d..df5e211a8bf 100644 --- a/netwerk/test/browser/Makefile.in +++ b/netwerk/test/browser/Makefile.in @@ -49,4 +49,4 @@ _BROWSER_TEST_FILES = \ $(NULL) libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/parser/htmlparser/tests/mochitest/Makefile.in b/parser/htmlparser/tests/mochitest/Makefile.in index c686164e3d7..7efcaf9cdd2 100644 --- a/parser/htmlparser/tests/mochitest/Makefile.in +++ b/parser/htmlparser/tests/mochitest/Makefile.in @@ -103,4 +103,4 @@ _TEST_FILES = parser_datreader.js \ # test_bug534293.html \ libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/parser/htmlparser/tests/mochitest/dir_bug534293/Makefile.in b/parser/htmlparser/tests/mochitest/dir_bug534293/Makefile.in index c243457449c..762cba121ca 100644 --- a/parser/htmlparser/tests/mochitest/dir_bug534293/Makefile.in +++ b/parser/htmlparser/tests/mochitest/dir_bug534293/Makefile.in @@ -48,4 +48,4 @@ _TEST_FILES = file_bug534293.sjs \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/parser/htmlparser/tests/mochitest/html5lib_tree_construction/Makefile.in b/parser/htmlparser/tests/mochitest/html5lib_tree_construction/Makefile.in index ee26a59fff1..3bf4afd284a 100644 --- a/parser/htmlparser/tests/mochitest/html5lib_tree_construction/Makefile.in +++ b/parser/htmlparser/tests/mochitest/html5lib_tree_construction/Makefile.in @@ -95,4 +95,4 @@ _TEST_FILES = adoption01.dat \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/parser/htmlparser/tests/mochitest/html5lib_tree_construction/scripted/Makefile.in b/parser/htmlparser/tests/mochitest/html5lib_tree_construction/scripted/Makefile.in index 140f1171b42..ffd87029f3a 100644 --- a/parser/htmlparser/tests/mochitest/html5lib_tree_construction/scripted/Makefile.in +++ b/parser/htmlparser/tests/mochitest/html5lib_tree_construction/scripted/Makefile.in @@ -50,4 +50,4 @@ _TEST_FILES = adoption01.dat \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/security/manager/ssl/tests/mochitest/bugs/Makefile.in b/security/manager/ssl/tests/mochitest/bugs/Makefile.in index 568ddc03188..d478470714f 100644 --- a/security/manager/ssl/tests/mochitest/bugs/Makefile.in +++ b/security/manager/ssl/tests/mochitest/bugs/Makefile.in @@ -58,6 +58,6 @@ _CHROME_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/security/manager/ssl/tests/mochitest/mixedcontent/Makefile.in b/security/manager/ssl/tests/mochitest/mixedcontent/Makefile.in index 6e384d963ef..376ebfc8aa8 100644 --- a/security/manager/ssl/tests/mochitest/mixedcontent/Makefile.in +++ b/security/manager/ssl/tests/mochitest/mixedcontent/Makefile.in @@ -106,4 +106,4 @@ _TEST_FILES = \ libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/security/manager/ssl/tests/mochitest/stricttransportsecurity/Makefile.in b/security/manager/ssl/tests/mochitest/stricttransportsecurity/Makefile.in index 11a265d0767..07dfa965b1d 100644 --- a/security/manager/ssl/tests/mochitest/stricttransportsecurity/Makefile.in +++ b/security/manager/ssl/tests/mochitest/stricttransportsecurity/Makefile.in @@ -57,4 +57,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/testing/mochitest/Makefile.in b/testing/mochitest/Makefile.in index 2a8eb7dd21a..2a1adbd8a53 100644 --- a/testing/mochitest/Makefile.in +++ b/testing/mochitest/Makefile.in @@ -39,7 +39,6 @@ DEPTH = ../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ -relativesrcdir = testing/mochitest include $(DEPTH)/config/autoconf.mk @@ -67,12 +66,12 @@ XPI_NAME = mochijar CHROME_JAR = 1 include $(topsrcdir)/config/rules.mk -# We're installing to _tests/testing/mochitest, so this is the depth +# We're installing to _mochitest, so this is the depth # necessary for relative objdir paths. -TARGET_DEPTH = ../../.. +TARGET_DEPTH = .. include $(topsrcdir)/build/automation-build.mk -# files that get copied into $objdir/_tests/ +# files that get copied into $objdir/_mochitest/ _SERV_FILES = \ runtests.py \ automation.py \ @@ -128,7 +127,7 @@ _HANDSHAKE_FILES = \ pywebsocket/mod_pywebsocket/handshake/hybi06.py \ $(NULL) -_DEST_DIR = $(DEPTH)/_tests/$(relativesrcdir) +_DEST_DIR = $(DEPTH)/$(mochitestdir) libs:: (cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - mochijar) | (cd $(_DEST_DIR) && tar -xf -) @@ -199,10 +198,10 @@ PKG_CHROMEJAR = $(PKG_STAGE)/mochitest/content/ ifdef CHROME_JAR stage-chromejar: $(NSINSTALL) -D $(PKG_CHROMEJAR) - cp -RL $(DEPTH)/_tests/testing/mochitest/browser $(PKG_CHROMEJAR) - cp -RL $(DEPTH)/_tests/testing/mochitest/chrome $(PKG_CHROMEJAR) + cp -RL $(DEPTH)/$(mochitestdir)/browser $(PKG_CHROMEJAR) + cp -RL $(DEPTH)/$(mochitestdir)/chrome $(PKG_CHROMEJAR) ifdef ACCESSIBILITY - cp -RL $(DEPTH)/_tests/testing/mochitest/a11y $(PKG_CHROMEJAR) + cp -RL $(DEPTH)/$(mochitestdir)/a11y $(PKG_CHROMEJAR) endif @(cd $(PKG_STAGE)/mochitest && zip -r tests.jar content/) @(rm -rf $(PKG_CHROMEJAR)) @@ -215,7 +214,7 @@ $(_DEST_DIR): stage-package: $(NSINSTALL) -D $(PKG_STAGE)/mochitest && $(NSINSTALL) -D $(PKG_STAGE)/bin/plugins - @(cd $(DEPTH)/_tests/testing/mochitest/ && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mochitest && tar -xf -) + @(cd $(DEPTH)/$(mochitestdir)/ && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mochitest && tar -xf -) @(cd $(DIST_BIN) && tar $(TAR_CREATE_FLAGS) - $(TEST_HARNESS_BINS)) | (cd $(PKG_STAGE)/bin && tar -xf -) @(cd $(DIST_BIN)/components && tar $(TAR_CREATE_FLAGS) - $(TEST_HARNESS_COMPONENTS)) | (cd $(PKG_STAGE)/bin/components && tar -xf -) @(cd $(topsrcdir)/build/pgo/certs && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/certs && tar -xf -) diff --git a/testing/mochitest/MochiKit/Makefile.in b/testing/mochitest/MochiKit/Makefile.in index 1bb55dd3d8b..ec0e616520a 100644 --- a/testing/mochitest/MochiKit/Makefile.in +++ b/testing/mochitest/MochiKit/Makefile.in @@ -39,7 +39,7 @@ DEPTH = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ -relativesrcdir = testing/mochitest/MochiKit +relativesrcdir = MochiKit include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk @@ -67,4 +67,4 @@ _JS_FILES = Async.js \ $(NULL) libs:: $(_JS_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/$(relativesrcdir) diff --git a/testing/mochitest/chrome/Makefile.in b/testing/mochitest/chrome/Makefile.in index e7018f2831f..c149531c88d 100644 --- a/testing/mochitest/chrome/Makefile.in +++ b/testing/mochitest/chrome/Makefile.in @@ -39,7 +39,7 @@ DEPTH = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ -relativesrcdir = testing/mochitest/chrome +relativesrcdir = chrome include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk @@ -53,4 +53,4 @@ _STATIC_FILES = test_sample.xul \ $(NULL) libs:: $(_STATIC_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/$(relativesrcdir) diff --git a/testing/mochitest/dynamic/Makefile.in b/testing/mochitest/dynamic/Makefile.in index 2376fa4e73a..e206a09165b 100644 --- a/testing/mochitest/dynamic/Makefile.in +++ b/testing/mochitest/dynamic/Makefile.in @@ -39,7 +39,7 @@ DEPTH = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ -relativesrcdir = testing/mochitest/dynamic +relativesrcdir = dynamic include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk @@ -49,4 +49,4 @@ _STATIC_FILES = \ $(NULL) libs:: $(_STATIC_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/$(relativesrcdir) diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py index 3fc079128c7..a80f76cec37 100644 --- a/testing/mochitest/runtests.py +++ b/testing/mochitest/runtests.py @@ -288,7 +288,7 @@ See for details on the logg if not os.path.exists(options.app): msg = """\ Error: Path %(app)s doesn't exist. - Are you executing $objdir/_tests/testing/mochitest/runtests.py?""" + Are you executing $objdir/_mochitest/runtests.py?""" print msg % {"app": options.app} return None diff --git a/testing/mochitest/specialpowers/Makefile.in b/testing/mochitest/specialpowers/Makefile.in index 7dafbf26619..502f16402ea 100644 --- a/testing/mochitest/specialpowers/Makefile.in +++ b/testing/mochitest/specialpowers/Makefile.in @@ -39,7 +39,7 @@ DEPTH = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ -relativesrcdir = testing/mochitest/specialpowers +relativesrcdir = specialpowers include $(DEPTH)/config/autoconf.mk @@ -57,7 +57,7 @@ XPI_NAME=specialpowers # Used in install.rdf USE_EXTENSION_MANIFEST=1 -TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions +TEST_EXTENSIONS_DIR = $(DEPTH)/${mochitestdir}/extensions include $(topsrcdir)/config/rules.mk diff --git a/testing/mochitest/static/Makefile.in b/testing/mochitest/static/Makefile.in index eeecc007b84..6b75e38f69b 100644 --- a/testing/mochitest/static/Makefile.in +++ b/testing/mochitest/static/Makefile.in @@ -39,7 +39,7 @@ DEPTH = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ -relativesrcdir = testing/mochitest/static +relativesrcdir = static include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk @@ -51,4 +51,4 @@ _STATIC_FILES = test.template.txt \ $(NULL) libs:: $(_STATIC_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/$(relativesrcdir) diff --git a/testing/mochitest/tests/Makefile.in b/testing/mochitest/tests/Makefile.in index 2e110a83e9b..42563f6701a 100644 --- a/testing/mochitest/tests/Makefile.in +++ b/testing/mochitest/tests/Makefile.in @@ -40,7 +40,7 @@ DEPTH = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ -relativesrcdir = testing/mochitest/tests +relativesrcdir = tests include $(DEPTH)/config/autoconf.mk @@ -71,4 +71,4 @@ endif # Copy the sanity tests into a subdirectory, so the top level is all dirs # in the test screen. libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/$(relativesrcdir)/Harness_sanity + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/$(relativesrcdir)/Harness_sanity diff --git a/testing/mochitest/tests/MochiKit-1.4.2/MochiKit/Makefile.in b/testing/mochitest/tests/MochiKit-1.4.2/MochiKit/Makefile.in index 6cbaca82840..68f103bdef7 100644 --- a/testing/mochitest/tests/MochiKit-1.4.2/MochiKit/Makefile.in +++ b/testing/mochitest/tests/MochiKit-1.4.2/MochiKit/Makefile.in @@ -40,7 +40,7 @@ DEPTH = ../../../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ -relativesrcdir = testing/mochitest/tests/MochiKit-1.4.2/MochiKit +relativesrcdir = tests/MochiKit-1.4.2/MochiKit include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk @@ -68,4 +68,4 @@ _MOCHIKIT_FILES = \ $(NULL) libs:: $(_MOCHIKIT_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/$(relativesrcdir) diff --git a/testing/mochitest/tests/MochiKit-1.4.2/tests/Makefile.in b/testing/mochitest/tests/MochiKit-1.4.2/tests/Makefile.in index 159b26887b3..3692792b7fd 100644 --- a/testing/mochitest/tests/MochiKit-1.4.2/tests/Makefile.in +++ b/testing/mochitest/tests/MochiKit-1.4.2/tests/Makefile.in @@ -40,7 +40,7 @@ DEPTH = ../../../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ -relativesrcdir = testing/mochitest/tests/MochiKit-1.4.2/tests +relativesrcdir = tests/MochiKit-1.4.2/tests include $(DEPTH)/config/autoconf.mk @@ -82,4 +82,4 @@ _TEST_FILES = \ # test_MochiKit-JSAN.html \ libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/$(relativesrcdir) diff --git a/testing/mochitest/tests/MochiKit-1.4.2/tests/SimpleTest/Makefile.in b/testing/mochitest/tests/MochiKit-1.4.2/tests/SimpleTest/Makefile.in index f02c694a6d3..6131ae9909e 100644 --- a/testing/mochitest/tests/MochiKit-1.4.2/tests/SimpleTest/Makefile.in +++ b/testing/mochitest/tests/MochiKit-1.4.2/tests/SimpleTest/Makefile.in @@ -44,7 +44,7 @@ DEPTH = ../../../../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ -relativesrcdir = testing/mochitest/tests/MochiKit-1.4.2/tests/SimpleTest +relativesrcdir = tests/MochiKit-1.4.2/tests/SimpleTest include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk @@ -54,4 +54,4 @@ _STUBS_FILES = \ $(NULL) libs:: $(_STUBS_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/$(relativesrcdir) diff --git a/testing/mochitest/tests/SimpleTest/Makefile.in b/testing/mochitest/tests/SimpleTest/Makefile.in index 87502e97b66..19d50535c57 100644 --- a/testing/mochitest/tests/SimpleTest/Makefile.in +++ b/testing/mochitest/tests/SimpleTest/Makefile.in @@ -38,7 +38,7 @@ DEPTH = ../../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ -relativesrcdir = testing/mochitest/tests/SimpleTest +relativesrcdir = tests/SimpleTest include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk @@ -58,5 +58,5 @@ _SIMPLETEST_FILES = MozillaLogger.js \ $(NULL) libs:: $(_SIMPLETEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/$(relativesrcdir) diff --git a/testing/mochitest/tests/browser/Makefile.in b/testing/mochitest/tests/browser/Makefile.in index a5a22df2798..2184c324c73 100644 --- a/testing/mochitest/tests/browser/Makefile.in +++ b/testing/mochitest/tests/browser/Makefile.in @@ -39,7 +39,7 @@ DEPTH = ../../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ -relativesrcdir = testing/mochitest/tests/browser +relativesrcdir = tests/browser include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk @@ -68,4 +68,4 @@ _BROWSER_TEST_FILES = \ $(NULL) libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/testing/testsuite-targets.mk b/testing/testsuite-targets.mk index e51169333ff..656cc33006d 100644 --- a/testing/testsuite-targets.mk +++ b/testing/testsuite-targets.mk @@ -57,13 +57,13 @@ mochitest:: $(MOCHITESTS) RUN_MOCHITEST = \ rm -f ./$@.log && \ - $(PYTHON) _tests/testing/mochitest/runtests.py --autorun --close-when-done \ + $(PYTHON) $(mochitestdir)/runtests.py --autorun --close-when-done \ --console-level=INFO --log-file=./$@.log --file-level=INFO \ $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS) RUN_MOCHITEST_REMOTE = \ rm -f ./$@.log && \ - $(PYTHON) _tests/testing/mochitest/runtestsremote.py --autorun --close-when-done \ + $(PYTHON) $(mochitestdir)/runtestsremote.py --autorun --close-when-done \ --console-level=INFO --log-file=./$@.log --file-level=INFO $(DM_FLAGS) --dm_trans=$(DM_TRANS) \ --app=$(ANDROID_PACKAGE_NAME) --deviceIP=${TEST_DEVICE} --xre-path=${MOZ_HOST_BIN} \ $(SYMBOLS_PATH) $(TEST_PATH_ARG) $(EXTRA_TEST_ARGS) diff --git a/toolkit/components/aboutmemory/tests/chrome/Makefile.in b/toolkit/components/aboutmemory/tests/chrome/Makefile.in index beec9f7b71d..79141e1667d 100644 --- a/toolkit/components/aboutmemory/tests/chrome/Makefile.in +++ b/toolkit/components/aboutmemory/tests/chrome/Makefile.in @@ -50,5 +50,5 @@ _CHROME_FILES = \ $(NULL) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/toolkit/components/alerts/test/Makefile.in b/toolkit/components/alerts/test/Makefile.in index 8cc1c369afe..80168907dbe 100644 --- a/toolkit/components/alerts/test/Makefile.in +++ b/toolkit/components/alerts/test/Makefile.in @@ -55,4 +55,4 @@ MOCHI_TESTS = \ include $(topsrcdir)/config/rules.mk libs:: $(MOCHI_TESTS) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/toolkit/components/ctypes/tests/Makefile.in b/toolkit/components/ctypes/tests/Makefile.in index 1d4b584a00e..e28cc2feb11 100644 --- a/toolkit/components/ctypes/tests/Makefile.in +++ b/toolkit/components/ctypes/tests/Makefile.in @@ -75,7 +75,7 @@ include $(topsrcdir)/config/rules.mk xpctestdir = $(testxpcobjdir)/$(relativesrcdir)/unit chrometestdir = \ - $(DEPTH)/_tests/testing/mochitest/chrome/toolkit/components/$(relativesrcdir) + $(DEPTH)/$(mochitestdir)/chrome/toolkit/components/$(relativesrcdir) # preprocess and install our unit test into the appropriate directory, # and install the test library as well. the xpcshell test rules will @@ -84,7 +84,7 @@ libs:: unit/test_jsctypes.js.in $(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) \ $^ > $(xpctestdir)/test_jsctypes.js $(INSTALL) $(SHARED_LIBRARY) $(xpctestdir) - $(INSTALL) $(SHARED_LIBRARY) $(DEPTH)/_tests/testing/mochitest/chrome/libraries + $(INSTALL) $(SHARED_LIBRARY) $(DEPTH)/$(mochitestdir)/chrome/libraries $(INSTALL) $(xpctestdir)/test_jsctypes.js $(chrometestdir) $(INSTALL) $(xpctestdir)/$(SHARED_LIBRARY) $(chrometestdir) $(RM) $(xpctestdir)/test_jsctypes.js.in diff --git a/toolkit/components/downloads/test/browser/Makefile.in b/toolkit/components/downloads/test/browser/Makefile.in index a894b3a8006..7499e1d00e6 100644 --- a/toolkit/components/downloads/test/browser/Makefile.in +++ b/toolkit/components/downloads/test/browser/Makefile.in @@ -50,4 +50,4 @@ _BROWSER_FILES = \ $(NULL) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/toolkit/components/feeds/test/Makefile.in b/toolkit/components/feeds/test/Makefile.in index 7d9490b4bdd..64239ae39b4 100644 --- a/toolkit/components/feeds/test/Makefile.in +++ b/toolkit/components/feeds/test/Makefile.in @@ -49,4 +49,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/toolkit/components/microformats/tests/Makefile.in b/toolkit/components/microformats/tests/Makefile.in index 9e1732237f8..36aa023f5f6 100644 --- a/toolkit/components/microformats/tests/Makefile.in +++ b/toolkit/components/microformats/tests/Makefile.in @@ -58,4 +58,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/tests/toolkit/components/microformats/tests + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/tests/toolkit/components/microformats/tests diff --git a/toolkit/components/passwordmgr/test/Makefile.in b/toolkit/components/passwordmgr/test/Makefile.in index f8fe444e87e..2bd124ce1bf 100644 --- a/toolkit/components/passwordmgr/test/Makefile.in +++ b/toolkit/components/passwordmgr/test/Makefile.in @@ -133,4 +133,4 @@ endif include $(topsrcdir)/config/rules.mk libs:: $(MOCHI_TESTS) $(MOCHI_CONTENT) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/toolkit/components/passwordmgr/test/browser/Makefile.in b/toolkit/components/passwordmgr/test/browser/Makefile.in index 9e6ae9f5c51..9eb88cdb193 100644 --- a/toolkit/components/passwordmgr/test/browser/Makefile.in +++ b/toolkit/components/passwordmgr/test/browser/Makefile.in @@ -52,4 +52,4 @@ _BROWSER_FILES = \ $(NULL) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/toolkit/components/perf/Makefile.in b/toolkit/components/perf/Makefile.in index e72fb6891d6..cee74dce9ea 100644 --- a/toolkit/components/perf/Makefile.in +++ b/toolkit/components/perf/Makefile.in @@ -65,7 +65,7 @@ _CHROME_TEST_FILES = \ $(NULL) chrometestdir = \ - $(DEPTH)/_tests/testing/mochitest/chrome/toolkit/components/$(MODULE) + $(DEPTH)/$(mochitestdir)/chrome/toolkit/components/$(MODULE) endif include $(topsrcdir)/config/rules.mk diff --git a/toolkit/components/places/tests/Makefile.in b/toolkit/components/places/tests/Makefile.in index ee0f8a309c7..baf5e93cb27 100644 --- a/toolkit/components/places/tests/Makefile.in +++ b/toolkit/components/places/tests/Makefile.in @@ -84,7 +84,7 @@ TOOL_DIRS = \ include $(topsrcdir)/config/rules.mk libs:: $(MOCHI_TESTS) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(XPCSHELL_TESTS_COMMON) $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/xpcshell/$(relativesrcdir) diff --git a/toolkit/components/places/tests/browser/Makefile.in b/toolkit/components/places/tests/browser/Makefile.in index 81c896bcc9a..a25fe597228 100644 --- a/toolkit/components/places/tests/browser/Makefile.in +++ b/toolkit/components/places/tests/browser/Makefile.in @@ -73,7 +73,7 @@ _HTTP_FILES = \ $(NULL) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) libs:: $(_HTTP_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/toolkit/components/places/tests/chrome/Makefile.in b/toolkit/components/places/tests/chrome/Makefile.in index 66fea3547be..ab7ac30c217 100644 --- a/toolkit/components/places/tests/chrome/Makefile.in +++ b/toolkit/components/places/tests/chrome/Makefile.in @@ -64,8 +64,8 @@ _CHROME_FILES = \ $(NULL) libs:: $(_HTTP_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/toolkit/components/places/tests/mochitest/bug_411966/Makefile.in b/toolkit/components/places/tests/mochitest/bug_411966/Makefile.in index 463faf9c161..7a3f09f9e26 100644 --- a/toolkit/components/places/tests/mochitest/bug_411966/Makefile.in +++ b/toolkit/components/places/tests/mochitest/bug_411966/Makefile.in @@ -56,4 +56,4 @@ _HTTP_FILES = \ $(NULL) libs:: $(_HTTP_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/toolkit/components/places/tests/mochitest/bug_461710/Makefile.in b/toolkit/components/places/tests/mochitest/bug_461710/Makefile.in index b459e1018c4..71d71962ba5 100644 --- a/toolkit/components/places/tests/mochitest/bug_461710/Makefile.in +++ b/toolkit/components/places/tests/mochitest/bug_461710/Makefile.in @@ -53,4 +53,4 @@ _HTTP_FILES = \ $(NULL) libs:: $(_HTTP_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/toolkit/components/prompts/test/Makefile.in b/toolkit/components/prompts/test/Makefile.in index de080233693..e8f4fc9ba73 100644 --- a/toolkit/components/prompts/test/Makefile.in +++ b/toolkit/components/prompts/test/Makefile.in @@ -64,4 +64,4 @@ MOCHI_CONTENT = \ include $(topsrcdir)/config/rules.mk libs:: $(MOCHI_TESTS) $(MOCHI_CONTENT) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/toolkit/components/satchel/test/Makefile.in b/toolkit/components/satchel/test/Makefile.in index 1349249b43d..41e78db6ca0 100644 --- a/toolkit/components/satchel/test/Makefile.in +++ b/toolkit/components/satchel/test/Makefile.in @@ -69,5 +69,5 @@ MOCHI_CONTENT = \ include $(topsrcdir)/config/rules.mk libs:: $(MOCHI_TESTS) $(MOCHI_CONTENT) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/toolkit/components/startup/tests/browser/Makefile.in b/toolkit/components/startup/tests/browser/Makefile.in index 9be8cf5ffcc..00940dc82aa 100644 --- a/toolkit/components/startup/tests/browser/Makefile.in +++ b/toolkit/components/startup/tests/browser/Makefile.in @@ -51,4 +51,4 @@ _BROWSER_FILES = \ $(NULL) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/toolkit/components/url-classifier/tests/mochitest/Makefile.in b/toolkit/components/url-classifier/tests/mochitest/Makefile.in index 6aa51bab102..e0d19bb3cd4 100644 --- a/toolkit/components/url-classifier/tests/mochitest/Makefile.in +++ b/toolkit/components/url-classifier/tests/mochitest/Makefile.in @@ -58,4 +58,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/toolkit/components/viewsource/test/Makefile.in b/toolkit/components/viewsource/test/Makefile.in index 2cf06728ac5..51c5baa8167 100644 --- a/toolkit/components/viewsource/test/Makefile.in +++ b/toolkit/components/viewsource/test/Makefile.in @@ -50,4 +50,4 @@ _CHROME_FILES = \ $(NULL) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/toolkit/content/tests/browser/Makefile.in b/toolkit/content/tests/browser/Makefile.in index 37c978860d6..75b2235307e 100644 --- a/toolkit/content/tests/browser/Makefile.in +++ b/toolkit/content/tests/browser/Makefile.in @@ -60,4 +60,4 @@ _BROWSER_TEST_FILES = \ $(NULL) libs:: $(_BROWSER_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/toolkit/content/tests/browser/common/Makefile.in b/toolkit/content/tests/browser/common/Makefile.in index 9d8e2f9be1a..b58b3ceb3fe 100644 --- a/toolkit/content/tests/browser/common/Makefile.in +++ b/toolkit/content/tests/browser/common/Makefile.in @@ -50,4 +50,4 @@ _COMMON_FILES = \ $(NULL) libs:: $(_COMMON_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/toolkit/content/tests/browser/data/Makefile.in b/toolkit/content/tests/browser/data/Makefile.in index 03b75cc2449..576bb2b3cca 100644 --- a/toolkit/content/tests/browser/data/Makefile.in +++ b/toolkit/content/tests/browser/data/Makefile.in @@ -50,4 +50,4 @@ _DATA_FILES = \ $(NULL) libs:: $(_DATA_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/toolkit/content/tests/chrome/Makefile.in b/toolkit/content/tests/chrome/Makefile.in index 9220e32b07e..bc46d59f1ad 100644 --- a/toolkit/content/tests/chrome/Makefile.in +++ b/toolkit/content/tests/chrome/Makefile.in @@ -203,4 +203,4 @@ _TEST_FILES += $(warning test_cursorsnap.xul temporarily disabled) \ endif libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/toolkit/content/tests/chrome/rtlchrome/Makefile.in b/toolkit/content/tests/chrome/rtlchrome/Makefile.in index 4fabaa851e4..103fbdcc312 100644 --- a/toolkit/content/tests/chrome/rtlchrome/Makefile.in +++ b/toolkit/content/tests/chrome/rtlchrome/Makefile.in @@ -45,6 +45,6 @@ include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk libs:: rtl.manifest rtl.css rtl.dtd - $(INSTALL) @srcdir@/rtl.manifest $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)/ - $(INSTALL) @srcdir@/rtl.css $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)/ - $(INSTALL) @srcdir@/rtl.dtd $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)/ + $(INSTALL) @srcdir@/rtl.manifest $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir)/ + $(INSTALL) @srcdir@/rtl.css $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir)/ + $(INSTALL) @srcdir@/rtl.dtd $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir)/ diff --git a/toolkit/content/tests/chrome/rtltest/Makefile.in b/toolkit/content/tests/chrome/rtltest/Makefile.in index 6bfec3fc203..56d585ef314 100644 --- a/toolkit/content/tests/chrome/rtltest/Makefile.in +++ b/toolkit/content/tests/chrome/rtltest/Makefile.in @@ -45,5 +45,5 @@ include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk libs:: righttoleft.manifest dirtest.xul - $(INSTALL) @srcdir@/righttoleft.manifest $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)/ - $(INSTALL) @srcdir@/dirtest.xul $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)/content/ + $(INSTALL) @srcdir@/righttoleft.manifest $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir)/ + $(INSTALL) @srcdir@/dirtest.xul $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir)/content/ diff --git a/toolkit/content/tests/widgets/Makefile.in b/toolkit/content/tests/widgets/Makefile.in index 9bf02061b49..8356a7514a8 100644 --- a/toolkit/content/tests/widgets/Makefile.in +++ b/toolkit/content/tests/widgets/Makefile.in @@ -87,11 +87,11 @@ _TEST_FILES += test_menubar.xul \ endif libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)/../chrome + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir)/../chrome libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) libs:: $(_CHROME_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/toolkit/crashreporter/test/Makefile.in b/toolkit/crashreporter/test/Makefile.in index 12553cd3b32..c2b9b5c5eac 100644 --- a/toolkit/crashreporter/test/Makefile.in +++ b/toolkit/crashreporter/test/Makefile.in @@ -90,7 +90,7 @@ _BROWSER_FILES = \ $(NULL) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)/browser + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir)/browser endif libs:: $(SHARED_LIBRARY) $(EXTRA_JS_MODULES) diff --git a/toolkit/mozapps/downloads/tests/chrome/Makefile.in b/toolkit/mozapps/downloads/tests/chrome/Makefile.in index 35114077bac..805d85ba09e 100644 --- a/toolkit/mozapps/downloads/tests/chrome/Makefile.in +++ b/toolkit/mozapps/downloads/tests/chrome/Makefile.in @@ -91,4 +91,4 @@ _CHROME_FILES += \ endif libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/toolkit/mozapps/extensions/test/browser/Makefile.in b/toolkit/mozapps/extensions/test/browser/Makefile.in index fc052ac7796..08ebca28aed 100644 --- a/toolkit/mozapps/extensions/test/browser/Makefile.in +++ b/toolkit/mozapps/extensions/test/browser/Makefile.in @@ -41,7 +41,7 @@ srcdir = @srcdir@ VPATH = @srcdir@ relativesrcdir = toolkit/mozapps/extensions/test/browser ADDONSRC = $(srcdir)/addons -TESTXPI = $(CURDIR)/$(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)/addons +TESTXPI = $(CURDIR)/$(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir)/addons include $(DEPTH)/config/autoconf.mk @@ -133,14 +133,14 @@ _TEST_RESOURCES = \ include $(topsrcdir)/config/rules.mk libs:: $(_MAIN_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)-window + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir)-window libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) libs:: $(_TEST_RESOURCES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) libs:: rm -rf $(TESTXPI) diff --git a/toolkit/mozapps/extensions/test/mochitest/Makefile.in b/toolkit/mozapps/extensions/test/mochitest/Makefile.in index 3476b63e988..293df06d98b 100644 --- a/toolkit/mozapps/extensions/test/mochitest/Makefile.in +++ b/toolkit/mozapps/extensions/test/mochitest/Makefile.in @@ -48,4 +48,4 @@ _TEST_FILES = test_bug609794.html \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/toolkit/mozapps/extensions/test/xpinstall/Makefile.in b/toolkit/mozapps/extensions/test/xpinstall/Makefile.in index 0e6c622bbbf..47a739dbd16 100644 --- a/toolkit/mozapps/extensions/test/xpinstall/Makefile.in +++ b/toolkit/mozapps/extensions/test/xpinstall/Makefile.in @@ -130,4 +130,4 @@ _BROWSER_FILES = head.js \ $(NULL) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) diff --git a/toolkit/mozapps/plugins/tests/Makefile.in b/toolkit/mozapps/plugins/tests/Makefile.in index 9c333f24869..534a0d114d2 100644 --- a/toolkit/mozapps/plugins/tests/Makefile.in +++ b/toolkit/mozapps/plugins/tests/Makefile.in @@ -44,7 +44,7 @@ include $(DEPTH)/config/autoconf.mk MODULE = test_plugins relativesrcdir = toolkit/mozapps/plugins/tests -TESTROOT = $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) +TESTROOT = $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) USE_STATIC_LIBS = 1 ifneq (mobile,$(MOZ_BUILD_APP)) diff --git a/toolkit/mozapps/shared/test/chrome/Makefile.in b/toolkit/mozapps/shared/test/chrome/Makefile.in index 634ec7eba98..1b83869cf15 100644 --- a/toolkit/mozapps/shared/test/chrome/Makefile.in +++ b/toolkit/mozapps/shared/test/chrome/Makefile.in @@ -50,4 +50,4 @@ _CHROME_FILES = \ include $(topsrcdir)/config/rules.mk libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/toolkit/mozapps/update/test/chrome/Makefile.in b/toolkit/mozapps/update/test/chrome/Makefile.in index eb6beb46266..68af4e6b4be 100644 --- a/toolkit/mozapps/update/test/chrome/Makefile.in +++ b/toolkit/mozapps/update/test/chrome/Makefile.in @@ -109,13 +109,13 @@ _CHROME_FILES = \ include $(topsrcdir)/config/rules.mk libs:: $(_OTHER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) libs:: $(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) $(srcdir)/utils.js > \ - $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)/utils.js + $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir)/utils.js $(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) $(srcdir)/update.sjs > \ - $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)/update.sjs + $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir)/update.sjs diff --git a/toolkit/profile/test/Makefile.in b/toolkit/profile/test/Makefile.in index f3509a41c5c..be3aa9a5355 100644 --- a/toolkit/profile/test/Makefile.in +++ b/toolkit/profile/test/Makefile.in @@ -49,6 +49,6 @@ _CHROME_FILES = \ $(NULL) libs:: $(_CHROME_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) include $(topsrcdir)/config/rules.mk diff --git a/toolkit/themes/pinstripe/mochitests/Makefile.in b/toolkit/themes/pinstripe/mochitests/Makefile.in index 911e69e3c45..b06ea3ad380 100644 --- a/toolkit/themes/pinstripe/mochitests/Makefile.in +++ b/toolkit/themes/pinstripe/mochitests/Makefile.in @@ -48,4 +48,4 @@ _TEST_FILES = test_bug510426.xul \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/toolkit/xre/test/Makefile.in b/toolkit/xre/test/Makefile.in index 48f278af67e..19e455eb2a4 100644 --- a/toolkit/xre/test/Makefile.in +++ b/toolkit/xre/test/Makefile.in @@ -55,4 +55,4 @@ MOCHITEST_FILES = \ include $(topsrcdir)/config/rules.mk libs:: $(MOCHITEST_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/uriloader/exthandler/tests/mochitest/Makefile.in b/uriloader/exthandler/tests/mochitest/Makefile.in index f96f33383e4..4795f86f867 100644 --- a/uriloader/exthandler/tests/mochitest/Makefile.in +++ b/uriloader/exthandler/tests/mochitest/Makefile.in @@ -53,4 +53,4 @@ _TEST_FILES = \ $(NULL) libs:: $(_TEST_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) diff --git a/widget/tests/Makefile.in b/widget/tests/Makefile.in index c6eb8563e14..e9a7bc21225 100644 --- a/widget/tests/Makefile.in +++ b/widget/tests/Makefile.in @@ -135,8 +135,8 @@ endif ifdef _TEST_FILES libs:: $(_TEST_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/tests/$(relativesrcdir) endif libs:: $(_CHROME_FILES) - $(INSTALL) $^ $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir) + $(INSTALL) $^ $(DEPTH)/$(mochitestdir)/chrome/$(relativesrcdir) diff --git a/xpinstall/tests/Makefile.in b/xpinstall/tests/Makefile.in index 3412f19ee3a..614acf64f37 100644 --- a/xpinstall/tests/Makefile.in +++ b/xpinstall/tests/Makefile.in @@ -104,5 +104,5 @@ _BROWSER_FILES = harness.js \ $(NULL) libs:: $(_BROWSER_FILES) - $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir) + $(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/$(mochitestdir)/browser/$(relativesrcdir) endif From fa93655e6ec4dc5520b111670f62f9d616044610 Mon Sep 17 00:00:00 2001 From: ABE Hiroki Date: Fri, 4 Nov 2011 21:26:53 +0000 Subject: [PATCH 054/127] Bug 675593 - Fix nspr4!1.pgc path mistake on NSPR PGO build (m-c part); r=ted --- Makefile.in | 2 ++ config/rules.mk | 4 ++-- js/src/config/rules.mk | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index 7b7a6535fdf..e87d4b477a2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -214,6 +214,8 @@ maybe_clobber_profiledbuild: endif else maybe_clobber_profiledbuild: + $(RM) $(DIST)/bin/*.pgc + find $(DIST)/$(MOZ_APP_NAME) -name "*.pgc" -exec mv {} $(DIST)/bin \; endif .PHONY: maybe_clobber_profiledbuild diff --git a/config/rules.mk b/config/rules.mk index 606b94ff1a2..01b64bda246 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -805,11 +805,11 @@ ifneq (,$(SHARED_LIBRARY)$(PROGRAM)) export:: ifdef PROGRAM $(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \ - $(PROGRAM:$(BIN_SUFFIX)=) $(DIST)/$(MOZ_APP_NAME) + $(PROGRAM:$(BIN_SUFFIX)=) $(DIST)/bin endif ifdef SHARED_LIBRARY $(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \ - $(SHARED_LIBRARY_NAME) $(DIST)/$(MOZ_APP_NAME) + $(SHARED_LIBRARY_NAME) $(DIST)/bin endif endif # SHARED_LIBRARY || PROGRAM endif # WINNT_ diff --git a/js/src/config/rules.mk b/js/src/config/rules.mk index 606b94ff1a2..01b64bda246 100644 --- a/js/src/config/rules.mk +++ b/js/src/config/rules.mk @@ -805,11 +805,11 @@ ifneq (,$(SHARED_LIBRARY)$(PROGRAM)) export:: ifdef PROGRAM $(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \ - $(PROGRAM:$(BIN_SUFFIX)=) $(DIST)/$(MOZ_APP_NAME) + $(PROGRAM:$(BIN_SUFFIX)=) $(DIST)/bin endif ifdef SHARED_LIBRARY $(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \ - $(SHARED_LIBRARY_NAME) $(DIST)/$(MOZ_APP_NAME) + $(SHARED_LIBRARY_NAME) $(DIST)/bin endif endif # SHARED_LIBRARY || PROGRAM endif # WINNT_ From 947169c171f15a0af11ece5531be90e235ddbfe0 Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Fri, 4 Nov 2011 14:45:01 -0700 Subject: [PATCH 055/127] Bug 691951: make startup notifications persist until the users close them (disable auto-dismissal), r=zpao --HG-- extra : transplant_source : %D5%A0r%9A%DA3%F0%C1%E1%00%03%C6%DC%E8Z%B9%1BU%8B%E7 --- browser/components/nsBrowserGlue.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index d851d67119b..6c68fb4c4f1 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -639,8 +639,8 @@ BrowserGlue.prototype = { var currentVersion = Services.prefs.getIntPref("browser.rights.version"); Services.prefs.setBoolPref("browser.rights." + currentVersion + ".shown", true); - var box = notifyBox.appendNotification(notifyRightsText, "about-rights", null, notifyBox.PRIORITY_INFO_LOW, buttons); - box.persistence = 3; // arbitrary number, just so bar sticks around for a bit + var notification = notifyBox.appendNotification(notifyRightsText, "about-rights", null, notifyBox.PRIORITY_INFO_LOW, buttons); + notification.persistence = -1; // Until user closes it }, _showUpdateNotification: function BG__showUpdateNotification() { @@ -709,10 +709,10 @@ BrowserGlue.prototype = { } ]; - let box = notifyBox.appendNotification(text, "post-update-notification", - null, notifyBox.PRIORITY_INFO_LOW, - buttons); - box.persistence = 3; + let notification = notifyBox.appendNotification(text, "post-update-notification", + null, notifyBox.PRIORITY_INFO_LOW, + buttons); + notification.persistence = -1; // Until user closes it } if (actions.indexOf("showAlert") == -1) @@ -815,7 +815,7 @@ BrowserGlue.prototype = { var notification = notifyBox.appendNotification(telemetryPrompt, "telemetry", null, notifyBox.PRIORITY_INFO_LOW, buttons); notification.setAttribute("hideclose", true); - notification.persistence = 6; // arbitrary number, just so bar sticks around for a bit + notification.persistence = -1; // Until user closes it let XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; let link = notification.ownerDocument.createElementNS(XULNS, "label"); @@ -827,8 +827,9 @@ BrowserGlue.prototype = { // Remove the notification on which the user clicked notification.parentNode.removeNotification(notification, true); // Add a new notification to that tab, with no "Learn more" link - var notifyBox = browser.getNotificationBox(); - notifyBox.appendNotification(telemetryPrompt, "telemetry", null, notifyBox.PRIORITY_INFO_LOW, buttons); + notifyBox = browser.getNotificationBox(); + notification = notifyBox.appendNotification(telemetryPrompt, "telemetry", null, notifyBox.PRIORITY_INFO_LOW, buttons); + notification.persistence = -1; // Until user closes it }, false); let description = notification.ownerDocument.getAnonymousElementByAttribute(notification, "anonid", "messageText"); description.appendChild(link); @@ -1092,10 +1093,10 @@ BrowserGlue.prototype = { ]; var notifyBox = browser.getNotificationBox(); - var box = notifyBox.appendNotification(text, title, null, - notifyBox.PRIORITY_CRITICAL_MEDIUM, - buttons); - box.persistence = -1; // Until user closes it + var notification = notifyBox.appendNotification(text, title, null, + notifyBox.PRIORITY_CRITICAL_MEDIUM, + buttons); + notification.persistence = -1; // Until user closes it }, _migrateUI: function BG__migrateUI() { From e48a72361af886bdeab4ce6a2189a88578b62945 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Fri, 4 Nov 2011 15:18:58 -0700 Subject: [PATCH 056/127] Back out bug 429592 because of Linux opt jsreftest failure --- modules/libpref/src/init/all.js | 8 - startupcache/test/TestStartupCache.cpp | 6 - toolkit/crashreporter/nsExceptionHandler.cpp | 31 +-- toolkit/crashreporter/nsExceptionHandler.h | 5 - widget/src/windows/nsAppShell.cpp | 3 - xpcom/build/nsXPComInit.cpp | 12 +- xpcom/threads/HangMonitor.cpp | 241 ------------------- xpcom/threads/HangMonitor.h | 67 ------ xpcom/threads/Makefile.in | 7 - xpcom/threads/nsThread.cpp | 24 +- xpcom/threads/nsThread.h | 9 +- xpcom/threads/nsThreadManager.cpp | 6 +- 12 files changed, 33 insertions(+), 386 deletions(-) delete mode 100644 xpcom/threads/HangMonitor.cpp delete mode 100644 xpcom/threads/HangMonitor.h diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index a326df35086..92ff6c1ae4e 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -1470,14 +1470,6 @@ pref("editor.positioning.offset", 0); pref("dom.max_chrome_script_run_time", 20); pref("dom.max_script_run_time", 10); -// Hang monitor timeout after which we kill the browser, in seconds -// (0 is disabled) -#ifndef DEBUG -pref("hangmonitor.timeout", 30); -#else -pref("hangmonitor.timeout", 0); -#endif - #ifndef DEBUG // How long a plugin is allowed to process a synchronous IPC message // before we consider it "hung". diff --git a/startupcache/test/TestStartupCache.cpp b/startupcache/test/TestStartupCache.cpp index f1d6655c231..73c44cc6e9b 100644 --- a/startupcache/test/TestStartupCache.cpp +++ b/startupcache/test/TestStartupCache.cpp @@ -51,8 +51,6 @@ #include "nsIObjectOutputStream.h" #include "nsIURI.h" #include "nsStringAPI.h" -#include "nsIPrefBranch.h" -#include "nsIPrefService.h" namespace mozilla { namespace scache { @@ -93,7 +91,6 @@ WaitForStartupTimer() { bool complete; while (true) { - NS_ProcessPendingEvents(nsnull); rv = sc->StartupWriteComplete(&complete); if (NS_FAILED(rv) || complete) @@ -322,9 +319,6 @@ int main(int argc, char** argv) int rv = 0; nsresult rv2; ScopedXPCOM xpcom("Startup Cache"); - - nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); - prefs->SetIntPref("hangmonitor.timeout", 0); if (NS_FAILED(TestStartupWriteRead())) rv = 1; diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index 7a33380d4ff..8dbf8b99533 100644 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -206,7 +206,6 @@ static const int kAvailableVirtualMemoryParameterLen = sizeof(kAvailableVirtualMemoryParameter)-1; // this holds additional data sent via the API -static Mutex* crashReporterAPILock; static AnnotationTable* crashReporterAPIData_Hash; static nsCString* crashReporterAPIData = nsnull; static nsCString* notesField = nsnull; @@ -619,9 +618,6 @@ nsresult SetExceptionHandler(nsILocalFile* aXREDirectory, crashReporterAPIData = new nsCString(); NS_ENSURE_TRUE(crashReporterAPIData, NS_ERROR_OUT_OF_MEMORY); - NS_ASSERTION(!crashReporterAPILock, "Shouldn't have a lock yet"); - crashReporterAPILock = new Mutex("crashReporterAPILock"); - crashReporterAPIData_Hash = new nsDataHashtable(); NS_ENSURE_TRUE(crashReporterAPIData_Hash, NS_ERROR_OUT_OF_MEMORY); @@ -1042,17 +1038,20 @@ nsresult UnsetExceptionHandler() // do this here in the unlikely case that we succeeded in allocating // our strings but failed to allocate gExceptionHandler. - delete crashReporterAPIData_Hash; - crashReporterAPIData_Hash = nsnull; + if (crashReporterAPIData_Hash) { + delete crashReporterAPIData_Hash; + crashReporterAPIData_Hash = nsnull; + } - delete crashReporterAPILock; - crashReporterAPILock = nsnull; + if (crashReporterAPIData) { + delete crashReporterAPIData; + crashReporterAPIData = nsnull; + } - delete crashReporterAPIData; - crashReporterAPIData = nsnull; - - delete notesField; - notesField = nsnull; + if (notesField) { + delete notesField; + notesField = nsnull; + } if (crashReporterPath) { NS_Free(crashReporterPath); @@ -1181,10 +1180,6 @@ nsresult AnnotateCrashReport(const nsACString& key, const nsACString& data) return rv; if (XRE_GetProcessType() != GeckoProcessType_Default) { - if (!NS_IsMainThread()) { - NS_ERROR("Cannot call AnnotateCrashReport in child processes from non-main thread."); - return NS_ERROR_FAILURE; - } PCrashReporterChild* reporter = CrashReporterChild::GetCrashReporter(); if (!reporter) { EnqueueDelayedNote(new DelayedNote(key, data)); @@ -1195,8 +1190,6 @@ nsresult AnnotateCrashReport(const nsACString& key, const nsACString& data) return NS_OK; } - MutexAutoLock lock(*crashReporterAPILock); - rv = crashReporterAPIData_Hash->Put(key, escapedData); NS_ENSURE_SUCCESS(rv, rv); diff --git a/toolkit/crashreporter/nsExceptionHandler.h b/toolkit/crashreporter/nsExceptionHandler.h index a8b5a9b9b74..4cda5204bea 100644 --- a/toolkit/crashreporter/nsExceptionHandler.h +++ b/toolkit/crashreporter/nsExceptionHandler.h @@ -64,12 +64,7 @@ bool GetServerURL(nsACString& aServerURL); nsresult SetServerURL(const nsACString& aServerURL); bool GetMinidumpPath(nsAString& aPath); nsresult SetMinidumpPath(const nsAString& aPath); - - -// AnnotateCrashReport may be called from any thread in a chrome process, -// but may only be called from the main thread in a content process. nsresult AnnotateCrashReport(const nsACString& key, const nsACString& data); - nsresult AppendAppNotesToCrashReport(const nsACString& data); nsresult SetRestartArgs(int argc, char** argv); nsresult SetupExtraData(nsILocalFile* aAppDataDirectory, diff --git a/widget/src/windows/nsAppShell.cpp b/widget/src/windows/nsAppShell.cpp index 6037c81a2e6..906da808cea 100644 --- a/widget/src/windows/nsAppShell.cpp +++ b/widget/src/windows/nsAppShell.cpp @@ -46,7 +46,6 @@ #include "nsString.h" #include "nsIMM32Handler.h" #include "mozilla/widget/AudioSession.h" -#include "mozilla/HangMonitor.h" // For skidmark code #include @@ -339,13 +338,11 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait) ::PostQuitMessage(msg.wParam); Exit(); } else { - mozilla::HangMonitor::NotifyActivity(); ::TranslateMessage(&msg); ::DispatchMessageW(&msg); } } else if (mayWait) { // Block and wait for any posted application message - mozilla::HangMonitor::Suspend(); ::WaitMessage(); } } while (!gotMessage && mayWait); diff --git a/xpcom/build/nsXPComInit.cpp b/xpcom/build/nsXPComInit.cpp index 4150a32006c..d8ad19a0d80 100644 --- a/xpcom/build/nsXPComInit.cpp +++ b/xpcom/build/nsXPComInit.cpp @@ -139,7 +139,6 @@ extern nsresult nsStringInputStreamConstructor(nsISupports *, REFNSIID, void **) #include "mozilla/Services.h" #include "mozilla/FunctionTimer.h" #include "mozilla/Omnijar.h" -#include "mozilla/HangMonitor.h" #include "nsChromeRegistry.h" #include "nsChromeProtocolHandler.h" @@ -531,8 +530,6 @@ NS_InitXPCOM2(nsIServiceManager* *result, mozilla::MapsMemoryReporter::Init(); - mozilla::HangMonitor::Startup(); - return NS_OK; } @@ -569,9 +566,6 @@ namespace mozilla { nsresult ShutdownXPCOM(nsIServiceManager* servMgr) { - // Make sure the hang monitor is enabled for shutdown. - HangMonitor::NotifyActivity(); - NS_ENSURE_STATE(NS_IsMainThread()); nsresult rv; @@ -629,8 +623,6 @@ ShutdownXPCOM(nsIServiceManager* servMgr) NS_ProcessPendingEvents(thread); - HangMonitor::NotifyActivity(); - // We save the "xpcom-shutdown-loaders" observers to notify after // the observerservice is gone. if (observerService) { @@ -740,9 +732,7 @@ ShutdownXPCOM(nsIServiceManager* servMgr) sExitManager = nsnull; } - Omnijar::CleanUp(); - - HangMonitor::Shutdown(); + mozilla::Omnijar::CleanUp(); NS_LogTerm(); diff --git a/xpcom/threads/HangMonitor.cpp b/xpcom/threads/HangMonitor.cpp deleted file mode 100644 index bbe2932dbbb..00000000000 --- a/xpcom/threads/HangMonitor.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Firefox. - * - * The Initial Developer of the Original Code is - * the Mozilla Foundation . - * Portions created by the Initial Developer are Copyright (C) 2011 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "mozilla/HangMonitor.h" -#include "mozilla/Monitor.h" -#include "mozilla/Preferences.h" -#include "nsXULAppAPI.h" -#include "nsThreadUtils.h" - -#ifdef MOZ_CRASHREPORTER -#include "nsExceptionHandler.h" -#endif - -#ifdef XP_WIN -#include -#endif - -namespace mozilla { namespace HangMonitor { - -/** - * A flag which may be set from within a debugger to disable the hang - * monitor. - */ -volatile bool gDebugDisableHangMonitor = false; - -const char kHangMonitorPrefName[] = "hangmonitor.timeout"; - -// Monitor protects gShutdown and gTimeout, but not gTimestamp which rely on -// being atomically set by the processor; synchronization doesn't really matter -// in this use case. -Monitor* gMonitor; - -// The timeout preference, in seconds. -PRInt32 gTimeout; - -PRThread* gThread; - -// Set when shutdown begins to signal the thread to exit immediately. -bool gShutdown; - -// The timestamp of the last event notification, or PR_INTERVAL_NO_WAIT if -// we're currently not processing events. -volatile PRIntervalTime gTimestamp; - -// PrefChangedFunc -int -PrefChanged(const char*, void*) -{ - PRInt32 newval = Preferences::GetInt(kHangMonitorPrefName); - MonitorAutoLock lock(*gMonitor); - if (newval != gTimeout) { - gTimeout = newval; - lock.Notify(); - } - - return 0; -} - -void -Crash() -{ - if (gDebugDisableHangMonitor) { - return; - } - -#ifdef XP_WIN - if (::IsDebuggerPresent()) { - return; - } -#endif - -#ifdef MOZ_CRASHREPORTER - CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("Hang"), - NS_LITERAL_CSTRING("1")); -#endif - - NS_RUNTIMEABORT("HangMonitor triggered"); -} - -void -ThreadMain(void*) -{ - MonitorAutoLock lock(*gMonitor); - - // In order to avoid issues with the hang monitor incorrectly triggering - // during a general system stop such as sleeping, the monitor thread must - // run twice to trigger hang protection. - PRIntervalTime lastTimestamp = 0; - int waitCount = 0; - - while (true) { - if (gShutdown) { - return; // Exit the thread - } - - // avoid rereading the volatile value in this loop - PRIntervalTime timestamp = gTimestamp; - - PRIntervalTime now = PR_IntervalNow(); - - if (timestamp != PR_INTERVAL_NO_WAIT && - now < timestamp) { - // 32-bit overflow, reset for another waiting period - timestamp = 1; // lowest legal PRInterval value - } - - if (timestamp != PR_INTERVAL_NO_WAIT && - timestamp == lastTimestamp && - gTimeout > 0) { - ++waitCount; - if (waitCount == 2) { - PRInt32 delay = - PRInt32(PR_IntervalToSeconds(now - timestamp)); - if (delay > gTimeout) { - MonitorAutoUnlock unlock(*gMonitor); - Crash(); - } - } - } - else { - lastTimestamp = timestamp; - waitCount = 0; - } - - PRIntervalTime timeout; - if (gTimeout <= 0) { - timeout = PR_INTERVAL_NO_TIMEOUT; - } - else { - timeout = PR_MillisecondsToInterval(gTimeout * 500); - } - lock.Wait(timeout); - } -} - -void -Startup() -{ - // The hang detector only runs in chrome processes. If you change this, - // you must also deal with the threadsafety of AnnotateCrashReport in - // non-chrome processes! - if (GeckoProcessType_Default != XRE_GetProcessType()) - return; - - NS_ASSERTION(!gMonitor, "Hang monitor already initialized"); - gMonitor = new Monitor("HangMonitor"); - - Preferences::RegisterCallback(PrefChanged, kHangMonitorPrefName, NULL); - PrefChanged(NULL, NULL); - - // Don't actually start measuring hangs until we hit the main event loop. - // This potentially misses a small class of really early startup hangs, - // but avoids dealing with some xpcshell tests and other situations which - // start XPCOM but don't ever start the event loop. - Suspend(); - - gThread = PR_CreateThread(PR_USER_THREAD, - ThreadMain, - NULL, PR_PRIORITY_LOW, PR_GLOBAL_THREAD, - PR_JOINABLE_THREAD, 0); -} - -void -Shutdown() -{ - if (GeckoProcessType_Default != XRE_GetProcessType()) - return; - - NS_ASSERTION(gMonitor, "Hang monitor not started"); - - { // Scope the lock we're going to delete later - MonitorAutoLock lock(*gMonitor); - gShutdown = true; - lock.Notify(); - } - - // thread creation could theoretically fail - if (gThread) { - PR_JoinThread(gThread); - gThread = NULL; - } - - delete gMonitor; - gMonitor = NULL; -} - -void -NotifyActivity() -{ - NS_ASSERTION(NS_IsMainThread(), "HangMonitor::Notify called from off the main thread."); - - // This is not a locked activity because PRTimeStamp is a 32-bit quantity - // which can be read/written atomically, and we don't want to pay locking - // penalties here. - gTimestamp = PR_IntervalNow(); -} - -void -Suspend() -{ - NS_ASSERTION(NS_IsMainThread(), "HangMonitor::Suspend called from off the main thread."); - - // Because gTimestamp changes this resets the wait count. - gTimestamp = PR_INTERVAL_NO_WAIT; -} - -} } // namespace mozilla::HangMonitor diff --git a/xpcom/threads/HangMonitor.h b/xpcom/threads/HangMonitor.h deleted file mode 100644 index b6f859fe8ce..00000000000 --- a/xpcom/threads/HangMonitor.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Firefox. - * - * The Initial Developer of the Original Code is - * the Mozilla Foundation . - * Portions created by the Initial Developer are Copyright (C) 2011 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#ifndef mozilla_HangMonitor_h -#define mozilla_HangMonitor_h - -namespace mozilla { namespace HangMonitor { - -/** - * Start monitoring hangs. Should be called by the XPCOM startup process only. - */ -void Startup(); - -/** - * Stop monitoring hangs and join the thread. - */ -void Shutdown(); - -/** - * Notify the hang monitor of new activity which should reset its internal - * timer. - */ -void NotifyActivity(); - -/** - * Notify the hang monitor that the browser is now idle and no detection should - * be done. - */ -void Suspend(); - -} } // namespace mozilla::HangMonitor - -#endif // mozilla_HangMonitor_h diff --git a/xpcom/threads/Makefile.in b/xpcom/threads/Makefile.in index 915e7f23783..82214d2ab78 100644 --- a/xpcom/threads/Makefile.in +++ b/xpcom/threads/Makefile.in @@ -47,9 +47,7 @@ XPIDL_MODULE = xpcom_threads LIBRARY_NAME = xpcomthreads_s GRE_MODULE = 1 MOZILLA_INTERNAL_API = 1 -LIBXUL_LIBRARY = 1 -EXPORTS_NAMESPACES = mozilla CPPSRCS = \ nsEventQueue.cpp \ @@ -60,7 +58,6 @@ CPPSRCS = \ nsProcessCommon.cpp \ nsTimerImpl.cpp \ TimerThread.cpp \ - HangMonitor.cpp \ $(NULL) EXPORTS = \ @@ -69,10 +66,6 @@ EXPORTS = \ nsThreadUtilsInternal.h \ $(NULL) -EXPORTS_mozilla = \ - HangMonitor.h \ - $(NULL) - XPIDLSRCS = \ nsIEventTarget.idl \ nsIThread.idl \ diff --git a/xpcom/threads/nsThread.cpp b/xpcom/threads/nsThread.cpp index 50214fa6dc6..0f33f9a01b3 100644 --- a/xpcom/threads/nsThread.cpp +++ b/xpcom/threads/nsThread.cpp @@ -45,7 +45,6 @@ #include "nsCOMPtr.h" #include "prlog.h" #include "nsThreadUtilsInternal.h" -#include "mozilla/HangMonitor.h" #define HAVE_UALARM _BSD_SOURCE || (_XOPEN_SOURCE >= 500 || \ _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) && \ @@ -307,7 +306,20 @@ nsThread::ThreadFunc(void *arg) //----------------------------------------------------------------------------- -nsThread::nsThread(MainThreadFlag aMainThread, PRUint32 aStackSize) +nsThread::nsThread() + : mLock("nsThread.mLock") + , mEvents(&mEventsRoot) + , mPriority(PRIORITY_NORMAL) + , mThread(nsnull) + , mRunningEvent(0) + , mStackSize(0) + , mShutdownContext(nsnull) + , mShutdownRequired(false) + , mEventsAreDoomed(false) +{ +} + +nsThread::nsThread(PRUint32 aStackSize) : mLock("nsThread.mLock") , mEvents(&mEventsRoot) , mPriority(PRIORITY_NORMAL) @@ -317,7 +329,6 @@ nsThread::nsThread(MainThreadFlag aMainThread, PRUint32 aStackSize) , mShutdownContext(nsnull) , mShutdownRequired(false) , mEventsAreDoomed(false) - , mIsMainThread(aMainThread) { } @@ -574,9 +585,6 @@ nsThread::ProcessNextEvent(bool mayWait, bool *result) NS_ENSURE_STATE(PR_GetCurrentThread() == mThread); - if (MAIN_THREAD == mIsMainThread && mayWait && !ShuttingDown()) - HangMonitor::Suspend(); - bool notifyGlobalObserver = (sGlobalObserver != nsnull); if (notifyGlobalObserver) sGlobalObserver->OnProcessNextEvent(this, mayWait && !ShuttingDown(), @@ -607,7 +615,7 @@ nsThread::ProcessNextEvent(bool mayWait, bool *result) #ifdef NS_FUNCTION_TIMER char message[1024] = {'\0'}; - if (MAIN_THREAD == mIsMainThread) { + if (NS_IsMainThread()) { mozilla::FunctionTimer::ft_snprintf(message, sizeof(message), "@ Main Thread Event %p", (void*)event.get()); } @@ -620,8 +628,6 @@ nsThread::ProcessNextEvent(bool mayWait, bool *result) if (event) { LOG(("THRD(%p) running [%p]\n", this, event.get())); - if (MAIN_THREAD == mIsMainThread) - HangMonitor::NotifyActivity(); event->Run(); } else if (mayWait) { NS_ASSERTION(ShuttingDown(), diff --git a/xpcom/threads/nsThread.h b/xpcom/threads/nsThread.h index 83009a7a3be..750b33cce5f 100644 --- a/xpcom/threads/nsThread.h +++ b/xpcom/threads/nsThread.h @@ -57,12 +57,8 @@ public: NS_DECL_NSITHREADINTERNAL NS_DECL_NSISUPPORTSPRIORITY - enum MainThreadFlag { - MAIN_THREAD, - NOT_MAIN_THREAD - }; - - nsThread(MainThreadFlag aMainThread, PRUint32 aStackSize); + nsThread(); + nsThread(PRUint32 aStackSize); // Initialize this as a wrapper for a new PRThread. nsresult Init(); @@ -151,7 +147,6 @@ private: bool mShutdownPending; // Set to true when events posted to this thread will never run. bool mEventsAreDoomed; - MainThreadFlag mIsMainThread; }; //----------------------------------------------------------------------------- diff --git a/xpcom/threads/nsThreadManager.cpp b/xpcom/threads/nsThreadManager.cpp index 0cd4f737098..9524cc99b73 100644 --- a/xpcom/threads/nsThreadManager.cpp +++ b/xpcom/threads/nsThreadManager.cpp @@ -98,7 +98,7 @@ nsThreadManager::Init() mLock = new Mutex("nsThreadManager.mLock"); // Setup "main" thread - mMainThread = new nsThread(nsThread::MAIN_THREAD, 0); + mMainThread = new nsThread(); if (!mMainThread) return NS_ERROR_OUT_OF_MEMORY; @@ -224,7 +224,7 @@ nsThreadManager::GetCurrentThread() } // OK, that's fine. We'll dynamically create one :-) - nsRefPtr thread = new nsThread(nsThread::NOT_MAIN_THREAD, 0); + nsRefPtr thread = new nsThread(); if (!thread || NS_FAILED(thread->InitCurrentThread())) return nsnull; @@ -239,7 +239,7 @@ nsThreadManager::NewThread(PRUint32 creationFlags, // No new threads during Shutdown NS_ENSURE_TRUE(mInitialized, NS_ERROR_NOT_INITIALIZED); - nsThread *thr = new nsThread(nsThread::NOT_MAIN_THREAD, stackSize); + nsThread *thr = new nsThread(stackSize); if (!thr) return NS_ERROR_OUT_OF_MEMORY; NS_ADDREF(thr); From 57bab392eb19626de27308a244dc6875b4755852 Mon Sep 17 00:00:00 2001 From: Taras Glek Date: Fri, 4 Nov 2011 15:19:45 -0700 Subject: [PATCH 057/127] Bug 699942: Telemetry Yes->Yes, I want to help r=geekboy --- browser/locales/en-US/chrome/browser/browser.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/locales/en-US/chrome/browser/browser.properties b/browser/locales/en-US/chrome/browser/browser.properties index a282acb0ecf..0a4435ec993 100644 --- a/browser/locales/en-US/chrome/browser/browser.properties +++ b/browser/locales/en-US/chrome/browser/browser.properties @@ -331,7 +331,7 @@ syncPromoNotification.learnMoreLinkText=Learn More # and %2$S by the value of the toolkit.telemetry.server_owner preference. telemetryPrompt = Will you help improve %1$S by sending anonymous information about performance, hardware characteristics, feature usage, and browser customizations to %2$S? telemetryLinkLabel = Learn More -telemetryYesButtonLabel = Yes +telemetryYesButtonLabel = Yes, I want to help telemetryYesButtonAccessKey = Y telemetryNoButtonLabel = No telemetryNoButtonAccessKey = N From dae954f4e77e07f469970bee2cec94ede9cde9bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Fri, 4 Nov 2011 18:27:59 -0400 Subject: [PATCH 058/127] Bug 697989 - don't use domstorage-flush-timer test_bug624047.html. r=mak77. Use a new domstorage-flush-force message for testing calling FlushAndDeleteTemporaryTables with a 'true' argument. We want to add more work to profile-before-change and that would interfere with the testing in dom/tests/mochitest/localstorage/test_bug624047.html. Also move the NS_DOMSTORAGE_FLUSH_TIMER_OBSERVER define to the .cpp file since that is the only place it is used and rename it to end in _TOPIC. --- dom/src/storage/nsDOMStorage.cpp | 19 ++++++++++++++++--- dom/src/storage/nsDOMStorage.h | 2 -- .../localstorage/test_bug624047.html | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/dom/src/storage/nsDOMStorage.cpp b/dom/src/storage/nsDOMStorage.cpp index 0ad2a3fd359..9de9633ec36 100644 --- a/dom/src/storage/nsDOMStorage.cpp +++ b/dom/src/storage/nsDOMStorage.cpp @@ -74,6 +74,12 @@ using mozilla::dom::StorageChild; #include "mozilla/Preferences.h" #include "nsThreadUtils.h" +// calls FlushAndDeleteTemporaryTables(false) +#define NS_DOMSTORAGE_FLUSH_TIMER_TOPIC "domstorage-flush-timer" + +// calls FlushAndDeleteTemporaryTables(true) +#define NS_DOMSTORAGE_FLUSH_FORCE_TOPIC "domstorage-flush-force" + using namespace mozilla; static const PRUint32 ASK_BEFORE_ACCEPT = 1; @@ -290,7 +296,7 @@ nsDOMStorageManager::Initialize() // Used for temporary table flushing os->AddObserver(gStorageManager, "profile-before-change", false); os->AddObserver(gStorageManager, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false); - os->AddObserver(gStorageManager, NS_DOMSTORAGE_FLUSH_TIMER_OBSERVER, false); + os->AddObserver(gStorageManager, NS_DOMSTORAGE_FLUSH_TIMER_TOPIC, false); return NS_OK; } @@ -440,7 +446,7 @@ nsDOMStorageManager::Observe(nsISupports *aSubject, } else if (!strcmp(aTopic, "timer-callback")) { nsCOMPtr obsserv = mozilla::services::GetObserverService(); if (obsserv) - obsserv->NotifyObservers(nsnull, NS_DOMSTORAGE_FLUSH_TIMER_OBSERVER, nsnull); + obsserv->NotifyObservers(nsnull, NS_DOMSTORAGE_FLUSH_TIMER_TOPIC, nsnull); } else if (!strcmp(aTopic, "browser:purge-domain-data")) { // Convert the domain name to the ACE format nsCAutoString aceDomain; @@ -475,13 +481,20 @@ nsDOMStorageManager::Observe(nsISupports *aSubject, NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "DOMStorage: temporary table commit failed"); } - } else if (!strcmp(aTopic, NS_DOMSTORAGE_FLUSH_TIMER_OBSERVER)) { + } else if (!strcmp(aTopic, NS_DOMSTORAGE_FLUSH_TIMER_TOPIC)) { if (DOMStorageImpl::gStorageDB) { DebugOnly rv = DOMStorageImpl::gStorageDB->FlushAndDeleteTemporaryTables(false); NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "DOMStorage: temporary table commit failed"); } + } else if (!strcmp(aTopic, NS_DOMSTORAGE_FLUSH_FORCE_TOPIC)) { + if (DOMStorageImpl::gStorageDB) { + DebugOnly rv = + DOMStorageImpl::gStorageDB->FlushAndDeleteTemporaryTables(true); + NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), + "DOMStorage: temporary table commit failed"); + } } return NS_OK; diff --git a/dom/src/storage/nsDOMStorage.h b/dom/src/storage/nsDOMStorage.h index da9ac08ff04..737cc00fc0d 100644 --- a/dom/src/storage/nsDOMStorage.h +++ b/dom/src/storage/nsDOMStorage.h @@ -62,8 +62,6 @@ #include "nsITimer.h" #include "nsWeakReference.h" -#define NS_DOMSTORAGE_FLUSH_TIMER_OBSERVER "domstorage-flush-timer" - #include "nsDOMStorageDBWrapper.h" #define IS_PERMISSION_ALLOWED(perm) \ diff --git a/dom/tests/mochitest/localstorage/test_bug624047.html b/dom/tests/mochitest/localstorage/test_bug624047.html index c81eff272e7..c071fd58b48 100644 --- a/dom/tests/mochitest/localstorage/test_bug624047.html +++ b/dom/tests/mochitest/localstorage/test_bug624047.html @@ -24,7 +24,7 @@ function flushTables() netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var storageManager = Components.classes["@mozilla.org/dom/storagemanager;1"] .getService(Components.interfaces.nsIObserver); - storageManager.observe(null, "profile-before-change", null); + storageManager.observe(null, "domstorage-flush-force", null); } function startTest() From aca30c33aee21ee8b8f6bf5ea32b505498939da7 Mon Sep 17 00:00:00 2001 From: Tom Schuster Date: Fri, 4 Nov 2011 23:49:56 +0100 Subject: [PATCH 059/127] no bug - Add 0 add the end of a char array rs=waldo --HG-- extra : rebase_source : f0f7051cbb7842da215bf3163db49c68ada60bc3 --- js/src/jsopcode.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/js/src/jsopcode.cpp b/js/src/jsopcode.cpp index 5f76e63a8de..573f027bd0f 100644 --- a/js/src/jsopcode.cpp +++ b/js/src/jsopcode.cpp @@ -804,6 +804,7 @@ const char js_EscapeMap[] = { '"', '"', '\'', '\'', '\\', '\\', + '\0' }; #define DONT_ESCAPE 0x10000 From 5cb9f62045afb94f972798c78d1f044b82637831 Mon Sep 17 00:00:00 2001 From: Marco Bonardo Date: Sat, 5 Nov 2011 00:41:47 +0100 Subject: [PATCH 060/127] Bug 691512 - CreateStatement misuse in AddonRepository.jsm. r=mossop --- .../mozapps/extensions/AddonRepository.jsm | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/toolkit/mozapps/extensions/AddonRepository.jsm b/toolkit/mozapps/extensions/AddonRepository.jsm index 1f6b4d9e01c..53d526fe390 100644 --- a/toolkit/mozapps/extensions/AddonRepository.jsm +++ b/toolkit/mozapps/extensions/AddonRepository.jsm @@ -1290,10 +1290,10 @@ var AddonDatabase = { // false if there was an unrecoverable error openning the database databaseOk: true, // A cache of statements that are used and need to be finalized on shutdown - statementCache: {}, + asyncStatementsCache: {}, - // The statements used by the database - statements: { + // The queries used by the database + queries: { getAllAddons: "SELECT internal_id, id, type, name, version, " + "creator, creatorURL, description, fullDescription, " + "developerComments, eula, iconURL, homepageURL, supportURL, " + @@ -1445,9 +1445,9 @@ var AddonDatabase = { this.initialized = false; - for each (let stmt in this.statementCache) + for each (let stmt in this.asyncStatementsCache) stmt.finalize(); - this.statementCache = {}; + this.asyncStatementsCache = {}; if (this.connection.transactionInProgress) { ERROR("Outstanding transaction, rolling back."); @@ -1485,20 +1485,21 @@ var AddonDatabase = { }, /** - * Gets a cached statement or creates a new statement if it doesn't already - * exist. + * Gets a cached async statement or creates a new statement if it doesn't + * already exist. * * @param aKey * A unique key to reference the statement - * @return a mozIStorageStatement for the SQL corresponding to the unique key + * @return a mozIStorageAsyncStatement for the SQL corresponding to the + * unique key */ - getStatement: function AD_getStatement(aKey) { - if (aKey in this.statementCache) - return this.statementCache[aKey]; + getAsyncStatement: function AD_getAsyncStatement(aKey) { + if (aKey in this.asyncStatementsCache) + return this.asyncStatementsCache[aKey]; - let sql = this.statements[aKey]; + let sql = this.queries[aKey]; try { - return this.statementCache[aKey] = this.connection.createStatement(sql); + return this.asyncStatementsCache[aKey] = this.connection.createAsyncStatement(sql); } catch (e) { ERROR("Error creating statement " + aKey + " (" + sql + ")"); throw e; @@ -1518,7 +1519,7 @@ var AddonDatabase = { // Retrieve all data from the addon table function getAllAddons() { - self.getStatement("getAllAddons").executeAsync({ + self.getAsyncStatement("getAllAddons").executeAsync({ handleResult: function(aResults) { let row = null; while (row = aResults.getNextRow()) { @@ -1543,7 +1544,7 @@ var AddonDatabase = { // Retrieve all data from the developer table function getAllDevelopers() { - self.getStatement("getAllDevelopers").executeAsync({ + self.getAsyncStatement("getAllDevelopers").executeAsync({ handleResult: function(aResults) { let row = null; while (row = aResults.getNextRow()) { @@ -1577,7 +1578,7 @@ var AddonDatabase = { // Retrieve all data from the screenshot table function getAllScreenshots() { - self.getStatement("getAllScreenshots").executeAsync({ + self.getAsyncStatement("getAllScreenshots").executeAsync({ handleResult: function(aResults) { let row = null; while (row = aResults.getNextRow()) { @@ -1628,7 +1629,7 @@ var AddonDatabase = { let self = this; // Completely empty the database - let stmts = [this.getStatement("emptyAddon")]; + let stmts = [this.getAsyncStatement("emptyAddon")]; this.connection.executeAsync(stmts, stmts.length, { handleResult: function() {}, @@ -1694,7 +1695,7 @@ var AddonDatabase = { if (!aArray || aArray.length == 0) return; - let stmt = self.getStatement(aStatementKey); + let stmt = self.getAsyncStatement(aStatementKey); let params = stmt.newBindingParamsArray(); aArray.forEach(function(aElement, aIndex) { aAddParams(params, internal_id, aElement, aIndex); @@ -1761,7 +1762,7 @@ var AddonDatabase = { * @return The asynchronous mozIStorageStatement */ _makeAddonStatement: function AD__makeAddonStatement(aAddon) { - let stmt = this.getStatement("insertAddon"); + let stmt = this.getAsyncStatement("insertAddon"); let params = stmt.params; PROP_SINGLE.forEach(function(aProperty) { From 9bb8ebd1a172e5f17e97be8f5fd0a1cfc9d0fab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Fri, 4 Nov 2011 16:46:34 -0700 Subject: [PATCH 061/127] Bug 694795 - Black rectangle in top left corner after opening a link from another app [r=mbrubeck] --- embedding/android/GeckoApp.java | 12 +++++++++--- embedding/android/GeckoAppShell.java | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/embedding/android/GeckoApp.java b/embedding/android/GeckoApp.java index 58b46bbe09f..3945e6ad28d 100644 --- a/embedding/android/GeckoApp.java +++ b/embedding/android/GeckoApp.java @@ -399,9 +399,6 @@ abstract public class GeckoApp 0, 0)); - // Some phones (eg. nexus S) need at least a 8x16 preview size - mainLayout.addView(cameraView, new AbsoluteLayout.LayoutParams(8, 16, 0, 0)); - setContentView(mainLayout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT)); @@ -435,6 +432,15 @@ abstract public class GeckoApp mLibLoadThread.start(); } + public void enableCameraView() { + // Some phones (eg. nexus S) need at least a 8x16 preview size + mainLayout.addView(cameraView, new AbsoluteLayout.LayoutParams(8, 16, 0, 0)); + } + + public void disableCameraView() { + mainLayout.removeView(cameraView); + } + @Override protected void onNewIntent(Intent intent) { if (checkLaunchState(LaunchState.GeckoExiting)) { diff --git a/embedding/android/GeckoAppShell.java b/embedding/android/GeckoAppShell.java index e7bbcde75d3..78c88ad52d2 100644 --- a/embedding/android/GeckoAppShell.java +++ b/embedding/android/GeckoAppShell.java @@ -1475,6 +1475,14 @@ public class GeckoAppShell static int[] initCamera(String aContentType, int aCamera, int aWidth, int aHeight) { Log.i("GeckoAppJava", "initCamera(" + aContentType + ", " + aWidth + "x" + aHeight + ") on thread " + Thread.currentThread().getId()); + getMainHandler().post(new Runnable() { + public void run() { + try { + GeckoApp.mAppContext.enableCameraView(); + } catch (Exception e) {} + } + }); + // [0] = 0|1 (failure/success) // [1] = width // [2] = height @@ -1562,6 +1570,13 @@ public class GeckoAppShell static synchronized void closeCamera() { Log.i("GeckoAppJava", "closeCamera() on thread " + Thread.currentThread().getId()); + getMainHandler().post(new Runnable() { + public void run() { + try { + GeckoApp.mAppContext.disableCameraView(); + } catch (Exception e) {} + } + }); if (sCamera != null) { sCamera.stopPreview(); sCamera.release(); From 2130b134b4ed97945c75243f359025aff077ba06 Mon Sep 17 00:00:00 2001 From: Marco Bonardo Date: Sat, 5 Nov 2011 01:01:38 +0100 Subject: [PATCH 062/127] Bug 619623 - Try to fix some intermittent failures in test_IHistory.cpp. r=dietrich --- .../places/tests/cpp/places_test_harness.h | 77 ++++------ .../tests/cpp/places_test_harness_tail.h | 5 +- .../places/tests/cpp/test_IHistory.cpp | 136 +++++++++--------- xpcom/tests/TestHarness.h | 5 +- 4 files changed, 106 insertions(+), 117 deletions(-) diff --git a/toolkit/components/places/tests/cpp/places_test_harness.h b/toolkit/components/places/tests/cpp/places_test_harness.h index 7d3f8c00fda..951359195ed 100644 --- a/toolkit/components/places/tests/cpp/places_test_harness.h +++ b/toolkit/components/places/tests/cpp/places_test_harness.h @@ -134,28 +134,23 @@ public: NS_DECL_ISUPPORTS WaitForTopicSpinner(const char* const aTopic) - : mTopic(aTopic) - , mTopicReceived(false) + : mTopicReceived(false) , mStartTime(PR_IntervalNow()) { + nsCOMPtr observerService = + do_GetService(NS_OBSERVERSERVICE_CONTRACTID); + do_check_true(observerService); + (void)observerService->AddObserver(this, aTopic, false); } void Spin() { - nsCOMPtr observerService = - do_GetService(NS_OBSERVERSERVICE_CONTRACTID); - if (observerService) { - (void)observerService->AddObserver(this, mTopic, false); - - while (!mTopicReceived) { - if (PR_IntervalNow() - mStartTime > WAITFORTOPIC_TIMEOUT_SECONDS * PR_USEC_PER_SEC) { - // Timed out waiting for the topic. - do_check_true(false); - break; - } - (void)NS_ProcessNextEvent(); + while (!mTopicReceived) { + if ((PR_IntervalNow() - mStartTime) > (WAITFORTOPIC_TIMEOUT_SECONDS * PR_USEC_PER_SEC)) { + // Timed out waiting for the topic. + do_check_true(false); + break; } - - (void)observerService->RemoveObserver(this, mTopic); + (void)NS_ProcessNextEvent(); } } @@ -163,13 +158,15 @@ public: const char* aTopic, const PRUnichar* aData) { - do_check_false(strcmp(aTopic, mTopic)); mTopicReceived = true; + nsCOMPtr observerService = + do_GetService(NS_OBSERVERSERVICE_CONTRACTID); + do_check_true(observerService); + (void)observerService->RemoveObserver(this, aTopic); return NS_OK; } private: - const char* const mTopic; bool mTopicReceived; PRIntervalTime mStartTime; }; @@ -187,9 +184,11 @@ NS_IMPL_ISUPPORTS1( void addURI(nsIURI* aURI) { + nsRefPtr spinner = + new WaitForTopicSpinner(TOPIC_FRECENCY_UPDATED); + nsCOMPtr hist = do_GetService(NS_NAVHISTORYSERVICE_CONTRACTID); - PRInt64 id; nsresult rv = hist->AddVisit(aURI, PR_Now(), nsnull, nsINavHistoryService::TRANSITION_LINK, false, @@ -197,8 +196,6 @@ addURI(nsIURI* aURI) do_check_success(rv); // Wait for frecency update. - nsRefPtr spinner = - new WaitForTopicSpinner(TOPIC_FRECENCY_UPDATED); spinner->Spin(); } @@ -334,36 +331,24 @@ do_get_lastVisit(PRInt64 placeId, VisitRecord& result) static const char TOPIC_PROFILE_TEARDOWN[] = "profile-change-teardown"; static const char TOPIC_PROFILE_CHANGE[] = "profile-before-change"; +static const char TOPIC_PLACES_CONNECTION_CLOSED[] = "places-connection-closed"; -class ShutdownObserver : public nsIObserver +class ProfileScopedXPCOM : public ScopedXPCOM { public: - NS_DECL_ISUPPORTS - - ShutdownObserver() + ProfileScopedXPCOM(const char* testName) + : ScopedXPCOM(testName) { - nsCOMPtr observerService = - do_GetService(NS_OBSERVERSERVICE_CONTRACTID); - do_check_true(observerService); - observerService->AddObserver(this, - NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID, - false); } - NS_IMETHOD Observe(nsISupports* aSubject, - const char* aTopic, - const PRUnichar* aData) - { - if (strcmp(aTopic, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID) == 0) { - nsCOMPtr os = - do_GetService(NS_OBSERVERSERVICE_CONTRACTID); - (void)os->NotifyObservers(nsnull, TOPIC_PROFILE_TEARDOWN, nsnull); - (void)os->NotifyObservers(nsnull, TOPIC_PROFILE_CHANGE, nsnull); - } - return NS_OK; + ~ProfileScopedXPCOM() { + nsRefPtr spinner = + new WaitForTopicSpinner(TOPIC_PLACES_CONNECTION_CLOSED); + nsCOMPtr os = + do_GetService(NS_OBSERVERSERVICE_CONTRACTID); + (void)os->NotifyObservers(nsnull, TOPIC_PROFILE_TEARDOWN, nsnull); + (void)os->NotifyObservers(nsnull, TOPIC_PROFILE_CHANGE, nsnull); + // Wait for connection close. + spinner->Spin(); } }; -NS_IMPL_ISUPPORTS1( - ShutdownObserver, - nsIObserver -) diff --git a/toolkit/components/places/tests/cpp/places_test_harness_tail.h b/toolkit/components/places/tests/cpp/places_test_harness_tail.h index 31266623b7f..856129c6151 100644 --- a/toolkit/components/places/tests/cpp/places_test_harness_tail.h +++ b/toolkit/components/places/tests/cpp/places_test_harness_tail.h @@ -114,9 +114,8 @@ int main(int aArgc, char** aArgv) { - ScopedXPCOM xpcom(TEST_NAME); - nsRefPtr shutdownObserver = new ShutdownObserver(); - + ProfileScopedXPCOM xpcom(TEST_NAME); + nsCOMPtr profile = xpcom.GetProfileDirectory(); // Tinderboxes are constantly on idle. Since idle tasks can interact with // tests, causing random failures, disable the idle service. diff --git a/toolkit/components/places/tests/cpp/test_IHistory.cpp b/toolkit/components/places/tests/cpp/test_IHistory.cpp index 31ee993b443..9560813eccb 100644 --- a/toolkit/components/places/tests/cpp/test_IHistory.cpp +++ b/toolkit/components/places/tests/cpp/test_IHistory.cpp @@ -149,10 +149,10 @@ test_set_places_enabled() // sets the nsCOMPtr's to nsnull, freeing the reference. namespace test_unvisited_does_not_notify { nsCOMPtr testURI; - nsCOMPtr testLink; + nsRefPtr testLink; } void -test_unvisted_does_not_notify_part1() +test_unvisited_does_not_notify_part1() { using namespace test_unvisited_does_not_notify; @@ -169,7 +169,7 @@ test_unvisted_does_not_notify_part1() testLink = new mock_Link(expect_no_visit); // Now, register our Link to be notified. - nsCOMPtr history(do_get_IHistory()); + nsCOMPtr history = do_get_IHistory(); nsresult rv = history->RegisterVisitedCallback(testURI, testLink); do_check_success(rv); @@ -181,29 +181,30 @@ void test_visited_notifies() { // First, we add our test URI to history. - nsCOMPtr testURI(new_test_uri()); + nsCOMPtr testURI = new_test_uri(); addURI(testURI); // Create our test Link. The callback function will release the reference we // have on the Link. - Link* link = new mock_Link(expect_visit); - NS_ADDREF(link); + nsRefPtr link = new mock_Link(expect_visit); // Now, register our Link to be notified. - nsCOMPtr history(do_get_IHistory()); + nsCOMPtr history = do_get_IHistory(); nsresult rv = history->RegisterVisitedCallback(testURI, link); do_check_success(rv); + + link.forget(); // It will release itself when notified. // Note: test will continue upon notification. } void -test_unvisted_does_not_notify_part2() +test_unvisited_does_not_notify_part2() { using namespace test_unvisited_does_not_notify; // We would have had a failure at this point had the content node been told it // was visited. Therefore, it is safe to unregister our content node. - nsCOMPtr history(do_get_IHistory()); + nsCOMPtr history = do_get_IHistory(); nsresult rv = history->UnregisterVisitedCallback(testURI, testLink); do_check_success(rv); @@ -219,24 +220,24 @@ void test_same_uri_notifies_both() { // First, we add our test URI to history. - nsCOMPtr testURI(new_test_uri()); + nsCOMPtr testURI = new_test_uri(); addURI(testURI); // Create our two test Links. The callback function will release the // reference we have on the Links. Only the second Link should run the next // test! - Link* link1 = new mock_Link(expect_visit, false); - NS_ADDREF(link1); - Link* link2 = new mock_Link(expect_visit); - NS_ADDREF(link2); + nsRefPtr link1 = new mock_Link(expect_visit, false); + nsRefPtr link2 = new mock_Link(expect_visit); // Now, register our Link to be notified. - nsCOMPtr history(do_get_IHistory()); + nsCOMPtr history = do_get_IHistory(); nsresult rv = history->RegisterVisitedCallback(testURI, link1); do_check_success(rv); rv = history->RegisterVisitedCallback(testURI, link2); do_check_success(rv); + link1.forget(); // It will release itself when notified. + link2.forget(); // It will release itself when notified. // Note: test will continue upon notification. } @@ -247,8 +248,8 @@ test_unregistered_visited_does_not_notify() // The Link would have been notified by now if we were buggy and notified // unregistered Links (due to request serialization). - nsCOMPtr testURI(new_test_uri()); - nsCOMPtr link(new mock_Link(expect_no_visit)); + nsCOMPtr testURI = new_test_uri(); + nsRefPtr link = new mock_Link(expect_no_visit); // Now, register our Link to be notified. nsCOMPtr history(do_get_IHistory()); @@ -276,18 +277,18 @@ test_new_visit_notifies_waiting_Link() { // Create our test Link. The callback function will release the reference we // have on the link. - Link* link = new mock_Link(expect_visit); - NS_ADDREF(link); + nsRefPtr link = new mock_Link(expect_visit); // Now, register our content node to be notified. - nsCOMPtr testURI(new_test_uri()); - nsCOMPtr history(do_get_IHistory()); + nsCOMPtr testURI = new_test_uri(); + nsCOMPtr history = do_get_IHistory(); nsresult rv = history->RegisterVisitedCallback(testURI, link); do_check_success(rv); // Add ourselves to history. addURI(testURI); + link.forget(); // It will release itself when notified. // Note: test will continue upon notification. } @@ -295,14 +296,14 @@ void test_RegisterVisitedCallback_returns_before_notifying() { // Add a URI so that it's already in history. - nsCOMPtr testURI(new_test_uri()); + nsCOMPtr testURI = new_test_uri(); addURI(testURI); // Create our test Link. - nsCOMPtr link(new mock_Link(expect_no_visit)); + nsRefPtr link = new mock_Link(expect_no_visit); // Now, register our content node to be notified. It should not be notified. - nsCOMPtr history(do_get_IHistory()); + nsCOMPtr history = do_get_IHistory(); nsresult rv = history->RegisterVisitedCallback(testURI, link); do_check_success(rv); @@ -346,8 +347,9 @@ namespace test_observer_topic_dispatched_helpers { do_check_false(strcmp(aTopic, URI_VISITED_RESOLUTION_TOPIC)); // If this isn't for our URI, do not do anything. - nsCOMPtr notifiedURI(do_QueryInterface(aSubject)); + nsCOMPtr notifiedURI = do_QueryInterface(aSubject); do_check_true(notifiedURI); + bool isOurURI; nsresult rv = notifiedURI->Equals(mURI, &isOurURI); do_check_success(rv); @@ -361,7 +363,9 @@ namespace test_observer_topic_dispatched_helpers { do_check_true(visited || notVisited); // Check to make sure we got the state we expected. - do_check_eq(visited, mExpectVisit); + if (visited != mExpectVisit) { + return NS_OK; + } // Indicate that we've been notified. mNotified = true; @@ -389,8 +393,8 @@ test_observer_topic_dispatched() using namespace test_observer_topic_dispatched_helpers; // Create two URIs, making sure only one is in history. - nsCOMPtr visitedURI(new_test_uri()); - nsCOMPtr notVisitedURI(new_test_uri()); + nsCOMPtr visitedURI = new_test_uri(); + nsCOMPtr notVisitedURI = new_test_uri(); bool urisEqual; nsresult rv = visitedURI->Equals(notVisitedURI, &urisEqual); do_check_success(rv); @@ -398,21 +402,21 @@ test_observer_topic_dispatched() addURI(visitedURI); // Need two Link objects as well - one for each URI. - nsCOMPtr visitedLink(new mock_Link(expect_visit, false)); - nsCOMPtr visitedLinkCopy = visitedLink; + nsRefPtr visitedLink = new mock_Link(expect_visit, false); + nsRefPtr visitedLinkCopy = visitedLink; visitedLinkCopy.forget(); // It will release itself when notified. - nsCOMPtr notVisitedLink(new mock_Link(expect_no_visit)); + nsRefPtr notVisitedLink = new mock_Link(expect_no_visit); // Add the right observers for the URIs to check results. bool visitedNotified = false; - nsCOMPtr vistedObs = + nsCOMPtr visitedObs = new statusObserver(visitedURI, true, visitedNotified); bool notVisitedNotified = false; - nsCOMPtr unvistedObs = + nsCOMPtr unvisitedObs = new statusObserver(notVisitedURI, false, notVisitedNotified); // Register our Links to be notified. - nsCOMPtr history(do_get_IHistory()); + nsCOMPtr history = do_get_IHistory(); rv = history->RegisterVisitedCallback(visitedURI, visitedLink); do_check_success(rv); rv = history->RegisterVisitedCallback(notVisitedURI, notVisitedLink); @@ -433,13 +437,13 @@ test_observer_topic_dispatched() void test_visituri_inserts() { - nsCOMPtr history(do_get_IHistory()); - nsCOMPtr lastURI(new_test_uri()); - nsCOMPtr visitedURI(new_test_uri()); + nsCOMPtr history = do_get_IHistory(); + nsCOMPtr lastURI = new_test_uri(); + nsCOMPtr visitedURI = new_test_uri(); history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL); - nsCOMPtr finisher = new VisitURIObserver(); + nsRefPtr finisher = new VisitURIObserver(); finisher->WaitForNotification(); PlaceRecord place; @@ -456,10 +460,10 @@ test_visituri_inserts() void test_visituri_updates() { - nsCOMPtr history(do_get_IHistory()); - nsCOMPtr lastURI(new_test_uri()); - nsCOMPtr visitedURI(new_test_uri()); - nsCOMPtr finisher; + nsCOMPtr history = do_get_IHistory(); + nsCOMPtr lastURI = new_test_uri(); + nsCOMPtr visitedURI = new_test_uri(); + nsRefPtr finisher; history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL); finisher = new VisitURIObserver(); @@ -480,16 +484,16 @@ test_visituri_updates() void test_visituri_preserves_shown_and_typed() { - nsCOMPtr history(do_get_IHistory()); - nsCOMPtr lastURI(new_test_uri()); - nsCOMPtr visitedURI(new_test_uri()); + nsCOMPtr history = do_get_IHistory(); + nsCOMPtr lastURI = new_test_uri(); + nsCOMPtr visitedURI = new_test_uri(); history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL); // this simulates the uri visit happening in a frame. Normally frame // transitions would be hidden unless it was previously loaded top-level history->VisitURI(visitedURI, lastURI, 0); - nsCOMPtr finisher = new VisitURIObserver(2); + nsRefPtr finisher = new VisitURIObserver(2); finisher->WaitForNotification(); PlaceRecord place; @@ -502,12 +506,12 @@ test_visituri_preserves_shown_and_typed() void test_visituri_creates_visit() { - nsCOMPtr history(do_get_IHistory()); - nsCOMPtr lastURI(new_test_uri()); - nsCOMPtr visitedURI(new_test_uri()); + nsCOMPtr history = do_get_IHistory(); + nsCOMPtr lastURI = new_test_uri(); + nsCOMPtr visitedURI = new_test_uri(); history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL); - nsCOMPtr finisher = new VisitURIObserver(); + nsRefPtr finisher = new VisitURIObserver(); finisher->WaitForNotification(); PlaceRecord place; @@ -527,13 +531,13 @@ test_visituri_transition_typed() { nsCOMPtr navHistory = do_get_NavHistory(); nsCOMPtr browserHistory = do_QueryInterface(navHistory); - nsCOMPtr history(do_get_IHistory()); - nsCOMPtr lastURI(new_test_uri()); - nsCOMPtr visitedURI(new_test_uri()); + nsCOMPtr history = do_get_IHistory(); + nsCOMPtr lastURI = new_test_uri(); + nsCOMPtr visitedURI = new_test_uri(); browserHistory->MarkPageAsTyped(visitedURI); history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL); - nsCOMPtr finisher = new VisitURIObserver(); + nsRefPtr finisher = new VisitURIObserver(); finisher->WaitForNotification(); PlaceRecord place; @@ -551,12 +555,12 @@ test_visituri_transition_embed() { nsCOMPtr navHistory = do_get_NavHistory(); nsCOMPtr browserHistory = do_QueryInterface(navHistory); - nsCOMPtr history(do_get_IHistory()); - nsCOMPtr lastURI(new_test_uri()); - nsCOMPtr visitedURI(new_test_uri()); + nsCOMPtr history = do_get_IHistory(); + nsCOMPtr lastURI = new_test_uri(); + nsCOMPtr visitedURI = new_test_uri(); history->VisitURI(visitedURI, lastURI, 0); - nsCOMPtr finisher = new VisitURIObserver(); + nsRefPtr finisher = new VisitURIObserver(); finisher->WaitForNotification(); PlaceRecord place; @@ -574,12 +578,12 @@ void test_new_visit_adds_place_guid() { // First, add a visit and wait. This will also add a place. - nsCOMPtr visitedURI(new_test_uri()); - nsCOMPtr history(do_get_IHistory()); + nsCOMPtr visitedURI = new_test_uri(); + nsCOMPtr history = do_get_IHistory(); nsresult rv = history->VisitURI(visitedURI, NULL, mozilla::IHistory::TOP_LEVEL); do_check_success(rv); - nsCOMPtr finisher = new VisitURIObserver(); + nsRefPtr finisher = new VisitURIObserver(); finisher->WaitForNotification(); // Check that we have a guid for our visit. @@ -600,9 +604,9 @@ test_two_null_links_same_uri() // Tests that we do not crash when we have had two NULL Links passed to // RegisterVisitedCallback and then the visit occurs (bug 607469). This only // happens in IPC builds. - nsCOMPtr testURI(new_test_uri()); + nsCOMPtr testURI = new_test_uri(); - nsCOMPtr history(do_get_IHistory()); + nsCOMPtr history = do_get_IHistory(); nsresult rv = history->RegisterVisitedCallback(testURI, NULL); do_check_success(rv); rv = history->RegisterVisitedCallback(testURI, NULL); @@ -611,7 +615,7 @@ test_two_null_links_same_uri() rv = history->VisitURI(testURI, NULL, mozilla::IHistory::TOP_LEVEL); do_check_success(rv); - nsCOMPtr finisher = new VisitURIObserver(); + nsRefPtr finisher = new VisitURIObserver(); finisher->WaitForNotification(); run_next_test(); @@ -625,9 +629,9 @@ test_two_null_links_same_uri() */ Test gTests[] = { TEST(test_set_places_enabled), // Must come first! - TEST(test_unvisted_does_not_notify_part1), // Order Important! + TEST(test_unvisited_does_not_notify_part1), // Order Important! TEST(test_visited_notifies), - TEST(test_unvisted_does_not_notify_part2), // Order Important! + TEST(test_unvisited_does_not_notify_part2), // Order Important! TEST(test_same_uri_notifies_both), TEST(test_unregistered_visited_does_not_notify), // Order Important! TEST(test_new_visit_notifies_waiting_Link), diff --git a/xpcom/tests/TestHarness.h b/xpcom/tests/TestHarness.h index 1884c1292ac..18c2e217308 100644 --- a/xpcom/tests/TestHarness.h +++ b/xpcom/tests/TestHarness.h @@ -194,8 +194,9 @@ class ScopedXPCOM : public nsIDirectoryServiceProvider2 { // If we created a profile directory, we need to remove it. if (mProfD) { - if (NS_FAILED(mProfD->Remove(true))) - NS_WARNING("Problem removing profile direrctory"); + if (NS_FAILED(mProfD->Remove(true))) { + NS_WARNING("Problem removing profile directory"); + } mProfD = nsnull; } From b8dbe816f58ed803d5d59b3141f75d8fd820b246 Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Tue, 11 Oct 2011 21:52:36 -0700 Subject: [PATCH 063/127] Bug 693907 - Once Upon a JSAPI (move JS_CallOnce from jslock.cpp to jsapi.cpp) (r=waldo) --HG-- extra : rebase_source : 718fa503c0b73f0a4a94f50f28bc4a7981ef4202 --- js/src/jsapi.cpp | 24 ++++++++++++++++++++++++ js/src/jslock.cpp | 29 ++--------------------------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index f013a2b949c..cec5100111f 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -6315,3 +6315,27 @@ JS_IndexToId(JSContext *cx, uint32 index, jsid *id) { return IndexToId(cx, index, id); } + +#ifdef JS_THREADSAFE +static PRStatus +CallOnce(void *func) +{ + JSInitCallback init = JS_DATA_TO_FUNC_PTR(JSInitCallback, func); + return init() ? PR_SUCCESS : PR_FAILURE; +} +#endif + +JS_PUBLIC_API(JSBool) +JS_CallOnce(JSCallOnceType *once, JSInitCallback func) +{ +#ifdef JS_THREADSAFE + return PR_CallOnceWithArg(once, CallOnce, JS_FUNC_TO_DATA_PTR(void *, func)) == PR_SUCCESS; +#else + if (!*once) { + *once = true; + return func(); + } else { + return JS_TRUE; + } +#endif +} diff --git a/js/src/jslock.cpp b/js/src/jslock.cpp index 6db587bdff8..013bb3f4a39 100644 --- a/js/src/jslock.cpp +++ b/js/src/jslock.cpp @@ -37,10 +37,6 @@ * * ***** END LICENSE BLOCK ***** */ -#include "jsapi.h" -#include "jspubtd.h" -#include "jstypes.h" - #ifdef JS_THREADSAFE /* @@ -55,6 +51,8 @@ # include #endif +#include "jspubtd.h" +#include "jstypes.h" #include "jsutil.h" #include "jsstdint.h" #include "jscntxt.h" @@ -765,27 +763,4 @@ js_IsRuntimeLocked(JSRuntime *rt) } #endif /* DEBUG */ -static PRStatus -CallOnce(void *func) -{ - JSInitCallback init = JS_DATA_TO_FUNC_PTR(JSInitCallback, func); - return init() ? PR_FAILURE : PR_SUCCESS; -} - -JS_PUBLIC_API(JSBool) -JS_CallOnce(JSCallOnceType *once, JSInitCallback func) -{ - return PR_CallOnceWithArg(once, CallOnce, JS_FUNC_TO_DATA_PTR(void *, func)) == PR_SUCCESS; -} -#else /* JS_THREADSAFE */ -JS_PUBLIC_API(JSBool) -JS_CallOnce(JSCallOnceType *once, JSInitCallback func) -{ - if (!*once) { - *once = true; - return func(); - } else { - return JS_TRUE; - } -} #endif /* JS_THREADSAFE */ From 9514f6e6dce0d4b6f85605e789fec7ef2710e352 Mon Sep 17 00:00:00 2001 From: Steve Fink Date: Fri, 28 Oct 2011 12:35:35 -0700 Subject: [PATCH 064/127] Bug 625639 - fix XPCConvert error handling (r=mrbkap) --- js/xpconnect/src/XPCConvert.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/xpconnect/src/XPCConvert.cpp b/js/xpconnect/src/XPCConvert.cpp index 82271e0ed09..9f6bfb049df 100644 --- a/js/xpconnect/src/XPCConvert.cpp +++ b/js/xpconnect/src/XPCConvert.cpp @@ -1212,7 +1212,7 @@ XPCConvert::NativeInterface2JSObject(XPCLazyCallContext& lccx, wrapper = strongWrapper; } - if (pErr) + if (NS_FAILED(rv) && pErr) *pErr = rv; // If creating the wrapped native failed, then return early. @@ -1228,6 +1228,8 @@ XPCConvert::NativeInterface2JSObject(XPCLazyCallContext& lccx, *d = v; if (dest) *dest = strongWrapper.forget().get(); + if (pErr) + *pErr = NS_OK; return JS_TRUE; } @@ -1294,6 +1296,9 @@ XPCConvert::NativeInterface2JSObject(XPCLazyCallContext& lccx, } } + if (pErr) + *pErr = NS_OK; + return JS_TRUE; } From 2d748c8dcfd4610ccd2f3a5f52132023c2a82125 Mon Sep 17 00:00:00 2001 From: Terrence Cole Date: Tue, 11 Oct 2011 18:37:40 -0700 Subject: [PATCH 065/127] =?UTF-8?q?Bug=20670596=20-=20Mark=20ununused=20ar?= =?UTF-8?q?enas=20as=20decommitted;=20r=3D=3F,njn?= This patch tells the OS which pages we are not using after we do a GC_SHRINK. The result is that the OS can do a better job managing memory, send less to swap and will not count these pages against us in RSS. --- js/src/Makefile.in | 1 + js/src/ds/BitArray.h | 91 ++++++++++++++ js/src/jsgc.cpp | 200 +++++++++++++++++++++++++----- js/src/jsgc.h | 157 ++++++++++++++++------- js/src/jsgcchunk.cpp | 70 ++++++++--- js/src/jsgcchunk.h | 20 ++- js/xpconnect/src/XPCJSRuntime.cpp | 55 ++++++-- js/xpconnect/src/xpcpublic.h | 4 + 8 files changed, 498 insertions(+), 100 deletions(-) create mode 100644 js/src/ds/BitArray.h diff --git a/js/src/Makefile.in b/js/src/Makefile.in index d60fac4fb2c..fc48cbd6c66 100644 --- a/js/src/Makefile.in +++ b/js/src/Makefile.in @@ -245,6 +245,7 @@ EXPORTS_vm = \ EXPORTS_ds = \ LifoAlloc.h \ + BitArray.h \ $(NULL) EXPORTS_gc = \ diff --git a/js/src/ds/BitArray.h b/js/src/ds/BitArray.h new file mode 100644 index 00000000000..91165f919d1 --- /dev/null +++ b/js/src/ds/BitArray.h @@ -0,0 +1,91 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * vim: set ts=4 sw=4 et tw=99 ft=cpp: + * + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is SpiderMonkey JavaScript engine. + * + * The Initial Developer of the Original Code is + * Mozilla Corporation. + * Portions created by the Initial Developer are Copyright (C) 2011 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Terrence Cole + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +#ifndef BitArray_h__ +#define BitArray_h__ + +#include "jstypes.h" + +#include "js/TemplateLib.h" + +namespace js { + +template +class BitArray { + private: + uintptr_t map[nbits / JS_BITS_PER_WORD + (nbits % JS_BITS_PER_WORD == 0 ? 0 : 1)]; + + public: + void clear(bool value) { + if (value) + memset(map, 0xFF, sizeof(map)); + else + memset(map, 0, sizeof(map)); + } + + inline bool get(size_t offset) const { + uintptr_t index, mask; + getMarkWordAndMask(offset, &index, &mask); + return map[index] & mask; + } + + inline void set(size_t offset) { + uintptr_t index, mask; + getMarkWordAndMask(offset, &index, &mask); + map[index] |= mask; + } + + inline void unset(size_t offset) { + uintptr_t index, mask; + getMarkWordAndMask(offset, &index, &mask); + map[index] &= ~mask; + } + + private: + inline void getMarkWordAndMask(size_t offset, + uintptr_t *indexp, uintptr_t *maskp) const { + *indexp = offset >> tl::FloorLog2::result; + *maskp = uintptr_t(1) << (offset & (JS_BITS_PER_WORD - 1)); + } +}; + +} /* namespace js */ + +#endif diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 037e4d93b3f..16d56caafd4 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -525,10 +525,26 @@ ChunkPool::expire(JSRuntime *rt, bool releaseAll) JS_ASSERT_IF(releaseAll, !emptyCount); } +JS_FRIEND_API(int64) +ChunkPool::countDecommittedArenas(JSRuntime *rt) +{ + JS_ASSERT(this == &rt->gcChunkPool); + + int64 numDecommitted = 0; + Chunk *chunk = emptyChunkListHead; + while (chunk) { + for (uint32 i = 0; i < ArenasPerChunk; ++i) + if (chunk->decommittedArenas.get(i)) + ++numDecommitted; + chunk = chunk->info.next; + } + return numDecommitted; +} + /* static */ Chunk * Chunk::allocate(JSRuntime *rt) { - Chunk *chunk = static_cast(AllocGCChunk()); + Chunk *chunk = static_cast(AllocChunk()); if (!chunk) return NULL; chunk->init(); @@ -541,30 +557,37 @@ Chunk::release(JSRuntime *rt, Chunk *chunk) { JS_ASSERT(chunk); rt->gcStats.count(gcstats::STAT_DESTROY_CHUNK); - FreeGCChunk(chunk); + FreeChunk(chunk); } void Chunk::init() { - JS_POISON(this, JS_FREE_PATTERN, GC_CHUNK_SIZE); + JS_POISON(this, JS_FREE_PATTERN, ChunkSize); - /* Assemble all arenas into a linked list and mark them as not allocated. */ - ArenaHeader **prevp = &info.emptyArenaListHead; - Arena *end = &arenas[ArrayLength(arenas)]; - for (Arena *a = &arenas[0]; a != end; ++a) { - *prevp = &a->aheader; - a->aheader.setAsNotAllocated(); - prevp = &a->aheader.next; - } - *prevp = NULL; - - /* We clear the bitmap to guard against xpc_IsGrayGCThing being called on - uninitialized data, which would happen before the first GC cycle. */ + /* + * We clear the bitmap to guard against xpc_IsGrayGCThing being called on + * uninitialized data, which would happen before the first GC cycle. + */ bitmap.clear(); + /* Initialize the arena tracking bitmap. */ + decommittedArenas.clear(false); + + /* Initialize the chunk info. */ + info.freeArenasHead = &arenas[0].aheader; + info.lastDecommittedArenaOffset = 0; + info.numArenasFree = ArenasPerChunk; + info.numArenasFreeCommitted = ArenasPerChunk; info.age = 0; - info.numFree = ArenasPerChunk; + + /* Initialize the arena header state. */ + for (jsuint i = 0; i < ArenasPerChunk; i++) { + arenas[i].aheader.setAsNotAllocated(); + arenas[i].aheader.next = (i + 1 < ArenasPerChunk) + ? &arenas[i + 1].aheader + : NULL; + } /* The rest of info fields are initialized in PickChunk. */ } @@ -607,16 +630,66 @@ Chunk::removeFromAvailableList() info.next = NULL; } +/* + * Search for and return the next decommitted Arena. Our goal is to keep + * lastDecommittedArenaOffset "close" to a free arena. We do this by setting + * it to the most recently freed arena when we free, and forcing it to + * the last alloc + 1 when we allocate. + */ +jsuint +Chunk::findDecommittedArenaOffset() +{ + /* Note: lastFreeArenaOffset can be past the end of the list. */ + for (jsuint i = info.lastDecommittedArenaOffset; i < ArenasPerChunk; i++) + if (decommittedArenas.get(i)) + return i; + for (jsuint i = 0; i < info.lastDecommittedArenaOffset; i++) + if (decommittedArenas.get(i)) + return i; + JS_NOT_REACHED("No decommitted arenas found."); + return -1; +} + +ArenaHeader * +Chunk::fetchNextDecommittedArena() +{ + JS_ASSERT(info.numArenasFreeCommitted < info.numArenasFree); + + jsuint offset = findDecommittedArenaOffset(); + info.lastDecommittedArenaOffset = offset + 1; + --info.numArenasFree; + decommittedArenas.unset(offset); + + Arena *arena = &arenas[offset]; + CommitMemory(arena, ArenaSize); + arena->aheader.setAsNotAllocated(); + + return &arena->aheader; +} + +inline ArenaHeader * +Chunk::fetchNextFreeArena() +{ + JS_ASSERT(info.numArenasFreeCommitted > 0); + + ArenaHeader *aheader = info.freeArenasHead; + info.freeArenasHead = aheader->next; + --info.numArenasFreeCommitted; + --info.numArenasFree; + + return aheader; +} + ArenaHeader * Chunk::allocateArena(JSCompartment *comp, AllocKind thingKind) { - JS_ASSERT(hasAvailableArenas()); - ArenaHeader *aheader = info.emptyArenaListHead; - info.emptyArenaListHead = aheader->next; - aheader->init(comp, thingKind); - --info.numFree; + JS_ASSERT(!noAvailableArenas()); - if (!hasAvailableArenas()) + ArenaHeader *aheader = JS_LIKELY(info.numArenasFreeCommitted > 0) + ? fetchNextFreeArena() + : fetchNextDecommittedArena(); + aheader->init(comp, thingKind); + if (JS_UNLIKELY(noAvailableArenas())) removeFromAvailableList(); JSRuntime *rt = comp->rt; @@ -655,13 +728,15 @@ Chunk::releaseArena(ArenaHeader *aheader) JS_ATOMIC_ADD(&comp->gcBytes, -int32(ArenaSize)); aheader->setAsNotAllocated(); - aheader->next = info.emptyArenaListHead; - info.emptyArenaListHead = aheader; - ++info.numFree; - if (info.numFree == 1) { + aheader->next = info.freeArenasHead; + info.freeArenasHead = aheader; + ++info.numArenasFreeCommitted; + ++info.numArenasFree; + + if (info.numArenasFree == 1) { JS_ASSERT(!info.prevp); JS_ASSERT(!info.next); - addToAvailableList(aheader->compartment); + addToAvailableList(comp); } else if (!unused()) { JS_ASSERT(info.prevp); } else { @@ -850,7 +925,12 @@ MarkIfGCThingWord(JSTracer *trc, jsuword w) if (!Chunk::withinArenasRange(addr)) return CGCT_NOTARENA; - ArenaHeader *aheader = &chunk->arenas[Chunk::arenaIndex(addr)].aheader; + /* If the arena is not currently allocated, don't access the header. */ + size_t arenaOffset = Chunk::arenaIndex(addr); + if (chunk->decommittedArenas.get(arenaOffset)) + return CGCT_FREEARENA; + + ArenaHeader *aheader = &chunk->arenas[arenaOffset].aheader; if (!aheader->allocated()) return CGCT_FREEARENA; @@ -2292,6 +2372,46 @@ ReleaseObservedTypes(JSContext *cx) return releaseTypes; } +static void +DecommitFreePages(JSContext *cx) +{ + JSRuntime *rt = cx->runtime; + + for (GCChunkSet::Range r(rt->gcChunkSet.all()); !r.empty(); r.popFront()) { + Chunk *chunk = r.front(); + while (chunk) { + ArenaHeader *aheader = static_cast(chunk->info.freeArenasHead); + + /* + * In the non-failure case, the list will be gone at the end of + * the loop. In the case where we fail, we relink all failed + * decommits into a new list on freeArenasHead. + */ + chunk->info.freeArenasHead = NULL; + + while (aheader) { + /* Store aside everything we will need after decommit. */ + ArenaHeader *next = aheader->next; + + bool success = DecommitMemory(aheader, ArenaSize); + if (!success) { + aheader->next = chunk->info.freeArenasHead; + chunk->info.freeArenasHead = aheader; + continue; + } + + size_t arenaOffset = Chunk::arenaIndex(reinterpret_cast(aheader)); + chunk->decommittedArenas.set(arenaOffset); + --chunk->info.numArenasFreeCommitted; + + aheader = next; + } + + chunk = chunk->info.next; + } + } +} + static void SweepCompartments(JSContext *cx, JSGCInvocationKind gckind) { @@ -2504,6 +2624,9 @@ SweepPhase(JSContext *cx, GCMarker *gcmarker, JSGCInvocationKind gckind) */ rt->gcChunkPool.expire(rt, gckind == GC_SHRINK); #endif + + if (gckind == GC_SHRINK) + DecommitFreePages(cx); } if (rt->gcCallback) @@ -2978,6 +3101,27 @@ IterateCompartmentsArenasCells(JSContext *cx, void *data, } } +void +IterateChunks(JSContext *cx, void *data, IterateChunkCallback chunkCallback) +{ + /* :XXX: Any way to common this preamble with IterateCompartmentsArenasCells? */ + CHECK_REQUEST(cx); + LeaveTrace(cx); + + JSRuntime *rt = cx->runtime; + JS_ASSERT(!rt->gcRunning); + + AutoLockGC lock(rt); + AutoGCSession gcsession(cx); +#ifdef JS_THREADSAFE + rt->gcHelperThread.waitBackgroundSweepEnd(); +#endif + AutoUnlockGC unlock(rt); + + for (js::GCChunkSet::Range r = rt->gcChunkSet.all(); !r.empty(); r.popFront()) + chunkCallback(cx, data, r.front()); +} + void IterateCells(JSContext *cx, JSCompartment *compartment, AllocKind thingKind, void *data, IterateCellCallback cellCallback) diff --git a/js/src/jsgc.h b/js/src/jsgc.h index 697ad7576ca..ff047480bcc 100644 --- a/js/src/jsgc.h +++ b/js/src/jsgc.h @@ -59,6 +59,7 @@ #include "jsgcstats.h" #include "jscell.h" +#include "ds/BitArray.h" #include "gc/Statistics.h" #include "js/HashTable.h" #include "js/Vector.h" @@ -363,6 +364,12 @@ struct ArenaHeader { friend struct FreeLists; JSCompartment *compartment; + + /* + * ArenaHeader::next has two purposes: when unallocated, it points to the + * next available Arena's header. When allocated, it points to the next + * arena of the same size class and compartment. + */ ArenaHeader *next; private: @@ -413,18 +420,28 @@ struct ArenaHeader { inline uintptr_t address() const; inline Chunk *chunk() const; - void setAsNotAllocated() { - allocKind = size_t(FINALIZE_LIMIT); - hasDelayedMarking = 0; - nextDelayedMarking = 0; - } - bool allocated() const { JS_ASSERT(allocKind <= size_t(FINALIZE_LIMIT)); return allocKind < size_t(FINALIZE_LIMIT); } - inline void init(JSCompartment *comp, AllocKind kind); + void init(JSCompartment *comp, AllocKind kind) { + JS_ASSERT(!allocated()); + JS_ASSERT(!hasDelayedMarking); + compartment = comp; + + JS_STATIC_ASSERT(FINALIZE_LIMIT <= 255); + allocKind = size_t(kind); + + /* See comments in FreeSpan::allocateFromNewArena. */ + firstFreeSpanOffsets = FreeSpan::FullArenaOffsets; + } + + void setAsNotAllocated() { + allocKind = size_t(FINALIZE_LIMIT); + hasDelayedMarking = 0; + nextDelayedMarking = 0; + } uintptr_t arenaAddress() const { return address(); @@ -543,13 +560,60 @@ struct Arena { struct ChunkInfo { Chunk *next; Chunk **prevp; - ArenaHeader *emptyArenaListHead; - size_t age; - size_t numFree; + + /* Free arenas are linked together with aheader.next. */ + ArenaHeader *freeArenasHead; + + /* + * Decommitted arenas are tracked by a bitmap in the chunk header. We use + * this offset to start our search iteration close to a decommitted arena + * that we can allocate. + */ + uint32 lastDecommittedArenaOffset; + + /* Number of free arenas, either committed or decommitted. */ + uint32 numArenasFree; + + /* Number of free, committed arenas. */ + uint32 numArenasFreeCommitted; + + /* Number of GC cycles this chunk has survived. */ + uint32 age; }; -const size_t BytesPerArena = ArenaSize + ArenaBitmapBytes; -const size_t ArenasPerChunk = (GC_CHUNK_SIZE - sizeof(ChunkInfo)) / BytesPerArena; +/* + * Calculating ArenasPerChunk: + * + * In order to figure out how many Arenas will fit in a chunk, we need to know + * how much extra space is available after we allocate the header data. This + * is a problem because the header size depends on the number of arenas in the + * chunk. The two dependent fields are bitmap and decommittedArenas. + * + * For the mark bitmap, we know that each arena will use a fixed number of full + * bytes: ArenaBitmapBytes. The full size of the header data is this number + * multiplied by the eventual number of arenas we have in the header. We, + * conceptually, distribute this header data among the individual arenas and do + * not include it in the header. This way we do not have to worry about its + * variable size: it gets attached to the variable number we are computing. + * + * For the decommitted arena bitmap, we only have 1 bit per arena, so this + * technique will not work. Instead, we observe that we do not have enough + * header info to fill 8 full arenas: it is currently 4 on 64bit, less on + * 32bit. Thus, with current numbers, we need 64 bytes for decommittedArenas. + * This will not become 63 bytes unless we double the data required in the + * header. Therefore, we just compute the number of bytes required to track + * every possible arena and do not worry about slop bits, since there are too + * few to usefully allocate. + * + * To actually compute the number of arenas we can allocate in a chunk, we + * divide the amount of available space less the header info (not including + * the mark bitmap which is distributed into the arena size) by the size of + * the arena (with the mark bitmap bytes it uses). + */ +const size_t BytesPerArenaWithHeader = ArenaSize + ArenaBitmapBytes; +const size_t ChunkDecommitBitmapBytes = ChunkSize / ArenaSize / JS_BITS_PER_BYTE; +const size_t ChunkBytesAvailable = ChunkSize - sizeof(ChunkInfo) - ChunkDecommitBitmapBytes; +const size_t ArenasPerChunk = ChunkBytesAvailable / BytesPerArenaWithHeader; /* A chunk bitmap contains enough mark bits for all the cells in a chunk. */ struct ChunkBitmap { @@ -615,11 +679,14 @@ struct ChunkBitmap { JS_STATIC_ASSERT(ArenaBitmapBytes * ArenasPerChunk == sizeof(ChunkBitmap)); -const size_t ChunkPadSize = GC_CHUNK_SIZE +typedef BitArray PerArenaBitmap; + +const size_t ChunkPadSize = ChunkSize - (sizeof(Arena) * ArenasPerChunk) - sizeof(ChunkBitmap) + - sizeof(PerArenaBitmap) - sizeof(ChunkInfo); -JS_STATIC_ASSERT(ChunkPadSize < BytesPerArena); +JS_STATIC_ASSERT(ChunkPadSize < BytesPerArenaWithHeader); /* * Chunks contain arenas and associated data structures (mark bitmap, delayed @@ -632,35 +699,36 @@ struct Chunk { uint8 padding[ChunkPadSize]; ChunkBitmap bitmap; + PerArenaBitmap decommittedArenas; ChunkInfo info; static Chunk *fromAddress(uintptr_t addr) { - addr &= ~GC_CHUNK_MASK; + addr &= ~ChunkMask; return reinterpret_cast(addr); } static bool withinArenasRange(uintptr_t addr) { - uintptr_t offset = addr & GC_CHUNK_MASK; + uintptr_t offset = addr & ChunkMask; return offset < ArenasPerChunk * ArenaSize; } static size_t arenaIndex(uintptr_t addr) { JS_ASSERT(withinArenasRange(addr)); - return (addr & GC_CHUNK_MASK) >> ArenaShift; + return (addr & ChunkMask) >> ArenaShift; } uintptr_t address() const { uintptr_t addr = reinterpret_cast(this); - JS_ASSERT(!(addr & GC_CHUNK_MASK)); + JS_ASSERT(!(addr & ChunkMask)); return addr; } bool unused() const { - return info.numFree == ArenasPerChunk; + return info.numArenasFree == ArenasPerChunk; } - bool hasAvailableArenas() const { - return info.numFree > 0; + bool noAvailableArenas() const { + return info.numArenasFree == 0; } inline void addToAvailableList(JSCompartment *compartment); @@ -675,9 +743,16 @@ struct Chunk { private: inline void init(); + + /* Search for a decommitted arena to allocate. */ + jsuint findDecommittedArenaOffset(); + ArenaHeader* fetchNextDecommittedArena(); + + /* Unlink and return the freeArenasHead. */ + inline ArenaHeader* fetchNextFreeArena(); }; -JS_STATIC_ASSERT(sizeof(Chunk) == GC_CHUNK_SIZE); +JS_STATIC_ASSERT(sizeof(Chunk) == ChunkSize); class ChunkPool { Chunk *emptyChunkListHead; @@ -702,6 +777,9 @@ class ChunkPool { /* Must be called either during the GC or with the GC lock taken. */ void expire(JSRuntime *rt, bool releaseAll); + + /* Must be called either during the GC or with the GC lock taken. */ + JS_FRIEND_API(int64) countDecommittedArenas(JSRuntime *rt); }; inline uintptr_t @@ -726,7 +804,7 @@ Cell::chunk() const { uintptr_t addr = uintptr_t(this); JS_ASSERT(addr % Cell::CellSize == 0); - addr &= ~(GC_CHUNK_SIZE - 1); + addr &= ~(ChunkSize - 1); return reinterpret_cast(addr); } @@ -744,20 +822,6 @@ Cell::isAligned() const } #endif -inline void -ArenaHeader::init(JSCompartment *comp, AllocKind kind) -{ - JS_ASSERT(!allocated()); - JS_ASSERT(!hasDelayedMarking); - compartment = comp; - - JS_STATIC_ASSERT(FINALIZE_LIMIT <= 255); - allocKind = size_t(kind); - - /* See comments in FreeSpan::allocateFromNewArena. */ - firstFreeSpanOffsets = FreeSpan::FullArenaOffsets; -} - inline uintptr_t ArenaHeader::address() const { @@ -808,7 +872,7 @@ ChunkBitmap::getMarkWordAndMask(const Cell *cell, uint32 color, uintptr_t **wordp, uintptr_t *maskp) { JS_ASSERT(cell->chunk() == Chunk::fromAddress(reinterpret_cast(this))); - size_t bit = (cell->address() & GC_CHUNK_MASK) / Cell::CellSize + color; + size_t bit = (cell->address() & ChunkMask) / Cell::CellSize + color; JS_ASSERT(bit < ArenaBitmapBits * ArenasPerChunk); *maskp = uintptr_t(1) << (bit % JS_BITS_PER_WORD); *wordp = &bitmap[bit / JS_BITS_PER_WORD]; @@ -1152,7 +1216,7 @@ struct ArenaLists { * chunks with total capacity of 16MB to avoid buffer resizes during browser * startup. */ -const size_t INITIAL_CHUNK_CAPACITY = 16 * 1024 * 1024 / GC_CHUNK_SIZE; +const size_t INITIAL_CHUNK_CAPACITY = 16 * 1024 * 1024 / ChunkSize; /* The number of GC cycles an empty chunk can survive before been released. */ const size_t MAX_EMPTY_CHUNK_AGE = 4; @@ -1457,13 +1521,13 @@ struct GCChunkHasher { * ratio. */ static HashNumber hash(gc::Chunk *chunk) { - JS_ASSERT(!(jsuword(chunk) & GC_CHUNK_MASK)); - return HashNumber(jsuword(chunk) >> GC_CHUNK_SHIFT); + JS_ASSERT(!(jsuword(chunk) & gc::ChunkMask)); + return HashNumber(jsuword(chunk) >> gc::ChunkShift); } static bool match(gc::Chunk *k, gc::Chunk *l) { - JS_ASSERT(!(jsuword(k) & GC_CHUNK_MASK)); - JS_ASSERT(!(jsuword(l) & GC_CHUNK_MASK)); + JS_ASSERT(!(jsuword(k) & gc::ChunkMask)); + JS_ASSERT(!(jsuword(l) & gc::ChunkMask)); return k == l; } }; @@ -1653,6 +1717,7 @@ void MarkStackRangeConservatively(JSTracer *trc, Value *begin, Value *end); typedef void (*IterateCompartmentCallback)(JSContext *cx, void *data, JSCompartment *compartment); +typedef void (*IterateChunkCallback)(JSContext *cx, void *data, gc::Chunk *chunk); typedef void (*IterateArenaCallback)(JSContext *cx, void *data, gc::Arena *arena, JSGCTraceKind traceKind, size_t thingSize); typedef void (*IterateCellCallback)(JSContext *cx, void *data, void *thing, @@ -1669,6 +1734,12 @@ IterateCompartmentsArenasCells(JSContext *cx, void *data, IterateArenaCallback arenaCallback, IterateCellCallback cellCallback); +/* + * Invoke chunkCallback on every in-use chunk. + */ +extern JS_FRIEND_API(void) +IterateChunks(JSContext *cx, void *data, IterateChunkCallback chunkCallback); + /* * Invoke cellCallback on every in-use object of the specified thing kind for * the given compartment or for all compartments if it is null. diff --git a/js/src/jsgcchunk.cpp b/js/src/jsgcchunk.cpp index 2529166fe9c..c48245e3fc9 100644 --- a/js/src/jsgcchunk.cpp +++ b/js/src/jsgcchunk.cpp @@ -55,6 +55,7 @@ # include # include # include +# include #elif defined(XP_UNIX) @@ -271,22 +272,23 @@ UnmapPages(void *addr, size_t size) #endif namespace js { +namespace gc { -inline void * +static inline void * FindChunkStart(void *p) { jsuword addr = reinterpret_cast(p); - addr = (addr + GC_CHUNK_MASK) & ~GC_CHUNK_MASK; + addr = (addr + ChunkMask) & ~ChunkMask; return reinterpret_cast(addr); } void * -AllocGCChunk() +AllocChunk() { void *p; #ifdef JS_GC_HAS_MAP_ALIGN - p = MapAlignedPages(GC_CHUNK_SIZE, GC_CHUNK_SIZE); + p = MapAlignedPages(ChunkSize, ChunkSize); if (!p) return NULL; #else @@ -296,24 +298,24 @@ AllocGCChunk() * final result via one mapping operation. This means unmapping any * preliminary result that is not correctly aligned. */ - p = MapPages(NULL, GC_CHUNK_SIZE); + p = MapPages(NULL, ChunkSize); if (!p) return NULL; - if (reinterpret_cast(p) & GC_CHUNK_MASK) { - UnmapPages(p, GC_CHUNK_SIZE); - p = MapPages(FindChunkStart(p), GC_CHUNK_SIZE); + if (reinterpret_cast(p) & ChunkMask) { + UnmapPages(p, ChunkSize); + p = MapPages(FindChunkStart(p), ChunkSize); while (!p) { /* * Over-allocate in order to map a memory region that is * definitely large enough then deallocate and allocate again the * correct size, within the over-sized mapping. */ - p = MapPages(NULL, GC_CHUNK_SIZE * 2); + p = MapPages(NULL, ChunkSize * 2); if (!p) return 0; - UnmapPages(p, GC_CHUNK_SIZE * 2); - p = MapPages(FindChunkStart(p), GC_CHUNK_SIZE); + UnmapPages(p, ChunkSize * 2); + p = MapPages(FindChunkStart(p), ChunkSize); /* * Failure here indicates a race with another thread, so @@ -323,17 +325,55 @@ AllocGCChunk() } #endif /* !JS_GC_HAS_MAP_ALIGN */ - JS_ASSERT(!(reinterpret_cast(p) & GC_CHUNK_MASK)); + JS_ASSERT(!(reinterpret_cast(p) & ChunkMask)); return p; } void -FreeGCChunk(void *p) +FreeChunk(void *p) { JS_ASSERT(p); - JS_ASSERT(!(reinterpret_cast(p) & GC_CHUNK_MASK)); - UnmapPages(p, GC_CHUNK_SIZE); + JS_ASSERT(!(reinterpret_cast(p) & ChunkMask)); + UnmapPages(p, ChunkSize); } +#ifdef XP_WIN +bool +CommitMemory(void *addr, size_t size) +{ + JS_ASSERT(uintptr_t(addr) % 4096UL == 0); + return true; +} + +bool +DecommitMemory(void *addr, size_t size) +{ + JS_ASSERT(uintptr_t(addr) % 4096UL == 0); + LPVOID p = VirtualAlloc(addr, size, MEM_RESET, PAGE_READWRITE); + return p == addr; +} +#elif defined XP_OSX || defined XP_UNIX +# ifndef MADV_DONTNEED +# define MADV_DONTNEED MADV_FREE +# endif +bool +CommitMemory(void *addr, size_t size) +{ + JS_ASSERT(uintptr_t(addr) % 4096UL == 0); + return true; +} + +bool +DecommitMemory(void *addr, size_t size) +{ + JS_ASSERT(uintptr_t(addr) % 4096UL == 0); + int result = madvise(addr, size, MADV_DONTNEED); + return result != -1; +} +#else +# error "No CommitMemory defined on this platform." +#endif + +} /* namespace gc */ } /* namespace js */ diff --git a/js/src/jsgcchunk.h b/js/src/jsgcchunk.h index df648ce9545..465c45ba213 100644 --- a/js/src/jsgcchunk.h +++ b/js/src/jsgcchunk.h @@ -44,17 +44,25 @@ #include "jsutil.h" namespace js { +namespace gc { -const size_t GC_CHUNK_SHIFT = 20; -const size_t GC_CHUNK_SIZE = size_t(1) << GC_CHUNK_SHIFT; -const size_t GC_CHUNK_MASK = GC_CHUNK_SIZE - 1; +const size_t ChunkShift = 20; +const size_t ChunkSize = size_t(1) << ChunkShift; +const size_t ChunkMask = ChunkSize - 1; void * -AllocGCChunk(); +AllocChunk(); void -FreeGCChunk(void *p); +FreeChunk(void *p); -} +bool +CommitMemory(void *addr, size_t size); + +bool +DecommitMemory(void *addr, size_t size); + +} /* namespace gc */ +} /* namespace js */ #endif /* jsgchunk_h__ */ diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index 72bbd05e13a..0bf3bcfeda1 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -1284,11 +1284,21 @@ CompartmentCallback(JSContext *cx, void *vdata, JSCompartment *compartment) moz_malloc_usable_size); } +void +ChunkCallback(JSContext *cx, void *vdata, js::gc::Chunk *chunk) +{ + IterateData *data = static_cast(vdata); + for (uint32 i = 0; i < js::gc::ArenasPerChunk; i++) + if (chunk->decommittedArenas.get(i)) + data->gcHeapChunkDirtyDecommitted += js::gc::ArenaSize; +} + void ArenaCallback(JSContext *cx, void *vdata, js::gc::Arena *arena, JSGCTraceKind traceKind, size_t thingSize) { IterateData *data = static_cast(vdata); + data->currCompartmentStats->gcHeapArenaHeaders += sizeof(js::gc::ArenaHeader); size_t allocationSpace = arena->thingsSpan(thingSize); @@ -1431,7 +1441,7 @@ static PRInt64 GetGCChunkTotalBytes() { JSRuntime *rt = nsXPConnect::GetRuntimeInstance()->GetJSRuntime(); - return PRInt64(JS_GetGCParameter(rt, JSGC_TOTAL_CHUNKS)) * js::GC_CHUNK_SIZE; + return PRInt64(JS_GetGCParameter(rt, JSGC_TOTAL_CHUNKS)) * js::gc::ChunkSize; } NS_MEMORY_REPORTER_IMPLEMENT(XPConnectJSGCHeap, @@ -1550,15 +1560,20 @@ CollectCompartmentStatsForRuntime(JSRuntime *rt, IterateData *data) data->compartmentStatsVector.SetCapacity(rt->compartments.length()); + data->gcHeapChunkCleanDecommitted = + rt->gcChunkPool.countDecommittedArenas(rt) * + js::gc::ArenaSize; data->gcHeapChunkCleanUnused = PRInt64(JS_GetGCParameter(rt, JSGC_UNUSED_CHUNKS)) * - js::GC_CHUNK_SIZE; + js::gc::ChunkSize - + data->gcHeapChunkCleanDecommitted; data->gcHeapChunkTotal = PRInt64(JS_GetGCParameter(rt, JSGC_TOTAL_CHUNKS)) * - js::GC_CHUNK_SIZE; + js::gc::ChunkSize; js::IterateCompartmentsArenasCells(cx, data, CompartmentCallback, ArenaCallback, CellCallback); + js::IterateChunks(cx, data, ChunkCallback); for (js::ThreadDataIter i(rt); !i.empty(); i.popFront()) data->stackSize += i.threadData()->stackSpace.committedSize(); @@ -1577,7 +1592,9 @@ CollectCompartmentStatsForRuntime(JSRuntime *rt, IterateData *data) // This is initialized to all bytes stored in used chunks, and then we // subtract used space from it each time around the loop. data->gcHeapChunkDirtyUnused = data->gcHeapChunkTotal - - data->gcHeapChunkCleanUnused; + data->gcHeapChunkCleanUnused - + data->gcHeapChunkCleanDecommitted - + data->gcHeapChunkDirtyDecommitted; for (PRUint32 index = 0; index < data->compartmentStatsVector.Length(); @@ -1625,7 +1642,7 @@ CollectCompartmentStatsForRuntime(JSRuntime *rt, IterateData *data) size_t numDirtyChunks = (data->gcHeapChunkTotal - data->gcHeapChunkCleanUnused) / - js::GC_CHUNK_SIZE; + js::gc::ChunkSize; PRInt64 perChunkAdmin = sizeof(js::gc::Chunk) - (sizeof(js::gc::Arena) * js::gc::ArenasPerChunk); data->gcHeapChunkAdmin = numDirtyChunks * perChunkAdmin; @@ -1636,6 +1653,8 @@ CollectCompartmentStatsForRuntime(JSRuntime *rt, IterateData *data) // they can be fractional. data->gcHeapUnusedPercentage = (data->gcHeapChunkCleanUnused + data->gcHeapChunkDirtyUnused + + data->gcHeapChunkCleanDecommitted + + data->gcHeapChunkDirtyDecommitted + data->gcHeapArenaUnused) * 10000 / data->gcHeapChunkTotal; @@ -1915,14 +1934,25 @@ ReportJSRuntimeStats(const IterateData &data, const nsACString &pathPrefix, JS_GC_HEAP_KIND, data.gcHeapChunkDirtyUnused, "Memory on the garbage-collected JavaScript heap, within chunks with at " "least one allocated GC thing, that could be holding useful data but " - "currently isn't.", + "currently isn't. Memory here is mutually exclusive with memory reported" + "under gc-heap-decommitted.", callback, closure); ReportMemoryBytes(pathPrefix + NS_LITERAL_CSTRING("gc-heap-chunk-clean-unused"), JS_GC_HEAP_KIND, data.gcHeapChunkCleanUnused, "Memory on the garbage-collected JavaScript heap taken by completely empty " - "chunks, that soon will be released unless claimed for new allocations.", + "chunks, that soon will be released unless claimed for new allocations. " + "Memory here is mutually exclusive with memory reported under " + "gc-heap-decommitted.", + callback, closure); + + ReportMemoryBytes(pathPrefix + + NS_LITERAL_CSTRING("gc-heap-decommitted"), + JS_GC_HEAP_KIND, + data.gcHeapChunkCleanDecommitted + data.gcHeapChunkDirtyDecommitted, + "Memory in the address space of the garbage-collected JavaScript heap that " + "is currently returned to the OS.", callback, closure); ReportMemoryBytes(pathPrefix + @@ -1931,6 +1961,7 @@ ReportJSRuntimeStats(const IterateData &data, const nsACString &pathPrefix, "Memory on the garbage-collected JavaScript heap, within chunks, that is " "used to hold internal book-keeping information.", callback, closure); + } } // namespace memory @@ -1975,8 +2006,16 @@ public: "easy comparison with other 'js-gc' reporters.", callback, closure); + ReportMemoryBytes(NS_LITERAL_CSTRING("js-gc-heap-decommitted"), + nsIMemoryReporter::KIND_OTHER, + data.gcHeapChunkCleanDecommitted + data.gcHeapChunkDirtyDecommitted, + "The same as 'explicit/js/gc-heap-decommitted'. Shown here for " + "easy comparison with other 'js-gc' reporters.", + callback, closure); + ReportMemoryBytes(NS_LITERAL_CSTRING("js-gc-heap-arena-unused"), - nsIMemoryReporter::KIND_OTHER, data.gcHeapArenaUnused, + nsIMemoryReporter::KIND_OTHER, + data.gcHeapArenaUnused, "Memory on the garbage-collected JavaScript heap, within arenas, that " "could be holding useful data but currently isn't. This is the sum of " "all compartments' 'gc-heap/arena-unused' numbers.", diff --git a/js/xpconnect/src/xpcpublic.h b/js/xpconnect/src/xpcpublic.h index 1b84851f18e..5d51da723a8 100644 --- a/js/xpconnect/src/xpcpublic.h +++ b/js/xpconnect/src/xpcpublic.h @@ -237,6 +237,8 @@ struct IterateData gcHeapChunkTotal(0), gcHeapChunkCleanUnused(0), gcHeapChunkDirtyUnused(0), + gcHeapChunkCleanDecommitted(0), + gcHeapChunkDirtyDecommitted(0), gcHeapArenaUnused(0), gcHeapChunkAdmin(0), gcHeapUnusedPercentage(0), @@ -258,6 +260,8 @@ struct IterateData PRInt64 gcHeapChunkTotal; PRInt64 gcHeapChunkCleanUnused; PRInt64 gcHeapChunkDirtyUnused; + PRInt64 gcHeapChunkCleanDecommitted; + PRInt64 gcHeapChunkDirtyDecommitted; PRInt64 gcHeapArenaUnused; PRInt64 gcHeapChunkAdmin; PRInt64 gcHeapUnusedPercentage; From 59155e6fa39939c4b5764d98cc351e6f3a01189e Mon Sep 17 00:00:00 2001 From: Dave Camp Date: Sat, 5 Nov 2011 08:41:10 -0700 Subject: [PATCH 066/127] Bug 699592 - Add inIDOMUtils::isInheritedProperty to find out if a CSS property is inherited by default. r=bz --- layout/inspector/public/inIDOMUtils.idl | 5 ++- layout/inspector/src/inDOMUtils.cpp | 18 +++++++++ layout/inspector/tests/Makefile.in | 1 + .../tests/test_isinheritableproperty.html | 39 +++++++++++++++++++ 4 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 layout/inspector/tests/test_isinheritableproperty.html diff --git a/layout/inspector/public/inIDOMUtils.idl b/layout/inspector/public/inIDOMUtils.idl index 9445719cec6..d245785036b 100644 --- a/layout/inspector/public/inIDOMUtils.idl +++ b/layout/inspector/public/inIDOMUtils.idl @@ -49,13 +49,16 @@ interface nsIDOMNodeList; interface nsIDOMFontFaceList; interface nsIDOMRange; -[scriptable, uuid(70205D9E-EFD7-4658-8E9E-690400B57FD0)] +[scriptable, uuid(0D9E5532-F5D5-44DD-94CA-D9EED5778B1C)] interface inIDOMUtils : nsISupports { // CSS utilities nsISupportsArray getCSSStyleRules(in nsIDOMElement aElement, [optional] in DOMString aPseudo); unsigned long getRuleLine(in nsIDOMCSSStyleRule aRule); + // Returns true if the string names a property that is inherited by default. + bool isInheritedProperty(in AString aPropertyName); + // DOM Node utilities boolean isIgnorableWhitespace(in nsIDOMCharacterData aDataNode); // Returns the "parent" of a node. The parent of a document node is the diff --git a/layout/inspector/src/inDOMUtils.cpp b/layout/inspector/src/inDOMUtils.cpp index df5de07e888..2e29a9d8d37 100644 --- a/layout/inspector/src/inDOMUtils.cpp +++ b/layout/inspector/src/inDOMUtils.cpp @@ -244,6 +244,24 @@ inDOMUtils::GetRuleLine(nsIDOMCSSStyleRule *aRule, PRUint32 *_retval) return NS_OK; } +NS_IMETHODIMP +inDOMUtils::IsInheritedProperty(const nsAString &aPropertyName, bool *_retval) +{ + nsCSSProperty prop = nsCSSProps::LookupProperty(aPropertyName); + if (prop == eCSSProperty_UNKNOWN) { + *_retval = false; + return NS_OK; + } + + if (nsCSSProps::IsShorthand(prop)) { + prop = nsCSSProps::SubpropertyEntryFor(prop)[0]; + } + + nsStyleStructID sid = nsCSSProps::kSIDTable[prop]; + *_retval = !nsCachedStyleData::IsReset(sid); + return NS_OK; +} + NS_IMETHODIMP inDOMUtils::GetBindingURLs(nsIDOMElement *aElement, nsIArray **_retval) { diff --git a/layout/inspector/tests/Makefile.in b/layout/inspector/tests/Makefile.in index 0b2e25fc425..0cf75f6dc2b 100644 --- a/layout/inspector/tests/Makefile.in +++ b/layout/inspector/tests/Makefile.in @@ -52,6 +52,7 @@ _TEST_FILES =\ test_bug536379-2.html \ test_bug557726.html \ test_bug609549.xhtml \ + test_isinheritableproperty.html \ $(NULL) libs:: $(_TEST_FILES) diff --git a/layout/inspector/tests/test_isinheritableproperty.html b/layout/inspector/tests/test_isinheritableproperty.html new file mode 100644 index 00000000000..2b5e3b77e9d --- /dev/null +++ b/layout/inspector/tests/test_isinheritableproperty.html @@ -0,0 +1,39 @@ + + + + + Test for nsIDOMUtils::isInheritedProperty + + + + +
+
+
+ + From 1eda249064e08e79bbe20f14e021b1c6dd80a63f Mon Sep 17 00:00:00 2001 From: Dave Camp Date: Sat, 5 Nov 2011 08:45:22 -0700 Subject: [PATCH 067/127] Bug 696180 - Add support for inherited properties to the rule view. r=robcee --- .../devtools/styleinspector/CssRuleView.jsm | 94 ++++++++++++---- .../styleinspector/test/browser/Makefile.in | 1 + .../test/browser/browser_ruleview_inherit.js | 101 ++++++++++++++++++ .../devtools/styleinspector.properties | 7 ++ 4 files changed, 185 insertions(+), 18 deletions(-) create mode 100644 browser/devtools/styleinspector/test/browser/browser_ruleview_inherit.js diff --git a/browser/devtools/styleinspector/CssRuleView.jsm b/browser/devtools/styleinspector/CssRuleView.jsm index b2b91b4f9e0..3fc576e1802 100644 --- a/browser/devtools/styleinspector/CssRuleView.jsm +++ b/browser/devtools/styleinspector/CssRuleView.jsm @@ -125,19 +125,29 @@ ElementStyle.prototype = { { this.rules = []; + let element = this.element; + do { + this._addElementRules(element); + } while ((element = element.parentNode) && + element.nodeType === Ci.nsIDOMNode.ELEMENT_NODE); + + // Mark overridden computed styles. + this.markOverridden(); + }, + + _addElementRules: function ElementStyle_addElementRules(aElement) + { + let inherited = aElement !== this.element ? aElement : null; + // Include the element's style first. - this.rules.push(new Rule(this, { - style: this.element.style, - selectorText: CssLogic.l10n("rule.sourceElement") - })); + this._maybeAddRule({ + style: aElement.style, + selectorText: CssLogic.l10n("rule.sourceElement"), + inherited: inherited + }); // Get the styles that apply to the element. - try { - var domRules = this.domUtils.getCSSStyleRules(this.element); - } catch (ex) { - Services.console.logStringMessage("ElementStyle_populate error: " + ex); - return; - } + var domRules = this.domUtils.getCSSStyleRules(aElement); // getCSStyleRules returns ordered from least-specific to // most-specific. @@ -150,14 +160,43 @@ ElementStyle.prototype = { continue; } - // XXX: non-style rules. - if (domRule.type === Ci.nsIDOMCSSRule.STYLE_RULE) { - this.rules.push(new Rule(this, { domRule: domRule })); + if (domRule.type !== Ci.nsIDOMCSSRule.STYLE_RULE) { + continue; } + + this._maybeAddRule({ + domRule: domRule, + inherited: inherited + }); + } + }, + + /** + * Add a rule if it's one we care about. Filters out duplicates and + * inherited styles with no inherited properties. + * + * @param {object} aOptions + * Options for creating the Rule, see the Rule constructor. + * + * @return true if we added the rule. + */ + _maybeAddRule: function ElementStyle_maybeAddRule(aOptions) + { + // If we've already included this domRule (for example, when a + // common selector is inherited), ignore it. + if (aOptions.domRule && + this.rules.some(function(rule) rule.domRule === aOptions.domRule)) { + return false; } - // Mark overridden computed styles. - this.markOverridden(); + let rule = new Rule(this, aOptions); + + // Ignore inherited rules with no properties. + if (aOptions.inherited && rule.textProps.length == 0) { + return false; + } + + this.rules.push(rule); }, /** @@ -178,7 +217,7 @@ ElementStyle.prototype = { let computedProps = []; for each (let textProp in textProps) { computedProps = computedProps.concat(textProp.computed); - }; + } // Walk over the computed properties. As we see a property name // for the first time, mark that property's name as taken by this @@ -273,6 +312,8 @@ ElementStyle.prototype = { * the domRule's style will be used. * selectorText: selector text to display. If omitted, the domRule's * selectorText will be used. + * inherited: An element this rule was inherited from. If omitted, + * the rule applies directly to the current element. * @constructor */ function Rule(aElementStyle, aOptions) @@ -281,7 +322,7 @@ function Rule(aElementStyle, aOptions) this.domRule = aOptions.domRule || null; this.style = aOptions.style || this.domRule.style; this.selectorText = aOptions.selectorText || this.domRule.selectorText; - + this.inherited = aOptions.inherited || null; this._getTextProperties(); } @@ -297,6 +338,17 @@ Rule.prototype = { let line = this.elementStyle.domUtils.getRuleLine(this.domRule); this._title += ":" + line; } + + if (this.inherited) { + let eltText = this.inherited.tagName.toLowerCase(); + if (this.inherited.id) { + eltText += "#" + this.inherited.id; + } + let args = [eltText, this._title]; + this._title = CssLogic._strings.formatStringFromName("rule.inheritedSource", + args, args.length); + } + return this._title; }, @@ -416,7 +468,13 @@ Rule.prototype = { if(!matches || !matches[2]) continue; - let prop = new TextProperty(this, matches[1], matches[2], matches[3] || ""); + let name = matches[1]; + if (this.inherited && + !this.elementStyle.domUtils.isInheritedProperty(name)) { + continue; + } + + let prop = new TextProperty(this, name, matches[2], matches[3] || ""); this.textProps.push(prop); } }, diff --git a/browser/devtools/styleinspector/test/browser/Makefile.in b/browser/devtools/styleinspector/test/browser/Makefile.in index 994365070da..df8ab992ab9 100644 --- a/browser/devtools/styleinspector/test/browser/Makefile.in +++ b/browser/devtools/styleinspector/test/browser/Makefile.in @@ -53,6 +53,7 @@ _BROWSER_TEST_FILES = \ browser_styleinspector_bug_672744_search_filter.js \ browser_bug_692400_element_style.js \ browser_ruleview_editor.js \ + browser_ruleview_inherit.js \ browser_ruleview_manipulation.js \ browser_ruleview_override.js \ browser_ruleview_ui.js \ diff --git a/browser/devtools/styleinspector/test/browser/browser_ruleview_inherit.js b/browser/devtools/styleinspector/test/browser/browser_ruleview_inherit.js new file mode 100644 index 00000000000..cd76aae880b --- /dev/null +++ b/browser/devtools/styleinspector/test/browser/browser_ruleview_inherit.js @@ -0,0 +1,101 @@ +/* vim: set ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +Cu.import("resource:///modules/devtools/CssRuleView.jsm"); + +let doc; + +function simpleInherit() +{ + let style = '' + + '#test2 {' + + ' background-color: green;' + + ' color: purple;' + + '}'; + + let styleNode = addStyle(doc, style); + doc.body.innerHTML = '
Styled Node
'; + + let elementStyle = new _ElementStyle(doc.getElementById("test1")); + + is(elementStyle.rules.length, 2, "Should have 2 rules."); + + let elementRule = elementStyle.rules[0]; + ok(!elementRule.inherited, "Element style attribute should not consider itself inherited."); + + let inheritRule = elementStyle.rules[1]; + is(inheritRule.selectorText, "#test2", "Inherited rule should be the one that includes inheritable properties."); + ok(!!inheritRule.inherited, "Rule should consider itself inherited."); + is(inheritRule.textProps.length, 1, "Should only display one inherited style"); + let inheritProp = inheritRule.textProps[0]; + is(inheritProp.name, "color", "color should have been inherited."); + + styleNode.parentNode.removeChild(styleNode); + + emptyInherit(); +} + +function emptyInherit() +{ + // No inheritable styles, this rule shouldn't show up. + let style = '' + + '#test2 {' + + ' background-color: green;' + + '}'; + + let styleNode = addStyle(doc, style); + doc.body.innerHTML = '
Styled Node
'; + + let elementStyle = new _ElementStyle(doc.getElementById("test1")); + + is(elementStyle.rules.length, 1, "Should have 1 rule."); + + let elementRule = elementStyle.rules[0]; + ok(!elementRule.inherited, "Element style attribute should not consider itself inherited."); + + styleNode.parentNode.removeChild(styleNode); + + elementStyleInherit(); +} + +function elementStyleInherit() +{ + doc.body.innerHTML = '
Styled Node
'; + + let elementStyle = new _ElementStyle(doc.getElementById("test1")); + + is(elementStyle.rules.length, 2, "Should have 2 rules."); + + let elementRule = elementStyle.rules[0]; + ok(!elementRule.inherited, "Element style attribute should not consider itself inherited."); + + let inheritRule = elementStyle.rules[1]; + ok(!inheritRule.domRule, "Inherited rule should be an element style, not a rule."); + ok(!!inheritRule.inherited, "Rule should consider itself inherited."); + is(inheritRule.textProps.length, 1, "Should only display one inherited style"); + let inheritProp = inheritRule.textProps[0]; + is(inheritProp.name, "color", "color should have been inherited."); + + finishTest(); +} + +function finishTest() +{ + doc = null; + gBrowser.removeCurrentTab(); + finish(); +} + +function test() +{ + waitForExplicitFinish(); + gBrowser.selectedTab = gBrowser.addTab(); + gBrowser.selectedBrowser.addEventListener("load", function(evt) { + gBrowser.selectedBrowser.removeEventListener(evt.type, arguments.callee, true); + doc = content.document; + waitForFocus(simpleInherit, content); + }, true); + + content.location = "data:text/html,basic style inspector tests"; +} diff --git a/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties b/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties index f04eb2b15fd..13ec8c81fa0 100644 --- a/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties +++ b/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties @@ -19,6 +19,12 @@ rule.status.UNMATCHED=Unmatched rule.sourceInline=inline rule.sourceElement=element +# LOCALIZATION NOTE (rule.inheritedSource): Shown for CSS rules +# that were inherited from a parent node. Will be passed a node +# identifier and a source location. +# e.g "Inherited from body#bodyID (styles.css:20)" +rule.inheritedSource=Inherited from %S (%S) + # LOCALIZATION NOTE (group): Style properties are displayed in categories and # these are the category names. group.Text_Fonts_and_Color=Text, Fonts & Color @@ -34,3 +40,4 @@ group.Effects_and_Other=Effects and Other style.highlighter.button.label1=Properties style.highlighter.accesskey1=P style.highlighter.button.tooltip=Inspect element styles + From 61e11c69a1a8d2fdaddb2b326f4557739201655a Mon Sep 17 00:00:00 2001 From: Dave Camp Date: Sat, 5 Nov 2011 08:46:40 -0700 Subject: [PATCH 068/127] Bug 699968 - Update the rule view's dtd link. r=robcee --- browser/devtools/styleinspector/cssruleview.xhtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/devtools/styleinspector/cssruleview.xhtml b/browser/devtools/styleinspector/cssruleview.xhtml index f06f0f18a64..c0518525a34 100644 --- a/browser/devtools/styleinspector/cssruleview.xhtml +++ b/browser/devtools/styleinspector/cssruleview.xhtml @@ -1,7 +1,7 @@ %htmlDTD; - + %inspectorDTD; ]> + xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> @@ -63,8 +63,7 @@ -
-
+
@@ -74,6 +73,14 @@
+ + &bestMatch; + &matched; + &parentMatch; + &unmatched; + + + @@ -83,15 +90,16 @@ To visually debug the templates without running firefox, alter the display:none styles" checkbox. For data it needs an instance of CssHtmlTree. -->
-
+ - -
+ +
-
-
- ${name} +
+
+
${name}
+
${value}
-
@@ -172,7 +181,7 @@ To visually debug the templates without running firefox, alter the display:none - + + + - + - - - + + + + + + diff --git a/browser/themes/gnomestripe/browser/devtools/arrows.png b/browser/themes/gnomestripe/browser/devtools/arrows.png index 95e7217927854ed98dd7e55123709ad8baf126f9..447d73938398ff2c09efafc33d14c82252229668 100644 GIT binary patch delta 812 zcmV+{1JnGa2l57x83+OZ001ya>kyG4K7R`Y3_1diBBnb400Qz!L_t(I%Y~EQPZL=b z$G_*^mH~AmOkxE!kyxU*OlPK>mB>B-55BnDU2%17YU`_i1Fj)i)&zWq|A1dAxEgIj zl+6b4X^lZBZ59Q#YBV(@v|Tmn)NwfbFatKm;C(yip8Gl9dwx*wmHx;NC%*|B_=WB)ms2WU}l$g_^>LEw|$q* zX75k^rK)N}{ocg#s}0y{s;nVEUk*Ejp%!3(Qwe}8}S$mHa5u}~@$tzywC7Og^|6p!lyfNk4CAel^F z?&+OhSgb^hU7xsgxo2f%xytW%90x$xsUJ(0Rau{M*)~lRU?R$93%~cyba(%m$*fg! zW@n#Yym)7D@L};k3(R1&wH>IfRUo_oA_Rk~rUiVi0l@z7K}sZ($r}?le}6f1I+aTQ zv$RxGt@t;k@FqQ^g;rLU9mfHv%I}LrA^_YrGK0a{Y@zqJ>0pzZNa(rTyYcZ%K3@`o zKm-N|LI6NKt`81A1i8;Bkza^KO6jIzFu=?V;C$>{$+8## z*ecs$QwJbK#b*Hq^7&FO_kXUTVVA1bc;#g8Qya_xIyxHb>Z%1n2s#w3bLYm&;|>AB&#t{Sdi6v)y*50YT3yZ4<^Z<0 z9~>D;scKD2i?^OWW(1p>;<4y9iyAidu&K{IUbuZHS&`%Gqs`4*=Kg(Ob)9PN>}=eI qqiLS3si~)1&S+HIvl(Z{mia$#>@r2p07;Vo0000 delta 863 zcmV-l1EBo!2Bim(83+ad006%$d`FQXK7R)U2{9a0;%#{V00SjSL_t(I%Z-#zY!qb} z#(&SZ1hxkRgceivVA94v7qr+KPFlDbf`^Xo8e^fxvlk=AizX%*!qKaQieA|8ZKH&E zQQCTHw8f-}iRczRxj>1Pa&WiH&O9DwyKNIOe3?u#Gw=7#^XGj&(X;v13ideABIp?`QwRnbLJB~;^>cab{6FpXS~bSf^w@z5R2Rz+)P5|f9Cy|} z8p5_Uq^AJ{wk@Q*$es(39YOwqV(%m{2td#N{{g=H7&~??AWahVEYexf<3Jy%7ubi@ z2Mlm;^;A1;jRIGaq%zMSqX1{W_kVrcCrM>INh6eJvQ0Jp>$-G$a@zf1V0C z6Wv7`#h$0wdk%XbC$e{=bMfJ$?AY@oFp1TVX=0hy>J{+soho(i#(V`V0g{BIgMl!e zB$fGZKE3b~z?nmTYyf|?@@A4$>cDx#BiINO<7*df->}%s+Q34LrD@T#_kSl~U+1+t zKi>ncf=`j92MF8VMGSz}x*);e291?Lw(mX$Oj0N`F&TuNNW(OiYe`c1MbcBb<3^IP zWthjD1P>y81UxFqraK^{>AmYyQ*R6;No71ICURmTBRfounE)0LfC3@_0l5i0nS(DZ z0>5Gvfh-3|3S^)RfYzN$NPpKm5*V1Gv0NjUKkMq&f!2|-A3O-E0d;k?^(L7ufEY_( z05=5ANqV6g%QMx*GJ!M`X&OjVk)}nmtd5zWxpIis-H1Ys=E?~uJcq+~5OzW#!-b8o z=HNaC@5tTLC+j&f1Z<2umv17*V=O%utL4u|>Lar;mPS%%qqeUqH-FgqBzDaJ@xE|mijxR@SkfP5H)6E pEDZxk(kz|ZQe=OK`CxPS{{?YTh?UJ}5zhbs002ovPDHLkV1n3kjC=q9 diff --git a/browser/themes/gnomestripe/browser/devtools/csshtmltree.css b/browser/themes/gnomestripe/browser/devtools/csshtmltree.css index 98b32c0ffba..6c2378f0ded 100644 --- a/browser/themes/gnomestripe/browser/devtools/csshtmltree.css +++ b/browser/themes/gnomestripe/browser/devtools/csshtmltree.css @@ -37,77 +37,109 @@ * * ***** END LICENSE BLOCK ***** */ +html { + height: 100%; +} + body { font-family: sans-serif; font-size: 11px; - background: #EEE; + background: -moz-Field; + margin: 0; + width: 100%; + height: 100%; + display: -moz-box; + -moz-box-orient: vertical; } -.path, -.filters { + +#root { + display: -moz-box; +} + +#path { font-size: 11px; word-spacing: -1px; + margin-bottom: 0; + color: -moz-dialogtext; + background-color: -moz-dialog; + padding: 4px 5px 0; } -.path ol { +#path ol { list-style: none outside none; margin: 0; padding: 0; } -.path li { +#path li { border-radius: 3px; padding: 2px 3px; - text-shadow: #FFF 0 1px 0; - font-weight: bold; font-size: 11px; - background: -moz-linear-gradient(top, #F6F6FF, #E3E3FF); display: inline-block; } -.path li:after { +#path li:after { content: " > "; } -.path li:last-child { - background: -moz-linear-gradient(top, #FFC, #DD8); +#path li:last-child { + font-weight: bold; + color: #0091ff; } -.path li:last-child:after { - color: red; +#path li:last-child:after { content: ""; } .property-header { - padding: 2px 5px; - background: -moz-linear-gradient(top, #F8F8F8, #E8E8E8); - color: #666; + padding: 4px; + -moz-padding-start: 0; + -moz-padding-end: 5px; } -.property-name, -.rule-matched, -.rule-unmatched { - cursor: pointer; -} + .rule-unmatched { + cursor: pointer; + padding: 2px; + -moz-padding-start: 4px; + -moz-padding-end: 0; + white-space: nowrap; + } /* Take away these two :visited rules to get a core dumper */ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=575675#c30 */ -.link { - color: #55A; -} +.link, .link:visited { - color: #55A; + color: #0091ff; } -a.link { - text-decoration: none; - cursor: pointer; -} -a.link:visited { +.link, +.helplink, +.link:visited, +.helplink:visited { text-decoration: none; } -.rule-matched, -.rule-unmatched { - padding: 2px 0; - white-space: nowrap; +.helplink-container { + position: relative; + top: 2px; + display: inline-block; + visibility: hidden; +} + +.helplink { + display: block; + height: 0; + width: 14px; + overflow: hidden; + padding-top: 14px; + background-image: url("chrome://browser/skin/devtools/goto-mdn.png"); +} + +.property-header:hover > .helplink-container { + visibility: visible; +} + +.unmatchedSelectorTable { + -moz-margin-start: 15px; } .rulelink { - color: #55A; + color: -moz-dialogtext; + -moz-margin-start: 12px; } .expander { @@ -117,34 +149,45 @@ a.link:visited { -moz-margin-start: 15px; -moz-margin-end: 5px; margin-top: 3px; - background: url("chrome://browser/skin/devtools/arrows.png"); - background-position: 24px 0; -} - -.searchfield { - background: url("chrome://browser/skin/devtools/search.png") no-repeat #FFF; - border-radius: 5px; - -moz-padding-start: 20px; - width: 135px; - float: right; + background: url("chrome://browser/skin/devtools/arrows.png") 48px 0; } .expander[dir="rtl"] { - background-position: 16px 0; + float: right; + background-position: 40px 0; } + .expander[open] { - background-position: 8px 0; + background-position: 32px 0; +} + +.expandable { + cursor: pointer; +} + +.match { + visibility: hidden; +} + +.expandable > .match { + margin-top: 5px; + visibility: visible; +} + +.only-unmatched { + -moz-margin-start: 0; } .property-name { display: inline-block; font-size: 12px; - font-weight: bold; - color: #000; + color: -moz-FieldText; + width: 220px; } .property-value { display: inline-block; font-size: 10px; + color: grey; } .property-view-hidden { @@ -159,11 +202,7 @@ a.link:visited { /* This rule is necessary because Templater.jsm breaks LTR TDs in RTL docs */ .rule-text { direction: ltr; - -moz-padding-start: 10px; -} - -.resizerbox { - background-color: window; + -moz-padding-start: 15px; } .bestmatch { @@ -179,16 +218,62 @@ a.link:visited { color: brown; } -.userStyles { - position: relative; - top: 3px; +#propertyContainer { + display: -moz-box; + -moz-box-orient: vertical; + -moz-box-flex: 1; + overflow-y: auto; } -.userStyles, +.selectedElementLabel { + font-weight: bold; +} + +.darkrow { + background-color: rgba(0,0,0,.022); +} + +.header { + color: -moz-dialogtext; + background-color: -moz-dialog; + padding: 5px 0 0; +} + +.onlyuserstyles, .userStylesLabel { cursor: pointer; } +.userStylesLabel { + display: -moz-box; + white-space: nowrap; +} + +.onlyuserstyles { + position: relative; + top: 3px; + font-family: sans-serif; + font-size: 11px; +} + +.searchfield { + display: -moz-box; + -moz-box-flex: 1; + margin-left: 10px; +} + +.styleinspector-legend { + -moz-margin-start: 12px; +} + +#footer { + border-top: 1px solid -moz-dialog; +} + +.legendKey { + margin: 0 5px; +} + /** * CSS Rule View */ diff --git a/browser/themes/gnomestripe/browser/devtools/goto-mdn.png b/browser/themes/gnomestripe/browser/devtools/goto-mdn.png new file mode 100644 index 0000000000000000000000000000000000000000..dbe064863d65ac3123a7a60070114dd465852de2 GIT binary patch literal 661 zcmV;G0&4wPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipn- z2m%$DyLk=(00I?BL_t(2&sCB?Zxc}v#DDkh-PyVG`C^*@2}yxvJ^(@nAt)nCl!gMO zrA+~m(o!O%NEB%)k%&Zr_zXc%P*5X80V3cS;`rY=j_pCAm;Ism{L!(?)VbC%l= z9$%(%dSAYMm(h5F)*;GQ)E6&NEClSf zI~@xN@-yfKrMq z8>5Z2_(6am7-#vpw-10I094W#fZcWn5D>vShgQCih#(^1pm*W`P@PSvrV0Jwh;DC) z6NeK4546?_>l~g^oO=`y&lK424*1pX9B(0l6CnsRx)enm^!hl!^VK=wpH3I+9L`w) zoOL*BC?zSXvAmIra~Nx|#!i6~>Pz#~7w4y(a~2UtV|gQ0qz!X(<;jA{bFBG~d~(F$ z_=sUPnsO%3xwW#sK-w^8D)%}0^!9nnScB)Cx#JUFA2e6D vlDS%yLZ~q|$CwFWsF|x(Xs&K0ry_uVAQ%nSnI7d%00000NkvXXu0mjf{3jAFJg2T)jk)8oi3#0-$aN1{?c|g2d$P)DnfH z)bz|eTc!8A_bVx6rr0WloBA5~7C5J7WO`H;r3P2|g(O#HCtIc{+1n}DR9FEG$W1Lt zRH(?!$t$+1uvG$^YXxM3g!Ppaz)DK8ZIvL7itr6kaLzAERWQ{v&`mZlGf*%y)H5_T zF*i5YQ7|$vG|)FN(l<2HH8i&}HnK7>P=Ep@plwAdX;wilZcw{`JX@uVl9B=|ef{$C za=mh6z5JqdeM3u2OOP2xM!G;1y2X`wC5aWfdBw^w6I@b@lZ!G7N;32F6hI~>Cgqow z*eU^C3h_d20o>TUVrVb{15Cdnu|VHY&j92lm_lD){7Q3k;i`*Ef>IIg#cFVINM%8) zeo$(0erZuMFyhjbK~@!5ITxiSmgE|*3%U}@%LYUE^S=;CH+X<_DUY+_*M>g48R zX5a|Z>yn>bnwy$e0@Is<&})uUFDNPG765H_NiE7OOHFYr%Fk5*d)X=zw_8kbng`XJ zg4->oIQ8lS9itD5Sfq%C2?0|NhzU=&Kn^_Nr{)1udl4{McN%s-VPIgA^mK6yskn7! z%6@O@M2X|~y}wLSp7Vsg!%%Ea%oGP<hJt3m#n3Ra~TWaQ^{Kiz5rWz1x#4 z6nAuVJZtls6(+d&w65Sf-zJMAe71{^z5d?%Jwz6Uq}=AreyjExt)0s%bVW(~8Ri2Fi7u`xzb{RyV(R$600V!M)7e z+XODmG)R<>biDU`oo&kvcD1n0x8Isy%m~pF>wbMRr%YLfZ~lhw^|O7JiSGHm?5)^K zKHfE9ugzQhbj41uT%=Ll(aRv$aX`NNXi$Y;>v5SN)!8iR#+w; zd0Y1W@!a(*9xRyq;QpjqyZZvKC!hPg=SOgXK%x|@YNw&#y7tHUT5CQ`LlTE9T&C9FT+ExHhp?M zqv>^p%{rxL2O{=fHR)C3Yf8@0*)ID=&Bg3S-7$mi-720@2NJwJme>CAt5?u%{@cIf z(#tQ4F2B5Uc){tDDVKgk+@3T)yJW-i8>~0X^q9WC`hTOIMS|ht@d~@9zs^%Y1*fO0 KpUXO@geCx1^&^4+ diff --git a/browser/themes/gnomestripe/browser/jar.mn b/browser/themes/gnomestripe/browser/jar.mn index 377c6bc9f64..d37625c3d17 100644 --- a/browser/themes/gnomestripe/browser/jar.mn +++ b/browser/themes/gnomestripe/browser/jar.mn @@ -79,12 +79,12 @@ browser.jar: skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) skin/classic/browser/tabview/edit-light.png (tabview/edit-light.png) - skin/classic/browser/tabview/search.png (tabview/search.png) + skin/classic/browser/tabview/search.png (tabview/search.png) skin/classic/browser/tabview/stack-expander.png (tabview/stack-expander.png) skin/classic/browser/tabview/tabview.png (tabview/tabview.png) skin/classic/browser/tabview/tabview.css (tabview/tabview.css) skin/classic/browser/devtools/arrows.png (devtools/arrows.png) - skin/classic/browser/devtools/search.png (devtools/search.png) + skin/classic/browser/devtools/goto-mdn.png (devtools/goto-mdn.png) skin/classic/browser/devtools/csshtmltree.css (devtools/csshtmltree.css) skin/classic/browser/devtools/gcli.css (devtools/gcli.css) skin/classic/browser/devtools/breadcrumbs/ltr-end-pressed.png (devtools/breadcrumbs/ltr-end-pressed.png) diff --git a/browser/themes/pinstripe/browser/devtools/arrows.png b/browser/themes/pinstripe/browser/devtools/arrows.png index 95e7217927854ed98dd7e55123709ad8baf126f9..447d73938398ff2c09efafc33d14c82252229668 100644 GIT binary patch delta 812 zcmV+{1JnGa2l57x83+OZ001ya>kyG4K7R`Y3_1diBBnb400Qz!L_t(I%Y~EQPZL=b z$G_*^mH~AmOkxE!kyxU*OlPK>mB>B-55BnDU2%17YU`_i1Fj)i)&zWq|A1dAxEgIj zl+6b4X^lZBZ59Q#YBV(@v|Tmn)NwfbFatKm;C(yip8Gl9dwx*wmHx;NC%*|B_=WB)ms2WU}l$g_^>LEw|$q* zX75k^rK)N}{ocg#s}0y{s;nVEUk*Ejp%!3(Qwe}8}S$mHa5u}~@$tzywC7Og^|6p!lyfNk4CAel^F z?&+OhSgb^hU7xsgxo2f%xytW%90x$xsUJ(0Rau{M*)~lRU?R$93%~cyba(%m$*fg! zW@n#Yym)7D@L};k3(R1&wH>IfRUo_oA_Rk~rUiVi0l@z7K}sZ($r}?le}6f1I+aTQ zv$RxGt@t;k@FqQ^g;rLU9mfHv%I}LrA^_YrGK0a{Y@zqJ>0pzZNa(rTyYcZ%K3@`o zKm-N|LI6NKt`81A1i8;Bkza^KO6jIzFu=?V;C$>{$+8## z*ecs$QwJbK#b*Hq^7&FO_kXUTVVA1bc;#g8Qya_xIyxHb>Z%1n2s#w3bLYm&;|>AB&#t{Sdi6v)y*50YT3yZ4<^Z<0 z9~>D;scKD2i?^OWW(1p>;<4y9iyAidu&K{IUbuZHS&`%Gqs`4*=Kg(Ob)9PN>}=eI qqiLS3si~)1&S+HIvl(Z{mia$#>@r2p07;Vo0000 delta 863 zcmV-l1EBo!2Bim(83+ad006%$d`FQXK7R)U2{9a0;%#{V00SjSL_t(I%Z-#zY!qb} z#(&SZ1hxkRgceivVA94v7qr+KPFlDbf`^Xo8e^fxvlk=AizX%*!qKaQieA|8ZKH&E zQQCTHw8f-}iRczRxj>1Pa&WiH&O9DwyKNIOe3?u#Gw=7#^XGj&(X;v13ideABIp?`QwRnbLJB~;^>cab{6FpXS~bSf^w@z5R2Rz+)P5|f9Cy|} z8p5_Uq^AJ{wk@Q*$es(39YOwqV(%m{2td#N{{g=H7&~??AWahVEYexf<3Jy%7ubi@ z2Mlm;^;A1;jRIGaq%zMSqX1{W_kVrcCrM>INh6eJvQ0Jp>$-G$a@zf1V0C z6Wv7`#h$0wdk%XbC$e{=bMfJ$?AY@oFp1TVX=0hy>J{+soho(i#(V`V0g{BIgMl!e zB$fGZKE3b~z?nmTYyf|?@@A4$>cDx#BiINO<7*df->}%s+Q34LrD@T#_kSl~U+1+t zKi>ncf=`j92MF8VMGSz}x*);e291?Lw(mX$Oj0N`F&TuNNW(OiYe`c1MbcBb<3^IP zWthjD1P>y81UxFqraK^{>AmYyQ*R6;No71ICURmTBRfounE)0LfC3@_0l5i0nS(DZ z0>5Gvfh-3|3S^)RfYzN$NPpKm5*V1Gv0NjUKkMq&f!2|-A3O-E0d;k?^(L7ufEY_( z05=5ANqV6g%QMx*GJ!M`X&OjVk)}nmtd5zWxpIis-H1Ys=E?~uJcq+~5OzW#!-b8o z=HNaC@5tTLC+j&f1Z<2umv17*V=O%utL4u|>Lar;mPS%%qqeUqH-FgqBzDaJ@xE|mijxR@SkfP5H)6E pEDZxk(kz|ZQe=OK`CxPS{{?YTh?UJ}5zhbs002ovPDHLkV1n3kjC=q9 diff --git a/browser/themes/pinstripe/browser/devtools/csshtmltree.css b/browser/themes/pinstripe/browser/devtools/csshtmltree.css index 98b32c0ffba..df346f2e659 100644 --- a/browser/themes/pinstripe/browser/devtools/csshtmltree.css +++ b/browser/themes/pinstripe/browser/devtools/csshtmltree.css @@ -37,114 +37,155 @@ * * ***** END LICENSE BLOCK ***** */ +html { + height: 100%; +} + body { font-family: sans-serif; font-size: 11px; - background: #EEE; + background: -moz-Field; + margin: 0; + width: 100%; + height: 100%; + display: -moz-box; + -moz-box-orient: vertical; } -.path, -.filters { + +#root { + display: -moz-box; +} + +#path { font-size: 11px; word-spacing: -1px; + margin-bottom: 0; + color: -moz-dialogtext; + background-color: -moz-dialog; + padding: 4px 5px 0; } -.path ol { +#path ol { list-style: none outside none; margin: 0; padding: 0; } -.path li { +#path li { border-radius: 3px; padding: 2px 3px; - text-shadow: #FFF 0 1px 0; - font-weight: bold; font-size: 11px; - background: -moz-linear-gradient(top, #F6F6FF, #E3E3FF); display: inline-block; } -.path li:after { +#path li:after { content: " > "; } -.path li:last-child { - background: -moz-linear-gradient(top, #FFC, #DD8); +#path li:last-child { + font-weight: bold; + color: #0091ff; } -.path li:last-child:after { - color: red; +#path li:last-child:after { content: ""; } .property-header { - padding: 2px 5px; - background: -moz-linear-gradient(top, #F8F8F8, #E8E8E8); - color: #666; + padding: 4px; + -moz-padding-start: 0; + -moz-padding-end: 5px; } -.property-name, -.rule-matched, -.rule-unmatched { - cursor: pointer; -} + .rule-unmatched { + cursor: pointer; + padding: 2px; + -moz-padding-start: 4px; + -moz-padding-end: 0; + white-space: nowrap; + } /* Take away these two :visited rules to get a core dumper */ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=575675#c30 */ -.link { - color: #55A; -} +.link, .link:visited { - color: #55A; + color: #0091ff; } -a.link { - text-decoration: none; - cursor: pointer; -} -a.link:visited { +.link, +.helplink, +.link:visited, +.helplink:visited { text-decoration: none; } -.rule-matched, -.rule-unmatched { - padding: 2px 0; - white-space: nowrap; +.helplink-container { + position: relative; + top: 2px; + display: inline-block; + visibility: hidden; +} + +.helplink { + display: block; + height: 0; + width: 14px; + overflow: hidden; + padding-top: 14px; + background-image: url("chrome://browser/skin/devtools/goto-mdn.png"); +} + +.property-header:hover > .helplink-container { + visibility: visible; +} + +.unmatchedSelectorTable { + -moz-margin-start: 15px; } .rulelink { - color: #55A; + color: -moz-dialogtext; + -moz-margin-start: 12px; } .expander { - width: 8px; - height: 8px; + -moz-appearance: treetwisty; + width: 12px; + height: 12px; float: left; - -moz-margin-start: 15px; + -moz-margin-start: 5px; -moz-margin-end: 5px; - margin-top: 3px; - background: url("chrome://browser/skin/devtools/arrows.png"); - background-position: 24px 0; -} - -.searchfield { - background: url("chrome://browser/skin/devtools/search.png") no-repeat #FFF; - border-radius: 5px; - -moz-padding-start: 20px; - width: 135px; - float: right; } .expander[dir="rtl"] { - background-position: 16px 0; + float: right; } + .expander[open] { - background-position: 8px 0; + -moz-appearance: treetwistyopen; +} + +.expandable { + cursor: pointer; +} + +.match { + visibility: hidden; +} + +.expandable > .match { + margin-top: 5px; + visibility: visible; +} + +.only-unmatched { + -moz-margin-start: 0; } .property-name { display: inline-block; font-size: 12px; - font-weight: bold; - color: #000; + color: -moz-FieldText; + width: 220px; } .property-value { display: inline-block; font-size: 10px; + color: grey; } .property-view-hidden { @@ -159,11 +200,7 @@ a.link:visited { /* This rule is necessary because Templater.jsm breaks LTR TDs in RTL docs */ .rule-text { direction: ltr; - -moz-padding-start: 10px; -} - -.resizerbox { - background-color: window; + -moz-padding-start: 15px; } .bestmatch { @@ -179,16 +216,62 @@ a.link:visited { color: brown; } -.userStyles { - position: relative; - top: 3px; +#propertyContainer { + display: -moz-box; + -moz-box-orient: vertical; + -moz-box-flex: 1; + overflow-y: auto; } -.userStyles, +.selectedElementLabel { + font-weight: bold; +} + +.darkrow { + background-color: rgba(0,0,0,.022); +} + +.header { + color: -moz-dialogtext; + background-color: -moz-dialog; + padding: 5px 0 0; +} + +.onlyuserstyles, .userStylesLabel { cursor: pointer; } +.userStylesLabel { + display: -moz-box; + white-space: nowrap; +} + +.onlyuserstyles { + position: relative; + top: 3px; + font-family: sans-serif; + font-size: 11px; +} + +.searchfield { + display: -moz-box; + -moz-box-flex: 1; + margin-left: 10px; +} + +.styleinspector-legend { + -moz-margin-start: 12px; +} + +#footer { + border-top: 1px solid -moz-dialog; +} + +.legendKey { + margin: 0 5px; +} + /** * CSS Rule View */ diff --git a/browser/themes/pinstripe/browser/devtools/goto-mdn.png b/browser/themes/pinstripe/browser/devtools/goto-mdn.png new file mode 100644 index 0000000000000000000000000000000000000000..dbe064863d65ac3123a7a60070114dd465852de2 GIT binary patch literal 661 zcmV;G0&4wPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipn- z2m%$DyLk=(00I?BL_t(2&sCB?Zxc}v#DDkh-PyVG`C^*@2}yxvJ^(@nAt)nCl!gMO zrA+~m(o!O%NEB%)k%&Zr_zXc%P*5X80V3cS;`rY=j_pCAm;Ism{L!(?)VbC%l= z9$%(%dSAYMm(h5F)*;GQ)E6&NEClSf zI~@xN@-yfKrMq z8>5Z2_(6am7-#vpw-10I094W#fZcWn5D>vShgQCih#(^1pm*W`P@PSvrV0Jwh;DC) z6NeK4546?_>l~g^oO=`y&lK424*1pX9B(0l6CnsRx)enm^!hl!^VK=wpH3I+9L`w) zoOL*BC?zSXvAmIra~Nx|#!i6~>Pz#~7w4y(a~2UtV|gQ0qz!X(<;jA{bFBG~d~(F$ z_=sUPnsO%3xwW#sK-w^8D)%}0^!9nnScB)Cx#JUFA2e6D vlDS%yLZ~q|$CwFWsF|x(Xs&K0ry_uVAQ%nSnI7d%00000NkvXXu0mjf{3jAFJg2T)jk)8oi3#0-$aN1{?c|g2d$P)DnfH z)bz|eTc!8A_bVx6rr0WloBA5~7C5J7WO`H;r3P2|g(O#HCtIc{+1n}DR9FEG$W1Lt zRH(?!$t$+1uvG$^YXxM3g!Ppaz)DK8ZIvL7itr6kaLzAERWQ{v&`mZlGf*%y)H5_T zF*i5YQ7|$vG|)FN(l<2HH8i&}HnK7>P=Ep@plwAdX;wilZcw{`JX@uVl9B=|ef{$C za=mh6z5JqdeM3u2OOP2xM!G;1y2X`wC5aWfdBw^w6I@b@lZ!G7N;32F6hI~>Cgqow z*eU^C3h_d20o>TUVrVb{15Cdnu|VHY&j92lm_lD){7Q3k;i`*Ef>IIg#cFVINM%8) zeo$(0erZuMFyhjbK~@!5ITxiSmgE|*3%U}@%LYUE^S=;CH+X<_DUY+_*M>g48R zX5a|Z>yn>bnwy$e0@Is<&})uUFDNPG765H_NiE7OOHFYr%Fk5*d)X=zw_8kbng`XJ zg4->oIQ8lS9itD5Sfq%C2?0|NhzU=&Kn^_Nr{)1udl4{McN%s-VPIgA^mK6yskn7! z%6@O@M2X|~y}wLSp7Vsg!%%Ea%oGP<hJt3m#n3Ra~TWaQ^{Kiz5rWz1x#4 z6nAuVJZtls6(+d&w65Sf-zJMAe71{^z5d?%Jwz6Uq}=AreyjExt)0s%bVW(~8Ri2Fi7u`xzb{RyV(R$600V!M)7e z+XODmG)R<>biDU`oo&kvcD1n0x8Isy%m~pF>wbMRr%YLfZ~lhw^|O7JiSGHm?5)^K zKHfE9ugzQhbj41uT%=Ll(aRv$aX`NNXi$Y;>v5SN)!8iR#+w; zd0Y1W@!a(*9xRyq;QpjqyZZvKC!hPg=SOgXK%x|@YNw&#y7tHUT5CQ`LlTE9T&C9FT+ExHhp?M zqv>^p%{rxL2O{=fHR)C3Yf8@0*)ID=&Bg3S-7$mi-720@2NJwJme>CAt5?u%{@cIf z(#tQ4F2B5Uc){tDDVKgk+@3T)yJW-i8>~0X^q9WC`hTOIMS|ht@d~@9zs^%Y1*fO0 KpUXO@geCx1^&^4+ diff --git a/browser/themes/pinstripe/browser/jar.mn b/browser/themes/pinstripe/browser/jar.mn index cd33566ffca..0264b5c2a50 100644 --- a/browser/themes/pinstripe/browser/jar.mn +++ b/browser/themes/pinstripe/browser/jar.mn @@ -123,7 +123,7 @@ browser.jar: skin/classic/browser/tabview/tabview.png (tabview/tabview.png) skin/classic/browser/tabview/tabview.css (tabview/tabview.css) skin/classic/browser/devtools/arrows.png (devtools/arrows.png) - skin/classic/browser/devtools/search.png (devtools/search.png) + skin/classic/browser/devtools/goto-mdn.png (devtools/goto-mdn.png) skin/classic/browser/devtools/csshtmltree.css (devtools/csshtmltree.css) skin/classic/browser/devtools/gcli.css (devtools/gcli.css) skin/classic/browser/devtools/toolbarbutton-close.png (devtools/toolbarbutton-close.png) diff --git a/browser/themes/winstripe/browser/devtools/arrows.png b/browser/themes/winstripe/browser/devtools/arrows.png index 95e7217927854ed98dd7e55123709ad8baf126f9..447d73938398ff2c09efafc33d14c82252229668 100644 GIT binary patch delta 812 zcmV+{1JnGa2l57x83+OZ001ya>kyG4K7R`Y3_1diBBnb400Qz!L_t(I%Y~EQPZL=b z$G_*^mH~AmOkxE!kyxU*OlPK>mB>B-55BnDU2%17YU`_i1Fj)i)&zWq|A1dAxEgIj zl+6b4X^lZBZ59Q#YBV(@v|Tmn)NwfbFatKm;C(yip8Gl9dwx*wmHx;NC%*|B_=WB)ms2WU}l$g_^>LEw|$q* zX75k^rK)N}{ocg#s}0y{s;nVEUk*Ejp%!3(Qwe}8}S$mHa5u}~@$tzywC7Og^|6p!lyfNk4CAel^F z?&+OhSgb^hU7xsgxo2f%xytW%90x$xsUJ(0Rau{M*)~lRU?R$93%~cyba(%m$*fg! zW@n#Yym)7D@L};k3(R1&wH>IfRUo_oA_Rk~rUiVi0l@z7K}sZ($r}?le}6f1I+aTQ zv$RxGt@t;k@FqQ^g;rLU9mfHv%I}LrA^_YrGK0a{Y@zqJ>0pzZNa(rTyYcZ%K3@`o zKm-N|LI6NKt`81A1i8;Bkza^KO6jIzFu=?V;C$>{$+8## z*ecs$QwJbK#b*Hq^7&FO_kXUTVVA1bc;#g8Qya_xIyxHb>Z%1n2s#w3bLYm&;|>AB&#t{Sdi6v)y*50YT3yZ4<^Z<0 z9~>D;scKD2i?^OWW(1p>;<4y9iyAidu&K{IUbuZHS&`%Gqs`4*=Kg(Ob)9PN>}=eI qqiLS3si~)1&S+HIvl(Z{mia$#>@r2p07;Vo0000 delta 863 zcmV-l1EBo!2Bim(83+ad006%$d`FQXK7R)U2{9a0;%#{V00SjSL_t(I%Z-#zY!qb} z#(&SZ1hxkRgceivVA94v7qr+KPFlDbf`^Xo8e^fxvlk=AizX%*!qKaQieA|8ZKH&E zQQCTHw8f-}iRczRxj>1Pa&WiH&O9DwyKNIOe3?u#Gw=7#^XGj&(X;v13ideABIp?`QwRnbLJB~;^>cab{6FpXS~bSf^w@z5R2Rz+)P5|f9Cy|} z8p5_Uq^AJ{wk@Q*$es(39YOwqV(%m{2td#N{{g=H7&~??AWahVEYexf<3Jy%7ubi@ z2Mlm;^;A1;jRIGaq%zMSqX1{W_kVrcCrM>INh6eJvQ0Jp>$-G$a@zf1V0C z6Wv7`#h$0wdk%XbC$e{=bMfJ$?AY@oFp1TVX=0hy>J{+soho(i#(V`V0g{BIgMl!e zB$fGZKE3b~z?nmTYyf|?@@A4$>cDx#BiINO<7*df->}%s+Q34LrD@T#_kSl~U+1+t zKi>ncf=`j92MF8VMGSz}x*);e291?Lw(mX$Oj0N`F&TuNNW(OiYe`c1MbcBb<3^IP zWthjD1P>y81UxFqraK^{>AmYyQ*R6;No71ICURmTBRfounE)0LfC3@_0l5i0nS(DZ z0>5Gvfh-3|3S^)RfYzN$NPpKm5*V1Gv0NjUKkMq&f!2|-A3O-E0d;k?^(L7ufEY_( z05=5ANqV6g%QMx*GJ!M`X&OjVk)}nmtd5zWxpIis-H1Ys=E?~uJcq+~5OzW#!-b8o z=HNaC@5tTLC+j&f1Z<2umv17*V=O%utL4u|>Lar;mPS%%qqeUqH-FgqBzDaJ@xE|mijxR@SkfP5H)6E pEDZxk(kz|ZQe=OK`CxPS{{?YTh?UJ}5zhbs002ovPDHLkV1n3kjC=q9 diff --git a/browser/themes/winstripe/browser/devtools/csshtmltree.css b/browser/themes/winstripe/browser/devtools/csshtmltree.css index 98b32c0ffba..aaad2af5c7e 100644 --- a/browser/themes/winstripe/browser/devtools/csshtmltree.css +++ b/browser/themes/winstripe/browser/devtools/csshtmltree.css @@ -37,114 +37,156 @@ * * ***** END LICENSE BLOCK ***** */ +html { + height: 100%; +} + body { font-family: sans-serif; font-size: 11px; - background: #EEE; + background: -moz-Field; + margin: 0; + width: 100%; + height: 100%; + display: -moz-box; + -moz-box-orient: vertical; } -.path, -.filters { + +#root { + display: -moz-box; +} + +#path { font-size: 11px; word-spacing: -1px; + margin-bottom: 0; + color: -moz-dialogtext; + background-color: -moz-dialog; + padding: 4px 5px 0; } -.path ol { +#path ol { list-style: none outside none; margin: 0; padding: 0; } -.path li { +#path li { border-radius: 3px; padding: 2px 3px; - text-shadow: #FFF 0 1px 0; - font-weight: bold; font-size: 11px; - background: -moz-linear-gradient(top, #F6F6FF, #E3E3FF); display: inline-block; } -.path li:after { +#path li:after { content: " > "; } -.path li:last-child { - background: -moz-linear-gradient(top, #FFC, #DD8); +#path li:last-child { + font-weight: bold; + color: #0091ff; } -.path li:last-child:after { - color: red; +#path li:last-child:after { content: ""; } .property-header { - padding: 2px 5px; - background: -moz-linear-gradient(top, #F8F8F8, #E8E8E8); - color: #666; + padding: 4px; + -moz-padding-start: 0; + -moz-padding-end: 5px; } -.property-name, -.rule-matched, -.rule-unmatched { - cursor: pointer; -} + .rule-unmatched { + cursor: pointer; + padding: 2px; + -moz-padding-start: 4px; + -moz-padding-end: 0; + white-space: nowrap; + } /* Take away these two :visited rules to get a core dumper */ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=575675#c30 */ -.link { - color: #55A; -} +.link, .link:visited { - color: #55A; + color: #0091ff; } -a.link { - text-decoration: none; - cursor: pointer; -} -a.link:visited { +.link, +.helplink, +.link:visited, +.helplink:visited { text-decoration: none; } -.rule-matched, -.rule-unmatched { - padding: 2px 0; - white-space: nowrap; +.helplink-container { + position: relative; + top: 2px; + display: inline-block; + visibility: hidden; +} + +.helplink { + display: block; + height: 0; + width: 14px; + overflow: hidden; + padding-top: 14px; + background-image: url("chrome://browser/skin/devtools/goto-mdn.png"); +} + +.property-header:hover > .helplink-container { + visibility: visible; +} + +.unmatchedSelectorTable { + -moz-margin-start: 15px; } .rulelink { - color: #55A; + color: -moz-dialogtext; + -moz-margin-start: 12px; } .expander { - width: 8px; - height: 8px; + width: 9px; + height: 9px; float: left; - -moz-margin-start: 15px; + margin-top: 1px; + -moz-margin-start: 5px; -moz-margin-end: 5px; - margin-top: 3px; - background: url("chrome://browser/skin/devtools/arrows.png"); - background-position: 24px 0; -} - -.searchfield { - background: url("chrome://browser/skin/devtools/search.png") no-repeat #FFF; - border-radius: 5px; - -moz-padding-start: 20px; - width: 135px; - float: right; + background-image: url("chrome://global/skin/tree/twisty-clsd.png"); } .expander[dir="rtl"] { - background-position: 16px 0; + float: right; } + .expander[open] { - background-position: 8px 0; + background-image: url("chrome://global/skin/tree/twisty-open.png"); +} + +.expandable { + cursor: pointer; +} + +.match { + visibility: hidden; +} + +.expandable > .match { + margin-top: 5px; + visibility: visible; +} + +.only-unmatched { + -moz-margin-start: 0; } .property-name { display: inline-block; font-size: 12px; - font-weight: bold; - color: #000; + color: -moz-FieldText; + width: 220px; } .property-value { display: inline-block; font-size: 10px; + color: grey; } .property-view-hidden { @@ -159,11 +201,7 @@ a.link:visited { /* This rule is necessary because Templater.jsm breaks LTR TDs in RTL docs */ .rule-text { direction: ltr; - -moz-padding-start: 10px; -} - -.resizerbox { - background-color: window; + -moz-padding-start: 15px; } .bestmatch { @@ -179,16 +217,62 @@ a.link:visited { color: brown; } -.userStyles { - position: relative; - top: 3px; +#propertyContainer { + display: -moz-box; + -moz-box-orient: vertical; + -moz-box-flex: 1; + overflow-y: auto; } -.userStyles, +.selectedElementLabel { + font-weight: bold; +} + +.darkrow { + background-color: rgba(0,0,0,.022); +} + +.header { + color: -moz-dialogtext; + background-color: -moz-dialog; + padding: 5px 0 0; +} + +.onlyuserstyles, .userStylesLabel { cursor: pointer; } +.userStylesLabel { + display: -moz-box; + white-space: nowrap; +} + +.onlyuserstyles { + position: relative; + top: 3px; + font-family: sans-serif; + font-size: 11px; +} + +.searchfield { + display: -moz-box; + -moz-box-flex: 1; + margin-left: 10px; +} + +.styleinspector-legend { + -moz-margin-start: 12px; +} + +#footer { + border-top: 1px solid -moz-dialog; +} + +.legendKey { + margin: 0 5px; +} + /** * CSS Rule View */ diff --git a/browser/themes/winstripe/browser/devtools/goto-mdn.png b/browser/themes/winstripe/browser/devtools/goto-mdn.png new file mode 100644 index 0000000000000000000000000000000000000000..dbe064863d65ac3123a7a60070114dd465852de2 GIT binary patch literal 661 zcmV;G0&4wPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipn- z2m%$DyLk=(00I?BL_t(2&sCB?Zxc}v#DDkh-PyVG`C^*@2}yxvJ^(@nAt)nCl!gMO zrA+~m(o!O%NEB%)k%&Zr_zXc%P*5X80V3cS;`rY=j_pCAm;Ism{L!(?)VbC%l= z9$%(%dSAYMm(h5F)*;GQ)E6&NEClSf zI~@xN@-yfKrMq z8>5Z2_(6am7-#vpw-10I094W#fZcWn5D>vShgQCih#(^1pm*W`P@PSvrV0Jwh;DC) z6NeK4546?_>l~g^oO=`y&lK424*1pX9B(0l6CnsRx)enm^!hl!^VK=wpH3I+9L`w) zoOL*BC?zSXvAmIra~Nx|#!i6~>Pz#~7w4y(a~2UtV|gQ0qz!X(<;jA{bFBG~d~(F$ z_=sUPnsO%3xwW#sK-w^8D)%}0^!9nnScB)Cx#JUFA2e6D vlDS%yLZ~q|$CwFWsF|x(Xs&K0ry_uVAQ%nSnI7d%00000NkvXXu0mjf{3jAFJg2T)jk)8oi3#0-$aN1{?c|g2d$P)DnfH z)bz|eTc!8A_bVx6rr0WloBA5~7C5J7WO`H;r3P2|g(O#HCtIc{+1n}DR9FEG$W1Lt zRH(?!$t$+1uvG$^YXxM3g!Ppaz)DK8ZIvL7itr6kaLzAERWQ{v&`mZlGf*%y)H5_T zF*i5YQ7|$vG|)FN(l<2HH8i&}HnK7>P=Ep@plwAdX;wilZcw{`JX@uVl9B=|ef{$C za=mh6z5JqdeM3u2OOP2xM!G;1y2X`wC5aWfdBw^w6I@b@lZ!G7N;32F6hI~>Cgqow z*eU^C3h_d20o>TUVrVb{15Cdnu|VHY&j92lm_lD){7Q3k;i`*Ef>IIg#cFVINM%8) zeo$(0erZuMFyhjbK~@!5ITxiSmgE|*3%U}@%LYUE^S=;CH+X<_DUY+_*M>g48R zX5a|Z>yn>bnwy$e0@Is<&})uUFDNPG765H_NiE7OOHFYr%Fk5*d)X=zw_8kbng`XJ zg4->oIQ8lS9itD5Sfq%C2?0|NhzU=&Kn^_Nr{)1udl4{McN%s-VPIgA^mK6yskn7! z%6@O@M2X|~y}wLSp7Vsg!%%Ea%oGP<hJt3m#n3Ra~TWaQ^{Kiz5rWz1x#4 z6nAuVJZtls6(+d&w65Sf-zJMAe71{^z5d?%Jwz6Uq}=AreyjExt)0s%bVW(~8Ri2Fi7u`xzb{RyV(R$600V!M)7e z+XODmG)R<>biDU`oo&kvcD1n0x8Isy%m~pF>wbMRr%YLfZ~lhw^|O7JiSGHm?5)^K zKHfE9ugzQhbj41uT%=Ll(aRv$aX`NNXi$Y;>v5SN)!8iR#+w; zd0Y1W@!a(*9xRyq;QpjqyZZvKC!hPg=SOgXK%x|@YNw&#y7tHUT5CQ`LlTE9T&C9FT+ExHhp?M zqv>^p%{rxL2O{=fHR)C3Yf8@0*)ID=&Bg3S-7$mi-720@2NJwJme>CAt5?u%{@cIf z(#tQ4F2B5Uc){tDDVKgk+@3T)yJW-i8>~0X^q9WC`hTOIMS|ht@d~@9zs^%Y1*fO0 KpUXO@geCx1^&^4+ diff --git a/browser/themes/winstripe/browser/jar.mn b/browser/themes/winstripe/browser/jar.mn index 8aa38f8eb0d..d3358ea5fbc 100644 --- a/browser/themes/winstripe/browser/jar.mn +++ b/browser/themes/winstripe/browser/jar.mn @@ -107,7 +107,7 @@ browser.jar: skin/classic/browser/tabview/tabview-inverted.png (tabview/tabview-inverted.png) skin/classic/browser/tabview/tabview.css (tabview/tabview.css) skin/classic/browser/devtools/arrows.png (devtools/arrows.png) - skin/classic/browser/devtools/search.png (devtools/search.png) + skin/classic/browser/devtools/goto-mdn.png (devtools/goto-mdn.png) skin/classic/browser/devtools/csshtmltree.css (devtools/csshtmltree.css) skin/classic/browser/devtools/gcli.css (devtools/gcli.css) skin/classic/browser/devtools/toolbarbutton-close.png (devtools/toolbarbutton-close.png) @@ -259,7 +259,7 @@ browser.jar: skin/classic/aero/browser/tabview/tabview-inverted.png (tabview/tabview-inverted.png) skin/classic/aero/browser/tabview/tabview.css (tabview/tabview.css) skin/classic/aero/browser/devtools/arrows.png (devtools/arrows.png) - skin/classic/aero/browser/devtools/search.png (devtools/search.png) + skin/classic/aero/browser/devtools/goto-mdn.png (devtools/goto-mdn.png) skin/classic/aero/browser/devtools/csshtmltree.css (devtools/csshtmltree.css) skin/classic/aero/browser/devtools/gcli.css (devtools/gcli.css) skin/classic/aero/browser/devtools/toolbarbutton-close.png (devtools/toolbarbutton-close.png) From 4c71454dae62423999b01b78c3e055f549da89f4 Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Fri, 4 Nov 2011 18:42:56 -0700 Subject: [PATCH 086/127] back out ffdc872d5450 (https://bugzilla.mozilla.org/show_bug.cgi?id=699942#c4) --- browser/locales/en-US/chrome/browser/browser.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/locales/en-US/chrome/browser/browser.properties b/browser/locales/en-US/chrome/browser/browser.properties index 0a4435ec993..a282acb0ecf 100644 --- a/browser/locales/en-US/chrome/browser/browser.properties +++ b/browser/locales/en-US/chrome/browser/browser.properties @@ -331,7 +331,7 @@ syncPromoNotification.learnMoreLinkText=Learn More # and %2$S by the value of the toolkit.telemetry.server_owner preference. telemetryPrompt = Will you help improve %1$S by sending anonymous information about performance, hardware characteristics, feature usage, and browser customizations to %2$S? telemetryLinkLabel = Learn More -telemetryYesButtonLabel = Yes, I want to help +telemetryYesButtonLabel = Yes telemetryYesButtonAccessKey = Y telemetryNoButtonLabel = No telemetryNoButtonAccessKey = N From ab3318eb15f52d5075fc3de7e0105dbda01674f0 Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Fri, 4 Nov 2011 22:26:07 -0700 Subject: [PATCH 087/127] Back out 24129599cb51 (bug 691951) because of Windows 7 test_resizer failure --- browser/components/nsBrowserGlue.js | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index 6c68fb4c4f1..d851d67119b 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -639,8 +639,8 @@ BrowserGlue.prototype = { var currentVersion = Services.prefs.getIntPref("browser.rights.version"); Services.prefs.setBoolPref("browser.rights." + currentVersion + ".shown", true); - var notification = notifyBox.appendNotification(notifyRightsText, "about-rights", null, notifyBox.PRIORITY_INFO_LOW, buttons); - notification.persistence = -1; // Until user closes it + var box = notifyBox.appendNotification(notifyRightsText, "about-rights", null, notifyBox.PRIORITY_INFO_LOW, buttons); + box.persistence = 3; // arbitrary number, just so bar sticks around for a bit }, _showUpdateNotification: function BG__showUpdateNotification() { @@ -709,10 +709,10 @@ BrowserGlue.prototype = { } ]; - let notification = notifyBox.appendNotification(text, "post-update-notification", - null, notifyBox.PRIORITY_INFO_LOW, - buttons); - notification.persistence = -1; // Until user closes it + let box = notifyBox.appendNotification(text, "post-update-notification", + null, notifyBox.PRIORITY_INFO_LOW, + buttons); + box.persistence = 3; } if (actions.indexOf("showAlert") == -1) @@ -815,7 +815,7 @@ BrowserGlue.prototype = { var notification = notifyBox.appendNotification(telemetryPrompt, "telemetry", null, notifyBox.PRIORITY_INFO_LOW, buttons); notification.setAttribute("hideclose", true); - notification.persistence = -1; // Until user closes it + notification.persistence = 6; // arbitrary number, just so bar sticks around for a bit let XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; let link = notification.ownerDocument.createElementNS(XULNS, "label"); @@ -827,9 +827,8 @@ BrowserGlue.prototype = { // Remove the notification on which the user clicked notification.parentNode.removeNotification(notification, true); // Add a new notification to that tab, with no "Learn more" link - notifyBox = browser.getNotificationBox(); - notification = notifyBox.appendNotification(telemetryPrompt, "telemetry", null, notifyBox.PRIORITY_INFO_LOW, buttons); - notification.persistence = -1; // Until user closes it + var notifyBox = browser.getNotificationBox(); + notifyBox.appendNotification(telemetryPrompt, "telemetry", null, notifyBox.PRIORITY_INFO_LOW, buttons); }, false); let description = notification.ownerDocument.getAnonymousElementByAttribute(notification, "anonid", "messageText"); description.appendChild(link); @@ -1093,10 +1092,10 @@ BrowserGlue.prototype = { ]; var notifyBox = browser.getNotificationBox(); - var notification = notifyBox.appendNotification(text, title, null, - notifyBox.PRIORITY_CRITICAL_MEDIUM, - buttons); - notification.persistence = -1; // Until user closes it + var box = notifyBox.appendNotification(text, title, null, + notifyBox.PRIORITY_CRITICAL_MEDIUM, + buttons); + box.persistence = -1; // Until user closes it }, _migrateUI: function BG__migrateUI() { From 41f2696d655b46acd6fc9f9de21e1e24fd974e45 Mon Sep 17 00:00:00 2001 From: Michael Ratcliffe Date: Sat, 5 Nov 2011 12:38:17 +0100 Subject: [PATCH 088/127] Bug 698762 - Remove unmatched rules from style inspector; r=msucan --- .../devtools/styleinspector/CssHtmlTree.jsm | 161 +---------- browser/devtools/styleinspector/CssLogic.jsm | 265 ++---------------- .../devtools/styleinspector/csshtmltree.xhtml | 36 --- .../test/browser/browser_bug683672.html | 4 - .../test/browser/browser_bug683672.js | 25 -- .../test/browser/browser_styleinspector.js | 1 - .../browser_styleinspector_webconsole.htm | 1 - .../browser/devtools/styleinspector.dtd | 12 +- .../devtools/styleinspector.properties | 1 - .../browser/devtools/csshtmltree.css | 19 -- .../browser/devtools/csshtmltree.css | 31 +- .../browser/devtools/csshtmltree.css | 19 -- 12 files changed, 34 insertions(+), 541 deletions(-) diff --git a/browser/devtools/styleinspector/CssHtmlTree.jsm b/browser/devtools/styleinspector/CssHtmlTree.jsm index a8a67c49afc..cc521643aef 100644 --- a/browser/devtools/styleinspector/CssHtmlTree.jsm +++ b/browser/devtools/styleinspector/CssHtmlTree.jsm @@ -133,9 +133,8 @@ XPCOMUtils.defineLazyGetter(CssHtmlTree, "_strings", function() Services.strings .createBundle("chrome://browser/locale/devtools/styleinspector.properties")); CssHtmlTree.prototype = { - // Cache the list of properties that have matched and unmatched properties. + // Cache the list of properties that have matched properties. _matchedProperties: null, - _unmatchedProperties: null, htmlComplete: false, @@ -171,7 +170,6 @@ CssHtmlTree.prototype = { } this.viewedElement = aElement; - this._unmatchedProperties = null; this._matchedProperties = null; CssHtmlTree.processTemplate(this.templatePath, this.path, this); @@ -198,7 +196,7 @@ CssHtmlTree.prototype = { let propView = new PropertyView(this, name); CssHtmlTree.processTemplate(this.templateProperty, this.propertyContainer, propView, true); - propView.refreshAllSelectors(); + propView.refreshMatchedSelectors(); this.propertyViews.push(propView); } if (i < max) { @@ -359,41 +357,6 @@ CssHtmlTree.prototype = { return this._matchedProperties; }, - /** - * Check if a property has unmatched selectors. Result is cached. - * - * @param {string} aProperty the name of the property you want to check. - * @return {boolean} true if the property has unmatched selectors, false - * otherwise. - */ - hasUnmatchedSelectors: function CssHtmlTree_hasUnmatchedSelectors(aProperty) - { - // Initially check all of the properties that return false for - // hasMatchedSelectors(). This speeds-up the UI. - if (!this._unmatchedProperties) { - let properties = []; - CssHtmlTree.propertyNames.forEach(function(aName) { - if (!this.matchedProperties[aName]) { - properties.push(aName); - } - }, this); - - if (properties.indexOf(aProperty) == -1) { - properties.push(aProperty); - } - - this._unmatchedProperties = this.cssLogic.hasUnmatchedSelectors(properties); - } - - // Lazy-get the result for properties we do not have cached. - if (!(aProperty in this._unmatchedProperties)) { - let result = this.cssLogic.hasUnmatchedSelectors([aProperty]); - this._unmatchedProperties[aProperty] = result[aProperty]; - } - - return this._unmatchedProperties[aProperty]; - }, - /** * Destructor for CssHtmlTree. */ @@ -444,7 +407,6 @@ function PropertyView(aTree, aName) this.link = "https://developer.mozilla.org/en/CSS/" + aName; this.templateMatchedSelectors = aTree.styleDocument.getElementById("templateMatchedSelectors"); - this.templateUnmatchedSelectors = aTree.styleDocument.getElementById("templateUnmatchedSelectors"); } PropertyView.prototype = { @@ -460,33 +422,15 @@ PropertyView.prototype = { // Are matched rules expanded? matchedExpanded: false, - // Are unmatched rules expanded? - unmatchedExpanded: false, - - // Unmatched selector table - unmatchedSelectorTable: null, - // Matched selector container matchedSelectorsContainer: null, // Matched selector expando matchedExpander: null, - // Unmatched selector expando - unmatchedExpander: null, - - // Unmatched selector container - unmatchedSelectorsContainer: null, - - // Unmatched title block - unmatchedTitleBlock: null, - // Cache for matched selector views _matchedSelectorViews: null, - // Cache for unmatched selector views - _unmatchedSelectorViews: null, - // The previously selected element used for the selector view caches prevViewedElement: null, @@ -517,14 +461,6 @@ PropertyView.prototype = { return this.tree.matchedProperties[this.name]; }, - /** - * Does the property have any unmatched selectors? - */ - get hasUnmatchedSelectors() - { - return this.tree.hasUnmatchedSelectors(this.name); - }, - /** * Should this property be visible? */ @@ -568,23 +504,19 @@ PropertyView.prototype = { if (this.prevViewedElement != this.tree.viewedElement) { this._matchedSelectorViews = null; - this._unmatchedSelectorViews = null; this.prevViewedElement = this.tree.viewedElement; } if (!this.tree.viewedElement || !this.visible) { this.valueNode.innerHTML = ""; this.matchedSelectorsContainer.hidden = true; - this.unmatchedSelectorsContainer.hidden = true; - this.unmatchedSelectorTable.innerHTML = ""; this.matchedSelectorsContainer.innerHTML = ""; this.matchedExpander.removeAttribute("open"); - this.unmatchedExpander.removeAttribute("open"); return; } this.valueNode.innerHTML = this.propertyInfo.value; - this.refreshAllSelectors(); + this.refreshMatchedSelectors(); }, /** @@ -595,7 +527,7 @@ PropertyView.prototype = { let hasMatchedSelectors = this.hasMatchedSelectors; this.matchedSelectorsContainer.hidden = !hasMatchedSelectors; - if (hasMatchedSelectors || this.hasUnmatchedSelectors) { + if (hasMatchedSelectors) { this.propertyHeader.classList.add("expandable"); } else { this.propertyHeader.classList.remove("expandable"); @@ -611,52 +543,6 @@ PropertyView.prototype = { } }, - /** - * Refresh the panel unmatched rules. - */ - refreshUnmatchedSelectors: function PropertyView_refreshUnmatchedSelectors() - { - let hasMatchedSelectors = this.hasMatchedSelectors; - - this.unmatchedSelectorTable.hidden = !this.unmatchedExpanded; - - if (hasMatchedSelectors) { - this.unmatchedSelectorsContainer.hidden = !this.matchedExpanded || - !this.hasUnmatchedSelectors; - this.unmatchedTitleBlock.hidden = false; - } else { - this.unmatchedSelectorsContainer.hidden = !this.unmatchedExpanded; - this.unmatchedTitleBlock.hidden = true; - } - - if (this.unmatchedExpanded && this.hasUnmatchedSelectors) { - CssHtmlTree.processTemplate(this.templateUnmatchedSelectors, - this.unmatchedSelectorTable, this); - if (!hasMatchedSelectors) { - this.matchedExpander.setAttribute("open", ""); - this.unmatchedSelectorTable.classList.add("only-unmatched"); - } else { - this.unmatchedExpander.setAttribute("open", ""); - this.unmatchedSelectorTable.classList.remove("only-unmatched"); - } - } else { - if (!hasMatchedSelectors) { - this.matchedExpander.removeAttribute("open"); - } - this.unmatchedExpander.removeAttribute("open"); - this.unmatchedSelectorTable.innerHTML = ""; - } - }, - - /** - * Refresh the panel matched and unmatched rules - */ - refreshAllSelectors: function PropertyView_refreshAllSelectors() - { - this.refreshMatchedSelectors(); - this.refreshUnmatchedSelectors(); - }, - /** * Provide access to the matched SelectorViews that we are currently * displaying. @@ -670,27 +556,9 @@ PropertyView.prototype = { this._matchedSelectorViews.push(new SelectorView(this.tree, aSelectorInfo)); }, this); } - return this._matchedSelectorViews; }, - /** - * Provide access to the unmatched SelectorViews that we are currently - * displaying. - */ - get unmatchedSelectorViews() - { - if (!this._unmatchedSelectorViews) { - this._unmatchedSelectorViews = []; - this.propertyInfo.unmatchedSelectors.forEach( - function unmatchedSelectorViews_convert(aSelectorInfo) { - this._unmatchedSelectorViews.push(new SelectorView(this.tree, aSelectorInfo)); - }, this); - } - - return this._unmatchedSelectorViews; - }, - /** * The action when a user expands matched selectors. * @@ -702,24 +570,11 @@ PropertyView.prototype = { { if (aEvent.target.className != "helplink") { this.matchedExpanded = !this.matchedExpanded; - if (!this.hasMatchedSelectors && this.hasUnmatchedSelectors) { - this.unmatchedExpanded = !this.unmatchedExpanded; - } - this.refreshAllSelectors(); + this.refreshMatchedSelectors(); aEvent.preventDefault(); } }, - /** - * The action when a user expands unmatched selectors. - */ - unmatchedSelectorsClick: function PropertyView_unmatchedSelectorsClick(aEvent) - { - this.unmatchedExpanded = !this.unmatchedExpanded; - this.refreshUnmatchedSelectors(); - aEvent.preventDefault(); - }, - /** * The action when a user clicks on the MDN help link for a property. */ @@ -748,11 +603,11 @@ function SelectorView(aTree, aSelectorInfo) * @see CssLogic.STATUS */ SelectorView.STATUS_NAMES = [ - // "Unmatched", "Parent Match", "Matched", "Best Match" + // "Parent Match", "Matched", "Best Match" ]; SelectorView.CLASS_NAMES = [ - "unmatched", "parentmatch", "matched", "bestmatch" + "parentmatch", "matched", "bestmatch" ]; SelectorView.prototype = { @@ -773,7 +628,7 @@ SelectorView.prototype = { for (let status in CssLogic.STATUS) { let i = CssLogic.STATUS[status]; - if (i > -1) { + if (i > CssLogic.STATUS.UNKNOWN) { let value = CssHtmlTree.l10n("rule.status." + status); // Replace normal spaces with non-breaking spaces SelectorView.STATUS_NAMES[i] = value.replace(/ /g, '\u00A0'); diff --git a/browser/devtools/styleinspector/CssLogic.jsm b/browser/devtools/styleinspector/CssLogic.jsm index 278b915b5f5..9d33fd7c6ae 100644 --- a/browser/devtools/styleinspector/CssLogic.jsm +++ b/browser/devtools/styleinspector/CssLogic.jsm @@ -58,8 +58,7 @@ * standard DOM API, but more inline with the definition in the spec. * * - CssPropertyInfo contains style information for a single property for the - * highlighted element. It divides the CSS rules on the page into matched and - * unmatched rules. + * highlighted element. It contains the matched CSS rules on the page. * - CssSelectorInfo is a wrapper around CssSelector, which adds sorting with * reference to the selected element. */ @@ -116,10 +115,9 @@ CssLogic.MEDIA = { * @see csshtmltree.js RuleView._cacheStatusNames() */ CssLogic.STATUS = { - BEST: 3, - MATCHED: 2, - PARENT_MATCH: 1, - UNMATCHED: 0, + BEST: 2, + MATCHED: 1, + PARENT_MATCH: 0, UNKNOWN: -1, }; @@ -147,13 +145,11 @@ CssLogic.prototype = { // processMatchedSelectors(). _passId: 0, - // Used for tracking matched CssSelector objects, such that we can skip them - // in processUnmatchedSelectors(). + // Used for tracking matched CssSelector objects. _matchId: 0, _matchedRules: null, _matchedSelectors: null, - _unmatchedSelectors: null, domUtils: Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils), @@ -169,7 +165,6 @@ CssLogic.prototype = { this._sheetsCached = false; this._matchedRules = null; this._matchedSelectors = null; - this._unmatchedSelectors = null; }, /** @@ -204,7 +199,6 @@ CssLogic.prototype = { this._matchedRules = null; this._matchedSelectors = null; - this._unmatchedSelectors = null; let win = this.viewedDocument.defaultView; this._computedStyle = win.getComputedStyle(this.viewedElement, ""); }, @@ -219,8 +213,7 @@ CssLogic.prototype = { /** * Source filter. Only display properties coming from the given source (web - * address). Note that in order to avoid information overload we DO NOT show - * unmatched system rules. + * address). * @see CssLogic.FILTER.* */ set sourceFilter(aValue) { @@ -247,7 +240,6 @@ CssLogic.prototype = { if (needFullUpdate) { this._matchedRules = null; this._matchedSelectors = null; - this._unmatchedSelectors = null; this._propertyInfos = {}; } else { // Update the CssPropertyInfo objects. @@ -495,7 +487,6 @@ CssLogic.prototype = { } this._matchedSelectors = []; - this._unmatchedSelectors = null; this._passId++; for (let i = 0; i < this._matchedRules.length; i++) { @@ -540,52 +531,6 @@ CssLogic.prototype = { return false; }, - /** - * Process the CssSelector object that do not match the highlighted elements, - * nor its parents. Your callback function is invoked for every such - * CssSelector object. You receive one argument: the CssSelector object. - * - * The list of unmatched selectors is cached. - * - * @param {function} aCallback the function you want to execute for each of - * the unmatched selectors. - * @param {object} aScope the scope you want for the callback function. aScope - * will be the this object when aCallback executes. - */ - processUnmatchedSelectors: function CL_processUnmatchedSelectors(aCallback, aScope) - { - if (this._unmatchedSelectors) { - if (aCallback) { - this._unmatchedSelectors.forEach(aCallback, aScope); - } - return; - } - - if (!this._matchedSelectors) { - this.processMatchedSelectors(); - } - - this._unmatchedSelectors = []; - - this.forEachSheet(function (aSheet) { - // We do not show unmatched selectors from system stylesheets - if (aSheet.systemSheet || aSheet.disabled || !aSheet.mediaMatches) { - return; - } - - aSheet.forEachRule(function (aRule) { - aRule.selectors.forEach(function (aSelector) { - if (aSelector._matchId !== this._matchId) { - this._unmatchedSelectors.push(aSelector); - if (aCallback) { - aCallback.call(aScope, aSelector); - } - } - }, this); - }, this); - }, this); - }, - /** * Check if the highlighted element or it's parents have matched selectors. * @@ -686,95 +631,6 @@ CssLogic.prototype = { element.nodeType === Ci.nsIDOMNode.ELEMENT_NODE); }, - /** - * Check if the highlighted element or it's parents have unmatched selectors. - * - * Please note that this method is far slower than hasMatchedSelectors() - * because it needs to do a lot more checks in the DOM. - * - * @param {array} aProperties The list of properties you want to check if they - * have unmatched selectors or not. - * @return {object} An object that tells for each property if it has unmatched - * selectors or not. Object keys are property names and values are booleans. - */ - hasUnmatchedSelectors: function CL_hasUnmatchedSelectors(aProperties) - { - if (!this._matchedRules) { - this._buildMatchedRules(); - } - - let result = {}; - - this.forSomeSheets(function (aSheet) { - if (aSheet.systemSheet || aSheet.disabled || !aSheet.mediaMatches) { - return false; - } - - return aSheet.forSomeRules(function (aRule) { - let unmatched = aRule._matchId !== this._matchId || - this._ruleHasUnmatchedSelector(aRule); - if (!unmatched) { - return false; - } - - aProperties = aProperties.filter(function(aProperty) { - if (!aRule.getPropertyValue(aProperty)) { - // Keep this property for the next rule. We need to find a rule - // which has the property. - return true; - } - - result[aProperty] = true; - - // We found a rule that has the current property while it does not - // match the current element. We can remove this property from the - // array. - return false; - }); - - return aProperties.length == 0; - }, this); - }, this); - - aProperties.forEach(function(aProperty) { result[aProperty] = false; }); - - return result; - }, - - /** - * Check if a CssRule has an unmatched selector for the highlighted element or - * its parents. - * - * @private - * @param {CssRule} aRule The rule you want to check if it has an unmatched - * selector. - * @return {boolean} True if the rule has an unmatched selector, false - * otherwise. - */ - _ruleHasUnmatchedSelector: function CL__ruleHasUnmatchedSelector(aRule) - { - if (!aRule._cssSheet && aRule.sourceElement) { - // CssRule wraps element.style, which never has unmatched selectors. - return false; - } - - let element = this.viewedElement; - let selectors = aRule.selectors; - - do { - selectors = selectors.filter(function(aSelector) { - return !element.mozMatchesSelector(aSelector); - }); - - if (selectors.length == 0) { - break; - } - } while ((element = element.parentNode) && - element.nodeType === Ci.nsIDOMNode.ELEMENT_NODE); - - return selectors.length > 0; - }, - /** * Tells if the given DOM CSS object matches the current view media. * @@ -1494,10 +1350,9 @@ CssSelector.prototype = { * A cache of information about the matched rules, selectors and values attached * to a CSS property, for the highlighted element. * - * The heart of the CssPropertyInfo object is the _findMatchedSelectors() and - * _findUnmatchedSelectors() methods. These are invoked when the PropertyView - * tries to access the .matchedSelectors and .unmatchedSelectors arrays. - * Results are cached, for later reuse. + * The heart of the CssPropertyInfo object is the _findMatchedSelectors() + * method. This is invoked when the PropertyView tries to access the + * .matchedSelectors array. Results are cached, for later reuse. * * @param {CssLogic} aCssLogic Reference to the parent CssLogic instance * @param {string} aProperty The CSS property we are gathering information for @@ -1518,7 +1373,6 @@ function CssPropertyInfo(aCssLogic, aProperty) // counted. This includes rules that come from filtered stylesheets (those // that have sheetAllowed = false). this._matchedSelectors = null; - this._unmatchedSelectors = null; } CssPropertyInfo.prototype = { @@ -1561,23 +1415,6 @@ CssPropertyInfo.prototype = { return this._matchedRuleCount; }, - /** - * Retrieve the number of unmatched rules. - * - * @return {number} the number of rules that do not match the highlighted - * element or its parents. - */ - get unmatchedRuleCount() - { - if (!this._unmatchedSelectors) { - this._findUnmatchedSelectors(); - } else if (this.needRefilter) { - this._refilterSelectors(); - } - - return this._unmatchedRuleCount; - }, - /** * Retrieve the array holding CssSelectorInfo objects for each of the matched * selectors, from each of the matched rules. Only selectors coming from @@ -1597,25 +1434,6 @@ CssPropertyInfo.prototype = { return this._matchedSelectors; }, - /** - * Retrieve the array holding CssSelectorInfo objects for each of the - * unmatched selectors, from each of the unmatched rules. Only selectors - * coming from allowed stylesheets are included in the array. - * - * @return {array} the list of CssSelectorInfo objects of selectors that do - * not match the highlighted element or its parents. - */ - get unmatchedSelectors() - { - if (!this._unmatchedSelectors) { - this._findUnmatchedSelectors(); - } else if (this.needRefilter) { - this._refilterSelectors(); - } - - return this._unmatchedSelectors; - }, - /** * Find the selectors that match the highlighted element and its parents. * Uses CssLogic.processMatchedSelectors() to find the matched selectors, @@ -1644,7 +1462,7 @@ CssPropertyInfo.prototype = { // Now we know which of the matches is best, we can mark it BEST_MATCH. if (this._matchedSelectors.length > 0 && - this._matchedSelectors[0].status > CssLogic.STATUS.UNMATCHED) { + this._matchedSelectors[0].status > CssLogic.STATUS.UNKNOWN) { this._matchedSelectors[0].status = CssLogic.STATUS.BEST; } }, @@ -1671,53 +1489,8 @@ CssPropertyInfo.prototype = { }, /** - * Find the selectors that do not match the highlighted element and its - * parents. - * @private - */ - _findUnmatchedSelectors: function CssPropertyInfo_findUnmatchedSelectors() - { - this._unmatchedSelectors = []; - this._unmatchedRuleCount = 0; - this.needRefilter = false; - this._cssLogic._passId++; - - this._cssLogic.processUnmatchedSelectors(this._processUnmatchedSelector, - this); - - // Sort the selectors by specificity. - this._unmatchedSelectors.sort(function(aSelectorInfo1, aSelectorInfo2) { - return aSelectorInfo1.compareTo(aSelectorInfo2); - }); - }, - - /** - * Process an unmatched CssSelector object. Note that in order to avoid - * information overload we DO NOT show unmatched system rules. - * - * @private - * @param {CssSelector} aSelector the unmatched CssSelector object. - */ - _processUnmatchedSelector: function CPI_processUnmatchedSelector(aSelector) - { - let cssRule = aSelector._cssRule; - let value = cssRule.getPropertyValue(this.property); - if (value) { - let selectorInfo = new CssSelectorInfo(aSelector, this.property, value, - CssLogic.STATUS.UNMATCHED); - this._unmatchedSelectors.push(selectorInfo); - if (this._cssLogic._passId != cssRule._passId) { - if (cssRule.sheetAllowed) { - this._unmatchedRuleCount++; - } - cssRule._passId = this._cssLogic._passId; - } - } - }, - - /** - * Refilter the matched and unmatched selectors arrays when the - * CssLogic.sourceFilter changes. This allows for quick filter changes. + * Refilter the matched selectors array when the CssLogic.sourceFilter + * changes. This allows for quick filter changes. * @private */ _refilterSelectors: function CssPropertyInfo_refilterSelectors() @@ -1740,12 +1513,6 @@ CssPropertyInfo.prototype = { this._matchedRuleCount = ruleCount; } - if (this._unmatchedSelectors) { - ruleCount = 0; - this._unmatchedSelectors.forEach(iterator); - this._unmatchedRuleCount = ruleCount; - } - this.needRefilter = false; }, @@ -1758,10 +1525,10 @@ CssPropertyInfo.prototype = { /** * A class that holds information about a given CssSelector object. * - * Instances of this class are given to CssHtmlTree in the arrays of matched and - * unmatched selectors. Each such object represents a displayable row in the - * PropertyView objects. The information given by this object blends data coming - * from the CssSheet, CssRule and from the CssSelector that own this object. + * Instances of this class are given to CssHtmlTree in the array of matched + * selectors. Each such object represents a displayable row in the PropertyView + * objects. The information given by this object blends data coming from the + * CssSheet, CssRule and from the CssSelector that own this object. * * @param {CssSelector} aSelector The CssSelector object for which to present information. * @param {string} aProperty The property for which information should be retrieved. diff --git a/browser/devtools/styleinspector/csshtmltree.xhtml b/browser/devtools/styleinspector/csshtmltree.xhtml index 50baa58e06c..bc84e8a4535 100644 --- a/browser/devtools/styleinspector/csshtmltree.xhtml +++ b/browser/devtools/styleinspector/csshtmltree.xhtml @@ -77,7 +77,6 @@ &bestMatch; &matched; &parentMatch; - &unmatched; @@ -142,15 +141,6 @@ To visually debug the templates without running firefox, alter the display:none -
@@ -178,32 +168,6 @@ To visually debug the templates without running firefox, alter the display:none
- - -
- - - - - - - -
- ${selector.humanReadableText(__element)} -
-
- diff --git a/browser/devtools/styleinspector/test/browser/browser_bug683672.html b/browser/devtools/styleinspector/test/browser/browser_bug683672.html index 78f96355018..020602467ac 100644 --- a/browser/devtools/styleinspector/test/browser/browser_bug683672.html +++ b/browser/devtools/styleinspector/test/browser/browser_bug683672.html @@ -7,10 +7,6 @@ color: #000; } - .unmatched1, .unmatched2, .unmatched3, .unmatched4, .unmatched5, .unmatched6, .unmatched7 { - color: #f00; - } - div { position: absolute; top: 40px; diff --git a/browser/devtools/styleinspector/test/browser/browser_bug683672.js b/browser/devtools/styleinspector/test/browser/browser_bug683672.js index 01c11c243a0..4d16b5feedb 100644 --- a/browser/devtools/styleinspector/test/browser/browser_bug683672.js +++ b/browser/devtools/styleinspector/test/browser/browser_bug683672.js @@ -38,7 +38,6 @@ function runTests() ok(stylePanel.isOpen(), "style inspector is open"); testMatchedSelectors(); - testUnmatchedSelectors(); info("finishing up"); Services.obs.addObserver(finishUp, "StyleInspector-closed", false); @@ -69,30 +68,6 @@ function testMatchedSelectors() "hasMatchedSelectors returns true"); } -function testUnmatchedSelectors() -{ - info("checking selector counts, unmatched rules and titles"); - let body = content.document.body; - ok(body, "captain, we have a body"); - - info("selecting content.document.body"); - stylePanel.selectNode(body); - - let htmlTree = stylePanel.cssHtmlTree; - - is(body, htmlTree.viewedElement, - "style inspector node matches the selected node"); - - let propertyView = new PropertyView(htmlTree, "color"); - let numUnmatchedSelectors = propertyView.propertyInfo.unmatchedSelectors.length; - - is(numUnmatchedSelectors, 13, - "CssLogic returns the correct number of unmatched selectors for body"); - - is(propertyView.hasUnmatchedSelectors, true, - "hasUnmatchedSelectors returns true"); -} - function finishUp() { Services.obs.removeObserver(finishUp, "StyleInspector-closed", false); diff --git a/browser/devtools/styleinspector/test/browser/browser_styleinspector.js b/browser/devtools/styleinspector/test/browser/browser_styleinspector.js index 0f53bf23568..e293312fad6 100644 --- a/browser/devtools/styleinspector/test/browser/browser_styleinspector.js +++ b/browser/devtools/styleinspector/test/browser/browser_styleinspector.js @@ -64,7 +64,6 @@ function SI_CheckProperty() let cssLogic = stylePanel.cssLogic; let propertyInfo = cssLogic.getPropertyInfo("color"); ok(propertyInfo.matchedRuleCount > 0, "color property has matching rules"); - ok(propertyInfo.unmatchedRuleCount > 0, "color property has unmatched rules"); } function finishUp() diff --git a/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm b/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm index d02b4a257c8..c9db689c20d 100644 --- a/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm +++ b/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm @@ -179,7 +179,6 @@ Use inspectstyle($('text')) to inspect me
Use inspectstyle($('text2'))
Some Link -

font-family has a single unmatched rule

diff --git a/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd b/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd index 07bc28aad96..39ddbfa22df 100644 --- a/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd +++ b/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd @@ -18,17 +18,11 @@ - This is the link title shown in the hover tooltip. --> - - - - - diff --git a/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties b/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties index 13ec8c81fa0..60fdc746851 100644 --- a/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties +++ b/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties @@ -10,7 +10,6 @@ panelTitle=Style Inspector rule.status.BEST=Best Match rule.status.MATCHED=Matched rule.status.PARENT_MATCH=Parent Match -rule.status.UNMATCHED=Unmatched # LOCALIZATION NOTE (rule.sourceElement, rule.sourceInline): For each # style property the panel shows the rules which hold that specific property. diff --git a/browser/themes/gnomestripe/browser/devtools/csshtmltree.css b/browser/themes/gnomestripe/browser/devtools/csshtmltree.css index 6c2378f0ded..a7f07b8e4a4 100644 --- a/browser/themes/gnomestripe/browser/devtools/csshtmltree.css +++ b/browser/themes/gnomestripe/browser/devtools/csshtmltree.css @@ -92,14 +92,6 @@ body { -moz-padding-end: 5px; } - .rule-unmatched { - cursor: pointer; - padding: 2px; - -moz-padding-start: 4px; - -moz-padding-end: 0; - white-space: nowrap; - } - /* Take away these two :visited rules to get a core dumper */ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=575675#c30 */ .link, @@ -133,10 +125,6 @@ body { visibility: visible; } -.unmatchedSelectorTable { - -moz-margin-start: 15px; -} - .rulelink { color: -moz-dialogtext; -moz-margin-start: 12px; @@ -174,10 +162,6 @@ body { visibility: visible; } -.only-unmatched { - -moz-margin-start: 0; -} - .property-name { display: inline-block; font-size: 12px; @@ -214,9 +198,6 @@ body { .parentmatch { color: #666; } -.unmatched { - color: brown; -} #propertyContainer { display: -moz-box; diff --git a/browser/themes/pinstripe/browser/devtools/csshtmltree.css b/browser/themes/pinstripe/browser/devtools/csshtmltree.css index df346f2e659..a7f07b8e4a4 100644 --- a/browser/themes/pinstripe/browser/devtools/csshtmltree.css +++ b/browser/themes/pinstripe/browser/devtools/csshtmltree.css @@ -92,14 +92,6 @@ body { -moz-padding-end: 5px; } - .rule-unmatched { - cursor: pointer; - padding: 2px; - -moz-padding-start: 4px; - -moz-padding-end: 0; - white-space: nowrap; - } - /* Take away these two :visited rules to get a core dumper */ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=575675#c30 */ .link, @@ -133,30 +125,28 @@ body { visibility: visible; } -.unmatchedSelectorTable { - -moz-margin-start: 15px; -} - .rulelink { color: -moz-dialogtext; -moz-margin-start: 12px; } .expander { - -moz-appearance: treetwisty; - width: 12px; - height: 12px; + width: 8px; + height: 8px; float: left; - -moz-margin-start: 5px; + -moz-margin-start: 15px; -moz-margin-end: 5px; + margin-top: 3px; + background: url("chrome://browser/skin/devtools/arrows.png") 48px 0; } .expander[dir="rtl"] { float: right; + background-position: 40px 0; } .expander[open] { - -moz-appearance: treetwistyopen; + background-position: 32px 0; } .expandable { @@ -172,10 +162,6 @@ body { visibility: visible; } -.only-unmatched { - -moz-margin-start: 0; -} - .property-name { display: inline-block; font-size: 12px; @@ -212,9 +198,6 @@ body { .parentmatch { color: #666; } -.unmatched { - color: brown; -} #propertyContainer { display: -moz-box; diff --git a/browser/themes/winstripe/browser/devtools/csshtmltree.css b/browser/themes/winstripe/browser/devtools/csshtmltree.css index aaad2af5c7e..03eb3516aeb 100644 --- a/browser/themes/winstripe/browser/devtools/csshtmltree.css +++ b/browser/themes/winstripe/browser/devtools/csshtmltree.css @@ -92,14 +92,6 @@ body { -moz-padding-end: 5px; } - .rule-unmatched { - cursor: pointer; - padding: 2px; - -moz-padding-start: 4px; - -moz-padding-end: 0; - white-space: nowrap; - } - /* Take away these two :visited rules to get a core dumper */ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=575675#c30 */ .link, @@ -133,10 +125,6 @@ body { visibility: visible; } -.unmatchedSelectorTable { - -moz-margin-start: 15px; -} - .rulelink { color: -moz-dialogtext; -moz-margin-start: 12px; @@ -173,10 +161,6 @@ body { visibility: visible; } -.only-unmatched { - -moz-margin-start: 0; -} - .property-name { display: inline-block; font-size: 12px; @@ -213,9 +197,6 @@ body { .parentmatch { color: #666; } -.unmatched { - color: brown; -} #propertyContainer { display: -moz-box; From 9c58856be1b155f6b7fb47cff5cec8d4d607f727 Mon Sep 17 00:00:00 2001 From: Michael Ratcliffe Date: Sat, 5 Nov 2011 12:52:55 +0100 Subject: [PATCH 089/127] Bug 689759 - Style Inspector needs a no-results placeholder; r=msucan --- .../devtools/styleinspector/CssHtmlTree.jsm | 17 +++ .../devtools/styleinspector/csshtmltree.xhtml | 5 + .../styleinspector/test/browser/Makefile.in | 1 + ...ector_bug_689759_no_results_placeholder.js | 118 ++++++++++++++++++ .../browser/devtools/styleinspector.dtd | 5 + .../browser/devtools/csshtmltree.css | 6 + .../browser/devtools/csshtmltree.css | 6 + .../browser/devtools/csshtmltree.css | 6 + 8 files changed, 164 insertions(+) create mode 100644 browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_689759_no_results_placeholder.js diff --git a/browser/devtools/styleinspector/CssHtmlTree.jsm b/browser/devtools/styleinspector/CssHtmlTree.jsm index cc521643aef..3c4429cc1da 100644 --- a/browser/devtools/styleinspector/CssHtmlTree.jsm +++ b/browser/devtools/styleinspector/CssHtmlTree.jsm @@ -81,6 +81,9 @@ function CssHtmlTree(aStyleInspector) this.templateProperty = this.styleDocument.getElementById("templateProperty"); this.panel = aStyleInspector.panel; + // No results text. + this.noResults = this.styleDocument.getElementById("noResults"); + // The element that we're inspecting, and the document that it comes from. this.viewedElement = null; this.createStyleViews(); @@ -153,6 +156,9 @@ CssHtmlTree.prototype = { // Toggle for zebra striping _darkStripe: true, + // Number of visible properties + numVisibleProperties: 0, + get showOnlyUserStyles() { return this.onlyUserStylesCheckbox.checked; @@ -196,6 +202,9 @@ CssHtmlTree.prototype = { let propView = new PropertyView(this, name); CssHtmlTree.processTemplate(this.templateProperty, this.propertyContainer, propView, true); + if (propView.visible) { + this.numVisibleProperties++; + } propView.refreshMatchedSelectors(); this.propertyViews.push(propView); } @@ -207,6 +216,7 @@ CssHtmlTree.prototype = { } else { this.htmlComplete = true; this._panelRefreshTimeout = null; + this.noResults.hidden = this.numVisibleProperties ? true : false; Services.obs.notifyObservers(null, "StyleInspector-populated", null); } } @@ -225,6 +235,11 @@ CssHtmlTree.prototype = { this.win.clearTimeout(this._panelRefreshTimeout); } + this.noResults.hidden = true; + + // Reset visible property count + this.numVisibleProperties = 0; + // Reset zebra striping. this._darkStripe = true; @@ -244,6 +259,7 @@ CssHtmlTree.prototype = { this._panelRefreshTimeout = this.win.setTimeout(refreshView.bind(this), 15); } else { this._panelRefreshTimeout = null; + this.noResults.hidden = this.numVisibleProperties ? true : false; Services.obs.notifyObservers(null, "StyleInspector-populated", null); } } @@ -515,6 +531,7 @@ PropertyView.prototype = { return; } + this.tree.numVisibleProperties++; this.valueNode.innerHTML = this.propertyInfo.value; this.refreshMatchedSelectors(); }, diff --git a/browser/devtools/styleinspector/csshtmltree.xhtml b/browser/devtools/styleinspector/csshtmltree.xhtml index bc84e8a4535..0cf16775971 100644 --- a/browser/devtools/styleinspector/csshtmltree.xhtml +++ b/browser/devtools/styleinspector/csshtmltree.xhtml @@ -69,6 +69,11 @@
+ + +
diff --git a/browser/devtools/styleinspector/test/browser/Makefile.in b/browser/devtools/styleinspector/test/browser/Makefile.in index df8ab992ab9..f2dda2cbcbd 100644 --- a/browser/devtools/styleinspector/test/browser/Makefile.in +++ b/browser/devtools/styleinspector/test/browser/Makefile.in @@ -51,6 +51,7 @@ _BROWSER_TEST_FILES = \ browser_bug683672.js \ browser_styleinspector_bug_672746_default_styles.js \ browser_styleinspector_bug_672744_search_filter.js \ + browser_styleinspector_bug_689759_no_results_placeholder.js \ browser_bug_692400_element_style.js \ browser_ruleview_editor.js \ browser_ruleview_inherit.js \ diff --git a/browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_689759_no_results_placeholder.js b/browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_689759_no_results_placeholder.js new file mode 100644 index 00000000000..0a7ae442d51 --- /dev/null +++ b/browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_689759_no_results_placeholder.js @@ -0,0 +1,118 @@ +/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +// Tests that the no results placeholder works properly. + +let doc; +let stylePanel; + +function createDocument() +{ + doc.body.innerHTML = '' + + 'Some styled text'; + doc.title = "Tests that the no results placeholder works properly"; + ok(window.StyleInspector, "StyleInspector exists"); + stylePanel = new StyleInspector(window); + Services.obs.addObserver(runStyleInspectorTests, "StyleInspector-opened", false); + stylePanel.createPanel(false, function() { + stylePanel.open(doc.body); + }); +} + +function runStyleInspectorTests() +{ + Services.obs.removeObserver(runStyleInspectorTests, "StyleInspector-opened", false); + + ok(stylePanel.isOpen(), "style inspector is open"); + + Services.obs.addObserver(SI_AddFilterText, "StyleInspector-populated", false); + + let span = doc.querySelector("#matches"); + ok(span, "captain, we have the matches span"); + + let htmlTree = stylePanel.cssHtmlTree; + stylePanel.selectNode(span); + + is(span, htmlTree.viewedElement, + "style inspector node matches the selected node"); + is(htmlTree.viewedElement, stylePanel.cssLogic.viewedElement, + "cssLogic node matches the cssHtmlTree node"); +} + +function SI_AddFilterText() +{ + Services.obs.removeObserver(SI_AddFilterText, "StyleInspector-populated", false); + + let iframe = stylePanel.iframe; + let searchbar = stylePanel.cssHtmlTree.searchField; + let searchTerm = "xxxxx"; + + Services.obs.addObserver(SI_checkPlaceholderVisible, "StyleInspector-populated", false); + info("setting filter text to \"" + searchTerm + "\""); + searchbar.focus(); + for each (let c in searchTerm) { + EventUtils.synthesizeKey(c, {}, iframe.contentWindow); + } +} + +function SI_checkPlaceholderVisible() +{ + Services.obs.removeObserver(SI_checkPlaceholderVisible, "StyleInspector-populated", false); + info("SI_checkPlaceholderVisible called"); + let placeholder = stylePanel.cssHtmlTree.noResults; + let iframe = stylePanel.iframe; + let display = iframe.contentWindow.getComputedStyle(placeholder).display; + + is(display, "block", "placeholder is visible"); + + SI_ClearFilterText(); +} + +function SI_ClearFilterText() +{ + let iframe = stylePanel.iframe; + let searchbar = stylePanel.cssHtmlTree.searchField; + + Services.obs.addObserver(SI_checkPlaceholderHidden, "StyleInspector-populated", false); + info("clearing filter text"); + searchbar.focus(); + searchbar.value = ""; + EventUtils.synthesizeKey("c", {}, iframe.contentWindow); +} + +function SI_checkPlaceholderHidden() +{ + Services.obs.removeObserver(SI_checkPlaceholderHidden, "StyleInspector-populated", false); + let placeholder = stylePanel.cssHtmlTree.noResults; + let iframe = stylePanel.iframe; + let display = iframe.contentWindow.getComputedStyle(placeholder).display; + + is(display, "none", "placeholder is hidden"); + + Services.obs.addObserver(finishUp, "StyleInspector-closed", false); + stylePanel.close(); +} + +function finishUp() +{ + Services.obs.removeObserver(finishUp, "StyleInspector-closed", false); + ok(!stylePanel.isOpen(), "style inspector is closed"); + doc = stylePanel = null; + gBrowser.removeCurrentTab(); + finish(); +} + +function test() +{ + waitForExplicitFinish(); + gBrowser.selectedTab = gBrowser.addTab(); + gBrowser.selectedBrowser.addEventListener("load", function onLoad(evt) { + gBrowser.selectedBrowser.removeEventListener(evt.type, onLoad, true); + doc = content.document; + waitForFocus(createDocument, content); + }, true); + + content.location = "data:text/html,no results placeholder test"; +} diff --git a/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd b/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd index 39ddbfa22df..9ffd6000e09 100644 --- a/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd +++ b/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd @@ -18,6 +18,11 @@ - This is the link title shown in the hover tooltip. --> + + + +
+ + + + + + + +
+ ${selector.humanReadableText(__element)} +
+
+ diff --git a/browser/devtools/styleinspector/test/browser/browser_bug683672.html b/browser/devtools/styleinspector/test/browser/browser_bug683672.html index 020602467ac..78f96355018 100644 --- a/browser/devtools/styleinspector/test/browser/browser_bug683672.html +++ b/browser/devtools/styleinspector/test/browser/browser_bug683672.html @@ -7,6 +7,10 @@ color: #000; } + .unmatched1, .unmatched2, .unmatched3, .unmatched4, .unmatched5, .unmatched6, .unmatched7 { + color: #f00; + } + div { position: absolute; top: 40px; diff --git a/browser/devtools/styleinspector/test/browser/browser_bug683672.js b/browser/devtools/styleinspector/test/browser/browser_bug683672.js index 4d16b5feedb..01c11c243a0 100644 --- a/browser/devtools/styleinspector/test/browser/browser_bug683672.js +++ b/browser/devtools/styleinspector/test/browser/browser_bug683672.js @@ -38,6 +38,7 @@ function runTests() ok(stylePanel.isOpen(), "style inspector is open"); testMatchedSelectors(); + testUnmatchedSelectors(); info("finishing up"); Services.obs.addObserver(finishUp, "StyleInspector-closed", false); @@ -68,6 +69,30 @@ function testMatchedSelectors() "hasMatchedSelectors returns true"); } +function testUnmatchedSelectors() +{ + info("checking selector counts, unmatched rules and titles"); + let body = content.document.body; + ok(body, "captain, we have a body"); + + info("selecting content.document.body"); + stylePanel.selectNode(body); + + let htmlTree = stylePanel.cssHtmlTree; + + is(body, htmlTree.viewedElement, + "style inspector node matches the selected node"); + + let propertyView = new PropertyView(htmlTree, "color"); + let numUnmatchedSelectors = propertyView.propertyInfo.unmatchedSelectors.length; + + is(numUnmatchedSelectors, 13, + "CssLogic returns the correct number of unmatched selectors for body"); + + is(propertyView.hasUnmatchedSelectors, true, + "hasUnmatchedSelectors returns true"); +} + function finishUp() { Services.obs.removeObserver(finishUp, "StyleInspector-closed", false); diff --git a/browser/devtools/styleinspector/test/browser/browser_styleinspector.js b/browser/devtools/styleinspector/test/browser/browser_styleinspector.js index e293312fad6..0f53bf23568 100644 --- a/browser/devtools/styleinspector/test/browser/browser_styleinspector.js +++ b/browser/devtools/styleinspector/test/browser/browser_styleinspector.js @@ -64,6 +64,7 @@ function SI_CheckProperty() let cssLogic = stylePanel.cssLogic; let propertyInfo = cssLogic.getPropertyInfo("color"); ok(propertyInfo.matchedRuleCount > 0, "color property has matching rules"); + ok(propertyInfo.unmatchedRuleCount > 0, "color property has unmatched rules"); } function finishUp() diff --git a/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm b/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm index c9db689c20d..d02b4a257c8 100644 --- a/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm +++ b/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm @@ -179,6 +179,7 @@ Use inspectstyle($('text')) to inspect me
Use inspectstyle($('text2'))
Some Link +

font-family has a single unmatched rule

diff --git a/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd b/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd index 9ffd6000e09..5f308774a80 100644 --- a/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd +++ b/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd @@ -18,6 +18,14 @@ - This is the link title shown in the hover tooltip. --> + + + + @@ -31,3 +39,4 @@ + diff --git a/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties b/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties index 60fdc746851..13ec8c81fa0 100644 --- a/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties +++ b/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties @@ -10,6 +10,7 @@ panelTitle=Style Inspector rule.status.BEST=Best Match rule.status.MATCHED=Matched rule.status.PARENT_MATCH=Parent Match +rule.status.UNMATCHED=Unmatched # LOCALIZATION NOTE (rule.sourceElement, rule.sourceInline): For each # style property the panel shows the rules which hold that specific property. diff --git a/browser/themes/gnomestripe/browser/devtools/csshtmltree.css b/browser/themes/gnomestripe/browser/devtools/csshtmltree.css index 3f7bfc5ee31..fa05256a642 100644 --- a/browser/themes/gnomestripe/browser/devtools/csshtmltree.css +++ b/browser/themes/gnomestripe/browser/devtools/csshtmltree.css @@ -92,6 +92,14 @@ body { -moz-padding-end: 5px; } + .rule-unmatched { + cursor: pointer; + padding: 2px; + -moz-padding-start: 4px; + -moz-padding-end: 0; + white-space: nowrap; + } + /* Take away these two :visited rules to get a core dumper */ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=575675#c30 */ .link, @@ -125,6 +133,10 @@ body { visibility: visible; } +.unmatchedSelectorTable { + -moz-margin-start: 15px; +} + .rulelink { color: -moz-dialogtext; -moz-margin-start: 12px; @@ -162,6 +174,10 @@ body { visibility: visible; } +.only-unmatched { + -moz-margin-start: 0; +} + .property-name { display: inline-block; font-size: 12px; @@ -198,6 +214,9 @@ body { .parentmatch { color: #666; } +.unmatched { + color: brown; +} #propertyContainer { display: -moz-box; diff --git a/browser/themes/pinstripe/browser/devtools/csshtmltree.css b/browser/themes/pinstripe/browser/devtools/csshtmltree.css index 3f7bfc5ee31..76f9385127c 100644 --- a/browser/themes/pinstripe/browser/devtools/csshtmltree.css +++ b/browser/themes/pinstripe/browser/devtools/csshtmltree.css @@ -92,6 +92,14 @@ body { -moz-padding-end: 5px; } + .rule-unmatched { + cursor: pointer; + padding: 2px; + -moz-padding-start: 4px; + -moz-padding-end: 0; + white-space: nowrap; + } + /* Take away these two :visited rules to get a core dumper */ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=575675#c30 */ .link, @@ -125,28 +133,30 @@ body { visibility: visible; } +.unmatchedSelectorTable { + -moz-margin-start: 15px; +} + .rulelink { color: -moz-dialogtext; -moz-margin-start: 12px; } .expander { - width: 8px; - height: 8px; + -moz-appearance: treetwisty; + width: 12px; + height: 12px; float: left; - -moz-margin-start: 15px; + -moz-margin-start: 5px; -moz-margin-end: 5px; - margin-top: 3px; - background: url("chrome://browser/skin/devtools/arrows.png") 48px 0; } .expander[dir="rtl"] { float: right; - background-position: 40px 0; } .expander[open] { - background-position: 32px 0; + -moz-appearance: treetwistyopen; } .expandable { @@ -162,6 +172,10 @@ body { visibility: visible; } +.only-unmatched { + -moz-margin-start: 0; +} + .property-name { display: inline-block; font-size: 12px; @@ -198,6 +212,9 @@ body { .parentmatch { color: #666; } +.unmatched { + color: brown; +} #propertyContainer { display: -moz-box; diff --git a/browser/themes/winstripe/browser/devtools/csshtmltree.css b/browser/themes/winstripe/browser/devtools/csshtmltree.css index 17b0d3d0fd7..778ccda6aa2 100644 --- a/browser/themes/winstripe/browser/devtools/csshtmltree.css +++ b/browser/themes/winstripe/browser/devtools/csshtmltree.css @@ -92,6 +92,14 @@ body { -moz-padding-end: 5px; } + .rule-unmatched { + cursor: pointer; + padding: 2px; + -moz-padding-start: 4px; + -moz-padding-end: 0; + white-space: nowrap; + } + /* Take away these two :visited rules to get a core dumper */ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=575675#c30 */ .link, @@ -125,6 +133,10 @@ body { visibility: visible; } +.unmatchedSelectorTable { + -moz-margin-start: 15px; +} + .rulelink { color: -moz-dialogtext; -moz-margin-start: 12px; @@ -161,6 +173,10 @@ body { visibility: visible; } +.only-unmatched { + -moz-margin-start: 0; +} + .property-name { display: inline-block; font-size: 12px; @@ -197,6 +213,9 @@ body { .parentmatch { color: #666; } +.unmatched { + color: brown; +} #propertyContainer { display: -moz-box; From 0cb96d90ec5f720235080743bbfa40ddc970b413 Mon Sep 17 00:00:00 2001 From: Rob Campbell Date: Sat, 5 Nov 2011 17:15:58 -0300 Subject: [PATCH 095/127] Bug 698762 - Remove unmatched rules from style inspector; fix merge bustage; a=bustage --- .../locales/en-US/chrome/browser/devtools/styleinspector.dtd | 3 --- 1 file changed, 3 deletions(-) diff --git a/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd b/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd index 5f308774a80..9cdd650ac6e 100644 --- a/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd +++ b/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd @@ -23,9 +23,6 @@ - currently selected element. --> - From b343f5d5155090089c31c42d670c7989a4d8b483 Mon Sep 17 00:00:00 2001 From: Rob Campbell Date: Sat, 5 Nov 2011 19:18:58 -0300 Subject: [PATCH 096/127] Backout part 1 - Bug 698762 rev 1b6acffa7a94, Bug 698762 rev f0e736dbc7bc, a=bustage --- .../devtools/styleinspector/CssHtmlTree.jsm | 159 +---------- browser/devtools/styleinspector/CssLogic.jsm | 265 ++---------------- .../devtools/styleinspector/csshtmltree.xhtml | 36 --- .../test/browser/browser_bug683672.html | 4 - .../test/browser/browser_bug683672.js | 25 -- .../test/browser/browser_styleinspector.js | 1 - .../browser_styleinspector_webconsole.htm | 1 - .../browser/devtools/styleinspector.dtd | 6 - .../devtools/styleinspector.properties | 1 - .../browser/devtools/csshtmltree.css | 19 -- .../browser/devtools/csshtmltree.css | 31 +- .../browser/devtools/csshtmltree.css | 19 -- 12 files changed, 30 insertions(+), 537 deletions(-) diff --git a/browser/devtools/styleinspector/CssHtmlTree.jsm b/browser/devtools/styleinspector/CssHtmlTree.jsm index 2c7213bd0e5..3c4429cc1da 100644 --- a/browser/devtools/styleinspector/CssHtmlTree.jsm +++ b/browser/devtools/styleinspector/CssHtmlTree.jsm @@ -136,9 +136,8 @@ XPCOMUtils.defineLazyGetter(CssHtmlTree, "_strings", function() Services.strings .createBundle("chrome://browser/locale/devtools/styleinspector.properties")); CssHtmlTree.prototype = { - // Cache the list of properties that have matched and unmatched properties. + // Cache the list of properties that have matched properties. _matchedProperties: null, - _unmatchedProperties: null, htmlComplete: false, @@ -177,7 +176,6 @@ CssHtmlTree.prototype = { } this.viewedElement = aElement; - this._unmatchedProperties = null; this._matchedProperties = null; CssHtmlTree.processTemplate(this.templatePath, this.path, this); @@ -375,41 +373,6 @@ CssHtmlTree.prototype = { return this._matchedProperties; }, - /** - * Check if a property has unmatched selectors. Result is cached. - * - * @param {string} aProperty the name of the property you want to check. - * @return {boolean} true if the property has unmatched selectors, false - * otherwise. - */ - hasUnmatchedSelectors: function CssHtmlTree_hasUnmatchedSelectors(aProperty) - { - // Initially check all of the properties that return false for - // hasMatchedSelectors(). This speeds-up the UI. - if (!this._unmatchedProperties) { - let properties = []; - CssHtmlTree.propertyNames.forEach(function(aName) { - if (!this.matchedProperties[aName]) { - properties.push(aName); - } - }, this); - - if (properties.indexOf(aProperty) == -1) { - properties.push(aProperty); - } - - this._unmatchedProperties = this.cssLogic.hasUnmatchedSelectors(properties); - } - - // Lazy-get the result for properties we do not have cached. - if (!(aProperty in this._unmatchedProperties)) { - let result = this.cssLogic.hasUnmatchedSelectors([aProperty]); - this._unmatchedProperties[aProperty] = result[aProperty]; - } - - return this._unmatchedProperties[aProperty]; - }, - /** * Destructor for CssHtmlTree. */ @@ -460,7 +423,6 @@ function PropertyView(aTree, aName) this.link = "https://developer.mozilla.org/en/CSS/" + aName; this.templateMatchedSelectors = aTree.styleDocument.getElementById("templateMatchedSelectors"); - this.templateUnmatchedSelectors = aTree.styleDocument.getElementById("templateUnmatchedSelectors"); } PropertyView.prototype = { @@ -476,33 +438,15 @@ PropertyView.prototype = { // Are matched rules expanded? matchedExpanded: false, - // Are unmatched rules expanded? - unmatchedExpanded: false, - - // Unmatched selector table - unmatchedSelectorTable: null, - // Matched selector container matchedSelectorsContainer: null, // Matched selector expando matchedExpander: null, - // Unmatched selector expando - unmatchedExpander: null, - - // Unmatched selector container - unmatchedSelectorsContainer: null, - - // Unmatched title block - unmatchedTitleBlock: null, - // Cache for matched selector views _matchedSelectorViews: null, - // Cache for unmatched selector views - _unmatchedSelectorViews: null, - // The previously selected element used for the selector view caches prevViewedElement: null, @@ -533,14 +477,6 @@ PropertyView.prototype = { return this.tree.matchedProperties[this.name]; }, - /** - * Does the property have any unmatched selectors? - */ - get hasUnmatchedSelectors() - { - return this.tree.hasUnmatchedSelectors(this.name); - }, - /** * Should this property be visible? */ @@ -584,24 +520,20 @@ PropertyView.prototype = { if (this.prevViewedElement != this.tree.viewedElement) { this._matchedSelectorViews = null; - this._unmatchedSelectorViews = null; this.prevViewedElement = this.tree.viewedElement; } if (!this.tree.viewedElement || !this.visible) { this.valueNode.innerHTML = ""; this.matchedSelectorsContainer.hidden = true; - this.unmatchedSelectorsContainer.hidden = true; - this.unmatchedSelectorTable.innerHTML = ""; this.matchedSelectorsContainer.innerHTML = ""; this.matchedExpander.removeAttribute("open"); - this.unmatchedExpander.removeAttribute("open"); return; } this.tree.numVisibleProperties++; this.valueNode.innerHTML = this.propertyInfo.value; - this.refreshAllSelectors(); + this.refreshMatchedSelectors(); }, /** @@ -612,7 +544,7 @@ PropertyView.prototype = { let hasMatchedSelectors = this.hasMatchedSelectors; this.matchedSelectorsContainer.hidden = !hasMatchedSelectors; - if (hasMatchedSelectors || this.hasUnmatchedSelectors) { + if (hasMatchedSelectors) { this.propertyHeader.classList.add("expandable"); } else { this.propertyHeader.classList.remove("expandable"); @@ -628,52 +560,6 @@ PropertyView.prototype = { } }, - /** - * Refresh the panel unmatched rules. - */ - refreshUnmatchedSelectors: function PropertyView_refreshUnmatchedSelectors() - { - let hasMatchedSelectors = this.hasMatchedSelectors; - - this.unmatchedSelectorTable.hidden = !this.unmatchedExpanded; - - if (hasMatchedSelectors) { - this.unmatchedSelectorsContainer.hidden = !this.matchedExpanded || - !this.hasUnmatchedSelectors; - this.unmatchedTitleBlock.hidden = false; - } else { - this.unmatchedSelectorsContainer.hidden = !this.unmatchedExpanded; - this.unmatchedTitleBlock.hidden = true; - } - - if (this.unmatchedExpanded && this.hasUnmatchedSelectors) { - CssHtmlTree.processTemplate(this.templateUnmatchedSelectors, - this.unmatchedSelectorTable, this); - if (!hasMatchedSelectors) { - this.matchedExpander.setAttribute("open", ""); - this.unmatchedSelectorTable.classList.add("only-unmatched"); - } else { - this.unmatchedExpander.setAttribute("open", ""); - this.unmatchedSelectorTable.classList.remove("only-unmatched"); - } - } else { - if (!hasMatchedSelectors) { - this.matchedExpander.removeAttribute("open"); - } - this.unmatchedExpander.removeAttribute("open"); - this.unmatchedSelectorTable.innerHTML = ""; - } - }, - - /** - * Refresh the panel matched and unmatched rules - */ - refreshAllSelectors: function PropertyView_refreshAllSelectors() - { - this.refreshMatchedSelectors(); - this.refreshUnmatchedSelectors(); - }, - /** * Provide access to the matched SelectorViews that we are currently * displaying. @@ -687,27 +573,9 @@ PropertyView.prototype = { this._matchedSelectorViews.push(new SelectorView(this.tree, aSelectorInfo)); }, this); } - return this._matchedSelectorViews; }, - /** - * Provide access to the unmatched SelectorViews that we are currently - * displaying. - */ - get unmatchedSelectorViews() - { - if (!this._unmatchedSelectorViews) { - this._unmatchedSelectorViews = []; - this.propertyInfo.unmatchedSelectors.forEach( - function unmatchedSelectorViews_convert(aSelectorInfo) { - this._unmatchedSelectorViews.push(new SelectorView(this.tree, aSelectorInfo)); - }, this); - } - - return this._unmatchedSelectorViews; - }, - /** * The action when a user expands matched selectors. * @@ -719,24 +587,11 @@ PropertyView.prototype = { { if (aEvent.target.className != "helplink") { this.matchedExpanded = !this.matchedExpanded; - if (!this.hasMatchedSelectors && this.hasUnmatchedSelectors) { - this.unmatchedExpanded = !this.unmatchedExpanded; - } - this.refreshAllSelectors(); + this.refreshMatchedSelectors(); aEvent.preventDefault(); } }, - /** - * The action when a user expands unmatched selectors. - */ - unmatchedSelectorsClick: function PropertyView_unmatchedSelectorsClick(aEvent) - { - this.unmatchedExpanded = !this.unmatchedExpanded; - this.refreshUnmatchedSelectors(); - aEvent.preventDefault(); - }, - /** * The action when a user clicks on the MDN help link for a property. */ @@ -765,11 +620,11 @@ function SelectorView(aTree, aSelectorInfo) * @see CssLogic.STATUS */ SelectorView.STATUS_NAMES = [ - // "Unmatched", "Parent Match", "Matched", "Best Match" + // "Parent Match", "Matched", "Best Match" ]; SelectorView.CLASS_NAMES = [ - "unmatched", "parentmatch", "matched", "bestmatch" + "parentmatch", "matched", "bestmatch" ]; SelectorView.prototype = { @@ -790,7 +645,7 @@ SelectorView.prototype = { for (let status in CssLogic.STATUS) { let i = CssLogic.STATUS[status]; - if (i > -1) { + if (i > CssLogic.STATUS.UNKNOWN) { let value = CssHtmlTree.l10n("rule.status." + status); // Replace normal spaces with non-breaking spaces SelectorView.STATUS_NAMES[i] = value.replace(/ /g, '\u00A0'); diff --git a/browser/devtools/styleinspector/CssLogic.jsm b/browser/devtools/styleinspector/CssLogic.jsm index 278b915b5f5..9d33fd7c6ae 100644 --- a/browser/devtools/styleinspector/CssLogic.jsm +++ b/browser/devtools/styleinspector/CssLogic.jsm @@ -58,8 +58,7 @@ * standard DOM API, but more inline with the definition in the spec. * * - CssPropertyInfo contains style information for a single property for the - * highlighted element. It divides the CSS rules on the page into matched and - * unmatched rules. + * highlighted element. It contains the matched CSS rules on the page. * - CssSelectorInfo is a wrapper around CssSelector, which adds sorting with * reference to the selected element. */ @@ -116,10 +115,9 @@ CssLogic.MEDIA = { * @see csshtmltree.js RuleView._cacheStatusNames() */ CssLogic.STATUS = { - BEST: 3, - MATCHED: 2, - PARENT_MATCH: 1, - UNMATCHED: 0, + BEST: 2, + MATCHED: 1, + PARENT_MATCH: 0, UNKNOWN: -1, }; @@ -147,13 +145,11 @@ CssLogic.prototype = { // processMatchedSelectors(). _passId: 0, - // Used for tracking matched CssSelector objects, such that we can skip them - // in processUnmatchedSelectors(). + // Used for tracking matched CssSelector objects. _matchId: 0, _matchedRules: null, _matchedSelectors: null, - _unmatchedSelectors: null, domUtils: Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils), @@ -169,7 +165,6 @@ CssLogic.prototype = { this._sheetsCached = false; this._matchedRules = null; this._matchedSelectors = null; - this._unmatchedSelectors = null; }, /** @@ -204,7 +199,6 @@ CssLogic.prototype = { this._matchedRules = null; this._matchedSelectors = null; - this._unmatchedSelectors = null; let win = this.viewedDocument.defaultView; this._computedStyle = win.getComputedStyle(this.viewedElement, ""); }, @@ -219,8 +213,7 @@ CssLogic.prototype = { /** * Source filter. Only display properties coming from the given source (web - * address). Note that in order to avoid information overload we DO NOT show - * unmatched system rules. + * address). * @see CssLogic.FILTER.* */ set sourceFilter(aValue) { @@ -247,7 +240,6 @@ CssLogic.prototype = { if (needFullUpdate) { this._matchedRules = null; this._matchedSelectors = null; - this._unmatchedSelectors = null; this._propertyInfos = {}; } else { // Update the CssPropertyInfo objects. @@ -495,7 +487,6 @@ CssLogic.prototype = { } this._matchedSelectors = []; - this._unmatchedSelectors = null; this._passId++; for (let i = 0; i < this._matchedRules.length; i++) { @@ -540,52 +531,6 @@ CssLogic.prototype = { return false; }, - /** - * Process the CssSelector object that do not match the highlighted elements, - * nor its parents. Your callback function is invoked for every such - * CssSelector object. You receive one argument: the CssSelector object. - * - * The list of unmatched selectors is cached. - * - * @param {function} aCallback the function you want to execute for each of - * the unmatched selectors. - * @param {object} aScope the scope you want for the callback function. aScope - * will be the this object when aCallback executes. - */ - processUnmatchedSelectors: function CL_processUnmatchedSelectors(aCallback, aScope) - { - if (this._unmatchedSelectors) { - if (aCallback) { - this._unmatchedSelectors.forEach(aCallback, aScope); - } - return; - } - - if (!this._matchedSelectors) { - this.processMatchedSelectors(); - } - - this._unmatchedSelectors = []; - - this.forEachSheet(function (aSheet) { - // We do not show unmatched selectors from system stylesheets - if (aSheet.systemSheet || aSheet.disabled || !aSheet.mediaMatches) { - return; - } - - aSheet.forEachRule(function (aRule) { - aRule.selectors.forEach(function (aSelector) { - if (aSelector._matchId !== this._matchId) { - this._unmatchedSelectors.push(aSelector); - if (aCallback) { - aCallback.call(aScope, aSelector); - } - } - }, this); - }, this); - }, this); - }, - /** * Check if the highlighted element or it's parents have matched selectors. * @@ -686,95 +631,6 @@ CssLogic.prototype = { element.nodeType === Ci.nsIDOMNode.ELEMENT_NODE); }, - /** - * Check if the highlighted element or it's parents have unmatched selectors. - * - * Please note that this method is far slower than hasMatchedSelectors() - * because it needs to do a lot more checks in the DOM. - * - * @param {array} aProperties The list of properties you want to check if they - * have unmatched selectors or not. - * @return {object} An object that tells for each property if it has unmatched - * selectors or not. Object keys are property names and values are booleans. - */ - hasUnmatchedSelectors: function CL_hasUnmatchedSelectors(aProperties) - { - if (!this._matchedRules) { - this._buildMatchedRules(); - } - - let result = {}; - - this.forSomeSheets(function (aSheet) { - if (aSheet.systemSheet || aSheet.disabled || !aSheet.mediaMatches) { - return false; - } - - return aSheet.forSomeRules(function (aRule) { - let unmatched = aRule._matchId !== this._matchId || - this._ruleHasUnmatchedSelector(aRule); - if (!unmatched) { - return false; - } - - aProperties = aProperties.filter(function(aProperty) { - if (!aRule.getPropertyValue(aProperty)) { - // Keep this property for the next rule. We need to find a rule - // which has the property. - return true; - } - - result[aProperty] = true; - - // We found a rule that has the current property while it does not - // match the current element. We can remove this property from the - // array. - return false; - }); - - return aProperties.length == 0; - }, this); - }, this); - - aProperties.forEach(function(aProperty) { result[aProperty] = false; }); - - return result; - }, - - /** - * Check if a CssRule has an unmatched selector for the highlighted element or - * its parents. - * - * @private - * @param {CssRule} aRule The rule you want to check if it has an unmatched - * selector. - * @return {boolean} True if the rule has an unmatched selector, false - * otherwise. - */ - _ruleHasUnmatchedSelector: function CL__ruleHasUnmatchedSelector(aRule) - { - if (!aRule._cssSheet && aRule.sourceElement) { - // CssRule wraps element.style, which never has unmatched selectors. - return false; - } - - let element = this.viewedElement; - let selectors = aRule.selectors; - - do { - selectors = selectors.filter(function(aSelector) { - return !element.mozMatchesSelector(aSelector); - }); - - if (selectors.length == 0) { - break; - } - } while ((element = element.parentNode) && - element.nodeType === Ci.nsIDOMNode.ELEMENT_NODE); - - return selectors.length > 0; - }, - /** * Tells if the given DOM CSS object matches the current view media. * @@ -1494,10 +1350,9 @@ CssSelector.prototype = { * A cache of information about the matched rules, selectors and values attached * to a CSS property, for the highlighted element. * - * The heart of the CssPropertyInfo object is the _findMatchedSelectors() and - * _findUnmatchedSelectors() methods. These are invoked when the PropertyView - * tries to access the .matchedSelectors and .unmatchedSelectors arrays. - * Results are cached, for later reuse. + * The heart of the CssPropertyInfo object is the _findMatchedSelectors() + * method. This is invoked when the PropertyView tries to access the + * .matchedSelectors array. Results are cached, for later reuse. * * @param {CssLogic} aCssLogic Reference to the parent CssLogic instance * @param {string} aProperty The CSS property we are gathering information for @@ -1518,7 +1373,6 @@ function CssPropertyInfo(aCssLogic, aProperty) // counted. This includes rules that come from filtered stylesheets (those // that have sheetAllowed = false). this._matchedSelectors = null; - this._unmatchedSelectors = null; } CssPropertyInfo.prototype = { @@ -1561,23 +1415,6 @@ CssPropertyInfo.prototype = { return this._matchedRuleCount; }, - /** - * Retrieve the number of unmatched rules. - * - * @return {number} the number of rules that do not match the highlighted - * element or its parents. - */ - get unmatchedRuleCount() - { - if (!this._unmatchedSelectors) { - this._findUnmatchedSelectors(); - } else if (this.needRefilter) { - this._refilterSelectors(); - } - - return this._unmatchedRuleCount; - }, - /** * Retrieve the array holding CssSelectorInfo objects for each of the matched * selectors, from each of the matched rules. Only selectors coming from @@ -1597,25 +1434,6 @@ CssPropertyInfo.prototype = { return this._matchedSelectors; }, - /** - * Retrieve the array holding CssSelectorInfo objects for each of the - * unmatched selectors, from each of the unmatched rules. Only selectors - * coming from allowed stylesheets are included in the array. - * - * @return {array} the list of CssSelectorInfo objects of selectors that do - * not match the highlighted element or its parents. - */ - get unmatchedSelectors() - { - if (!this._unmatchedSelectors) { - this._findUnmatchedSelectors(); - } else if (this.needRefilter) { - this._refilterSelectors(); - } - - return this._unmatchedSelectors; - }, - /** * Find the selectors that match the highlighted element and its parents. * Uses CssLogic.processMatchedSelectors() to find the matched selectors, @@ -1644,7 +1462,7 @@ CssPropertyInfo.prototype = { // Now we know which of the matches is best, we can mark it BEST_MATCH. if (this._matchedSelectors.length > 0 && - this._matchedSelectors[0].status > CssLogic.STATUS.UNMATCHED) { + this._matchedSelectors[0].status > CssLogic.STATUS.UNKNOWN) { this._matchedSelectors[0].status = CssLogic.STATUS.BEST; } }, @@ -1671,53 +1489,8 @@ CssPropertyInfo.prototype = { }, /** - * Find the selectors that do not match the highlighted element and its - * parents. - * @private - */ - _findUnmatchedSelectors: function CssPropertyInfo_findUnmatchedSelectors() - { - this._unmatchedSelectors = []; - this._unmatchedRuleCount = 0; - this.needRefilter = false; - this._cssLogic._passId++; - - this._cssLogic.processUnmatchedSelectors(this._processUnmatchedSelector, - this); - - // Sort the selectors by specificity. - this._unmatchedSelectors.sort(function(aSelectorInfo1, aSelectorInfo2) { - return aSelectorInfo1.compareTo(aSelectorInfo2); - }); - }, - - /** - * Process an unmatched CssSelector object. Note that in order to avoid - * information overload we DO NOT show unmatched system rules. - * - * @private - * @param {CssSelector} aSelector the unmatched CssSelector object. - */ - _processUnmatchedSelector: function CPI_processUnmatchedSelector(aSelector) - { - let cssRule = aSelector._cssRule; - let value = cssRule.getPropertyValue(this.property); - if (value) { - let selectorInfo = new CssSelectorInfo(aSelector, this.property, value, - CssLogic.STATUS.UNMATCHED); - this._unmatchedSelectors.push(selectorInfo); - if (this._cssLogic._passId != cssRule._passId) { - if (cssRule.sheetAllowed) { - this._unmatchedRuleCount++; - } - cssRule._passId = this._cssLogic._passId; - } - } - }, - - /** - * Refilter the matched and unmatched selectors arrays when the - * CssLogic.sourceFilter changes. This allows for quick filter changes. + * Refilter the matched selectors array when the CssLogic.sourceFilter + * changes. This allows for quick filter changes. * @private */ _refilterSelectors: function CssPropertyInfo_refilterSelectors() @@ -1740,12 +1513,6 @@ CssPropertyInfo.prototype = { this._matchedRuleCount = ruleCount; } - if (this._unmatchedSelectors) { - ruleCount = 0; - this._unmatchedSelectors.forEach(iterator); - this._unmatchedRuleCount = ruleCount; - } - this.needRefilter = false; }, @@ -1758,10 +1525,10 @@ CssPropertyInfo.prototype = { /** * A class that holds information about a given CssSelector object. * - * Instances of this class are given to CssHtmlTree in the arrays of matched and - * unmatched selectors. Each such object represents a displayable row in the - * PropertyView objects. The information given by this object blends data coming - * from the CssSheet, CssRule and from the CssSelector that own this object. + * Instances of this class are given to CssHtmlTree in the array of matched + * selectors. Each such object represents a displayable row in the PropertyView + * objects. The information given by this object blends data coming from the + * CssSheet, CssRule and from the CssSelector that own this object. * * @param {CssSelector} aSelector The CssSelector object for which to present information. * @param {string} aProperty The property for which information should be retrieved. diff --git a/browser/devtools/styleinspector/csshtmltree.xhtml b/browser/devtools/styleinspector/csshtmltree.xhtml index f00e2cc7049..0cf16775971 100644 --- a/browser/devtools/styleinspector/csshtmltree.xhtml +++ b/browser/devtools/styleinspector/csshtmltree.xhtml @@ -82,7 +82,6 @@ &bestMatch; &matched; &parentMatch; - &unmatched; @@ -147,15 +146,6 @@ To visually debug the templates without running firefox, alter the display:none - @@ -183,32 +173,6 @@ To visually debug the templates without running firefox, alter the display:none - - -
- - - - - - - -
- ${selector.humanReadableText(__element)} -
-
- diff --git a/browser/devtools/styleinspector/test/browser/browser_bug683672.html b/browser/devtools/styleinspector/test/browser/browser_bug683672.html index 78f96355018..020602467ac 100644 --- a/browser/devtools/styleinspector/test/browser/browser_bug683672.html +++ b/browser/devtools/styleinspector/test/browser/browser_bug683672.html @@ -7,10 +7,6 @@ color: #000; } - .unmatched1, .unmatched2, .unmatched3, .unmatched4, .unmatched5, .unmatched6, .unmatched7 { - color: #f00; - } - div { position: absolute; top: 40px; diff --git a/browser/devtools/styleinspector/test/browser/browser_bug683672.js b/browser/devtools/styleinspector/test/browser/browser_bug683672.js index 01c11c243a0..4d16b5feedb 100644 --- a/browser/devtools/styleinspector/test/browser/browser_bug683672.js +++ b/browser/devtools/styleinspector/test/browser/browser_bug683672.js @@ -38,7 +38,6 @@ function runTests() ok(stylePanel.isOpen(), "style inspector is open"); testMatchedSelectors(); - testUnmatchedSelectors(); info("finishing up"); Services.obs.addObserver(finishUp, "StyleInspector-closed", false); @@ -69,30 +68,6 @@ function testMatchedSelectors() "hasMatchedSelectors returns true"); } -function testUnmatchedSelectors() -{ - info("checking selector counts, unmatched rules and titles"); - let body = content.document.body; - ok(body, "captain, we have a body"); - - info("selecting content.document.body"); - stylePanel.selectNode(body); - - let htmlTree = stylePanel.cssHtmlTree; - - is(body, htmlTree.viewedElement, - "style inspector node matches the selected node"); - - let propertyView = new PropertyView(htmlTree, "color"); - let numUnmatchedSelectors = propertyView.propertyInfo.unmatchedSelectors.length; - - is(numUnmatchedSelectors, 13, - "CssLogic returns the correct number of unmatched selectors for body"); - - is(propertyView.hasUnmatchedSelectors, true, - "hasUnmatchedSelectors returns true"); -} - function finishUp() { Services.obs.removeObserver(finishUp, "StyleInspector-closed", false); diff --git a/browser/devtools/styleinspector/test/browser/browser_styleinspector.js b/browser/devtools/styleinspector/test/browser/browser_styleinspector.js index 0f53bf23568..e293312fad6 100644 --- a/browser/devtools/styleinspector/test/browser/browser_styleinspector.js +++ b/browser/devtools/styleinspector/test/browser/browser_styleinspector.js @@ -64,7 +64,6 @@ function SI_CheckProperty() let cssLogic = stylePanel.cssLogic; let propertyInfo = cssLogic.getPropertyInfo("color"); ok(propertyInfo.matchedRuleCount > 0, "color property has matching rules"); - ok(propertyInfo.unmatchedRuleCount > 0, "color property has unmatched rules"); } function finishUp() diff --git a/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm b/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm index d02b4a257c8..c9db689c20d 100644 --- a/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm +++ b/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm @@ -179,7 +179,6 @@ Use inspectstyle($('text')) to inspect me
Use inspectstyle($('text2'))
Some Link -

font-family has a single unmatched rule

diff --git a/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd b/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd index 9cdd650ac6e..9ffd6000e09 100644 --- a/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd +++ b/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd @@ -18,11 +18,6 @@ - This is the link title shown in the hover tooltip. --> - - - @@ -36,4 +31,3 @@ - diff --git a/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties b/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties index 13ec8c81fa0..60fdc746851 100644 --- a/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties +++ b/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties @@ -10,7 +10,6 @@ panelTitle=Style Inspector rule.status.BEST=Best Match rule.status.MATCHED=Matched rule.status.PARENT_MATCH=Parent Match -rule.status.UNMATCHED=Unmatched # LOCALIZATION NOTE (rule.sourceElement, rule.sourceInline): For each # style property the panel shows the rules which hold that specific property. diff --git a/browser/themes/gnomestripe/browser/devtools/csshtmltree.css b/browser/themes/gnomestripe/browser/devtools/csshtmltree.css index fa05256a642..3f7bfc5ee31 100644 --- a/browser/themes/gnomestripe/browser/devtools/csshtmltree.css +++ b/browser/themes/gnomestripe/browser/devtools/csshtmltree.css @@ -92,14 +92,6 @@ body { -moz-padding-end: 5px; } - .rule-unmatched { - cursor: pointer; - padding: 2px; - -moz-padding-start: 4px; - -moz-padding-end: 0; - white-space: nowrap; - } - /* Take away these two :visited rules to get a core dumper */ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=575675#c30 */ .link, @@ -133,10 +125,6 @@ body { visibility: visible; } -.unmatchedSelectorTable { - -moz-margin-start: 15px; -} - .rulelink { color: -moz-dialogtext; -moz-margin-start: 12px; @@ -174,10 +162,6 @@ body { visibility: visible; } -.only-unmatched { - -moz-margin-start: 0; -} - .property-name { display: inline-block; font-size: 12px; @@ -214,9 +198,6 @@ body { .parentmatch { color: #666; } -.unmatched { - color: brown; -} #propertyContainer { display: -moz-box; diff --git a/browser/themes/pinstripe/browser/devtools/csshtmltree.css b/browser/themes/pinstripe/browser/devtools/csshtmltree.css index 76f9385127c..3f7bfc5ee31 100644 --- a/browser/themes/pinstripe/browser/devtools/csshtmltree.css +++ b/browser/themes/pinstripe/browser/devtools/csshtmltree.css @@ -92,14 +92,6 @@ body { -moz-padding-end: 5px; } - .rule-unmatched { - cursor: pointer; - padding: 2px; - -moz-padding-start: 4px; - -moz-padding-end: 0; - white-space: nowrap; - } - /* Take away these two :visited rules to get a core dumper */ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=575675#c30 */ .link, @@ -133,30 +125,28 @@ body { visibility: visible; } -.unmatchedSelectorTable { - -moz-margin-start: 15px; -} - .rulelink { color: -moz-dialogtext; -moz-margin-start: 12px; } .expander { - -moz-appearance: treetwisty; - width: 12px; - height: 12px; + width: 8px; + height: 8px; float: left; - -moz-margin-start: 5px; + -moz-margin-start: 15px; -moz-margin-end: 5px; + margin-top: 3px; + background: url("chrome://browser/skin/devtools/arrows.png") 48px 0; } .expander[dir="rtl"] { float: right; + background-position: 40px 0; } .expander[open] { - -moz-appearance: treetwistyopen; + background-position: 32px 0; } .expandable { @@ -172,10 +162,6 @@ body { visibility: visible; } -.only-unmatched { - -moz-margin-start: 0; -} - .property-name { display: inline-block; font-size: 12px; @@ -212,9 +198,6 @@ body { .parentmatch { color: #666; } -.unmatched { - color: brown; -} #propertyContainer { display: -moz-box; diff --git a/browser/themes/winstripe/browser/devtools/csshtmltree.css b/browser/themes/winstripe/browser/devtools/csshtmltree.css index 778ccda6aa2..17b0d3d0fd7 100644 --- a/browser/themes/winstripe/browser/devtools/csshtmltree.css +++ b/browser/themes/winstripe/browser/devtools/csshtmltree.css @@ -92,14 +92,6 @@ body { -moz-padding-end: 5px; } - .rule-unmatched { - cursor: pointer; - padding: 2px; - -moz-padding-start: 4px; - -moz-padding-end: 0; - white-space: nowrap; - } - /* Take away these two :visited rules to get a core dumper */ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=575675#c30 */ .link, @@ -133,10 +125,6 @@ body { visibility: visible; } -.unmatchedSelectorTable { - -moz-margin-start: 15px; -} - .rulelink { color: -moz-dialogtext; -moz-margin-start: 12px; @@ -173,10 +161,6 @@ body { visibility: visible; } -.only-unmatched { - -moz-margin-start: 0; -} - .property-name { display: inline-block; font-size: 12px; @@ -213,9 +197,6 @@ body { .parentmatch { color: #666; } -.unmatched { - color: brown; -} #propertyContainer { display: -moz-box; From 8237b3ae56e87837f27d6ef5fee2a9de1dfaa73c Mon Sep 17 00:00:00 2001 From: Rob Campbell Date: Sat, 5 Nov 2011 19:19:02 -0300 Subject: [PATCH 097/127] Backout part 2 - Bug 689759 rev b73aa0bd2b4e, Bug 698762 rev 2967e93cdb44, a=bustage --- .../devtools/styleinspector/CssHtmlTree.jsm | 178 ++++++++++-- browser/devtools/styleinspector/CssLogic.jsm | 265 ++++++++++++++++-- .../devtools/styleinspector/csshtmltree.xhtml | 41 ++- .../styleinspector/test/browser/Makefile.in | 1 - .../test/browser/browser_bug683672.html | 4 + .../test/browser/browser_bug683672.js | 25 ++ .../test/browser/browser_styleinspector.js | 1 + ...ector_bug_689759_no_results_placeholder.js | 118 -------- .../browser_styleinspector_webconsole.htm | 1 + .../browser/devtools/styleinspector.dtd | 15 +- .../devtools/styleinspector.properties | 1 + .../browser/devtools/csshtmltree.css | 25 +- .../browser/devtools/csshtmltree.css | 37 ++- .../browser/devtools/csshtmltree.css | 25 +- 14 files changed, 540 insertions(+), 197 deletions(-) delete mode 100644 browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_689759_no_results_placeholder.js diff --git a/browser/devtools/styleinspector/CssHtmlTree.jsm b/browser/devtools/styleinspector/CssHtmlTree.jsm index 3c4429cc1da..a8a67c49afc 100644 --- a/browser/devtools/styleinspector/CssHtmlTree.jsm +++ b/browser/devtools/styleinspector/CssHtmlTree.jsm @@ -81,9 +81,6 @@ function CssHtmlTree(aStyleInspector) this.templateProperty = this.styleDocument.getElementById("templateProperty"); this.panel = aStyleInspector.panel; - // No results text. - this.noResults = this.styleDocument.getElementById("noResults"); - // The element that we're inspecting, and the document that it comes from. this.viewedElement = null; this.createStyleViews(); @@ -136,8 +133,9 @@ XPCOMUtils.defineLazyGetter(CssHtmlTree, "_strings", function() Services.strings .createBundle("chrome://browser/locale/devtools/styleinspector.properties")); CssHtmlTree.prototype = { - // Cache the list of properties that have matched properties. + // Cache the list of properties that have matched and unmatched properties. _matchedProperties: null, + _unmatchedProperties: null, htmlComplete: false, @@ -156,9 +154,6 @@ CssHtmlTree.prototype = { // Toggle for zebra striping _darkStripe: true, - // Number of visible properties - numVisibleProperties: 0, - get showOnlyUserStyles() { return this.onlyUserStylesCheckbox.checked; @@ -176,6 +171,7 @@ CssHtmlTree.prototype = { } this.viewedElement = aElement; + this._unmatchedProperties = null; this._matchedProperties = null; CssHtmlTree.processTemplate(this.templatePath, this.path, this); @@ -202,10 +198,7 @@ CssHtmlTree.prototype = { let propView = new PropertyView(this, name); CssHtmlTree.processTemplate(this.templateProperty, this.propertyContainer, propView, true); - if (propView.visible) { - this.numVisibleProperties++; - } - propView.refreshMatchedSelectors(); + propView.refreshAllSelectors(); this.propertyViews.push(propView); } if (i < max) { @@ -216,7 +209,6 @@ CssHtmlTree.prototype = { } else { this.htmlComplete = true; this._panelRefreshTimeout = null; - this.noResults.hidden = this.numVisibleProperties ? true : false; Services.obs.notifyObservers(null, "StyleInspector-populated", null); } } @@ -235,11 +227,6 @@ CssHtmlTree.prototype = { this.win.clearTimeout(this._panelRefreshTimeout); } - this.noResults.hidden = true; - - // Reset visible property count - this.numVisibleProperties = 0; - // Reset zebra striping. this._darkStripe = true; @@ -259,7 +246,6 @@ CssHtmlTree.prototype = { this._panelRefreshTimeout = this.win.setTimeout(refreshView.bind(this), 15); } else { this._panelRefreshTimeout = null; - this.noResults.hidden = this.numVisibleProperties ? true : false; Services.obs.notifyObservers(null, "StyleInspector-populated", null); } } @@ -373,6 +359,41 @@ CssHtmlTree.prototype = { return this._matchedProperties; }, + /** + * Check if a property has unmatched selectors. Result is cached. + * + * @param {string} aProperty the name of the property you want to check. + * @return {boolean} true if the property has unmatched selectors, false + * otherwise. + */ + hasUnmatchedSelectors: function CssHtmlTree_hasUnmatchedSelectors(aProperty) + { + // Initially check all of the properties that return false for + // hasMatchedSelectors(). This speeds-up the UI. + if (!this._unmatchedProperties) { + let properties = []; + CssHtmlTree.propertyNames.forEach(function(aName) { + if (!this.matchedProperties[aName]) { + properties.push(aName); + } + }, this); + + if (properties.indexOf(aProperty) == -1) { + properties.push(aProperty); + } + + this._unmatchedProperties = this.cssLogic.hasUnmatchedSelectors(properties); + } + + // Lazy-get the result for properties we do not have cached. + if (!(aProperty in this._unmatchedProperties)) { + let result = this.cssLogic.hasUnmatchedSelectors([aProperty]); + this._unmatchedProperties[aProperty] = result[aProperty]; + } + + return this._unmatchedProperties[aProperty]; + }, + /** * Destructor for CssHtmlTree. */ @@ -423,6 +444,7 @@ function PropertyView(aTree, aName) this.link = "https://developer.mozilla.org/en/CSS/" + aName; this.templateMatchedSelectors = aTree.styleDocument.getElementById("templateMatchedSelectors"); + this.templateUnmatchedSelectors = aTree.styleDocument.getElementById("templateUnmatchedSelectors"); } PropertyView.prototype = { @@ -438,15 +460,33 @@ PropertyView.prototype = { // Are matched rules expanded? matchedExpanded: false, + // Are unmatched rules expanded? + unmatchedExpanded: false, + + // Unmatched selector table + unmatchedSelectorTable: null, + // Matched selector container matchedSelectorsContainer: null, // Matched selector expando matchedExpander: null, + // Unmatched selector expando + unmatchedExpander: null, + + // Unmatched selector container + unmatchedSelectorsContainer: null, + + // Unmatched title block + unmatchedTitleBlock: null, + // Cache for matched selector views _matchedSelectorViews: null, + // Cache for unmatched selector views + _unmatchedSelectorViews: null, + // The previously selected element used for the selector view caches prevViewedElement: null, @@ -477,6 +517,14 @@ PropertyView.prototype = { return this.tree.matchedProperties[this.name]; }, + /** + * Does the property have any unmatched selectors? + */ + get hasUnmatchedSelectors() + { + return this.tree.hasUnmatchedSelectors(this.name); + }, + /** * Should this property be visible? */ @@ -520,20 +568,23 @@ PropertyView.prototype = { if (this.prevViewedElement != this.tree.viewedElement) { this._matchedSelectorViews = null; + this._unmatchedSelectorViews = null; this.prevViewedElement = this.tree.viewedElement; } if (!this.tree.viewedElement || !this.visible) { this.valueNode.innerHTML = ""; this.matchedSelectorsContainer.hidden = true; + this.unmatchedSelectorsContainer.hidden = true; + this.unmatchedSelectorTable.innerHTML = ""; this.matchedSelectorsContainer.innerHTML = ""; this.matchedExpander.removeAttribute("open"); + this.unmatchedExpander.removeAttribute("open"); return; } - this.tree.numVisibleProperties++; this.valueNode.innerHTML = this.propertyInfo.value; - this.refreshMatchedSelectors(); + this.refreshAllSelectors(); }, /** @@ -544,7 +595,7 @@ PropertyView.prototype = { let hasMatchedSelectors = this.hasMatchedSelectors; this.matchedSelectorsContainer.hidden = !hasMatchedSelectors; - if (hasMatchedSelectors) { + if (hasMatchedSelectors || this.hasUnmatchedSelectors) { this.propertyHeader.classList.add("expandable"); } else { this.propertyHeader.classList.remove("expandable"); @@ -560,6 +611,52 @@ PropertyView.prototype = { } }, + /** + * Refresh the panel unmatched rules. + */ + refreshUnmatchedSelectors: function PropertyView_refreshUnmatchedSelectors() + { + let hasMatchedSelectors = this.hasMatchedSelectors; + + this.unmatchedSelectorTable.hidden = !this.unmatchedExpanded; + + if (hasMatchedSelectors) { + this.unmatchedSelectorsContainer.hidden = !this.matchedExpanded || + !this.hasUnmatchedSelectors; + this.unmatchedTitleBlock.hidden = false; + } else { + this.unmatchedSelectorsContainer.hidden = !this.unmatchedExpanded; + this.unmatchedTitleBlock.hidden = true; + } + + if (this.unmatchedExpanded && this.hasUnmatchedSelectors) { + CssHtmlTree.processTemplate(this.templateUnmatchedSelectors, + this.unmatchedSelectorTable, this); + if (!hasMatchedSelectors) { + this.matchedExpander.setAttribute("open", ""); + this.unmatchedSelectorTable.classList.add("only-unmatched"); + } else { + this.unmatchedExpander.setAttribute("open", ""); + this.unmatchedSelectorTable.classList.remove("only-unmatched"); + } + } else { + if (!hasMatchedSelectors) { + this.matchedExpander.removeAttribute("open"); + } + this.unmatchedExpander.removeAttribute("open"); + this.unmatchedSelectorTable.innerHTML = ""; + } + }, + + /** + * Refresh the panel matched and unmatched rules + */ + refreshAllSelectors: function PropertyView_refreshAllSelectors() + { + this.refreshMatchedSelectors(); + this.refreshUnmatchedSelectors(); + }, + /** * Provide access to the matched SelectorViews that we are currently * displaying. @@ -573,9 +670,27 @@ PropertyView.prototype = { this._matchedSelectorViews.push(new SelectorView(this.tree, aSelectorInfo)); }, this); } + return this._matchedSelectorViews; }, + /** + * Provide access to the unmatched SelectorViews that we are currently + * displaying. + */ + get unmatchedSelectorViews() + { + if (!this._unmatchedSelectorViews) { + this._unmatchedSelectorViews = []; + this.propertyInfo.unmatchedSelectors.forEach( + function unmatchedSelectorViews_convert(aSelectorInfo) { + this._unmatchedSelectorViews.push(new SelectorView(this.tree, aSelectorInfo)); + }, this); + } + + return this._unmatchedSelectorViews; + }, + /** * The action when a user expands matched selectors. * @@ -587,11 +702,24 @@ PropertyView.prototype = { { if (aEvent.target.className != "helplink") { this.matchedExpanded = !this.matchedExpanded; - this.refreshMatchedSelectors(); + if (!this.hasMatchedSelectors && this.hasUnmatchedSelectors) { + this.unmatchedExpanded = !this.unmatchedExpanded; + } + this.refreshAllSelectors(); aEvent.preventDefault(); } }, + /** + * The action when a user expands unmatched selectors. + */ + unmatchedSelectorsClick: function PropertyView_unmatchedSelectorsClick(aEvent) + { + this.unmatchedExpanded = !this.unmatchedExpanded; + this.refreshUnmatchedSelectors(); + aEvent.preventDefault(); + }, + /** * The action when a user clicks on the MDN help link for a property. */ @@ -620,11 +748,11 @@ function SelectorView(aTree, aSelectorInfo) * @see CssLogic.STATUS */ SelectorView.STATUS_NAMES = [ - // "Parent Match", "Matched", "Best Match" + // "Unmatched", "Parent Match", "Matched", "Best Match" ]; SelectorView.CLASS_NAMES = [ - "parentmatch", "matched", "bestmatch" + "unmatched", "parentmatch", "matched", "bestmatch" ]; SelectorView.prototype = { @@ -645,7 +773,7 @@ SelectorView.prototype = { for (let status in CssLogic.STATUS) { let i = CssLogic.STATUS[status]; - if (i > CssLogic.STATUS.UNKNOWN) { + if (i > -1) { let value = CssHtmlTree.l10n("rule.status." + status); // Replace normal spaces with non-breaking spaces SelectorView.STATUS_NAMES[i] = value.replace(/ /g, '\u00A0'); diff --git a/browser/devtools/styleinspector/CssLogic.jsm b/browser/devtools/styleinspector/CssLogic.jsm index 9d33fd7c6ae..278b915b5f5 100644 --- a/browser/devtools/styleinspector/CssLogic.jsm +++ b/browser/devtools/styleinspector/CssLogic.jsm @@ -58,7 +58,8 @@ * standard DOM API, but more inline with the definition in the spec. * * - CssPropertyInfo contains style information for a single property for the - * highlighted element. It contains the matched CSS rules on the page. + * highlighted element. It divides the CSS rules on the page into matched and + * unmatched rules. * - CssSelectorInfo is a wrapper around CssSelector, which adds sorting with * reference to the selected element. */ @@ -115,9 +116,10 @@ CssLogic.MEDIA = { * @see csshtmltree.js RuleView._cacheStatusNames() */ CssLogic.STATUS = { - BEST: 2, - MATCHED: 1, - PARENT_MATCH: 0, + BEST: 3, + MATCHED: 2, + PARENT_MATCH: 1, + UNMATCHED: 0, UNKNOWN: -1, }; @@ -145,11 +147,13 @@ CssLogic.prototype = { // processMatchedSelectors(). _passId: 0, - // Used for tracking matched CssSelector objects. + // Used for tracking matched CssSelector objects, such that we can skip them + // in processUnmatchedSelectors(). _matchId: 0, _matchedRules: null, _matchedSelectors: null, + _unmatchedSelectors: null, domUtils: Cc["@mozilla.org/inspector/dom-utils;1"].getService(Ci.inIDOMUtils), @@ -165,6 +169,7 @@ CssLogic.prototype = { this._sheetsCached = false; this._matchedRules = null; this._matchedSelectors = null; + this._unmatchedSelectors = null; }, /** @@ -199,6 +204,7 @@ CssLogic.prototype = { this._matchedRules = null; this._matchedSelectors = null; + this._unmatchedSelectors = null; let win = this.viewedDocument.defaultView; this._computedStyle = win.getComputedStyle(this.viewedElement, ""); }, @@ -213,7 +219,8 @@ CssLogic.prototype = { /** * Source filter. Only display properties coming from the given source (web - * address). + * address). Note that in order to avoid information overload we DO NOT show + * unmatched system rules. * @see CssLogic.FILTER.* */ set sourceFilter(aValue) { @@ -240,6 +247,7 @@ CssLogic.prototype = { if (needFullUpdate) { this._matchedRules = null; this._matchedSelectors = null; + this._unmatchedSelectors = null; this._propertyInfos = {}; } else { // Update the CssPropertyInfo objects. @@ -487,6 +495,7 @@ CssLogic.prototype = { } this._matchedSelectors = []; + this._unmatchedSelectors = null; this._passId++; for (let i = 0; i < this._matchedRules.length; i++) { @@ -531,6 +540,52 @@ CssLogic.prototype = { return false; }, + /** + * Process the CssSelector object that do not match the highlighted elements, + * nor its parents. Your callback function is invoked for every such + * CssSelector object. You receive one argument: the CssSelector object. + * + * The list of unmatched selectors is cached. + * + * @param {function} aCallback the function you want to execute for each of + * the unmatched selectors. + * @param {object} aScope the scope you want for the callback function. aScope + * will be the this object when aCallback executes. + */ + processUnmatchedSelectors: function CL_processUnmatchedSelectors(aCallback, aScope) + { + if (this._unmatchedSelectors) { + if (aCallback) { + this._unmatchedSelectors.forEach(aCallback, aScope); + } + return; + } + + if (!this._matchedSelectors) { + this.processMatchedSelectors(); + } + + this._unmatchedSelectors = []; + + this.forEachSheet(function (aSheet) { + // We do not show unmatched selectors from system stylesheets + if (aSheet.systemSheet || aSheet.disabled || !aSheet.mediaMatches) { + return; + } + + aSheet.forEachRule(function (aRule) { + aRule.selectors.forEach(function (aSelector) { + if (aSelector._matchId !== this._matchId) { + this._unmatchedSelectors.push(aSelector); + if (aCallback) { + aCallback.call(aScope, aSelector); + } + } + }, this); + }, this); + }, this); + }, + /** * Check if the highlighted element or it's parents have matched selectors. * @@ -631,6 +686,95 @@ CssLogic.prototype = { element.nodeType === Ci.nsIDOMNode.ELEMENT_NODE); }, + /** + * Check if the highlighted element or it's parents have unmatched selectors. + * + * Please note that this method is far slower than hasMatchedSelectors() + * because it needs to do a lot more checks in the DOM. + * + * @param {array} aProperties The list of properties you want to check if they + * have unmatched selectors or not. + * @return {object} An object that tells for each property if it has unmatched + * selectors or not. Object keys are property names and values are booleans. + */ + hasUnmatchedSelectors: function CL_hasUnmatchedSelectors(aProperties) + { + if (!this._matchedRules) { + this._buildMatchedRules(); + } + + let result = {}; + + this.forSomeSheets(function (aSheet) { + if (aSheet.systemSheet || aSheet.disabled || !aSheet.mediaMatches) { + return false; + } + + return aSheet.forSomeRules(function (aRule) { + let unmatched = aRule._matchId !== this._matchId || + this._ruleHasUnmatchedSelector(aRule); + if (!unmatched) { + return false; + } + + aProperties = aProperties.filter(function(aProperty) { + if (!aRule.getPropertyValue(aProperty)) { + // Keep this property for the next rule. We need to find a rule + // which has the property. + return true; + } + + result[aProperty] = true; + + // We found a rule that has the current property while it does not + // match the current element. We can remove this property from the + // array. + return false; + }); + + return aProperties.length == 0; + }, this); + }, this); + + aProperties.forEach(function(aProperty) { result[aProperty] = false; }); + + return result; + }, + + /** + * Check if a CssRule has an unmatched selector for the highlighted element or + * its parents. + * + * @private + * @param {CssRule} aRule The rule you want to check if it has an unmatched + * selector. + * @return {boolean} True if the rule has an unmatched selector, false + * otherwise. + */ + _ruleHasUnmatchedSelector: function CL__ruleHasUnmatchedSelector(aRule) + { + if (!aRule._cssSheet && aRule.sourceElement) { + // CssRule wraps element.style, which never has unmatched selectors. + return false; + } + + let element = this.viewedElement; + let selectors = aRule.selectors; + + do { + selectors = selectors.filter(function(aSelector) { + return !element.mozMatchesSelector(aSelector); + }); + + if (selectors.length == 0) { + break; + } + } while ((element = element.parentNode) && + element.nodeType === Ci.nsIDOMNode.ELEMENT_NODE); + + return selectors.length > 0; + }, + /** * Tells if the given DOM CSS object matches the current view media. * @@ -1350,9 +1494,10 @@ CssSelector.prototype = { * A cache of information about the matched rules, selectors and values attached * to a CSS property, for the highlighted element. * - * The heart of the CssPropertyInfo object is the _findMatchedSelectors() - * method. This is invoked when the PropertyView tries to access the - * .matchedSelectors array. Results are cached, for later reuse. + * The heart of the CssPropertyInfo object is the _findMatchedSelectors() and + * _findUnmatchedSelectors() methods. These are invoked when the PropertyView + * tries to access the .matchedSelectors and .unmatchedSelectors arrays. + * Results are cached, for later reuse. * * @param {CssLogic} aCssLogic Reference to the parent CssLogic instance * @param {string} aProperty The CSS property we are gathering information for @@ -1373,6 +1518,7 @@ function CssPropertyInfo(aCssLogic, aProperty) // counted. This includes rules that come from filtered stylesheets (those // that have sheetAllowed = false). this._matchedSelectors = null; + this._unmatchedSelectors = null; } CssPropertyInfo.prototype = { @@ -1415,6 +1561,23 @@ CssPropertyInfo.prototype = { return this._matchedRuleCount; }, + /** + * Retrieve the number of unmatched rules. + * + * @return {number} the number of rules that do not match the highlighted + * element or its parents. + */ + get unmatchedRuleCount() + { + if (!this._unmatchedSelectors) { + this._findUnmatchedSelectors(); + } else if (this.needRefilter) { + this._refilterSelectors(); + } + + return this._unmatchedRuleCount; + }, + /** * Retrieve the array holding CssSelectorInfo objects for each of the matched * selectors, from each of the matched rules. Only selectors coming from @@ -1434,6 +1597,25 @@ CssPropertyInfo.prototype = { return this._matchedSelectors; }, + /** + * Retrieve the array holding CssSelectorInfo objects for each of the + * unmatched selectors, from each of the unmatched rules. Only selectors + * coming from allowed stylesheets are included in the array. + * + * @return {array} the list of CssSelectorInfo objects of selectors that do + * not match the highlighted element or its parents. + */ + get unmatchedSelectors() + { + if (!this._unmatchedSelectors) { + this._findUnmatchedSelectors(); + } else if (this.needRefilter) { + this._refilterSelectors(); + } + + return this._unmatchedSelectors; + }, + /** * Find the selectors that match the highlighted element and its parents. * Uses CssLogic.processMatchedSelectors() to find the matched selectors, @@ -1462,7 +1644,7 @@ CssPropertyInfo.prototype = { // Now we know which of the matches is best, we can mark it BEST_MATCH. if (this._matchedSelectors.length > 0 && - this._matchedSelectors[0].status > CssLogic.STATUS.UNKNOWN) { + this._matchedSelectors[0].status > CssLogic.STATUS.UNMATCHED) { this._matchedSelectors[0].status = CssLogic.STATUS.BEST; } }, @@ -1489,8 +1671,53 @@ CssPropertyInfo.prototype = { }, /** - * Refilter the matched selectors array when the CssLogic.sourceFilter - * changes. This allows for quick filter changes. + * Find the selectors that do not match the highlighted element and its + * parents. + * @private + */ + _findUnmatchedSelectors: function CssPropertyInfo_findUnmatchedSelectors() + { + this._unmatchedSelectors = []; + this._unmatchedRuleCount = 0; + this.needRefilter = false; + this._cssLogic._passId++; + + this._cssLogic.processUnmatchedSelectors(this._processUnmatchedSelector, + this); + + // Sort the selectors by specificity. + this._unmatchedSelectors.sort(function(aSelectorInfo1, aSelectorInfo2) { + return aSelectorInfo1.compareTo(aSelectorInfo2); + }); + }, + + /** + * Process an unmatched CssSelector object. Note that in order to avoid + * information overload we DO NOT show unmatched system rules. + * + * @private + * @param {CssSelector} aSelector the unmatched CssSelector object. + */ + _processUnmatchedSelector: function CPI_processUnmatchedSelector(aSelector) + { + let cssRule = aSelector._cssRule; + let value = cssRule.getPropertyValue(this.property); + if (value) { + let selectorInfo = new CssSelectorInfo(aSelector, this.property, value, + CssLogic.STATUS.UNMATCHED); + this._unmatchedSelectors.push(selectorInfo); + if (this._cssLogic._passId != cssRule._passId) { + if (cssRule.sheetAllowed) { + this._unmatchedRuleCount++; + } + cssRule._passId = this._cssLogic._passId; + } + } + }, + + /** + * Refilter the matched and unmatched selectors arrays when the + * CssLogic.sourceFilter changes. This allows for quick filter changes. * @private */ _refilterSelectors: function CssPropertyInfo_refilterSelectors() @@ -1513,6 +1740,12 @@ CssPropertyInfo.prototype = { this._matchedRuleCount = ruleCount; } + if (this._unmatchedSelectors) { + ruleCount = 0; + this._unmatchedSelectors.forEach(iterator); + this._unmatchedRuleCount = ruleCount; + } + this.needRefilter = false; }, @@ -1525,10 +1758,10 @@ CssPropertyInfo.prototype = { /** * A class that holds information about a given CssSelector object. * - * Instances of this class are given to CssHtmlTree in the array of matched - * selectors. Each such object represents a displayable row in the PropertyView - * objects. The information given by this object blends data coming from the - * CssSheet, CssRule and from the CssSelector that own this object. + * Instances of this class are given to CssHtmlTree in the arrays of matched and + * unmatched selectors. Each such object represents a displayable row in the + * PropertyView objects. The information given by this object blends data coming + * from the CssSheet, CssRule and from the CssSelector that own this object. * * @param {CssSelector} aSelector The CssSelector object for which to present information. * @param {string} aProperty The property for which information should be retrieved. diff --git a/browser/devtools/styleinspector/csshtmltree.xhtml b/browser/devtools/styleinspector/csshtmltree.xhtml index 0cf16775971..50baa58e06c 100644 --- a/browser/devtools/styleinspector/csshtmltree.xhtml +++ b/browser/devtools/styleinspector/csshtmltree.xhtml @@ -69,11 +69,6 @@
- - -
@@ -82,6 +77,7 @@ &bestMatch; &matched; &parentMatch; + &unmatched; @@ -146,6 +142,15 @@ To visually debug the templates without running firefox, alter the display:none + @@ -173,6 +178,32 @@ To visually debug the templates without running firefox, alter the display:none + + +
+ + + + + + + +
+ ${selector.humanReadableText(__element)} +
+
+ diff --git a/browser/devtools/styleinspector/test/browser/Makefile.in b/browser/devtools/styleinspector/test/browser/Makefile.in index 26728730c0a..f6c48b59dae 100644 --- a/browser/devtools/styleinspector/test/browser/Makefile.in +++ b/browser/devtools/styleinspector/test/browser/Makefile.in @@ -51,7 +51,6 @@ _BROWSER_TEST_FILES = \ browser_bug683672.js \ browser_styleinspector_bug_672746_default_styles.js \ browser_styleinspector_bug_672744_search_filter.js \ - browser_styleinspector_bug_689759_no_results_placeholder.js \ browser_bug_692400_element_style.js \ browser_ruleview_editor.js \ browser_ruleview_inherit.js \ diff --git a/browser/devtools/styleinspector/test/browser/browser_bug683672.html b/browser/devtools/styleinspector/test/browser/browser_bug683672.html index 020602467ac..78f96355018 100644 --- a/browser/devtools/styleinspector/test/browser/browser_bug683672.html +++ b/browser/devtools/styleinspector/test/browser/browser_bug683672.html @@ -7,6 +7,10 @@ color: #000; } + .unmatched1, .unmatched2, .unmatched3, .unmatched4, .unmatched5, .unmatched6, .unmatched7 { + color: #f00; + } + div { position: absolute; top: 40px; diff --git a/browser/devtools/styleinspector/test/browser/browser_bug683672.js b/browser/devtools/styleinspector/test/browser/browser_bug683672.js index 4d16b5feedb..01c11c243a0 100644 --- a/browser/devtools/styleinspector/test/browser/browser_bug683672.js +++ b/browser/devtools/styleinspector/test/browser/browser_bug683672.js @@ -38,6 +38,7 @@ function runTests() ok(stylePanel.isOpen(), "style inspector is open"); testMatchedSelectors(); + testUnmatchedSelectors(); info("finishing up"); Services.obs.addObserver(finishUp, "StyleInspector-closed", false); @@ -68,6 +69,30 @@ function testMatchedSelectors() "hasMatchedSelectors returns true"); } +function testUnmatchedSelectors() +{ + info("checking selector counts, unmatched rules and titles"); + let body = content.document.body; + ok(body, "captain, we have a body"); + + info("selecting content.document.body"); + stylePanel.selectNode(body); + + let htmlTree = stylePanel.cssHtmlTree; + + is(body, htmlTree.viewedElement, + "style inspector node matches the selected node"); + + let propertyView = new PropertyView(htmlTree, "color"); + let numUnmatchedSelectors = propertyView.propertyInfo.unmatchedSelectors.length; + + is(numUnmatchedSelectors, 13, + "CssLogic returns the correct number of unmatched selectors for body"); + + is(propertyView.hasUnmatchedSelectors, true, + "hasUnmatchedSelectors returns true"); +} + function finishUp() { Services.obs.removeObserver(finishUp, "StyleInspector-closed", false); diff --git a/browser/devtools/styleinspector/test/browser/browser_styleinspector.js b/browser/devtools/styleinspector/test/browser/browser_styleinspector.js index e293312fad6..0f53bf23568 100644 --- a/browser/devtools/styleinspector/test/browser/browser_styleinspector.js +++ b/browser/devtools/styleinspector/test/browser/browser_styleinspector.js @@ -64,6 +64,7 @@ function SI_CheckProperty() let cssLogic = stylePanel.cssLogic; let propertyInfo = cssLogic.getPropertyInfo("color"); ok(propertyInfo.matchedRuleCount > 0, "color property has matching rules"); + ok(propertyInfo.unmatchedRuleCount > 0, "color property has unmatched rules"); } function finishUp() diff --git a/browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_689759_no_results_placeholder.js b/browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_689759_no_results_placeholder.js deleted file mode 100644 index 0a7ae442d51..00000000000 --- a/browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_689759_no_results_placeholder.js +++ /dev/null @@ -1,118 +0,0 @@ -/* vim: set ft=javascript ts=2 et sw=2 tw=80: */ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -// Tests that the no results placeholder works properly. - -let doc; -let stylePanel; - -function createDocument() -{ - doc.body.innerHTML = '' + - 'Some styled text'; - doc.title = "Tests that the no results placeholder works properly"; - ok(window.StyleInspector, "StyleInspector exists"); - stylePanel = new StyleInspector(window); - Services.obs.addObserver(runStyleInspectorTests, "StyleInspector-opened", false); - stylePanel.createPanel(false, function() { - stylePanel.open(doc.body); - }); -} - -function runStyleInspectorTests() -{ - Services.obs.removeObserver(runStyleInspectorTests, "StyleInspector-opened", false); - - ok(stylePanel.isOpen(), "style inspector is open"); - - Services.obs.addObserver(SI_AddFilterText, "StyleInspector-populated", false); - - let span = doc.querySelector("#matches"); - ok(span, "captain, we have the matches span"); - - let htmlTree = stylePanel.cssHtmlTree; - stylePanel.selectNode(span); - - is(span, htmlTree.viewedElement, - "style inspector node matches the selected node"); - is(htmlTree.viewedElement, stylePanel.cssLogic.viewedElement, - "cssLogic node matches the cssHtmlTree node"); -} - -function SI_AddFilterText() -{ - Services.obs.removeObserver(SI_AddFilterText, "StyleInspector-populated", false); - - let iframe = stylePanel.iframe; - let searchbar = stylePanel.cssHtmlTree.searchField; - let searchTerm = "xxxxx"; - - Services.obs.addObserver(SI_checkPlaceholderVisible, "StyleInspector-populated", false); - info("setting filter text to \"" + searchTerm + "\""); - searchbar.focus(); - for each (let c in searchTerm) { - EventUtils.synthesizeKey(c, {}, iframe.contentWindow); - } -} - -function SI_checkPlaceholderVisible() -{ - Services.obs.removeObserver(SI_checkPlaceholderVisible, "StyleInspector-populated", false); - info("SI_checkPlaceholderVisible called"); - let placeholder = stylePanel.cssHtmlTree.noResults; - let iframe = stylePanel.iframe; - let display = iframe.contentWindow.getComputedStyle(placeholder).display; - - is(display, "block", "placeholder is visible"); - - SI_ClearFilterText(); -} - -function SI_ClearFilterText() -{ - let iframe = stylePanel.iframe; - let searchbar = stylePanel.cssHtmlTree.searchField; - - Services.obs.addObserver(SI_checkPlaceholderHidden, "StyleInspector-populated", false); - info("clearing filter text"); - searchbar.focus(); - searchbar.value = ""; - EventUtils.synthesizeKey("c", {}, iframe.contentWindow); -} - -function SI_checkPlaceholderHidden() -{ - Services.obs.removeObserver(SI_checkPlaceholderHidden, "StyleInspector-populated", false); - let placeholder = stylePanel.cssHtmlTree.noResults; - let iframe = stylePanel.iframe; - let display = iframe.contentWindow.getComputedStyle(placeholder).display; - - is(display, "none", "placeholder is hidden"); - - Services.obs.addObserver(finishUp, "StyleInspector-closed", false); - stylePanel.close(); -} - -function finishUp() -{ - Services.obs.removeObserver(finishUp, "StyleInspector-closed", false); - ok(!stylePanel.isOpen(), "style inspector is closed"); - doc = stylePanel = null; - gBrowser.removeCurrentTab(); - finish(); -} - -function test() -{ - waitForExplicitFinish(); - gBrowser.selectedTab = gBrowser.addTab(); - gBrowser.selectedBrowser.addEventListener("load", function onLoad(evt) { - gBrowser.selectedBrowser.removeEventListener(evt.type, onLoad, true); - doc = content.document; - waitForFocus(createDocument, content); - }, true); - - content.location = "data:text/html,no results placeholder test"; -} diff --git a/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm b/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm index c9db689c20d..d02b4a257c8 100644 --- a/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm +++ b/browser/devtools/styleinspector/test/browser/browser_styleinspector_webconsole.htm @@ -179,6 +179,7 @@ Use inspectstyle($('text')) to inspect me
Use inspectstyle($('text2'))
Some Link +

font-family has a single unmatched rule

diff --git a/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd b/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd index 9ffd6000e09..07bc28aad96 100644 --- a/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd +++ b/browser/locales/en-US/chrome/browser/devtools/styleinspector.dtd @@ -18,16 +18,17 @@ - This is the link title shown in the hover tooltip. --> - - + + - + diff --git a/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties b/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties index 60fdc746851..13ec8c81fa0 100644 --- a/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties +++ b/browser/locales/en-US/chrome/browser/devtools/styleinspector.properties @@ -10,6 +10,7 @@ panelTitle=Style Inspector rule.status.BEST=Best Match rule.status.MATCHED=Matched rule.status.PARENT_MATCH=Parent Match +rule.status.UNMATCHED=Unmatched # LOCALIZATION NOTE (rule.sourceElement, rule.sourceInline): For each # style property the panel shows the rules which hold that specific property. diff --git a/browser/themes/gnomestripe/browser/devtools/csshtmltree.css b/browser/themes/gnomestripe/browser/devtools/csshtmltree.css index 3f7bfc5ee31..6c2378f0ded 100644 --- a/browser/themes/gnomestripe/browser/devtools/csshtmltree.css +++ b/browser/themes/gnomestripe/browser/devtools/csshtmltree.css @@ -92,6 +92,14 @@ body { -moz-padding-end: 5px; } + .rule-unmatched { + cursor: pointer; + padding: 2px; + -moz-padding-start: 4px; + -moz-padding-end: 0; + white-space: nowrap; + } + /* Take away these two :visited rules to get a core dumper */ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=575675#c30 */ .link, @@ -125,6 +133,10 @@ body { visibility: visible; } +.unmatchedSelectorTable { + -moz-margin-start: 15px; +} + .rulelink { color: -moz-dialogtext; -moz-margin-start: 12px; @@ -162,6 +174,10 @@ body { visibility: visible; } +.only-unmatched { + -moz-margin-start: 0; +} + .property-name { display: inline-block; font-size: 12px; @@ -198,6 +214,9 @@ body { .parentmatch { color: #666; } +.unmatched { + color: brown; +} #propertyContainer { display: -moz-box; @@ -214,12 +233,6 @@ body { background-color: rgba(0,0,0,.022); } -#noResults { - font-size: 18px; - margin-top: 5px; - text-align: center; -} - .header { color: -moz-dialogtext; background-color: -moz-dialog; diff --git a/browser/themes/pinstripe/browser/devtools/csshtmltree.css b/browser/themes/pinstripe/browser/devtools/csshtmltree.css index 3f7bfc5ee31..df346f2e659 100644 --- a/browser/themes/pinstripe/browser/devtools/csshtmltree.css +++ b/browser/themes/pinstripe/browser/devtools/csshtmltree.css @@ -92,6 +92,14 @@ body { -moz-padding-end: 5px; } + .rule-unmatched { + cursor: pointer; + padding: 2px; + -moz-padding-start: 4px; + -moz-padding-end: 0; + white-space: nowrap; + } + /* Take away these two :visited rules to get a core dumper */ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=575675#c30 */ .link, @@ -125,28 +133,30 @@ body { visibility: visible; } +.unmatchedSelectorTable { + -moz-margin-start: 15px; +} + .rulelink { color: -moz-dialogtext; -moz-margin-start: 12px; } .expander { - width: 8px; - height: 8px; + -moz-appearance: treetwisty; + width: 12px; + height: 12px; float: left; - -moz-margin-start: 15px; + -moz-margin-start: 5px; -moz-margin-end: 5px; - margin-top: 3px; - background: url("chrome://browser/skin/devtools/arrows.png") 48px 0; } .expander[dir="rtl"] { float: right; - background-position: 40px 0; } .expander[open] { - background-position: 32px 0; + -moz-appearance: treetwistyopen; } .expandable { @@ -162,6 +172,10 @@ body { visibility: visible; } +.only-unmatched { + -moz-margin-start: 0; +} + .property-name { display: inline-block; font-size: 12px; @@ -198,6 +212,9 @@ body { .parentmatch { color: #666; } +.unmatched { + color: brown; +} #propertyContainer { display: -moz-box; @@ -214,12 +231,6 @@ body { background-color: rgba(0,0,0,.022); } -#noResults { - font-size: 18px; - margin-top: 5px; - text-align: center; -} - .header { color: -moz-dialogtext; background-color: -moz-dialog; diff --git a/browser/themes/winstripe/browser/devtools/csshtmltree.css b/browser/themes/winstripe/browser/devtools/csshtmltree.css index 17b0d3d0fd7..aaad2af5c7e 100644 --- a/browser/themes/winstripe/browser/devtools/csshtmltree.css +++ b/browser/themes/winstripe/browser/devtools/csshtmltree.css @@ -92,6 +92,14 @@ body { -moz-padding-end: 5px; } + .rule-unmatched { + cursor: pointer; + padding: 2px; + -moz-padding-start: 4px; + -moz-padding-end: 0; + white-space: nowrap; + } + /* Take away these two :visited rules to get a core dumper */ /* See https://bugzilla.mozilla.org/show_bug.cgi?id=575675#c30 */ .link, @@ -125,6 +133,10 @@ body { visibility: visible; } +.unmatchedSelectorTable { + -moz-margin-start: 15px; +} + .rulelink { color: -moz-dialogtext; -moz-margin-start: 12px; @@ -161,6 +173,10 @@ body { visibility: visible; } +.only-unmatched { + -moz-margin-start: 0; +} + .property-name { display: inline-block; font-size: 12px; @@ -197,6 +213,9 @@ body { .parentmatch { color: #666; } +.unmatched { + color: brown; +} #propertyContainer { display: -moz-box; @@ -213,12 +232,6 @@ body { background-color: rgba(0,0,0,.022); } -#noResults { - font-size: 18px; - margin-top: 5px; - text-align: center; -} - .header { color: -moz-dialogtext; background-color: -moz-dialog; From 6e754d0cf0a09f0f05f3f27aa3b1a3d1e92c8426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Sat, 5 Nov 2011 12:31:00 -0700 Subject: [PATCH 098/127] Bug 700036 - Put the style inspector into a xul document. r=dcamp --HG-- rename : browser/devtools/styleinspector/csshtmltree.xhtml => browser/devtools/styleinspector/csshtmltree.xul rename : browser/devtools/styleinspector/cssruleview.xhtml => browser/devtools/styleinspector/cssruleview.xul --- browser/devtools/highlighter/inspector.jsm | 5 +- browser/devtools/jar.mn | 4 +- .../devtools/styleinspector/CssHtmlTree.jsm | 8 +-- .../styleinspector/StyleInspector.jsm | 6 +- .../{csshtmltree.xhtml => csshtmltree.xul} | 70 ++++++++----------- .../{cssruleview.xhtml => cssruleview.xul} | 27 +++---- .../test/browser/browser_ruleview_ui.js | 5 +- browser/devtools/webconsole/HUDService.jsm | 5 +- .../browser/devtools/csshtmltree.css | 19 ++--- .../browser/devtools/csshtmltree.css | 19 ++--- .../browser/devtools/csshtmltree.css | 19 ++--- 11 files changed, 70 insertions(+), 117 deletions(-) rename browser/devtools/styleinspector/{csshtmltree.xhtml => csshtmltree.xul} (86%) rename browser/devtools/styleinspector/{cssruleview.xhtml => cssruleview.xul} (75%) diff --git a/browser/devtools/highlighter/inspector.jsm b/browser/devtools/highlighter/inspector.jsm index 99bcf15f441..5a19a616faa 100644 --- a/browser/devtools/highlighter/inspector.jsm +++ b/browser/devtools/highlighter/inspector.jsm @@ -1340,8 +1340,7 @@ InspectorUI.prototype = { iframe.removeEventListener("load", boundLoadListener, true); let doc = iframe.contentDocument; this.ruleView = new CssRuleView(doc); - let body = doc.getElementById("ruleview-body"); - body.appendChild(this.ruleView.element); + doc.documentElement.appendChild(this.ruleView.element); this.ruleView.highlight(this.selection); Services.obs.notifyObservers(null, INSPECTOR_NOTIFICATIONS.RULEVIEWREADY, null); @@ -1349,7 +1348,7 @@ InspectorUI.prototype = { iframe.addEventListener("load", boundLoadListener, true); - iframe.setAttribute("src", "chrome://browser/content/devtools/cssruleview.xhtml"); + iframe.setAttribute("src", "chrome://browser/content/devtools/cssruleview.xul"); }, /** diff --git a/browser/devtools/jar.mn b/browser/devtools/jar.mn index 772bb510a53..7fca7adc924 100644 --- a/browser/devtools/jar.mn +++ b/browser/devtools/jar.mn @@ -3,8 +3,8 @@ browser.jar: content/browser/NetworkPanel.xhtml (webconsole/NetworkPanel.xhtml) * content/browser/scratchpad.xul (scratchpad/scratchpad.xul) * content/browser/scratchpad.js (scratchpad/scratchpad.js) - content/browser/csshtmltree.xhtml (styleinspector/csshtmltree.xhtml) - content/browser/devtools/cssruleview.xhtml (styleinspector/cssruleview.xhtml) + content/browser/devtools/csshtmltree.xul (styleinspector/csshtmltree.xul) + content/browser/devtools/cssruleview.xul (styleinspector/cssruleview.xul) content/browser/devtools/styleinspector.css (styleinspector/styleinspector.css) content/browser/orion.js (sourceeditor/orion/orion.js) content/browser/orion.css (sourceeditor/orion/orion.css) diff --git a/browser/devtools/styleinspector/CssHtmlTree.jsm b/browser/devtools/styleinspector/CssHtmlTree.jsm index a8a67c49afc..7f37d61ab3c 100644 --- a/browser/devtools/styleinspector/CssHtmlTree.jsm +++ b/browser/devtools/styleinspector/CssHtmlTree.jsm @@ -69,7 +69,7 @@ function CssHtmlTree(aStyleInspector) this.getRTLAttr = this.win.getComputedStyle(this.win.gBrowser).direction; this.propertyViews = []; - // The document in which we display the results (csshtmltree.xhtml). + // The document in which we display the results (csshtmltree.xul). this.styleDocument = this.styleWin.contentWindow.document; // Nodes used in templating @@ -327,8 +327,8 @@ CssHtmlTree.prototype = { CssHtmlTree.propertyNames = []; // Here we build and cache a list of css properties supported by the browser - // We could use any element but let's use the main document's body - let styles = this.styleWin.contentWindow.getComputedStyle(this.styleDocument.body); + // We could use any element but let's use the main document's root element + let styles = this.styleWin.contentWindow.getComputedStyle(this.styleDocument.documentElement); let mozProps = []; for (let i = 0, numStyles = styles.length; i < numStyles; i++) { let prop = styles.item(i); @@ -414,7 +414,7 @@ CssHtmlTree.prototype = { delete this.templateProperty; delete this.panel; - // The document in which we display the results (csshtmltree.xhtml). + // The document in which we display the results (csshtmltree.xul). delete this.styleDocument; // The element that we're inspecting, and the document that it comes from. diff --git a/browser/devtools/styleinspector/StyleInspector.jsm b/browser/devtools/styleinspector/StyleInspector.jsm index 782f7d7a5dd..c2bfe00ae1e 100644 --- a/browser/devtools/styleinspector/StyleInspector.jsm +++ b/browser/devtools/styleinspector/StyleInspector.jsm @@ -112,7 +112,7 @@ StyleInspector.prototype = { let boundIframeOnLoad = function loadedInitializeIframe() { if (this.iframe && this.iframe.getAttribute("src") == - "chrome://browser/content/csshtmltree.xhtml") { + "chrome://browser/content/devtools/csshtmltree.xul") { let selectedNode = this.selectedNode || null; this.cssHtmlTree = new CssHtmlTree(this); this.cssLogic.highlight(selectedNode); @@ -164,7 +164,7 @@ StyleInspector.prototype = { iframe.flex = 1; iframe.setAttribute("tooltip", "aHTMLTooltip"); iframe.addEventListener("load", boundIframeOnLoad, true); - iframe.setAttribute("src", "chrome://browser/content/csshtmltree.xhtml"); + iframe.setAttribute("src", "chrome://browser/content/devtools/csshtmltree.xul"); panel.appendChild(iframe); popupSet.appendChild(panel); @@ -266,7 +266,7 @@ StyleInspector.prototype = { this.selectNode(aSelection); if (this.openDocked) { if (!this.iframeReady) { - this.iframe.setAttribute("src", "chrome://browser/content/csshtmltree.xhtml"); + this.iframe.setAttribute("src", "chrome://browser/content/devtools/csshtmltree.xul"); } } else { this.panel.openPopup(this.window.gBrowser.selectedBrowser, "end_before", 0, 0, diff --git a/browser/devtools/styleinspector/csshtmltree.xhtml b/browser/devtools/styleinspector/csshtmltree.xul similarity index 86% rename from browser/devtools/styleinspector/csshtmltree.xhtml rename to browser/devtools/styleinspector/csshtmltree.xul index 50baa58e06c..ba54faaf107 100644 --- a/browser/devtools/styleinspector/csshtmltree.xhtml +++ b/browser/devtools/styleinspector/csshtmltree.xul @@ -1,20 +1,4 @@ - - %htmlDTD; - - %inspectorDTD; - - - - - - - - - - - -]> + - - - - - - + + + + %inspectorDTD; + + + + + + + + + + + +]> +
@@ -91,7 +85,7 @@ To visually debug the templates without running firefox, alter the display:none -->
-