From b6354a7a37a8890707e1625160e20cbc1a35503e Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 4 Dec 2020 16:37:02 +0000 Subject: [PATCH 01/13] Issue #1694 - Part 1: Use scriptabledateformat for the Cookie Accept dialog. --- .../cookie/content/cookieAcceptDialog.js | 30 +++++++++++++++---- .../cookie/cookieAcceptDialog.properties | 2 ++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/toolkit/components/cookie/content/cookieAcceptDialog.js b/toolkit/components/cookie/content/cookieAcceptDialog.js index 4b322e95d9..5f5760305a 100644 --- a/toolkit/components/cookie/content/cookieAcceptDialog.js +++ b/toolkit/components/cookie/content/cookieAcceptDialog.js @@ -13,6 +13,7 @@ Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); var params; var cookieBundle; +var gDateService = null; var showDetails = ""; var hideDetails = ""; @@ -38,6 +39,14 @@ function onload() document.getElementById("cancel").setAttribute("icon", "cancel"); document.getElementById("disclosureButton").setAttribute("icon", "properties"); + // Initialize the date formatter + if (!gDateService) { + const nsScriptableDateFormat_CONTRACTID = "@mozilla.org/intl/scriptabledateformat;1"; + const nsIScriptableDateFormat = Components.interfaces.nsIScriptableDateFormat; + gDateService = Components.classes[nsScriptableDateFormat_CONTRACTID] + .getService(nsIScriptableDateFormat); + } + cookieBundle = document.getElementById("cookieBundle"); // cache strings @@ -174,12 +183,21 @@ function cookieDeny() function GetExpiresString(secondsUntilExpires) { if (secondsUntilExpires) { var date = new Date(1000*secondsUntilExpires); - const locale = Components.classes["@mozilla.org/chrome/chrome-registry;1"] - .getService(Components.interfaces.nsIXULChromeRegistry) - .getSelectedLocale("global", true); - const dtOptions = { year: 'numeric', month: 'long', day: 'numeric', - hour: 'numeric', minute: 'numeric', second: 'numeric' }; - return date.toLocaleString(locale, dtOptions); + + // if a server manages to set a really long-lived cookie, the dateservice + // can't cope with it properly, so we'll return a descriptive string instead. + var expiry = ""; + try { + expiry = gDateService.FormatDateTime("", gDateService.dateFormatLong, + gDateService.timeFormatSeconds, + date.getFullYear(), date.getMonth()+1, + date.getDate(), date.getHours(), + date.getMinutes(), date.getSeconds()); + } catch (ex) { + // Expiry duration was out of range for the date formatter, meaning a silly long time. + expiry = cookieBundle.getString("expireInAVeryLongTime"); + } + return expiry; } return cookieBundle.getString("expireAtEndOfSession"); } diff --git a/toolkit/locales/en-US/chrome/cookie/cookieAcceptDialog.properties b/toolkit/locales/en-US/chrome/cookie/cookieAcceptDialog.properties index bba1214986..698c6f010d 100644 --- a/toolkit/locales/en-US/chrome/cookie/cookieAcceptDialog.properties +++ b/toolkit/locales/en-US/chrome/cookie/cookieAcceptDialog.properties @@ -7,6 +7,8 @@ domainColon=Domain: forSecureOnly=Encrypted connections only forAnyConnection=Any type of connection expireAtEndOfSession=At end of session +# LOCALIZATION NOTE (expireInAVeryLongTime) This string is used if a cookie won't expire for a literal life age and then some. +expireInAVeryLongTime=Not in your lifetime showDetails=Show Details hideDetails=Hide Details From ec967555896a11fe219c08aba41c33bd7f31e8f2 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 4 Dec 2020 16:41:24 +0000 Subject: [PATCH 02/13] Issue #1694 - Part 2: Use scriptabledateformat for Update History display. --- toolkit/mozapps/update/content/history.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/toolkit/mozapps/update/content/history.js b/toolkit/mozapps/update/content/history.js index c5bbccefcf..809eee4782 100644 --- a/toolkit/mozapps/update/content/history.js +++ b/toolkit/mozapps/update/content/history.js @@ -58,13 +58,18 @@ var gUpdateHistory = { * @returns A human readable date string */ _formatDate: function(seconds) { + var sdf = + Components.classes["@mozilla.org/intl/scriptabledateformat;1"]. + getService(Components.interfaces.nsIScriptableDateFormat); var date = new Date(seconds); - const locale = Components.classes["@mozilla.org/chrome/chrome-registry;1"] - .getService(Components.interfaces.nsIXULChromeRegistry) - .getSelectedLocale("global", true); - const dtOptions = { year: 'numeric', month: 'long', day: 'numeric', - hour: 'numeric', minute: 'numeric', second: 'numeric' }; - return date.toLocaleString(locale, dtOptions); + return sdf.FormatDateTime("", sdf.dateFormatLong, + sdf.timeFormatSeconds, + date.getFullYear(), + date.getMonth() + 1, + date.getDate(), + date.getHours(), + date.getMinutes(), + date.getSeconds()); } }; From b1d1a02c6cec17adebe535fcba8f5f09d793b6b0 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 4 Dec 2020 18:11:46 +0000 Subject: [PATCH 03/13] [Basilisk] Issue #31 - Part 1: Use nsIScriptableDateFormat in Page Info. --- .../basilisk/base/content/pageinfo/pageInfo.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/application/basilisk/base/content/pageinfo/pageInfo.js b/application/basilisk/base/content/pageinfo/pageInfo.js index 7a6d0a0630..98e567cb44 100644 --- a/application/basilisk/base/content/pageinfo/pageInfo.js +++ b/application/basilisk/base/content/pageinfo/pageInfo.js @@ -1051,16 +1051,18 @@ function formatNumber(number) function formatDate(datestr, unknown) { + // scriptable date formatter, for pretty printing dates + var dateService = Components.classes["@mozilla.org/intl/scriptabledateformat;1"] + .getService(Components.interfaces.nsIScriptableDateFormat); + var date = new Date(datestr); if (!date.valueOf()) return unknown; - const locale = Components.classes["@mozilla.org/chrome/chrome-registry;1"] - .getService(Components.interfaces.nsIXULChromeRegistry) - .getSelectedLocale("global", true); - const dtOptions = { year: 'numeric', month: 'long', day: 'numeric', - hour: 'numeric', minute: 'numeric', second: 'numeric' }; - return date.toLocaleString(locale, dtOptions); + return dateService.FormatDateTime("", dateService.dateFormatLong, + dateService.timeFormatSeconds, + date.getFullYear(), date.getMonth()+1, date.getDate(), + date.getHours(), date.getMinutes(), date.getSeconds()); } function doCopy() From ad9127aad4934d0c79a188b0ffdb5528f420faf2 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 4 Dec 2020 18:12:10 +0000 Subject: [PATCH 04/13] [Basilisk] Issue #31 - Part 2: Use nsIScriptableDateFormat in feeds. --- .../basilisk/components/feeds/FeedWriter.js | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/application/basilisk/components/feeds/FeedWriter.js b/application/basilisk/components/feeds/FeedWriter.js index ceb2a7e2f6..d208ee5960 100644 --- a/application/basilisk/components/feeds/FeedWriter.js +++ b/application/basilisk/components/feeds/FeedWriter.js @@ -185,20 +185,11 @@ FeedWriter.prototype = { if (!dateObj.getTime()) return false; - return this._dateFormatter.format(dateObj); - }, - - __dateFormatter: null, - get _dateFormatter() { - if (!this.__dateFormatter) { - const locale = Cc["@mozilla.org/chrome/chrome-registry;1"] - .getService(Ci.nsIXULChromeRegistry) - .getSelectedLocale("global", true); - const dtOptions = { year: 'numeric', month: 'long', day: 'numeric', - hour: 'numeric', minute: 'numeric' }; - this.__dateFormatter = new Intl.DateTimeFormat(locale, dtOptions); - } - return this.__dateFormatter; + let dateService = Cc["@mozilla.org/intl/scriptabledateformat;1"]. + getService(Ci.nsIScriptableDateFormat); + return dateService.FormatDateTime("", dateService.dateFormatLong, dateService.timeFormatNoSeconds, + dateObj.getFullYear(), dateObj.getMonth()+1, dateObj.getDate(), + dateObj.getHours(), dateObj.getMinutes(), dateObj.getSeconds()); }, /** From 443bc25ce0d08743521e00d6513724f4edd00f6c Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 4 Dec 2020 18:13:16 +0000 Subject: [PATCH 05/13] [Basilisk] Issue #31 - Part 3: Use nsIScriptableDateFormat in places library window. --- .../components/places/content/places.js | 15 +++--- .../components/places/content/treeView.js | 47 +++++++------------ 2 files changed, 27 insertions(+), 35 deletions(-) diff --git a/application/basilisk/components/places/content/places.js b/application/basilisk/components/places/content/places.js index c0df8732c7..30b4b7b462 100644 --- a/application/basilisk/components/places/content/places.js +++ b/application/basilisk/components/places/content/places.js @@ -409,11 +409,8 @@ var PlacesOrganizer = { populateRestoreMenu: function() { let restorePopup = document.getElementById("fileRestorePopup"); - const locale = Cc["@mozilla.org/chrome/chrome-registry;1"] - .getService(Ci.nsIXULChromeRegistry) - .getSelectedLocale("global", true); - const dtOptions = { year: 'numeric', month: 'long', day: 'numeric' }; - let dateFormatter = new Intl.DateTimeFormat(locale, dtOptions); + let dateSvc = Cc["@mozilla.org/intl/scriptabledateformat;1"]. + getService(Ci.nsIScriptableDateFormat); // Remove existing menu items. Last item is the restoreFromFile item. while (restorePopup.childNodes.length > 1) @@ -445,7 +442,13 @@ var PlacesOrganizer = { let backupDate = PlacesBackups.getDateForFile(backupFiles[i]); let m = restorePopup.insertBefore(document.createElement("menuitem"), document.getElementById("restoreFromFile")); - m.setAttribute("label", dateFormatter.format(backupDate) + sizeInfo); + m.setAttribute("label", + dateSvc.FormatDate("", + Ci.nsIScriptableDateFormat.dateFormatLong, + backupDate.getFullYear(), + backupDate.getMonth() + 1, + backupDate.getDate()) + + sizeInfo); m.setAttribute("value", OS.Path.basename(backupFiles[i])); m.setAttribute("oncommand", "PlacesOrganizer.onRestoreMenuItemClick(this);"); diff --git a/application/basilisk/components/places/content/treeView.js b/application/basilisk/components/places/content/treeView.js index 810c4ab8c1..dc1f829bbf 100644 --- a/application/basilisk/components/places/content/treeView.js +++ b/application/basilisk/components/places/content/treeView.js @@ -33,6 +33,15 @@ PlacesTreeView.prototype = { return this.__xulStore; }, + __dateService: null, + get _dateService() { + if (!this.__dateService) { + this.__dateService = Cc["@mozilla.org/intl/scriptabledateformat;1"]. + getService(Ci.nsIScriptableDateFormat); + } + return this.__dateService; + }, + QueryInterface: XPCOMUtils.generateQI(PTV_interfaces), // Bug 761494: @@ -495,36 +504,16 @@ PlacesTreeView.prototype = { let midnight = now - (now % MS_PER_DAY); midnight += new Date(midnight).getTimezoneOffset() * MS_PER_MINUTE; + let dateFormat = timeMs >= midnight ? + Ci.nsIScriptableDateFormat.dateFormatNone : + Ci.nsIScriptableDateFormat.dateFormatShort; + let timeObj = new Date(timeMs); - return timeMs >= midnight ? this._todayFormatter.format(timeObj) - : this._dateFormatter.format(timeObj); - }, - - // We use a different formatter for times within the current day, - // so we cache both a "today" formatter and a general date formatter. - __todayFormatter: null, - get _todayFormatter() { - if (!this.__todayFormatter) { - const locale = Cc["@mozilla.org/chrome/chrome-registry;1"] - .getService(Ci.nsIXULChromeRegistry) - .getSelectedLocale("global", true); - const dtOptions = { hour: 'numeric', minute: 'numeric' }; - this.__todayFormatter = new Intl.DateTimeFormat(locale, dtOptions); - } - return this.__todayFormatter; - }, - - __dateFormatter: null, - get _dateFormatter() { - if (!this.__dateFormatter) { - const locale = Cc["@mozilla.org/chrome/chrome-registry;1"] - .getService(Ci.nsIXULChromeRegistry) - .getSelectedLocale("global", true); - const dtOptions = { year: 'numeric', month: 'numeric', day: 'numeric', - hour: 'numeric', minute: 'numeric' }; - this.__dateFormatter = new Intl.DateTimeFormat(locale, dtOptions); - } - return this.__dateFormatter; + return (this._dateService.FormatDateTime("", dateFormat, + Ci.nsIScriptableDateFormat.timeFormatNoSeconds, + timeObj.getFullYear(), timeObj.getMonth() + 1, + timeObj.getDate(), timeObj.getHours(), + timeObj.getMinutes(), timeObj.getSeconds())); }, COLUMN_TYPE_UNKNOWN: 0, From 76fca5f9906709ffaa40336ee6080c1a1d59c773 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Fri, 4 Dec 2020 18:13:56 +0000 Subject: [PATCH 06/13] [Basilisk] Issue #31 - Part 4: Use nsIScriptableDateFormat in cookie preferences. --- .../basilisk/components/preferences/cookies.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/application/basilisk/components/preferences/cookies.js b/application/basilisk/components/preferences/cookies.js index d44e9ee8a9..b63072bc0d 100644 --- a/application/basilisk/components/preferences/cookies.js +++ b/application/basilisk/components/preferences/cookies.js @@ -12,6 +12,8 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); var gCookiesWindow = { _cm : Components.classes["@mozilla.org/cookiemanager;1"] .getService(Components.interfaces.nsICookieManager), + _ds : Components.classes["@mozilla.org/intl/scriptabledateformat;1"] + .getService(Components.interfaces.nsIScriptableDateFormat), _hosts : {}, _hostOrder : [], _tree : null, @@ -490,12 +492,14 @@ var gCookiesWindow = { formatExpiresString: function (aExpires) { if (aExpires) { var date = new Date(1000 * aExpires); - const locale = Components.classes["@mozilla.org/chrome/chrome-registry;1"] - .getService(Components.interfaces.nsIXULChromeRegistry) - .getSelectedLocale("global", true); - const dtOptions = { year: 'numeric', month: 'long', day: 'numeric', - hour: 'numeric', minute: 'numeric', second: 'numeric' }; - return date.toLocaleString(locale, dtOptions); + return this._ds.FormatDateTime("", this._ds.dateFormatLong, + this._ds.timeFormatSeconds, + date.getFullYear(), + date.getMonth() + 1, + date.getDate(), + date.getHours(), + date.getMinutes(), + date.getSeconds()); } return this._bundle.getString("expireAtEndOfSession"); }, From 48f962a66f1bf9afc0054b36a60d0c8dd560737e Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sat, 19 Dec 2020 21:56:53 +0000 Subject: [PATCH 07/13] [Pale-Moon] Issue #1854 - Account for users disabling off-line and memory caching. Resolves #1854 --- application/palemoon/base/content/browser.js | 7 ++- .../components/preferences/advanced.js | 58 ++++++++++++------- 2 files changed, 43 insertions(+), 22 deletions(-) diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js index d62228a8b3..ac8d2cea40 100644 --- a/application/palemoon/base/content/browser.js +++ b/application/palemoon/base/content/browser.js @@ -5893,7 +5893,12 @@ var OfflineApps = { var cacheService = Cc["@mozilla.org/network/application-cache-service;1"] .getService(Ci.nsIApplicationCacheService); if (!groups) { - groups = cacheService.getGroups(); + try { + groups = cacheService.getGroups(); + } catch(ex) { + // Cache disabled. + return 0; + } } var usage = 0; diff --git a/application/palemoon/components/preferences/advanced.js b/application/palemoon/components/preferences/advanced.js index 59c12890a3..9986ca1e7e 100644 --- a/application/palemoon/components/preferences/advanced.js +++ b/application/palemoon/components/preferences/advanced.js @@ -283,7 +283,11 @@ var gAdvancedPane = { Components.classes["@mozilla.org/netwerk/cache-storage-service;1"] .getService(Components.interfaces.nsICacheStorageService); var storage = cacheService.appCacheStorage(LoadContextInfo.default, null); - storage.asyncVisitStorage(visitor, false); + try { + storage.asyncVisitStorage(visitor, false); + } catch(ex) { + // Service unavailable: user most likely crippled the cache. + } }, updateCacheSizeUI: function(smartSizeEnabled) @@ -393,8 +397,14 @@ var gAdvancedPane = { { var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"]. getService(Components.interfaces.nsIApplicationCacheService); - if (!groups) - groups = cacheService.getGroups(); + if (!groups) { + try { + groups = cacheService.getGroups(); + } catch(ex) { + // Cache disabled. + return 0; + } + } var ios = Components.classes["@mozilla.org/network/io-service;1"]. getService(Components.interfaces.nsIIOService); @@ -426,27 +436,33 @@ var gAdvancedPane = { var cacheService = Components.classes["@mozilla.org/network/application-cache-service;1"]. getService(Components.interfaces.nsIApplicationCacheService); - var groups = cacheService.getGroups(); + + try { + var groups = cacheService.getGroups(); - var bundle = document.getElementById("bundlePreferences"); + var bundle = document.getElementById("bundlePreferences"); - var enumerator = pm.enumerator; - while (enumerator.hasMoreElements()) { - var perm = enumerator.getNext().QueryInterface(Components.interfaces.nsIPermission); - if (perm.type == "offline-app" && - perm.capability != Components.interfaces.nsIPermissionManager.DEFAULT_ACTION && - perm.capability != Components.interfaces.nsIPermissionManager.DENY_ACTION) { - var row = document.createElement("listitem"); - row.id = ""; - row.className = "offlineapp"; - row.setAttribute("origin", perm.principal.origin); - var converted = DownloadUtils. - convertByteUnits(this._getOfflineAppUsage(perm, groups)); - row.setAttribute("usage", - bundle.getFormattedString("offlineAppUsage", - converted)); - list.appendChild(row); + var enumerator = pm.enumerator; + while (enumerator.hasMoreElements()) { + var perm = enumerator.getNext().QueryInterface(Components.interfaces.nsIPermission); + if (perm.type == "offline-app" && + perm.capability != Components.interfaces.nsIPermissionManager.DEFAULT_ACTION && + perm.capability != Components.interfaces.nsIPermissionManager.DENY_ACTION) { + var row = document.createElement("listitem"); + row.id = ""; + row.className = "offlineapp"; + row.setAttribute("origin", perm.principal.origin); + var converted = DownloadUtils. + convertByteUnits(this._getOfflineAppUsage(perm, groups)); + row.setAttribute("usage", + bundle.getFormattedString("offlineAppUsage", + converted)); + list.appendChild(row); + } } + } catch(ex) { + // Cache service unavailable/errored, off-line app cache is disabled or 0 + // Do nothing, just leave the box blank. } }, From f1eb2c5cfbe2bedd7a81dc0cab733e22e076b332 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Tue, 15 Dec 2020 09:04:21 +0000 Subject: [PATCH 08/13] [network] Update port blacklist. See BZ bugs 1674735, 1677047, 1677940 and 1676868 for details. --- netwerk/base/nsIOService.cpp | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/netwerk/base/nsIOService.cpp b/netwerk/base/nsIOService.cpp index 314f2aeffd..a953dc78c1 100644 --- a/netwerk/base/nsIOService.cpp +++ b/netwerk/base/nsIOService.cpp @@ -108,6 +108,7 @@ int16_t gBadPortList[] = { 42, // name 43, // nicname 53, // domain + 69, // TFTP 77, // priv-rjs 79, // finger 87, // ttylink @@ -125,8 +126,10 @@ int16_t gBadPortList[] = { 119, // nntp 123, // NTP 135, // loc-srv / epmap + 137, // netbios 139, // netbios 143, // imap2 + 161, // SNMP 179, // BGP 389, // ldap 465, // smtp+ssl @@ -138,24 +141,32 @@ int16_t gBadPortList[] = { 530, // courier 531, // Chat 532, // netnews - 540, // uucp + 540, // uucp + 554, // rtsp 556, // remotefs 563, // nntp+ssl - 587, // - 601, // + 587, // smtp (outgoing) + 601, // syslog-conn 636, // ldap+ssl 993, // imap+ssl 995, // pop3+ssl + 1719, // h323 (RAS) + 1720, // h323 (hostcall) + 1723, // pptp 2049, // nfs - 3659, // apple-sasl / PasswordServer + 3659, // apple-sasl / PasswordServer 4045, // lockd + 5060, // sip + 5061, // sips 6000, // x11 - 6665, // Alternate IRC [Apple addition] - 6666, // Alternate IRC [Apple addition] - 6667, // Standard IRC [Apple addition] - 6668, // Alternate IRC [Apple addition] - 6669, // Alternate IRC [Apple addition] - 0, // This MUST be zero so that we can populating the array + 6566, // SANE + 6665, // Alternate IRC [Apple addition] + 6666, // Alternate IRC [Apple addition] + 6667, // Standard IRC [Apple addition] + 6668, // Alternate IRC [Apple addition] + 6669, // Alternate IRC [Apple addition] + 10080,// Amanda + 0, // Sentinel value: This MUST be zero }; static const char kProfileChangeNetTeardownTopic[] = "profile-change-net-teardown"; From 873a58c4d5c27988de8b114294182a1be52c2b9f Mon Sep 17 00:00:00 2001 From: Moonchild Date: Tue, 15 Dec 2020 10:30:06 +0000 Subject: [PATCH 09/13] Issue #1696 - Propagate flex sizes to the table wrapper This avoids overlapping of table styled elements inside flexboxes as used on some websites. Resolves #1696 --- layout/style/res/ua.css | 3 + .../table-item-flex-percentage-width.html.ini | 3 + .../table-item-flex-percentage-width-ref.html | 140 +++++++++++++++++ .../table-item-flex-percentage-width.html | 144 ++++++++++++++++++ 4 files changed, 290 insertions(+) create mode 100644 testing/web-platform/meta/css/css-flexbox/table-item-flex-percentage-width.html.ini create mode 100644 testing/web-platform/tests/css/css-flexbox/table-item-flex-percentage-width-ref.html create mode 100644 testing/web-platform/tests/css/css-flexbox/table-item-flex-percentage-width.html diff --git a/layout/style/res/ua.css b/layout/style/res/ua.css index 504f5dc570..a8425d472a 100644 --- a/layout/style/res/ua.css +++ b/layout/style/res/ua.css @@ -46,6 +46,9 @@ backface-visibility: inherit; clip: inherit; /* When the table wrapper is a Flex/Grid item we need these: */ + flex-grow: inherit; + flex-shrink: inherit; + flex-basis: inherit; align-self: inherit; justify-self: inherit; grid-column-start: inherit; diff --git a/testing/web-platform/meta/css/css-flexbox/table-item-flex-percentage-width.html.ini b/testing/web-platform/meta/css/css-flexbox/table-item-flex-percentage-width.html.ini new file mode 100644 index 0000000000..8069b87eb5 --- /dev/null +++ b/testing/web-platform/meta/css/css-flexbox/table-item-flex-percentage-width.html.ini @@ -0,0 +1,3 @@ +[table-item-flex-percentage-width.html] + expected: FAIL + bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1674268 diff --git a/testing/web-platform/tests/css/css-flexbox/table-item-flex-percentage-width-ref.html b/testing/web-platform/tests/css/css-flexbox/table-item-flex-percentage-width-ref.html new file mode 100644 index 0000000000..e598475fdd --- /dev/null +++ b/testing/web-platform/tests/css/css-flexbox/table-item-flex-percentage-width-ref.html @@ -0,0 +1,140 @@ + +Reference: display:table flex items with flex-shrink/flex-grow/flex-basis + + + + +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
diff --git a/testing/web-platform/tests/css/css-flexbox/table-item-flex-percentage-width.html b/testing/web-platform/tests/css/css-flexbox/table-item-flex-percentage-width.html new file mode 100644 index 0000000000..f21b5f0c65 --- /dev/null +++ b/testing/web-platform/tests/css/css-flexbox/table-item-flex-percentage-width.html @@ -0,0 +1,144 @@ + +Flexbox Test: display:table flex items with flex-shrink/flex-grow/flex-basis + + + + + + + + +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
+ +
+
1
+
2
+
3
+
From ef3947ea750abe973a1c0b5b35db22ed71925f1d Mon Sep 17 00:00:00 2001 From: Moonchild Date: Tue, 15 Dec 2020 11:33:29 +0000 Subject: [PATCH 10/13] [toolkit] Handle corner case confusion of downloaded files without extension. See code comment for details. --- .../jsdownloads/src/DownloadIntegration.jsm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm index 9845328937..d47ebcd638 100644 --- a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm +++ b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm @@ -717,6 +717,22 @@ this.DownloadIntegration = { return; } +#ifdef XP_WIN + // When a file has no extension, and there's an executable file with the + // same name in the same folder, the Windows shell can get confused. + // For this reason, we show the file in the containing folder instead of + // trying to open it. + // We also don't trust mimeinfo; it could be a type we can forward to a + // system handler, but it could also be an executable type, and we + // don't have an exhaustive list with all of them. + if (!fileExtension) { + // We can't check for the existence of a same-name file with every + // possible executable extension, so this is a catch-all. + this.showContainingDirectory(aDownload.target.path); + return; + } +#endif + // No custom application chosen, let's launch the file with the default // handler. First, let's try to launch it through the MIME service. if (mimeInfo) { From 9f0067af53882bfc6aa8ee4b684cb5f06b013034 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 16 Dec 2020 06:36:21 +0000 Subject: [PATCH 11/13] Issue #1695 - Restore Sleep/Wake timer that was erroneously removed. This was fallout from PR #929 for Issue #21 --- netwerk/base/nsSocketTransportService2.cpp | 27 ++++++++++++++++++++++ netwerk/base/nsSocketTransportService2.h | 3 +++ 2 files changed, 30 insertions(+) diff --git a/netwerk/base/nsSocketTransportService2.cpp b/netwerk/base/nsSocketTransportService2.cpp index 686bde6396..3d82022248 100644 --- a/netwerk/base/nsSocketTransportService2.cpp +++ b/netwerk/base/nsSocketTransportService2.cpp @@ -125,6 +125,7 @@ nsSocketTransportService::nsSocketTransportService() , mServingPendingQueue(false) , mMaxTimePerPollIter(100) , mMaxTimeForPrClosePref(PR_SecondsToInterval(5)) + , mSleepPhase(false) , mProbedMaxCount(false) #if defined(XP_WIN) , mPolling(false) @@ -566,6 +567,8 @@ nsSocketTransportService::Init() if (obsSvc) { obsSvc->AddObserver(this, "profile-initial-state", false); obsSvc->AddObserver(this, "last-pb-context-exited", false); + obsSvc->AddObserver(this, NS_WIDGET_SLEEP_OBSERVER_TOPIC, true); + obsSvc->AddObserver(this, NS_WIDGET_WAKE_OBSERVER_TOPIC, true); obsSvc->AddObserver(this, "xpcom-shutdown-threads", false); } @@ -632,9 +635,16 @@ nsSocketTransportService::ShutdownThread() if (obsSvc) { obsSvc->RemoveObserver(this, "profile-initial-state"); obsSvc->RemoveObserver(this, "last-pb-context-exited"); + obsSvc->RemoveObserver(this, NS_WIDGET_SLEEP_OBSERVER_TOPIC); + obsSvc->RemoveObserver(this, NS_WIDGET_WAKE_OBSERVER_TOPIC); obsSvc->RemoveObserver(this, "xpcom-shutdown-threads"); } + if (mAfterWakeUpTimer) { + mAfterWakeUpTimer->Cancel(); + mAfterWakeUpTimer = nullptr; + } + NetworkActivityMonitor::Shutdown(); mInitialized = false; @@ -1237,6 +1247,10 @@ nsSocketTransportService::Observe(nsISupports *subject, if (!strcmp(topic, NS_TIMER_CALLBACK_TOPIC)) { nsCOMPtr timer = do_QueryInterface(subject); + if (timer == mAfterWakeUpTimer) { + mAfterWakeUpTimer = nullptr; + mSleepPhase = false; + } #if defined(XP_WIN) if (timer == mPollRepairTimer) { @@ -1244,6 +1258,19 @@ nsSocketTransportService::Observe(nsISupports *subject, } #endif + } else if (!strcmp(topic, NS_WIDGET_SLEEP_OBSERVER_TOPIC)) { + mSleepPhase = true; + if (mAfterWakeUpTimer) { + mAfterWakeUpTimer->Cancel(); + mAfterWakeUpTimer = nullptr; + } + } else if (!strcmp(topic, NS_WIDGET_WAKE_OBSERVER_TOPIC)) { + if (mSleepPhase && !mAfterWakeUpTimer) { + mAfterWakeUpTimer = do_CreateInstance("@mozilla.org/timer;1"); + if (mAfterWakeUpTimer) { + mAfterWakeUpTimer->Init(this, 2000, nsITimer::TYPE_ONE_SHOT); + } + } } else if (!strcmp(topic, "xpcom-shutdown-threads")) { ShutdownThread(); } diff --git a/netwerk/base/nsSocketTransportService2.h b/netwerk/base/nsSocketTransportService2.h index 31efec1d92..484dbe098e 100644 --- a/netwerk/base/nsSocketTransportService2.h +++ b/netwerk/base/nsSocketTransportService2.h @@ -258,6 +258,9 @@ private: Atomic mMaxTimePerPollIter; Atomic mMaxTimeForPrClosePref; + Atomic mSleepPhase; + nsCOMPtr mAfterWakeUpTimer; + void OnKeepaliveEnabledPrefChange(); void NotifyKeepaliveEnabledPrefChange(SocketContext *sock); From 942b305400000fd6da064e7e6f12a021edd07794 Mon Sep 17 00:00:00 2001 From: adesh Date: Wed, 16 Dec 2020 06:31:28 -0500 Subject: [PATCH 12/13] Issue #1697 - Reinstate the performance timing code removed in error. This was a fallout from pull request #929. --- netwerk/base/nsLoadGroup.cpp | 13 +++++++++++++ netwerk/base/nsLoadGroup.h | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/netwerk/base/nsLoadGroup.cpp b/netwerk/base/nsLoadGroup.cpp index c30f7ade8c..5f81cb091f 100644 --- a/netwerk/base/nsLoadGroup.cpp +++ b/netwerk/base/nsLoadGroup.cpp @@ -107,6 +107,9 @@ nsLoadGroup::nsLoadGroup(nsISupports* outer) , mStatus(NS_OK) , mPriority(PRIORITY_NORMAL) , mIsCanceling(false) + , mDefaultLoadIsTimed(false) + , mTimedRequests(0) + , mCachedRequests(0) , mTimedNonCachedRequestsUntilOnEndPageLoad(0) { NS_INIT_AGGREGATED(outer); @@ -427,6 +430,12 @@ nsLoadGroup::SetDefaultLoadRequest(nsIRequest *aRequest) // in particular, nsIChannel::LOAD_DOCUMENT_URI... // mLoadFlags &= nsIRequest::LOAD_REQUESTMASK; + + nsCOMPtr timedChannel = do_QueryInterface(aRequest); + mDefaultLoadIsTimed = timedChannel != nullptr; + if (mDefaultLoadIsTimed) { + timedChannel->SetTimingEnabled(true); + } } // Else, do not change the group's load flags (see bug 95981) return NS_OK; @@ -481,6 +490,10 @@ nsLoadGroup::AddRequest(nsIRequest *request, nsISupports* ctxt) if (mPriority != 0) RescheduleRequest(request, mPriority); + nsCOMPtr timedChannel = do_QueryInterface(request); + if (timedChannel) + timedChannel->SetTimingEnabled(true); + if (!(flags & nsIRequest::LOAD_BACKGROUND)) { // Update the count of foreground URIs.. mForegroundCount += 1; diff --git a/netwerk/base/nsLoadGroup.h b/netwerk/base/nsLoadGroup.h index 9b5e70868c..1af84977db 100644 --- a/netwerk/base/nsLoadGroup.h +++ b/netwerk/base/nsLoadGroup.h @@ -82,6 +82,10 @@ protected: int32_t mPriority; bool mIsCanceling; + bool mDefaultLoadIsTimed; + uint32_t mTimedRequests; + uint32_t mCachedRequests; + /* For nsPILoadGroupInternal */ uint32_t mTimedNonCachedRequestsUntilOnEndPageLoad; }; From 8e43c8250c7e289a6bf9fca615fca27467eafcb7 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sun, 20 Dec 2020 19:48:50 +0000 Subject: [PATCH 13/13] Revert "Issue #1686 - Align a keybinding definition with the others" This reverts commit 85dc118aaca8446cbe33671446ac23147daec44c. --- devtools/client/menus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devtools/client/menus.js b/devtools/client/menus.js index 9b3d3c0b36..23f024f04a 100644 --- a/devtools/client/menus.js +++ b/devtools/client/menus.js @@ -94,7 +94,7 @@ exports.menuitems = [ }, key: { id: "browserToolbox", - modifiers: isMac ? "accel,alt" : "accel,shift", + modifiers: "accel,alt,shift", keytext: true } },