forked from mirrors/gecko-dev
Merge mozilla-central to autoland
--HG-- extra : rebase_source : ef48ee99e861f57c5e04f0230238ab31940e46b1
This commit is contained in:
commit
a05236937c
34 changed files with 302 additions and 194 deletions
60
dom/localstorage/test/unit/test_uri_encoding_edge_cases.js
Normal file
60
dom/localstorage/test/unit/test_uri_encoding_edge_cases.js
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
/**
|
||||||
|
* Any copyright is dedicated to the Public Domain.
|
||||||
|
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test verifies that group and origin strings for URIs with special
|
||||||
|
* characters are consistent between calling
|
||||||
|
* EnsureQuotaForOringin/EnsureOriginIsInitailized and GetQuotaObject in
|
||||||
|
* PrepareDatastoreOp, so writing to local storage won't cause a crash because
|
||||||
|
* of a null quota object. See bug 1516333.
|
||||||
|
*/
|
||||||
|
|
||||||
|
async function testSteps() {
|
||||||
|
/**
|
||||||
|
* The edge cases are specified in this array of origins. Each edge case must
|
||||||
|
* contain two properties uri and path (origin directory path relative to the
|
||||||
|
* profile directory).
|
||||||
|
*/
|
||||||
|
const origins = [
|
||||||
|
{
|
||||||
|
uri: "file:///test'.html",
|
||||||
|
path: "storage/default/file++++test'.html",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
uri: "file:///test>.html",
|
||||||
|
path: "storage/default/file++++test%3E.html",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
for (let origin of origins) {
|
||||||
|
const principal = getPrincipal(origin.uri);
|
||||||
|
|
||||||
|
let originDir = getRelativeFile(origin.path);
|
||||||
|
|
||||||
|
info("Checking the origin directory existence");
|
||||||
|
|
||||||
|
ok(!originDir.exists(),
|
||||||
|
`The origin directory ${origin.path} should not exists`);
|
||||||
|
|
||||||
|
info("Getting storage");
|
||||||
|
|
||||||
|
let storage = getLocalStorage(principal);
|
||||||
|
|
||||||
|
info("Adding item");
|
||||||
|
|
||||||
|
storage.setItem("foo", "bar");
|
||||||
|
|
||||||
|
info("Resetting origin");
|
||||||
|
|
||||||
|
// This forces any pending changes to be flushed to disk (including origin
|
||||||
|
// directory creation).
|
||||||
|
let request = resetOrigin(principal);
|
||||||
|
await requestFinished(request);
|
||||||
|
|
||||||
|
info("Checking the origin directory existence");
|
||||||
|
|
||||||
|
ok(originDir.exists(), `The origin directory ${origin.path} should exist`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -44,4 +44,5 @@ run-sequentially = this test depends on a file produced by test_databaseShadowin
|
||||||
requesttimeoutfactor = 4
|
requesttimeoutfactor = 4
|
||||||
[test_stringLength.js]
|
[test_stringLength.js]
|
||||||
[test_stringLength2.js]
|
[test_stringLength2.js]
|
||||||
|
[test_uri_encoding_edge_cases.js]
|
||||||
[test_usage.js]
|
[test_usage.js]
|
||||||
|
|
|
||||||
|
|
@ -3729,21 +3729,12 @@ already_AddRefed<QuotaObject> QuotaManager::GetQuotaObject(
|
||||||
fileSize = aFileSize;
|
fileSize = aFileSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-escape our parameters above to make sure we get the right quota group.
|
|
||||||
nsAutoCString group;
|
|
||||||
rv = NS_EscapeURL(aGroup, esc_Query, group, fallible);
|
|
||||||
NS_ENSURE_SUCCESS(rv, nullptr);
|
|
||||||
|
|
||||||
nsAutoCString origin;
|
|
||||||
rv = NS_EscapeURL(aOrigin, esc_Query, origin, fallible);
|
|
||||||
NS_ENSURE_SUCCESS(rv, nullptr);
|
|
||||||
|
|
||||||
RefPtr<QuotaObject> result;
|
RefPtr<QuotaObject> result;
|
||||||
{
|
{
|
||||||
MutexAutoLock lock(mQuotaMutex);
|
MutexAutoLock lock(mQuotaMutex);
|
||||||
|
|
||||||
GroupInfoPair* pair;
|
GroupInfoPair* pair;
|
||||||
if (!mGroupInfoPairs.Get(group, &pair)) {
|
if (!mGroupInfoPairs.Get(aGroup, &pair)) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3753,7 +3744,7 @@ already_AddRefed<QuotaObject> QuotaManager::GetQuotaObject(
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<OriginInfo> originInfo = groupInfo->LockedGetOriginInfo(origin);
|
RefPtr<OriginInfo> originInfo = groupInfo->LockedGetOriginInfo(aOrigin);
|
||||||
|
|
||||||
if (!originInfo) {
|
if (!originInfo) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
||||||
|
|
@ -233,16 +233,17 @@ bool CompositorD3D11::Initialize(nsCString* const out_failureReason) {
|
||||||
hr = dxgiFactory2->CreateSwapChainForHwnd(mDevice, mHwnd, &swapDesc,
|
hr = dxgiFactory2->CreateSwapChainForHwnd(mDevice, mHwnd, &swapDesc,
|
||||||
nullptr, nullptr,
|
nullptr, nullptr,
|
||||||
getter_AddRefs(swapChain));
|
getter_AddRefs(swapChain));
|
||||||
if (Failed(hr, "create swap chain")) {
|
if (SUCCEEDED(hr)) {
|
||||||
*out_failureReason = "FEATURE_FAILURE_D3D11_SWAP_CHAIN";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
DXGI_RGBA color = {1.0f, 1.0f, 1.0f, 1.0f};
|
DXGI_RGBA color = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||||
swapChain->SetBackgroundColor(&color);
|
swapChain->SetBackgroundColor(&color);
|
||||||
|
|
||||||
mSwapChain = swapChain;
|
mSwapChain = swapChain;
|
||||||
} else
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// In some configurations double buffering may have failed with an
|
||||||
|
// ACCESS_DENIED error.
|
||||||
|
if (!mSwapChain)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
DXGI_SWAP_CHAIN_DESC swapDesc;
|
DXGI_SWAP_CHAIN_DESC swapDesc;
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,14 @@
|
||||||
|
|
||||||
#include "nsPrintJob.h"
|
#include "nsPrintJob.h"
|
||||||
|
|
||||||
|
#include "nsDocShell.h"
|
||||||
#include "nsIStringBundle.h"
|
#include "nsIStringBundle.h"
|
||||||
#include "nsReadableUtils.h"
|
#include "nsReadableUtils.h"
|
||||||
#include "nsCRT.h"
|
#include "nsCRT.h"
|
||||||
|
|
||||||
#include "mozilla/AsyncEventDispatcher.h"
|
#include "mozilla/AsyncEventDispatcher.h"
|
||||||
#include "mozilla/ComputedStyleInlines.h"
|
#include "mozilla/ComputedStyleInlines.h"
|
||||||
|
#include "mozilla/dom/BrowsingContext.h"
|
||||||
#include "mozilla/dom/Selection.h"
|
#include "mozilla/dom/Selection.h"
|
||||||
#include "mozilla/dom/CustomEvent.h"
|
#include "mozilla/dom/CustomEvent.h"
|
||||||
#include "mozilla/dom/ScriptSettings.h"
|
#include "mozilla/dom/ScriptSettings.h"
|
||||||
|
|
@ -448,6 +450,40 @@ static void MapContentToWebShells(const UniquePtr<nsPrintObject>& aRootPO,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Recursively builds the static clone document tree.
|
||||||
|
* XXXjwatt - uh, CreateStaticClone already takes care of recursively creating
|
||||||
|
* subdocs (in-process, at least). nsPrintObject::Init creating a static clone
|
||||||
|
* for subdocs is...broken, surely.
|
||||||
|
* The outparam aDocList returns a (depth first) flat list of all the
|
||||||
|
* nsPrintObjects created.
|
||||||
|
*/
|
||||||
|
static void BuildDocTree(BrowsingContext* aBrowsingContext,
|
||||||
|
const UniquePtr<nsPrintObject>& aPO,
|
||||||
|
nsTArray<nsPrintObject*>* aDocList) {
|
||||||
|
MOZ_ASSERT(aBrowsingContext, "Pointer is null!");
|
||||||
|
MOZ_ASSERT(aDocList, "Pointer is null!");
|
||||||
|
MOZ_ASSERT(aPO, "Pointer is null!");
|
||||||
|
|
||||||
|
for (auto& childBC : aBrowsingContext->GetChildren()) {
|
||||||
|
auto window = childBC->GetDOMWindow();
|
||||||
|
if (!window) {
|
||||||
|
// XXXfission - handle OOP-iframes
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
auto childPO = MakeUnique<nsPrintObject>();
|
||||||
|
childPO->mParent = aPO.get();
|
||||||
|
nsresult rv = childPO->Init(childBC->GetDocShell(), window->GetExtantDoc(),
|
||||||
|
aPO->mPrintPreview);
|
||||||
|
if (NS_FAILED(rv)) {
|
||||||
|
MOZ_ASSERT_UNREACHABLE("Init failed?");
|
||||||
|
}
|
||||||
|
aPO->mKids.AppendElement(std::move(childPO));
|
||||||
|
aDocList->AppendElement(aPO->mKids.LastElement().get());
|
||||||
|
BuildDocTree(childBC, aPO->mKids.LastElement(), aDocList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On platforms that support it, sets the printer name stored in the
|
* On platforms that support it, sets the printer name stored in the
|
||||||
* nsIPrintSettings to the default printer if a printer name is not already
|
* nsIPrintSettings to the default printer if a printer name is not already
|
||||||
|
|
@ -815,9 +851,10 @@ nsresult nsPrintJob::DoCommonPrint(bool aIsPrintPreview,
|
||||||
printData->mPrintObject->mFrameType =
|
printData->mPrintObject->mFrameType =
|
||||||
printData->mIsParentAFrameSet ? eFrameSet : eDoc;
|
printData->mIsParentAFrameSet ? eFrameSet : eDoc;
|
||||||
|
|
||||||
// Build the "tree" of PrintObjects
|
// Builds the static clone doc tree and the "tree" of PrintObjects
|
||||||
BuildDocTree(printData->mPrintObject->mDocShell, &printData->mPrintDocList,
|
BuildDocTree(nsDocShell::Cast(printData->mPrintObject->mDocShell)
|
||||||
printData->mPrintObject);
|
->GetBrowsingContext(),
|
||||||
|
printData->mPrintObject, &printData->mPrintDocList);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The nsAutoScriptBlocker above will now have been destroyed, which may
|
// The nsAutoScriptBlocker above will now have been destroyed, which may
|
||||||
|
|
@ -1241,40 +1278,6 @@ bool nsPrintJob::IsThereARangeSelection(nsPIDOMWindowOuter* aDOMWin) {
|
||||||
return selection->GetRangeAt(0) && !selection->IsCollapsed();
|
return selection->GetRangeAt(0) && !selection->IsCollapsed();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
|
||||||
// Recursively build a list of sub documents to be printed
|
|
||||||
// that mirrors the document tree
|
|
||||||
void nsPrintJob::BuildDocTree(nsIDocShell* aParentNode,
|
|
||||||
nsTArray<nsPrintObject*>* aDocList,
|
|
||||||
const UniquePtr<nsPrintObject>& aPO) {
|
|
||||||
NS_ASSERTION(aParentNode, "Pointer is null!");
|
|
||||||
NS_ASSERTION(aDocList, "Pointer is null!");
|
|
||||||
NS_ASSERTION(aPO, "Pointer is null!");
|
|
||||||
|
|
||||||
int32_t childWebshellCount;
|
|
||||||
aParentNode->GetChildCount(&childWebshellCount);
|
|
||||||
if (childWebshellCount > 0) {
|
|
||||||
for (int32_t i = 0; i < childWebshellCount; i++) {
|
|
||||||
nsCOMPtr<nsIDocShellTreeItem> child;
|
|
||||||
aParentNode->GetChildAt(i, getter_AddRefs(child));
|
|
||||||
nsCOMPtr<nsIDocShell> childAsShell(do_QueryInterface(child));
|
|
||||||
|
|
||||||
nsCOMPtr<nsIContentViewer> viewer;
|
|
||||||
childAsShell->GetContentViewer(getter_AddRefs(viewer));
|
|
||||||
if (viewer) {
|
|
||||||
nsCOMPtr<Document> doc = do_GetInterface(childAsShell);
|
|
||||||
auto po = MakeUnique<nsPrintObject>();
|
|
||||||
po->mParent = aPO.get();
|
|
||||||
nsresult rv = po->Init(childAsShell, doc, aPO->mPrintPreview);
|
|
||||||
if (NS_FAILED(rv)) MOZ_ASSERT_UNREACHABLE("Init failed?");
|
|
||||||
aPO->mKids.AppendElement(std::move(po));
|
|
||||||
aDocList->AppendElement(aPO->mKids.LastElement().get());
|
|
||||||
BuildDocTree(childAsShell, aDocList, aPO->mKids.LastElement());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
bool nsPrintJob::IsThereAnIFrameSelected(nsIDocShell* aDocShell,
|
bool nsPrintJob::IsThereAnIFrameSelected(nsIDocShell* aDocShell,
|
||||||
nsPIDOMWindowOuter* aDOMWin,
|
nsPIDOMWindowOuter* aDOMWin,
|
||||||
|
|
@ -2704,32 +2707,21 @@ already_AddRefed<nsPIDOMWindowOuter> nsPrintJob::FindFocusedDOMWindow() const {
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
bool nsPrintJob::IsWindowsInOurSubTree(nsPIDOMWindowOuter* window) const {
|
bool nsPrintJob::IsWindowsInOurSubTree(nsPIDOMWindowOuter* window) const {
|
||||||
bool found = false;
|
|
||||||
|
|
||||||
// now check to make sure it is in "our" tree of docshells
|
|
||||||
if (window) {
|
if (window) {
|
||||||
nsCOMPtr<nsIDocShell> docShell = window->GetDocShell();
|
nsCOMPtr<nsIDocShell> ourDocShell(do_QueryReferent(mDocShell));
|
||||||
|
if (ourDocShell) {
|
||||||
if (docShell) {
|
BrowsingContext* ourBC =
|
||||||
// get this DocViewer docshell
|
nsDocShell::Cast(ourDocShell)->GetBrowsingContext();
|
||||||
nsCOMPtr<nsIDocShell> thisDVDocShell(do_QueryReferent(mDocShell));
|
BrowsingContext* bc = window->GetBrowsingContext();
|
||||||
while (!found) {
|
while (bc) {
|
||||||
if (docShell) {
|
if (bc == ourBC) {
|
||||||
if (docShell == thisDVDocShell) {
|
return true;
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} else {
|
bc = bc->GetParent();
|
||||||
break; // at top of tree
|
|
||||||
}
|
}
|
||||||
nsCOMPtr<nsIDocShellTreeItem> docShellItemParent;
|
|
||||||
docShell->GetSameTypeParent(getter_AddRefs(docShellItemParent));
|
|
||||||
docShell = do_QueryInterface(docShellItemParent);
|
|
||||||
} // while
|
|
||||||
}
|
}
|
||||||
} // scriptobj
|
}
|
||||||
|
return false;
|
||||||
return found;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -170,9 +170,6 @@ class nsPrintJob final : public nsIObserver,
|
||||||
bool DonePrintingPages(nsPrintObject* aPO, nsresult aResult);
|
bool DonePrintingPages(nsPrintObject* aPO, nsresult aResult);
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
void BuildDocTree(nsIDocShell* aParentNode,
|
|
||||||
nsTArray<nsPrintObject*>* aDocList,
|
|
||||||
const mozilla::UniquePtr<nsPrintObject>& aPO);
|
|
||||||
nsresult ReflowDocList(const mozilla::UniquePtr<nsPrintObject>& aPO,
|
nsresult ReflowDocList(const mozilla::UniquePtr<nsPrintObject>& aPO,
|
||||||
bool aSetPixelScale);
|
bool aSetPixelScale);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,7 @@ var validGradientAndElementValues = [
|
||||||
"linear-gradient(#ffff00, #ef3, rgba(10, 20, 30, 0.4))",
|
"linear-gradient(#ffff00, #ef3, rgba(10, 20, 30, 0.4))",
|
||||||
"linear-gradient(rgba(10, 20, 30, 0.4), #ffff00, #ef3)",
|
"linear-gradient(rgba(10, 20, 30, 0.4), #ffff00, #ef3)",
|
||||||
"linear-gradient(red, green calc(50% + 20px), blue)",
|
"linear-gradient(red, green calc(50% + 20px), blue)",
|
||||||
|
"linear-gradient(180deg, red, blue)",
|
||||||
|
|
||||||
"linear-gradient(to top, red, blue)",
|
"linear-gradient(to top, red, blue)",
|
||||||
"linear-gradient(to bottom, red, blue)",
|
"linear-gradient(to bottom, red, blue)",
|
||||||
|
|
|
||||||
|
|
@ -1255,11 +1255,8 @@ pref("dom.storage.enabled", true);
|
||||||
// Whether or not LSNG (Next Generation Local Storage) is enabled.
|
// Whether or not LSNG (Next Generation Local Storage) is enabled.
|
||||||
// See bug 1517090 for enabling this on Nightly.
|
// See bug 1517090 for enabling this on Nightly.
|
||||||
// See bug 1534736 for changing it to EARLY_BETA_OR_EARLIER.
|
// See bug 1534736 for changing it to EARLY_BETA_OR_EARLIER.
|
||||||
#ifdef EARLY_BETA_OR_EARLIER
|
// See bug 1539835 for enabling this unconditionally.
|
||||||
pref("dom.storage.next_gen", true);
|
pref("dom.storage.next_gen", true);
|
||||||
#else
|
|
||||||
pref("dom.storage.next_gen", false);
|
|
||||||
#endif
|
|
||||||
pref("dom.storage.default_quota", 5120);
|
pref("dom.storage.default_quota", 5120);
|
||||||
pref("dom.storage.shadow_writes", true);
|
pref("dom.storage.shadow_writes", true);
|
||||||
pref("dom.storage.snapshot_prefill", 16384);
|
pref("dom.storage.snapshot_prefill", 16384);
|
||||||
|
|
|
||||||
|
|
@ -389,6 +389,7 @@ impl nsStyleImage {
|
||||||
let angle = Angle::from_gecko_style_coord(&gecko_gradient.mAngle);
|
let angle = Angle::from_gecko_style_coord(&gecko_gradient.mAngle);
|
||||||
let line_direction = match (angle, horizontal_style, vertical_style) {
|
let line_direction = match (angle, horizontal_style, vertical_style) {
|
||||||
(Some(a), None, None) => LineDirection::Angle(a),
|
(Some(a), None, None) => LineDirection::Angle(a),
|
||||||
|
(None, None, None) => LineDirection::Angle(Angle::from_radians(PI)),
|
||||||
(None, Some(horizontal), Some(vertical)) => {
|
(None, Some(horizontal), Some(vertical)) => {
|
||||||
line_direction(horizontal, vertical)
|
line_direction(horizontal, vertical)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
#include "mozilla/dom/quota/QuotaObject.h"
|
#include "mozilla/dom/quota/QuotaObject.h"
|
||||||
#include "mozilla/net/IOActivityMonitor.h"
|
#include "mozilla/net/IOActivityMonitor.h"
|
||||||
#include "mozilla/IOInterposer.h"
|
#include "mozilla/IOInterposer.h"
|
||||||
|
#include "nsEscape.h"
|
||||||
|
|
||||||
// The last VFS version for which this file has been updated.
|
// The last VFS version for which this file has been updated.
|
||||||
#define LAST_KNOWN_VFS_VERSION 3
|
#define LAST_KNOWN_VFS_VERSION 3
|
||||||
|
|
@ -318,13 +319,27 @@ already_AddRefed<QuotaObject> GetQuotaObjectFromNameAndParameters(
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Re-escape group and origin to make sure we get the right quota group and
|
||||||
|
// origin.
|
||||||
|
nsAutoCString escGroup;
|
||||||
|
nsresult rv =
|
||||||
|
NS_EscapeURL(nsDependentCString(group), esc_Query, escGroup, fallible);
|
||||||
|
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsAutoCString escOrigin;
|
||||||
|
rv = NS_EscapeURL(nsDependentCString(origin), esc_Query, escOrigin, fallible);
|
||||||
|
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
QuotaManager* quotaManager = QuotaManager::Get();
|
QuotaManager* quotaManager = QuotaManager::Get();
|
||||||
MOZ_ASSERT(quotaManager);
|
MOZ_ASSERT(quotaManager);
|
||||||
|
|
||||||
return quotaManager->GetQuotaObject(
|
return quotaManager->GetQuotaObject(
|
||||||
PersistenceTypeFromText(nsDependentCString(persistenceType)),
|
PersistenceTypeFromText(nsDependentCString(persistenceType)), escGroup,
|
||||||
nsDependentCString(group), nsDependentCString(origin),
|
escOrigin, NS_ConvertUTF8toUTF16(zName));
|
||||||
NS_ConvertUTF8toUTF16(zName));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MaybeEstablishQuotaControl(const char* zName, telemetry_file* pFile,
|
void MaybeEstablishQuotaControl(const char* zName, telemetry_file* pFile,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
[2d.shadow.enable.y.html]
|
|
||||||
[Shadows are drawn if shadowOffsetY is set]
|
|
||||||
expected:
|
|
||||||
if (os == "android") and not e10s: FAIL
|
|
||||||
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
[first-letter-punctuation-088.xht]
|
[first-letter-punctuation-088.xht]
|
||||||
expected:
|
expected:
|
||||||
if (os == "android") and not e10s: FAIL
|
if (os == "android"): FAIL
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,8 @@
|
||||||
if not debug and not webrender and e10s and (os == "android") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
|
if not debug and not webrender and e10s and (os == "android") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
|
||||||
if not debug and webrender and e10s and (os == "win") and (version == "10.0.17134") and (processor == "x86_64") and (bits == 64): PASS
|
if not debug and webrender and e10s and (os == "win") and (version == "10.0.17134") and (processor == "x86_64") and (bits == 64): PASS
|
||||||
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): PASS
|
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): PASS
|
||||||
|
if debug and not webrender and e10s and (os == "android") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
|
||||||
|
if not debug and not webrender and e10s and (os == "win") and (version == "10.0.17134") and (processor == "aarch64") and (bits == 64): PASS
|
||||||
FAIL
|
FAIL
|
||||||
|
|
||||||
[test unit: ex - ellipse(closest-side 75ex) - computed]
|
[test unit: ex - ellipse(closest-side 75ex) - computed]
|
||||||
|
|
@ -212,6 +214,7 @@
|
||||||
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
|
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
|
||||||
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
|
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
|
||||||
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): PASS
|
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): PASS
|
||||||
|
if not debug and not webrender and e10s and (os == "win") and (version == "10.0.17134") and (processor == "aarch64") and (bits == 64): PASS
|
||||||
FAIL
|
FAIL
|
||||||
|
|
||||||
[test unit: vh - ellipse(50vh) - computed]
|
[test unit: vh - ellipse(50vh) - computed]
|
||||||
|
|
@ -234,6 +237,7 @@
|
||||||
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
|
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
|
||||||
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
|
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
|
||||||
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): PASS
|
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): PASS
|
||||||
|
if not debug and not webrender and e10s and (os == "win") and (version == "10.0.17134") and (processor == "aarch64") and (bits == 64): PASS
|
||||||
FAIL
|
FAIL
|
||||||
|
|
||||||
[test unit: vmin - ellipse(50vmin) - computed]
|
[test unit: vmin - ellipse(50vmin) - computed]
|
||||||
|
|
@ -256,6 +260,7 @@
|
||||||
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
|
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
|
||||||
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
|
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
|
||||||
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): PASS
|
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): PASS
|
||||||
|
if not debug and not webrender and e10s and (os == "win") and (version == "10.0.17134") and (processor == "aarch64") and (bits == 64): PASS
|
||||||
FAIL
|
FAIL
|
||||||
|
|
||||||
[test unit: vmax - ellipse(50vmax) - computed]
|
[test unit: vmax - ellipse(50vmax) - computed]
|
||||||
|
|
@ -278,6 +283,7 @@
|
||||||
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
|
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): PASS
|
||||||
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
|
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): PASS
|
||||||
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): PASS
|
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): PASS
|
||||||
|
if not debug and not webrender and e10s and (os == "win") and (version == "10.0.17134") and (processor == "aarch64") and (bits == 64): PASS
|
||||||
FAIL
|
FAIL
|
||||||
|
|
||||||
[test unit: vmin - ellipse(50vmin 100vmin) - inline]
|
[test unit: vmin - ellipse(50vmin 100vmin) - inline]
|
||||||
|
|
|
||||||
|
|
@ -890,6 +890,10 @@
|
||||||
[-webkit-appearance: listitem]
|
[-webkit-appearance: listitem]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
[-webkit-appearance: listitem (invalid)]
|
||||||
|
expected:
|
||||||
|
if os == "android": FAIL
|
||||||
|
|
||||||
[-webkit-appearance: resizer (invalid)]
|
[-webkit-appearance: resizer (invalid)]
|
||||||
expected:
|
expected:
|
||||||
if (os == "android") and not e10s: FAIL
|
if (os == "android") and not e10s: FAIL
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
[Orientation=Rotated]
|
[Orientation=Rotated]
|
||||||
expected:
|
expected:
|
||||||
if (os == "win"): PASS
|
if os == "win": PASS
|
||||||
FAIL
|
FAIL
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -683,6 +683,9 @@
|
||||||
[[["defaultparagraphseparator","p"\],["insertparagraph",""\]\] "<blockquote>foo[\]bar</blockquote>" compare innerHTML]
|
[[["defaultparagraphseparator","p"\],["insertparagraph",""\]\] "<blockquote>foo[\]bar</blockquote>" compare innerHTML]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
[insertparagraph - HTML editing conformance tests]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
||||||
[insertparagraph.html?3001-4000]
|
[insertparagraph.html?3001-4000]
|
||||||
[[["defaultparagraphseparator","div"\],["insertparagraph",""\]\] "<p><b><a href=foo>foo[\]</a></b></p>" compare innerHTML]
|
[[["defaultparagraphseparator","div"\],["insertparagraph",""\]\] "<p><b><a href=foo>foo[\]</a></b></p>" compare innerHTML]
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
[idlharness.https.any.serviceworker.html]
|
|
||||||
expected: TIMEOUT
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
|
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
|
||||||
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
|
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
|
||||||
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
|
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
|
||||||
|
if not debug and not webrender and e10s and (os == "win") and (version == "10.0.17134") and (processor == "aarch64") and (bits == 64): FAIL
|
||||||
|
|
||||||
[Leading noopener should work]
|
[Leading noopener should work]
|
||||||
expected:
|
expected:
|
||||||
|
|
@ -43,6 +44,7 @@
|
||||||
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
|
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
|
||||||
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
|
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
|
||||||
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
|
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
|
||||||
|
if not debug and not webrender and e10s and (os == "win") and (version == "10.0.17134") and (processor == "aarch64") and (bits == 64): FAIL
|
||||||
|
|
||||||
[Interior noopener should work]
|
[Interior noopener should work]
|
||||||
expected:
|
expected:
|
||||||
|
|
@ -63,6 +65,7 @@
|
||||||
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
|
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
|
||||||
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
|
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
|
||||||
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
|
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
|
||||||
|
if not debug and not webrender and e10s and (os == "win") and (version == "10.0.17134") and (processor == "aarch64") and (bits == 64): FAIL
|
||||||
|
|
||||||
[window.open() with 'noopener' should not reuse existing target]
|
[window.open() with 'noopener' should not reuse existing target]
|
||||||
expected:
|
expected:
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
|
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
|
||||||
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
|
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
|
||||||
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
|
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
|
||||||
|
if not debug and not webrender and e10s and (os == "win") and (version == "10.0.17134") and (processor == "aarch64") and (bits == 64): FAIL
|
||||||
|
|
||||||
[Check that targeting of rel=noopener with a given name reuses an existing subframe with that name]
|
[Check that targeting of rel=noopener with a given name reuses an existing subframe with that name]
|
||||||
expected:
|
expected:
|
||||||
|
|
@ -48,4 +49,5 @@
|
||||||
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
|
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
|
||||||
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
|
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
|
||||||
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
|
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
|
||||||
|
if not debug and not webrender and e10s and (os == "win") and (version == "10.0.17134") and (processor == "aarch64") and (bits == 64): FAIL
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -239,4 +239,5 @@
|
||||||
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
|
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): FAIL
|
||||||
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
|
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): FAIL
|
||||||
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
|
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): FAIL
|
||||||
|
if not debug and not webrender and e10s and (os == "win") and (version == "10.0.17134") and (processor == "aarch64") and (bits == 64): FAIL
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,4 +19,5 @@
|
||||||
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): TIMEOUT
|
if debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86_64") and (bits == 64): TIMEOUT
|
||||||
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): TIMEOUT
|
if not debug and not webrender and e10s and (os == "linux") and (version == "Ubuntu 16.04") and (processor == "x86") and (bits == 32): TIMEOUT
|
||||||
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): TIMEOUT
|
if not debug and not webrender and e10s and (os == "mac") and (version == "OS X 10.10.5") and (processor == "x86_64") and (bits == 64): TIMEOUT
|
||||||
|
if not debug and (os == "win") and (version == "10.0.17134") and (processor == "aarch64"): TIMEOUT
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,2 @@
|
||||||
[text-clipped-offscreen-move-onscreen.html]
|
[text-clipped-offscreen-move-onscreen.html]
|
||||||
disabled:
|
disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1552460
|
||||||
if (os == "linux"): https://bugzilla.mozilla.org/show_bug.cgi?id=1552460
|
|
||||||
if (os == "mac"): https://bugzilla.mozilla.org/show_bug.cgi?id=1552460
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
[createcredential-pubkeycredparams.https.html]
|
|
||||||
[Bad pubKeyCredParams: first param has bad alg (0)]
|
|
||||||
expected:
|
|
||||||
if (os == "android") and not e10s: FAIL
|
|
||||||
|
|
||||||
[Bad pubKeyCredParams: first param has bad alg (42)]
|
|
||||||
expected:
|
|
||||||
if (os == "android") and not e10s: FAIL
|
|
||||||
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
[createcredential-timeout.https.html]
|
[createcredential-timeout.https.html]
|
||||||
expected:
|
|
||||||
if os == "android": ERROR
|
|
||||||
[ensure create credential times out]
|
[ensure create credential times out]
|
||||||
expected:
|
expected:
|
||||||
if os == "android": PASS
|
if os == "android": PASS
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
[event-timeout.any.html]
|
|
||||||
|
|
||||||
[event-timeout.any.worker.html]
|
|
||||||
[XMLHttpRequest: timeout event]
|
|
||||||
expected:
|
|
||||||
if os == "android": FAIL
|
|
||||||
|
|
||||||
|
|
@ -47,6 +47,7 @@ var snapshotFormatters = {
|
||||||
$("application-box").textContent = data.name;
|
$("application-box").textContent = data.name;
|
||||||
$("useragent-box").textContent = data.userAgent;
|
$("useragent-box").textContent = data.userAgent;
|
||||||
$("os-box").textContent = data.osVersion;
|
$("os-box").textContent = data.osVersion;
|
||||||
|
$("binary-box").textContent = Services.dirsvc.get("XREExeF", Ci.nsIFile).path;
|
||||||
$("supportLink").href = data.supportURL;
|
$("supportLink").href = data.supportURL;
|
||||||
let version = AppConstants.MOZ_APP_VERSION_DISPLAY;
|
let version = AppConstants.MOZ_APP_VERSION_DISPLAY;
|
||||||
if (data.vendor)
|
if (data.vendor)
|
||||||
|
|
|
||||||
|
|
@ -111,6 +111,13 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr class="no-copy">
|
||||||
|
<th class="column" data-l10n-id="app-basics-binary"/>
|
||||||
|
|
||||||
|
<td id="binary-box">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr id="profile-row" class="no-copy">
|
<tr id="profile-row" class="no-copy">
|
||||||
<th class="column" data-l10n-id="app-basics-profile-dir"/>
|
<th class="column" data-l10n-id="app-basics-profile-dir"/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@ app-basics-build-id = Build ID
|
||||||
app-basics-update-channel = Update Channel
|
app-basics-update-channel = Update Channel
|
||||||
app-basics-update-history = Update History
|
app-basics-update-history = Update History
|
||||||
app-basics-show-update-history = Show Update History
|
app-basics-show-update-history = Show Update History
|
||||||
|
# Represents the path to the binary used to start the application.
|
||||||
|
app-basics-binary = Application Binary
|
||||||
app-basics-profile-dir =
|
app-basics-profile-dir =
|
||||||
{ PLATFORM() ->
|
{ PLATFORM() ->
|
||||||
[linux] Profile Directory
|
[linux] Profile Directory
|
||||||
|
|
|
||||||
|
|
@ -2362,7 +2362,11 @@ static void ExtractCompatVersionInfo(const nsACString& aCompatVersion,
|
||||||
aPlatformBuildID = Substring(aCompatVersion, slashPos + 1);
|
aPlatformBuildID = Substring(aCompatVersion, slashPos + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsNewIDLower(nsACString& oldID, nsACString& newID) {
|
/**
|
||||||
|
* Compares two build IDs. Returns 0 if they match, < 0 if newID is considered
|
||||||
|
* newer than oldID and > 0 if the oldID is considered newer than newID.
|
||||||
|
*/
|
||||||
|
static int32_t CompareBuildIDs(nsACString& oldID, nsACString& newID) {
|
||||||
// For Mozilla builds the build ID is a numeric date string. But it is too
|
// For Mozilla builds the build ID is a numeric date string. But it is too
|
||||||
// large a number for the version comparator to handle so try to just compare
|
// large a number for the version comparator to handle so try to just compare
|
||||||
// them as integer values first.
|
// them as integer values first.
|
||||||
|
|
@ -2394,16 +2398,22 @@ static bool IsNewIDLower(nsACString& oldID, nsACString& newID) {
|
||||||
|
|
||||||
if (isNumeric) {
|
if (isNumeric) {
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
uint64_t oldVal;
|
CheckedInt<uint64_t> oldVal = oldID.ToInteger64(&rv);
|
||||||
uint64_t newVal;
|
|
||||||
oldVal = oldID.ToInteger64(&rv);
|
|
||||||
|
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv) && oldVal.isValid()) {
|
||||||
newVal = newID.ToInteger64(&rv);
|
CheckedInt<uint64_t> newVal = newID.ToInteger64(&rv);
|
||||||
|
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv) && newVal.isValid()) {
|
||||||
// We have simple numbers for both IDs.
|
// We have simple numbers for both IDs.
|
||||||
return newVal < oldVal;
|
if (oldVal.value() == newVal.value()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oldVal.value() > newVal.value()) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2412,8 +2422,8 @@ static bool IsNewIDLower(nsACString& oldID, nsACString& newID) {
|
||||||
// distribution could have modified the build ID in some way. We don't know
|
// distribution could have modified the build ID in some way. We don't know
|
||||||
// what format this may be so let's just fall back to assuming that it's a
|
// what format this may be so let's just fall back to assuming that it's a
|
||||||
// valid toolkit version.
|
// valid toolkit version.
|
||||||
return Version(PromiseFlatCString(newID).get()) <
|
return CompareVersions(PromiseFlatCString(oldID).get(),
|
||||||
Version(PromiseFlatCString(oldID).get());
|
PromiseFlatCString(newID).get());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2422,13 +2432,11 @@ static bool IsNewIDLower(nsACString& oldID, nsACString& newID) {
|
||||||
* The aDowngrade parameter is set to true if the old version is "newer" than
|
* The aDowngrade parameter is set to true if the old version is "newer" than
|
||||||
* the new version.
|
* the new version.
|
||||||
*/
|
*/
|
||||||
bool CheckCompatVersions(const nsACString& aOldCompatVersion,
|
int32_t CompareCompatVersions(const nsACString& aOldCompatVersion,
|
||||||
const nsACString& aNewCompatVersion,
|
const nsACString& aNewCompatVersion) {
|
||||||
bool* aIsDowngrade) {
|
|
||||||
// Quick path for the common case.
|
// Quick path for the common case.
|
||||||
if (aOldCompatVersion.Equals(aNewCompatVersion)) {
|
if (aOldCompatVersion.Equals(aNewCompatVersion)) {
|
||||||
*aIsDowngrade = false;
|
return 0;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The versions differ for some reason so we will only ever return false from
|
// The versions differ for some reason so we will only ever return false from
|
||||||
|
|
@ -2438,8 +2446,7 @@ bool CheckCompatVersions(const nsACString& aOldCompatVersion,
|
||||||
// cannot tell if this is a downgrade or not so just assume it isn't and let
|
// cannot tell if this is a downgrade or not so just assume it isn't and let
|
||||||
// the user proceed.
|
// the user proceed.
|
||||||
if (aOldCompatVersion.EqualsLiteral("Safe Mode")) {
|
if (aOldCompatVersion.EqualsLiteral("Safe Mode")) {
|
||||||
*aIsDowngrade = false;
|
return -1;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCString oldVersion;
|
nsCString oldVersion;
|
||||||
|
|
@ -2455,24 +2462,18 @@ bool CheckCompatVersions(const nsACString& aOldCompatVersion,
|
||||||
newPlatformBuildID);
|
newPlatformBuildID);
|
||||||
|
|
||||||
// In most cases the app version will differ and this is an easy check.
|
// In most cases the app version will differ and this is an easy check.
|
||||||
if (Version(newVersion.get()) < Version(oldVersion.get())) {
|
int32_t result = CompareVersions(oldVersion.get(), newVersion.get());
|
||||||
*aIsDowngrade = true;
|
if (result != 0) {
|
||||||
return false;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fall back to build ID comparison.
|
// Fall back to build ID comparison.
|
||||||
if (IsNewIDLower(oldAppBuildID, newAppBuildID)) {
|
result = CompareBuildIDs(oldAppBuildID, newAppBuildID);
|
||||||
*aIsDowngrade = true;
|
if (result != 0) {
|
||||||
return false;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsNewIDLower(oldPlatformBuildID, newPlatformBuildID)) {
|
return CompareBuildIDs(oldPlatformBuildID, newPlatformBuildID);
|
||||||
*aIsDowngrade = true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
*aIsDowngrade = false;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -2506,7 +2507,9 @@ static bool CheckCompatibility(nsIFile* aProfileDir, const nsCString& aVersion,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CheckCompatVersions(aLastVersion, aVersion, aIsDowngrade)) {
|
int32_t result = CompareCompatVersions(aLastVersion, aVersion);
|
||||||
|
if (result != 0) {
|
||||||
|
*aIsDowngrade = result > 0;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,9 +60,14 @@ nsresult AppInfoConstructor(nsISupports* aOuter, const nsID& aIID,
|
||||||
// Exported for gtests.
|
// Exported for gtests.
|
||||||
void BuildCompatVersion(const char* aAppVersion, const char* aAppBuildID,
|
void BuildCompatVersion(const char* aAppVersion, const char* aAppBuildID,
|
||||||
const char* aToolkitBuildID, nsACString& aBuf);
|
const char* aToolkitBuildID, nsACString& aBuf);
|
||||||
bool CheckCompatVersions(const nsACString& aOldCompatVersion,
|
|
||||||
const nsACString& aNewCompatVersion,
|
/**
|
||||||
bool* aIsDowngrade);
|
* Compares the provided compatibility versions. Returns 0 if they match,
|
||||||
|
* < 0 if the new version is considered an upgrade from the old version and
|
||||||
|
* > 0 if the new version is considered a downgrade from the old version.
|
||||||
|
*/
|
||||||
|
int32_t CompareCompatVersions(const nsACString& aOldCompatVersion,
|
||||||
|
const nsACString& aNewCompatVersion);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the nativeappsupport implementation.
|
* Create the nativeappsupport implementation.
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,10 @@ void CheckCompatVersionCompare(const nsCString& aOldCompatVersion,
|
||||||
bool aExpectedSame, bool aExpectedDowngrade) {
|
bool aExpectedSame, bool aExpectedDowngrade) {
|
||||||
printf("Comparing '%s' to '%s'.\n", aOldCompatVersion.get(), aNewCompatVersion.get());
|
printf("Comparing '%s' to '%s'.\n", aOldCompatVersion.get(), aNewCompatVersion.get());
|
||||||
|
|
||||||
bool isDowngrade = false;
|
int32_t result = CompareCompatVersions(aOldCompatVersion, aNewCompatVersion);
|
||||||
bool isSame = CheckCompatVersions(aOldCompatVersion, aNewCompatVersion, &isDowngrade);
|
|
||||||
|
|
||||||
ASSERT_EQ(aExpectedSame, isSame) << "Version sameness check should match.";
|
ASSERT_EQ(aExpectedSame, result == 0) << "Version sameness check should match.";
|
||||||
ASSERT_EQ(aExpectedDowngrade, isDowngrade) << "Version downgrade check should match.";
|
ASSERT_EQ(aExpectedDowngrade, result > 0) << "Version downgrade check should match.";
|
||||||
}
|
}
|
||||||
|
|
||||||
void CheckExpectedResult(
|
void CheckExpectedResult(
|
||||||
|
|
@ -34,6 +33,7 @@ void CheckExpectedResult(
|
||||||
aExpectedSame, aExpectedDowngrade);
|
aExpectedSame, aExpectedDowngrade);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
TEST(CompatVersionCompare, CompareVersionChange) {
|
TEST(CompatVersionCompare, CompareVersionChange) {
|
||||||
// Identical
|
// Identical
|
||||||
CheckExpectedResult(
|
CheckExpectedResult(
|
||||||
|
|
@ -124,13 +124,32 @@ TEST(CompatVersionCompare, CompareVersionChange) {
|
||||||
"67.0.5", "20190523030228","20190523030228",
|
"67.0.5", "20190523030228","20190523030228",
|
||||||
false, false);
|
false, false);
|
||||||
CheckExpectedResult(
|
CheckExpectedResult(
|
||||||
"67.0.5", "20190523030228","20190523030228",
|
"67.0.5", "20190523030228", "20190523030228",
|
||||||
"67.0", "20190516215225", "20190516215225",
|
"67.0", "20190516215225", "20190516215225",
|
||||||
false, true);
|
false, true);
|
||||||
|
|
||||||
|
// A newer or equal version should not go on to test the build IDs (bug 1556612).
|
||||||
|
CheckExpectedResult(
|
||||||
|
"65.0", "30000000000000", "20000000000000",
|
||||||
|
"66.0", "20000000000000", "20000000000000",
|
||||||
|
false, false);
|
||||||
|
CheckExpectedResult(
|
||||||
|
"65.0", "20000000000000", "30000000000000",
|
||||||
|
"66.0", "20000000000000", "20000000000000",
|
||||||
|
false, false);
|
||||||
|
CheckExpectedResult(
|
||||||
|
"66.0", "30000000000000", "20000000000000",
|
||||||
|
"65.0", "20000000000000", "20000000000000",
|
||||||
|
false, true);
|
||||||
|
CheckExpectedResult(
|
||||||
|
"66.0", "20000000000000", "30000000000000",
|
||||||
|
"65.0", "20000000000000", "20000000000000",
|
||||||
|
false, true);
|
||||||
|
|
||||||
// Check that if the last run was safe mode then we consider this an upgrade.
|
// Check that if the last run was safe mode then we consider this an upgrade.
|
||||||
CheckCompatVersionCompare(
|
CheckCompatVersionCompare(
|
||||||
NS_LITERAL_CSTRING("Safe Mode"),
|
NS_LITERAL_CSTRING("Safe Mode"),
|
||||||
NS_LITERAL_CSTRING("67.0.1_20000000000000/20000000000000"),
|
NS_LITERAL_CSTRING("67.0.1_20000000000000/20000000000000"),
|
||||||
false, false);
|
false, false);
|
||||||
}
|
}
|
||||||
|
// clang-format on
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include "mozilla/CheckedInt.h"
|
||||||
#if defined(XP_WIN) && !defined(UPDATER_NO_STRING_GLUE_STL)
|
#if defined(XP_WIN) && !defined(UPDATER_NO_STRING_GLUE_STL)
|
||||||
# include <wchar.h>
|
# include <wchar.h>
|
||||||
# include "nsString.h"
|
# include "nsString.h"
|
||||||
|
|
@ -39,6 +40,29 @@ struct VersionPartW {
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static int32_t ns_strtol(const char* aPart, char** aNext) {
|
||||||
|
errno = 0;
|
||||||
|
long result_long = strtol(aPart, aNext, 10);
|
||||||
|
|
||||||
|
// Different platforms seem to disagree on what to return when the value
|
||||||
|
// is out of range so we ensure that it is always what we want it to be.
|
||||||
|
// We choose 0 firstly because that is the default when the number doesn't
|
||||||
|
// exist at all and also because it would be easier to recover from should
|
||||||
|
// you somehow end up in a situation where an old version is invalid. It is
|
||||||
|
// much easier to create a version either larger or smaller than 0, much
|
||||||
|
// harder to do the same with INT_MAX.
|
||||||
|
if (errno != 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
mozilla::CheckedInt<int32_t> result = result_long;
|
||||||
|
if (!result.isValid()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result.value();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a version part into a number and "extra text".
|
* Parse a version part into a number and "extra text".
|
||||||
*
|
*
|
||||||
|
|
@ -66,19 +90,7 @@ static char* ParseVP(char* aPart, VersionPart& aResult) {
|
||||||
aResult.numA = INT32_MAX;
|
aResult.numA = INT32_MAX;
|
||||||
aResult.strB = "";
|
aResult.strB = "";
|
||||||
} else {
|
} else {
|
||||||
errno = 0;
|
aResult.numA = ns_strtol(aPart, const_cast<char**>(&aResult.strB));
|
||||||
aResult.numA = strtol(aPart, const_cast<char**>(&aResult.strB), 10);
|
|
||||||
|
|
||||||
// Different platforms seem to disagree on what to return when the value
|
|
||||||
// is out of range so we ensure that it is always what we want it to be.
|
|
||||||
// We choose 0 firstly because that is the default when the number doesn't
|
|
||||||
// exist at all and also because it would be easier to recover from should
|
|
||||||
// you somehow end up in a situation where an old version is invalid. It is
|
|
||||||
// much easier to create a version either larger or smaller than 0, much
|
|
||||||
// harder to do the same with INT_MAX.
|
|
||||||
if (errno != 0) {
|
|
||||||
aResult.numA = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!*aResult.strB) {
|
if (!*aResult.strB) {
|
||||||
|
|
@ -97,14 +109,7 @@ static char* ParseVP(char* aPart, VersionPart& aResult) {
|
||||||
aResult.strBlen = strlen(aResult.strB);
|
aResult.strBlen = strlen(aResult.strB);
|
||||||
} else {
|
} else {
|
||||||
aResult.strBlen = numstart - aResult.strB;
|
aResult.strBlen = numstart - aResult.strB;
|
||||||
|
aResult.numC = ns_strtol(numstart, const_cast<char**>(&aResult.extraD));
|
||||||
errno = 0;
|
|
||||||
aResult.numC = strtol(numstart, &aResult.extraD, 10);
|
|
||||||
|
|
||||||
// See above for the rationale for using 0 here.
|
|
||||||
if (errno != 0) {
|
|
||||||
aResult.numC = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!*aResult.extraD) {
|
if (!*aResult.extraD) {
|
||||||
aResult.extraD = nullptr;
|
aResult.extraD = nullptr;
|
||||||
|
|
@ -130,6 +135,24 @@ static char* ParseVP(char* aPart, VersionPart& aResult) {
|
||||||
* @returns A pointer to the next versionpart, or null if none.
|
* @returns A pointer to the next versionpart, or null if none.
|
||||||
*/
|
*/
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
|
|
||||||
|
static int32_t ns_wcstol(const wchar_t* aPart, wchar_t** aNext) {
|
||||||
|
errno = 0;
|
||||||
|
long result_long = wcstol(aPart, aNext, 10);
|
||||||
|
|
||||||
|
// See above for the rationale for using 0 here.
|
||||||
|
if (errno != 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
mozilla::CheckedInt<int32_t> result = result_long;
|
||||||
|
if (!result.isValid()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result.value();
|
||||||
|
}
|
||||||
|
|
||||||
static wchar_t* ParseVP(wchar_t* aPart, VersionPartW& aResult) {
|
static wchar_t* ParseVP(wchar_t* aPart, VersionPartW& aResult) {
|
||||||
wchar_t* dot;
|
wchar_t* dot;
|
||||||
|
|
||||||
|
|
@ -154,13 +177,7 @@ static wchar_t* ParseVP(wchar_t* aPart, VersionPartW& aResult) {
|
||||||
aResult.numA = INT32_MAX;
|
aResult.numA = INT32_MAX;
|
||||||
aResult.strB = kEmpty;
|
aResult.strB = kEmpty;
|
||||||
} else {
|
} else {
|
||||||
errno = 0;
|
aResult.numA = ns_wcstol(aPart, const_cast<wchar_t**>(&aResult.strB));
|
||||||
aResult.numA = wcstol(aPart, const_cast<wchar_t**>(&aResult.strB), 10);
|
|
||||||
|
|
||||||
// See above for the rationale for using 0 here.
|
|
||||||
if (errno != 0) {
|
|
||||||
aResult.numA = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!*aResult.strB) {
|
if (!*aResult.strB) {
|
||||||
|
|
@ -179,14 +196,7 @@ static wchar_t* ParseVP(wchar_t* aPart, VersionPartW& aResult) {
|
||||||
aResult.strBlen = wcslen(aResult.strB);
|
aResult.strBlen = wcslen(aResult.strB);
|
||||||
} else {
|
} else {
|
||||||
aResult.strBlen = numstart - aResult.strB;
|
aResult.strBlen = numstart - aResult.strB;
|
||||||
|
aResult.numC = ns_wcstol(numstart, const_cast<wchar_t**>(&aResult.extraD));
|
||||||
errno = 0;
|
|
||||||
aResult.numC = wcstol(numstart, &aResult.extraD, 10);
|
|
||||||
|
|
||||||
// See above for the rationale for using 0 here.
|
|
||||||
if (errno != 0) {
|
|
||||||
aResult.numC = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!*aResult.extraD) {
|
if (!*aResult.extraD) {
|
||||||
aResult.extraD = nullptr;
|
aResult.extraD = nullptr;
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,18 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Compares the version strings provided.
|
||||||
|
*
|
||||||
|
* Returns 0 if the versions match, < 0 if aStrB > aStrA and > 0 if
|
||||||
|
* aStrA > aStrB.
|
||||||
|
*/
|
||||||
int32_t CompareVersions(const char* aStrA, const char* aStrB);
|
int32_t CompareVersions(const char* aStrA, const char* aStrB);
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
|
/**
|
||||||
|
* As above but for wide character strings.
|
||||||
|
*/
|
||||||
int32_t CompareVersions(const char16_t* aStrA, const char16_t* aStrB);
|
int32_t CompareVersions(const char16_t* aStrA, const char16_t* aStrB);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@ const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||||
|
|
||||||
// Versions to test listed in ascending order, none can be equal
|
// Versions to test listed in ascending order, none can be equal
|
||||||
var comparisons = [
|
var comparisons = [
|
||||||
|
"pre",
|
||||||
|
// A number that is too large to be supported should be normalized to 0.
|
||||||
|
String(0x1F0000000),
|
||||||
"0.9",
|
"0.9",
|
||||||
"0.9.1",
|
"0.9.1",
|
||||||
"1.0pre1",
|
"1.0pre1",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue