Date: Fri, 16 Mar 2018 13:11:16 +0000 (UTC) From: Jan Beich <jbeich@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r464679 - in head/www/waterfox: . files Message-ID: <201803161311.w2GDBGFY099839@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jbeich Date: Fri Mar 16 13:11:16 2018 New Revision: 464679 URL: https://svnweb.freebsd.org/changeset/ports/464679 Log: www/waterfox: apply more FF59 fixes Some are left for later: https://bugzilla.mozilla.org/buglist.cgi?bug_id=1431371,1429768,1297740,1432855,1442318,1422631,1426603,1373934,1416940 Added: head/www/waterfox/files/patch-bug1366357 (contents, props changed) head/www/waterfox/files/patch-bug1414768 (contents, props changed) head/www/waterfox/files/patch-bug1419166 (contents, props changed) head/www/waterfox/files/patch-bug1421963 (contents, props changed) head/www/waterfox/files/patch-bug1422643 (contents, props changed) head/www/waterfox/files/patch-bug1423173 (contents, props changed) head/www/waterfox/files/patch-bug1424261 (contents, props changed) head/www/waterfox/files/patch-bug1426002 (contents, props changed) head/www/waterfox/files/patch-bug1430511 (contents, props changed) head/www/waterfox/files/patch-bug1438425 (contents, props changed) head/www/waterfox/files/patch-bug1439396 (contents, props changed) head/www/waterfox/files/patch-bug1440717 (contents, props changed) head/www/waterfox/files/patch-bug1443865 (contents, props changed) head/www/waterfox/files/patch-bug1446062 (contents, props changed) Modified: head/www/waterfox/Makefile (contents, props changed) head/www/waterfox/files/patch-bug1425780 (contents, props changed) Modified: head/www/waterfox/Makefile ============================================================================== --- head/www/waterfox/Makefile Fri Mar 16 12:46:02 2018 (r464678) +++ head/www/waterfox/Makefile Fri Mar 16 13:11:16 2018 (r464679) @@ -3,7 +3,7 @@ PORTNAME= waterfox DISTVERSION= 56.0.4-36 DISTVERSIONSUFFIX= -g79492ecca478 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= www ipv6 MAINTAINER= jbeich@FreeBSD.org Added: head/www/waterfox/files/patch-bug1366357 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/waterfox/files/patch-bug1366357 Fri Mar 16 13:11:16 2018 (r464679) @@ -0,0 +1,141 @@ +commit 15353262e8f3 +Author: Johann Hofmann <jhofmann@mozilla.com> +Date: Tue Jun 13 12:10:39 2017 +0200 + + Bug 1366357 - Use origin instead of documentURI for WebRTC permission requests. r=florian + + MozReview-Commit-ID: IkccA65Ma3a + + --HG-- + extra : rebase_source : 9c1f2c895949b1dae617b0c2a1039a5494cd8b2a +--- + .../test/popupNotifications/browser_displayURI.js | 79 ++++++++++++++++++---- + browser/modules/ContentWebRTC.jsm | 1 + + browser/modules/webrtcUI.jsm | 8 ++- + 3 files changed, 73 insertions(+), 15 deletions(-) + +diff --git browser/base/content/test/popupNotifications/browser_displayURI.js browser/base/content/test/popupNotifications/browser_displayURI.js +index 10a8199dab54..df2bfb54fe25 100644 +--- browser/base/content/test/popupNotifications/browser_displayURI.js ++++ browser/base/content/test/popupNotifications/browser_displayURI.js +@@ -1,19 +1,11 @@ + /* +- * Make sure that the origin is shown for ContentPermissionPrompt +- * consumers e.g. geolocation. +-*/ +- +-add_task(async function test_displayURI() { +- await BrowserTestUtils.withNewTab({ +- gBrowser, +- url: "https://test1.example.com/", +- }, async function(browser) { ++ * Make sure that the correct origin is shown for permission prompts. ++ */ ++ ++async function check(contentTask) { ++ await BrowserTestUtils.withNewTab("https://test1.example.com/", async function(browser) { + let popupShownPromise = waitForNotificationPanel(); +- await ContentTask.spawn(browser, null, async function() { +- content.navigator.geolocation.getCurrentPosition(function(pos) { +- // Do nothing +- }); +- }); ++ await ContentTask.spawn(browser, null, contentTask); + let panel = await popupShownPromise; + let notification = panel.children[0]; + let body = document.getAnonymousElementByAttribute(notification, +@@ -21,4 +13,63 @@ add_task(async function test_displayURI() { + "popup-notification-body"); + ok(body.innerHTML.includes("example.com"), "Check that at least the eTLD+1 is present in the markup"); + }); ++ ++ let channel = NetUtil.newChannel({ ++ uri: getRootDirectory(gTestPath), ++ loadUsingSystemPrincipal: true, ++ }); ++ channel = channel.QueryInterface(Ci.nsIFileChannel); ++ ++ return BrowserTestUtils.withNewTab(channel.file.path, async function(browser) { ++ let popupShownPromise = waitForNotificationPanel(); ++ await ContentTask.spawn(browser, null, contentTask); ++ let panel = await popupShownPromise; ++ let notification = panel.children[0]; ++ let body = document.getAnonymousElementByAttribute(notification, ++ "class", ++ "popup-notification-body"); ++ if (notification.id == "geolocation-notification") { ++ ok(body.innerHTML.includes("local file"), `file:// URIs should be displayed as local file.`); ++ } else { ++ ok(body.innerHTML.includes("Unknown origin"), "file:// URIs should be displayed as unknown origin."); ++ } ++ }); ++} ++ ++add_task(async function setup() { ++ await SpecialPowers.pushPrefEnv({set: [ ++ ["media.navigator.permission.fake", true], ++ ["media.navigator.permission.force", true], ++ ]}); + }); ++ ++add_task(async function test_displayURI_geo() { ++ await check(async function() { ++ content.navigator.geolocation.getCurrentPosition(() => {}); ++ }); ++}); ++ ++add_task(async function test_displayURI_camera() { ++ await check(async function() { ++ content.navigator.mediaDevices.getUserMedia({video: true, fake: true}); ++ }); ++}); ++ ++add_task(async function test_displayURI_geo_blob() { ++ await check(async function() { ++ let text = "<script>navigator.geolocation.getCurrentPosition(() => {})</script>"; ++ let blob = new Blob([text], {type: "text/html"}); ++ let url = content.URL.createObjectURL(blob); ++ content.location.href = url; ++ }); ++}); ++ ++add_task(async function test_displayURI_camera_blob() { ++ await check(async function() { ++ let text = "<script>navigator.mediaDevices.getUserMedia({video: true, fake: true})</script>"; ++ let blob = new Blob([text], {type: "text/html"}); ++ let url = content.URL.createObjectURL(blob); ++ content.location.href = url; ++ }); ++}); ++ +diff --git browser/modules/ContentWebRTC.jsm browser/modules/ContentWebRTC.jsm +index f717f6abbc0a..1cbe0832cba1 100644 +--- browser/modules/ContentWebRTC.jsm ++++ browser/modules/ContentWebRTC.jsm +@@ -216,6 +216,7 @@ function prompt(aContentWindow, aWindowID, aCallID, aConstraints, aDevices, aSec + let request = { + callID: aCallID, + windowID: aWindowID, ++ origin: aContentWindow.origin, + documentURI: aContentWindow.document.documentURI, + secure: aSecure, + requestTypes, +diff --git browser/modules/webrtcUI.jsm browser/modules/webrtcUI.jsm +index 6bc97eb7305c..3efdf946352b 100644 +--- browser/modules/webrtcUI.jsm ++++ browser/modules/webrtcUI.jsm +@@ -368,7 +368,13 @@ function prompt(aBrowser, aRequest) { + aBrowser.dispatchEvent(new aBrowser.ownerGlobal + .CustomEvent("PermissionStateChange")); + +- let uri = Services.io.newURI(aRequest.documentURI); ++ let uri; ++ try { ++ // This fails for principals that serialize to "null", e.g. file URIs. ++ uri = Services.io.newURI(aRequest.origin); ++ } catch (e) { ++ uri = Services.io.newURI(aRequest.documentURI); ++ } + let host = getHost(uri); + let chromeDoc = aBrowser.ownerDocument; + let stringBundle = chromeDoc.defaultView.gNavigatorBundle; Added: head/www/waterfox/files/patch-bug1414768 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/waterfox/files/patch-bug1414768 Fri Mar 16 13:11:16 2018 (r464679) @@ -0,0 +1,325 @@ +commit cb494b100bfb +Author: Jason Orendorff <jorendorff@mozilla.com> +Date: Tue Nov 7 16:59:00 2017 -0600 + + Bug 1414768 - Handle same-compartment wrappers in TypedArray methods. r=bz + + CallTypedArrayMethodIfWrapped (and the CallNonGeneric machinery throughout + the engine) unwraps the `this` argument, but the other arguments are only + rewrapped for the target compartment. + + The pattern being used before this patch to get the length of a TypedArray + or possible TypedArray wrapper is: + + callFunction(CallTypedArrayMethodIfWrapped, O, O, "TypedArrayLength") + + The first O is the `this` value and the second is an argument. + If O is a cross-compartment wrapper, this works fine. The first O is unwrapped, + revealing the actual TypedArray object; the second O is rewrapped for that + TypedArray's compartment, producing the same TypedArray. + + However, if O is a same-compartment wrapper, this doesn't work. The first O + is unwrapped, revealing the actual TypedArray object in the same compartment; + rewrapping the other O does nothing to it, since it is already an object in the + target compartment. Thus TypedArrayLength receives a `this` value that's an + unwrapped TypedArray, but an argument that is still a wrapper. + + The fix is to have CallTypedArrayMethodIfWrapped targets only expect `this` + to be an unwrapped TypedArray. + + --HG-- + extra : rebase_source : 468453beebc9e48dcbc63162f400069a11f413b9 +--- + js/src/builtin/TypedArray.js | 73 ++++++++++------------ + .../jit-test/tests/proxy/testWrapWithProtoIter.js | 1 + + .../tests/proxy/testWrapWithProtoTypedArray.js | 19 ++++++ + 3 files changed, 54 insertions(+), 39 deletions(-) + +diff --git js/src/builtin/TypedArray.js js/src/builtin/TypedArray.js +index 0ee07634822d..8e29657f167e 100644 +--- js/src/builtin/TypedArray.js ++++ js/src/builtin/TypedArray.js +@@ -33,6 +33,10 @@ function IsDetachedBuffer(buffer) { + return (flags & JS_ARRAYBUFFER_DETACHED_FLAG) !== 0; + } + ++function TypedArrayLengthMethod() { ++ return TypedArrayLength(this); ++} ++ + function GetAttachedArrayBuffer(tarray) { + var buffer = ViewedArrayBufferIfReified(tarray); + if (IsDetachedBuffer(buffer)) +@@ -40,6 +44,10 @@ function GetAttachedArrayBuffer(tarray) { + return buffer; + } + ++function GetAttachedArrayBufferMethod() { ++ return GetAttachedArrayBuffer(this); ++} ++ + // A function which ensures that the argument is either a typed array or a + // cross-compartment wrapper for a typed array and that the typed array involved + // has an attached array buffer. If one of those conditions doesn't hold (wrong +@@ -52,10 +60,7 @@ function IsTypedArrayEnsuringArrayBuffer(arg) { + return true; + } + +- // This is a bit hacky but gets the job done: the first `arg` is used to +- // test for a wrapped typed array, the second as an argument to +- // GetAttachedArrayBuffer. +- callFunction(CallTypedArrayMethodIfWrapped, arg, arg, "GetAttachedArrayBuffer"); ++ callFunction(CallTypedArrayMethodIfWrapped, arg, "GetAttachedArrayBufferMethod"); + return false; + } + +@@ -96,8 +101,8 @@ function TypedArrayCreateWithLength(constructor, length) { + if (isTypedArray) { + len = TypedArrayLength(newTypedArray); + } else { +- len = callFunction(CallTypedArrayMethodIfWrapped, newTypedArray, newTypedArray, +- "TypedArrayLength"); ++ len = callFunction(CallTypedArrayMethodIfWrapped, newTypedArray, ++ "TypedArrayLengthMethod"); + } + + if (len < length) +@@ -257,15 +262,14 @@ function TypedArrayEvery(callbackfn/*, thisArg*/) { + // We want to make sure that we have an attached buffer, per spec prose. + var isTypedArray = IsTypedArrayEnsuringArrayBuffer(O); + +- // If we got here, `this` is either a typed array or a cross-compartment +- // wrapper for one. ++ // If we got here, `this` is either a typed array or a wrapper for one. + + // Steps 3-5. + var len; + if (isTypedArray) + len = TypedArrayLength(O); + else +- len = callFunction(CallTypedArrayMethodIfWrapped, O, O, "TypedArrayLength"); ++ len = callFunction(CallTypedArrayMethodIfWrapped, O, "TypedArrayLengthMethod"); + + // Step 6. + if (arguments.length === 0) +@@ -361,15 +365,14 @@ function TypedArrayFilter(callbackfn/*, thisArg*/) { + // We want to make sure that we have an attached buffer, per spec prose. + var isTypedArray = IsTypedArrayEnsuringArrayBuffer(O); + +- // If we got here, `this` is either a typed array or a cross-compartment +- // wrapper for one. ++ // If we got here, `this` is either a typed array or a wrapper for one. + + // Step 3. + var len; + if (isTypedArray) + len = TypedArrayLength(O); + else +- len = callFunction(CallTypedArrayMethodIfWrapped, O, O, "TypedArrayLength"); ++ len = callFunction(CallTypedArrayMethodIfWrapped, O, "TypedArrayLengthMethod"); + + // Step 4. + if (arguments.length === 0) +@@ -423,15 +426,14 @@ function TypedArrayFind(predicate/*, thisArg*/) { + // We want to make sure that we have an attached buffer, per spec prose. + var isTypedArray = IsTypedArrayEnsuringArrayBuffer(O); + +- // If we got here, `this` is either a typed array or a cross-compartment +- // wrapper for one. ++ // If we got here, `this` is either a typed array or a wrapper for one. + + // Steps 3-5. + var len; + if (isTypedArray) + len = TypedArrayLength(O); + else +- len = callFunction(CallTypedArrayMethodIfWrapped, O, O, "TypedArrayLength"); ++ len = callFunction(CallTypedArrayMethodIfWrapped, O, "TypedArrayLengthMethod"); + + // Step 6. + if (arguments.length === 0) +@@ -465,15 +467,14 @@ function TypedArrayFindIndex(predicate/*, thisArg*/) { + // We want to make sure that we have an attached buffer, per spec prose. + var isTypedArray = IsTypedArrayEnsuringArrayBuffer(O); + +- // If we got here, `this` is either a typed array or a cross-compartment +- // wrapper for one. ++ // If we got here, `this` is either a typed array or a wrapper for one. + + // Steps 3-5. + var len; + if (isTypedArray) + len = TypedArrayLength(O); + else +- len = callFunction(CallTypedArrayMethodIfWrapped, O, O, "TypedArrayLength"); ++ len = callFunction(CallTypedArrayMethodIfWrapped, O, "TypedArrayLengthMethod"); + + // Step 6. + if (arguments.length === 0) +@@ -505,15 +506,14 @@ function TypedArrayForEach(callbackfn/*, thisArg*/) { + // We want to make sure that we have an attached buffer, per spec prose. + var isTypedArray = IsTypedArrayEnsuringArrayBuffer(O); + +- // If we got here, `this` is either a typed array or a cross-compartment +- // wrapper for one. ++ // If we got here, `this` is either a typed array or a wrapper for one. + + // Step 3-4. + var len; + if (isTypedArray) + len = TypedArrayLength(O); + else +- len = callFunction(CallTypedArrayMethodIfWrapped, O, O, "TypedArrayLength"); ++ len = callFunction(CallTypedArrayMethodIfWrapped, O, "TypedArrayLengthMethod"); + + // Step 5. + if (arguments.length === 0) +@@ -703,15 +703,14 @@ function TypedArrayMap(callbackfn/*, thisArg*/) { + // We want to make sure that we have an attached buffer, per spec prose. + var isTypedArray = IsTypedArrayEnsuringArrayBuffer(O); + +- // If we got here, `this` is either a typed array or a cross-compartment +- // wrapper for one. ++ // If we got here, `this` is either a typed array or a wrapper for one. + + // Step 3. + var len; + if (isTypedArray) + len = TypedArrayLength(O); + else +- len = callFunction(CallTypedArrayMethodIfWrapped, O, O, "TypedArrayLength"); ++ len = callFunction(CallTypedArrayMethodIfWrapped, O, "TypedArrayLengthMethod"); + + // Step 4. + if (arguments.length === 0) +@@ -747,15 +746,14 @@ function TypedArrayReduce(callbackfn/*, initialValue*/) { + // We want to make sure that we have an attached buffer, per spec prose. + var isTypedArray = IsTypedArrayEnsuringArrayBuffer(O); + +- // If we got here, `this` is either a typed array or a cross-compartment +- // wrapper for one. ++ // If we got here, `this` is either a typed array or a wrapper for one. + + // Steps 3-5. + var len; + if (isTypedArray) + len = TypedArrayLength(O); + else +- len = callFunction(CallTypedArrayMethodIfWrapped, O, O, "TypedArrayLength"); ++ len = callFunction(CallTypedArrayMethodIfWrapped, O, "TypedArrayLengthMethod"); + + // Step 6. + if (arguments.length === 0) +@@ -793,15 +791,14 @@ function TypedArrayReduceRight(callbackfn/*, initialValue*/) { + // We want to make sure that we have an attached buffer, per spec prose. + var isTypedArray = IsTypedArrayEnsuringArrayBuffer(O); + +- // If we got here, `this` is either a typed array or a cross-compartment +- // wrapper for one. ++ // If we got here, `this` is either a typed array or a wrapper for one. + + // Steps 3-5. + var len; + if (isTypedArray) + len = TypedArrayLength(O); + else +- len = callFunction(CallTypedArrayMethodIfWrapped, O, O, "TypedArrayLength"); ++ len = callFunction(CallTypedArrayMethodIfWrapped, O, "TypedArrayLengthMethod"); + + // Step 6. + if (arguments.length === 0) +@@ -1066,15 +1063,14 @@ function TypedArraySome(callbackfn/*, thisArg*/) { + // We want to make sure that we have an attached buffer, per spec prose. + var isTypedArray = IsTypedArrayEnsuringArrayBuffer(O); + +- // If we got here, `this` is either a typed array or a cross-compartment +- // wrapper for one. ++ // If we got here, `this` is either a typed array or a wrapper for one. + + // Steps 3-5. + var len; + if (isTypedArray) + len = TypedArrayLength(O); + else +- len = callFunction(CallTypedArrayMethodIfWrapped, O, O, "TypedArrayLength"); ++ len = callFunction(CallTypedArrayMethodIfWrapped, O, "TypedArrayLengthMethod"); + + // Step 6. + if (arguments.length === 0) +@@ -1176,7 +1172,7 @@ function TypedArraySort(comparefn) { + if (isTypedArray) { + buffer = GetAttachedArrayBuffer(obj); + } else { +- buffer = callFunction(CallTypedArrayMethodIfWrapped, obj, obj, "GetAttachedArrayBuffer"); ++ buffer = callFunction(CallTypedArrayMethodIfWrapped, obj, "GetAttachedArrayBufferMethod"); + } + + // Step 4. +@@ -1184,7 +1180,7 @@ function TypedArraySort(comparefn) { + if (isTypedArray) { + len = TypedArrayLength(obj); + } else { +- len = callFunction(CallTypedArrayMethodIfWrapped, obj, obj, "TypedArrayLength"); ++ len = callFunction(CallTypedArrayMethodIfWrapped, obj, "TypedArrayLengthMethod"); + } + + // Arrays with less than two elements remain unchanged when sorted. +@@ -1221,7 +1217,7 @@ function TypedArraySort(comparefn) { + if (isTypedArray) { + length = TypedArrayLength(obj); + } else { +- length = callFunction(CallTypedArrayMethodIfWrapped, obj, obj, "TypedArrayLength"); ++ length = callFunction(CallTypedArrayMethodIfWrapped, obj, "TypedArrayLengthMethod"); + } + + // It's faster for us to check the typed array's length than to check +@@ -1253,15 +1249,14 @@ function TypedArrayToLocaleString(locales = undefined, options = undefined) { + // We want to make sure that we have an attached buffer, per spec prose. + var isTypedArray = IsTypedArrayEnsuringArrayBuffer(array); + +- // If we got here, `this` is either a typed array or a cross-compartment +- // wrapper for one. ++ // If we got here, `this` is either a typed array or a wrapper for one. + + // Step 2. + var len; + if (isTypedArray) + len = TypedArrayLength(array); + else +- len = callFunction(CallTypedArrayMethodIfWrapped, array, array, "TypedArrayLength"); ++ len = callFunction(CallTypedArrayMethodIfWrapped, array, "TypedArrayLengthMethod"); + + // Step 4. + if (len === 0) +diff --git js/src/jit-test/tests/proxy/testWrapWithProtoIter.js js/src/jit-test/tests/proxy/testWrapWithProtoIter.js +new file mode 100644 +index 000000000000..c6854b206786 +--- /dev/null ++++ js/src/jit-test/tests/proxy/testWrapWithProtoIter.js +@@ -0,0 +1 @@ ++[...wrapWithProto(new Int8Array(), new Int8Array())] +diff --git js/src/jit-test/tests/proxy/testWrapWithProtoTypedArray.js js/src/jit-test/tests/proxy/testWrapWithProtoTypedArray.js +new file mode 100644 +index 000000000000..1b805d30a119 +--- /dev/null ++++ js/src/jit-test/tests/proxy/testWrapWithProtoTypedArray.js +@@ -0,0 +1,19 @@ ++let a = wrapWithProto(new Int8Array([1, 3, 5, 6, 9]), new Int8Array()); ++ ++assertEq([...a].toString(), "1,3,5,6,9"); ++assertEq(a.every(e => e < 100), true); ++assertEq(a.filter(e => e % 2 == 1).toString(), "1,3,5,9"); ++assertEq(a.find(e => e > 3), 5); ++assertEq(a.findIndex(e => e % 2 == 0), 3); ++assertEq(a.map(e => e * 10).toString(), "10,30,50,60,90"); ++assertEq(a.reduce((a, b) => a + b, ""), "13569"); ++assertEq(a.reduceRight((acc, e) => "(" + e + acc + ")", ""), "(1(3(5(6(9)))))"); ++assertEq(a.some(e => e % 2 == 0), true); ++ ++let s = ""; ++assertEq(a.forEach(e => s += e), undefined); ++assertEq(s, "13569"); ++ ++a.sort((a, b) => b - a); ++assertEq(a.toString(), "9,6,5,3,1"); ++ Added: head/www/waterfox/files/patch-bug1419166 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/waterfox/files/patch-bug1419166 Fri Mar 16 13:11:16 2018 (r464679) @@ -0,0 +1,144 @@ +commit 2b3039c02109 +Author: Andrea Marchesini <amarchesini@mozilla.com> +Date: Mon Nov 27 17:07:39 2017 +0100 + + Bug 1419166 - Use nsIPrincipal to decide if a SharedWorker should be shared, r=bkelly +--- + dom/workers/RuntimeService.cpp | 80 +++++++++++++++++------------------------- + dom/workers/RuntimeService.h | 2 +- + 2 files changed, 33 insertions(+), 49 deletions(-) + +diff --git dom/workers/RuntimeService.cpp dom/workers/RuntimeService.cpp +index 452f623aef2d..8e34fb398e10 100644 +--- dom/workers/RuntimeService.cpp ++++ dom/workers/RuntimeService.cpp +@@ -253,26 +253,6 @@ GetWorkerPref(const nsACString& aPref, + return result; + } + +-// This fn creates a key for a SharedWorker that contains the name, script +-// spec, and the serialized origin attributes: +-// "name|scriptSpec^key1=val1&key2=val2&key3=val3" +-void +-GenerateSharedWorkerKey(const nsACString& aScriptSpec, +- const nsAString& aName, +- const OriginAttributes& aAttrs, +- nsCString& aKey) +-{ +- nsAutoCString suffix; +- aAttrs.CreateSuffix(suffix); +- +- aKey.Truncate(); +- aKey.SetCapacity(aName.Length() + aScriptSpec.Length() + suffix.Length() + 2); +- aKey.Append(NS_ConvertUTF16toUTF8(aName)); +- aKey.Append('|'); +- aKey.Append(aScriptSpec); +- aKey.Append(suffix); +-} +- + void + LoadContextOptions(const char* aPrefName, void* /* aClosure */) + { +@@ -1602,16 +1582,23 @@ RuntimeService::RegisterWorker(WorkerPrivate* aWorkerPrivate) + } + + if (isSharedWorker) { +- const nsString& sharedWorkerName(aWorkerPrivate->WorkerName()); +- nsAutoCString key; +- GenerateSharedWorkerKey(sharedWorkerScriptSpec, sharedWorkerName, +- aWorkerPrivate->GetOriginAttributes(), key); +- MOZ_ASSERT(!domainInfo->mSharedWorkerInfos.Get(key)); ++#ifdef DEBUG ++ for (const UniquePtr<SharedWorkerInfo>& data : domainInfo->mSharedWorkerInfos) { ++ if (data->mScriptSpec == sharedWorkerScriptSpec && ++ data->mName == aWorkerPrivate->WorkerName() && ++ // We want to be sure that the window's principal subsumes the ++ // SharedWorker's principal and vice versa. ++ data->mWorkerPrivate->GetPrincipal()->Subsumes(aWorkerPrivate->GetPrincipal()) && ++ aWorkerPrivate->GetPrincipal()->Subsumes(data->mWorkerPrivate->GetPrincipal())) { ++ MOZ_CRASH("We should not instantiate a new SharedWorker!"); ++ } ++ } ++#endif + +- SharedWorkerInfo* sharedWorkerInfo = ++ UniquePtr<SharedWorkerInfo> sharedWorkerInfo( + new SharedWorkerInfo(aWorkerPrivate, sharedWorkerScriptSpec, +- sharedWorkerName); +- domainInfo->mSharedWorkerInfos.Put(key, sharedWorkerInfo); ++ aWorkerPrivate->WorkerName())); ++ domainInfo->mSharedWorkerInfos.AppendElement(Move(sharedWorkerInfo)); + } + } + +@@ -1671,18 +1658,11 @@ void + RuntimeService::RemoveSharedWorker(WorkerDomainInfo* aDomainInfo, + WorkerPrivate* aWorkerPrivate) + { +- for (auto iter = aDomainInfo->mSharedWorkerInfos.Iter(); +- !iter.Done(); +- iter.Next()) { +- SharedWorkerInfo* data = iter.UserData(); ++ for (uint32_t i = 0; i < aDomainInfo->mSharedWorkerInfos.Length(); ++i) { ++ const UniquePtr<SharedWorkerInfo>& data = ++ aDomainInfo->mSharedWorkerInfos[i]; + if (data->mWorkerPrivate == aWorkerPrivate) { +-#ifdef DEBUG +- nsAutoCString key; +- GenerateSharedWorkerKey(data->mScriptSpec, data->mName, +- aWorkerPrivate->GetOriginAttributes(), key); +- MOZ_ASSERT(iter.Key() == key); +-#endif +- iter.Remove(); ++ aDomainInfo->mSharedWorkerInfos.RemoveElementAt(i); + break; + } + } +@@ -2499,21 +2479,25 @@ RuntimeService::CreateSharedWorkerFromLoadInfo(JSContext* aCx, + { + MutexAutoLock lock(mMutex); + +- WorkerDomainInfo* domainInfo; +- SharedWorkerInfo* sharedWorkerInfo; +- + nsCString scriptSpec; + nsresult rv = aLoadInfo->mResolvedScriptURI->GetSpec(scriptSpec); + NS_ENSURE_SUCCESS(rv, rv); + + MOZ_ASSERT(aLoadInfo->mPrincipal); +- nsAutoCString key; +- GenerateSharedWorkerKey(scriptSpec, aName, +- aLoadInfo->mPrincipal->OriginAttributesRef(), key); + +- if (mDomainMap.Get(aLoadInfo->mDomain, &domainInfo) && +- domainInfo->mSharedWorkerInfos.Get(key, &sharedWorkerInfo)) { +- workerPrivate = sharedWorkerInfo->mWorkerPrivate; ++ WorkerDomainInfo* domainInfo; ++ if (mDomainMap.Get(aLoadInfo->mDomain, &domainInfo)) { ++ for (const UniquePtr<SharedWorkerInfo>& data : domainInfo->mSharedWorkerInfos) { ++ if (data->mScriptSpec == scriptSpec && ++ data->mName == aName && ++ // We want to be sure that the window's principal subsumes the ++ // SharedWorker's principal and vice versa. ++ aLoadInfo->mPrincipal->Subsumes(data->mWorkerPrivate->GetPrincipal()) && ++ data->mWorkerPrivate->GetPrincipal()->Subsumes(aLoadInfo->mPrincipal)) { ++ workerPrivate = data->mWorkerPrivate; ++ break; ++ } ++ } + } + } + +diff --git dom/workers/RuntimeService.h dom/workers/RuntimeService.h +index f7334896cd4c..45c8642adc85 100644 +--- dom/workers/RuntimeService.h ++++ dom/workers/RuntimeService.h +@@ -45,7 +45,7 @@ class RuntimeService final : public nsIObserver + nsTArray<WorkerPrivate*> mActiveWorkers; + nsTArray<WorkerPrivate*> mActiveServiceWorkers; + nsTArray<WorkerPrivate*> mQueuedWorkers; +- nsClassHashtable<nsCStringHashKey, SharedWorkerInfo> mSharedWorkerInfos; ++ nsTArray<UniquePtr<SharedWorkerInfo>> mSharedWorkerInfos; + uint32_t mChildWorkerCount; + + WorkerDomainInfo() Added: head/www/waterfox/files/patch-bug1421963 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/waterfox/files/patch-bug1421963 Fri Mar 16 13:11:16 2018 (r464679) @@ -0,0 +1,39 @@ +commit edbe55cb9057 +Author: Randell Jesup <rjesup@jesup.org> +Date: Thu Dec 7 13:24:46 2017 -0500 + + Bug 1421963: lock around SCTP input processing, not just the receive callback r=drno +--- + netwerk/sctp/datachannel/DataChannel.cpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git netwerk/sctp/datachannel/DataChannel.cpp netwerk/sctp/datachannel/DataChannel.cpp +index 4a0432469a80..6f13826ed7c6 100644 +--- netwerk/sctp/datachannel/DataChannel.cpp ++++ netwerk/sctp/datachannel/DataChannel.cpp +@@ -817,6 +817,7 @@ DataChannelConnection::SctpDtlsInput(TransportFlow *flow, + } + } + // Pass the data to SCTP ++ MutexAutoLock lock(mLock); + usrsctp_conninput(static_cast<void *>(this), data, len, 0); + } + +@@ -1224,7 +1225,7 @@ DataChannelConnection::SendDeferredMessages() + RefPtr<DataChannel> channel; // we may null out the refs to this + + // This may block while something is modifying channels, but should not block for IO +- MutexAutoLock lock(mLock); ++ mLock.AssertCurrentThreadOwns(); + + LOG(("SendDeferredMessages called, pending type: %d", mPendingType)); + if (!mPendingType) { +@@ -2307,7 +2308,7 @@ DataChannelConnection::ReceiveCallback(struct socket* sock, void *data, size_t d + if (!data) { + usrsctp_close(sock); // SCTP has finished shutting down + } else { +- MutexAutoLock lock(mLock); ++ mLock.AssertCurrentThreadOwns(); + if (flags & MSG_NOTIFICATION) { + HandleNotification(static_cast<union sctp_notification *>(data), datalen); + } else { Added: head/www/waterfox/files/patch-bug1422643 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/waterfox/files/patch-bug1422643 Fri Mar 16 13:11:16 2018 (r464679) @@ -0,0 +1,80 @@ +commit dd719e911e2c +Author: Gijs Kruitbosch <gijskruitbosch@gmail.com> +Date: Wed Dec 20 18:57:48 2017 +0000 + + Bug 1422643 - deal with tabs in the protocol in js paste detection code, r=florian,valentin + + MozReview-Commit-ID: Ax5LGkIedkY + + --HG-- + extra : rebase_source : 85a9871a4de44652fe3bbfd455af389fe27d7714 + extra : source : 6ad5ec88a8982d83b8097fd76a2383aae94711c6 +--- + browser/base/content/browser.js | 20 ++++++++++++-------- + .../browser_removeUnsafeProtocolsFromURLBarPaste.js | 15 +++++++++++++++ + 2 files changed, 27 insertions(+), 8 deletions(-) + +diff --git browser/base/content/browser.js browser/base/content/browser.js +index e6e60cd202a0..5306800ebaca 100755 +--- browser/base/content/browser.js ++++ browser/base/content/browser.js +@@ -6053,14 +6053,18 @@ function middleMousePaste(event) { + function stripUnsafeProtocolOnPaste(pasteData) { + // Don't allow pasting javascript URIs since we don't support + // LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL for those. +- let changed = false; +- let pasteDataNoJS = pasteData.replace(/\r?\n/g, "") +- .replace(/^(?:\W*javascript:)+/i, +- () => { +- changed = true; +- return ""; +- }); +- return changed ? pasteDataNoJS : pasteData; ++ while (true) { ++ let scheme = ""; ++ try { ++ scheme = Services.io.extractScheme(pasteData); ++ } catch (ex) { } ++ if (scheme != "javascript") { ++ break; ++ } ++ ++ pasteData = pasteData.substring(pasteData.indexOf(":") + 1); ++ } ++ return pasteData; + } + + // handleDroppedLink has the following 2 overloads: +diff --git browser/base/content/test/urlbar/browser_removeUnsafeProtocolsFromURLBarPaste.js browser/base/content/test/urlbar/browser_removeUnsafeProtocolsFromURLBarPaste.js +index 27129297b0a3..70ecaa048626 100644 +--- browser/base/content/test/urlbar/browser_removeUnsafeProtocolsFromURLBarPaste.js ++++ browser/base/content/test/urlbar/browser_removeUnsafeProtocolsFromURLBarPaste.js +@@ -9,6 +9,7 @@ var pairs = [ + ["javascript:document.domain", "document.domain"], + [" \u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u0009javascript:document.domain", "document.domain"], + ["java\nscript:foo", "foo"], ++ ["java\tscript:foo", "foo"], + ["http://\nexample.com", "http://example.com"], + ["http://\nexample.com\n", "http://example.com"], + ["data:text/html,<body>hi</body>", "data:text/html,<body>hi</body>"], +@@ -20,6 +21,20 @@ var pairs = [ + ["data:data:text/html,javascript:alert('hi!')", "data:data:text/html,javascript:alert('hi!')"], + ]; + ++let supportsNullBytes = AppConstants.platform == "macosx"; ++// Note that \u000d (\r) is missing here; we test it separately because it ++// makes the test sad on Windows. ++let gobbledygook = "\u000a\u000b\u000c\u000e\u000f\u0010\u0011\u0012\u0013\u0014javascript:foo"; ++if (supportsNullBytes) { ++ gobbledygook = "\u0000" + gobbledygook; ++} ++pairs.push([gobbledygook, "foo"]); ++ ++let supportsReturnWithoutNewline = AppConstants.platform != "win"; ++if (supportsReturnWithoutNewline) { ++ pairs.push(["java\rscript:foo", "foo"]); ++} ++ + var clipboardHelper = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper); + + function paste(input, cb) { Added: head/www/waterfox/files/patch-bug1423173 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/waterfox/files/patch-bug1423173 Fri Mar 16 13:11:16 2018 (r464679) @@ -0,0 +1,43 @@ +commit 46e3052bc347 +Author: Kannan Vijayan <kvijayan@mozilla.com> +Date: Thu Jan 4 14:36:07 2018 -0500 + + Bug 1423173 - Check for shadowing indexed properties when adding elements. r=jandem +--- + js/src/jit-test/tests/arrays/bug1423173.js | 13 +++++++++++++ + js/src/jit/CacheIR.cpp | 3 +++ + 2 files changed, 16 insertions(+) + +diff --git js/src/jit-test/tests/arrays/bug1423173.js js/src/jit-test/tests/arrays/bug1423173.js +new file mode 100644 +index 000000000000..38e584ce3655 +--- /dev/null ++++ js/src/jit-test/tests/arrays/bug1423173.js +@@ -0,0 +1,13 @@ ++// |jit-test| --baseline-eager ++Array.prototype.push(1); ++Object.freeze([].__proto__); ++var x = []; ++var c = 0; ++for (var j = 0; j < 5; ++j) { ++ try { ++ x.push(function() {}); ++ } catch (e) { ++ c++; ++ } ++} ++assertEq(c, j); +diff --git js/src/jit/CacheIR.cpp js/src/jit/CacheIR.cpp +index 507788a7c182..fa5fc6bc6f91 100644 +--- js/src/jit/CacheIR.cpp ++++ js/src/jit/CacheIR.cpp +@@ -3406,6 +3406,9 @@ CanAttachAddElement(JSObject* obj, bool isInit) + if (!proto->isNative()) + return false; + ++ if (proto->as<NativeObject>().denseElementsAreFrozen()) ++ return false; ++ + obj = proto; + } while (true); + Added: head/www/waterfox/files/patch-bug1424261 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/waterfox/files/patch-bug1424261 Fri Mar 16 13:11:16 2018 (r464679) @@ -0,0 +1,66 @@ +commit 0d38343e3589 +Author: Gijs Kruitbosch <gijskruitbosch@gmail.com> +Date: Tue Dec 12 10:53:10 2017 -0600 + + Bug 1424261, r=bz + + --HG-- + extra : rebase_source : 2bead652bbfd4cd251b431e04e3002c38c1a7a7b +--- + caps/nsScriptSecurityManager.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git caps/nsScriptSecurityManager.cpp caps/nsScriptSecurityManager.cpp +index 736eab415b8d..e557f4f1a0b7 100644 +--- caps/nsScriptSecurityManager.cpp ++++ caps/nsScriptSecurityManager.cpp +@@ -840,7 +840,7 @@ nsScriptSecurityManager::CheckLoadURIFlags(nsIURI *aSourceURI, + + // Check for chrome target URI + bool hasFlags = false; +- rv = NS_URIChainHasFlags(aTargetBaseURI, ++ rv = NS_URIChainHasFlags(aTargetURI, + nsIProtocolHandler::URI_IS_UI_RESOURCE, + &hasFlags); + NS_ENSURE_SUCCESS(rv, rv); + +commit 3c59d5240166 +Author: Gijs Kruitbosch <gijskruitbosch@gmail.com> +Date: Tue Dec 12 10:53:50 2017 -0600 + + Bug 1424261, r=valentin + + --HG-- + extra : rebase_source : 9f4c9c619dbccc2575b2a9d3e4304a54d41acad5 +--- + image/decoders/icon/nsIconURI.cpp | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git image/decoders/icon/nsIconURI.cpp image/decoders/icon/nsIconURI.cpp +index 5958bd9d1436..5f096674bd35 100644 +--- image/decoders/icon/nsIconURI.cpp ++++ image/decoders/icon/nsIconURI.cpp +@@ -218,7 +218,10 @@ nsMozIconURI::SetSpec(const nsACString& aSpec) + + nsAutoCString iconSpec(aSpec); + if (!Substring(iconSpec, 0, +- MOZICON_SCHEME_LEN).EqualsLiteral(MOZICON_SCHEME)) { ++ MOZICON_SCHEME_LEN).EqualsLiteral(MOZICON_SCHEME) || ++ (!Substring(iconSpec, MOZICON_SCHEME_LEN, 7).EqualsLiteral("file://") && ++ // Checking for the leading '//' will match both the '//stock/' and '//.foo' cases: ++ !Substring(iconSpec, MOZICON_SCHEME_LEN, 2).EqualsLiteral("//"))) { + return NS_ERROR_MALFORMED_URI; + } + +@@ -298,6 +301,11 @@ nsMozIconURI::SetSpec(const nsACString& aSpec) + ioService->NewURI(iconPath, nullptr, nullptr, getter_AddRefs(uri)); + mIconURL = do_QueryInterface(uri); + if (mIconURL) { ++ // The inner URI should be a 'file:' one. If not, bail. ++ bool isFile = false; ++ if (!NS_SUCCEEDED(mIconURL->SchemeIs("file", &isFile)) || !isFile) { ++ return NS_ERROR_MALFORMED_URI; ++ } + mFileName.Truncate(); + } else if (mFileName.IsEmpty()) { + return NS_ERROR_MALFORMED_URI; Modified: head/www/waterfox/files/patch-bug1425780 ============================================================================== --- head/www/waterfox/files/patch-bug1425780 Fri Mar 16 12:46:02 2018 (r464678) +++ head/www/waterfox/files/patch-bug1425780 Fri Mar 16 13:11:16 2018 (r464679) @@ -1,4 +1,4 @@ -commit e5fb39219394 (release/branches/default/tip, origin/release) +commit e5fb39219394 Author: Michael Froman <mfroman@mozilla.com> Date: Thu Jan 11 21:38:36 2018 -0500 Added: head/www/waterfox/files/patch-bug1426002 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/waterfox/files/patch-bug1426002 Fri Mar 16 13:11:16 2018 (r464679) @@ -0,0 +1,34 @@ +commit 7ee28da3b920 +Author: Boris Zbarsky <bzbarsky@mit.edu> +Date: Thu Dec 21 15:08:49 2017 -0500 + + Bug 1426002. Bail out of document.open if beforeunload tears things down. r=mystor + + MozReview-Commit-ID: GDozCq4Qbni +--- + dom/html/nsHTMLDocument.cpp | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git dom/html/nsHTMLDocument.cpp dom/html/nsHTMLDocument.cpp +index 5ad609c0802b..ce974748034f 100644 +--- dom/html/nsHTMLDocument.cpp ++++ dom/html/nsHTMLDocument.cpp +@@ -1598,6 +1598,18 @@ nsHTMLDocument::Open(JSContext* cx, + nsCOMPtr<nsIDocument> ret = this; + return ret.forget(); + } ++ ++ // Now double-check that our invariants still hold. ++ if (!mScriptGlobalObject) { ++ nsCOMPtr<nsIDocument> ret = this; ++ return ret.forget(); ++ } ++ ++ nsPIDOMWindowOuter* outer = GetWindow(); ++ if (!outer || (GetInnerWindow() != outer->GetCurrentInnerWindow())) { ++ nsCOMPtr<nsIDocument> ret = this; ++ return ret.forget(); ++ } + } + + nsCOMPtr<nsIWebNavigation> webnav(do_QueryInterface(shell)); Added: head/www/waterfox/files/patch-bug1430511 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/waterfox/files/patch-bug1430511 Fri Mar 16 13:11:16 2018 (r464679) @@ -0,0 +1,72 @@ +commit 2050bcb92e39 +Author: Gijs Kruitbosch <gijskruitbosch@gmail.com> +Date: Wed Jan 17 00:08:32 2018 +0000 + + Bug 1430511, r=jaws + + --HG-- + extra : rebase_source : e5ecfb98c1bbd1cd5f9a71be13416a1d041350ef +--- + browser/components/preferences/in-content/findInPage.js | 16 +++++++++++++--- + .../chrome/browser/preferences/preferences.properties | 8 +++++--- + 2 files changed, 18 insertions(+), 6 deletions(-) + +diff --git browser/base/content/test/static/browser_misused_characters_in_strings.js browser/base/content/test/static/browser_misused_characters_in_strings.js +index 9a8168bdb360..10b6796d3580 100644 +--- browser/base/content/test/static/browser_misused_characters_in_strings.js ++++ browser/base/content/test/static/browser_misused_characters_in_strings.js +@@ -110,7 +110,7 @@ let gWhitelist = [{ + type: "single-quote" + }, { + file: "preferences.properties", +- key: "searchResults.needHelp2", ++ key: "searchResults.needHelp3", + type: "double-quote" + } + ]; +diff --git browser/components/preferences/in-content-new/findInPage.js browser/components/preferences/in-content-new/findInPage.js +index a822ec04e728..d54ba7b0e355 100644 +--- browser/components/preferences/in-content-new/findInPage.js ++++ browser/components/preferences/in-content-new/findInPage.js +@@ -264,9 +264,19 @@ var gSearchResultsPane = { + strings.getFormattedString("searchResults.sorryMessageUnix", [this.query]); + let helpUrl = Services.urlFormatter.formatURLPref("app.support.baseURL") + "preferences"; + let brandName = document.getElementById("bundleBrand").getString("brandShortName"); +- // eslint-disable-next-line no-unsanitized/property +- document.getElementById("need-help").innerHTML = +- strings.getFormattedString("searchResults.needHelp2", [helpUrl, brandName]); ++ let helpString = strings.getString("searchResults.needHelp3"); ++ let helpItems = helpString.split(/%(?:\$1)?S/); ++ let helpContainer = document.getElementById("need-help"); ++ helpContainer.innerHTML = ""; ++ helpContainer.appendChild(document.createTextNode(helpItems[0])); ++ let link = document.createElement("label"); ++ link.className = "text-link"; ++ link.setAttribute("href", helpUrl); ++ link.textContent = strings.getFormattedString("searchResults.needHelpSupportLink", [brandName]); ++ helpContainer.appendChild(link); ++ if (helpItems[1]) { ++ helpContainer.appendChild(document.createTextNode(helpItems[1])); ++ } + } else { + // Creating tooltips for all the instances found + this.listSearchTooltips.forEach((anchorNode) => this.createSearchTooltip(anchorNode, this.query)); +diff --git browser/locales/en-US/chrome/browser/preferences/preferences.properties browser/locales/en-US/chrome/browser/preferences/preferences.properties +index 9066145c3c48..73410a196ebf 100644 +--- browser/locales/en-US/chrome/browser/preferences/preferences.properties ++++ browser/locales/en-US/chrome/browser/preferences/preferences.properties +@@ -263,9 +263,11 @@ searchInput.labelUnix=Find in Preferences + # LOCALIZATION NOTE %S will be replaced by the word being searched + searchResults.sorryMessageWin=Sorry! There are no results in Options for ā%Sā. + searchResults.sorryMessageUnix=Sorry! There are no results in Preferences for ā%Sā. +-# LOCALIZATION NOTE (searchResults.needHelp2): %1$S is a link to SUMO, %2$S is +-# the browser name +-searchResults.needHelp2=Need help? Visit <html:a id="need-help-link" target="_blank" href="%1$S">%2$S Support</html:a> ++# LOCALIZATION NOTE (searchResults.needHelp3): %S will be replaced with a link to the support page. ++# The label of the link is in searchResults.needHelpSupportLink . ++searchResults.needHelp3=Need help? Visit %S ++# LOCALIZATION NOTE (searchResults.needHelpSupportLink): %S will be replaced with the browser name. ++searchResults.needHelpSupportLink=%S Support + + # LOCALIZATION NOTE %S is the default value of the `dom.ipc.processCount` pref. + defaultContentProcessCount=%S (default) Added: head/www/waterfox/files/patch-bug1438425 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/waterfox/files/patch-bug1438425 Fri Mar 16 13:11:16 2018 (r464679) @@ -0,0 +1,662 @@ +commit f324bee78e24 +Author: Jeff Muizelaar <jmuizelaar@mozilla.com> +Date: Wed Mar 7 11:54:01 2018 -0500 + + Bug 1438425 - Delete DocumentRenderer. r=jesup, r=jgilbert, a=RyanVM + + It is unused. *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803161311.w2GDBGFY099839>