summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--browser/base/content/aboutDialog.js21
-rw-r--r--browser/base/content/aboutDialog.xul14
-rw-r--r--browser/branding/official/pref/firefox-branding.js4
-rw-r--r--browser/components/nsBrowserGlue.js4
-rw-r--r--browser/config/version.txt2
-rw-r--r--browser/config/version_display.txt2
-rwxr-xr-xbrowser/confvars.sh4
-rw-r--r--config/milestone.txt2
-rw-r--r--devtools/client/scratchpad/scratchpad.xul2
-rw-r--r--docshell/base/nsAboutRedirector.cpp5
-rw-r--r--docshell/test/file_bug1151421.html19
-rw-r--r--docshell/test/mochitest.ini2
-rw-r--r--docshell/test/navigation/file_scrollRestoration.html14
-rw-r--r--docshell/test/test_bug1151421.html61
-rw-r--r--docshell/test/test_bug1186774.html2
-rw-r--r--docshell/test/test_bug590573.html16
-rw-r--r--docshell/test/test_bug653741.html4
-rw-r--r--docshell/test/test_bug662170.html2
-rw-r--r--dom/base/Navigator.cpp10
-rw-r--r--dom/base/nsGlobalWindow.cpp12
-rw-r--r--dom/base/nsGlobalWindow.h14
-rw-r--r--dom/base/test/test_viewport_scroll.html4
-rw-r--r--dom/browser-element/mochitest/browserElement_ScrollEvent.js4
-rw-r--r--dom/tests/mochitest/general/test_domWindowUtils_scrollXY.html12
-rw-r--r--dom/url/URL.h6
-rw-r--r--dom/url/tests/test_url.html6
-rw-r--r--dom/webidl/URL.webidl5
-rw-r--r--dom/webidl/Window.webidl12
-rw-r--r--layout/forms/test/test_bug562447.html6
-rw-r--r--layout/forms/test/test_bug564115.html4
-rw-r--r--modules/libpref/init/all.js3
-rw-r--r--netwerk/base/nsICryptoHash.idl3
-rw-r--r--netwerk/protocol/http/nsHttpHandler.cpp83
-rw-r--r--netwerk/protocol/http/nsHttpHandler.h4
-rw-r--r--old-configure.in3
-rw-r--r--python/mozbuild/mozbuild/milestone.py12
-rw-r--r--services/crypto/modules/utils.js82
-rw-r--r--toolkit/components/alerts/resources/content/alert.js28
-rw-r--r--toolkit/components/alerts/resources/content/alert.xul1
-rw-r--r--toolkit/content/mozilla.xhtml6
-rw-r--r--toolkit/locales/en-US/chrome/global/mozilla.dtd16
41 files changed, 357 insertions, 159 deletions
diff --git a/browser/base/content/aboutDialog.js b/browser/base/content/aboutDialog.js
index b024d2d52..f9571621f 100644
--- a/browser/base/content/aboutDialog.js
+++ b/browser/base/content/aboutDialog.js
@@ -40,16 +40,23 @@ function init(aEvent)
// Pref is unset
}
- // Include the build ID and display warning if this is an "a#" (nightly or aurora) build
+ // Include the build ID
let versionField = document.getElementById("version");
let version = Services.appinfo.version;
+ let buildID = Services.appinfo.appBuildID;
+ let year = buildID.slice(0, 4);
+ let month = buildID.slice(4, 6);
+ let day = buildID.slice(6, 8);
+ let hour = buildID.slice(8, 10);
+ let minute = buildID.slice(10, 12);
+ if (Services.prefs.getBoolPref("general.useragent.appVersionIsBuildID")) {
+ versionField.textContent = `${year}.${month}.${day}`;
+ } else {
+ versionField.textContent = `v` + version + ` (${year}-${month}-${day})`;
+ }
+
+ // Display warning if this is an "a#" (nightly or aurora) build
if (/a\d+$/.test(version)) {
- let buildID = Services.appinfo.appBuildID;
- let year = buildID.slice(0, 4);
- let month = buildID.slice(4, 6);
- let day = buildID.slice(6, 8);
- versionField.textContent += ` (${year}-${month}-${day})`;
-
document.getElementById("experimental").hidden = false;
document.getElementById("communityDesc").hidden = true;
}
diff --git a/browser/base/content/aboutDialog.xul b/browser/base/content/aboutDialog.xul
index ef2804f31..f64e79681 100644
--- a/browser/base/content/aboutDialog.xul
+++ b/browser/base/content/aboutDialog.xul
@@ -45,7 +45,7 @@
<vbox id="leftBox" flex="1"/>
<vbox id="rightBox" flex="1">
<hbox align="baseline">
-#expand <label id="version">__MOZ_APP_VERSION_DISPLAY__</label>
+#expand <label id="version"></label>
#ifndef NIGHTLY_BUILD
<label id="releasenotes" class="text-link">&releaseNotes.link;</label>
#endif
@@ -120,19 +120,13 @@
<vbox id="experimental" hidden="true">
<description class="text-blurb" id="warningDesc">
&warningDesc.version;
-#ifdef MOZ_TELEMETRY_ON_BY_DEFAULT
- &warningDesc.telemetryDesc;
-#endif
- </description>
- <description class="text-blurb" id="communityExperimentalDesc">
- &community.exp.start;<label class="text-link" href="http://www.mozilla.org/">&community.exp.mozillaLink;</label>&community.exp.middle;<label class="text-link" useoriginprincipal="true" href="about:credits">&community.exp.creditsLink;</label>&community.exp.end;
</description>
</vbox>
<description class="text-blurb" id="communityDesc">
- &community.start2;<label class="text-link" href="http://www.mozilla.org/">&community.mozillaLink;</label>&community.middle2;<label class="text-link" useoriginprincipal="true" href="about:credits">&community.creditsLink;</label>&community.end3;
+ Basilisk is community software released by <label class="text-link" href="http://www.palemoon.org/">the Pale Moon team</label> and Mozilla developers. Learn <label class="text-link" useoriginprincipal="true" href="about:credits">who contributed</label> to this software.
</description>
<description class="text-blurb" id="contributeDesc">
- &helpus.start;<label class="text-link" href="https://sendto.mozilla.org/page/contribute/Give-Now?source=mozillaorg_default_footer&#38;ref=firefox_about&#38;utm_campaign=firefox_about&#38;tm_source=firefox&#38;tm_medium=referral&#38;utm_content=20140929_FireFoxAbout">&helpus.donateLink;</label>&helpus.middle;<label class="text-link" href="http://www.mozilla.org/contribute/">&helpus.getInvolvedLink;</label>&helpus.end;
+ Want to help? Please consider <label class="text-link" href="https://www.palemoon.org/donations.shtml">donating</label> or get involved with our <label class="text-link" href="https://github.com/MoonchildProductions/moebius">development</label> of the Unified XUL Platform.
</description>
</vbox>
</vbox>
@@ -141,7 +135,7 @@
<hbox pack="center">
<label class="text-link bottom-link" useoriginprincipal="true" href="about:license">&bottomLinks.license;</label>
<label class="text-link bottom-link" useoriginprincipal="true" href="about:rights">&bottomLinks.rights;</label>
- <label class="text-link bottom-link" href="https://www.mozilla.org/privacy/">&bottomLinks.privacy;</label>
+ <label class="text-link bottom-link" href="https://www.palemoon.org/privacy.shtml">&bottomLinks.privacy;</label>
</hbox>
<description id="trademark">&trademarkInfo.part1;</description>
</vbox>
diff --git a/browser/branding/official/pref/firefox-branding.js b/browser/branding/official/pref/firefox-branding.js
index eb2bf489b..190b84e78 100644
--- a/browser/branding/official/pref/firefox-branding.js
+++ b/browser/branding/official/pref/firefox-branding.js
@@ -37,6 +37,10 @@ pref("app.update.url.manual", "https://@BRANDING_SITEURL@/");
// supplied in the "An update is available" page of the update wizard.
pref("app.update.url.details", "https://@BRANDING_SITEURL@/@BRANDING_RELNOTESPATH@");
+// Provide UA Gecko and Firefox slices for web compatibility
+pref("general.useragent.compatMode.firefox",true);
+pref("general.useragent.compatMode.gecko",true);
+
// Switch Application Updates off for now
pref("app.update.enabled", false);
diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js
index d69a11f6b..f97c173a0 100644
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -64,6 +64,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "AlertsService", "@mozilla.org/alerts-s
["Task", "resource://gre/modules/Task.jsm"],
["UITour", "resource:///modules/UITour.jsm"],
["URLBarZoom", "resource:///modules/URLBarZoom.jsm"],
+ ["UserAgentOverrides", "resource://gre/modules/UserAgentOverrides.jsm"],
["WebChannel", "resource://gre/modules/WebChannel.jsm"],
["WindowsRegistry", "resource://gre/modules/WindowsRegistry.jsm"],
["webrtcUI", "resource:///modules/webrtcUI.jsm"],
@@ -662,6 +663,8 @@ BrowserGlue.prototype = {
}
} catch (ex) { /* missing any of the prefs is not critical */ }
+ UserAgentOverrides.init();
+
PageThumbs.init();
webrtcUI.init();
AboutHome.init();
@@ -1042,6 +1045,7 @@ BrowserGlue.prototype = {
BrowserUsageTelemetry.uninit();
SelfSupportBackend.uninit();
+ UserAgentOverrides.uninit();
PageThumbs.uninit();
NewTabMessages.uninit();
AboutNewTab.uninit();
diff --git a/browser/config/version.txt b/browser/config/version.txt
index b406fbef6..d90a8c220 100644
--- a/browser/config/version.txt
+++ b/browser/config/version.txt
@@ -1 +1 @@
-55.0.0
+52.9.0
diff --git a/browser/config/version_display.txt b/browser/config/version_display.txt
index b406fbef6..d90a8c220 100644
--- a/browser/config/version_display.txt
+++ b/browser/config/version_display.txt
@@ -1 +1 @@
-55.0.0
+52.9.0
diff --git a/browser/confvars.sh b/browser/confvars.sh
index 65cf154e9..0cccede38 100755
--- a/browser/confvars.sh
+++ b/browser/confvars.sh
@@ -18,7 +18,7 @@ if test "$OS_ARCH" = "WINNT"; then
MOZ_MAINTENANCE_SERVICE=
fi
-# For Basilisk we want to use 55.0.YYYY.MM.DD as MOZ_APP_VERSION in release
+# For Basilisk we want to use 52.9.YYYY.MM.DD as MOZ_APP_VERSION in release
# builds so add-on developers have something to target while maintaining
# Firefox compatiblity.
# To enable add "export BASILISK_VERSION=1" to the .mozconfig file.
@@ -26,7 +26,7 @@ fi
# don't export the variable if you are in development or don't care.
# When not exported we fall back the value in the version*.txt file.
if test -n "$BASILISK_VERSION" ; then
- MOZ_APP_VERSION=55.0.`date --utc '+%Y.%m.%d'`
+ MOZ_APP_VERSION=52.9.`date --utc '+%Y.%m.%d'`
MOZ_APP_VERSION_DISPLAY=`date --utc '+%Y.%m.%d'`
else
MOZ_APP_VERSION=`cat ${_topsrcdir}/$MOZ_BUILD_APP/config/version.txt`
diff --git a/config/milestone.txt b/config/milestone.txt
index 48a995e3c..05d41f934 100644
--- a/config/milestone.txt
+++ b/config/milestone.txt
@@ -10,4 +10,4 @@
# hardcoded milestones in the tree from these two files.
#--------------------------------------------------------
-52.6.0
+4.1.0
diff --git a/devtools/client/scratchpad/scratchpad.xul b/devtools/client/scratchpad/scratchpad.xul
index 0603fa95e..3712f163d 100644
--- a/devtools/client/scratchpad/scratchpad.xul
+++ b/devtools/client/scratchpad/scratchpad.xul
@@ -121,7 +121,7 @@
<key id="sp-key-reloadAndRun"
key="&reloadAndRun.key;"
command="sp-cmd-reloadAndRun"
- modifiers="accel,shift"/>
+ modifiers="accel,alt"/>
<key id="sp-key-evalFunction"
key="&evalFunction.key;"
command="sp-cmd-evalFunction"
diff --git a/docshell/base/nsAboutRedirector.cpp b/docshell/base/nsAboutRedirector.cpp
index cb62eacbb..e7d362864 100644
--- a/docshell/base/nsAboutRedirector.cpp
+++ b/docshell/base/nsAboutRedirector.cpp
@@ -54,8 +54,9 @@ static RedirEntry kRedirMap[] = {
{ "crashes", "chrome://global/content/crashes.xhtml", 0 },
#endif
{
- "credits", "https://www.mozilla.org/credits/",
- nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT
+ "credits", "http://www.palemoon.org/Contributors.shtml",
+ nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
+ nsIAboutModule::MAKE_LINKABLE
},
#ifdef MOZ_DEVTOOLS
{
diff --git a/docshell/test/file_bug1151421.html b/docshell/test/file_bug1151421.html
new file mode 100644
index 000000000..7bb8c8f36
--- /dev/null
+++ b/docshell/test/file_bug1151421.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+<style>
+body, html {
+ height: 100%;
+}
+.spacer {
+ height: 80%;
+}
+</style>
+</head>
+<body onload='(parent || opener).childLoad()'>
+
+<div class="spacer"></div>
+<div id="content">content</div>
+<div class="spacer"></div>
+
+</body>
+</html>
diff --git a/docshell/test/mochitest.ini b/docshell/test/mochitest.ini
index 725486b77..7b27908fb 100644
--- a/docshell/test/mochitest.ini
+++ b/docshell/test/mochitest.ini
@@ -32,6 +32,7 @@ support-files =
file_bug680257.html
file_bug703855.html
file_bug728939.html
+ file_bug1151421.html
file_pushState_after_document_open.html
historyframes.html
@@ -85,6 +86,7 @@ support-files = file_bug668513.html
[test_bug797909.html]
[test_bug1045096.html]
[test_bug1121701.html]
+[test_bug1151421.html]
[test_bug1186774.html]
[test_forceinheritprincipal_overrule_owner.html]
[test_framedhistoryframes.html]
diff --git a/docshell/test/navigation/file_scrollRestoration.html b/docshell/test/navigation/file_scrollRestoration.html
index 5450c2724..92e43d7fb 100644
--- a/docshell/test/navigation/file_scrollRestoration.html
+++ b/docshell/test/navigation/file_scrollRestoration.html
@@ -26,7 +26,7 @@
}
case 2: {
opener.is(event.persisted, false, "Shouldn't have persisted session history entry.");
- opener.isnot(window.scrollY, 0, "Should have restored scrolling.");
+ opener.isnot(Math.round(window.scrollY), 0, "Should have restored scrolling.");
opener.is(history.scrollRestoration, "auto", "Should have the same scrollRestoration as before reload.");
history.scrollRestoration = "manual";
window.onunload = function() {} // Disable bfcache.
@@ -45,7 +45,7 @@
}
case 4: {
opener.is(event.persisted, true, "Should have persisted session history entry.");
- opener.isnot(window.scrollY, 0, "Should have kept the old scroll position.");
+ opener.isnot(Math.round(window.scrollY), 0, "Should have kept the old scroll position.");
opener.is(history.scrollRestoration, "manual", "Should have the same scrollRestoration as before reload.");
window.scrollTo(0, 0);
window.location.hash = "hash";
@@ -53,7 +53,7 @@
break;
}
case 5: {
- opener.isnot(window.scrollY, 0, "Should have scrolled to #hash.");
+ opener.isnot(Math.round(window.scrollY), 0, "Should have scrolled to #hash.");
opener.is(history.scrollRestoration, "manual", "Should have the same scrollRestoration mode as before fragment navigation.");
window.onunload = function() {} // Disable bfcache.
opener.setTimeout("is(testWindow.history.scrollRestoration, 'auto'); testWindow.history.back();", 250);
@@ -70,7 +70,7 @@
history.pushState({ state: "state2" }, "state2");
window.scrollTo(0, 0);
history.back();
- opener.isnot(window.scrollY, 0, "Should have scrolled back to the state1's position");
+ opener.isnot(Math.round(window.scrollY), 0, "Should have scrolled back to the state1's position");
opener.is(history.state.state, "state1", "Unexpected state.");
history.scrollRestoration = "manual";
@@ -79,17 +79,17 @@
history.pushState({ state: "state4" }, "state4");
window.scrollTo(0, 0);
history.back();
- opener.is(window.scrollY, 0, "Shouldn't have scrolled back to the state3's position");
+ opener.is(Math.round(window.scrollY), 0, "Shouldn't have scrolled back to the state3's position");
opener.is(history.state.state, "state3", "Unexpected state.");
history.pushState({ state: "state5" }, "state5");
history.scrollRestoration = "auto";
document.getElementById("bottom").scrollIntoView();
- opener.isnot(window.scrollY, 0, "Should have scrolled to 'bottom'.");
+ opener.isnot(Math.round(window.scrollY), 0, "Should have scrolled to 'bottom'.");
history.back();
window.scrollTo(0, 0);
history.forward();
- opener.isnot(window.scrollY, 0, "Should have scrolled back to the state5's position");
+ opener.isnot(Math.round(window.scrollY), 0, "Should have scrolled back to the state5's position");
var ifr = document.createElement("iframe");
ifr.src = "data:text/html,";
diff --git a/docshell/test/test_bug1151421.html b/docshell/test/test_bug1151421.html
new file mode 100644
index 000000000..76e34d502
--- /dev/null
+++ b/docshell/test/test_bug1151421.html
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1151421
+-->
+<head>
+ <title>Test for Bug 1151421</title>
+ <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1151421">Mozilla Bug 1151421</a>
+
+<script type="application/javascript">
+
+/** Test for Bug 1151421 **/
+SimpleTest.waitForExplicitFinish();
+
+function childLoad() {
+ // Spin the event loop so we leave the onload handler.
+ SimpleTest.executeSoon(childLoad2);
+}
+
+function childLoad2() {
+ let cw = iframe.contentWindow;
+ let content = cw.document.getElementById("content");
+
+ // Create a function to calculate an invariant.
+ let topPlusOffset = function()
+ {
+ return Math.round(content.getBoundingClientRect().top + cw.pageYOffset);
+ }
+
+ let initialTPO = topPlusOffset();
+
+ // Scroll the iframe to various positions, and check the TPO.
+ // Scrolling down to the bottom will adjust the page offset by a fractional amount.
+ let positions = [-100, 0.17, 0, 1.5, 10.41, 1e6, 12.1];
+
+ // Run some tests with scrollTo() and ensure we have the same invariant after scrolling.
+ positions.forEach(function(pos) {
+ cw.scrollTo(0, pos);
+ is(topPlusOffset(), initialTPO, "Top plus offset should remain invariant across scrolling.");
+ });
+
+ positions.reverse().forEach(function(pos) {
+ cw.scrollTo(0, pos);
+ is(topPlusOffset(), initialTPO, "(reverse) Top plus offset should remain invariant across scrolling.");
+ });
+
+ SimpleTest.finish();
+}
+
+</script>
+
+<!-- When the iframe loads, it calls childLoad(). -->
+<br>
+<iframe height='100px' id='iframe' src='file_bug1151421.html'></iframe>
+
+</body>
+</html>
diff --git a/docshell/test/test_bug1186774.html b/docshell/test/test_bug1186774.html
index 52ef5f62c..623e7996b 100644
--- a/docshell/test/test_bug1186774.html
+++ b/docshell/test/test_bug1186774.html
@@ -28,7 +28,7 @@ function runTest() {
}
child.onpopstate = function() {
- is(child.scrollY, 6000, "Shouldn't have scrolled before popstate");
+ is(Math.round(child.scrollY), 6000, "Shouldn't have scrolled before popstate");
child.close();
SimpleTest.finish();
}
diff --git a/docshell/test/test_bug590573.html b/docshell/test/test_bug590573.html
index aa6d3bd79..e218140ea 100644
--- a/docshell/test/test_bug590573.html
+++ b/docshell/test/test_bug590573.html
@@ -147,21 +147,21 @@ function* testBody()
popup.scroll(0, 100);
popup.history.pushState('', '', '?pushed');
- is(popup.scrollY, 100, "test 2");
+ is(Math.round(popup.scrollY), 100, "test 2");
popup.scroll(0, 200); // set state-2's position to 200
popup.history.back();
- is(popup.scrollY, 100, "test 3");
+ is(Math.round(popup.scrollY), 100, "test 3");
popup.scroll(0, 150); // set original page's position to 150
popup.history.forward();
- is(popup.scrollY, 200, "test 4");
+ is(Math.round(popup.scrollY), 200, "test 4");
popup.history.back();
- is(popup.scrollY, 150, "test 5");
+ is(Math.round(popup.scrollY), 150, "test 5");
popup.history.forward();
- is(popup.scrollY, 200, "test 6");
+ is(Math.round(popup.scrollY), 200, "test 6");
// At this point, the history looks like:
// PATH POSITION
@@ -202,13 +202,13 @@ function* testBody()
is(popup.location.search, "?pushed");
ok(popup.document.getElementById('div1'), 'page should have div1.');
- is(popup.scrollY, 200, "test 8");
+ is(Math.round(popup.scrollY), 200, "test 8");
popup.history.back();
- is(popup.scrollY, 150, "test 9");
+ is(Math.round(popup.scrollY), 150, "test 9");
popup.history.forward();
- is(popup.scrollY, 200, "test 10");
+ is(Math.round(popup.scrollY), 200, "test 10");
// Spin one last time...
setTimeout(pageLoad, 0);
diff --git a/docshell/test/test_bug653741.html b/docshell/test/test_bug653741.html
index f4d4587b8..a1faf5e2d 100644
--- a/docshell/test/test_bug653741.html
+++ b/docshell/test/test_bug653741.html
@@ -27,7 +27,7 @@ function childLoad2() {
// Save the Y offset. For sanity's sake, make sure it's not 0, because we
// should be at the bottom of the page!
- let origYOffset = cw.pageYOffset;
+ let origYOffset = Math.round(cw.pageYOffset);
ok(origYOffset != 0, 'Original Y offset is not 0.');
// Scroll the iframe to the top, then navigate to #bottom again.
@@ -37,7 +37,7 @@ function childLoad2() {
// bottom again.
cw.location = cw.location + '';
- is(cw.pageYOffset, origYOffset, 'Correct offset after reloading page.');
+ is(Math.round(cw.pageYOffset), origYOffset, 'Correct offset after reloading page.');
SimpleTest.finish();
}
diff --git a/docshell/test/test_bug662170.html b/docshell/test/test_bug662170.html
index 514bb55b1..0e626fed4 100644
--- a/docshell/test/test_bug662170.html
+++ b/docshell/test/test_bug662170.html
@@ -32,7 +32,7 @@ function childLoad2() {
cw.scrollTo(0, 300);
// Did we actually scroll somewhere?
- isnot(cw.pageYOffset, 0, 'Y offset should be non-zero after scrolling.');
+ isnot(Math.round(cw.pageYOffset), 0, 'Y offset should be non-zero after scrolling.');
// Now load file_bug662170.html#, which should take us to the top of the
// page.
diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp
index 290af152b..8b20d0196 100644
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -1854,16 +1854,6 @@ Navigator::GetUserAgent(nsPIDOMWindowInner* aWindow, nsIURI* aURI,
{
MOZ_ASSERT(NS_IsMainThread());
- if (!aIsCallerChrome) {
- const nsAdoptingString& override =
- mozilla::Preferences::GetString("general.useragent.override");
-
- if (override) {
- aUserAgent = override;
- return NS_OK;
- }
- }
-
nsresult rv;
nsCOMPtr<nsIHttpProtocolHandler>
service(do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http", &rv));
diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp
index 8ff4b84ce..f784031f6 100644
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -6187,7 +6187,7 @@ nsGlobalWindow::GetScrollMaxY(ErrorResult& aError)
FORWARD_TO_OUTER_OR_THROW(GetScrollBoundaryOuter, (eSideBottom), aError, 0);
}
-CSSIntPoint
+CSSPoint
nsGlobalWindow::GetScrollXY(bool aDoFlush)
{
MOZ_ASSERT(IsOuterWindow());
@@ -6211,30 +6211,30 @@ nsGlobalWindow::GetScrollXY(bool aDoFlush)
return GetScrollXY(true);
}
- return sf->GetScrollPositionCSSPixels();
+ return CSSPoint::FromAppUnits(scrollPos);
}
-int32_t
+double
nsGlobalWindow::GetScrollXOuter()
{
MOZ_RELEASE_ASSERT(IsOuterWindow());
return GetScrollXY(false).x;
}
-int32_t
+double
nsGlobalWindow::GetScrollX(ErrorResult& aError)
{
FORWARD_TO_OUTER_OR_THROW(GetScrollXOuter, (), aError, 0);
}
-int32_t
+double
nsGlobalWindow::GetScrollYOuter()
{
MOZ_RELEASE_ASSERT(IsOuterWindow());
return GetScrollXY(false).y;
}
-int32_t
+double
nsGlobalWindow::GetScrollY(ErrorResult& aError)
{
FORWARD_TO_OUTER_OR_THROW(GetScrollYOuter, (), aError, 0);
diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h
index eab91c2e4..dbceeab74 100644
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -1050,15 +1050,15 @@ public:
void SetInnerHeight(JSContext* aCx, JS::Handle<JS::Value> aValue,
mozilla::dom::CallerType aCallerType,
mozilla::ErrorResult& aError);
- int32_t GetScrollXOuter();
- int32_t GetScrollX(mozilla::ErrorResult& aError);
- int32_t GetPageXOffset(mozilla::ErrorResult& aError)
+ double GetScrollXOuter();
+ double GetScrollX(mozilla::ErrorResult& aError);
+ double GetPageXOffset(mozilla::ErrorResult& aError)
{
return GetScrollX(aError);
}
- int32_t GetScrollYOuter();
- int32_t GetScrollY(mozilla::ErrorResult& aError);
- int32_t GetPageYOffset(mozilla::ErrorResult& aError)
+ double GetScrollYOuter();
+ double GetScrollY(mozilla::ErrorResult& aError);
+ double GetPageYOffset(mozilla::ErrorResult& aError)
{
return GetScrollY(aError);
}
@@ -1579,7 +1579,7 @@ public:
// If aDoFlush is true, we'll flush our own layout; otherwise we'll try to
// just flush our parent and only flush ourselves if we think we need to.
// Outer windows only.
- mozilla::CSSIntPoint GetScrollXY(bool aDoFlush);
+ mozilla::CSSPoint GetScrollXY(bool aDoFlush);
int32_t GetScrollBoundaryOuter(mozilla::Side aSide);
diff --git a/dom/base/test/test_viewport_scroll.html b/dom/base/test/test_viewport_scroll.html
index 9b812360b..7db02b781 100644
--- a/dom/base/test/test_viewport_scroll.html
+++ b/dom/base/test/test_viewport_scroll.html
@@ -28,10 +28,10 @@ function subtest(winProp, elemProp, win, correctElement, elemToSet, otherElem1,
win.scrollTo(50, 50);
elemToSet[elemProp] = 100;
if (elemToSet == correctElement) {
- is(win[winProp], 100, "Setting " + elemToSet.name + "." + elemProp + " should scroll");
+ is(Math.round(win[winProp]), 100, "Setting " + elemToSet.name + "." + elemProp + " should scroll");
is(elemToSet[elemProp], 100, "Reading back " + elemToSet.name + "." + elemProp + " after scrolling");
} else {
- is(win[winProp], 50, "Setting " + elemToSet.name + "." + elemProp + " should not scroll");
+ is(Math.round(win[winProp]), 50, "Setting " + elemToSet.name + "." + elemProp + " should not scroll");
is(elemToSet[elemProp], 0, "Reading back " + elemToSet.name + "." + elemProp + " after not scrolling");
}
if (otherElem1 == correctElement) {
diff --git a/dom/browser-element/mochitest/browserElement_ScrollEvent.js b/dom/browser-element/mochitest/browserElement_ScrollEvent.js
index 5c4b4dcf9..06dc91b86 100644
--- a/dom/browser-element/mochitest/browserElement_ScrollEvent.js
+++ b/dom/browser-element/mochitest/browserElement_ScrollEvent.js
@@ -16,8 +16,8 @@ function runTest() {
iframe.addEventListener("mozbrowserscroll", function(e) {
ok(true, "got mozbrowserscroll event.");
ok(e.detail, "event.detail is not null.");
- ok(e.detail.top === 4000, "top position is correct.");
- ok(e.detail.left === 4000, "left position is correct.");
+ ok(Math.round(e.detail.top) == 4000, "top position is correct.");
+ ok(Math.round(e.detail.left) == 4000, "left position is correct.");
SimpleTest.finish();
});
diff --git a/dom/tests/mochitest/general/test_domWindowUtils_scrollXY.html b/dom/tests/mochitest/general/test_domWindowUtils_scrollXY.html
index c6ee89ee3..cf27e5d87 100644
--- a/dom/tests/mochitest/general/test_domWindowUtils_scrollXY.html
+++ b/dom/tests/mochitest/general/test_domWindowUtils_scrollXY.html
@@ -31,13 +31,13 @@
function checkGetScrollXYState(flush, vals, testName) {
let scrollX = {}, scrollY = {};
domWindowUtils.getScrollXY(flush, scrollX, scrollY);
- is(scrollX.value, vals[0], "getScrollXY x for test: " + testName);
- is(scrollY.value, vals[1], "getScrollXY y for test: " + testName);
+ is(Math.round(scrollX.value), vals[0], "getScrollXY x for test: " + testName);
+ is(Math.round(scrollY.value), vals[1], "getScrollXY y for test: " + testName);
}
function checkWindowScrollState(vals, testName) {
- is(cwindow.scrollX, vals[0], "scrollX for test: " + testName);
- is(cwindow.scrollY, vals[1], "scrollY for test: " + testName);
+ is(Math.round(cwindow.scrollX), vals[0], "scrollX for test: " + testName);
+ is(Math.round(cwindow.scrollY), vals[1], "scrollY for test: " + testName);
}
// Check initial state (0, 0)
@@ -67,8 +67,8 @@
let scrollX = {}, scrollY = {};
domWindowUtils.getScrollXY(false, scrollX, scrollY);
- is(scrollX.value, 0, "scrollX is zero for display:none iframe");
- is(scrollY.value, 0, "scrollY is zero for display:none iframe");
+ is(Math.round(scrollX.value), 0, "scrollX is zero for display:none iframe");
+ is(Math.round(scrollY.value), 0, "scrollY is zero for display:none iframe");
}
SimpleTest.waitForExplicitFinish();
diff --git a/dom/url/URL.h b/dom/url/URL.h
index 16b4678ba..45e4dd289 100644
--- a/dom/url/URL.h
+++ b/dom/url/URL.h
@@ -155,6 +155,12 @@ public:
GetHref(aRetval, aRv);
}
+ void
+ ToJSON(nsAString& aResult, ErrorResult& aRv) const
+ {
+ GetHref(aResult, aRv);
+ }
+
// URLSearchParamsObserver
void
URLSearchParamsUpdated(URLSearchParams* aSearchParams) override;
diff --git a/dom/url/tests/test_url.html b/dom/url/tests/test_url.html
index 3f3f727d6..d07a752bb 100644
--- a/dom/url/tests/test_url.html
+++ b/dom/url/tests/test_url.html
@@ -438,5 +438,11 @@
url = new URL("data:text/html,<a href=\"http://example.org/?q\">Link</a>");
is(url.href, "data:text/html,<a%20href=\"http://example.org/?q\">Link</a>");
</script>
+
+ <script>
+ var u = new URL('http://www.example.org');
+ ok(u.toJSON(), 'http://www.example.org', "URL.toJSON()");
+ is(JSON.stringify(u), "\"http://www.example.org/\"", "JSON.stringify(u) works");
+ </script>
</body>
</html>
diff --git a/dom/webidl/URL.webidl b/dom/webidl/URL.webidl
index 0baa9913c..4d491e1b3 100644
--- a/dom/webidl/URL.webidl
+++ b/dom/webidl/URL.webidl
@@ -44,9 +44,12 @@ interface URL {
attribute USVString pathname;
[Throws]
attribute USVString search;
- readonly attribute URLSearchParams searchParams;
+ [SameObject] readonly attribute URLSearchParams searchParams;
[Throws]
attribute USVString hash;
+
+ [Throws]
+ USVString toJSON();
};
partial interface URL {
diff --git a/dom/webidl/Window.webidl b/dom/webidl/Window.webidl
index 055a274cc..36b1f0313 100644
--- a/dom/webidl/Window.webidl
+++ b/dom/webidl/Window.webidl
@@ -182,14 +182,10 @@ partial interface Window {
[ChromeOnly] void mozScrollSnap();
// The four properties below are double per spec at the moment, but whether
// that will continue is unclear.
- //[Replaceable, Throws] readonly attribute double scrollX;
- //[Replaceable, Throws] readonly attribute double pageXOffset;
- //[Replaceable, Throws] readonly attribute double scrollY;
- //[Replaceable, Throws] readonly attribute double pageYOffset;
- [Replaceable, Throws] readonly attribute long scrollX;
- [Replaceable, Throws] readonly attribute long pageXOffset;
- [Replaceable, Throws] readonly attribute long scrollY;
- [Replaceable, Throws] readonly attribute long pageYOffset;
+ [Replaceable, Throws] readonly attribute double scrollX;
+ [Throws] readonly attribute double pageXOffset;
+ [Replaceable, Throws] readonly attribute double scrollY;
+ [Throws] readonly attribute double pageYOffset;
// client
// These are writable because we allow chrome to write them. And they need
diff --git a/layout/forms/test/test_bug562447.html b/layout/forms/test/test_bug562447.html
index 53f84428e..99f691871 100644
--- a/layout/forms/test/test_bug562447.html
+++ b/layout/forms/test/test_bug562447.html
@@ -23,7 +23,7 @@ addLoadEvent(function() {
setTimeout(function() {
// Make sure that we're scrolled by 5000px
- is(window.pageYOffset, 5000, "Make sure we're scrolled correctly");
+ is(Math.round(window.pageYOffset), 5000, "Make sure we're scrolled correctly");
// Scroll back up, and mess with the input box along the way
var input = document.getElementById("WhyDoYouFocusMe");
@@ -38,14 +38,14 @@ addLoadEvent(function() {
window.scrollTo(0, 5000);
setTimeout(function() {
- is(window.pageYOffset, 5000, "Sanity check");
+ is(Math.round(window.pageYOffset), 5000, "Sanity check");
window.scrollTo(0, 0);
input.focus();
input.blur();
setTimeout(function() {
- isnot(window.pageYOffset, 0, "This time we shouldn't be scrolled up");
+ isnot(Math.round(window.pageYOffset), 0, "This time we shouldn't be scrolled up");
SimpleTest.finish();
}, 0);
diff --git a/layout/forms/test/test_bug564115.html b/layout/forms/test/test_bug564115.html
index 5723b55d5..ffd4222ca 100644
--- a/layout/forms/test/test_bug564115.html
+++ b/layout/forms/test/test_bug564115.html
@@ -30,12 +30,12 @@ addLoadEvent(function() {
win.scrollTo(0, 5000);
setTimeout(function() {
- is(win.pageYOffset, 5000, "Page should be scrolled correctly");
+ is(Math.round(win.pageYOffset), 5000, "Page should be scrolled correctly");
// Refocus the window
SimpleTest.waitForFocus(function() {
SimpleTest.waitForFocus(function() {
- is(win.pageYOffset, 5000,
+ is(Math.round(win.pageYOffset), 5000,
"The page's scroll offset should not have been changed");
win.close();
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
index aaf50bff6..53891c608 100644
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -21,7 +21,10 @@
pref("keyword.enabled", false);
pref("general.useragent.locale", "chrome://global/locale/intl.properties");
+pref("general.useragent.compatMode.gecko", false);
pref("general.useragent.compatMode.firefox", false);
+pref("general.useragent.compatMode.version", "52.9");
+pref("general.useragent.appVersionIsBuildID", true);
// This pref exists only for testing purposes. In order to disable all
// overrides by default, don't initialize UserAgentOverrides.jsm.
diff --git a/netwerk/base/nsICryptoHash.idl b/netwerk/base/nsICryptoHash.idl
index cd865a3a9..ddd3103af 100644
--- a/netwerk/base/nsICryptoHash.idl
+++ b/netwerk/base/nsICryptoHash.idl
@@ -10,7 +10,7 @@ interface nsIInputStream;
* This interface provides crytographic hashing algorithms.
*/
-[scriptable, uuid(1e5b7c43-4688-45ce-92e1-77ed931e3bbe)]
+[scriptable, uuid(0a248513-dfa7-4474-8777-8c452d60dd04)]
interface nsICryptoHash : nsISupports
{
/**
@@ -25,6 +25,7 @@ interface nsICryptoHash : nsISupports
const short SHA256 = 4; /* String value: "sha256" */
const short SHA384 = 5; /* String value: "sha384" */
const short SHA512 = 6; /* String value: "sha512" */
+ const short SHA224 = 7; /* String value: "sha224" */
/**
* Initialize the hashing object. This method may be
diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp
index 1ddffabff..67e29a029 100644
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -199,8 +199,9 @@ nsHttpHandler::nsHttpHandler()
, mSessionStartTime(0)
, mLegacyAppName("Mozilla")
, mLegacyAppVersion("5.0")
- , mProduct("Gecko")
+ , mProduct("Goanna")
, mCompatFirefoxEnabled(false)
+ , mCompatFirefoxVersion("52.9")
, mUserAgentIsDirty(true)
, mPromptTempRedirect(true)
, mEnablePersistentHttpsCaching(false)
@@ -316,9 +317,13 @@ nsHttpHandler::Init()
nsHttpChannelAuthProvider::InitializePrefs();
- mMisc.AssignLiteral("rv:" MOZILLA_UAVERSION);
+ // rv: should have the Firefox/Gecko compatversion for web compatibility
+ mMisc.AssignLiteral("rv:");
+ mMisc += mCompatFirefoxVersion;
- mCompatFirefox.AssignLiteral("Firefox/" MOZILLA_UAVERSION);
+ mCompatGecko.AssignLiteral("Gecko/20100101");
+ mCompatFirefox.AssignLiteral("Firefox/");
+ mCompatFirefox += mCompatFirefoxVersion;
nsCOMPtr<nsIXULAppInfo> appInfo =
do_GetService("@mozilla.org/xre/app-info;1");
@@ -330,12 +335,30 @@ nsHttpHandler::Init()
if (mAppName.Length() == 0) {
appInfo->GetName(mAppName);
}
- appInfo->GetVersion(mAppVersion);
mAppName.StripChars(R"( ()<>@,;:\"/[]?={})");
+ }
+
+ nsCString dynamicBuildID;
+ if (appInfo) {
+ appInfo->GetPlatformBuildID(dynamicBuildID);
+ if (dynamicBuildID.Length() > 8 )
+ dynamicBuildID.Left(dynamicBuildID, 8);
+ }
+
+ if (mAppVersionIsBuildID) {
+ // Override BuildID
+ mAppVersion.AssignLiteral(MOZ_UA_BUILDID);
+ } else if (appInfo) {
+ appInfo->GetVersion(mAppVersion);
} else {
- mAppVersion.AssignLiteral(MOZ_APP_UA_VERSION);
+ // Fall back to platform if appInfo is unavailable
+ mAppVersion.AssignLiteral(MOZILLA_UAVERSION);
}
+ // If there's no override set, set it to the dynamic BuildID
+ if (mAppVersion.IsEmpty())
+ mAppVersion.Assign(dynamicBuildID);
+
mSessionStartTime = NowInSeconds();
mHandlerActive = true;
@@ -351,11 +374,11 @@ nsHttpHandler::Init()
mRequestContextService =
do_GetService("@mozilla.org/network/request-context-service;1");
-#if defined(ANDROID) || defined(MOZ_MULET)
+ // Goanna slice version
mProductSub.AssignLiteral(MOZILLA_UAVERSION);
-#else
- mProductSub.AssignLiteral("20100101");
-#endif
+
+ if (mProductSub.IsEmpty())
+ mProductSub.Assign(dynamicBuildID);
#if DEBUG
// dump user agent prefs
@@ -369,6 +392,7 @@ nsHttpHandler::Init()
LOG(("> app-name = %s\n", mAppName.get()));
LOG(("> app-version = %s\n", mAppVersion.get()));
LOG(("> compat-firefox = %s\n", mCompatFirefox.get()));
+ LOG(("> compat-gecko = %s\n", mCompatGecko.get()));
LOG(("> user-agent = %s\n", UserAgent().get()));
#endif
@@ -678,9 +702,10 @@ nsHttpHandler::BuildUserAgent()
mAppName.Length() +
mAppVersion.Length() +
mCompatFirefox.Length() +
+ mCompatGecko.Length() +
mCompatDevice.Length() +
mDeviceModelId.Length() +
- 13);
+ 14);
// Application portion
mUserAgent.Assign(mLegacyAppName);
@@ -710,6 +735,12 @@ nsHttpHandler::BuildUserAgent()
}
mUserAgent += mMisc;
mUserAgent += ')';
+
+ if(mCompatGeckoEnabled) {
+ // Provide frozen Gecko/20100101 slice
+ mUserAgent += ' ';
+ mUserAgent += mCompatGecko;
+ }
// Product portion
mUserAgent += ' ';
@@ -719,7 +750,7 @@ nsHttpHandler::BuildUserAgent()
bool isFirefox = mAppName.EqualsLiteral("Firefox");
if (isFirefox || mCompatFirefoxEnabled) {
- // "Firefox/x.y" (compatibility) app token
+ // Provide "Firefox/x.y" (compatibility) app token
mUserAgent += ' ';
mUserAgent += mCompatFirefox;
}
@@ -966,16 +997,44 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
bool cVar = false;
+ if (PREF_CHANGED(UA_PREF("appVersionIsBuildID"))) {
+ rv = prefs->GetBoolPref(UA_PREF("appVersionIsBuildID"), &cVar);
+ mAppVersionIsBuildID = (NS_SUCCEEDED(rv) && cVar);
+ mUserAgentIsDirty = true;
+ }
+
+ if (PREF_CHANGED(UA_PREF("compatMode.gecko"))) {
+ rv = prefs->GetBoolPref(UA_PREF("compatMode.gecko"), &cVar);
+ mCompatGeckoEnabled = (NS_SUCCEEDED(rv) && cVar);
+ mUserAgentIsDirty = true;
+ }
+
if (PREF_CHANGED(UA_PREF("compatMode.firefox"))) {
rv = prefs->GetBoolPref(UA_PREF("compatMode.firefox"), &cVar);
mCompatFirefoxEnabled = (NS_SUCCEEDED(rv) && cVar);
mUserAgentIsDirty = true;
}
+ // general.useragent.compatMode.version
+ // This is the version number used in rv: for Gecko compatibility
+ // and in the Firefox/nn.nn slice when compatMode.firefox is enabled.
+ if (PREF_CHANGED(UA_PREF("compatMode.version"))) {
+ prefs->GetCharPref(UA_PREF("compatMode.version"),
+ getter_Copies(mCompatFirefoxVersion));
+
+ // rebuild mMisc and compatMode slice
+ mMisc.AssignLiteral("rv:");
+ mMisc += mCompatFirefoxVersion;
+ mCompatFirefox.AssignLiteral("Firefox/");
+ mCompatFirefox += mCompatFirefoxVersion;
+
+ mUserAgentIsDirty = true;
+ }
+
// general.useragent.override
if (PREF_CHANGED(UA_PREF("override"))) {
prefs->GetCharPref(UA_PREF("override"),
- getter_Copies(mUserAgentOverride));
+ getter_Copies(mUserAgentOverride));
mUserAgentIsDirty = true;
}
diff --git a/netwerk/protocol/http/nsHttpHandler.h b/netwerk/protocol/http/nsHttpHandler.h
index 13cc72e8e..d51662db9 100644
--- a/netwerk/protocol/http/nsHttpHandler.h
+++ b/netwerk/protocol/http/nsHttpHandler.h
@@ -485,7 +485,11 @@ private:
nsXPIDLCString mProductSub;
nsXPIDLCString mAppName;
nsXPIDLCString mAppVersion;
+ bool mAppVersionIsBuildID;
+ nsCString mCompatGecko;
+ bool mCompatGeckoEnabled;
nsCString mCompatFirefox;
+ nsCString mCompatFirefoxVersion;
bool mCompatFirefoxEnabled;
nsXPIDLCString mCompatDevice;
nsCString mDeviceModelId;
diff --git a/old-configure.in b/old-configure.in
index 92a5f729e..4fbe49b96 100644
--- a/old-configure.in
+++ b/old-configure.in
@@ -5459,6 +5459,9 @@ fi
AC_SUBST(MOZ_APP_STATIC_INI)
+AC_DEFINE_UNQUOTED(MOZ_UA_BUILDID, "$MOZ_UA_BUILDID")
+AC_SUBST(MOZ_UA_BUILDID)
+
AC_SUBST(MOZ_PKG_SPECIAL)
AC_SUBST(MOZ_SIMPLE_PACKAGE_NAME)
diff --git a/python/mozbuild/mozbuild/milestone.py b/python/mozbuild/mozbuild/milestone.py
index c2aa78fcd..3ef55d540 100644
--- a/python/mozbuild/mozbuild/milestone.py
+++ b/python/mozbuild/mozbuild/milestone.py
@@ -43,6 +43,12 @@ def get_milestone_major(milestone):
return milestone.split('.')[0]
+def get_milestone_minor(milestone):
+ """
+ Returns the minor (second) part of the milestone.
+ """
+
+ return milestone.split('.')[1]
def main(args):
parser = argparse.ArgumentParser()
@@ -56,9 +62,9 @@ def main(args):
milestone = get_official_milestone(milestone_file)
if options.uaversion:
- # Only expose the major milestone in the UA string, hide the patch
- # level (bugs 572659 and 870868).
- uaversion = "%s.0" % (get_milestone_major(milestone),)
+ # Only expose the major+minor milestone in the UA string.
+ uaversion = "%s.%s" % (get_milestone_major(milestone),
+ get_milestone_minor(milestone))
print(uaversion)
elif options.symbolversion:
diff --git a/services/crypto/modules/utils.js b/services/crypto/modules/utils.js
index c17f5dfa1..e3a77ad0a 100644
--- a/services/crypto/modules/utils.js
+++ b/services/crypto/modules/utils.js
@@ -77,43 +77,6 @@ this.CryptoUtils = {
},
/**
- * UTF-8 encode a message and perform a SHA-1 over it.
- *
- * @param message
- * (string) Buffer to perform operation on. Should be a JS string.
- * It is possible to pass in a string representing an array
- * of bytes. But, you probably don't want to UTF-8 encode
- * such data and thus should not be using this function.
- *
- * @return string
- * Raw bytes constituting SHA-1 hash. Value is a JS string. Each
- * character is the byte value for that offset. Returned string
- * always has .length == 20.
- */
- UTF8AndSHA1: function UTF8AndSHA1(message) {
- let hasher = Cc["@mozilla.org/security/hash;1"]
- .createInstance(Ci.nsICryptoHash);
- hasher.init(hasher.SHA1);
-
- return CryptoUtils.digestUTF8(message, hasher);
- },
-
- sha1: function sha1(message) {
- return CommonUtils.bytesAsHex(CryptoUtils.UTF8AndSHA1(message));
- },
-
- sha1Base32: function sha1Base32(message) {
- return CommonUtils.encodeBase32(CryptoUtils.UTF8AndSHA1(message));
- },
-
- sha256(message) {
- let hasher = Cc["@mozilla.org/security/hash;1"]
- .createInstance(Ci.nsICryptoHash);
- hasher.init(hasher.SHA256);
- return CommonUtils.bytesAsHex(CryptoUtils.digestUTF8(message, hasher));
- },
-
- /**
* Produce an HMAC key object from a key string.
*/
makeHMACKey: function makeHMACKey(str) {
@@ -187,9 +150,8 @@ this.CryptoUtils = {
hmacAlg=Ci.nsICryptoHMAC.SHA1, hmacLen=20) {
// We don't have a default in the algo itself, as NSS does.
- // Use the constant.
if (!dkLen) {
- dkLen = SYNC_KEY_DECODED_LENGTH;
+ throw new Error("dkLen should be defined");
}
function F(S, c, i, h) {
@@ -551,6 +513,48 @@ this.CryptoUtils = {
};
+/**
+ * Hashing Algorithms SHA-X.
+ * These values map directly onto the values defined
+ * in netwerk/base/nsICryptoHash.idl.
+ */
+let shaX = ["1", "256", "384", "512", "224"];
+
+for (let shaIdx = 0, shaIdxLen = shaX.length; shaIdx < shaIdxLen; shaIdx++) {
+ let shaXIdx = shaX[shaIdx];
+
+ /**
+ * UTF-8 encode a message and perform a SHA-X over it.
+ *
+ * @param message
+ * (string) Buffer to perform operation on. Should be a JS string.
+ * It is possible to pass in a string representing an array
+ * of bytes. But, you probably don't want to UTF-8 encode
+ * such data and thus should not be using this function.
+ *
+ * @return string
+ * Raw bytes constituting SHA-X hash. Value is a JS string.
+ * Each character is the byte value for that offset.
+ */
+ CryptoUtils["UTF8AndSHA" + shaXIdx] = function (message) {
+ let hasher = Cc["@mozilla.org/security/hash;1"]
+ .createInstance(Ci.nsICryptoHash);
+ hasher.init(hasher["SHA" + shaXIdx]);
+
+ return CryptoUtils.digestUTF8(message, hasher);
+ };
+
+ CryptoUtils["sha" + shaXIdx] = function (message) {
+ return CommonUtils.bytesAsHex(
+ CryptoUtils["UTF8AndSHA" + shaXIdx](message));
+ };
+
+ CryptoUtils["sha" + shaXIdx + "Base32"] = function (message) {
+ return CommonUtils.encodeBase32(
+ CryptoUtils["UTF8AndSHA" + shaXIdx](message));
+ };
+}
+
XPCOMUtils.defineLazyGetter(CryptoUtils, "_utf8Converter", function() {
let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
.createInstance(Ci.nsIScriptableUnicodeConverter);
diff --git a/toolkit/components/alerts/resources/content/alert.js b/toolkit/components/alerts/resources/content/alert.js
index 523ec378e..ead4d503f 100644
--- a/toolkit/components/alerts/resources/content/alert.js
+++ b/toolkit/components/alerts/resources/content/alert.js
@@ -7,7 +7,21 @@ var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/Services.jsm");
-// Copied from nsILookAndFeel.h, see comments on eMetric_AlertNotificationOrigin
+/*
+ * This indicates from which corner of the screen alerts slide in,
+ * and from which direction (horizontal/vertical).
+ * 0, the default, represents bottom right, sliding vertically.
+ * Use any bitwise combination of the following constants:
+ * NS_ALERT_HORIZONTAL (1), NS_ALERT_LEFT (2), NS_ALERT_TOP (4).
+ *
+ * 6 4
+ * +-----------+
+ * 7| |5
+ * | |
+ * 3| |1
+ * +-----------+
+ * 2 0
+ */
const NS_ALERT_HORIZONTAL = 1;
const NS_ALERT_LEFT = 2;
const NS_ALERT_TOP = 4;
@@ -41,6 +55,8 @@ function prefillAlertInfo() {
// arguments[11] -> the nsIURI.hostPort of the origin, optional
// arguments[12] -> the alert icon URL, optional
+ document.getElementById('alertTime').setAttribute('value', (new Date).getTime());
+
switch (window.arguments.length) {
default:
case 13: {
@@ -235,7 +251,15 @@ function moveWindowToEnd() {
let windows = Services.wm.getEnumerator("alert:alert");
while (windows.hasMoreElements()) {
let alertWindow = windows.getNext();
- if (alertWindow != window) {
+ let alertWindowTime = Number(
+ alertWindow.document.getElementById('alertTime').getAttribute('value'));
+ let windowTime = Number(
+ window.document.getElementById('alertTime').getAttribute('value'));
+ // The time of window creation.
+ // Otherwise calling the notification twice (and more) in a row
+ // does not work.
+ // See https://bugzilla.mozilla.org/show_bug.cgi?id=1263155
+ if ((alertWindow != window) && (alertWindowTime <= windowTime)) {
if (gOrigin & NS_ALERT_TOP) {
y = Math.max(y, alertWindow.screenY + alertWindow.outerHeight - WINDOW_SHADOW_SPREAD);
} else {
diff --git a/toolkit/components/alerts/resources/content/alert.xul b/toolkit/components/alerts/resources/content/alert.xul
index 8597d9954..1549f4530 100644
--- a/toolkit/components/alerts/resources/content/alert.xul
+++ b/toolkit/components/alerts/resources/content/alert.xul
@@ -24,6 +24,7 @@
<script type="application/javascript" src="chrome://global/content/alerts/alert.js"/>
<vbox id="alertBox" class="alertBox">
+ <label id="alertTime" value="" hidden="true"/>
<box id="alertTitleBox">
<image id="alertIcon"/>
<label id="alertTitleLabel" class="alertTitle plain" crop="end"/>
diff --git a/toolkit/content/mozilla.xhtml b/toolkit/content/mozilla.xhtml
index 1ffde19e4..2acfc9f5d 100644
--- a/toolkit/content/mozilla.xhtml
+++ b/toolkit/content/mozilla.xhtml
@@ -13,7 +13,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset='utf-8' />
- <title>&mozilla.title.15.1;</title>
+ <title>&chronicles.title.55.2;</title>
<style>
html {
@@ -54,11 +54,11 @@ a {
<section>
<p id="moztext">
- &mozilla.quote.15.1;
+ &chronicles.quote.55.2;
</p>
<p id="from">
- &mozilla.from.15.1;
+ &chronicles.from.55.2;
</p>
</section>
diff --git a/toolkit/locales/en-US/chrome/global/mozilla.dtd b/toolkit/locales/en-US/chrome/global/mozilla.dtd
index 74ae40d44..038d8eb75 100644
--- a/toolkit/locales/en-US/chrome/global/mozilla.dtd
+++ b/toolkit/locales/en-US/chrome/global/mozilla.dtd
@@ -2,13 +2,13 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<!ENTITY mozilla.title.15.1
-'The Book of Mozilla, 15:1'>
+<!ENTITY chronicles.title.55.2
+'The Chronicles of the Pale Moon, 55:2'>
-<!ENTITY mozilla.quote.15.1
-'The <em>twins</em> of Mammon quarrelled. Their warring plunged the world into a <em>new darkness</em>, and the beast
-abhorred the darkness. So it began to move <em>swiftly</em>, and grew more powerful, and went forth and multiplied.
-And the beasts brought <em>fire</em> and light to the darkness.'>
+<!ENTITY chronicles.quote.55.2
+'And so, our focus was drawn through time and space to the <em>emerging dragon</em> who would not abandon hope.<br/>
+Its resilience, stubbornness and spirit unbroken, and searching for long hours to find those willing to <em>join</em> its cause.<br/>
+The old nest abandoned, the death throes of the Beast ignored, and more determined than ever to find glory in the future.'>
-<!ENTITY mozilla.from.15.1
-'from <strong>The Book of Mozilla,</strong> 15:1'>
+<!ENTITY chronicles.from.55.2
+'from <strong>The Chronicles of the Pale Moon,</strong> 55:2'>