From 9c92761c4dd9acbe951aa60c5d51ceafc9630709 Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Tue, 27 Mar 2018 10:12:44 -0700 Subject: [PATCH 01/29] Bug 1449248 - Manually add handler for resource://tps uri in TPS r=kitcambridge MozReview-Commit-ID: 97YR2gOlOKC --HG-- extra : rebase_source : 1766078e99e8b8e08677c0339ce5e8e34be868c8 --- services/sync/tps/extensions/tps/bootstrap.js | 8 +++++++- services/sync/tps/extensions/tps/chrome.manifest | 1 - services/sync/tps/extensions/tps/install.rdf | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) delete mode 100644 services/sync/tps/extensions/tps/chrome.manifest diff --git a/services/sync/tps/extensions/tps/bootstrap.js b/services/sync/tps/extensions/tps/bootstrap.js index 47f11a51a1fc..d18f2daa45d0 100644 --- a/services/sync/tps/extensions/tps/bootstrap.js +++ b/services/sync/tps/extensions/tps/bootstrap.js @@ -11,9 +11,13 @@ XPCOMUtils.defineLazyServiceGetter(this, "categoryManager", "@mozilla.org/categorymanager;1", "nsICategoryManager"); +XPCOMUtils.defineLazyServiceGetter(this, "resProto", + "@mozilla.org/network/protocol;1?name=resource", + "nsISubstitutingProtocolHandler"); + const Cm = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); -const CATMAN_CONTRACTID = "@mozilla.org/categorymanager;1"; +const CATMAN_CONTRACTID = "@mozilla.org/categorymanager;1"; const CATEGORY_NAME = "command-line-handler"; const CATEGORY_ENTRY = "m-tps"; @@ -89,9 +93,11 @@ TPSCmdLine.prototype = { function startup(data, reason) { TPSCmdLine.prototype.register(); + resProto.setSubstitution("tps", Services.io.newURI("resource", null, data.resourceURI)); } function shutdown(data, reason) { + resProto.setSubstitution("tps", null); TPSCmdLine.prototype.unregister(); } diff --git a/services/sync/tps/extensions/tps/chrome.manifest b/services/sync/tps/extensions/tps/chrome.manifest deleted file mode 100644 index ed5477b10faa..000000000000 --- a/services/sync/tps/extensions/tps/chrome.manifest +++ /dev/null @@ -1 +0,0 @@ -resource tps resource/ diff --git a/services/sync/tps/extensions/tps/install.rdf b/services/sync/tps/extensions/tps/install.rdf index fc78d94bfd89..f9f060af129d 100644 --- a/services/sync/tps/extensions/tps/install.rdf +++ b/services/sync/tps/extensions/tps/install.rdf @@ -15,7 +15,7 @@ {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 24.0.* - 31.0.* + * From b0d30e4bf98cb6258d52a99a9ed18ca11804f9d0 Mon Sep 17 00:00:00 2001 From: David Keeler Date: Mon, 26 Mar 2018 17:21:04 -0700 Subject: [PATCH 02/29] bug 1449060 - remove some dynamic OIDs from the certificate viewer that don't serve any purpose r=fkiefer MozReview-Commit-ID: IccdDvYMTP4 --HG-- extra : rebase_source : bedc23b8b49cc6f4fedf5d7f17932bc971e78d20 --- security/manager/ssl/nsNSSCertHelper.cpp | 215 +---------------------- 1 file changed, 6 insertions(+), 209 deletions(-) diff --git a/security/manager/ssl/nsNSSCertHelper.cpp b/security/manager/ssl/nsNSSCertHelper.cpp index b45ad7791e6b..fa8112cb254d 100644 --- a/security/manager/ssl/nsNSSCertHelper.cpp +++ b/security/manager/ssl/nsNSSCertHelper.cpp @@ -25,58 +25,6 @@ using namespace mozilla; -/* Object Identifier constants */ -#define CONST_OID static const unsigned char -#define MICROSOFT_OID 0x2b, 0x6, 0x1, 0x4, 0x1, 0x82, 0x37 -#define PKIX_OID 0x2b, 0x6, 0x01, 0x05, 0x05, 0x07 -CONST_OID msCertExtCerttype[] = { MICROSOFT_OID, 20, 2 }; -CONST_OID msNTPrincipalName[] = { MICROSOFT_OID, 20, 2, 3 }; -CONST_OID msCertsrvCAVersion[] = { MICROSOFT_OID, 21, 1 }; -CONST_OID msNTDSReplication[] = { MICROSOFT_OID, 25, 1 }; -CONST_OID pkixLogotype[] = { PKIX_OID, 1, 12 }; - -#define OI(x) \ - { \ - siDEROID, (unsigned char*)x, sizeof x \ - } -#define OD(oid, desc, mech, ext) \ - { \ - OI(oid), SEC_OID_UNKNOWN, desc, mech, ext \ - } -#define SEC_OID(tag) more_oids[tag].offset - -static SECOidData more_oids[] = { -/* Microsoft OIDs */ -#define MS_CERT_EXT_CERTTYPE 0 - OD(msCertExtCerttype, - "Microsoft Certificate Template Name", - CKM_INVALID_MECHANISM, - INVALID_CERT_EXTENSION), - -#define MS_NT_PRINCIPAL_NAME 1 - OD(msNTPrincipalName, - "Microsoft Principal Name", - CKM_INVALID_MECHANISM, - INVALID_CERT_EXTENSION), - -#define MS_CERTSERV_CA_VERSION 2 - OD(msCertsrvCAVersion, - "Microsoft CA Version", - CKM_INVALID_MECHANISM, - INVALID_CERT_EXTENSION), - -#define MS_NTDS_REPLICATION 3 - OD(msNTDSReplication, - "Microsoft Domain GUID", - CKM_INVALID_MECHANISM, - INVALID_CERT_EXTENSION), - -#define PKIX_LOGOTYPE 4 - OD(pkixLogotype, "Logotype", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION), -}; - -static const unsigned int numOids = (sizeof more_oids) / (sizeof more_oids[0]); - static nsresult GetPIPNSSBundle(nsIStringBundle** pipnssBundle) { @@ -591,19 +539,7 @@ GetOIDText(SECItem* oid, nsAString& text) bundlekey = "CertDumpECsect571r1"; break; default: - if (oidTag == SEC_OID(MS_CERT_EXT_CERTTYPE)) { - bundlekey = "CertDumpMSCerttype"; - break; - } - if (oidTag == SEC_OID(MS_CERTSERV_CA_VERSION)) { - bundlekey = "CertDumpMSCAVersion"; - break; - } - if (oidTag == SEC_OID(PKIX_LOGOTYPE)) { - bundlekey = "CertDumpLogotype"; - break; - } - /* fallthrough */ + break; } if (bundlekey) { @@ -944,24 +880,6 @@ AppendBMPtoUTF16(const UniquePLArenaPool& arena, return NS_OK; } -static nsresult -ProcessBMPString(SECItem* extData, nsAString& text) -{ - UniquePLArenaPool arena(PORT_NewArena(DER_DEFAULT_CHUNKSIZE)); - if (!arena) { - return NS_ERROR_OUT_OF_MEMORY; - } - - SECItem item; - if (SEC_ASN1DecodeItem( - arena.get(), &item, SEC_ASN1_GET(SEC_BMPStringTemplate), extData) != - SECSuccess) { - return NS_ERROR_FAILURE; - } - - return AppendBMPtoUTF16(arena, item.data, item.len, text); -} - static nsresult ProcessGeneralName(const UniquePLArenaPool& arena, CERTGeneralName* current, nsAString& text) @@ -973,69 +891,13 @@ ProcessGeneralName(const UniquePLArenaPool& arena, CERTGeneralName* current, nsresult rv = NS_OK; switch (current->type) { - case certOtherName: { - SECOidTag oidTag = SECOID_FindOIDTag(¤t->name.OthName.oid); - if (oidTag == SEC_OID(MS_NT_PRINCIPAL_NAME)) { - /* The type of this name is apparently nowhere explicitly - documented. However, in the generated templates, it is always - UTF-8. So try to decode this as UTF-8; if that fails, dump the - raw data. */ - SECItem decoded; - GetPIPNSSBundleString("CertDumpMSNTPrincipal", key); - if (SEC_ASN1DecodeItem(arena.get(), - &decoded, - SEC_ASN1_GET(SEC_UTF8StringTemplate), - ¤t->name.OthName.name) == SECSuccess) { - AppendUTF8toUTF16(nsAutoCString((char*)decoded.data, decoded.len), - value); - } else { - ProcessRawBytes(¤t->name.OthName.name, value); - } - break; - } else if (oidTag == SEC_OID(MS_NTDS_REPLICATION)) { - /* This should be a 16-byte GUID */ - SECItem guid; - GetPIPNSSBundleString("CertDumpMSDomainGUID", key); - if (SEC_ASN1DecodeItem(arena.get(), - &guid, - SEC_ASN1_GET(SEC_OctetStringTemplate), - ¤t->name.OthName.name) == SECSuccess && - guid.len == 16) { - char buf[40]; - unsigned char* d = guid.data; - SprintfLiteral(buf, - "{%.2x%.2x%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%.2x-%.2x%" - ".2x%.2x%.2x%.2x%.2x}", - d[3], - d[2], - d[1], - d[0], - d[5], - d[4], - d[7], - d[6], - d[8], - d[9], - d[10], - d[11], - d[12], - d[13], - d[14], - d[15]); - value.AssignASCII(buf); - } else { - ProcessRawBytes(¤t->name.OthName.name, value); - } - } else { - rv = GetDefaultOIDFormat( - ¤t->name.OthName.oid, key, ' '); - if (NS_FAILED(rv)) { - return rv; - } - ProcessRawBytes(¤t->name.OthName.name, value); + case certOtherName: + rv = GetDefaultOIDFormat(¤t->name.OthName.oid, key, ' '); + if (NS_FAILED(rv)) { + return rv; } + ProcessRawBytes(¤t->name.OthName.name, value); break; - } case certRFC822Name: GetPIPNSSBundleString("CertDumpRFC822Name", key); value.AssignASCII((char*)current->name.other.data, @@ -1493,38 +1355,6 @@ ProcessAuthInfoAccess(SECItem* extData, nsAString& text) return rv; } -static nsresult -ProcessMSCAVersion(SECItem* extData, nsAString& text) -{ - MOZ_ASSERT(extData); - NS_ENSURE_ARG(extData); - - ScopedAutoSECItem decoded; - if (SEC_ASN1DecodeItem( - nullptr, &decoded, SEC_ASN1_GET(SEC_IntegerTemplate), extData) != - SECSuccess) { - /* This extension used to be an Integer when this code - was written, but apparently isn't anymore. Display - the raw bytes instead. */ - return ProcessRawBytes(extData, text); - } - - unsigned long version; - if (SEC_ASN1DecodeInteger(&decoded, &version) != SECSuccess) { - /* Value out of range, display raw bytes */ - return ProcessRawBytes(extData, text); - } - - /* Apparently, the encoding is , with 16 bits each */ - char buf[50]; - if (SprintfLiteral(buf, "%lu.%lu", version & 0xFFFF, version >> 16) <= 0) { - return NS_ERROR_FAILURE; - } - - text.AppendASCII(buf); - return NS_OK; -} - static nsresult ProcessExtensionData(SECOidTag oidTag, SECItem* extData, nsAString& text) { @@ -1559,14 +1389,6 @@ ProcessExtensionData(SECOidTag oidTag, SECItem* extData, nsAString& text) rv = ProcessAuthInfoAccess(extData, text); break; default: - if (oidTag == SEC_OID(MS_CERT_EXT_CERTTYPE)) { - rv = ProcessBMPString(extData, text); - break; - } - if (oidTag == SEC_OID(MS_CERTSERV_CA_VERSION)) { - rv = ProcessMSCAVersion(extData, text); - break; - } rv = ProcessRawBytes(extData, text); break; } @@ -1809,34 +1631,9 @@ ProcessExtensions(CERTCertExtension** extensions, return NS_OK; } -static bool registered; -static SECStatus -RegisterDynamicOids() -{ - unsigned int i; - SECStatus rv = SECSuccess; - - if (registered) - return rv; - - for (i = 0; i < numOids; i++) { - SECOidTag tag = SECOID_AddEntry(&more_oids[i]); - if (tag == SEC_OID_UNKNOWN) { - rv = SECFailure; - continue; - } - more_oids[i].offset = tag; - } - registered = true; - return rv; -} - nsresult nsNSSCertificate::CreateTBSCertificateASN1Struct(nsIASN1Sequence** retSequence) { - if (RegisterDynamicOids() != SECSuccess) - return NS_ERROR_FAILURE; - // // TBSCertificate ::= SEQUENCE { // version [0] EXPLICIT Version DEFAULT v1, From c241a7059b71836106de5e3cb887fdb21b45c8aa Mon Sep 17 00:00:00 2001 From: Erica Wright Date: Fri, 16 Mar 2018 11:56:10 -0400 Subject: [PATCH 03/29] Bug 1439512 - Correctly find stacked lines to ensure grid and numbers do no disappear when changing grid-row values. r=pbro MozReview-Commit-ID: 7HkXaylZiMO --HG-- extra : rebase_source : 6f2719b94ffa7a35615ed6a03ed94763da2bf507 --- .../server/actors/highlighters/css-grid.js | 61 +++++++------------ 1 file changed, 21 insertions(+), 40 deletions(-) diff --git a/devtools/server/actors/highlighters/css-grid.js b/devtools/server/actors/highlighters/css-grid.js index f491a9f65190..f042b5a10609 100644 --- a/devtools/server/actors/highlighters/css-grid.js +++ b/devtools/server/actors/highlighters/css-grid.js @@ -1141,11 +1141,11 @@ class CssGridHighlighter extends AutoRefreshHighlighter { * The grid line breadth value. * @param {String} dimensionType * The grid dimension type which is either the constant COLUMNS or ROWS. - * @param {Number||undefined} stackedLineIndex - * The line index position of the stacked line. + * @param {Boolean||undefined} isStackedLine + * Boolean indicating if the line is stacked. */ renderGridLineNumber(lineNumber, linePos, startPos, breadth, dimensionType, - stackedLineIndex) { + isStackedLine) { let displayPixelRatio = getDisplayPixelRatio(this.win); let { devicePixelRatio } = this.win; let offset = (displayPixelRatio / 2) % 1; @@ -1206,7 +1206,7 @@ class CssGridHighlighter extends AutoRefreshHighlighter { [x, y] = apply(this.currentMatrix, [x, y]); - if (stackedLineIndex) { + if (isStackedLine) { // Offset the stacked line number by half of the box's width/height. const xOffset = boxWidth / 4; const yOffset = boxHeight / 4; @@ -1354,7 +1354,7 @@ class CssGridHighlighter extends AutoRefreshHighlighter { this.ctx.textAlign = "center"; this.ctx.textBaseline = "middle"; this.ctx.fillStyle = "black"; - const numberText = stackedLineIndex ? "" : lineNumber; + const numberText = isStackedLine ? "" : lineNumber; this.ctx.fillText(numberText, x, y); this.ctx.restore(); } @@ -1472,8 +1472,6 @@ class CssGridHighlighter extends AutoRefreshHighlighter { */ renderLineNumbers(gridDimension, dimensionType, startPos) { const { lines, tracks } = gridDimension; - // Keep track of the number of collapsed lines per line position. - let stackedLines = []; for (let i = 0, line; (line = lines[i++]);) { // If you place something using negative numbers, you can trigger some implicit @@ -1489,21 +1487,17 @@ class CssGridHighlighter extends AutoRefreshHighlighter { continue; } - // Check for overlapping lines. We render a second box beneath the last overlapping + // Check for overlapping lines by measuring the track width between them. + // We render a second box beneath the last overlapping // line number to indicate there are lines beneath it. - const gridLine = tracks[line.number - 1]; + const gridTrack = tracks[i - 1]; - if (gridLine) { - const { breadth } = gridLine; + if (gridTrack) { + const { breadth } = gridTrack; if (breadth === 0) { - stackedLines.push(lines[i].number); - - if (stackedLines.length > 0) { - this.renderGridLineNumber(line.number, line.start, startPos, line.breadth, - dimensionType, 1); - } - + this.renderGridLineNumber(line.number, line.start, startPos, line.breadth, + dimensionType, true); continue; } } @@ -1527,8 +1521,6 @@ class CssGridHighlighter extends AutoRefreshHighlighter { */ renderNegativeLineNumbers(gridDimension, dimensionType, startPos) { const { lines, tracks } = gridDimension; - // Keep track of the number of collapsed lines per line position. - let stackedLines = []; for (let i = 0, line; (line = lines[i++]);) { let linePos = line.start; @@ -1539,32 +1531,21 @@ class CssGridHighlighter extends AutoRefreshHighlighter { break; } - // Check for overlapping lines. We render a second box beneath the last overlapping + // Check for overlapping lines by measuring the track width between them. + // We render a second box beneath the last overlapping // line number to indicate there are lines beneath it. - const gridLine = tracks[line.number - 1]; - - if (gridLine) { - const { breadth } = gridLine; - - if (breadth === 0) { - stackedLines.push(negativeLineNumber); - - if (stackedLines.length > 0) { - this.renderGridLineNumber(negativeLineNumber, linePos, startPos, - line.breadth, dimensionType, 1); - } + const gridTrack = tracks[i - 1]; + if (gridTrack) { + const { breadth } = gridTrack; + // Ensure "-1" is always visible, since it is always the largest number. + if (breadth === 0 && negativeLineNumber != -1) { + this.renderGridLineNumber(negativeLineNumber, linePos, startPos, + line.breadth, dimensionType, true); continue; } } - // For negative line numbers, we want to display the smallest - // value at the front of the stack. - if (stackedLines.length) { - negativeLineNumber = stackedLines[0]; - stackedLines = []; - } - this.renderGridLineNumber(negativeLineNumber, linePos, startPos, line.breadth, dimensionType); } From 20eb6b854df43f3b4da39f12bebda62aa510b5ce Mon Sep 17 00:00:00 2001 From: Mike Conley Date: Tue, 27 Mar 2018 16:01:36 -0400 Subject: [PATCH 04/29] Bug 1408026 - Remove early renderLayers for preloaded browsers now that Activity Stream takes care of it. r=florian MozReview-Commit-ID: L9ROVXggr5k --HG-- extra : rebase_source : 2d76c136487072ed7178742687bc84c225ed45bf --- browser/base/content/tabbrowser.js | 1 - 1 file changed, 1 deletion(-) diff --git a/browser/base/content/tabbrowser.js b/browser/base/content/tabbrowser.js index 7a627bccfa8c..ff979422a85d 100644 --- a/browser/base/content/tabbrowser.js +++ b/browser/base/content/tabbrowser.js @@ -1775,7 +1775,6 @@ window._gBrowser = { browser.loadURI(BROWSER_NEW_TAB_URL); browser.docShellIsActive = false; - browser.renderLayers = true; browser._urlbarFocused = true; // Make sure the preloaded browser is loaded with desired zoom level From e6320ddb5da4cbb08235a6afe3e0dde554aa21b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Tue, 27 Mar 2018 23:19:15 +0200 Subject: [PATCH 05/29] Bug 1448565 - Extract tab bar visibility handling from the tabs binding. r=Gijs MozReview-Commit-ID: RDvodB7C8e --HG-- extra : rebase_source : 821cfdd9e3a6cfafd19ab46a9395f06ad01f9ec8 --- browser/base/content/browser.js | 2 +- browser/base/content/tabbrowser.js | 29 +++++++++++++++++-- browser/base/content/tabbrowser.xml | 44 ----------------------------- 3 files changed, 28 insertions(+), 47 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index f6cf2e661513..324c98b7c58e 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1281,7 +1281,7 @@ var gBrowserInit = { this._setInitialFocus(); - gBrowser.tabContainer.updateVisibility(); + window.TabBarVisibility.update(); TabsInTitlebar.onDOMContentLoaded(); }, diff --git a/browser/base/content/tabbrowser.js b/browser/base/content/tabbrowser.js index ff979422a85d..ee9ce68f23a1 100644 --- a/browser/base/content/tabbrowser.js +++ b/browser/base/content/tabbrowser.js @@ -2283,7 +2283,7 @@ window._gBrowser = { t._tPos = position; this.tabContainer._setPositionalAttributes(); - this.tabContainer.updateVisibility(); + TabBarVisibility.update(); // If we don't have a preferred remote type, and we have a remote // opener, use the opener's remote type. @@ -2757,7 +2757,7 @@ window._gBrowser = { if (newTab) this.addTab(BROWSER_NEW_TAB_URL, { skipAnimation: true }); else - this.tabContainer.updateVisibility(); + TabBarVisibility.update(); // We're committed to closing the tab now. // Dispatch a notification. @@ -4704,3 +4704,28 @@ var StatusPanel = { } } }; + +var TabBarVisibility = { + _initialUpdateDone: false, + + update() { + let toolbar = document.getElementById("TabsToolbar"); + let collapse = false; + if (gBrowser.tabs.length - gBrowser._removingTabs.length == 1) { + collapse = !window.toolbar.visible; + } + + if (collapse == toolbar.collapsed && this._initialUpdateDone) { + return; + } + this._initialUpdateDone = true; + + toolbar.collapsed = collapse; + + document.getElementById("menu_closeWindow").hidden = collapse; + document.getElementById("menu_close").setAttribute("label", + gTabBrowserBundle.GetStringFromName(collapse ? "tabs.close" : "tabs.closeTab")); + + TabsInTitlebar.allowedBy("tabs-visible", !collapse); + } +}; diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index 05dead5725af..bf494922065b 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -369,50 +369,6 @@ 350 0 - - - false - - - - - - - - - - - - - false Date: Sun, 11 Mar 2018 21:55:45 +1300 Subject: [PATCH 06/29] Bug 1444219 - Remove unnecessary call to MozbuildObject.from_environment r=froydnj MozReview-Commit-ID: 4KP2H9HVQbG --HG-- extra : rebase_source : b2a7a8b8c382ad00487081c3ec99b7dc095283ba --- python/mozbuild/mozbuild/mach_commands.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py index 21f72f449061..6846e029d1eb 100644 --- a/python/mozbuild/mozbuild/mach_commands.py +++ b/python/mozbuild/mozbuild/mach_commands.py @@ -1172,16 +1172,13 @@ class PackageFrontend(MachCommandBase): state_dir = self._mach_context.state_dir cache_dir = os.path.join(state_dir, 'package-frontend') - here = os.path.abspath(os.path.dirname(__file__)) - build_obj = MozbuildObject.from_environment(cwd=here) - hg = None - if conditions.is_hg(build_obj): - hg = build_obj.substs['HG'] + if conditions.is_hg(self): + hg = self.substs['HG'] git = None - if conditions.is_git(build_obj): - git = build_obj.substs['GIT'] + if conditions.is_git(self): + git = self.substs['GIT'] from mozbuild.artifacts import Artifacts artifacts = Artifacts(tree, self.substs, self.defines, job, From e71fb1aa39e9e636242684b88a1fe0842b23f8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Tue, 27 Mar 2018 23:34:23 +0200 Subject: [PATCH 07/29] Bug 1448482 - Remove element from about:privatebrowsing since tabbrowser already sets the title. r=Gijs MozReview-Commit-ID: 7oQrfiK0FRa --HG-- extra : rebase_source : dcaeae1f53682531709bd8333cdf38a0a7e21298 --- browser/base/content/tabbrowser.js | 2 +- .../privatebrowsing/content/aboutPrivateBrowsing.js | 1 - .../privatebrowsing/content/aboutPrivateBrowsing.xhtml | 1 - .../test/browser/browser_privatebrowsing_windowtitle.js | 4 ++-- .../locales/en-US/chrome/browser/aboutPrivateBrowsing.dtd | 5 ----- browser/locales/en-US/chrome/browser/tabbrowser.properties | 2 -- .../mozscreenshots/extension/configurations/Tabs.jsm | 2 +- 7 files changed, 4 insertions(+), 13 deletions(-) diff --git a/browser/base/content/tabbrowser.js b/browser/base/content/tabbrowser.js index ee9ce68f23a1..c4befce757cb 100644 --- a/browser/base/content/tabbrowser.js +++ b/browser/base/content/tabbrowser.js @@ -854,7 +854,7 @@ window._gBrowser = { docTitle = tab.getAttribute("label").replace(/\0/g, ""); } - if (!docTitle || docTitle == this.tabContainer.emptyTabTitle) + if (!docTitle) docTitle = docElement.getAttribute("titledefault"); var modifier = docElement.getAttribute("titlemodifier"); diff --git a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js index 732cf0ad5895..a35f89a890bd 100644 --- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js +++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js @@ -33,7 +33,6 @@ document.addEventListener("DOMContentLoaded", function() { if (!aboutCapabilities.isWindowPrivate()) { document.documentElement.classList.remove("private"); document.documentElement.classList.add("normal"); - document.title = document.querySelector("title").getAttribute("notprivatetitle"); document.getElementById("favicon").setAttribute("href", FAVICON_QUESTION); document.getElementById("startPrivateBrowsing").addEventListener("click", function() { aboutCapabilities.sendAsyncMessage("OpenPrivateWindow", null); diff --git a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml index 74687f231f3b..d45331f62306 100644 --- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml +++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml @@ -23,7 +23,6 @@ <link id="favicon" rel="icon" type="image/png" href="chrome://browser/skin/privatebrowsing/favicon.svg"/> <link rel="stylesheet" href="chrome://browser/content/aboutPrivateBrowsing.css" type="text/css" media="all"/> <link rel="stylesheet" href="chrome://browser/skin/privatebrowsing/aboutPrivateBrowsing.css" type="text/css" media="all"/> - <title notprivatetitle="&aboutPrivateBrowsing.notPrivate.title;">&aboutPrivateBrowsing.title; diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js index 83a66743d83a..bb0cd30aa57b 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js @@ -23,14 +23,14 @@ add_task(async function test() { if (isOSX) { page_with_title = test_title; page_without_title = app_name; - about_pb_title = "Open a private window?"; + about_pb_title = app_name; pb_page_with_title = test_title + " - (Private Browsing)"; pb_page_without_title = app_name + " - (Private Browsing)"; pb_about_pb_title = app_name + " - (Private Browsing)"; } else { page_with_title = test_title + " - " + app_name; page_without_title = app_name; - about_pb_title = "Open a private window? - " + app_name; + about_pb_title = app_name; pb_page_with_title = test_title + " - " + app_name + " (Private Browsing)"; pb_page_without_title = app_name + " (Private Browsing)"; pb_about_pb_title = app_name + " (Private Browsing)"; diff --git a/browser/locales/en-US/chrome/browser/aboutPrivateBrowsing.dtd b/browser/locales/en-US/chrome/browser/aboutPrivateBrowsing.dtd index d39e1dd44484..2eae73c38b76 100644 --- a/browser/locales/en-US/chrome/browser/aboutPrivateBrowsing.dtd +++ b/browser/locales/en-US/chrome/browser/aboutPrivateBrowsing.dtd @@ -2,11 +2,6 @@ - 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/. --> - - - - diff --git a/browser/locales/en-US/chrome/browser/tabbrowser.properties b/browser/locales/en-US/chrome/browser/tabbrowser.properties index f1465dcd7135..dfcfe19d0437 100644 --- a/browser/locales/en-US/chrome/browser/tabbrowser.properties +++ b/browser/locales/en-US/chrome/browser/tabbrowser.properties @@ -4,8 +4,6 @@ tabs.restoreLastTabs=Restore Tabs From Last Time tabs.emptyTabTitle=New Tab -# LOCALIZATION NOTE (tabs.emptyPrivateTabTitle) -# Please ensure this exactly matches aboutPrivateBrowsing.dtd's window title (aboutPrivateBrowsing.title). tabs.emptyPrivateTabTitle=Private Browsing tabs.closeTab=Close Tab tabs.close=Close diff --git a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Tabs.jsm b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Tabs.jsm index 1ce2bf442982..25c62f7483e0 100644 --- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Tabs.jsm +++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/Tabs.jsm @@ -132,7 +132,7 @@ async function allTabTitlesDisplayed(browserWindow) { "about:home": "New Tab", "about:newtab": "New Tab", "about:addons": "Add-ons Manager", - "about:privatebrowsing": "Open a private window?" + "about:privatebrowsing": "about:privatebrowsing" }; specToTitleMap[PREFS_TAB] = "browser/skin/settings.svg"; specToTitleMap[CUST_TAB] = "browser/skin/customize.svg"; From 2d456d10c4d2e3e0725d99a9884568c4a89df805 Mon Sep 17 00:00:00 2001 From: Marco Bonardo Date: Mon, 26 Mar 2018 21:15:41 +0200 Subject: [PATCH 08/29] Bug 1448810 - Rename the Places sidebar files and merge sidebarUtils into PlacesUIUtils. r=standard8 MozReview-Commit-ID: GsPPBhiTPul --HG-- rename : browser/components/places/content/bookmarksPanel.js => browser/components/places/content/bookmarksSidebar.js rename : browser/components/places/content/bookmarksPanel.xul => browser/components/places/content/bookmarksSidebar.xul rename : browser/components/places/content/history-panel.js => browser/components/places/content/historySidebar.js rename : browser/components/places/content/history-panel.xul => browser/components/places/content/historySidebar.xul extra : rebase_source : 6394e16be1df21d182647ea06c4cf592e8136071 --- browser/base/content/browser-sets.inc | 8 +- browser/components/places/PlacesUIUtils.jsm | 93 ++++++++++++++- ...{bookmarksPanel.js => bookmarksSidebar.js} | 5 + ...ookmarksPanel.xul => bookmarksSidebar.xul} | 28 ++--- .../{history-panel.js => historySidebar.js} | 7 +- .../{history-panel.xul => historySidebar.xul} | 29 ++--- .../components/places/content/organizer.css | 7 -- browser/components/places/content/places.css | 4 + browser/components/places/content/places.xul | 2 +- .../components/places/content/sidebarUtils.js | 108 ------------------ browser/components/places/jar.mn | 13 +-- 11 files changed, 140 insertions(+), 164 deletions(-) rename browser/components/places/content/{bookmarksPanel.js => bookmarksSidebar.js} (85%) rename browser/components/places/content/{bookmarksPanel.xul => bookmarksSidebar.xul} (75%) rename browser/components/places/content/{history-panel.js => historySidebar.js} (92%) rename browser/components/places/content/{history-panel.xul => historySidebar.xul} (83%) delete mode 100644 browser/components/places/content/organizer.css delete mode 100644 browser/components/places/content/sidebarUtils.js diff --git a/browser/base/content/browser-sets.inc b/browser/base/content/browser-sets.inc index 374528828a6b..d2eaca586396 100644 --- a/browser/base/content/browser-sets.inc +++ b/browser/base/content/browser-sets.inc @@ -120,15 +120,13 @@ - rect.x + : event.clientX < rect.x; + + let metaKey = AppConstants.platform === "macosx" ? event.metaKey + : event.ctrlKey; + let modifKey = metaKey || event.shiftKey; + let isContainer = tbo.view.isContainer(cell.row); + let openInTabs = isContainer && + (event.button == 1 || (event.button == 0 && modifKey)) && + PlacesUtils.hasChildURIs(tree.view.nodeForTreeIndex(cell.row)); + + if (event.button == 0 && isContainer && !openInTabs) { + tbo.view.toggleOpenState(cell.row); + } else if (!mouseInGutter && openInTabs && + event.originalTarget.localName == "treechildren") { + tbo.view.selection.select(cell.row); + this.openContainerNodeInTabs(tree.selectedNode, event, tree); + } else if (!mouseInGutter && !isContainer && + event.originalTarget.localName == "treechildren") { + // Clear all other selection since we're loading a link now. We must + // do this *before* attempting to load the link since openURL uses + // selection as an indication of which link to load. + tbo.view.selection.select(cell.row); + this.openNodeWithEvent(tree.selectedNode, event); + } + }, + + onSidebarTreeKeyPress(event) { + let node = event.target.selectedNode; + if (node) { + if (event.keyCode == KeyEvent.DOM_VK_RETURN) + this.openNodeWithEvent(node, event); + } + }, + + /** + * The following function displays the URL of a node that is being + * hovered over. + */ + onSidebarTreeMouseMove(event) { + let treechildren = event.target; + if (treechildren.localName != "treechildren") + return; + + let tree = treechildren.parentNode; + let cell = tree.treeBoxObject.getCellAt(event.clientX, event.clientY); + + // cell.row is -1 when the mouse is hovering an empty area within the tree. + // To avoid showing a URL from a previously hovered node for a currently + // hovered non-url node, we must clear the moused-over URL in these cases. + if (cell.row != -1) { + let node = tree.view.nodeForTreeIndex(cell.row); + if (PlacesUtils.nodeIsURI(node)) { + this.setMouseoverURL(node.uri, tree.ownerGlobal); + return; + } + } + this.setMouseoverURL("", tree.ownerGlobal); + }, + + setMouseoverURL(url, win) { + // When the browser window is closed with an open sidebar, the sidebar + // unload event happens after the browser's one. In this case + // top.XULBrowserWindow has been nullified already. + if (win.top.XULBrowserWindow) { + win.top.XULBrowserWindow.setOverLink(url, null); + } + } }; // These are lazy getters to avoid importing PlacesUtils immediately. diff --git a/browser/components/places/content/bookmarksPanel.js b/browser/components/places/content/bookmarksSidebar.js similarity index 85% rename from browser/components/places/content/bookmarksPanel.js rename to browser/components/places/content/bookmarksSidebar.js index 8778791f985f..290a97f19ae8 100644 --- a/browser/components/places/content/bookmarksPanel.js +++ b/browser/components/places/content/bookmarksSidebar.js @@ -6,6 +6,11 @@ /* import-globals-from ../../../../toolkit/components/places/PlacesUtils.jsm */ function init() { + let uidensity = window.top.document.documentElement.getAttribute("uidensity"); + if (uidensity) { + document.documentElement.setAttribute("uidensity", uidensity); + } + document.getElementById("bookmarks-view").place = "place:type=" + Ci.nsINavHistoryQueryOptions.RESULTS_AS_ROOTS_QUERY; } diff --git a/browser/components/places/content/bookmarksPanel.xul b/browser/components/places/content/bookmarksSidebar.xul similarity index 75% rename from browser/components/places/content/bookmarksPanel.xul rename to browser/components/places/content/bookmarksSidebar.xul index 4f92fcf2d774..d58952d7d7ab 100644 --- a/browser/components/places/content/bookmarksPanel.xul +++ b/browser/components/places/content/bookmarksSidebar.xul @@ -1,29 +1,27 @@ - + - + %placesDTD; - -%editMenuOverlayDTD; + +%editMenuDTD; ]> + onunload="PlacesUIUtils.setMouseoverURL('', window);">