diff --git a/accessible/base/Logging.cpp b/accessible/base/Logging.cpp
index f345cc3bcdc..ab1dc0f89da 100644
--- a/accessible/base/Logging.cpp
+++ b/accessible/base/Logging.cpp
@@ -45,14 +45,16 @@ static ModuleRep sModuleMap[] = {
{ "events", logging::eEvents },
{ "platforms", logging::ePlatforms },
- { "stack", logging::eStack },
{ "text", logging::eText },
{ "tree", logging::eTree },
{ "DOMEvents", logging::eDOMEvents },
{ "focus", logging::eFocus },
{ "selection", logging::eSelection },
- { "notifications", logging::eNotifications }
+ { "notifications", logging::eNotifications },
+
+ { "stack", logging::eStack },
+ { "verbose", logging::eVerbose }
};
static void
@@ -606,6 +608,61 @@ logging::SelChange(nsISelection* aSelection, DocAccessible* aDocument,
Stack();
}
+void
+logging::TreeInfo(const char* aMsg, uint32_t aExtraFlags, ...)
+{
+ if (IsEnabledAll(logging::eTree | aExtraFlags)) {
+ MsgBegin("TREE", aMsg);
+
+ va_list vl;
+ va_start(vl, aExtraFlags);
+ const char* descr = nullptr;
+ while ((descr = va_arg(vl, const char*))) {
+ AccessibleInfo(descr, va_arg(vl, Accessible*));
+ }
+ va_end(vl);
+
+ MsgEnd();
+
+ if (aExtraFlags & eStack) {
+ Stack();
+ }
+ }
+}
+
+void
+logging::TreeInfo(const char* aMsg, uint32_t aExtraFlags,
+ const char* aMsg1, Accessible* aAcc,
+ const char* aMsg2, nsINode* aNode)
+{
+ if (IsEnabledAll(logging::eTree | logging::eVerbose)) {
+ MsgBegin("TREE", aMsg);
+ AccessibleInfo(aMsg1, aAcc);
+ Accessible* acc = aAcc->Document()->GetAccessible(aNode);
+ if (acc) {
+ AccessibleInfo(aMsg2, acc);
+ }
+ else {
+ Node(aMsg2, aNode);
+ }
+ MsgEnd();
+ }
+}
+
+
+void
+logging::TreeInfo(const char* aMsg, uint32_t aExtraFlags, Accessible* aParent)
+{
+ if (IsEnabledAll(logging::eTree | aExtraFlags)) {
+ MsgBegin("TREE", aMsg);
+ AccessibleInfo("container", aParent);
+ for (uint32_t idx = 0; idx < aParent->ChildCount(); idx++) {
+ AccessibleInfo("child", aParent->GetChildAt(idx));
+ }
+ MsgEnd();
+ }
+}
+
void
logging::MsgBegin(const char* aTitle, const char* aMsgText, ...)
{
@@ -736,6 +793,62 @@ logging::Document(DocAccessible* aDocument)
printf("\n");
}
+void
+logging::AccessibleInfo(const char* aDescr, Accessible* aAccessible)
+{
+ printf(" %s: %p; ", aDescr, static_cast(aAccessible));
+ if (!aAccessible) {
+ printf("\n");
+ return;
+ }
+ if (aAccessible->IsDefunct()) {
+ printf("defunct\n");
+ return;
+ }
+ if (!aAccessible->Document() || aAccessible->Document()->IsDefunct()) {
+ printf("document is shutting down, no info\n");
+ return;
+ }
+
+ nsAutoString role;
+ GetAccService()->GetStringRole(aAccessible->Role(), role);
+ printf("role: %s", NS_ConvertUTF16toUTF8(role).get());
+
+ nsAutoString name;
+ aAccessible->Name(name);
+ if (!name.IsEmpty()) {
+ printf(", name: '%s'", NS_ConvertUTF16toUTF8(name).get());
+ }
+
+ printf(", idx: %d", aAccessible->IndexInParent());
+
+ nsINode* node = aAccessible->GetNode();
+ if (!node) {
+ printf(", node: null\n");
+ }
+ else if (node->IsNodeOfType(nsINode::eDOCUMENT)) {
+ printf(", document node: %p\n", static_cast(node));
+ }
+ else if (node->IsNodeOfType(nsINode::eTEXT)) {
+ printf(", text node: %p\n", static_cast(node));
+ }
+ else if (node->IsElement()) {
+ dom::Element* el = node->AsElement();
+
+ nsAutoCString tag;
+ el->NodeInfo()->NameAtom()->ToUTF8String(tag);
+
+ nsIAtom* idAtom = el->GetID();
+ nsAutoCString id;
+ if (idAtom) {
+ idAtom->ToUTF8String(id);
+ }
+
+ printf(", element node: %p, %s@id='%s'\n",
+ static_cast(el), tag.get(), id.get());
+ }
+}
+
void
logging::AccessibleNNode(const char* aDescr, Accessible* aAccessible)
{
@@ -814,6 +927,12 @@ logging::IsEnabled(uint32_t aModules)
return sModules & aModules;
}
+bool
+logging::IsEnabledAll(uint32_t aModules)
+{
+ return (sModules & aModules) == aModules;
+}
+
bool
logging::IsEnabled(const nsAString& aModuleStr)
{
diff --git a/accessible/base/Logging.h b/accessible/base/Logging.h
index 09fc7767ee2..43d0ed63c23 100644
--- a/accessible/base/Logging.h
+++ b/accessible/base/Logging.h
@@ -35,14 +35,17 @@ enum EModules {
eEvents = 1 << 3,
ePlatforms = 1 << 4,
- eStack = 1 << 5,
- eText = 1 << 6,
- eTree = 1 << 7,
+ eText = 1 << 5,
+ eTree = 1 << 6,
- eDOMEvents = 1 << 8,
- eFocus = 1 << 9,
- eSelection = 1 << 10,
- eNotifications = eDOMEvents | eSelection | eFocus
+ eDOMEvents = 1 << 7,
+ eFocus = 1 << 8,
+ eSelection = 1 << 9,
+ eNotifications = eDOMEvents | eSelection | eFocus,
+
+ // extras
+ eStack = 1 << 10,
+ eVerbose = 1 << 11
};
/**
@@ -50,6 +53,11 @@ enum EModules {
*/
bool IsEnabled(uint32_t aModules);
+/**
+ * Return true if all of the given modules are logged.
+ */
+bool IsEnabledAll(uint32_t aModules);
+
/**
* Return true if the given module is logged.
*/
@@ -121,6 +129,15 @@ void FocusDispatched(Accessible* aTarget);
void SelChange(nsISelection* aSelection, DocAccessible* aDocument,
int16_t aReason);
+/**
+ * Log the given accessible elements info.
+ */
+void TreeInfo(const char* aMsg, uint32_t aExtraFlags, ...);
+void TreeInfo(const char* aMsg, uint32_t aExtraFlags,
+ const char* aMsg1, Accessible* aAcc,
+ const char* aMsg2, nsINode* aNode);
+void TreeInfo(const char* aMsg, uint32_t aExtraFlags, Accessible* aParent);
+
/**
* Log the message ('title: text' format) on new line. Print the start and end
* boundaries of the message body designated by '{' and '}' (2 spaces indent for
@@ -164,6 +181,7 @@ void Document(DocAccessible* aDocument);
/**
* Log the accessible and its DOM node as a message entry.
*/
+void AccessibleInfo(const char* aDescr, Accessible* aAccessible);
void AccessibleNNode(const char* aDescr, Accessible* aAccessible);
void AccessibleNNode(const char* aDescr, nsINode* aNode);
@@ -189,7 +207,8 @@ void Enable(const nsAFlatCString& aModules);
*/
void CheckEnv();
-} // namespace logs
+} // namespace logging
+
} // namespace a11y
} // namespace mozilla
diff --git a/accessible/generic/Accessible.h b/accessible/generic/Accessible.h
index 1c700f86ce9..d7996f6611a 100644
--- a/accessible/generic/Accessible.h
+++ b/accessible/generic/Accessible.h
@@ -590,6 +590,7 @@ public:
HyperTextAccessible* AsHyperText();
bool IsHTMLBr() const { return mType == eHTMLBRType; }
+ bool IsHTMLCaption() const { return mType == eHTMLCaptionType; }
bool IsHTMLCombobox() const { return mType == eHTMLComboboxType; }
bool IsHTMLFileInput() const { return mType == eHTMLFileInputType; }
diff --git a/accessible/html/HTMLTableAccessible.cpp b/accessible/html/HTMLTableAccessible.cpp
index 5a8de9ff0bc..04bb744897f 100644
--- a/accessible/html/HTMLTableAccessible.cpp
+++ b/accessible/html/HTMLTableAccessible.cpp
@@ -393,24 +393,14 @@ NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableAccessible, Accessible)
////////////////////////////////////////////////////////////////////////////////
// HTMLTableAccessible: Accessible
-void
-HTMLTableAccessible::CacheChildren()
+bool
+HTMLTableAccessible::InsertChildAt(uint32_t aIndex, Accessible* aChild)
{
// Move caption accessible so that it's the first child. Check for the first
// caption only, because nsAccessibilityService ensures we don't create
// accessibles for the other captions, since only the first is actually
// visible.
- TreeWalker walker(this, mContent);
-
- Accessible* child = nullptr;
- while ((child = walker.Next())) {
- if (child->Role() == roles::CAPTION) {
- InsertChildAt(0, child);
- while ((child = walker.Next()) && AppendChild(child));
- break;
- }
- AppendChild(child);
- }
+ return Accessible::InsertChildAt(aChild->IsHTMLCaption() ? 0 : aIndex, aChild);
}
role
diff --git a/accessible/html/HTMLTableAccessible.h b/accessible/html/HTMLTableAccessible.h
index 5bef8e00d40..4bab484962d 100644
--- a/accessible/html/HTMLTableAccessible.h
+++ b/accessible/html/HTMLTableAccessible.h
@@ -157,12 +157,13 @@ public:
virtual already_AddRefed NativeAttributes() override;
virtual Relation RelationByType(RelationType aRelationType) override;
+ bool InsertChildAt(uint32_t aIndex, Accessible* aChild) override;
+
protected:
virtual ~HTMLTableAccessible() {}
// Accessible
virtual ENameValueFlag NativeName(nsString& aName) override;
- virtual void CacheChildren() override;
// HTMLTableAccessible
@@ -209,7 +210,7 @@ class HTMLCaptionAccessible : public HyperTextAccessibleWrap
{
public:
HTMLCaptionAccessible(nsIContent* aContent, DocAccessible* aDoc) :
- HyperTextAccessibleWrap(aContent, aDoc) { }
+ HyperTextAccessibleWrap(aContent, aDoc) { mType = eHTMLCaptionType; }
// Accessible
virtual a11y::role NativeRole() override;
diff --git a/accessible/tests/mochitest/treeupdate/a11y.ini b/accessible/tests/mochitest/treeupdate/a11y.ini
index bdb1b957017..e9294409873 100644
--- a/accessible/tests/mochitest/treeupdate/a11y.ini
+++ b/accessible/tests/mochitest/treeupdate/a11y.ini
@@ -29,6 +29,7 @@ skip-if = buildapp == "mulet"
[test_recreation.html]
[test_select.html]
[test_shutdown.xul]
+[test_table.html]
[test_textleaf.html]
[test_visibility.html]
[test_whitespace.html]
diff --git a/accessible/tests/mochitest/treeupdate/test_table.html b/accessible/tests/mochitest/treeupdate/test_table.html
new file mode 100644
index 00000000000..abadefdb028
--- /dev/null
+++ b/accessible/tests/mochitest/treeupdate/test_table.html
@@ -0,0 +1,81 @@
+
+
+
+ Table update tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/b2g/chrome/content/settings.js b/b2g/chrome/content/settings.js
index 17864c29721..7f0a6b80415 100644
--- a/b2g/chrome/content/settings.js
+++ b/b2g/chrome/content/settings.js
@@ -650,7 +650,6 @@ var settingsToObserve = {
'dom.mozApps.signed_apps_installable_from': 'https://marketplace.firefox.com',
'dom.presentation.discovery.enabled': false,
'dom.presentation.discoverable': false,
- 'dom.serviceWorkers.interception.enabled': true,
'dom.serviceWorkers.testing.enabled': false,
'gfx.layerscope.enabled': false,
'layers.draw-borders': false,
diff --git a/b2g/components/test/mochitest/test_aboutserviceworkers.html b/b2g/components/test/mochitest/test_aboutserviceworkers.html
index b239bf41c8a..d30e58f4f65 100644
--- a/b2g/components/test/mochitest/test_aboutserviceworkers.html
+++ b/b2g/components/test/mochitest/test_aboutserviceworkers.html
@@ -210,7 +210,6 @@ function setup() {
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
- ["dom.serviceWorkers.interception.enabled", true]
]}, () => {
SpecialPowers.pushPermissions([
{ "type": "webapps-manage", "allow": 1, "context": document },
diff --git a/b2g/installer/package-manifest.in b/b2g/installer/package-manifest.in
index cf98e6481a7..cced5bbfe41 100644
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -792,18 +792,6 @@
@RESPATH@/res/table-remove-row-active.gif
@RESPATH@/res/table-remove-row-hover.gif
@RESPATH@/res/table-remove-row.gif
-@RESPATH@/res/accessiblecaret.png
-@RESPATH@/res/accessiblecaret@1.5x.png
-@RESPATH@/res/accessiblecaret@2.25x.png
-@RESPATH@/res/accessiblecaret@2x.png
-@RESPATH@/res/accessiblecaret_tilt_left.png
-@RESPATH@/res/accessiblecaret_tilt_left@1.5x.png
-@RESPATH@/res/accessiblecaret_tilt_left@2.25x.png
-@RESPATH@/res/accessiblecaret_tilt_left@2x.png
-@RESPATH@/res/accessiblecaret_tilt_right.png
-@RESPATH@/res/accessiblecaret_tilt_right@1.5x.png
-@RESPATH@/res/accessiblecaret_tilt_right@2.25x.png
-@RESPATH@/res/accessiblecaret_tilt_right@2x.png
@RESPATH@/res/grabber.gif
#ifdef XP_MACOSX
@RESPATH@/res/cursors/*
diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
index a5aa5b0a843..32f4c694531 100644
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1635,7 +1635,6 @@ pref("reader.errors.includeURLs", true);
pref("view_source.tab", true);
pref("dom.serviceWorkers.enabled", true);
-pref("dom.serviceWorkers.interception.enabled", true);
pref("dom.serviceWorkers.openWindow.enabled", true);
pref("dom.webnotifications.serviceworker.enabled", true);
diff --git a/browser/components/sessionstore/SessionStorage.jsm b/browser/components/sessionstore/SessionStorage.jsm
index fb15fda18ce..2b94edf0704 100644
--- a/browser/components/sessionstore/SessionStorage.jsm
+++ b/browser/components/sessionstore/SessionStorage.jsm
@@ -108,7 +108,8 @@ var SessionStorageInternal = {
let principal;
try {
- let attrs = ChromeUtils.createOriginAttributesWithUserContextId(origin, aDocShell.userContextId);
+ let attrs = ChromeUtils.createDefaultOriginAttributes();
+ attrs.userContextId = aDocShell.userContextId;
let originURI = Services.io.newURI(origin, null, null);
principal = Services.scriptSecurityManager.createCodebasePrincipal(originURI, attrs);
} catch (e) {
diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
index 9f026b5bdeb..95045bb3b6f 100644
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -735,18 +735,6 @@
@RESPATH@/res/table-remove-row-active.gif
@RESPATH@/res/table-remove-row-hover.gif
@RESPATH@/res/table-remove-row.gif
-@RESPATH@/res/accessiblecaret.png
-@RESPATH@/res/accessiblecaret@1.5x.png
-@RESPATH@/res/accessiblecaret@2.25x.png
-@RESPATH@/res/accessiblecaret@2x.png
-@RESPATH@/res/accessiblecaret_tilt_left.png
-@RESPATH@/res/accessiblecaret_tilt_left@1.5x.png
-@RESPATH@/res/accessiblecaret_tilt_left@2.25x.png
-@RESPATH@/res/accessiblecaret_tilt_left@2x.png
-@RESPATH@/res/accessiblecaret_tilt_right.png
-@RESPATH@/res/accessiblecaret_tilt_right@1.5x.png
-@RESPATH@/res/accessiblecaret_tilt_right@2.25x.png
-@RESPATH@/res/accessiblecaret_tilt_right@2x.png
@RESPATH@/res/grabber.gif
#ifdef XP_MACOSX
@RESPATH@/res/cursors/*
diff --git a/caps/tests/unit/test_origin.js b/caps/tests/unit/test_origin.js
index 9290a2b13fd..3236df092ad 100644
--- a/caps/tests/unit/test_origin.js
+++ b/caps/tests/unit/test_origin.js
@@ -33,9 +33,28 @@ function checkOriginAttributes(prin, attrs, suffix) {
} else {
checkThrows(() => ssm.createCodebasePrincipalFromOrigin(prin.origin));
}
+}
- do_check_eq(ChromeUtils.createOriginAttributesWithUserContextId("http://example.org", 2).userContextId, 2);
- do_check_eq(ChromeUtils.createOriginAttributesWithUserContextId("https://www.example.com:123^userContextId=4", 2).userContextId, 2);
+// utility function useful for debugging
+function printAttrs(name, attrs) {
+ do_print(name + " {\n" +
+ "\tappId: " + attrs.appId + ",\n" +
+ "\tuserContextId: " + attrs.userContextId + ",\n" +
+ "\tinBrowser: " + attrs.inBrowser + ",\n" +
+ "\taddonId: '" + attrs.addonId + "',\n" +
+ "\tsignedPkg: '" + attrs.signedPkg + "'\n}");
+}
+
+
+function checkValues(attrs, values) {
+ values = values || {};
+ //printAttrs("attrs", attrs);
+ //printAttrs("values", values);
+ do_check_eq(attrs.appId, values.appId || 0);
+ do_check_eq(attrs.userContextId, values.userContextId || 0);
+ do_check_eq(attrs.inBrowser, values.inBrowser || false);
+ do_check_eq(attrs.addonId, values.addonId || '');
+ do_check_eq(attrs.signedPkg, values.signedPkg || '');
}
function run_test() {
@@ -177,4 +196,83 @@ function run_test() {
checkKind(ssm.createCodebasePrincipal(makeURI('http://www.example.com'), {}), 'codebasePrincipal');
checkKind(ssm.createExpandedPrincipal([ssm.createCodebasePrincipal(makeURI('http://www.example.com'), {})]), 'expandedPrincipal');
checkKind(ssm.getSystemPrincipal(), 'systemPrincipal');
+
+ //
+ // Test Origin Attribute Manipulation
+ //
+
+ // check that we can create an empty origin attributes dict with default
+ // members and values.
+ emptyAttrs = ChromeUtils.createDefaultOriginAttributes();
+ checkValues(emptyAttrs);
+
+ var uri = "http://example.org";
+ var tests = [
+ [ "", {} ],
+ [ "^appId=5", {appId: 5} ],
+ [ "^userContextId=3", {userContextId: 3} ],
+ [ "^addonId=fooBar", {addonId: "fooBar"} ],
+ [ "^inBrowser=1", {inBrowser: true} ],
+ [ "^signedPkg=bazQux", {signedPkg: "bazQux"} ],
+ [ "^appId=3&inBrowser=1&userContextId=6",
+ {appId: 3, userContextId: 6, inBrowser: true} ] ];
+
+ // check that we can create an origin attributes from an origin properly
+ tests.forEach(function(t) {
+ let attrs = ChromeUtils.createOriginAttributesFromOrigin(uri + t[0]);
+ checkValues(attrs, t[1]);
+ do_check_eq(ChromeUtils.originAttributesToSuffix(attrs), t[0]);
+ });
+
+ // check that we can create an origin attributes from a dict properly
+ tests.forEach(function(t) {
+ let attrs = ChromeUtils.createOriginAttributesFromDict(t[1]);
+ checkValues(attrs, t[1]);
+ do_check_eq(ChromeUtils.originAttributesToSuffix(attrs), t[0]);
+ });
+
+ // each row in the set_tests array has these values:
+ // [0] - the suffix used to create an origin attribute from
+ // [1] - the expected result of creating an origin attribute from [0]
+ // [2] - the pattern to set on the origin attributes
+ // [3] - the expected result of setting [2] values on [1]
+ // [4] - the expected result of creating a suffix from [3]
+ var set_tests = [
+ [ "", {}, {appId: 5}, {appId: 5}, "^appId=5" ],
+ [ "^appId=5", {appId: 5}, {appId: 3}, {appId: 3}, "^appId=3" ],
+ [ "^appId=5", {appId: 5}, {userContextId: 3}, {appId: 5, userContextId: 3}, "^appId=5&userContextId=3" ],
+ [ "^appId=5", {appId: 5}, {appId: 3, userContextId: 7}, {appId: 3, userContextId: 7}, "^appId=3&userContextId=7" ] ];
+
+ // check that we can set origin attributes values properly
+ set_tests.forEach(function(t) {
+ let orig = ChromeUtils.createOriginAttributesFromOrigin(uri + t[0]);
+ checkValues(orig, t[1]);
+ let mod = orig;
+ for (var key in t[2]) {
+ mod[key] = t[2][key];
+ }
+ checkValues(mod, t[3]);
+ do_check_eq(ChromeUtils.originAttributesToSuffix(mod), t[4]);
+ });
+
+ // each row in the dflt_tests array has these values:
+ // [0] - the suffix used to create an origin attribute from
+ // [1] - the expected result of creating an origin attributes from [0]
+ // [2] - the expected result after setting userContextId to the default
+ // [3] - the expected result of creating a suffix from [2]
+ var dflt_tests = [
+ [ "", {}, {}, "" ],
+ [ "^userContextId=3", {userContextId: 3}, {}, "" ],
+ [ "^appId=5", {appId: 5}, {appId: 5}, "^appId=5" ],
+ [ "^appId=5&userContextId=3", {appId: 5, userContextId: 3}, {appId: 5}, "^appId=5" ] ];
+
+ // check that we can set the userContextId to default properly
+ dflt_tests.forEach(function(t) {
+ let orig = ChromeUtils.createOriginAttributesFromOrigin(uri + t[0]);
+ checkValues(orig, t[1]);
+ let mod = orig;
+ mod['userContextId'] = 0;
+ checkValues(mod, t[2]);
+ do_check_eq(ChromeUtils.originAttributesToSuffix(mod), t[3]);
+ });
}
diff --git a/config/rules.mk b/config/rules.mk
index e40e1792b5d..d6fad629473 100644
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -1158,18 +1158,6 @@ ifneq (,$(DIST_SUBDIR)$(XPI_NAME))
PREF_DIR = defaults/preferences
endif
-################################################################################
-# Copy each element of AUTOCFG_JS_EXPORTS to $(FINAL_TARGET)/defaults/autoconfig
-
-ifneq ($(AUTOCFG_JS_EXPORTS),)
-ifndef NO_DIST_INSTALL
-AUTOCFG_JS_EXPORTS_FILES := $(AUTOCFG_JS_EXPORTS)
-AUTOCFG_JS_EXPORTS_DEST := $(FINAL_TARGET)/defaults/autoconfig
-AUTOCFG_JS_EXPORTS_TARGET := export
-INSTALL_TARGETS += AUTOCFG_JS_EXPORTS
-endif
-endif
-
################################################################################
# SDK
diff --git a/devtools/client/aboutdebugging/test/browser_service_workers.js b/devtools/client/aboutdebugging/test/browser_service_workers.js
index f45b60cfd58..a559d9cae0e 100644
--- a/devtools/client/aboutdebugging/test/browser_service_workers.js
+++ b/devtools/client/aboutdebugging/test/browser_service_workers.js
@@ -16,6 +16,7 @@ const TAB_URL = HTTP_ROOT + "service-workers/empty-sw.html";
add_task(function* () {
yield new Promise(done => {
let options = {"set": [
+ ["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
]};
SpecialPowers.pushPrefEnv(options, done);
diff --git a/devtools/client/locales/en-US/markers.properties b/devtools/client/locales/en-US/markers.properties
index c463cb03e49..bdf354a233a 100644
--- a/devtools/client/locales/en-US/markers.properties
+++ b/devtools/client/locales/en-US/markers.properties
@@ -32,6 +32,7 @@ marker.label.cycleCollection=Cycle Collection
marker.label.cycleCollection.forgetSkippable=CC Graph Reduction
marker.label.timestamp=Timestamp
marker.label.worker=Worker
+marker.label.messagePort=MessagePort
marker.label.unknown=Unknown
# LOCALIZATION NOTE (marker.label.javascript.*):
@@ -82,6 +83,9 @@ marker.worker.serializeDataOffMainThread=Serialize data in Worker
marker.worker.serializeDataOnMainThread=Serialize data on the main thread
marker.worker.deserializeDataOffMainThread=Deserialize data in Worker
marker.worker.deserializeDataOnMainThread=Deserialize data on the main thread
+# The type of operation performed by a MessagePort
+marker.messagePort.serializeData=Serialize data
+marker.messagePort.deserializeData=Deserialize data
# Strings used in the waterfall sidebar as values.
marker.value.unknownFrame=
diff --git a/devtools/client/performance/modules/logic/marker-formatters.js b/devtools/client/performance/modules/logic/marker-formatters.js
index 1acca0bf835..15e7c09beff 100644
--- a/devtools/client/performance/modules/logic/marker-formatters.js
+++ b/devtools/client/performance/modules/logic/marker-formatters.js
@@ -147,6 +147,13 @@ const Formatters = {
[L10N.getStr("marker.field.type")]:
L10N.getStr(`marker.worker.${marker.workerOperation}`)
};
+ },
+
+ MessagePortFields: function(marker) {
+ return {
+ [L10N.getStr("marker.field.type")]:
+ L10N.getStr(`marker.messagePort.${marker.messagePortOperation}`)
+ };
}
};
diff --git a/devtools/client/performance/modules/markers.js b/devtools/client/performance/modules/markers.js
index a927aa74874..4757801549c 100644
--- a/devtools/client/performance/modules/markers.js
+++ b/devtools/client/performance/modules/markers.js
@@ -147,6 +147,12 @@ const TIMELINE_BLUEPRINT = {
label: L10N.getStr("marker.label.worker"),
fields: Formatters.WorkerFields
},
+ "MessagePort": {
+ group: 1,
+ colorName: "graphs-orange",
+ label: L10N.getStr("marker.label.messagePort"),
+ fields: Formatters.MessagePortFields
+ },
/* Group 2 - User Controlled */
"ConsoleTime": {
diff --git a/devtools/client/responsive.html/index.css b/devtools/client/responsive.html/index.css
index 7e78f734a6d..728cefff6d5 100644
--- a/devtools/client/responsive.html/index.css
+++ b/devtools/client/responsive.html/index.css
@@ -105,7 +105,7 @@ body {
}
.viewport-rotate-button {
- mask-image: url("./images/rotate-viewport.svg");
+ mask: url("./images/rotate-viewport.svg");
}
/**
diff --git a/devtools/shared/webconsole/test/test_console_serviceworker.html b/devtools/shared/webconsole/test/test_console_serviceworker.html
index 75bc0946594..5dee68481ca 100644
--- a/devtools/shared/webconsole/test/test_console_serviceworker.html
+++ b/devtools/shared/webconsole/test/test_console_serviceworker.html
@@ -56,6 +56,7 @@ let startTest = Task.async(function*() {
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
+ ["dom.serviceWorkers.enabled", true],
["devtools.webconsole.filter.serviceworkers", true]
]}, resolve);
});
diff --git a/devtools/shared/webconsole/test/test_console_serviceworker_cached.html b/devtools/shared/webconsole/test/test_console_serviceworker_cached.html
index 3fbd8dffd48..5aab64d7ff9 100644
--- a/devtools/shared/webconsole/test/test_console_serviceworker_cached.html
+++ b/devtools/shared/webconsole/test/test_console_serviceworker_cached.html
@@ -49,6 +49,7 @@ let startTest = Task.async(function*() {
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
+ ["dom.serviceWorkers.enabled", true],
["devtools.webconsole.filter.serviceworkers", true]
]}, resolve);
});
diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index 36f1b1cf950..b766dc6aae4 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -14157,11 +14157,6 @@ nsDocShell::ShouldPrepareForIntercept(nsIURI* aURI, bool aIsNonSubresourceReques
bool* aShouldIntercept)
{
*aShouldIntercept = false;
- // Preffed off.
- if (!nsContentUtils::ServiceWorkerInterceptionEnabled()) {
- return NS_OK;
- }
-
// No in private browsing
if (mInPrivateBrowsing) {
return NS_OK;
diff --git a/docshell/base/timeline/AbstractTimelineMarker.h b/docshell/base/timeline/AbstractTimelineMarker.h
index 5fde6631da2..516b44eb0b6 100644
--- a/docshell/base/timeline/AbstractTimelineMarker.h
+++ b/docshell/base/timeline/AbstractTimelineMarker.h
@@ -30,12 +30,12 @@ private:
void operator=(const AbstractTimelineMarker& aOther) = delete;
public:
- explicit AbstractTimelineMarker(const char* aName,
- MarkerTracingType aTracingType);
+ AbstractTimelineMarker(const char* aName,
+ MarkerTracingType aTracingType);
- explicit AbstractTimelineMarker(const char* aName,
- const TimeStamp& aTime,
- MarkerTracingType aTracingType);
+ AbstractTimelineMarker(const char* aName,
+ const TimeStamp& aTime,
+ MarkerTracingType aTracingType);
virtual ~AbstractTimelineMarker();
diff --git a/docshell/base/timeline/AutoTimelineMarker.h b/docshell/base/timeline/AutoTimelineMarker.h
index e8a335a60d0..47bb25046a9 100644
--- a/docshell/base/timeline/AutoTimelineMarker.h
+++ b/docshell/base/timeline/AutoTimelineMarker.h
@@ -38,8 +38,8 @@ class MOZ_RAII AutoTimelineMarker
RefPtr mDocShell;
public:
- explicit AutoTimelineMarker(nsIDocShell* aDocShell, const char* aName
- MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
+ AutoTimelineMarker(nsIDocShell* aDocShell,
+ const char* aName MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
~AutoTimelineMarker();
AutoTimelineMarker(const AutoTimelineMarker& aOther) = delete;
diff --git a/docshell/base/timeline/CompositeTimelineMarker.h b/docshell/base/timeline/CompositeTimelineMarker.h
index 571f5d7a30e..45faefbd629 100644
--- a/docshell/base/timeline/CompositeTimelineMarker.h
+++ b/docshell/base/timeline/CompositeTimelineMarker.h
@@ -15,8 +15,8 @@ namespace mozilla {
class CompositeTimelineMarker : public TimelineMarker
{
public:
- explicit CompositeTimelineMarker(const TimeStamp& aTime,
- MarkerTracingType aTracingType)
+ CompositeTimelineMarker(const TimeStamp& aTime,
+ MarkerTracingType aTracingType)
: TimelineMarker("Composite", aTime, aTracingType)
{
// Even though these markers end up being created on the main thread in the
diff --git a/docshell/base/timeline/ConsoleTimelineMarker.h b/docshell/base/timeline/ConsoleTimelineMarker.h
index 39036494957..f397830c2da 100644
--- a/docshell/base/timeline/ConsoleTimelineMarker.h
+++ b/docshell/base/timeline/ConsoleTimelineMarker.h
@@ -15,8 +15,8 @@ namespace mozilla {
class ConsoleTimelineMarker : public TimelineMarker
{
public:
- explicit ConsoleTimelineMarker(const nsAString& aCause,
- MarkerTracingType aTracingType)
+ ConsoleTimelineMarker(const nsAString& aCause,
+ MarkerTracingType aTracingType)
: TimelineMarker("ConsoleTime", aTracingType)
, mCause(aCause)
{
diff --git a/docshell/base/timeline/EventTimelineMarker.h b/docshell/base/timeline/EventTimelineMarker.h
index 74dfb5e5c07..095bc528e9b 100644
--- a/docshell/base/timeline/EventTimelineMarker.h
+++ b/docshell/base/timeline/EventTimelineMarker.h
@@ -15,9 +15,9 @@ namespace mozilla {
class EventTimelineMarker : public TimelineMarker
{
public:
- explicit EventTimelineMarker(const nsAString& aType,
- uint16_t aPhase,
- MarkerTracingType aTracingType)
+ EventTimelineMarker(const nsAString& aType,
+ uint16_t aPhase,
+ MarkerTracingType aTracingType)
: TimelineMarker("DOMEvent", aTracingType)
, mType(aType)
, mPhase(aPhase)
diff --git a/docshell/base/timeline/JavascriptTimelineMarker.h b/docshell/base/timeline/JavascriptTimelineMarker.h
index 124dc82612b..0214857d39b 100644
--- a/docshell/base/timeline/JavascriptTimelineMarker.h
+++ b/docshell/base/timeline/JavascriptTimelineMarker.h
@@ -17,13 +17,13 @@ namespace mozilla {
class JavascriptTimelineMarker : public TimelineMarker
{
public:
- explicit JavascriptTimelineMarker(const char* aReason,
- const char16_t* aFunctionName,
- const char16_t* aFileName,
- uint32_t aLineNumber,
- MarkerTracingType aTracingType,
- JS::Handle aAsyncStack,
- JS::Handle aAsyncCause)
+ JavascriptTimelineMarker(const char* aReason,
+ const char16_t* aFunctionName,
+ const char16_t* aFileName,
+ uint32_t aLineNumber,
+ MarkerTracingType aTracingType,
+ JS::Handle aAsyncStack,
+ JS::Handle aAsyncCause)
: TimelineMarker("Javascript", aTracingType, MarkerStackRequest::NO_STACK)
, mCause(NS_ConvertUTF8toUTF16(aReason))
, mFunctionName(aFunctionName)
diff --git a/docshell/base/timeline/MessagePortTimelineMarker.h b/docshell/base/timeline/MessagePortTimelineMarker.h
new file mode 100644
index 00000000000..f578cf128be
--- /dev/null
+++ b/docshell/base/timeline/MessagePortTimelineMarker.h
@@ -0,0 +1,47 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_MessagePortTimelineMarker_h_
+#define mozilla_MessagePortTimelineMarker_h_
+
+#include "TimelineMarker.h"
+#include "mozilla/dom/ProfileTimelineMarkerBinding.h"
+
+namespace mozilla {
+
+class MessagePortTimelineMarker : public TimelineMarker
+{
+public:
+ MessagePortTimelineMarker(dom::ProfileTimelineMessagePortOperationType aOperationType,
+ MarkerTracingType aTracingType)
+ : TimelineMarker("MessagePort", aTracingType, MarkerStackRequest::NO_STACK)
+ , mOperationType(aOperationType)
+ {}
+
+ virtual UniquePtr Clone() override
+ {
+ MessagePortTimelineMarker* clone =
+ new MessagePortTimelineMarker(mOperationType, GetTracingType());
+ clone->SetCustomTime(GetTime());
+ return UniquePtr(clone);
+ }
+
+ virtual void AddDetails(JSContext* aCx, dom::ProfileTimelineMarker& aMarker) override
+ {
+ TimelineMarker::AddDetails(aCx, aMarker);
+
+ if (GetTracingType() == MarkerTracingType::START) {
+ aMarker.mMessagePortOperation.Construct(mOperationType);
+ }
+ }
+
+private:
+ dom::ProfileTimelineMessagePortOperationType mOperationType;
+};
+
+} // namespace mozilla
+
+#endif /* mozilla_MessagePortTimelineMarker_h_ */
diff --git a/docshell/base/timeline/RestyleTimelineMarker.h b/docshell/base/timeline/RestyleTimelineMarker.h
index fcc37b05d85..71055b08e58 100644
--- a/docshell/base/timeline/RestyleTimelineMarker.h
+++ b/docshell/base/timeline/RestyleTimelineMarker.h
@@ -15,8 +15,8 @@ namespace mozilla {
class RestyleTimelineMarker : public TimelineMarker
{
public:
- explicit RestyleTimelineMarker(nsRestyleHint aRestyleHint,
- MarkerTracingType aTracingType)
+ RestyleTimelineMarker(nsRestyleHint aRestyleHint,
+ MarkerTracingType aTracingType)
: TimelineMarker("Styles", aTracingType)
{
if (aRestyleHint) {
diff --git a/docshell/base/timeline/TimelineMarker.h b/docshell/base/timeline/TimelineMarker.h
index 468d95d9c12..2e0b4dd0210 100644
--- a/docshell/base/timeline/TimelineMarker.h
+++ b/docshell/base/timeline/TimelineMarker.h
@@ -18,14 +18,14 @@ namespace mozilla {
class TimelineMarker : public AbstractTimelineMarker
{
public:
- explicit TimelineMarker(const char* aName,
- MarkerTracingType aTracingType,
- MarkerStackRequest aStackRequest = MarkerStackRequest::STACK);
+ TimelineMarker(const char* aName,
+ MarkerTracingType aTracingType,
+ MarkerStackRequest aStackRequest = MarkerStackRequest::STACK);
- explicit TimelineMarker(const char* aName,
- const TimeStamp& aTime,
- MarkerTracingType aTracingType,
- MarkerStackRequest aStackRequest = MarkerStackRequest::STACK);
+ TimelineMarker(const char* aName,
+ const TimeStamp& aTime,
+ MarkerTracingType aTracingType,
+ MarkerStackRequest aStackRequest = MarkerStackRequest::STACK);
virtual void AddDetails(JSContext* aCx, dom::ProfileTimelineMarker& aMarker) override;
virtual JSObject* GetStack() override;
diff --git a/docshell/base/timeline/WorkerTimelineMarker.h b/docshell/base/timeline/WorkerTimelineMarker.h
index 2b2b6950030..ae24066f56d 100644
--- a/docshell/base/timeline/WorkerTimelineMarker.h
+++ b/docshell/base/timeline/WorkerTimelineMarker.h
@@ -15,8 +15,8 @@ namespace mozilla {
class WorkerTimelineMarker : public TimelineMarker
{
public:
- explicit WorkerTimelineMarker(ProfileTimelineWorkerOperationType aOperationType,
- MarkerTracingType aTracingType)
+ WorkerTimelineMarker(ProfileTimelineWorkerOperationType aOperationType,
+ MarkerTracingType aTracingType)
: TimelineMarker("Worker", aTracingType, MarkerStackRequest::NO_STACK)
, mOperationType(aOperationType)
{}
diff --git a/docshell/base/timeline/moz.build b/docshell/base/timeline/moz.build
index a0462bf3bd2..23ba5d0f628 100644
--- a/docshell/base/timeline/moz.build
+++ b/docshell/base/timeline/moz.build
@@ -15,6 +15,7 @@ EXPORTS.mozilla += [
'JavascriptTimelineMarker.h',
'LayerTimelineMarker.h',
'MarkersStorage.h',
+ 'MessagePortTimelineMarker.h',
'ObservedDocShell.h',
'RestyleTimelineMarker.h',
'TimelineConsumers.h',
diff --git a/docshell/build/nsDocShellModule.cpp b/docshell/build/nsDocShellModule.cpp
index 18dd0402c68..1e62e147947 100644
--- a/docshell/build/nsDocShellModule.cpp
+++ b/docshell/build/nsDocShellModule.cpp
@@ -179,9 +179,7 @@ const mozilla::Module::ContractIDEntry kDocShellContracts[] = {
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "neterror", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "networking", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "newaddon", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
-#ifdef NIGHTLY_BUILD
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "performance", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
-#endif
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "plugins", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "serviceworkers", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
#ifndef ANDROID
diff --git a/dom/base/ChromeUtils.cpp b/dom/base/ChromeUtils.cpp
index d80499d2426..73903478b02 100644
--- a/dom/base/ChromeUtils.cpp
+++ b/dom/base/ChromeUtils.cpp
@@ -50,7 +50,7 @@ ThreadSafeChromeUtils::NondeterministicGetWeakSetKeys(GlobalObject& aGlobal,
}
}
- /* static */ void
+/* static */ void
ChromeUtils::OriginAttributesToSuffix(dom::GlobalObject& aGlobal,
const dom::OriginAttributesDictionary& aAttrs,
nsCString& aSuffix)
@@ -71,11 +71,17 @@ ChromeUtils::OriginAttributesMatchPattern(dom::GlobalObject& aGlobal,
}
/* static */ void
-ChromeUtils::CreateOriginAttributesWithUserContextId(dom::GlobalObject& aGlobal,
- const nsAString& aOrigin,
- uint32_t aUserContextId,
- dom::OriginAttributesDictionary& aAttrs,
- ErrorResult& aRv)
+ChromeUtils::CreateDefaultOriginAttributes(dom::GlobalObject& aGlobal,
+ dom::OriginAttributesDictionary& aAttrs)
+{
+ aAttrs = GenericOriginAttributes();
+}
+
+/* static */ void
+ChromeUtils::CreateOriginAttributesFromOrigin(dom::GlobalObject& aGlobal,
+ const nsAString& aOrigin,
+ dom::OriginAttributesDictionary& aAttrs,
+ ErrorResult& aRv)
{
GenericOriginAttributes attrs;
nsAutoCString suffix;
@@ -83,11 +89,18 @@ ChromeUtils::CreateOriginAttributesWithUserContextId(dom::GlobalObject& aGlobal,
aRv.Throw(NS_ERROR_FAILURE);
return;
}
-
- attrs.mUserContextId = aUserContextId;
aAttrs = attrs;
}
+/* static */ void
+ChromeUtils::CreateOriginAttributesFromDict(dom::GlobalObject& aGlobal,
+ const dom::OriginAttributesDictionary& aAttrs,
+ dom::OriginAttributesDictionary& aNewAttrs)
+{
+ aNewAttrs = aAttrs;
+}
+
+
/* static */ bool
ChromeUtils::IsOriginAttributesEqual(dom::GlobalObject& aGlobal,
const dom::OriginAttributesDictionary& aA,
diff --git a/dom/base/ChromeUtils.h b/dom/base/ChromeUtils.h
index 4df8f86d685..3378dac3af4 100644
--- a/dom/base/ChromeUtils.h
+++ b/dom/base/ChromeUtils.h
@@ -59,11 +59,19 @@ public:
const dom::OriginAttributesPatternDictionary& aPattern);
static void
- CreateOriginAttributesWithUserContextId(dom::GlobalObject& aGlobal,
- const nsAString& aOrigin,
- uint32_t aUserContextId,
- dom::OriginAttributesDictionary& aAttrs,
- ErrorResult& aRv);
+ CreateDefaultOriginAttributes(dom::GlobalObject& aGlobal,
+ dom::OriginAttributesDictionary& aAttrs);
+
+ static void
+ CreateOriginAttributesFromOrigin(dom::GlobalObject& aGlobal,
+ const nsAString& aOrigin,
+ dom::OriginAttributesDictionary& aAttrs,
+ ErrorResult& aRv);
+
+ static void
+ CreateOriginAttributesFromDict(dom::GlobalObject& aGlobal,
+ const dom::OriginAttributesDictionary& aAttrs,
+ dom::OriginAttributesDictionary& aNewAttrs);
static bool
IsOriginAttributesEqual(dom::GlobalObject& aGlobal,
diff --git a/dom/base/StructuredCloneHolder.cpp b/dom/base/StructuredCloneHolder.cpp
index 3540a00adc9..f0da5380931 100644
--- a/dom/base/StructuredCloneHolder.cpp
+++ b/dom/base/StructuredCloneHolder.cpp
@@ -295,6 +295,7 @@ StructuredCloneHolder::Read(nsISupports* aParent,
{
MOZ_ASSERT_IF(mSupportedContext == SameProcessSameThread,
mCreationThread == NS_GetCurrentThread());
+ MOZ_ASSERT(aParent);
mozilla::AutoRestore guard(mParent);
mParent = aParent;
@@ -1044,9 +1045,11 @@ StructuredCloneHolder::CustomReadTransferHandler(JSContext* aCx,
MOZ_ASSERT(aExtraData < mPortIdentifiers.Length());
const MessagePortIdentifier& portIdentifier = mPortIdentifiers[aExtraData];
+ nsCOMPtr global = do_QueryInterface(mParent);
+
ErrorResult rv;
RefPtr port =
- MessagePort::Create(mParent, portIdentifier, rv);
+ MessagePort::Create(global, portIdentifier, rv);
if (NS_WARN_IF(rv.Failed())) {
return false;
}
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp
index 7a5448ba483..e3fcbb7d026 100644
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -274,7 +274,6 @@ bool nsContentUtils::sEncodeDecodeURLHash = false;
bool nsContentUtils::sGettersDecodeURLHash = false;
bool nsContentUtils::sPrivacyResistFingerprinting = false;
bool nsContentUtils::sSendPerformanceTimingNotifications = false;
-bool nsContentUtils::sSWInterceptionEnabled = false;
uint32_t nsContentUtils::sHandlingInputTimeout = 1000;
@@ -569,10 +568,6 @@ nsContentUtils::Init()
Preferences::AddBoolVarCache(&sPrivacyResistFingerprinting,
"privacy.resistFingerprinting", false);
- Preferences::AddBoolVarCache(&sSWInterceptionEnabled,
- "dom.serviceWorkers.interception.enabled",
- false);
-
Preferences::AddUintVarCache(&sHandlingInputTimeout,
"dom.event.handling-user-input-time-limit",
1000);
@@ -1754,8 +1749,7 @@ nsContentUtils::ParseLegacyFontSize(const nsAString& aValue)
bool
nsContentUtils::IsControlledByServiceWorker(nsIDocument* aDocument)
{
- if (!ServiceWorkerInterceptionEnabled() ||
- nsContentUtils::IsInPrivateBrowsing(aDocument)) {
+ if (nsContentUtils::IsInPrivateBrowsing(aDocument)) {
return false;
}
diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h
index f0b47f48d80..e2a48e2cde3 100644
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -1996,14 +1996,6 @@ public:
return sSendPerformanceTimingNotifications;
}
- /*
- * Returns true if ServiceWorker Interception is enabled by pref.
- */
- static bool ServiceWorkerInterceptionEnabled()
- {
- return sSWInterceptionEnabled;
- }
-
/*
* Returns true if the frame timing APIs are enabled.
*/
@@ -2706,7 +2698,6 @@ private:
static bool sGettersDecodeURLHash;
static bool sPrivacyResistFingerprinting;
static bool sSendPerformanceTimingNotifications;
- static bool sSWInterceptionEnabled;
static uint32_t sCookiesLifetimePolicy;
static uint32_t sCookiesBehavior;
diff --git a/dom/canvas/test/test_offscreencanvas_serviceworker.html b/dom/canvas/test/test_offscreencanvas_serviceworker.html
index 923e9e7facf..887b94fc6da 100644
--- a/dom/canvas/test/test_offscreencanvas_serviceworker.html
+++ b/dom/canvas/test/test_offscreencanvas_serviceworker.html
@@ -43,7 +43,6 @@ SpecialPowers.pushPrefEnv({'set': [
['gfx.offscreencanvas.enabled', true],
['webgl.force-enabled', true],
["dom.serviceWorkers.exemptFromPerDomainMax", true],
- ["dom.serviceWorkers.interception.enabled", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true]
]}, runTest);
diff --git a/dom/events/test/test_bug238987.html b/dom/events/test/test_bug238987.html
index 3aa05b4d2c1..814b0596b9f 100644
--- a/dom/events/test/test_bug238987.html
+++ b/dom/events/test/test_bug238987.html
@@ -31,16 +31,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=238987
// but the last blur event goes to i1, not "begin".
var expectedWindowBlurCount = forwardFocusArray.length + backwardFocusArray.length + 3;
- // accessibility.tabfocus must be set to value 7 before running test also
- // on a mac.
- function setOrRestoreTabFocus(newValue) {
- if (!newValue) {
- SpecialPowers.clearUserPref("accessibility.tabfocus");
- } else {
- SpecialPowers.setIntPref("accessibility.tabfocus", newValue);
- }
- }
-
function handleFocus(e) {
if (e.target.id == "begin") {
// if the modifier is set, the test is coming back from the end.
@@ -128,7 +118,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=238987
"|window| didn't get the right amount of blur events");
// Cleanup
- setOrRestoreTabFocus(0);
window.removeEventListener("focus", handleWindowFocus, true);
window.removeEventListener("focus", handleWindowFocus, false);
window.removeEventListener("blur", handleWindowBlur, true);
@@ -166,9 +155,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=238987
tab();
}
+ // accessibility.tabfocus must be set to value 7 before running test also
+ // on a mac.
function doTest() {
- setOrRestoreTabFocus(7);
- setTimeout(start, 0);
+ SpecialPowers.pushPrefEnv({"set": [["accessibility.tabfocus", 7]]}, start);
}
SimpleTest.waitForExplicitFinish();
diff --git a/dom/events/test/test_bug409604.html b/dom/events/test/test_bug409604.html
index cd3af13abc2..ec714ab64b7 100644
--- a/dom/events/test/test_bug409604.html
+++ b/dom/events/test/test_bug409604.html
@@ -90,15 +90,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
"tr"
];
- // ui.key.contentAccess must be set to value 5 before running the test.
- function setOrRestoreContentAccess(newValue) {
- if (!newValue) {
- SpecialPowers.clearUserPref("ui.key.contentAccess");
- } else {
- SpecialPowers.setIntPref("ui.key.contentAccess", newValue);
- }
- }
-
function handleFocus(e) {
ok("accessKey" in e, "(focus) accesskey property not found on element");
var expected = focusArray.shift();
@@ -218,17 +209,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=409604
function start() {
testFocusableElements();
testUnfocusableElements();
- setOrRestoreContentAccess(0);
SimpleTest.finish();
}
function doTest() {
- setOrRestoreContentAccess(5);
- setTimeout(start, 100);
+ SpecialPowers.pushPrefEnv({"set": [["ui.key.contentAccess", 5]]}, start);
}
SimpleTest.waitForExplicitFinish();
- SimpleTest.requestFlakyTimeout("untriaged");
addLoadEvent(doTest);
diff --git a/dom/events/test/test_bug457672.html b/dom/events/test/test_bug457672.html
index 89e344ab63f..b3dc5bcb355 100644
--- a/dom/events/test/test_bug457672.html
+++ b/dom/events/test/test_bug457672.html
@@ -21,19 +21,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=457672
var windowBlurCount = 0;
-function setUserPref(reset) {
- if (reset) {
- SpecialPowers.clearUserPref("browser.link.open_newwindow");
- } else {
- SpecialPowers.setIntPref("browser.link.open_newwindow", 3);
- }
-}
-
function listener(evt) {
if (evt.type == "focus") {
is(windowBlurCount, 1,
"Window should have got blur event when opening a new tab!");
- setUserPref(true);
document.getElementsByTagName("a")[0].focus();
SimpleTest.finish();
} else if (evt.type == "blur") {
@@ -43,13 +34,14 @@ function listener(evt) {
}
function startTest() {
- setUserPref(false);
- document.getElementsByTagName("a")[0].focus();
- // Note, focus/blur don't bubble
- window.addEventListener("focus", listener, false);
- window.addEventListener("blur", listener, false);
- var subwin = window.open("about:blank", "", "");
- subwin.addEventListener("focus", function(e) { subwin.close(); }, false);
+ SpecialPowers.pushPrefEnv({"set": [["browser.link.open_newwindow", 3]]}, function() {
+ document.getElementsByTagName("a")[0].focus();
+ // Note, focus/blur don't bubble
+ window.addEventListener("focus", listener, false);
+ window.addEventListener("blur", listener, false);
+ var subwin = window.open("about:blank", "", "");
+ subwin.addEventListener("focus", function(e) { subwin.close(); }, false);
+ });
}
addLoadEvent(startTest);
diff --git a/dom/events/test/test_moz_mouse_pixel_scroll_event.html b/dom/events/test/test_moz_mouse_pixel_scroll_event.html
index 25c7bb94340..c2919ce44dd 100644
--- a/dom/events/test/test_moz_mouse_pixel_scroll_event.html
+++ b/dom/events/test/test_moz_mouse_pixel_scroll_event.html
@@ -45,7 +45,7 @@
-
-
-
-
-
-
diff --git a/dom/events/test/window_bug659071.html b/dom/events/test/window_bug659071.html
index a012b883010..5fb2efed46c 100644
--- a/dom/events/test/window_bug659071.html
+++ b/dom/events/test/window_bug659071.html
@@ -10,7 +10,7 @@
diff --git a/dom/workers/test/serviceworkers/test_eventsource_intercept.html b/dom/workers/test/serviceworkers/test_eventsource_intercept.html
index ab384158fda..55df62bb7ba 100644
--- a/dom/workers/test/serviceworkers/test_eventsource_intercept.html
+++ b/dom/workers/test/serviceworkers/test_eventsource_intercept.html
@@ -95,8 +95,6 @@
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
- ["dom.serviceWorkers.interception.enabled", true],
- ["dom.serviceWorkers.interception.opaque.enabled", true],
["dom.caches.enabled", true],
]}, runTest);
diff --git a/dom/workers/test/serviceworkers/test_fetch_event.html b/dom/workers/test/serviceworkers/test_fetch_event.html
index 5c21c3183e0..764be87b131 100644
--- a/dom/workers/test/serviceworkers/test_fetch_event.html
+++ b/dom/workers/test/serviceworkers/test_fetch_event.html
@@ -73,8 +73,6 @@
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [
["dom.serviceWorkers.exemptFromPerDomainMax", true],
- ["dom.serviceWorkers.interception.enabled", true],
- ["dom.serviceWorkers.interception.opaque.enabled", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
]}, runTest);
diff --git a/dom/workers/test/serviceworkers/test_file_blob_upload.html b/dom/workers/test/serviceworkers/test_file_blob_upload.html
index 5410d65e645..30a31eb7e85 100644
--- a/dom/workers/test/serviceworkers/test_file_blob_upload.html
+++ b/dom/workers/test/serviceworkers/test_file_blob_upload.html
@@ -135,7 +135,6 @@
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [
["dom.serviceWorkers.exemptFromPerDomainMax", true],
- ["dom.serviceWorkers.interception.enabled", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true]
]}, runTest);
diff --git a/dom/workers/test/serviceworkers/test_force_refresh.html b/dom/workers/test/serviceworkers/test_force_refresh.html
index e39330e5a34..05caf0e6ac4 100644
--- a/dom/workers/test/serviceworkers/test_force_refresh.html
+++ b/dom/workers/test/serviceworkers/test_force_refresh.html
@@ -74,7 +74,6 @@
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [
["dom.serviceWorkers.exemptFromPerDomainMax", true],
- ["dom.serviceWorkers.interception.enabled", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
["dom.caches.enabled", true],
diff --git a/dom/workers/test/serviceworkers/test_gzip_redirect.html b/dom/workers/test/serviceworkers/test_gzip_redirect.html
index f8c2ac082cc..7ac92122ce8 100644
--- a/dom/workers/test/serviceworkers/test_gzip_redirect.html
+++ b/dom/workers/test/serviceworkers/test_gzip_redirect.html
@@ -77,7 +77,6 @@
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
- ['dom.serviceWorkers.interception.enabled', true],
]}, runTest);
diff --git a/dom/workers/test/serviceworkers/test_hsts_upgrade_intercept.html b/dom/workers/test/serviceworkers/test_hsts_upgrade_intercept.html
index ea2c1fe8ef6..068046ca6f1 100644
--- a/dom/workers/test/serviceworkers/test_hsts_upgrade_intercept.html
+++ b/dom/workers/test/serviceworkers/test_hsts_upgrade_intercept.html
@@ -54,7 +54,6 @@
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
- ["dom.serviceWorkers.interception.enabled", true],
// This is needed so that we can test upgrading a non-secure load inside an https iframe.
["security.mixed_content.block_active_content", false],
["security.mixed_content.block_display_content", false],
diff --git a/dom/workers/test/serviceworkers/test_https_fetch.html b/dom/workers/test/serviceworkers/test_https_fetch.html
index 01e18b03d25..e990200f855 100644
--- a/dom/workers/test/serviceworkers/test_https_fetch.html
+++ b/dom/workers/test/serviceworkers/test_https_fetch.html
@@ -51,7 +51,6 @@
onload = function() {
SpecialPowers.pushPrefEnv({"set": [
["dom.serviceWorkers.exemptFromPerDomainMax", true],
- ["dom.serviceWorkers.interception.enabled", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
["dom.caches.enabled", true]
diff --git a/dom/workers/test/serviceworkers/test_https_fetch_cloned_response.html b/dom/workers/test/serviceworkers/test_https_fetch_cloned_response.html
index 410db7a2769..1cf1dbef139 100644
--- a/dom/workers/test/serviceworkers/test_https_fetch_cloned_response.html
+++ b/dom/workers/test/serviceworkers/test_https_fetch_cloned_response.html
@@ -45,7 +45,6 @@
onload = function() {
SpecialPowers.pushPrefEnv({"set": [
["dom.serviceWorkers.exemptFromPerDomainMax", true],
- ["dom.serviceWorkers.interception.enabled", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
["dom.caches.enabled", true]
diff --git a/dom/workers/test/serviceworkers/test_https_origin_after_redirect.html b/dom/workers/test/serviceworkers/test_https_origin_after_redirect.html
index b780bc07b33..3878a1df6de 100644
--- a/dom/workers/test/serviceworkers/test_https_origin_after_redirect.html
+++ b/dom/workers/test/serviceworkers/test_https_origin_after_redirect.html
@@ -48,7 +48,6 @@
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
- ['dom.serviceWorkers.interception.enabled', true],
["dom.caches.enabled", true],
]}, runTest);
};
diff --git a/dom/workers/test/serviceworkers/test_https_origin_after_redirect_cached.html b/dom/workers/test/serviceworkers/test_https_origin_after_redirect_cached.html
index ba2801c1b87..81a1d1da0e5 100644
--- a/dom/workers/test/serviceworkers/test_https_origin_after_redirect_cached.html
+++ b/dom/workers/test/serviceworkers/test_https_origin_after_redirect_cached.html
@@ -48,7 +48,6 @@
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
- ['dom.serviceWorkers.interception.enabled', true],
["dom.caches.enabled", true],
]}, runTest);
};
diff --git a/dom/workers/test/serviceworkers/test_https_synth_fetch_from_cached_sw.html b/dom/workers/test/serviceworkers/test_https_synth_fetch_from_cached_sw.html
index 100ec57fea9..a968ac1a8ee 100644
--- a/dom/workers/test/serviceworkers/test_https_synth_fetch_from_cached_sw.html
+++ b/dom/workers/test/serviceworkers/test_https_synth_fetch_from_cached_sw.html
@@ -58,7 +58,6 @@
onload = function() {
SpecialPowers.pushPrefEnv({"set": [
["dom.serviceWorkers.exemptFromPerDomainMax", true],
- ["dom.serviceWorkers.interception.enabled", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
["dom.caches.enabled", true]
diff --git a/dom/workers/test/serviceworkers/test_imagecache.html b/dom/workers/test/serviceworkers/test_imagecache.html
index 319b4edcfd3..8627b54af71 100644
--- a/dom/workers/test/serviceworkers/test_imagecache.html
+++ b/dom/workers/test/serviceworkers/test_imagecache.html
@@ -45,7 +45,6 @@
onload = function() {
SpecialPowers.pushPrefEnv({"set": [
["dom.serviceWorkers.exemptFromPerDomainMax", true],
- ["dom.serviceWorkers.interception.enabled", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
]}, runTest);
diff --git a/dom/workers/test/serviceworkers/test_imagecache_max_age.html b/dom/workers/test/serviceworkers/test_imagecache_max_age.html
index 63c8e48319c..eb3c1f1668d 100644
--- a/dom/workers/test/serviceworkers/test_imagecache_max_age.html
+++ b/dom/workers/test/serviceworkers/test_imagecache_max_age.html
@@ -63,7 +63,6 @@
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
- ["dom.serviceWorkers.interception.enabled", true],
]}, runTest);
};
diff --git a/dom/workers/test/serviceworkers/test_importscript.html b/dom/workers/test/serviceworkers/test_importscript.html
index 7a363eed2a6..5d2d5b3522c 100644
--- a/dom/workers/test/serviceworkers/test_importscript.html
+++ b/dom/workers/test/serviceworkers/test_importscript.html
@@ -63,7 +63,6 @@
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [
["dom.serviceWorkers.exemptFromPerDomainMax", true],
- ["dom.serviceWorkers.interception.enabled", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true]
]}, runTest);
diff --git a/dom/workers/test/serviceworkers/test_importscript_mixedcontent.html b/dom/workers/test/serviceworkers/test_importscript_mixedcontent.html
index aa4166da7a3..a659af92baa 100644
--- a/dom/workers/test/serviceworkers/test_importscript_mixedcontent.html
+++ b/dom/workers/test/serviceworkers/test_importscript_mixedcontent.html
@@ -42,7 +42,6 @@
onload = function() {
SpecialPowers.pushPrefEnv({"set": [
["dom.serviceWorkers.exemptFromPerDomainMax", true],
- ["dom.serviceWorkers.interception.enabled", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
["security.mixed_content.block_active_content", false],
diff --git a/dom/workers/test/serviceworkers/test_install_event.html b/dom/workers/test/serviceworkers/test_install_event.html
index dc0fcbf07ad..0e59510fe74 100644
--- a/dom/workers/test/serviceworkers/test_install_event.html
+++ b/dom/workers/test/serviceworkers/test_install_event.html
@@ -134,7 +134,6 @@
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [
["dom.serviceWorkers.exemptFromPerDomainMax", true],
- ["dom.serviceWorkers.interception.enabled", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true]
]}, runTest);
diff --git a/dom/workers/test/serviceworkers/test_installation_simple.html b/dom/workers/test/serviceworkers/test_installation_simple.html
index 1806b7a4083..1b0d6c9471e 100644
--- a/dom/workers/test/serviceworkers/test_installation_simple.html
+++ b/dom/workers/test/serviceworkers/test_installation_simple.html
@@ -201,7 +201,6 @@
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [
["dom.serviceWorkers.exemptFromPerDomainMax", true],
- ["dom.serviceWorkers.interception.enabled", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
["dom.caches.testing.enabled", true],
diff --git a/dom/workers/test/serviceworkers/test_interception_featuredetect.html b/dom/workers/test/serviceworkers/test_interception_featuredetect.html
deleted file mode 100644
index 61dd04366b6..00000000000
--- a/dom/workers/test/serviceworkers/test_interception_featuredetect.html
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-
-