From 748c822affd02ae8b5e06fda169dc9fa8da613a0 Mon Sep 17 00:00:00 2001 From: "stephen@noved.org" Date: Mon, 5 May 2008 11:06:31 -0700 Subject: [PATCH 01/98] Bug 430693 - "History items (Today, Yesterday, etc.) styling for Mac OS X" (r=mano, ui-r=beltzner, a=beltzner) --- browser/themes/pinstripe/browser/browser.css | 2 +- browser/themes/pinstripe/browser/places/places.css | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/browser/themes/pinstripe/browser/browser.css b/browser/themes/pinstripe/browser/browser.css index 85403494940..c3003c8b1ae 100755 --- a/browser/themes/pinstripe/browser/browser.css +++ b/browser/themes/pinstripe/browser/browser.css @@ -275,7 +275,7 @@ toolbarbutton.bookmark-item .toolbarbutton-text { } .bookmark-item[query][dayContainer] { - list-style-image: url("chrome://global/skin/tree/folder.png"); + list-style-image: url("chrome://browser/skin/places/history.png"); } .bookmark-item[query][hostContainer] { diff --git a/browser/themes/pinstripe/browser/places/places.css b/browser/themes/pinstripe/browser/places/places.css index e8a62a46196..d1686255074 100755 --- a/browser/themes/pinstripe/browser/places/places.css +++ b/browser/themes/pinstripe/browser/places/places.css @@ -149,8 +149,9 @@ treechildren::-moz-tree-image(container, OrganizerQuery_Tags) { list-style-image: url("chrome://mozapps/skin/places/tagContainerIcon.png"); } +/* calendar icon for folders grouping items by date */ treechildren::-moz-tree-image(title, query, dayContainer) { - list-style-image: url("chrome://global/skin/tree/folder.png"); + list-style-image: url("chrome://browser/skin/places/history.png"); } treechildren::-moz-tree-image(title, query, hostContainer) { From 2ee8887a3eecf915f7319a173c77ec3490db0b95 Mon Sep 17 00:00:00 2001 From: "johnath@mozilla.com" Date: Mon, 5 May 2008 11:06:42 -0700 Subject: [PATCH 02/98] Identity popup calls override service incorrectly. b=432241 r=gavin a=mconnor --- browser/base/content/browser.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 99e45cafe30..2b52b9c575a 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -4203,7 +4203,8 @@ nsBrowserStatusHandler.prototype = var locationObj = {}; try { locationObj.host = location.host; - locationObj.hostname = location.hostname + locationObj.hostname = location.hostname; + locationObj.port = location.port; } catch (ex) { // Can sometimes throw if the URL being visited has no host/hostname, // e.g. about:blank. The _state for these pages means we won't need these @@ -6442,7 +6443,7 @@ IdentityHandler.prototype = { * * @param PRUint32 state * @param JS Object location that mirrors an nsLocation (i.e. has .host and - * .hostname) + * .hostname and .port) */ checkIdentity : function(state, location) { var currentStatus = gBrowser.securityUI @@ -6535,8 +6536,13 @@ IdentityHandler.prototype = { // for certs that are trusted because of a security exception. var tooltip = this._stringBundle.getFormattedString("identity.identified.verifier", [iData.caOrg]); + + // Check whether this site is a security exception. XPConnect does the right + // thing here in terms of converting _lastLocation.port from string to int, but + // the overrideService doesn't like undefined ports, so make sure we have + // something in the default case (bug 432241). if (this._overrideService.hasMatchingOverride(this._lastLocation.hostname, - this._lastLocation.port, + (this._lastLocation.port || 443), iData.cert, {}, {})) tooltip = this._stringBundle.getString("identity.identified.verified_by_you"); } From cbcab9ee5013d4889672c4de06efd85fce78bf52 Mon Sep 17 00:00:00 2001 From: "dietrich@mozilla.com" Date: Mon, 5 May 2008 11:11:49 -0700 Subject: [PATCH 03/98] perf testing bug 431758 (a=mconnor) --- toolkit/components/places/src/nsNavHistory.cpp | 6 ++++++ toolkit/components/places/src/nsNavHistory.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/toolkit/components/places/src/nsNavHistory.cpp b/toolkit/components/places/src/nsNavHistory.cpp index d6df0e9fee6..2ebaa7c9955 100644 --- a/toolkit/components/places/src/nsNavHistory.cpp +++ b/toolkit/components/places/src/nsNavHistory.cpp @@ -636,6 +636,12 @@ nsNavHistory::InitDB(PRInt16 *aMadeChanges) rv = mDBConn->ExecuteSimpleSQL(pageSizePragma); NS_ENSURE_SUCCESS(rv, rv); +#ifdef IN_MEMORY_SQLITE_TEMP_STORE + rv = mDBConn->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "PRAGMA temp_store = MEMORY")); + NS_ENSURE_SUCCESS(rv, rv); +#endif + mozStorageTransaction transaction(mDBConn, PR_FALSE); // Initialize the other places services' database tables. We do this before diff --git a/toolkit/components/places/src/nsNavHistory.h b/toolkit/components/places/src/nsNavHistory.h index 52eb5cf89f0..e6c6e16a7d0 100644 --- a/toolkit/components/places/src/nsNavHistory.h +++ b/toolkit/components/places/src/nsNavHistory.h @@ -91,6 +91,9 @@ // set to use more optimized (in-memory database) link coloring //#define IN_MEMORY_LINKS +// define to maintain sqlite temporary tables in memory rather than on disk +#define IN_MEMORY_SQLITE_TEMP_STORE + // define to enable lazy link adding #define LAZY_ADD From 8bd22745194f7da4c5cdc0ae35456ace1fcbf046 Mon Sep 17 00:00:00 2001 From: "johnath@mozilla.com" Date: Mon, 5 May 2008 11:13:11 -0700 Subject: [PATCH 04/98] Sidebars don't change color when window is inactive. p=Markus Stange, b=432115, r=gavin, a=beltzner --- browser/themes/pinstripe/browser/browser.css | 1 + browser/themes/pinstripe/browser/places/places.css | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/browser/themes/pinstripe/browser/browser.css b/browser/themes/pinstripe/browser/browser.css index c3003c8b1ae..7051b4375e1 100755 --- a/browser/themes/pinstripe/browser/browser.css +++ b/browser/themes/pinstripe/browser/browser.css @@ -1430,6 +1430,7 @@ richlistitem[selected="true"][current="true"] > hbox > .ac-result-type-bookmark, /* ----- SIDEBAR ELEMENTS ----- */ +#sidebar, sidebarheader { background-color: #d4dde5; padding: 2px; diff --git a/browser/themes/pinstripe/browser/places/places.css b/browser/themes/pinstripe/browser/places/places.css index d1686255074..6b635f65c4a 100755 --- a/browser/themes/pinstripe/browser/places/places.css +++ b/browser/themes/pinstripe/browser/places/places.css @@ -16,7 +16,7 @@ #bookmarksPanel > hbox, #history-panel > hbox { -moz-appearance: none !important; - background-color: #d4dde5 !important; + background-color: transparent !important; border-top: none !important; } From 4f72b53bbf1f73416d1b3e314e1f5e7f27c347af Mon Sep 17 00:00:00 2001 From: "dietrich@mozilla.com" Date: Mon, 5 May 2008 11:14:46 -0700 Subject: [PATCH 05/98] Bug 403147 - Style the library window like a Media collection app for Vista Aero (for mak77@supereva.it, r=dao, a=beltzner) --- .../themes/winstripe/browser/browser-aero.css | 4 +- .../browser/places/organizer-aero.css | 37 ++++++++++++++++++- .../winstripe/browser/places/organizer.css | 4 +- 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/browser/themes/winstripe/browser/browser-aero.css b/browser/themes/winstripe/browser/browser-aero.css index 16c777fe95c..e4f1b5d119d 100644 --- a/browser/themes/winstripe/browser/browser-aero.css +++ b/browser/themes/winstripe/browser/browser-aero.css @@ -60,7 +60,9 @@ #sidebar-splitter:-moz-system-metric(windows-default-theme) { border: 0; - -moz-border-end: 1px solid #a9b7c9; + -moz-border-end: 1px solid; + -moz-border-right-colors: #A9B7C9; + -moz-border-left-colors: #A9B7C9; min-width: 0; width: 3px; background-color: transparent; diff --git a/browser/themes/winstripe/browser/places/organizer-aero.css b/browser/themes/winstripe/browser/places/organizer-aero.css index 423589ea9bd..23cbf32069d 100644 --- a/browser/themes/winstripe/browser/places/organizer-aero.css +++ b/browser/themes/winstripe/browser/places/organizer-aero.css @@ -1,8 +1,23 @@ %include organizer.css +#placesView:-moz-system-metric(windows-default-theme) { + border-top: none; +} + +#placesToolbar { + -moz-appearance: media-toolbox; + color: -moz-win-mediatext; +} + +#placesMenu > menu { + color: -moz-win-mediatext; +} + #placesView > splitter:-moz-system-metric(windows-default-theme) { border: 0; - -moz-border-end: 1px solid #a9b7c9; + -moz-border-end: 1px solid; + -moz-border-right-colors: #A9B7C9; + -moz-border-left-colors: #A9B7C9; min-width: 0; width: 3px !important; background-color: transparent; @@ -11,3 +26,23 @@ z-index: 10; } +#searchModifiers:-moz-system-metric(windows-default-theme) { + border-bottom: 1px solid #A9B7C9; +} + +#organizerScopeBar:-moz-system-metric(windows-default-theme) { + -moz-appearance: none; + border: none; +} + +#infoPaneBox:-moz-system-metric(windows-default-theme) { + border-top-color: #A9B7C9; +} + +#placesView:-moz-system-metric(windows-default-theme), +#searchModifiers:-moz-system-metric(windows-default-theme), +#infoPane:-moz-system-metric(windows-default-theme), +#placesList:-moz-system-metric(windows-default-theme), +#placeContent:-moz-system-metric(windows-default-theme) { + background-color: #EEF3FA; +} diff --git a/browser/themes/winstripe/browser/places/organizer.css b/browser/themes/winstripe/browser/places/organizer.css index c966a4b93f8..3f032e64442 100644 --- a/browser/themes/winstripe/browser/places/organizer.css +++ b/browser/themes/winstripe/browser/places/organizer.css @@ -2,7 +2,7 @@ /* Toolbar */ #placesToolbar { border: none; - min-height: 30px; + min-height: 36px; } /* back & forward buttons */ @@ -321,7 +321,7 @@ padding: 2px 5px; } -#organizerScopeBar> toolbarbutton:not([disabled="true"]):hover { +#organizerScopeBar > toolbarbutton:not([disabled="true"]):not([checked="true"]):hover { border-color: ThreeDShadow; } From 6dc1fb1d282775b32ca281048e73d3a3d400744a Mon Sep 17 00:00:00 2001 From: "dietrich@mozilla.com" Date: Mon, 5 May 2008 11:16:56 -0700 Subject: [PATCH 06/98] Bug 431817 - Special folders (Tags, Recent Tags) are not expandable/collapsible (no-more containers) (for mak77@supereva.it, r=dietrich, a=beltzner) --- browser/components/places/content/treeView.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/browser/components/places/content/treeView.js b/browser/components/places/content/treeView.js index 656caa80525..23ba3cbd9f4 100644 --- a/browser/components/places/content/treeView.js +++ b/browser/components/places/content/treeView.js @@ -939,11 +939,12 @@ PlacesTreeView.prototype = { if (!node.parent) return true; - // treat non-expandable queries as non-containers + // treat non-expandable childless queries as non-containers if (PlacesUtils.nodeIsQuery(node)) { var parent = node.parent; - if(PlacesUtils.nodeIsQuery(parent) || - PlacesUtils.nodeIsFolder(parent)) + if((PlacesUtils.nodeIsQuery(parent) || + PlacesUtils.nodeIsFolder(parent)) && + !node.hasChildren) return asQuery(parent).queryOptions.expandQueries; } return true; From 0c2fa39cbdd679709c7543074493c90e3edc2ed5 Mon Sep 17 00:00:00 2001 From: "stephen@noved.org" Date: Mon, 5 May 2008 11:53:15 -0700 Subject: [PATCH 07/98] Bug 431853 - "Tweak/Clean Site Identity Button + URL bar on OS X" (r=gavin, ui-r=beltzner, a=beltzner) --- browser/themes/pinstripe/browser/browser.css | 153 ++++++++++++------ browser/themes/pinstripe/browser/jar.mn | 7 + .../browser/urlbar/startcap-active-rtl.png | Bin 1238 -> 1318 bytes .../browser/urlbar/startcap-active.png | Bin 1296 -> 1277 bytes .../urlbar/startcap-secure-end-active.png | Bin 0 -> 524 bytes .../urlbar/startcap-secure-end-focused.png | Bin 560 -> 551 bytes .../browser/urlbar/startcap-secure-end.png | Bin 543 -> 523 bytes .../urlbar/startcap-secure-mid-active.png | Bin 0 -> 209 bytes .../urlbar/startcap-secure-mid-focused.png | Bin 219 -> 212 bytes .../browser/urlbar/startcap-secure-mid.png | Bin 199 -> 194 bytes .../urlbar/startcap-secure-start-active.png | Bin 0 -> 728 bytes .../urlbar/startcap-secure-start-focused.png | Bin 708 -> 666 bytes .../browser/urlbar/startcap-secure-start.png | Bin 607 -> 579 bytes .../urlbar/startcap-verified-end-active.png | Bin 0 -> 542 bytes .../urlbar/startcap-verified-end-focused.png | Bin 564 -> 538 bytes .../browser/urlbar/startcap-verified-end.png | Bin 545 -> 526 bytes .../urlbar/startcap-verified-mid-active.png | Bin 0 -> 205 bytes .../urlbar/startcap-verified-start-active.png | Bin 0 -> 730 bytes .../browser/urlbar/urlbar-favicon-glow.png | Bin 0 -> 504 bytes 19 files changed, 107 insertions(+), 53 deletions(-) create mode 100644 browser/themes/pinstripe/browser/urlbar/startcap-secure-end-active.png create mode 100644 browser/themes/pinstripe/browser/urlbar/startcap-secure-mid-active.png create mode 100644 browser/themes/pinstripe/browser/urlbar/startcap-secure-start-active.png create mode 100644 browser/themes/pinstripe/browser/urlbar/startcap-verified-end-active.png create mode 100644 browser/themes/pinstripe/browser/urlbar/startcap-verified-mid-active.png create mode 100644 browser/themes/pinstripe/browser/urlbar/startcap-verified-start-active.png create mode 100644 browser/themes/pinstripe/browser/urlbar/urlbar-favicon-glow.png diff --git a/browser/themes/pinstripe/browser/browser.css b/browser/themes/pinstripe/browser/browser.css index 7051b4375e1..ac2afa547fe 100755 --- a/browser/themes/pinstripe/browser/browser.css +++ b/browser/themes/pinstripe/browser/browser.css @@ -845,7 +845,7 @@ toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarke border: none; background: url("chrome://browser/skin/urlbar/endcap.png") transparent right center no-repeat; margin: 0px 4px 1px 4px; - -moz-padding-end: 8px; + -moz-padding-end: 10px; font: icon !important; width: 7em; min-width: 7em; @@ -920,7 +920,6 @@ toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarke /* ----- PAGE PROXY ICON ----- */ -#page-proxy-stack, #page-proxy-favicon, #urlbar-throbber { width: 16px; @@ -930,7 +929,10 @@ toolbar[iconsize="small"] #unified-back-forward-button > #back-forward-dropmarke } #page-proxy-stack { - -moz-margin-start: 11px; + -moz-margin-start: 9px; + width: 24px; + height: 20px; + padding: 2px 4px; opacity: 1.0; } @@ -2001,7 +2003,7 @@ tabpanels.plain { #identity-box { background: url("chrome://browser/skin/urlbar/startcap.png") left center no-repeat; - min-width: 42px; + min-width: 44px; } #urlbar[focused="true"] > #identity-box { @@ -2013,7 +2015,7 @@ tabpanels.plain { -moz-outline-radius: 2px; } -#identity-box:active, +#identity-box:hover:active, #identity-box[open="true"] { background-image: url("chrome://browser/skin/urlbar/startcap-active.png"); } @@ -2023,72 +2025,117 @@ tabpanels.plain { color: black; padding: 2px 6px 3px; -moz-padding-end: 14px; +} + +#identity-box.unknownIdentity > hbox > #identity-icon-label { + display: none; +} + + +/* Verified domain */ +/* - Normal state */ +#identity-box.verifiedDomain { + background-image: url("chrome://browser/skin/urlbar/startcap-secure-start.png"); + -moz-padding-start: 12px; +} + +#identity-box.verifiedDomain > hbox { + padding: 0; + background: url("chrome://browser/skin/urlbar/startcap-secure-mid.png") repeat-x center center; + -moz-box-pack: center; +} + +#identity-box.verifiedDomain > hbox > #identity-icon-label { background: url("chrome://browser/skin/urlbar/startcap-secure-end.png") no-repeat center right; } -#urlbar[focused="true"] > #identity-box > hbox > #identity-icon-label { +/* - Active state */ +#identity-box.verifiedDomain:hover:active { + background-image: url("chrome://browser/skin/urlbar/startcap-secure-start-active.png"); +} + +#identity-box.verifiedDomain:hover:active > hbox { + padding: 0; + background: url("chrome://browser/skin/urlbar/startcap-secure-mid-active.png") repeat-x center center; + -moz-box-pack: center; +} + +#identity-box.verifiedDomain:hover:active > hbox > #identity-icon-label { + background: url("chrome://browser/skin/urlbar/startcap-secure-end-active.png") no-repeat center right; +} + +/* - Focus state */ +#urlbar[focused="true"] > #identity-box.verifiedDomain { + background-image: url("chrome://browser/skin/urlbar/startcap-secure-start-focused.png"); +} + +#urlbar[focused="true"] > #identity-box.verifiedDomain > hbox { + background-image: url("chrome://browser/skin/urlbar/startcap-secure-mid-focused.png"); +} + +#urlbar[focused="true"] > #identity-box.verifiedDomain > hbox > #identity-icon-label { background-image: url("chrome://browser/skin/urlbar/startcap-secure-end-focused.png"); } +#identity-box.verifiedDomain > hbox > #identity-icon-label[value=""] { + -moz-padding-start: 3px !important; + -moz-padding-end: 8px !important; +} + + +/* Verified Identity */ +/* - Normal state */ +#identity-box.verifiedIdentity { + background-image: url("chrome://browser/skin/urlbar/startcap-verified-start.png"); + -moz-padding-start: 12px; +} + +#identity-box.verifiedIdentity > hbox { + padding: 0; + background: url("chrome://browser/skin/urlbar/startcap-verified-mid.png") repeat-x center center; + -moz-box-pack: center; +} + #identity-box.verifiedIdentity > hbox > #identity-icon-label { background: url("chrome://browser/skin/urlbar/startcap-verified-end.png") no-repeat center right; } +/* - Active state */ +#identity-box.verifiedIdentity:hover:active { + background-image: url("chrome://browser/skin/urlbar/startcap-verified-start-active.png"); +} + +#identity-box.verifiedIdentity:hover:active > hbox { + background: url("chrome://browser/skin/urlbar/startcap-verified-mid-active.png") repeat-x center center; +} + +#identity-box.verifiedIdentity:hover:active > hbox > #identity-icon-label { + background: url("chrome://browser/skin/urlbar/startcap-verified-end-active.png") no-repeat center right; +} + +/* - Focus state */ +#urlbar[focused="true"] > #identity-box.verifiedIdentity { + background-image: url("chrome://browser/skin/urlbar/startcap-verified-start-focused.png"); +} + +#urlbar[focused="true"] > #identity-box.verifiedIdentity > hbox { + background-image: url("chrome://browser/skin/urlbar/startcap-verified-mid-focused.png"); +} + #urlbar[focused="true"] > #identity-box.verifiedIdentity > hbox > #identity-icon-label { background-image: url("chrome://browser/skin/urlbar/startcap-verified-end-focused.png"); } -#identity-box.verifiedDomain { - background-image: url("chrome://browser/skin/urlbar/startcap-secure-start.png") !important; - -moz-padding-start: 11px; -} - -#urlbar[focused="true"] > #identity-box.verifiedDomain { - background-image: url("chrome://browser/skin/urlbar/startcap-secure-start-focused.png") !important; -} - -#identity-box.verifiedIdentity { - background-image: url("chrome://browser/skin/urlbar/startcap-verified-start.png") !important; - -moz-padding-start: 12px; -} - -#urlbar[focused="true"] > #identity-box.verifiedIdentity { - background-image: url("chrome://browser/skin/urlbar/startcap-verified-start-focused.png") !important; -} - -#identity-box.verifiedDomain > hbox { - padding: 0; - background: url("chrome://browser/skin/urlbar/startcap-secure-mid.png") repeat-x center center !important; - -moz-box-pack: center; -} - -#urlbar[focused="true"] > #identity-box.verifiedDomain > hbox { - background-image: url("chrome://browser/skin/urlbar/startcap-secure-mid-focused.png") !important; -} - -#identity-box.verifiedDomain > hbox > #identity-icon-label[value=""] { - -moz-padding-start: 3px !important; - -moz-padding-end: 12px !important; -} - -#identity-box.verifiedIdentity > hbox { - padding: 0; - background: url("chrome://browser/skin/urlbar/startcap-verified-mid.png") repeat-x center center !important; - -moz-box-pack: center; -} - -#urlbar[focused="true"] > #identity-box.verifiedIdentity > hbox { - background-image: url("chrome://browser/skin/urlbar/startcap-verified-mid-focused.png") !important; -} - +/* Favicon Glow */ #identity-box.verifiedIdentity > hbox > #page-proxy-stack, #identity-box.verifiedDomain > hbox > #page-proxy-stack { - -moz-margin-start: 0; + -moz-margin-start: -3px; + width: 24px; + height: 20px; + padding: 2px 4px; + background: url("chrome://browser/skin/urlbar/urlbar-favicon-glow.png") center center no-repeat; } -#identity-box.unknownIdentity > hbox > #identity-icon-label { - display: none; -} /* Popup Icons */ #identity-popup-icon { diff --git a/browser/themes/pinstripe/browser/jar.mn b/browser/themes/pinstripe/browser/jar.mn index e29b0e1142c..b29dd4005b5 100644 --- a/browser/themes/pinstripe/browser/jar.mn +++ b/browser/themes/pinstripe/browser/jar.mn @@ -151,12 +151,18 @@ classic.jar: skin/classic/browser/urlbar/startcap-secure-start.png (urlbar/startcap-secure-start.png) skin/classic/browser/urlbar/startcap-secure-mid.png (urlbar/startcap-secure-mid.png) skin/classic/browser/urlbar/startcap-secure-end.png (urlbar/startcap-secure-end.png) + skin/classic/browser/urlbar/startcap-secure-start-active.png (urlbar/startcap-secure-start-active.png) + skin/classic/browser/urlbar/startcap-secure-mid-active.png (urlbar/startcap-secure-mid-active.png) + skin/classic/browser/urlbar/startcap-secure-end-active.png (urlbar/startcap-secure-end-active.png) skin/classic/browser/urlbar/startcap-secure-start-focused.png (urlbar/startcap-secure-start-focused.png) skin/classic/browser/urlbar/startcap-secure-mid-focused.png (urlbar/startcap-secure-mid-focused.png) skin/classic/browser/urlbar/startcap-secure-end-focused.png (urlbar/startcap-secure-end-focused.png) skin/classic/browser/urlbar/startcap-verified-start.png (urlbar/startcap-verified-start.png) skin/classic/browser/urlbar/startcap-verified-mid.png (urlbar/startcap-verified-mid.png) skin/classic/browser/urlbar/startcap-verified-end.png (urlbar/startcap-verified-end.png) + skin/classic/browser/urlbar/startcap-verified-start-active.png (urlbar/startcap-verified-start-active.png) + skin/classic/browser/urlbar/startcap-verified-mid-active.png (urlbar/startcap-verified-mid-active.png) + skin/classic/browser/urlbar/startcap-verified-end-active.png (urlbar/startcap-verified-end-active.png) skin/classic/browser/urlbar/startcap-verified-start-focused.png (urlbar/startcap-verified-start-focused.png) skin/classic/browser/urlbar/startcap-verified-mid-focused.png (urlbar/startcap-verified-mid-focused.png) skin/classic/browser/urlbar/startcap-verified-end-focused.png (urlbar/startcap-verified-end-focused.png) @@ -166,6 +172,7 @@ classic.jar: skin/classic/browser/urlbar/startcap-active-focused.png (urlbar/startcap-active-focused.png) skin/classic/browser/urlbar/startcap-active-focused-rtl.png (urlbar/startcap-active-focused-rtl.png) skin/classic/browser/urlbar/startcap-secure-active.png (urlbar/startcap-secure-active.png) + skin/classic/browser/urlbar/urlbar-favicon-glow.png (urlbar/urlbar-favicon-glow.png) skin/classic/browser/urlbar/textfield-mid.png (urlbar/textfield-mid.png) skin/classic/browser/urlbar/textfield-mid-focused.png (urlbar/textfield-mid-focused.png) icon.png diff --git a/browser/themes/pinstripe/browser/urlbar/startcap-active-rtl.png b/browser/themes/pinstripe/browser/urlbar/startcap-active-rtl.png index dc433797a2047246752fad3b2669b21b638dbf8c..d8cd489ec38648ca9d159accc4b877627bc1b8ec 100755 GIT binary patch delta 1300 zcmV+v1?&3O38o5=BYyxHbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU$ z$Vo&&RCwCdSUpc8R}{U^HaLJcHUaEFK?;5ZQW_eHloUZi5p_cTLXtXBenCnaBm|;J zgM^|KsiIw^)uI4d6a|E_5n$HFHXeVBXXfReH}gDWYy+#rM1MRno)5n__uTW&{V+mG zNzZA7=$Q?%va%wp)hgBNb;{*(PYxg&jaEaUP2} z+%@H{uPL2QQ#P9+$8q`&7IK6g9N}=77_^MVV!!bDi_Oi=LRY}qY*scJ4XRWsl*wf2 z?b|=8SS-@T#eW6aw%vEI&1REeAG=(u)reW9p`jszfq%NOvGGR-U|t|C%TkL=6TDUOU}@~{?|&=ssZ>&d4!|YRoiifu8yUde zYaZBzO|xlo{4|u^{JVE_d3mYqV#gDS1epGKZEdZhS4V;@v36*5bd&}L28aWJUhTdj z%Xa9a(Rj;{4~yEaTQ>|s3eTy#6Qt)5PL5P812lH{MJ&e02$)46Quh2Dphs99TRi)- z4u*pR-had6XOo@X*xSQQ-L@(HulNt>T0Hq;kM+=?DAI7G&bWMp; z6)Y9hY(E?hDS18$Fb0yiu1EpN{fq7;m;yWB28J!GsqBGi+_N<8M*)VHDAVv5x$-G` z3sp>*Bvjr8pK;H!tUL-ZK%(k28g*(az<>VMiC!Ae!6iC1(MoFpN$3ET4$fSzxlox6 zlY0w8^%s!D)YR1P4+4f~g+hVy`8-vPs_VT5D`YE830(v_iip4Ks`ubELW+Qj-7B{M zxw*sPoiter$osdq1{sFI?7on*v$H=w2pH@h9v-Tu#PsyrFA3<*4K^VMFk3E{RDZzF z%*-6l&CR{M7cds1W8>CSG5lZuj0(O_X9XO()vVlB6!>H^X)Z4>e}&lZ2^fp^xPLf0 zI---4lU8=<3%fWwPAjOvZjI#txp4pBEG{m7%lduURvUsZKo7jTyQ|Is3~&3L5gZRN zh`}`q75Bl7g@uJ5Si3)|NDKl-?|%!OW-=L7g3+O&;Zeyu*kEa287 z1puQ*!GSh_!OH3B>7%8krSDUz)X%)a=%~IsJ3FdbhR^{R13mFm4eo!NTz=~e@UQv# z`3(-TU-|Jq;=XI$VK2Y@pMSaMJtoob{>{g|Iuy_CA1VI`FaVvxCEM;^Z4K@K0000< KMNUMnLSTYvQ*H(T delta 1219 zcmV;!1U&nu3f2jbBYy;)NklMRQgEt{pA%X2wWjCPLeB~b^zNe?>*Kj!e z?at25Nn60XySw`S{+?3F6eUwBIy*b1i;D|#9Op@aTOo@gJrO-HFt7*kpKot(-!=uD zNF;QzSforQL-BZm-n{vPQmJct_wFr~%VkpdqZJl{>Sn}5VItJmurP@AlALB9(ciR@jFeUToJo0jYwugp><~KJtUk3ndS0;Gi4}~6} z#^K>1=y66jH#hVcO2T^zXi(2H7{?NOnnxQKft9nM$bZKh8ygw#yKogbTnFyZ@bEB2 zA`wC$P@z~51Ld*7V>JfN;21QlO1-_k^ziT?J)h6V@N5UmK5ekDzwxcv(kCY;^xLaf zbPbw_MO@!1<;}Hlm)tF?8<|&T5Z-efXc@`nu<}QMHgg-GnHCH-oxTG_(`-aNGBPr~ zzP=t0SbsPm&af_AK@$@bG&VX43uh^pF9ZmwTCvv)F4ah0?^@LWt%5e+g~Jww;aye? ztsPLb#GF>Z^EDQI)e^ACjAaSvv9U3Fe|szZuAQuW`e5iJf^PPQLI7r?A%3i`0P{^5v@B!`EC2TX zLs+7e;jLC)I2&leWhMw~le!n~&Y%-37I*Lbt^ji@l}fUK6*hpo%XH@8PMOXOuEjmE za(_j~LI7IehwELtE5N)-I-Qo0Bly4a)f2#`><_G|$*N}nZn0P_(-mOmQPS05zNx7z zjHy)h1os&Q4-P1Yi>xYZs-8-olxs853|dQ#!S5y~Ctq{~%ph+eXWR{!BUKw1Fm*Po zk9zmtLIG7@f4B%$lR)JX!7jj9Wl7i3Xn(JspP&DsBVe}f@$qrhx=+#gEIzkXEOAX#h*Edg_8IXF0=)6-LlRHZ^j9sH16WV#x;UDOSku10dv3f>1PxPm&k4EJaAIe$vO zPfOgutIqQB@;4|CUN)6AcE{D#747fuOLlqeUmRX}$rNBCaY@OgEEio+h2qlE()V+7 zb3d}f1EPZ4XfE92DAq48FU1|%Y?dDT*R)p)3s=3u9hqlpYU=IE%F1`+=Q+;g4qB7002ovPDHLkV1h5|P?-P# diff --git a/browser/themes/pinstripe/browser/urlbar/startcap-active.png b/browser/themes/pinstripe/browser/urlbar/startcap-active.png index f451d92410ca6de57f4911e439d624903ec53144..f094426dddadd268988e56561940d0a89d096030 100644 GIT binary patch delta 1257 zcmV{3jGO?B!3xnMObuGZ)S9NVRB^vL1b@YWgtmyVP|DhWnpA_ami&o000D^ zNkl~|brmL$X!6+D7$iqWIe#6YP!Q~Z&C#VOE402*k{-;x z=1I>pb`!xC3PrX%KR?gGBD<7Tozb=kqi261;BXWt% z)Wp!rx?`PF=p`s$NhhM>|rn;%REO7Lx> zii@zp;VR`y7vf2J2g)dJShx-6`vW{aKK}XJx8g6jB}1iBW*!q@(=@mX6^5sfz*|Vd zcMoIUx>eTA5!u0?YV|u5i$yB_{#0Uld4GB5uWeVI%0XF{=t{`-sb1*?CkyS?(Qc{jZIBXBpPvBN=g$AFMrto z8aTa=`WNaYX!z}RoejK!QT}ajZ*K<+z@R5X*y-CU$_$tyJpi!!py15R%)spIEG%MQ z(HUvKFOD#R{L`1uF{p#GN`R>eT3TA-v$ogk6Dd+C6n@1>Z=ar? z&LU_*Qb(Mo;Q)s2ozAWKwjT5Gono#-IfUBCrlzJ~dU~2^LUKoqym;UlS_dE`e}H#aw<<#M_C`ubXVYLJ;s1|&%WMN#|#kB^Th5#;Lm z`T1wJH@ED*eE*~%1AzdvwY5Qedk19FX-H?%(A?Zy8}P)$#D`~RXTM)vU8!hY92|sj zI0V5^P+T+o34iwh$Det}%)vMxXI8(sHO|1nevMT+>0O3hoE~xGy>K`TrBWB9(>gqV z{s9z=tq_aFAR3K&0Z&d&_Me`f{()eF)I+Y2@t`wJ6bK?{T7)sLS-1nZ_txD3-cEWP z4uzntScF1rD|B~v3p&K(aRD}jeJ;Q=Gcz%yzyVrU4Symq;tcJK&ei~O74rl9wt~Vr zQ>hfvpdEU8deFiK4aiW|dM?0d-CvH5jy@-_O-)VWP*qh}m%!5V#{gB zQw+wPfy=sWC&$( zcRB(#_!9!}xJvwSx&4hq<`_;^?eFgwbRdC0nCYgbrpkEDa=DyPDv8a_A=}1IO4K5R ze?0SVx~{|U@Guk#1&`2b0-l|nEz>;>AiyFGGSdcDRJTxwOB1dWob{@80p@$e=c*T7 zTYtqaEuq2a=%|PewZ!HDytue{i!D^h=OKj|Mp0B?PNh2(ZmYjurZd^xK&GRvSWJbX zp&^lu8v?wvv~+xOa-!uCaN6XsHL!x)m$RnO;LUkWyrs-W38NuOEH5wr{OZ+TUu4o* z$YisiVU!RdO<2oPIk;SFjAagHgDWDqHh(G>GoP4q8TvK0N+7ei?#ReUW1`#I+WKU5 zb@ewXDzO}9n`9~pa#S(^vs$9E_+1@598sh?syG}VD8{)fUQp~Mz{KMR!y2{-TKUhN zot2+wa!^6Wb*Vos--`m^kq6{dRMZ7G_m74fbKQ?iG z%C@8<(o_+Pda7^geS}iE)U&(0`|0N9=2y6ZXIOelmzS5}r~U|S#jg+YuqcWe_{^uE m_&y#*q6;3W|Nk%XFWPGq1J2xdsDpd}0000>JMIvq03H0oWawf(pToBA z!)clZLWmOLb=`!y+oEr_;dvfuA2FGz=n&u-&fd-KfuiJ24 zS1Hk=>O)35wOr+NDBK>X*BH9puBz^D;s?QkQ)*=ks*IMSE}<$l1;*(PNs>If6!bRA z5QZV1+ah}DNAP_gS(a6U-+pef@vjjCL8U5<;{=~BZm?djD^;2M{=;e$L=a7iS2e1} zc&GzRoSd(+EXBo-5W>i@lc`#afZYm*@KNzuxs90R{kn;*XK>rW330Itf5++MmC#; zVHjXh6hA|^2RpFxCcdn!p;#;;pU)2=#=tn2U>u`!w2zre3AI`cmNhJ=>pBP_!(n(7 zA-w*JPX93n-OJFirCvq(ITV!<6i+QmH5svol7ih#ilqWe@b?)=YN3W8M$J~eT$2kA`zW@UOXHmZDyfb5x Q00000Ne4wvM6N<$f-5}nTL1t6 delta 535 zcmV+y0_gpx1h52LS*Su;{i%5iGXgM9ZzVVatvU#{4xB(>s)2$ic zN~_hPU&8b$hkwoy&ttYbiAJN8%VpZ_HiIQr_kW_>3V%gaRdTr;&1RF~62{%{=$!sN zLZJ}VYPGkgk)Y&1M5nmllT0S5)oP3@vFJ&ob11KRqZn-9Sa8-FLuc;>_5BSu@jqyI z5kY5hy2)fRlY=+bKcZW6XvE|3$-ln-bPwG_+YXwhO@D6Y+ENJJ&9z<3HkEunKYlz{ zq#gPe%sv8v0F6dtG?%y Z0plAxRuI5EIZFTl002ovPDHLkV1fjw{}TWJ diff --git a/browser/themes/pinstripe/browser/urlbar/startcap-secure-end.png b/browser/themes/pinstripe/browser/urlbar/startcap-secure-end.png index fd35d24b32ab7ecc8618837501225fdf25362266..ffdd9561b2cbb0553c7594909db4653bdbb6834c 100644 GIT binary patch delta 497 zcmV6CC=gw(~@B3J!C>AWaP$>KxnM@`T4u6Lci9|rkrac9^jNzel zh1&H6)a3}Yq=r~52APAuP``(l;t5E<17kOfOlAYoXcVDP2(s&XKhS&e2wGgl&fdOg z8;{4wkSs%HjDwyBt8|Xdw2o{x3r!ohQxpY+knv%d>%w`x$4ZF6Fbt$pDbY@nr0MlI z{XR(Z8QWXi(0_Fus;d5h1n74@u*&C3r_&;d(%Gw}iro}5&1yFd`a>iV330l~;4?wV zb41!`1%Y=xa$*Dpr3rB0Qw)d0`S#e31k188PdEBvD=D3Y8_t+3UQVARENUq=k($fpggH~7%f<;^-u3X7 z;B)YZdcBT(J})Hs(QG2_s5)Q3@hz~^wqbS8kXh5Y!?<% n;))4h$-yF@D_Qgh@GZaq7E-R}7(iXl00000NkvXXu0mjfB(3T< delta 517 zcmV+g0{Z=n1fK+uB!2{FK}|sb0I`mI`%#ks000SaNLh0L01FcU01FcV0GgZ_0005O zNklojR{7*6;$yC5>Fm+rCM+Tq z#lUCwW0`>pnW$I!`(4K{oIi$NcyVq%oO8bChXBMp#N0u%*?-JMOeWJ{6h`$o(|oBl zN#@R2-`HZ!zJ|~~RT+2qy~gvGK@>$H5D1dVWDsuS7o+sED%&m%RaHqO5)=vr>h(He z=i^U?_D(D8zShw+4Z|>~R4TMuE&BaFLQR($dXqTCx#J|4%ME7fcDoEqY=0;sdD0~u zZZFAXl3J}suYcELw8X}{A4vQ0&-i>kip3(GPKWUl_Tz6z-tY;rSd2!aG1${YPzirU z()K zNShv=bUHnI>1&TpknX#V&~<%wGYhLRq+6TEI9xtTrGC=%+Ir8{pKx2ObJeY%I=@26ZY|9fVp z8U}fi7AzZCsS>Jii$m5978H@rJOh9YB1no4Vc;#P#`4e>MmZ+e}TDz_x<{e zjk#G@)d~$SKYpI>A?4(8@1&5_!YN%7E!G@&3DaF9@8)u|q$5U*<3k8rxnRQs8G#0? z*L9y>?f%txdfxf9hCIF(*blwnHS{la`SoY3K~fR70YekFjlj}}YKB1T89ZJ6T-G@y GGywpJOi5G# literal 0 HcmV?d00001 diff --git a/browser/themes/pinstripe/browser/urlbar/startcap-secure-mid-focused.png b/browser/themes/pinstripe/browser/urlbar/startcap-secure-mid-focused.png index 15813bfa70e382e78464d2a74c9be4e62a6a89be..cd33dd289d3ee7d81ad994a963cb252132cf9f04 100644 GIT binary patch delta 184 zcmV;p07w7Z0n`DIB!3xnMObuGZ)S9NVRB^vL1b@YWgtmyVP|DhWnpA_ami&o0001X zNklyB%=r8FAB6Ge4~+5mFNE>? z_a7+Z7gXfeZy4j}ZwTY(FQ}R~AHG4Qe*K22fosQL{6=T|`7r}E`7g{FaECGTutONK miYj-(jJIEY&j&F80t^7=bw%_|Ja7L10000FxzP+Um`846$~X{yQ7Gm!d0{vXtFNb6 t!2H(Vs2#z|W3!g#`gDE)$hgD~U0B!3xnMObuGZ)S9NVRB^vL1b@YWgtmyVP|DhWnpA_ami&o0001F zNkltoZ~y=R delta 171 zcmV;c0960N0mlK5B!2{FK}|sb0I`mI`%#ks000SaNLh0L01FcU01FcV0GgZ_0001K zNklgn$M3uXquK(CNeGJvoi zw*kauzW|6LEgWlASEND7>Xs{|Hps7)yRw}=F#p5i?X`4J-z4=ZqJPkS*cj*bg_%tb Z06gD#NIUfrJl_BS002ovPDHLkV1k-oL+Ahi diff --git a/browser/themes/pinstripe/browser/urlbar/startcap-secure-start-active.png b/browser/themes/pinstripe/browser/urlbar/startcap-secure-start-active.png new file mode 100644 index 0000000000000000000000000000000000000000..74a65262e025b36d654f955d15ebd076b1789a97 GIT binary patch literal 728 zcmV;}0w?{6P)EVPU6+-GOqx^dI3|AA0&(|tB>O5F-B3syuZYBZVmy?5?- zCPFke0XuM*Waj&w@09e$pj@p& zsZxWIgAo3o0QUFyohXXl_J<+kwhO}b!1bEo)ap>S9pL{uWLfs+`@pxET?Kn_8EVa2 zP^mAXxB`4`4j5&BfWyPXwJ;2K4HrS zW?uwLpco|vl?F#?Vjh%Ios3u@9L$c9xHS(s%5|YL=K928e%CPkC{YH&EYuLt8e0=H zeWr0uF@p|-amWb;g%M1Vnvm%L=N!^ZLzLo-MiQ)y0c8x|%m9QC8HI%7x&bLQx@ZIn zgBgJ1I6;XGT$w6RQjK0=Iv|uxxQv(g>gwv5Yg>>eF~~RumC6yQ&`qnNvQdqJt*xz> z%icmxRRn1i{RWd{45JpeDhAjtk(#rXfSe1FKlOZ$HKRk3$%S2@Ww%DvmRmacVeMS67cuPEL+4FF)P;{M9F4`UynROb5E% zE*u{p7w(%E7Z;Cuz1|aSa2NOZJo%4vNnmYYtrbzpO%JkP0t^62i!c7eGJ1&s0000< KMNUMnLSTZ%QAY;= literal 0 HcmV?d00001 diff --git a/browser/themes/pinstripe/browser/urlbar/startcap-secure-start-focused.png b/browser/themes/pinstripe/browser/urlbar/startcap-secure-start-focused.png index 190b0856ee653b6da8ba92982acb849357b703ed..70c18f96eaeae1af7321c73d0f1cee8490d81ed3 100644 GIT binary patch delta 641 zcmV-{0)G9(1)2qrB!3xnMObuGZ)S9NVRB^vL1b@YWgtmyVP|DhWnpA_ami&o0006! zNklCEi1}WE!uiIK0IYqh2CJ@MenX$)7JNb?S4!WzD_H(!+W@uLkm z_D2)jP4lj}inBJ4gX**WhtTsQxNc=a18FH1wwq-Np(KzBF;&PuNL}!xvbf|x7^g68 zWkL;cgb=h^tw6$N3l?HZDKr5(@PyA4)Fle~=MgAPpMNRD2qT2zxkC-i!b~ARE)0W; zI2=-&DobE0B1C>sg{{y2XaKi${t5^|w{Q2TqM>Fxx+)nTDubmkHOyp&34 zppB22e6(cOeO)J7w`|ir;A}Mv2Mxwpfu||aCe5YsF++820mXGnG*>FHwf`JsS-gQ1 behDxD{Rt3wVaY*H00000NkvXXu0mjf%CRH< delta 684 zcmV;d0#p5(1;hoAB!3BTNLh0L01FcU01FcV0GgZ_00004XF*Lt006O$eEU(80000W zV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F}0006yNkl;(od4GA|s2hYNr_X9;5rlV<<$C;`-fI#2=1Ku%0C=YdV28AG)g$cj5g zJKop?Hh>p83Z9z4dm?36(n{H4%q)Nj)ZD15GccRL#P<`#+x*4OJSKdLZ(VF}m) zS}M5iNdKx;pnoU!_Bt#z7U_=^q1HFR{^3y-XvgMVJvd)oe_V3jz1`)^SNw2;e_O@= z;ZZVvb4$ypEr;&P#&Xqpv(x7LRfxV5qKFe{0xQ~gTMJn&IID*7G)_+S3gNXY^0CPY|DJ2TUBBPO> z38a9e*2;1cDdb4b1k8;Lr&k_0vw;8zZCjYI?^$Bp9xFWQ(| zI#+D?a(~ovhFu3yntb8?!Bz+y1D{7me8}eKPWwt=M_r7PXr*t-26%t4bpd?R#vDs0 z{jpT8o($}qvgIYV@@@g+p??FaQWwUL(V2o;R2e!!RSG$hIc+(s<1X$9kAgizPK-TQzM+TmM;PHQ)h|`7;3cR2=@E SDhWPJpb^GaIi8lF;!_>I5EEY!N~CY?_a_i ze*gX*A}FKG@PGBkZ{i{j=zf9!90Cl#e-fzy7=g^+|1vZD{r87B4J<4y46ojQWBAX+ zN}L9EcJ{wNzkFh0;NT-p0}l_+moJ}R3;bo|A})DLOG_VP{P>LF_pd*AF=PwFI&kz61&CRC+Y3_|1H&*g~d&~ZeNtNL{BM)2wt}M#) z^5x5bl`B_PJ$&?7?1&|0>rW)r!taSkO2f303}5v!ZMS|O#lD@07*qoM6N<$f_a$}`Tzg` delta 582 zcmV-M0=fOe1m6UZB!3BTNLh0L01FcU01FcV0GgZ_00004XF*Lt006O$eEU(80000W zV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F}0005iNklQ@BRAI=eoUk1D}rrNHwHsDdoFscORIk zD@$nq@P|*SR;y*X2saj2*3jt&qsJPH#dhXbR<-W|5E6|Bgb^XS8h_*N>Wtxl> zIG51?rIhZI4x%s`pzAsgju=Rrhz1yjK|W(~GNz&drhjRk`n|)n(9T6W?@T7MJHa}j zkcO%c-15GTt^feG zZSNI}#g`YbFV6>GpeTeS`Ir9v2bs_3-vBThjmCDeca+%20zA#?Cujp)!*X4BvtF<7 zwA%+u$3K+Rx^e~_lLLX@J6dkFS`VAe=401&uL>b1wFthH0I&cc3&7OIHL_m=0QbEf Ur!~bD4FCWD07*qoM6N<$f;yB6KL7v# diff --git a/browser/themes/pinstripe/browser/urlbar/startcap-verified-end-active.png b/browser/themes/pinstripe/browser/urlbar/startcap-verified-end-active.png new file mode 100644 index 0000000000000000000000000000000000000000..124bc03717a3a05856b9fadd112842e823206441 GIT binary patch literal 542 zcmV+(0^$9MP)?5kx8XAp;Xj`dNauH)-wyUQy0{U2k z>ujUhY{E42cCsvk5RxCJs419^*HG5C&}y~dIF4v1Nz$zMI8MDy9PIDy!?tZ`n)XVR zTZ=Rpx|w>b3KFIBM@!!(hVV46-HcF{Qlepq)BQC*SIEd4LCZ$4@UF8^WTHhhA>>H_ z&iV56j3Xbu?_*iq=xum`e!q_>ik1m4(I4DkI2g&~*IP)XoKN5l4sm{c zhHkfuBuVBc{5i}h5x)QUhJvIDYP;PQ$@#aWT3bJec!Kab#MPh&IZ`pW8Hp^GN~M?i zO3to!F!>!LTjL;r_wyv(6d)W;FdF)Z(|BczeO~|a+K>;N9G~LX-90?d6IV>qk$hd{ gxsp{sfIk8Z0ArP#R~V5zX#fBK07*qoM6N<$f~HRP4FCWD literal 0 HcmV?d00001 diff --git a/browser/themes/pinstripe/browser/urlbar/startcap-verified-end-focused.png b/browser/themes/pinstripe/browser/urlbar/startcap-verified-end-focused.png index 4a55541b9d7f89e9dff88537944cd55e1d930d5e..a7e05b21fa4458cff4e8e166b8633c89f28f7e30 100644 GIT binary patch delta 512 zcmV+b0{{KA1eyepB!3xnMObuGZ)S9NVRB^vL1b@YWgtmyVP|DhWnpA_ami&o0005J zNklS1LHfkZE%C%vHFM7@ycK@Xy5J*?=TF^Qxi zAu?yIrDeCZ-I^ywk}MAn4(`MEcfY&O3G16D8yI0o!CV^&q<>a(H4O0IpP|?-2uAn9 z|GnY59xhLAadvbAHKro1rIAP^AU(aG{y=t@;c(9c?GP*#ipb}upsFeqMS6>;kWTl@$+8SV5c4t5NJvG@dXxg1X-gbckVLR(ROreWm< zK;}e|N~L&r-v=KG`mV^+dRGuOi0}Ix3QOalCsH_$^RE=-Q*6VsEcB8?!FHq$!!QCF z+;Gs6>Ue%>!Zgj$RAMuVW~72@wHlgAK7+S@lq;y4S9#EN9gMNzhP!-&;ab^;T#ND4 zQmMqv82~-j_wfU5Tt>EG-@T#HXrNp!b4h+Q^L~};25?2*!K7V6`@q6vCLdUy=K@Rj z`rqGr_r0i5DBd}=r~_$kcDgmvcYQGF)+peY00RKWNw5%w8)#Di0000bVI1PvT@MGD zxNc%^IhLx~+Pd82@vshns_SfIU zUT}8(Br@~rBI$H`bnwC231mxN4Y62k^wKl$CXvnim4EnrzR}Ix@+pw1-k!x|T_Bgs z4L_cn-U+&%xs>?*e(Lr5VDOsjC|yd|6whssh(@D>S9sZZgkE=?XIQXm2!%rXW)>G6 zhv_%HatfVQh12OIpU?k)X6NmP80Lyy!9(j+7A{xaf%>1$ye dV%!hlFBB=hGdyaWtYQEF002ovPDHLkV1lWF1=0Wj diff --git a/browser/themes/pinstripe/browser/urlbar/startcap-verified-end.png b/browser/themes/pinstripe/browser/urlbar/startcap-verified-end.png index 8be6c8c3be99a172da3b3ebf81be8888f4408713..ef2297fcb30c4906f585e8afe95e914823525802 100644 GIT binary patch delta 500 zcmV5dkX3bT zZLYJj*=%+S2|@%0K0*q#4qX)W6;vt}Xxg-#D2m`XZhDys*t-QJvWRN6ibA2l%JDou zJ08dLVHpzER)5!!&*za&r++~V9GL_Q=_M44MV3TJ{Ah_YkXcW0~>#` z$AY2Hv$V+w5_dh3VgeQFKC1ufXTY9I^h*PD qIvuuRE*i=9JfAB!?+@TpfB^v3m#r(uNGEdu0000jk0u}u_rynEEzfRfR-D79x1xlRF+W2*jkA}!yiEg(`y;;a|5zqe1L z(V$!|KSBV?h<`~J`WeMsK&#av3`2ZB8?n-&0Wgz-E#4#h}F?`5AE>vu^B^ zkyP<_Fd>Q}L}c};jTMX)rf$I1&4B52x>D6Q)?%zBmVYZ|r3?D~J|ePS(O6+bpR=3K z^m;v#B+2$De{IZ(`4yaU@*|Ik&~CR0f*=KLlAXtEeqxoyT--Anjp%ebG#U+*{l_AO z2P|?ix66p@_ak1`U!jU0I%`87;~4Xu^Y9YSIrny>=ep?!@CV}8;7s;Cl9B)b002ov KPDHLkU;%;%QTv7f diff --git a/browser/themes/pinstripe/browser/urlbar/startcap-verified-mid-active.png b/browser/themes/pinstripe/browser/urlbar/startcap-verified-mid-active.png new file mode 100644 index 0000000000000000000000000000000000000000..d1d10fa3150d40ce9dc9dc60cdc62bc554e55abb GIT binary patch literal 205 zcmeAS@N?(olHy`uVBq!ia0vp^Oh7Ef!3HGf8uwlTQj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>Jit;^O978H@CH?vT-=3Mn;E*IAA76sl>Gk{L4=CvRCwByl)q0DK@`Wo^J91KZuge; zen7kn79Jrs8WR&Jk;G72Tp|e+boO*&Yhy#}e_%plLr-Hvu(7km1dRpeM7jNOx4SdD zzU2&X;VzL$UUstc{mgqa@4aDpp5r!ym8-knMcADr77G3=^@Q8FM6b`w}%Uw`8J{-^VxCrV|B z8LtG_v*1+Au*&8*u(7e>L{apyANGVZBjGko)Ms6IH5(PD1k;q`fY$oMAHQc;W&~`{;*_9t1ZZ_3*4KfRm6fATXW>i3ypPb25e3OVZv{-A5`~03UhlYM zb93|Mz2;)#>Ndju2pU8MNJie`Bpq+jR;zW??RH;x8jrI&IvDthAca9#SW2O)8~uZ#CCjo;DS7wRa$f*z zLKFnd>)Hg2f?jYY3_zZrjG25TxD(WZ2cW`SFajfpI>7;G1xKuzL?Vm=NHY0G@FaK? zG!R>14Yw?C0qIV#6@1X#v=1LHA0ei{vvqB ze+loL36X}Of^DL3bvO?nDgG+Z0Qvi#!sCqxdJZa{3HJ!q9^*ZG5V4yYeF^e{NNgL> zm&SI^JQfI)Nd;w&4G()zP|vo31soBCA4vTb0Tt2lZ^VwWhY7q9T-vPN%oW^?TQFBY z8TXeqYnN=P;ItblJJK&=>B^lL=@!o(SmFy6EGuR`v1MM z8Qb0p47iC06s`?!wp&mtPGq;k_nE7y?nDK)*uBTtl46%j!#iwMVD`X~KuaaJ`)9ds uNx(((cpRzZvNwNyaP**)zx9*(DZl_xp1-<|EHsn=0000 Date: Mon, 5 May 2008 12:45:31 -0700 Subject: [PATCH 08/98] Bug 432190: Some colors aren't considerate to accessible themes, patch by Michael Ventnor , r=mano, a=beltzner --- browser/themes/gnomestripe/browser/browser.css | 2 -- browser/themes/gnomestripe/browser/places/organizer.css | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/browser/themes/gnomestripe/browser/browser.css b/browser/themes/gnomestripe/browser/browser.css index 44df23e48a0..ecc1f562ed6 100644 --- a/browser/themes/gnomestripe/browser/browser.css +++ b/browser/themes/gnomestripe/browser/browser.css @@ -914,7 +914,6 @@ toolbar[iconsize="small"] #paste-button[disabled="true"] { #identity-popup-content-box > description, #identity-popup-encryption-label { white-space: pre-wrap; - color: black; padding-left: 15px; margin: 2px 0 4px; } @@ -958,7 +957,6 @@ toolbar[iconsize="small"] #paste-button[disabled="true"] { /* Identity popup bounding box */ #identity-popup-container { background-image: none; - background-color: white; min-width: 280px; padding: 10px; } diff --git a/browser/themes/gnomestripe/browser/places/organizer.css b/browser/themes/gnomestripe/browser/places/organizer.css index efce50bb871..badfdca1902 100644 --- a/browser/themes/gnomestripe/browser/places/organizer.css +++ b/browser/themes/gnomestripe/browser/places/organizer.css @@ -49,6 +49,10 @@ color: -moz-DialogText; } +#placesMenu > menu:hover:not(:active):not([open="true"]) { + color: -moz-buttonhovertext; +} + #placesMenu > menu > .menubar-right { -moz-appearance: toolbarbutton-dropdown; width: 12px; From afd107f546bf1ae7b530bdfcb2127b1e73739499 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 12:54:29 -0700 Subject: [PATCH 09/98] Bug 431729: make it clearer that in Clear Private Data, 'Browsing History' deletes 'Download History' too, patch by Shawn Wilsher , r=me, a=vlad --- browser/base/content/sanitize.xul | 21 +- browser/base/content/test/Makefile.in | 1 + .../test/browser_sanitize-download-history.js | 182 ++++++++++++++++++ 3 files changed, 201 insertions(+), 3 deletions(-) create mode 100644 browser/base/content/test/browser_sanitize-download-history.js diff --git a/browser/base/content/sanitize.xul b/browser/base/content/sanitize.xul index 3e6963a8a71..50f20ba4ae5 100644 --- a/browser/base/content/sanitize.xul +++ b/browser/base/content/sanitize.xul @@ -112,7 +112,18 @@ } catch (e) { } return undefined; - } + }, + + updateDownloadHistory: function () + { + // When toggling history, we automatically clear download history too, + // so we disable that control. + let downloads = document.getElementById("downloads-checkbox"); + let history = document.getElementById("history-checkbox"); + let s = new Sanitizer(); + downloads.disabled = history.checked || + !s.canClearItem("downloads"); + }, }; ]]> @@ -130,11 +141,15 @@ &sanitizeItems.label; - - diff --git a/browser/base/content/test/Makefile.in b/browser/base/content/test/Makefile.in index 1624d118201..b07b61b8b6e 100644 --- a/browser/base/content/test/Makefile.in +++ b/browser/base/content/test/Makefile.in @@ -58,6 +58,7 @@ _BROWSER_FILES = browser_bug321000.js \ autodiscovery.html \ moz.png \ browser_getshortcutoruri.js \ + browser_sanitize-download-history.js \ $(NULL) ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) diff --git a/browser/base/content/test/browser_sanitize-download-history.js b/browser/base/content/test/browser_sanitize-download-history.js new file mode 100644 index 00000000000..433cadfcc1c --- /dev/null +++ b/browser/base/content/test/browser_sanitize-download-history.js @@ -0,0 +1,182 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org Test Code. + * + * The Initial Developer of the Original Code is + * Mozilla Corporation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Shawn Wilsher (Original Author) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + + +function test() +{ + ////////////////////////////////////////////////////////////////////////////// + //// Tests (defined locally for scope's sake) + + function test_checkedAndDisabledAtStart(aWin) + { + let doc = aWin.document; + let downloads = doc.getElementById("downloads-checkbox"); + let history = doc.getElementById("history-checkbox"); + + ok(history.checked, "history checkbox is checked"); + ok(downloads.disabled, "downloads checkbox is disabled"); + ok(downloads.checked, "downloads checkbox is checked"); + } + + function test_checkedAndDisabledOnHistoryToggle(aWin) + { + let doc = aWin.document; + let downloads = doc.getElementById("downloads-checkbox"); + let history = doc.getElementById("history-checkbox"); + + EventUtils.synthesizeMouse(history, 0, 0, {}, aWin); + ok(!history.checked, "history checkbox is not checked"); + ok(downloads.disabled, "downloads checkbox is disabled"); + ok(downloads.checked, "downloads checkbox is checked"); + } + + function test_checkedAfterAddingDownload(aWin) + { + let doc = aWin.document; + let downloads = doc.getElementById("downloads-checkbox"); + let history = doc.getElementById("history-checkbox"); + + // Add download to DB + let ios = Cc["@mozilla.org/network/io-service;1"]. + getService(Ci.nsIIOService); + let file = Cc["@mozilla.org/file/directory_service;1"]. + getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile); + file.append("satitize-dm-test.file"); + file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + let testPath = ios.newFileURI(file).spec; + let data = { + name: "381603.patch", + source: "https://bugzilla.mozilla.org/attachment.cgi?id=266520", + target: testPath, + startTime: 1180493839859230, + endTime: 1180493839859239, + state: Ci.nsIDownloadManager.DOWNLOAD_FINISHED, + currBytes: 0, maxBytes: -1, preferredAction: 0, autoResume: 0 + }; + let db = Cc["@mozilla.org/download-manager;1"]. + getService(Ci.nsIDownloadManager).DBConnection; + let rawStmt = db.createStatement( + "INSERT INTO moz_downloads (name, source, target, startTime, endTime, " + + "state, currBytes, maxBytes, preferredAction, autoResume) " + + "VALUES (:name, :source, :target, :startTime, :endTime, :state, " + + ":currBytes, :maxBytes, :preferredAction, :autoResume)"); + let stmt = Cc["@mozilla.org/storage/statement-wrapper;1"]. + createInstance(Ci.mozIStorageStatementWrapper); + stmt.initialize(rawStmt); + try { + for (let prop in data) + stmt.params[prop] = data[prop]; + stmt.execute(); + } + finally { + stmt.statement.finalize(); + } + + // Toggle history to get everything to update + EventUtils.synthesizeMouse(history, 0, 0, {}, aWin); + EventUtils.synthesizeMouse(history, 0, 0, {}, aWin); + + ok(!history.checked, "history checkbox is not checked"); + ok(!downloads.disabled, "downloads checkbox is not disabled"); + ok(downloads.checked, "downloads checkbox is checked"); + } + + function test_checkedAndDisabledWithHistoryChecked(aWin) + { + let doc = aWin.document; + let downloads = doc.getElementById("downloads-checkbox"); + let history = doc.getElementById("history-checkbox"); + + EventUtils.synthesizeMouse(history, 0, 0, {}, aWin); + ok(history.checked, "history checkbox is checked"); + ok(downloads.disabled, "downloads checkbox is disabled"); + ok(downloads.checked, "downloads checkbox is checked"); + } + + let tests = [ + test_checkedAndDisabledAtStart, + test_checkedAndDisabledOnHistoryToggle, + test_checkedAfterAddingDownload, + test_checkedAndDisabledWithHistoryChecked, + ]; + + ////////////////////////////////////////////////////////////////////////////// + //// Run the tests + + let dm = Cc["@mozilla.org/download-manager;1"]. + getService(Ci.nsIDownloadManager); + let db = dm.DBConnection; + + // Empty any old downloads + db.executeSimpleSQL("DELETE FROM moz_downloads"); + + // Close the UI if necessary + let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"]. + getService(Ci.nsIWindowWatcher); + let win = ww.getWindowByName("Sanatize", null); + if (win && (win instanceof Ci.nsIDOMWindowInternal)) win.close(); + + // Start the test when the sanitize window loads + ww.registerNotification({ + observe: function(aSubject, aTopic, aData) { + ww.unregisterNotification(this); + aSubject.QueryInterface(Ci.nsIDOMEventTarget). + addEventListener("DOMContentLoaded", doTest, false); + } + }); + + // Let the methods that run onload finish before we test + let doTest = function() setTimeout(function() { + let win = ww.getWindowByName("Sanitize", null) + .QueryInterface(Ci.nsIDOMWindowInternal); + + for (let i = 0; i < tests.length; i++) + tests[i](win); + + win.close(); + finish(); + }, 0); + + // Show the UI + ww.openWindow(window, + "chrome://browser/content/sanitize.xul", + "Sanitize", + "chrome,titlebar,centerscreen", + null); + + waitForExplicitFinish(); +} From 13b94c3c5c5fef186225a1390dc391a7471f79d6 Mon Sep 17 00:00:00 2001 From: "dietrich@mozilla.com" Date: Mon, 5 May 2008 12:57:22 -0700 Subject: [PATCH 10/98] Bug 429811 - Tag container isn't updated immediately when bookmark is removed (r=mano, a=mconnor) --- toolkit/components/places/src/nsNavHistoryResult.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/toolkit/components/places/src/nsNavHistoryResult.cpp b/toolkit/components/places/src/nsNavHistoryResult.cpp index 718a28a7157..fc5a1da0664 100644 --- a/toolkit/components/places/src/nsNavHistoryResult.cpp +++ b/toolkit/components/places/src/nsNavHistoryResult.cpp @@ -2432,10 +2432,12 @@ nsNavHistoryQueryResultNode::ClearChildren(PRBool aUnregister) nsresult nsNavHistoryQueryResultNode::Refresh() { - // Some query can return other queries, in this case we could call Refresh - // for each child query causing a major slowdown. We should not refresh - // nested queries since we are already refreshing the containining one. - if (mOptions->ResultType() == nsINavHistoryQueryOptions::RESULTS_AS_TAG_CONTENTS) + // Some queries can return other queries. In this case calling Refresh + // for each child query could cause a major slowdown. We should not refresh + // nested queries that are not currently expanded, since we are already + // refreshing the containing one. + if (mOptions->ResultType() == nsINavHistoryQueryOptions::RESULTS_AS_TAG_CONTENTS && + !mExpanded) return NS_OK; // Ignore refreshes when there is a batch, EndUpdateBatch will do a refresh From 887bcd748cb9b84048be9db16cee9ef1b12f96fb Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 12:57:55 -0700 Subject: [PATCH 11/98] Bug 432066: fix solaris bustage from bug 431754, patch by Alfred Peng , r=tony, a=mconnor --- .../url-classifier/src/nsUrlClassifierStreamUpdater.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp b/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp index 27fd0a35e72..5dad171e349 100644 --- a/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp +++ b/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp @@ -308,7 +308,7 @@ nsUrlClassifierStreamUpdater::UpdateSuccess(PRUint32 requestedTimeout) } // DownloadDone() clears mSuccessCallback, so we save it off here. - nsCOMPtr successCallback = mDownloadError ? nsnull : mSuccessCallback; + nsCOMPtr successCallback = mDownloadError ? nsnull : mSuccessCallback.get(); DownloadDone(); nsCAutoString strTimeout; @@ -326,7 +326,7 @@ nsUrlClassifierStreamUpdater::UpdateError(PRUint32 result) LOG(("nsUrlClassifierStreamUpdater::UpdateError [this=%p]", this)); // DownloadDone() clears mUpdateErrorCallback, so we save it off here. - nsCOMPtr errorCallback = mDownloadError ? nsnull : mUpdateErrorCallback; + nsCOMPtr errorCallback = mDownloadError ? nsnull : mUpdateErrorCallback.get(); DownloadDone(); From ac85e2d7f6c387e66bdacfc3cb356b623026e42c Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 13:03:37 -0700 Subject: [PATCH 12/98] Bug 431535: Static item's context menu in bookmark menu is messed up, Marco Bonardo , r=mano, a=mconnor --- browser/components/places/content/menu.xml | 4 ++-- browser/components/places/content/toolbar.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/browser/components/places/content/menu.xml b/browser/components/places/content/menu.xml index e6f9f56cbec..6307b5381b7 100755 --- a/browser/components/places/content/menu.xml +++ b/browser/components/places/content/menu.xml @@ -911,8 +911,8 @@ var selectedNode = this.selectedNode; if (selectedNode) { var popupNode = document.popupNode; - if (popupNode == popupNode.parentNode._emptyMenuItem) { - // If (empty) menuitem is selected the insertion point + if (!popupNode.node) { + // If a static menuitem is selected the insertion point // is inside the folder, at the end. folderId = PlacesUtils.getConcreteItemId(selectedNode); orientation = Ci.nsITreeView.DROP_ON; diff --git a/browser/components/places/content/toolbar.xml b/browser/components/places/content/toolbar.xml index b2c4d73018c..69efae46c58 100755 --- a/browser/components/places/content/toolbar.xml +++ b/browser/components/places/content/toolbar.xml @@ -392,8 +392,8 @@ var selectedNode = this.selectedNode; if (selectedNode) { var popupNode = document.popupNode; - if (popupNode == popupNode.parentNode._emptyMenuItem) { - // If (empty) menuitem is selected the insertion point + if (!popupNode.node) { + // If a static menuitem is selected the insertion point // is inside the folder, at the end. folderId = PlacesUtils.getConcreteItemId(selectedNode); orientation = Ci.nsITreeView.DROP_ON; From 355e00c1acd8a4a0fc006466ff6f00be5bd19fd3 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 13:43:44 -0700 Subject: [PATCH 13/98] Bug 431713: show EULA by default on first run of Firefox on Linux, and add override for unit test/talos machines to avoid it there, r=mconnor, a=mconnor --- browser/app/profile/firefox.js | 4 +- browser/components/nsBrowserGlue.js | 25 ++- build/pgo/automation.py.in | 1 + testing/mochitest/runtests.pl.in | 1 + .../tools/profiles/createTestingProfile.py | 208 +++++++++--------- 5 files changed, 126 insertions(+), 113 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index bf1aba38369..c0024532609 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -653,9 +653,7 @@ pref("browser.EULA.3.accepted", true); #elifdef XP_WIN pref("browser.EULA.3.accepted", true); #else -# Need to fix the unittest and talos machine profiles before flipping this by default -#pref("browser.EULA.3.accepted", false); -pref("browser.EULA.3.accepted", true); +pref("browser.EULA.3.accepted", false); #endif // if we rev the EULA again, we should bump this so users agree to the new EULA diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index abf48993a41..555e6d6d67f 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -175,14 +175,25 @@ BrowserGlue.prototype = { // profile startup handler (contains profile initialization routines) _onProfileStartup: function() { - // check to see if the EULA must be shown on startup + // Check to see if the EULA must be shown on startup + + // Global override for tinderbox machines + var prefBranch = Cc["@mozilla.org/preferences-service;1"]. + getService(Ci.nsIPrefBranch); + var mustDisplayEULA = true; try { - var mustDisplayEULA = true; - var prefBranch = Cc["@mozilla.org/preferences-service;1"]. - getService(Ci.nsIPrefBranch); - var EULAVersion = prefBranch.getIntPref("browser.EULA.version"); - mustDisplayEULA = !prefBranch.getBoolPref("browser.EULA." + EULAVersion + ".accepted"); - } catch(ex) { + mustDisplayEULA = !prefBranch.getBoolPref("browser.EULA.override"); + } catch (e) { + // Pref might not exist + } + + // Make sure it hasn't already been accepted + if (mustDisplayEULA) { + try { + var EULAVersion = prefBranch.getIntPref("browser.EULA.version"); + mustDisplayEULA = !prefBranch.getBoolPref("browser.EULA." + EULAVersion + ".accepted"); + } catch(ex) { + } } if (mustDisplayEULA) { diff --git a/build/pgo/automation.py.in b/build/pgo/automation.py.in index c48564aef1f..2a0f6d7deec 100644 --- a/build/pgo/automation.py.in +++ b/build/pgo/automation.py.in @@ -241,6 +241,7 @@ user_pref("browser.warnOnQuit", false); user_pref("accessibility.typeaheadfind.autostart", false); user_pref("javascript.options.showInConsole", true); user_pref("layout.debug.enable_data_xbl", true); +user_pref("browser.EULA.override", true); """ prefs.append(part) diff --git a/testing/mochitest/runtests.pl.in b/testing/mochitest/runtests.pl.in index 0d956bc36f3..85d18f9acaf 100644 --- a/testing/mochitest/runtests.pl.in +++ b/testing/mochitest/runtests.pl.in @@ -439,6 +439,7 @@ user_pref("browser.warnOnQuit", false); user_pref("accessibility.typeaheadfind.autostart", false); user_pref("javascript.options.showInConsole", true); user_pref("layout.debug.enable_data_xbl", true); +user_pref("browser.EULA.override", true); PREFEND # Grant God-power to all the servers on which tests can run. diff --git a/testing/tools/profiles/createTestingProfile.py b/testing/tools/profiles/createTestingProfile.py index 6cdc32ff697..2a008e1d2a1 100644 --- a/testing/tools/profiles/createTestingProfile.py +++ b/testing/tools/profiles/createTestingProfile.py @@ -1,105 +1,107 @@ -import getopt -import os -import re -import shutil -from subprocess import Popen,PIPE -import sys - -# If you are adding prefs that require string values (rather than true/false), -# be sure to wrap the string value in quotes, e.g.: -# 'browser.active_color': '"#EE0000"', -userPrefs = { - 'browser.chrome.favicons': 'false', - 'browser.chrome.site_icons': 'false', - 'browser.dom.window.dump.enabled': 'true', - 'browser.sessionstore.enabled': 'false', - 'browser.sessionstore.resume_from_crash': 'false', - 'browser.shell.checkDefaultBrowser': 'false', - 'browser.tabs.warnOnClose': 'false', - 'browser.warnOnQuit': 'false', - 'dom.allow_scripts_to_close_windows': 'true', - 'dom.disable_open_during_load': 'false', - 'dom.disable_window_flip': 'false', - 'dom.disable_window_move_resize': 'false', - 'layout.fire_onload_after_image_background_loads': 'true', - 'javascript.options.showInConsole': 'true', - 'privacy.popups.firstTime': 'false', +import getopt +import os +import re +import shutil +from subprocess import Popen,PIPE +import sys + +# If you are adding prefs that require string values (rather than true/false), +# be sure to wrap the string value in quotes, e.g.: +# 'browser.active_color': '"#EE0000"', +userPrefs = { + 'browser.chrome.favicons': 'false', + 'browser.chrome.site_icons': 'false', + 'browser.dom.window.dump.enabled': 'true', + 'browser.sessionstore.enabled': 'false', + 'browser.sessionstore.resume_from_crash': 'false', + 'browser.shell.checkDefaultBrowser': 'false', + 'browser.tabs.warnOnClose': 'false', + 'browser.warnOnQuit': 'false', + 'dom.allow_scripts_to_close_windows': 'true', + 'dom.disable_open_during_load': 'false', + 'dom.disable_window_flip': 'false', + 'dom.disable_window_move_resize': 'false', + 'layout.fire_onload_after_image_background_loads': 'true', + 'javascript.options.showInConsole': 'true', + 'privacy.popups.firstTime': 'false', 'layout.debug.enable_data_xbl': 'true' -} + 'browser.EULA.override': 'true' +} + +def usage(): + print "python " + sys.argv[0] + " --binary=binary_location [--profileName=default] [--clobber] [--help]" + +def runCreateProfile(binary,profileName): + cmd = binary + " -CreateProfile " + profileName + p = Popen(cmd, + shell=True, + stdin=PIPE, + stdout=PIPE, + stderr=PIPE) + for line in p.stderr: + m = re.search('Success: created profile .* at \'([^\']+)\'', + line) + if m: + return m.group(1) + return "" + +def populatePrefs(profileLocation): + try: + f = open(profileLocation, 'w') + except IOError: + print "Couldn't write to " + profileLocation + sys.exit(2) + f.write("/* Generated by buildbot */\n\n") + for key in userPrefs.keys(): + f.write('user_pref("' + key + '", ' + userPrefs[key] + ");\n") + f.close() + print "Wrote testing preferences to %s" % profileLocation + +def main(argv): + try: + opts, args = getopt.getopt(argv, + "hb:p:cd", + ["help", + "binary=", + "profileName=", + "clobber"]) + except getopt.GetoptError: + usage() + sys.exit(2) + + binary = "" + profileName = "default" + clobber=0 + for o,a in opts: + if o in ("-h", "--help"): + usage() + sys.exit() + if o in ("-b","--binary"): + binary=a + if o in ("-p","--profileName"): + profileName=a + if o in ("-c","--clobber"): + clobber=1 + if binary=="" or not os.path.exists(binary): + usage() + sys.exit(2) + + profileLocation = runCreateProfile(binary,profileName) + if not profileLocation or not os.path.exists(profileLocation): + print "Couldn't find profile location" + sys.exit(2) + # Delete the existing profile directory if clobber is requested. + # -CreateProfile will re-create it in the right place. + if clobber: + dirname = os.path.dirname(profileLocation) + shutil.rmtree(dirname) + profileLocation = runCreateProfile(binary,profileName) + if not profileLocation or not os.path.exists(profileLocation): + print "Couldn't find profile location on second pass" + sys.exit(2) + + populatePrefs(profileLocation) + +if __name__ == "__main__": + main(sys.argv[1:]) -def usage(): - print "python " + sys.argv[0] + " --binary=binary_location [--profileName=default] [--clobber] [--help]" - -def runCreateProfile(binary,profileName): - cmd = binary + " -CreateProfile " + profileName - p = Popen(cmd, - shell=True, - stdin=PIPE, - stdout=PIPE, - stderr=PIPE) - for line in p.stderr: - m = re.search('Success: created profile .* at \'([^\']+)\'', - line) - if m: - return m.group(1) - return "" - -def populatePrefs(profileLocation): - try: - f = open(profileLocation, 'w') - except IOError: - print "Couldn't write to " + profileLocation - sys.exit(2) - f.write("/* Generated by buildbot */\n\n") - for key in userPrefs.keys(): - f.write('user_pref("' + key + '", ' + userPrefs[key] + ");\n") - f.close() - print "Wrote testing preferences to %s" % profileLocation - -def main(argv): - try: - opts, args = getopt.getopt(argv, - "hb:p:cd", - ["help", - "binary=", - "profileName=", - "clobber"]) - except getopt.GetoptError: - usage() - sys.exit(2) - - binary = "" - profileName = "default" - clobber=0 - for o,a in opts: - if o in ("-h", "--help"): - usage() - sys.exit() - if o in ("-b","--binary"): - binary=a - if o in ("-p","--profileName"): - profileName=a - if o in ("-c","--clobber"): - clobber=1 - if binary=="" or not os.path.exists(binary): - usage() - sys.exit(2) - - profileLocation = runCreateProfile(binary,profileName) - if not profileLocation or not os.path.exists(profileLocation): - print "Couldn't find profile location" - sys.exit(2) - # Delete the existing profile directory if clobber is requested. - # -CreateProfile will re-create it in the right place. - if clobber: - dirname = os.path.dirname(profileLocation) - shutil.rmtree(dirname) - profileLocation = runCreateProfile(binary,profileName) - if not profileLocation or not os.path.exists(profileLocation): - print "Couldn't find profile location on second pass" - sys.exit(2) - - populatePrefs(profileLocation) - -if __name__ == "__main__": - main(sys.argv[1:]) From b1137df04d417dc977e6dd8332903e45e0a85872 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 13:46:30 -0700 Subject: [PATCH 14/98] =?UTF-8?q?Bug=20426744:=20style=20print=20preview?= =?UTF-8?q?=20window=20on=20Windows,=20patch=20by=20D=C3=A3o=20Gottwald=20?= =?UTF-8?q?,=20r=3Dme,=20a=3Ddamon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- browser/themes/winstripe/browser/browser-aero.css | 4 ++++ browser/themes/winstripe/browser/browser.css | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/browser/themes/winstripe/browser/browser-aero.css b/browser/themes/winstripe/browser/browser-aero.css index e4f1b5d119d..2e614066bc9 100644 --- a/browser/themes/winstripe/browser/browser-aero.css +++ b/browser/themes/winstripe/browser/browser-aero.css @@ -6,6 +6,10 @@ border-style: none; } +#print-preview-toolbar { + -moz-appearance: browsertabbar-toolbox; +} + /* ::::: Location Bar AutoComplete Styling ::::: */ .ac-url-text:-moz-system-metric(windows-default-theme) { diff --git a/browser/themes/winstripe/browser/browser.css b/browser/themes/winstripe/browser/browser.css index 66ca1a26169..f53a36d413f 100644 --- a/browser/themes/winstripe/browser/browser.css +++ b/browser/themes/winstripe/browser/browser.css @@ -71,6 +71,10 @@ border-top: none; } +#print-preview-toolbar { + -moz-appearance: toolbox; +} + /* ::::: bookmark buttons ::::: */ toolbarbutton.bookmark-item { From db884f0c0804345cec3c81e76fb7e2b2ea345549 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 13:48:11 -0700 Subject: [PATCH 15/98] =?UTF-8?q?Bug=20428250:=20clicking=20in=20blank=20s?= =?UTF-8?q?pace=20in=20file=20column=20of=20directory=20listing=20activate?= =?UTF-8?q?s=20links,=20patch=20by=20D=C3=A3o=20Gottwald=20,=20r=3Dmano,=20r=3Dbiesi,=20a=3Dbeltzner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- netwerk/streamconv/converters/nsIndexedToHTML.cpp | 8 ++++---- toolkit/themes/pinstripe/global/dirListing/dirListing.css | 2 +- toolkit/themes/winstripe/global/dirListing/dirListing.css | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/netwerk/streamconv/converters/nsIndexedToHTML.cpp b/netwerk/streamconv/converters/nsIndexedToHTML.cpp index 187a680f0a2..db735847b1f 100644 --- a/netwerk/streamconv/converters/nsIndexedToHTML.cpp +++ b/netwerk/streamconv/converters/nsIndexedToHTML.cpp @@ -317,9 +317,9 @@ nsIndexedToHTML::OnStartRequest(nsIRequest* request, nsISupports *aContext) { "table[order=\"desc\"] > thead > tr > th::after {\n" " content: \"\\2191\"; /* UPWARDS ARROW (U+2191) */\n" "}\n" - "table[order][order-by=\"0\"] > thead > tr > th:first-child ,\n" - "table[order][order-by=\"1\"] > thead > tr > th:first-child + th ,\n" - "table[order][order-by=\"2\"] > thead > tr > th:first-child + th + th {\n" + "table[order][order-by=\"0\"] > thead > tr > th:first-child > a ,\n" + "table[order][order-by=\"1\"] > thead > tr > th:first-child + th > a ,\n" + "table[order][order-by=\"2\"] > thead > tr > th:first-child + th + th > a {\n" " text-decoration: underline;\n" "}\n" "table[order][order-by=\"0\"] > thead > tr > th:first-child::after ,\n" @@ -331,7 +331,7 @@ nsIndexedToHTML::OnStartRequest(nsIRequest* request, nsISupports *aContext) { " display: none;\n" "}\n" "td > a {\n" - " display: block;\n" + " display: inline-block;\n" "}\n" "/* name */\n" "th:first-child {\n" diff --git a/toolkit/themes/pinstripe/global/dirListing/dirListing.css b/toolkit/themes/pinstripe/global/dirListing/dirListing.css index 76bb91e525e..bc8b41c34fb 100755 --- a/toolkit/themes/pinstripe/global/dirListing/dirListing.css +++ b/toolkit/themes/pinstripe/global/dirListing/dirListing.css @@ -97,7 +97,7 @@ th:last-child { text-align: center; } -table[order] > thead > tr > th:hover { +th:hover > a { text-decoration: underline; } diff --git a/toolkit/themes/winstripe/global/dirListing/dirListing.css b/toolkit/themes/winstripe/global/dirListing/dirListing.css index aef2443abc7..b8df9022bba 100755 --- a/toolkit/themes/winstripe/global/dirListing/dirListing.css +++ b/toolkit/themes/winstripe/global/dirListing/dirListing.css @@ -97,7 +97,7 @@ th:last-child { text-align: center; } -table[order] > thead > tr > th:hover { +th:hover > a { text-decoration: underline; } From f72b7a26fbf131cfe9c9bfa149077f55e39fbe07 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 13:49:38 -0700 Subject: [PATCH 16/98] =?UTF-8?q?Bug=20431305:=20Panes=20different=20heigh?= =?UTF-8?q?t=20in=20the=20Add-ons=20Manager,=20patch=20by=20D=C3=A3o=20Got?= =?UTF-8?q?twald=20,=20r=3Dmossop,=20a=3Ddamon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- toolkit/themes/gnomestripe/mozapps/extensions/extensions.css | 4 ++-- toolkit/themes/winstripe/mozapps/extensions/extensions.css | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/toolkit/themes/gnomestripe/mozapps/extensions/extensions.css b/toolkit/themes/gnomestripe/mozapps/extensions/extensions.css index 26fcadf78f1..d57d85ace24 100644 --- a/toolkit/themes/gnomestripe/mozapps/extensions/extensions.css +++ b/toolkit/themes/gnomestripe/mozapps/extensions/extensions.css @@ -1,6 +1,6 @@ #extensionsBox { margin: 10px 8px 0 8px; - min-width:1px; + min-width: 1px; } /* Addons notification */ @@ -19,7 +19,7 @@ notification { -moz-border-right-colors: ThreeDHighlight ThreeDLightShadow; -moz-border-bottom-colors: ThreeDHighlight ThreeDLightShadow; -moz-border-left-colors: ThreeDShadow ThreeDDarkShadow; - margin: 0 !important; + margin: 0; } #resizerBox { diff --git a/toolkit/themes/winstripe/mozapps/extensions/extensions.css b/toolkit/themes/winstripe/mozapps/extensions/extensions.css index a5419cfe5a9..7e3565737fa 100644 --- a/toolkit/themes/winstripe/mozapps/extensions/extensions.css +++ b/toolkit/themes/winstripe/mozapps/extensions/extensions.css @@ -1,6 +1,6 @@ #extensionsBox { margin: 10px 10px 0px 10px; - min-width:1px; + min-width: 1px; } #extensionsView { @@ -9,6 +9,7 @@ -moz-border-right-colors: ThreeDHighlight ThreeDLightShadow; -moz-border-bottom-colors: ThreeDHighlight ThreeDLightShadow; -moz-border-left-colors: ThreeDShadow ThreeDDarkShadow; + margin: 0; } #resizerBox { From 2165466c0676ed1e9d147e25a40c155a6e67f7f1 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 13:50:59 -0700 Subject: [PATCH 17/98] =?UTF-8?q?Bug=20430925:=20Scrollbox=20smooth=20scro?= =?UTF-8?q?lling=20should=20skip=20frames=20when=20missing=20the=20desired?= =?UTF-8?q?=20frame=20rate,=20patch=20by=20D=C3=A3o=20Gottwald=20,=20r=3Denndeakin,=20a=3Dbeltzner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- toolkit/content/widgets/scrollbox.xml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/toolkit/content/widgets/scrollbox.xml b/toolkit/content/widgets/scrollbox.xml index 4ab8883637e..156a268d097 100644 --- a/toolkit/content/widgets/scrollbox.xml +++ b/toolkit/content/widgets/scrollbox.xml @@ -171,8 +171,18 @@ round = Math.ceil; } - function processFrame(self, scrollAmounts) { - self.scrollBoxObject.scrollBy(scrollAmounts.shift(), 0); + const FRAME_LENGTH = 60; + + function processFrame(self, scrollAmounts, off) { + var distance = scrollAmounts.shift(); + + // Skip frames if we aren't getting the desired frame rate. + if (off > 0) { + for (var i = Math.round(off / FRAME_LENGTH); i > 0; i--) + distance += scrollAmounts.shift() || 0; + } + + self.scrollBoxObject.scrollBy(distance, 0); if (!scrollAmounts.length) self._stopSmoothScroll(); } @@ -182,7 +192,7 @@ var scrollAmount, scrollAmounts = []; if (amountToScroll > 2 || amountToScroll < -2) { scrollAmount = round(amountToScroll * 0.2); - scrollAmounts.push (scrollAmount, scrollAmount, scrollAmount); + scrollAmounts.push(scrollAmount, scrollAmount, scrollAmount); amountToScroll -= 3 * scrollAmount; } while (this._isScrolling < 0 && amountToScroll < 0 || @@ -190,8 +200,8 @@ amountToScroll -= (scrollAmount = round(amountToScroll * 0.5)); scrollAmounts.push(scrollAmount); } - this._smoothScrollTimer = setInterval(processFrame, 60, this, scrollAmounts); - processFrame(this, scrollAmounts); + this._smoothScrollTimer = setInterval(processFrame, FRAME_LENGTH, this, scrollAmounts); + processFrame(this, scrollAmounts, 0); ]]> From 2d100cefd7a67a91fc48b9739a01933ea6b8939d Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 13:52:33 -0700 Subject: [PATCH 18/98] Bug 429717: use a large warning icon for about:config, patch by Ehsan Akhgari , r=me, a=beltzner --- toolkit/components/viewconfig/content/config.xul | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/components/viewconfig/content/config.xul b/toolkit/components/viewconfig/content/config.xul index 31d8deea763..1ac64bb285e 100644 --- a/toolkit/components/viewconfig/content/config.xul +++ b/toolkit/components/viewconfig/content/config.xul @@ -79,7 +79,7 @@ - + From be31be42b07e34ffac5fd0304c2e4942ee578ea8 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 13:53:34 -0700 Subject: [PATCH 19/98] Bug 431195: Tree children in Sidebar and Library are indented too far, patch by Ehsan Akhgari , r=me, a=beltzner --- toolkit/themes/winstripe/global/tree-aero.css | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/toolkit/themes/winstripe/global/tree-aero.css b/toolkit/themes/winstripe/global/tree-aero.css index e4ac179f671..2c5d3be1f9e 100644 --- a/toolkit/themes/winstripe/global/tree-aero.css +++ b/toolkit/themes/winstripe/global/tree-aero.css @@ -2,6 +2,15 @@ /* ::::: twisty ::::: */ +treechildren::-moz-tree-indentation { + width: 12px; +} + +treechildren::-moz-tree-twisty { + padding-right: 1px; + width: 9px; +} + /* Please note that the following RTL icons are only available in Aero themes: * chrome://global/skin/tree/twisty-clsd-hover.png @@ -21,7 +30,7 @@ treechildren::-moz-tree-twisty(hover, open) { tree[chromedir="rtl"] > treechildren::-moz-tree-twisty { padding-right: 0px; - padding-left: 4px; + padding-left: 1px; list-style-image: url("chrome://global/skin/tree/twisty-clsd-rtl.png"); } From c097befe30addee9ff79c1b61c947293050e05db Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 14:00:59 -0700 Subject: [PATCH 20/98] Bug 431774: make this test actually test what it was supposed to, instead of always passing, r=biesi --- netwerk/test/unit/test_bug261425.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/netwerk/test/unit/test_bug261425.js b/netwerk/test/unit/test_bug261425.js index 594902bb57f..11e10d89bc0 100644 --- a/netwerk/test/unit/test_bug261425.js +++ b/netwerk/test/unit/test_bug261425.js @@ -1,5 +1,6 @@ const Cc = Components.classes; const Ci = Components.interfaces; +const Cr = Components.results; function run_test() { var ios = Cc["@mozilla.org/network/io-service;1"]. @@ -9,21 +10,23 @@ function run_test() { var success = false; try { - newURI.setSpec("http: //foo.com"); + newURI.spec = "http: //foo.com"; } catch (e) { - success = true; + success = e.result == Cr.NS_ERROR_MALFORMED_URI; + } + if (!success) { + // This is failing: bug 431890 + //do_throw("We didn't throw NS_ERROR_MALFORMED_URI when a space was passed in the hostname!"); } - if (!success) - do_throw("We didn't throw when a space was passed in the hostname!"); success = false; try { - newURI.setHost(" foo.com"); + newURI.host = " foo.com"; } catch (e) { - success = true; + success = e.result == Cr.NS_ERROR_MALFORMED_URI; } if (!success) - do_throw("We didn't throw when a space was passed in the hostname!"); + do_throw("We didn't throw NS_ERROR_MALFORMED_URI when a space was passed in the hostname!"); } From 2351a06a888255338090d7f0e4f2f27ac7be7451 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 14:02:26 -0700 Subject: [PATCH 21/98] Bug 419395: fix tooltip padding on linux, patch by Ian Spence , r=me, a=beltzner --- browser/base/content/browser.xul | 4 ++-- toolkit/themes/gnomestripe/global/popup.css | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index d6042ef9229..2b29582fc47 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -233,8 +233,8 @@ - diff --git a/toolkit/themes/gnomestripe/global/popup.css b/toolkit/themes/gnomestripe/global/popup.css index 46d78eeb546..00033d533ba 100644 --- a/toolkit/themes/gnomestripe/global/popup.css +++ b/toolkit/themes/gnomestripe/global/popup.css @@ -56,7 +56,8 @@ panel { tooltip { -moz-appearance: tooltip; margin-top: 21px; - padding: 2px 3px; + /* GTK hardcodes this to 4px */ + padding: 4px; max-width: 40em; color: InfoText; font: message-box; From 37e9fae22d7de582917c8113dc156ac8ba4a6877 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 14:03:52 -0700 Subject: [PATCH 22/98] Bug 416801: View button in History sidebar is stretched vertically, patch by Kai Liu , r=me, ui-r=faaborg, a=beltzner --- browser/themes/winstripe/browser/places/places.css | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/browser/themes/winstripe/browser/places/places.css b/browser/themes/winstripe/browser/places/places.css index 8817c992b46..d2aabefe26a 100755 --- a/browser/themes/winstripe/browser/places/places.css +++ b/browser/themes/winstripe/browser/places/places.css @@ -124,3 +124,17 @@ treechildren::-moz-tree-row(session-start) { treechildren::-moz-tree-cell-text(date, session-continue) { color: -moz-Field; } + +/* Browser Sidebars */ + +/* Default button vert. margins are 1px/2px, and this can cause misalignment */ +#viewButton { + margin-top: 2px; + margin-bottom: 2px; +} + +#viewButton > hbox > dropmarker { + height: auto; + width: auto; + -moz-margin-end: -3px; +} From 34c66bb2ccf2025a3f8b59a995ff599fb7111b76 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 14:05:03 -0700 Subject: [PATCH 23/98] Bug 431639: Library splitter should be styled the same as sidebar splitter, patch by Marco Bonardo , r=dao, a=beltzner --- .../themes/gnomestripe/browser/places/organizer.css | 4 ---- .../themes/pinstripe/browser/places/organizer.css | 6 ------ .../themes/winstripe/browser/places/organizer.css | 13 ------------- 3 files changed, 23 deletions(-) diff --git a/browser/themes/gnomestripe/browser/places/organizer.css b/browser/themes/gnomestripe/browser/places/organizer.css index badfdca1902..32c784813b0 100644 --- a/browser/themes/gnomestripe/browser/places/organizer.css +++ b/browser/themes/gnomestripe/browser/places/organizer.css @@ -64,10 +64,6 @@ background-color: Window; } -#splitter { - min-width: 3px; -} - /* Place List, Place Content */ .placesTree { margin: 0px; diff --git a/browser/themes/pinstripe/browser/places/organizer.css b/browser/themes/pinstripe/browser/places/organizer.css index aad4a931d76..1fd205148e8 100644 --- a/browser/themes/pinstripe/browser/places/organizer.css +++ b/browser/themes/pinstripe/browser/places/organizer.css @@ -247,12 +247,6 @@ -moz-user-focus: ignore; } -#splitter { - border: 0px; - width: 3px; - background-color: transparent; -} - /* Place List, Place Content */ .placesTree { margin: 0px; diff --git a/browser/themes/winstripe/browser/places/organizer.css b/browser/themes/winstripe/browser/places/organizer.css index 3f032e64442..9b4c829aaa9 100644 --- a/browser/themes/winstripe/browser/places/organizer.css +++ b/browser/themes/winstripe/browser/places/organizer.css @@ -115,19 +115,6 @@ border-top: 1px solid ThreeDDarkShadow; } -#splitter { - border: none; - width: 3px; - background-color: transparent; -} - -#placesView > splitter { - width: 6px !important; - min-width: 6px; - border-left: 1px solid ThreeDShadow; - border-right: 1px solid ThreeDDarkShadow; -} - /* Place List, Place Content */ .placesTree { margin: 0px; From be043d5d475e1696c480e91d11b5fc50e3d3061c Mon Sep 17 00:00:00 2001 From: "alfred.peng@sun.com" Date: Mon, 5 May 2008 14:08:14 -0700 Subject: [PATCH 24/98] Followup fix for Bug 385280. should send proxy settings to the breakpad reporter. Add the check on whether gconf library exists. r=ted.mielczarek,a=beltzner. --- config/autoconf.mk.in | 1 + configure.in | 5 +++++ toolkit/crashreporter/client/Makefile.in | 16 ++++++++++++---- .../crashreporter/client/crashreporter_linux.cpp | 13 +++++++++++-- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index c52ca77b6f1..b250e0851af 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -249,6 +249,7 @@ MOZ_STARTUP_NOTIFICATION_LIBS = @MOZ_STARTUP_NOTIFICATION_LIBS@ MOZ_GNOMEVFS_CFLAGS = @MOZ_GNOMEVFS_CFLAGS@ MOZ_GNOMEVFS_LIBS = @MOZ_GNOMEVFS_LIBS@ +MOZ_ENABLE_GCONF = @MOZ_ENABLE_GCONF@ MOZ_GCONF_CFLAGS = @MOZ_GCONF_CFLAGS@ MOZ_GCONF_LIBS = @MOZ_GCONF_LIBS@ diff --git a/configure.in b/configure.in index 66e8002b273..f49bf6cff03 100644 --- a/configure.in +++ b/configure.in @@ -4988,6 +4988,11 @@ then ]) fi + if test "$MOZ_ENABLE_GCONF"; then + AC_DEFINE(MOZ_ENABLE_GCONF) + fi + + AC_SUBST(MOZ_ENABLE_GCONF) AC_SUBST(MOZ_GCONF_CFLAGS) AC_SUBST(MOZ_GCONF_LIBS) diff --git a/toolkit/crashreporter/client/Makefile.in b/toolkit/crashreporter/client/Makefile.in index 71c323d1222..10b9e1fc019 100644 --- a/toolkit/crashreporter/client/Makefile.in +++ b/toolkit/crashreporter/client/Makefile.in @@ -83,8 +83,12 @@ LIBS += \ $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/linux/$(LIB_PREFIX)breakpad_linux_common_s.$(LIB_SUFFIX) \ $(NULL) LOCAL_INCLUDES += -I$(srcdir) -OS_CXXFLAGS += $(MOZ_GTK2_CFLAGS) $(MOZ_GCONF_CFLAGS) $(MOZ_GTHREAD_CFLAGS) -OS_LIBS += $(MOZ_GTK2_LIBS) $(MOZ_GCONF_LIBS) $(MOZ_GTHREAD_LIBS) +OS_CXXFLAGS += $(MOZ_GTK2_CFLAGS) $(MOZ_GTHREAD_CFLAGS) +OS_LIBS += $(MOZ_GTK2_LIBS) $(MOZ_GTHREAD_LIBS) +ifdef MOZ_ENABLE_GCONF +OS_CXXFLAGS += $(MOZ_GCONF_CFLAGS) +OS_LIBS += $(MOZ_GCONF_LIBS) +endif CPPSRCS += http_upload.cc FORCE_USE_PIC=1 endif @@ -95,8 +99,12 @@ LIBS += \ $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/solaris/$(LIB_PREFIX)breakpad_solaris_common_s.$(LIB_SUFFIX) \ $(NULL) LOCAL_INCLUDES += -I$(srcdir) -OS_CXXFLAGS += $(MOZ_GTK2_CFLAGS) $(MOZ_GCONF_CFLAGS) $(MOZ_GTHREAD_CFLAGS) -OS_LIBS += $(MOZ_GTK2_LIBS) $(MOZ_GCONF_LIBS) $(MOZ_GTHREAD_LIBS) +OS_CXXFLAGS += $(MOZ_GTK2_CFLAGS) $(MOZ_GTHREAD_CFLAGS) +OS_LIBS += $(MOZ_GTK2_LIBS) $(MOZ_GTHREAD_LIBS) +ifdef MOZ_ENABLE_GCONF +OS_CXXFLAGS += $(MOZ_GCONF_CFLAGS) +OS_LIBS += $(MOZ_GCONF_LIBS) +endif CPPSRCS += http_upload.cc FORCE_USE_PIC=1 endif diff --git a/toolkit/crashreporter/client/crashreporter_linux.cpp b/toolkit/crashreporter/client/crashreporter_linux.cpp index 36fea49b52f..681832a3f7d 100644 --- a/toolkit/crashreporter/client/crashreporter_linux.cpp +++ b/toolkit/crashreporter/client/crashreporter_linux.cpp @@ -50,7 +50,10 @@ #include +#ifdef MOZ_ENABLE_GCONF #include +#endif + #include #include #include @@ -96,8 +99,6 @@ static void* gnomeuiLib = NULL; static const char kIniFile[] = "crashreporter.ini"; -#define HTTP_PROXY_DIR "/system/http_proxy" - static void LoadSettings() { StringTable settings; @@ -193,6 +194,9 @@ static gboolean ReportCompleted(gpointer success) return FALSE; } +#ifdef MOZ_ENABLE_GCONF +#define HTTP_PROXY_DIR "/system/http_proxy" + static void LoadProxyinfo() { GConfClient *conf = gconf_client_get_default(); @@ -237,11 +241,16 @@ static void LoadProxyinfo() g_object_unref(conf); } +#endif static gpointer SendThread(gpointer args) { string response, error; + +#ifdef MOZ_ENABLE_GCONF LoadProxyinfo(); +#endif + bool success = google_breakpad::HTTPUpload::SendRequest (gSendURL, gQueryParameters, From 2200cf62d26340285ebab75a47c93f325a508444 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 14:18:20 -0700 Subject: [PATCH 25/98] oops, missed a comma (bug 431713) --- testing/tools/profiles/createTestingProfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/tools/profiles/createTestingProfile.py b/testing/tools/profiles/createTestingProfile.py index 2a008e1d2a1..2548f2ace5d 100644 --- a/testing/tools/profiles/createTestingProfile.py +++ b/testing/tools/profiles/createTestingProfile.py @@ -24,7 +24,7 @@ userPrefs = { 'layout.fire_onload_after_image_background_loads': 'true', 'javascript.options.showInConsole': 'true', 'privacy.popups.firstTime': 'false', - 'layout.debug.enable_data_xbl': 'true' + 'layout.debug.enable_data_xbl': 'true', 'browser.EULA.override': 'true' } From ae48f702c08c60ab0eacef99cf2de7d90be30a40 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Mon, 5 May 2008 14:33:15 -0700 Subject: [PATCH 26/98] Bug 431713: revert again because Talos prefs need changing --- browser/app/profile/firefox.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index c0024532609..bf1aba38369 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -653,7 +653,9 @@ pref("browser.EULA.3.accepted", true); #elifdef XP_WIN pref("browser.EULA.3.accepted", true); #else -pref("browser.EULA.3.accepted", false); +# Need to fix the unittest and talos machine profiles before flipping this by default +#pref("browser.EULA.3.accepted", false); +pref("browser.EULA.3.accepted", true); #endif // if we rev the EULA again, we should bump this so users agree to the new EULA From 56baacb4df65a11c816270ef7f20febacacc3833 Mon Sep 17 00:00:00 2001 From: "dbaron@dbaron.org" Date: Mon, 5 May 2008 14:51:11 -0700 Subject: [PATCH 27/98] Deal with padding inside .gnu_debuglink section being non-null. Not part of build. --- tools/rb/fix-linux-stack.pl | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tools/rb/fix-linux-stack.pl b/tools/rb/fix-linux-stack.pl index 65ec852d80e..b3c5213ee44 100755 --- a/tools/rb/fix-linux-stack.pl +++ b/tools/rb/fix-linux-stack.pl @@ -36,7 +36,7 @@ # # ***** END LICENSE BLOCK ***** -# $Id: fix-linux-stack.pl,v 1.15 2007/06/20 22:01:17 dbaron%dbaron.org Exp $ +# $Id: fix-linux-stack.pl,v 1.16 2008/05/05 21:51:11 dbaron%dbaron.org Exp $ # # This script uses addr2line (part of binutils) to process the output of # nsTraceRefcnt's Linux stack walking code. This is useful for two @@ -183,14 +183,24 @@ sub separate_debug_file_for($) { $hash = ($hash_bytes[0] << 24) | ($hash_bytes[1] << 16) | ($hash_bytes[2] << 8) | $hash_bytes[3]; } - my $old_num = $#chars; - while ($chars[$#chars] eq '00') { - pop @chars; + # The string ends with a null-terminator and then 0 to three bytes + # of padding to fill the current 32-bit unit. (This padding is + # usually null bytes, but I've seen null-null-H, on Ubuntu x86_64.) + my $terminator = 1; + while ($chars[$terminator] ne '00') { + if ($terminator == $#chars) { + print STDERR "Warning: missing null terminator in " . + ".gnu_debuglink section of $file.\n"; + return ''; + } + ++$terminator; } - if ($old_num == $#chars || $old_num - 4 > $#chars) { - print STDERR "Warning: malformed .gnu_debuglink section in $file.\n"; + if ($#chars - $terminator > 3) { + print STDERR "Warning: Excess padding in .gnu_debuglink section " . + "of $file.\n"; return ''; } + $#chars = $terminator - 1; my $basename = join('', map { chr(hex($_)) } @chars); From 8f647509140d7ce0693a05f2230c44ed86874726 Mon Sep 17 00:00:00 2001 From: "nrthomas@gmail.com" Date: Mon, 5 May 2008 15:27:07 -0700 Subject: [PATCH 28/98] Bug 428063, test 3.0 RC2 build1 in staging --- tools/release/configs/fx-moz19-staging-bootstrap.cfg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/release/configs/fx-moz19-staging-bootstrap.cfg b/tools/release/configs/fx-moz19-staging-bootstrap.cfg index 9133ea427ef..83facc8c18d 100644 --- a/tools/release/configs/fx-moz19-staging-bootstrap.cfg +++ b/tools/release/configs/fx-moz19-staging-bootstrap.cfg @@ -1,16 +1,16 @@ -version = 3.0rc1 +version = 3.0rc2 appVersion = 3.0 milestone = 1.9 # _BUILDn and _RELEASE will be appended as-needed -productTag = FIREFOX_3_0RC1 +productTag = FIREFOX_3_0RC2 # Branch name and pull dates to use for base tag branchTag = HEAD #RelbranchOverride = GECKO190_20071207_RELBRANCH -pullDate = 2008-04-23 13:00 PDT -l10n_pullDate = 2008-04-23 13:00 PDT -build = 2 +pullDate = 2008-04-23 13:05 PDT +l10n_pullDate = 2008-04-23 13:05 PDT +build = 1 # oldVersion and oldRc refer to the previous release -oldVersion = 3.0b5 +oldVersion = 3.0rc1 oldBuild = 2 appName = browser product = firefox From 3649ce18bb01b4af1312e9b95b0cf9c9be7c308a Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Mon, 5 May 2008 16:01:07 -0700 Subject: [PATCH 29/98] Bug 431503. Infrastructure and tests for native key event translation. r=josh,karlt,sr=jst --- dom/public/idl/base/nsIDOMWindowUtils.idl | 15 +- dom/src/base/nsDOMWindowUtils.cpp | 22 ++ widget/public/nsIWidget.h | 47 ++- widget/src/cocoa/nsChildView.h | 6 + widget/src/cocoa/nsChildView.mm | 133 ++++++++- widget/src/gtk2/nsWindow.cpp | 19 +- widget/src/gtk2/nsWindow.h | 12 +- widget/src/windows/nsKeyboardLayout.cpp | 16 +- widget/src/windows/nsKeyboardLayout.h | 2 +- widget/src/windows/nsWindow.cpp | 227 ++++++++++---- widget/src/windows/nsWindow.h | 18 +- widget/src/xpwidgets/nsBaseWidget.h | 6 + widget/tests/Makefile.in | 1 + widget/tests/test_keycodes.xul | 347 ++++++++++++++++++++++ 14 files changed, 781 insertions(+), 90 deletions(-) create mode 100644 widget/tests/test_keycodes.xul diff --git a/dom/public/idl/base/nsIDOMWindowUtils.idl b/dom/public/idl/base/nsIDOMWindowUtils.idl index 55307d7895b..65832ede9f3 100644 --- a/dom/public/idl/base/nsIDOMWindowUtils.idl +++ b/dom/public/idl/base/nsIDOMWindowUtils.idl @@ -47,7 +47,7 @@ interface nsIDOMElement; -[scriptable, uuid(7a55fc2b-afb3-41c6-9e50-3fee341fa87c)] +[scriptable, uuid(1cfc1a0a-e348-4b18-b61b-935c192f85c4)] interface nsIDOMWindowUtils : nsISupports { /** @@ -144,6 +144,19 @@ interface nsIDOMWindowUtils : nsISupports { in long aCharCode, in long aModifiers); + /** + * See nsIWidget::SynthesizeNativeKeyEvent + * + * Cannot be accessed from unprivileged context (not content-accessible) + * Will throw a DOM security error if called without UniversalXPConnect + * privileges. + */ + void sendNativeKeyEvent(in long aNativeKeyboardLayout, + in long aNativeKeyCode, + in long aModifierFlags, + in AString aCharacters, + in AString aUnmodifiedCharacters); + /** * Focus the element aElement. The element should be in the same document * that the window is displaying. Pass null to blur the element, if any, diff --git a/dom/src/base/nsDOMWindowUtils.cpp b/dom/src/base/nsDOMWindowUtils.cpp index 5ad3a01d8fa..82b351fb501 100644 --- a/dom/src/base/nsDOMWindowUtils.cpp +++ b/dom/src/base/nsDOMWindowUtils.cpp @@ -276,6 +276,28 @@ nsDOMWindowUtils::SendKeyEvent(const nsAString& aType, return widget->DispatchEvent(&event, status); } +NS_IMETHODIMP +nsDOMWindowUtils::SendNativeKeyEvent(PRInt32 aNativeKeyboardLayout, + PRInt32 aNativeKeyCode, + PRInt32 aModifiers, + const nsAString& aCharacters, + const nsAString& aUnmodifiedCharacters) +{ + PRBool hasCap = PR_FALSE; + if (NS_FAILED(nsContentUtils::GetSecurityManager()->IsCapabilityEnabled("UniversalXPConnect", &hasCap)) + || !hasCap) + return NS_ERROR_DOM_SECURITY_ERR; + + // get the widget to send the event to + nsCOMPtr widget = GetWidget(); + if (!widget) + return NS_ERROR_FAILURE; + + widget->SynthesizeNativeKeyEvent(aNativeKeyboardLayout, aNativeKeyCode, + aModifiers, aCharacters, aUnmodifiedCharacters); + return NS_OK; +} + nsIWidget* nsDOMWindowUtils::GetWidget() { diff --git a/widget/public/nsIWidget.h b/widget/public/nsIWidget.h index 6e9b4cffa75..0c0b795a3d0 100644 --- a/widget/public/nsIWidget.h +++ b/widget/public/nsIWidget.h @@ -95,10 +95,10 @@ typedef nsEventStatus (*PR_CALLBACK EVENT_CALLBACK)(nsGUIEvent *event); #define NS_NATIVE_PLUGIN_PORT_CG 101 #endif -// 9151e8c9-a1cc-44e9-a70d-afb3956d4e13 +// e197eeba-a82b-46d9-8aa9-52e1133fc593 #define NS_IWIDGET_IID \ -{ 0x9151e8c9, 0xa1cc, 0x44e9, \ - { 0xa7, 0x0d, 0xaf, 0xb3, 0x95, 0x6d, 0x4e, 0x13 } } +{ 0xe197eeba, 0xa82b, 0x46d9, \ + { 0x8a, 0xa9, 0x52, 0xe1, 0x13, 0x3f, 0xc5, 0x93 } } // Hide the native window systems real window type so as to avoid // including native window system types and APIs. This is necessary @@ -1062,6 +1062,47 @@ class nsIWidget : public nsISupports { */ NS_IMETHOD BeginResizeDrag(nsGUIEvent* aEvent, PRInt32 aHorizontal, PRInt32 aVertical) = 0; + enum Modifiers { + CAPS_LOCK = 0x01, // when CapsLock is active + NUM_LOCK = 0x02, // when NumLock is active + SHIFT_L = 0x0100, + SHIFT_R = 0x0200, + CTRL_L = 0x0400, + CTRL_R = 0x0800, + ALT_L = 0x1000, // includes Option + ALT_R = 0x2000, + COMMAND = 0x4000, + HELP = 0x8000, + FUNCTION = 0x10000, + NUMERIC_KEY_PAD = 0x01000000 // when the key is coming from the keypad + }; + /** + * Utility method intended for testing. Dispatches native key events + * to this widget to simulate the press and release of a key. + * @param aNativeKeyboardLayout a *platform-specific* constant. + * On Mac, this is the resource ID for a 'uchr' or 'kchr' resource. + * On Windows, it is converted to a hex string and passed to + * LoadKeyboardLayout, see + * http://msdn.microsoft.com/en-us/library/ms646305(VS.85).aspx + * @param aNativeKeyCode a *platform-specific* keycode. + * On Windows, this is the virtual key code. + * @param aModifiers some combination of the above 'Modifiers' flags; + * not all flags will apply to all platforms. Mac ignores the _R + * modifiers. Windows ignores COMMAND, NUMERIC_KEY_PAD, HELP and + * FUNCTION. + * @param aCharacters characters that the OS would decide to generate + * from the event. On Windows, this is the charCode passed by + * WM_CHAR. + * @param aUnmodifiedCharacters characters that the OS would decide + * to generate from the event if modifier keys (other than shift) + * were assumed inactive. Needed on Mac, ignored on Windows. + */ + virtual void SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, + PRInt32 aNativeKeyCode, + PRUint32 aModifierFlags, + const nsAString& aCharacters, + const nsAString& aUnmodifiedCharacters) = 0; + protected: // keep the list of children. We also keep track of our siblings. // The ownership model is as follows: parent holds a strong ref to diff --git a/widget/src/cocoa/nsChildView.h b/widget/src/cocoa/nsChildView.h index b80da3fd88e..389d4f8760d 100644 --- a/widget/src/cocoa/nsChildView.h +++ b/widget/src/cocoa/nsChildView.h @@ -385,6 +385,12 @@ protected: virtual NSView* CreateCocoaView(NSRect inFrame); void TearDownView(); + virtual void SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, + PRInt32 aNativeKeyCode, + PRUint32 aModifierFlags, + const nsAString& aCharacters, + const nsAString& aUnmodifiedCharacters); + protected: NSView* mView; // my parallel cocoa view (ChildView or NativeScrollbarView), [STRONG] diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index 738e940e2a3..f4f991d43d5 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -157,10 +157,14 @@ nsIWidget * gRollupWidget = nsnull; - (void)processPendingRedraws; +- (PRBool)processKeyDownEvent:(NSEvent*)theEvent keyEquiv:(BOOL)isKeyEquiv; + - (BOOL)ensureCorrectMouseEventTarget:(NSEvent *)anEvent; - (void)maybeInitContextMenuTracking; ++ (NSEvent*)makeNewCocoaEventWithType:(NSEventType)type fromEvent:(NSEvent*)theEvent; + #if USE_CLICK_HOLD_CONTEXTMENU // called on a timer two seconds after a mouse down to see if we should display // a context menu (click-hold) @@ -1248,6 +1252,68 @@ void nsChildView::LiveResizeEnded() mLiveResizeInProgress = PR_FALSE; } +static NSString* ToNSString(const nsAString& aString) +{ + return [NSString stringWithCharacters:aString.BeginReading() + length:aString.Length()]; +} + +static PRInt32 gOverrideKeyboardLayout; + +static const PRUint32 sModifierFlagMap[][2] = { + { nsIWidget::CAPS_LOCK, NSAlphaShiftKeyMask }, + { nsIWidget::SHIFT_L, NSShiftKeyMask }, + { nsIWidget::CTRL_L, NSControlKeyMask }, + { nsIWidget::ALT_L, NSAlternateKeyMask }, + { nsIWidget::COMMAND, NSCommandKeyMask }, + { nsIWidget::NUMERIC_KEY_PAD, NSNumericPadKeyMask }, + { nsIWidget::HELP, NSHelpKeyMask }, + { nsIWidget::FUNCTION, NSFunctionKeyMask } +}; +void nsChildView::SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, + PRInt32 aNativeKeyCode, + PRUint32 aModifierFlags, + const nsAString& aCharacters, + const nsAString& aUnmodifiedCharacters) +{ + NS_OBJC_BEGIN_TRY_ABORT_BLOCK; + + NS_ASSERTION(aNativeKeyboardLayout, "Layout cannot be 0"); + + PRUint32 modifierFlags = 0; + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(sModifierFlagMap); ++i) { + if (aModifierFlags & sModifierFlagMap[i][0]) { + modifierFlags |= sModifierFlagMap[i][1]; + } + } + int windowNumber = [[mView window] windowNumber]; + NSEvent* downEvent = [NSEvent keyEventWithType:NSKeyDown + location:NSMakePoint(0,0) + modifierFlags:modifierFlags + timestamp:0 + windowNumber:windowNumber + context:[NSGraphicsContext currentContext] + characters:ToNSString(aCharacters) + charactersIgnoringModifiers:ToNSString(aUnmodifiedCharacters) + isARepeat:NO + keyCode:aNativeKeyCode]; + + NSEvent* upEvent = [ChildView makeNewCocoaEventWithType:NSKeyUp + fromEvent:downEvent]; + + if (downEvent && upEvent) { + PRInt32 currentLayout = gOverrideKeyboardLayout; + gOverrideKeyboardLayout = aNativeKeyboardLayout; + ChildView* view = static_cast(mView); + [view keyDown:downEvent]; + [view keyUp:upEvent]; + // processKeyDownEvent and keyUp block exceptions so we're sure to + // reach here to restore gOverrideKeyboardLayout + gOverrideKeyboardLayout = currentLayout; + } + + NS_OBJC_END_TRY_ABORT_BLOCK; +} #pragma mark - @@ -3948,9 +4014,9 @@ static PRBool IsNormalCharInputtingEvent(const nsKeyEvent& aEvent) // unshiftCharCode for accessKeys and accelKeys. if (outGeckoEvent->isControl || outGeckoEvent->isMeta || outGeckoEvent->isAlt) { - SInt16 keyLayoutID = - ::GetScriptVariable(::GetScriptManagerVariable(smKeyScript), - smScriptKeys); + SInt16 keyLayoutID = gOverrideKeyboardLayout ? gOverrideKeyboardLayout + : ::GetScriptVariable(::GetScriptManagerVariable(smKeyScript), + smScriptKeys); Handle handle = ::GetResource('uchr', keyLayoutID); PRUint32 unshiftedChar = 0; PRUint32 shiftedChar = 0; @@ -3979,14 +4045,21 @@ static PRBool IsNormalCharInputtingEvent(const nsKeyEvent& aEvent) kbType, 0, &deadKeyState, 1, &len, chars); if (noErr == err && len > 0) shiftedCmdChar = chars[0]; - } else if ((handle = (char**)::GetScriptManagerVariable(smKCHRCache))) { - UInt32 state = 0; - UInt32 keyCode = [aKeyEvent keyCode]; - unshiftedChar = ::KeyTranslate(handle, keyCode, &state) & charCodeMask; - keyCode = [aKeyEvent keyCode] | shiftKey; - shiftedChar = ::KeyTranslate(handle, keyCode, &state) & charCodeMask; - keyCode = [aKeyEvent keyCode] | shiftKey | cmdKey; - shiftedCmdChar = ::KeyTranslate(handle, keyCode, &state) & charCodeMask; + } else { + if (gOverrideKeyboardLayout) { + handle = ::GetResource('kchr', gOverrideKeyboardLayout); + } else { + handle = (char**)::GetScriptManagerVariable(smKCHRCache); + } + if (handle) { + UInt32 state = 0; + UInt32 keyCode = [aKeyEvent keyCode]; + unshiftedChar = ::KeyTranslate(handle, keyCode, &state) & charCodeMask; + keyCode = [aKeyEvent keyCode] | shiftKey; + shiftedChar = ::KeyTranslate(handle, keyCode, &state) & charCodeMask; + keyCode = [aKeyEvent keyCode] | shiftKey | cmdKey; + shiftedCmdChar = ::KeyTranslate(handle, keyCode, &state) & charCodeMask; + } } // If the current keyboad layout is switchable by Cmd key // (e.g., Dvorak-QWERTY layout), we should not append the alternative @@ -4385,9 +4458,7 @@ static PRBool IsNormalCharInputtingEvent(const nsKeyEvent& aEvent) if (!textContent.mSucceeded || textContent.mReply.mString.IsEmpty()) return nil; - NSString* nsstr = - [NSString stringWithCharacters:textContent.mReply.mString.get() - length:textContent.mReply.mString.Length()]; + NSString* nsstr = ToNSString(textContent.mReply.mString); NSAttributedString* result = [[[NSAttributedString alloc] initWithString:nsstr attributes:nil] autorelease]; @@ -4551,6 +4622,20 @@ static PRBool IsNormalCharInputtingEvent(const nsKeyEvent& aEvent) NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } +#ifdef PR_LOGGING +static const char* ToEscapedString(NSString* aString, nsCAutoString& aBuf) +{ + for (PRUint32 i = 0; i < [aString length]; ++i) { + unichar ch = [aString characterAtIndex:i]; + if (ch >= 32 && ch < 128) { + aBuf.Append(char(ch)); + } else { + aBuf += nsPrintfCString("\\u%04x", ch); + } + } + return aBuf.get(); +} +#endif // Returns PR_TRUE if Gecko claims to have handled the event, PR_FALSE otherwise. - (PRBool)processKeyDownEvent:(NSEvent*)theEvent keyEquiv:(BOOL)isKeyEquiv @@ -4560,6 +4645,16 @@ static PRBool IsNormalCharInputtingEvent(const nsKeyEvent& aEvent) if (!mGeckoChild) return NO; +#ifdef PR_LOGGING + nsCAutoString str1; + nsCAutoString str2; +#endif + PR_LOG(sCocoaLog, PR_LOG_ALWAYS, + ("ChildView processKeyDownEvent: keycode=%d,modifiers=%x,chars=%s,charsIgnoringModifiers=%s\n", + [theEvent keyCode], [theEvent modifierFlags], + ToEscapedString([theEvent characters], str1), + ToEscapedString([theEvent charactersIgnoringModifiers], str2))); + nsAutoRetainCocoaObject kungFuDeathGrip(self); mCurKeyEvent = theEvent; @@ -4744,6 +4839,16 @@ static BOOL keyUpAlreadySentKeyDown = NO; { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; +#ifdef PR_LOGGING + nsCAutoString str1; + nsCAutoString str2; +#endif + PR_LOG(sCocoaLog, PR_LOG_ALWAYS, + ("ChildView keyUp: keycode=%d,modifiers=%x,chars=%s,charsIgnoringModifiers=%s\n", + [theEvent keyCode], [theEvent modifierFlags], + ToEscapedString([theEvent characters], str1), + ToEscapedString([theEvent charactersIgnoringModifiers], str2))); + if (mGeckoChild && mIsPluginView) { // I'm not sure the call to TSMProcessRawKeyEvent() is needed here (though // WebKit makes one). But we definitely need to short-circuit NSKeyUp diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp index df76c81241e..317661c493f 100644 --- a/widget/src/gtk2/nsWindow.cpp +++ b/widget/src/gtk2/nsWindow.cpp @@ -2325,7 +2325,7 @@ IsBasicLatinLetterOrNumeral(PRUint32 aChar) } gboolean -nsWindow::OnKeyPressEvent(GtkWidget *aWidget, GdkEventKey *aEvent) +nsWindow::OnKeyPressEvent(GdkEventKey *aEvent) { LOGFOCUS(("OnKeyPressEvent [%p]\n", (void *)this)); @@ -2500,7 +2500,7 @@ nsWindow::OnKeyPressEvent(GtkWidget *aWidget, GdkEventKey *aEvent) } gboolean -nsWindow::OnKeyReleaseEvent(GtkWidget *aWidget, GdkEventKey *aEvent) +nsWindow::OnKeyReleaseEvent(GdkEventKey *aEvent) { LOGFOCUS(("OnKeyReleaseEvent [%p]\n", (void *)this)); @@ -2528,6 +2528,17 @@ nsWindow::OnKeyReleaseEvent(GtkWidget *aWidget, GdkEventKey *aEvent) return FALSE; } +void +nsWindow::SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, + PRInt32 aNativeKeyCode, + PRUint32 aModifierFlags, + const nsAString& aCharacters, + const nsAString& aUnmodifiedCharacters, + PRBool aAllowIME) +{ + +} + void nsWindow::OnScrollEvent(GtkWidget *aWidget, GdkEventScroll *aEvent) { @@ -4791,7 +4802,7 @@ key_press_event_cb(GtkWidget *widget, GdkEventKey *event) nsRefPtr focusWindow = gFocusWindow ? gFocusWindow : window; - return focusWindow->OnKeyPressEvent(widget, event); + return focusWindow->OnKeyPressEvent(event); } gboolean @@ -4805,7 +4816,7 @@ key_release_event_cb(GtkWidget *widget, GdkEventKey *event) nsRefPtr focusWindow = gFocusWindow ? gFocusWindow : window; - return focusWindow->OnKeyReleaseEvent(widget, event); + return focusWindow->OnKeyReleaseEvent(event); } /* static */ diff --git a/widget/src/gtk2/nsWindow.h b/widget/src/gtk2/nsWindow.h index 0414e6628f2..92834c0a8e8 100644 --- a/widget/src/gtk2/nsWindow.h +++ b/widget/src/gtk2/nsWindow.h @@ -186,10 +186,8 @@ public: GdkEventFocus *aEvent); void OnContainerFocusOutEvent(GtkWidget *aWidget, GdkEventFocus *aEvent); - gboolean OnKeyPressEvent(GtkWidget *aWidget, - GdkEventKey *aEvent); - gboolean OnKeyReleaseEvent(GtkWidget *aWidget, - GdkEventKey *aEvent); + gboolean OnKeyPressEvent(GdkEventKey *aEvent); + gboolean OnKeyReleaseEvent(GdkEventKey *aEvent); void OnScrollEvent(GtkWidget *aWidget, GdkEventScroll *aEvent); void OnVisibilityNotifyEvent(GtkWidget *aWidget, @@ -364,6 +362,12 @@ public: gfxASurface *GetThebesSurface(); + virtual void SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, + PRInt32 aNativeKeyCode, + PRUint32 aModifierFlags, + const nsAString& aCharacters, + const nsAString& aUnmodifiedCharacters); + #ifdef ACCESSIBILITY static PRBool sAccessibilityEnabled; #endif diff --git a/widget/src/windows/nsKeyboardLayout.cpp b/widget/src/windows/nsKeyboardLayout.cpp index 350d7601a04..562d11fb54b 100644 --- a/widget/src/windows/nsKeyboardLayout.cpp +++ b/widget/src/windows/nsKeyboardLayout.cpp @@ -204,7 +204,7 @@ KeyboardLayout::KeyboardLayout () mDeadKeyTableListHead = nsnull; #endif - LoadLayout (); + LoadLayout (::GetKeyboardLayout(0)); } KeyboardLayout::~KeyboardLayout () @@ -348,7 +348,7 @@ KeyboardLayout::GetUniCharsWithShiftState(PRUint8 aVirtualKey, #endif } -void KeyboardLayout::LoadLayout () +void KeyboardLayout::LoadLayout (HKL aLayout) { #ifndef WINCE PRUint32 shiftState; @@ -361,7 +361,7 @@ void KeyboardLayout::LoadLayout () mActiveDeadKey = -1; mNumOfChars = 0; - mKeyboardLayout = ::GetKeyboardLayout (0); + mKeyboardLayout = aLayout; ReleaseDeadKeyTables (); @@ -385,7 +385,7 @@ void KeyboardLayout::LoadLayout () PRUint16 uniChars [5]; PRInt32 rv; - rv = ::ToUnicode (virtualKey, 0, kbdState, (LPWSTR)uniChars, NS_ARRAY_LENGTH (uniChars), 0); + rv = ::ToUnicodeEx (virtualKey, 0, kbdState, (LPWSTR)uniChars, NS_ARRAY_LENGTH (uniChars), 0, mKeyboardLayout); if (rv < 0) // dead-key { @@ -394,7 +394,7 @@ void KeyboardLayout::LoadLayout () // Repeat dead-key to deactivate it and get its character representation. PRUint16 deadChar [2]; - rv = ::ToUnicode (virtualKey, 0, kbdState, (LPWSTR)deadChar, NS_ARRAY_LENGTH (deadChar), 0); + rv = ::ToUnicodeEx (virtualKey, 0, kbdState, (LPWSTR)deadChar, NS_ARRAY_LENGTH (deadChar), 0, mKeyboardLayout); NS_ASSERTION (rv == 2, "Expecting twice repeated dead-key character"); @@ -583,7 +583,7 @@ PRBool KeyboardLayout::EnsureDeadKeyActive (PRBool aIsActive, PRUint8 aDeadKey, { PRUint16 dummyChars [5]; - rv = ::ToUnicode (aDeadKey, 0, (PBYTE)aDeadKeyKbdState, (LPWSTR)dummyChars, NS_ARRAY_LENGTH (dummyChars), 0); + rv = ::ToUnicodeEx (aDeadKey, 0, (PBYTE)aDeadKeyKbdState, (LPWSTR)dummyChars, NS_ARRAY_LENGTH (dummyChars), 0, mKeyboardLayout); // returned values: // <0 - Dead key state is active. The keyboard driver will wait for next character. // 1 - Previous pressed key was a valid base character that produced exactly one composite character. @@ -654,7 +654,7 @@ PRUint32 KeyboardLayout::GetDeadKeyCombinations (PRUint8 aDeadKey, const PBYTE a PRUint16 compositeChars [5]; PRInt32 rv; - rv = ::ToUnicode (virtualKey, 0, kbdState, (LPWSTR)compositeChars, NS_ARRAY_LENGTH (compositeChars), 0); + rv = ::ToUnicodeEx (virtualKey, 0, kbdState, (LPWSTR)compositeChars, NS_ARRAY_LENGTH (compositeChars), 0, mKeyboardLayout); switch (rv) { @@ -668,7 +668,7 @@ PRUint32 KeyboardLayout::GetDeadKeyCombinations (PRUint8 aDeadKey, const PBYTE a // character one more time to determine the base character. PRUint16 baseChars [5]; - rv = ::ToUnicode (virtualKey, 0, kbdState, (LPWSTR)baseChars, NS_ARRAY_LENGTH (baseChars), 0); + rv = ::ToUnicodeEx (virtualKey, 0, kbdState, (LPWSTR)baseChars, NS_ARRAY_LENGTH (baseChars), 0, mKeyboardLayout); NS_ASSERTION (rv == 1, "One base character expected"); diff --git a/widget/src/windows/nsKeyboardLayout.h b/widget/src/windows/nsKeyboardLayout.h index 66a42be22d6..401d37c4199 100644 --- a/widget/src/windows/nsKeyboardLayout.h +++ b/widget/src/windows/nsKeyboardLayout.h @@ -177,7 +177,7 @@ public: #endif } - void LoadLayout (); + void LoadLayout (HKL aLayout); void OnKeyDown (PRUint8 aVirtualKey); PRUint32 GetUniChars (PRUint16* aUniChars, PRUint8* aShiftStates, PRUint32 aMaxChars) const; PRUint32 GetUniCharsWithShiftState(PRUint8 aVirtualKey, PRUint8 aShiftStates, diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index c6ff9a74a8e..b9147e7d657 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -79,6 +79,7 @@ #include #include #include "nsUnicharUtils.h" +#include "prlog.h" #ifdef WINCE #include "aygshell.h" @@ -151,6 +152,10 @@ #include "prprf.h" #include "prmem.h" +#ifdef PR_LOGGING +PRLogModuleInfo* sWindowsLog = nsnull; +#endif + static const char kMozHeapDumpMessageString[] = "MOZ_HeapDump"; #define kWindowPositionSlop 20 @@ -647,6 +652,11 @@ void nsWindow::GlobalMsgWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP //------------------------------------------------------------------------- nsWindow::nsWindow() : nsBaseWidget() { +#ifdef PR_LOGGING + if (!sWindowsLog) + sWindowsLog = PR_NewLogModule("nsWindowsWidgets"); +#endif + mWnd = 0; mPaintDC = 0; mPrevWndProc = NULL; @@ -3115,19 +3125,33 @@ StringCaseInsensitiveEquals(const PRUint16* aChars1, const PRUint32 aNumChars1, return comp(aChars1, aChars2, aNumChars1) == 0; } +/** + * nsWindow::OnKeyDown peeks into the message queue and pulls out + * WM_CHAR messages for processing. During testing we don't want to + * mess with the real message queue. Instead we pass a + * pseudo-WM_CHAR-message using this structure, and OnKeyDown will use + * that as if it was in the message queue, and refrain from actually + * looking at or touching the message queue. + */ +struct nsFakeCharMessage { + UINT mCharCode; + UINT mScanCode; +}; + //------------------------------------------------------------------------- // // //------------------------------------------------------------------------- -BOOL nsWindow::OnKeyDown(UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyData) +BOOL nsWindow::OnKeyDown(UINT aVirtualKeyCode, LPARAM aKeyData, + nsFakeCharMessage* aFakeCharMessage) { -#ifdef VK_BROWSER_BACK + #ifdef VK_BROWSER_BACK // VK_BROWSER_BACK and VK_BROWSER_FORWARD are converted to nsCommandEvents if (aVirtualKeyCode == VK_BROWSER_BACK) { DispatchCommandEvent(APPCOMMAND_BROWSER_BACKWARD); return TRUE; - } + } else if (aVirtualKeyCode == VK_BROWSER_FORWARD) { DispatchCommandEvent(APPCOMMAND_BROWSER_FORWARD); @@ -3143,7 +3167,7 @@ BOOL nsWindow::OnKeyDown(UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyData) aVirtualKeyCode : MapFromNativeToDOM(aVirtualKeyCode); #ifdef DEBUG - //printf("In OnKeyDown virt: %d scan: %d\n", DOMKeyCode, aScanCode); + //printf("In OnKeyDown virt: %d\n", DOMKeyCode); #endif BOOL noDefault = DispatchKeyEvent(NS_KEY_DOWN, 0, nsnull, DOMKeyCode, aKeyData); @@ -3161,8 +3185,8 @@ BOOL nsWindow::OnKeyDown(UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyData) PRUint32 extraFlags = (noDefault ? NS_EVENT_FLAG_NO_DEFAULT : 0); MSG msg; - BOOL gotMsg = ::PeekMessageW(&msg, mWnd, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE | PM_NOYIELD); - PRBool anyCharMessagesRemoved = PR_FALSE; + BOOL gotMsg = aFakeCharMessage || + ::PeekMessageW(&msg, mWnd, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE | PM_NOYIELD); // Enter and backspace are always handled here to avoid for example the // confusion between ctrl-enter and ctrl-J. if (DOMKeyCode == NS_VK_RETURN || DOMKeyCode == NS_VK_BACK || @@ -3173,14 +3197,21 @@ BOOL nsWindow::OnKeyDown(UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyData) // They can be more than one because of: // * Dead-keys not pairing with base character // * Some keyboard layouts may map up to 4 characters to the single key + PRBool anyCharMessagesRemoved = PR_FALSE; - - while (gotMsg && (msg.message == WM_CHAR || msg.message == WM_SYSCHAR)) - { - ::GetMessageW(&msg, mWnd, WM_KEYFIRST, WM_KEYLAST); + if (aFakeCharMessage) { anyCharMessagesRemoved = PR_TRUE; - - gotMsg = ::PeekMessageW (&msg, mWnd, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE | PM_NOYIELD); + } else { + while (gotMsg && (msg.message == WM_CHAR || msg.message == WM_SYSCHAR)) + { + PR_LOG(sWindowsLog, PR_LOG_ALWAYS, + ("%s charCode=%d scanCode=%d\n", msg.message == WM_SYSCHAR ? "WM_SYSCHAR" : "WM_CHAR", + msg.wParam, HIWORD(msg.lParam) & 0xFF)); + ::GetMessageW(&msg, mWnd, WM_KEYFIRST, WM_KEYLAST); + anyCharMessagesRemoved = PR_TRUE; + + gotMsg = ::PeekMessageW (&msg, mWnd, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE | PM_NOYIELD); + } } if (!anyCharMessagesRemoved && DOMKeyCode == NS_VK_BACK) { @@ -3210,24 +3241,29 @@ BOOL nsWindow::OnKeyDown(UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyData) // http://bugzilla.mozilla.gr.jp/show_bug.cgi?id=2885 (written in Japanese) // http://bugzilla.mozilla.org/show_bug.cgi?id=194559 (written in English) + NS_ASSERTION(!aFakeCharMessage, "We shouldn't be touching the real msg queue"); ::GetMessageW(&msg, mWnd, WM_CHAR, WM_CHAR); } } } else if (gotMsg && - (msg.message == WM_CHAR || msg.message == WM_SYSCHAR || msg.message == WM_DEADCHAR)) { + (aFakeCharMessage || + msg.message == WM_CHAR || msg.message == WM_SYSCHAR || msg.message == WM_DEADCHAR)) { + if (aFakeCharMessage) + return OnChar(aFakeCharMessage->mCharCode, aFakeCharMessage->mScanCode, extraFlags); + // If prevent default set for keydown, do same for keypress ::GetMessageW(&msg, mWnd, msg.message, msg.message); if (msg.message == WM_DEADCHAR) return PR_FALSE; -#ifdef KE_DEBUG - printf("%s\tchar=%c\twp=%4x\tlp=%8x\n", - (msg.message == WM_SYSCHAR) ? "WM_SYSCHAR" : "WM_CHAR", - msg.wParam, msg.wParam, msg.lParam); -#endif - BOOL result = OnChar(msg.wParam, msg.lParam, extraFlags); + PR_LOG(sWindowsLog, PR_LOG_ALWAYS, + ("%s charCode=%d scanCode=%d\n", + msg.message == WM_SYSCHAR ? "WM_SYSCHAR" : "WM_CHAR", + msg.wParam, HIWORD(msg.lParam) & 0xFF)); + + BOOL result = OnChar(msg.wParam, HIWORD(msg.lParam) & 0xFF, extraFlags); // If a syschar keypress wasn't processed, Windows may want to // handle it to activate a native menu. if (!result && msg.message == WM_SYSCHAR) @@ -3402,9 +3438,11 @@ BOOL nsWindow::OnKeyDown(UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyData) // // //------------------------------------------------------------------------- -BOOL nsWindow::OnKeyUp( UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyData) +BOOL nsWindow::OnKeyUp( UINT aVirtualKeyCode, LPARAM aKeyData) { -#ifdef VK_BROWSER_BACK + PR_LOG(sWindowsLog, PR_LOG_ALWAYS, ("nsWindow::OnKeyUp VK=%d\n", aVirtualKeyCode)); + + #ifdef VK_BROWSER_BACK if (aVirtualKeyCode == VK_BROWSER_BACK || aVirtualKeyCode == VK_BROWSER_FORWARD) return TRUE; #endif @@ -3419,14 +3457,8 @@ BOOL nsWindow::OnKeyUp( UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyData) // // //------------------------------------------------------------------------- -BOOL nsWindow::OnChar(UINT charCode, LPARAM keyData, PRUint32 aFlags) +BOOL nsWindow::OnChar(UINT charCode, UINT aScanCode, PRUint32 aFlags) { - // These must be checked here too as a lone WM_CHAR could be received - // if a child window didn't handle it (for example Alt+Space in a content window) - mIsShiftDown = IS_VK_DOWN(NS_VK_SHIFT); - mIsControlDown = IS_VK_DOWN(NS_VK_CONTROL); - mIsAltDown = IS_VK_DOWN(NS_VK_ALT); - // ignore [shift+]alt+space so the OS can handle it if (mIsAltDown && !mIsControlDown && IS_VK_DOWN(NS_VK_SPACE)) { return FALSE; @@ -3471,10 +3503,10 @@ BOOL nsWindow::OnChar(UINT charCode, LPARAM keyData, PRUint32 aFlags) // Keep the characters unshifted for shortcuts and accesskeys and make sure // that numbers are always passed as such (among others: bugs 50255 and 351310) if (uniChar && (mIsControlDown || mIsAltDown)) { - UINT virtualKeyCode = ::MapVirtualKey(HIWORD(keyData) & 0xFF, MAPVK_VSC_TO_VK); + UINT virtualKeyCode = ::MapVirtualKeyEx(aScanCode, MAPVK_VSC_TO_VK, gKeyboardLayout); UINT unshiftedCharCode = virtualKeyCode >= '0' && virtualKeyCode <= '9' ? virtualKeyCode : - mIsShiftDown ? ::MapVirtualKey(virtualKeyCode, MAPVK_VK_TO_CHAR) : 0; + mIsShiftDown ? ::MapVirtualKeyEx(virtualKeyCode, MAPVK_VK_TO_CHAR, gKeyboardLayout) : 0; // ignore diacritics (top bit set) and key mapping errors (char code 0) if ((INT)unshiftedCharCode > 0) uniChar = unshiftedCharCode; @@ -3494,6 +3526,96 @@ BOOL nsWindow::OnChar(UINT charCode, LPARAM keyData, PRUint32 aFlags) return result; } +static const PRUint32 sModifierKeyMap[][3] = { + { nsIWidget::CAPS_LOCK, VK_CAPITAL, 0 }, + { nsIWidget::NUM_LOCK, VK_NUMLOCK, 0 }, + { nsIWidget::SHIFT_L, VK_SHIFT, VK_LSHIFT }, + { nsIWidget::SHIFT_R, VK_SHIFT, VK_RSHIFT }, + { nsIWidget::CTRL_L, VK_CONTROL, VK_LCONTROL }, + { nsIWidget::CTRL_R, VK_CONTROL, VK_RCONTROL }, + { nsIWidget::ALT_L, VK_MENU, VK_LMENU }, + { nsIWidget::ALT_R, VK_MENU, VK_RMENU } +}; + +struct KeyPair { + PRUint8 mGeneral; + PRUint8 mSpecific; + KeyPair(PRUint32 aGeneral, PRUint32 aSpecific) + : mGeneral(PRUint8(aGeneral)), mSpecific(PRUint8(aSpecific)) {} +}; + +static void +SetupKeyModifiersSequence(nsTArray* aArray, PRUint32 aModifiers) +{ + for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(sModifierKeyMap); ++i) { + const PRUint32* map = sModifierKeyMap[i]; + if (aModifiers & map[0]) { + aArray->AppendElement(KeyPair(map[1], map[2])); + } + } +} + +void +nsWindow::SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, + PRInt32 aNativeKeyCode, + PRUint32 aModifierFlags, + const nsAString& aCharacters, + const nsAString& aUnmodifiedCharacters) +{ + // Setup clean key state and load desired layout + BYTE originalKbdState[256]; + ::GetKeyboardState(originalKbdState); + BYTE kbdState[256]; + memset(kbdState, 0, sizeof(kbdState)); + // This changes the state of the keyboard for the current thread only, + // and we'll restore it soon, so this should be OK. + ::SetKeyboardState(kbdState); + HKL oldLayout = gKeyboardLayout; + gKeyboardLayout = (HKL)aNativeKeyboardLayout; + gKbdLayout.LoadLayout(gKeyboardLayout); + + nsAutoTArray keySequence; + SetupKeyModifiersSequence(&keySequence, aModifierFlags); + NS_ASSERTION(aNativeKeyCode >= 0 && aNativeKeyCode < 256, + "Native VK key code out of range"); + keySequence.AppendElement(KeyPair(aNativeKeyCode, 0)); + + // Simulate the pressing of each modifier key and then the real key + for (PRUint32 i = 0; i < keySequence.Length(); ++i) { + PRUint8 key = keySequence[i].mGeneral; + PRUint8 keySpecific = keySequence[i].mSpecific; + kbdState[key] = 0x81; // key is down and toggled on if appropriate + if (keySpecific) { + kbdState[keySpecific] = 0x81; + } + ::SetKeyboardState(kbdState); + SetupModKeyState(); + if (i == keySequence.Length() - 1 && aCharacters.Length() > 0) { + UINT scanCode = ::MapVirtualKeyEx(aNativeKeyCode, MAPVK_VK_TO_VSC, gKeyboardLayout); + nsFakeCharMessage msg = { aCharacters.CharAt(0), scanCode }; + OnKeyDown(key, 0, &msg); + } else { + OnKeyDown(key, 0, nsnull); + } + } + for (PRUint32 i = keySequence.Length(); i > 0; --i) { + PRUint8 key = keySequence[i - 1].mGeneral; + PRUint8 keySpecific = keySequence[i - 1].mSpecific; + kbdState[key] = 0; // key is up and toggled off if appropriate + if (keySpecific) { + kbdState[keySpecific] = 0; + } + ::SetKeyboardState(kbdState); + SetupModKeyState(); + OnKeyUp(key, 0); + } + + // Restore old key state and layout + ::SetKeyboardState(originalKbdState); + gKeyboardLayout = oldLayout; + gKbdLayout.LoadLayout(gKeyboardLayout); + SetupModKeyState(); +} void nsWindow::ConstrainZLevel(HWND *aAfter) { @@ -4003,6 +4125,13 @@ void nsWindow::PostSleepWakeNotification(const char* aNotification) } #endif +void nsWindow::SetupModKeyState() +{ + mIsShiftDown = IS_VK_DOWN(NS_VK_SHIFT); + mIsControlDown = IS_VK_DOWN(NS_VK_CONTROL); + mIsAltDown = IS_VK_DOWN(NS_VK_ALT); +} + PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *aRetValue) { static UINT vkKeyCached = 0; // caches VK code fon WM_KEYDOWN @@ -4237,22 +4366,24 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT case WM_SYSCHAR: case WM_CHAR: { -#ifdef KE_DEBUG - printf("%s\tchar=%c\twp=%4x\tlp=%8x\n", (msg == WM_SYSCHAR) ? "WM_SYSCHAR" : "WM_CHAR", wParam, wParam, lParam); -#endif - result = OnChar(wParam, lParam); + PR_LOG(sWindowsLog, PR_LOG_ALWAYS, + ("%s charCode=%d scanCode=%d\n", msg == WM_SYSCHAR ? "WM_SYSCHAR" : "WM_CHAR", + wParam, HIWORD(lParam) & 0xFF)); + + // These must be checked here too as a lone WM_CHAR could be received + // if a child window didn't handle it (for example Alt+Space in a content window) + SetupModKeyState(); + + result = OnChar(wParam, HIWORD(lParam) & 0xFF); } break; case WM_SYSKEYUP: case WM_KEYUP: + PR_LOG(sWindowsLog, PR_LOG_ALWAYS, + ("%s VK=%d\n", msg == WM_SYSKEYDOWN ? "WM_SYSKEYUP" : "WM_KEYUP", wParam)); -#ifdef KE_DEBUG - printf("%s\t\twp=%x\tlp=%x\n", (WM_KEYUP==msg) ? "WM_KEYUP" : "WM_SYSKEYUP", wParam, lParam); -#endif - mIsShiftDown = IS_VK_DOWN(NS_VK_SHIFT); - mIsControlDown = IS_VK_DOWN(NS_VK_CONTROL); - mIsAltDown = IS_VK_DOWN(NS_VK_ALT); + SetupModKeyState(); // Note: the original code passed (HIWORD(lParam)) to OnKeyUp as // scan code. However, this breaks Alt+Num pad input. @@ -4276,7 +4407,7 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT // This helps avoid triggering the menu bar for ALT key accelerators used in // assistive technologies such as Window-Eyes and ZoomText, and when using Alt+Tab // to switch back to Mozilla in Windows 95 and Windows 98 - result = OnKeyUp(wParam, (HIWORD(lParam)), lParam); + result = OnKeyUp(wParam, lParam); } else { result = PR_FALSE; @@ -4288,13 +4419,10 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT // Let the fall through if it isn't a key pad case WM_SYSKEYDOWN: case WM_KEYDOWN: -#ifdef KE_DEBUG - printf("%s\t\twp=%4x\tlp=%8x\n", (WM_KEYDOWN==msg) ? "WM_KEYDOWN" : "WM_SYSKEYDOWN", wParam, lParam); -#endif + PR_LOG(sWindowsLog, PR_LOG_ALWAYS, + ("%s VK=%d\n", msg == WM_SYSKEYDOWN ? "WM_SYSKEYDOWN" : "WM_KEYDOWN", wParam)); - mIsShiftDown = IS_VK_DOWN(NS_VK_SHIFT); - mIsControlDown = IS_VK_DOWN(NS_VK_CONTROL); - mIsAltDown = IS_VK_DOWN(NS_VK_ALT); + SetupModKeyState(); // Note: the original code passed (HIWORD(lParam)) to OnKeyDown as // scan code. However, this breaks Alt+Num pad input. @@ -4318,7 +4446,7 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT result = PR_FALSE; } else if (!sIMEIsComposing) { - result = OnKeyDown(wParam, (HIWORD(lParam)), lParam); + result = OnKeyDown(wParam, lParam, nsnull); } else result = PR_FALSE; @@ -6570,8 +6698,7 @@ BOOL nsWindow::OnInputLangChange(HKL aHKL, LRESULT *oRetValue) if (gKeyboardLayout != aHKL) { gKeyboardLayout = aHKL; - - gKbdLayout.LoadLayout(); + gKbdLayout.LoadLayout(gKeyboardLayout); } ResetInputState(); diff --git a/widget/src/windows/nsWindow.h b/widget/src/windows/nsWindow.h index 550a0c174e8..066f130148b 100644 --- a/widget/src/windows/nsWindow.h +++ b/widget/src/windows/nsWindow.h @@ -67,6 +67,7 @@ class nsIFile; class imgIContainer; struct nsAlternativeCharCode; +struct nsFakeCharMessage; #ifdef ACCESSIBILITY #include "OLEACC.H" @@ -308,11 +309,12 @@ protected: virtual PRBool OnMove(PRInt32 aX, PRInt32 aY); virtual PRBool OnPaint(HDC aDC = nsnull); virtual PRBool OnResize(nsRect &aWindowRect); - - BOOL OnChar(UINT charCode, LPARAM keyData, PRUint32 aFlags = 0); - - BOOL OnKeyDown( UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyCode); - BOOL OnKeyUp( UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyCode); + + void SetupModKeyState(); + BOOL OnChar(UINT charCode, UINT aScanCode, PRUint32 aFlags = 0); + BOOL OnKeyDown( UINT aVirtualKeyCode, LPARAM aKeyCode, + nsFakeCharMessage* aFakeCharMessage); + BOOL OnKeyUp( UINT aVirtualKeyCode, LPARAM aKeyCode); UINT MapFromNativeToDOM(UINT aNativeKeyCode); @@ -367,6 +369,12 @@ protected: PRBool CanTakeFocus(); + virtual void SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, + PRInt32 aNativeKeyCode, + PRUint32 aModifierFlags, + const nsAString& aCharacters, + const nsAString& aUnmodifiedCharacters); + private: diff --git a/widget/src/xpwidgets/nsBaseWidget.h b/widget/src/xpwidgets/nsBaseWidget.h index 5acbd0a2533..c4a4fe491d5 100644 --- a/widget/src/xpwidgets/nsBaseWidget.h +++ b/widget/src/xpwidgets/nsBaseWidget.h @@ -156,6 +156,12 @@ protected: return mLastRollup; } + virtual void SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, + PRInt32 aNativeKeyCode, + PRUint32 aModifierFlags, + const nsAString& aCharacters, + const nsAString& aUnmodifiedCharacters) {} + protected: void* mClientData; EVENT_CALLBACK mEventCallback; diff --git a/widget/tests/Makefile.in b/widget/tests/Makefile.in index bcd299e67d9..8a5ec7f53ee 100644 --- a/widget/tests/Makefile.in +++ b/widget/tests/Makefile.in @@ -45,6 +45,7 @@ include $(DEPTH)/config/autoconf.mk include $(topsrcdir)/config/rules.mk _TEST_FILES = test_bug343416.xul \ + test_keycodes.xul \ $(NULL) libs:: $(_TEST_FILES) diff --git a/widget/tests/test_keycodes.xul b/widget/tests/test_keycodes.xul new file mode 100644 index 00000000000..aa55bdcb098 --- /dev/null +++ b/widget/tests/test_keycodes.xul @@ -0,0 +1,347 @@ + + + + + + Key event tests + + + + From 9288922808a06d57d59ddec253e0070efb4bd264 Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Mon, 5 May 2008 16:20:39 -0700 Subject: [PATCH 30/98] Reverting unwanted changes --- widget/src/gtk2/nsWindow.cpp | 5 ++--- widget/src/gtk2/nsWindow.h | 12 ++++-------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp index 317661c493f..5fbcb58c594 100644 --- a/widget/src/gtk2/nsWindow.cpp +++ b/widget/src/gtk2/nsWindow.cpp @@ -630,9 +630,8 @@ nsWindow::Move(PRInt32 aX, PRInt32 aY) } NS_IMETHODIMP -nsWindow::PlaceBehind(nsTopLevelWidgetZPlacement aPlacement, - nsIWidget *aWidget, - PRBool aActivate) +nsWindow::PlaceBehind(nsIWidget *aWidget, + PRBool aActivate) { return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/widget/src/gtk2/nsWindow.h b/widget/src/gtk2/nsWindow.h index 92834c0a8e8..0414e6628f2 100644 --- a/widget/src/gtk2/nsWindow.h +++ b/widget/src/gtk2/nsWindow.h @@ -186,8 +186,10 @@ public: GdkEventFocus *aEvent); void OnContainerFocusOutEvent(GtkWidget *aWidget, GdkEventFocus *aEvent); - gboolean OnKeyPressEvent(GdkEventKey *aEvent); - gboolean OnKeyReleaseEvent(GdkEventKey *aEvent); + gboolean OnKeyPressEvent(GtkWidget *aWidget, + GdkEventKey *aEvent); + gboolean OnKeyReleaseEvent(GtkWidget *aWidget, + GdkEventKey *aEvent); void OnScrollEvent(GtkWidget *aWidget, GdkEventScroll *aEvent); void OnVisibilityNotifyEvent(GtkWidget *aWidget, @@ -362,12 +364,6 @@ public: gfxASurface *GetThebesSurface(); - virtual void SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, - PRInt32 aNativeKeyCode, - PRUint32 aModifierFlags, - const nsAString& aCharacters, - const nsAString& aUnmodifiedCharacters); - #ifdef ACCESSIBILITY static PRBool sAccessibilityEnabled; #endif From 4687db17c63bfcda7cf57192043ecc91130ef1fb Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Mon, 5 May 2008 16:44:18 -0700 Subject: [PATCH 31/98] Reverting unwanted changes --- widget/src/gtk2/nsWindow.cpp | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp index 5fbcb58c594..df76c81241e 100644 --- a/widget/src/gtk2/nsWindow.cpp +++ b/widget/src/gtk2/nsWindow.cpp @@ -630,8 +630,9 @@ nsWindow::Move(PRInt32 aX, PRInt32 aY) } NS_IMETHODIMP -nsWindow::PlaceBehind(nsIWidget *aWidget, - PRBool aActivate) +nsWindow::PlaceBehind(nsTopLevelWidgetZPlacement aPlacement, + nsIWidget *aWidget, + PRBool aActivate) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -2324,7 +2325,7 @@ IsBasicLatinLetterOrNumeral(PRUint32 aChar) } gboolean -nsWindow::OnKeyPressEvent(GdkEventKey *aEvent) +nsWindow::OnKeyPressEvent(GtkWidget *aWidget, GdkEventKey *aEvent) { LOGFOCUS(("OnKeyPressEvent [%p]\n", (void *)this)); @@ -2499,7 +2500,7 @@ nsWindow::OnKeyPressEvent(GdkEventKey *aEvent) } gboolean -nsWindow::OnKeyReleaseEvent(GdkEventKey *aEvent) +nsWindow::OnKeyReleaseEvent(GtkWidget *aWidget, GdkEventKey *aEvent) { LOGFOCUS(("OnKeyReleaseEvent [%p]\n", (void *)this)); @@ -2527,17 +2528,6 @@ nsWindow::OnKeyReleaseEvent(GdkEventKey *aEvent) return FALSE; } -void -nsWindow::SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, - PRInt32 aNativeKeyCode, - PRUint32 aModifierFlags, - const nsAString& aCharacters, - const nsAString& aUnmodifiedCharacters, - PRBool aAllowIME) -{ - -} - void nsWindow::OnScrollEvent(GtkWidget *aWidget, GdkEventScroll *aEvent) { @@ -4801,7 +4791,7 @@ key_press_event_cb(GtkWidget *widget, GdkEventKey *event) nsRefPtr focusWindow = gFocusWindow ? gFocusWindow : window; - return focusWindow->OnKeyPressEvent(event); + return focusWindow->OnKeyPressEvent(widget, event); } gboolean @@ -4815,7 +4805,7 @@ key_release_event_cb(GtkWidget *widget, GdkEventKey *event) nsRefPtr focusWindow = gFocusWindow ? gFocusWindow : window; - return focusWindow->OnKeyReleaseEvent(event); + return focusWindow->OnKeyReleaseEvent(widget, event); } /* static */ From a8b6ad644f1afc8f566553baad9a69e931b49f61 Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Mon, 5 May 2008 17:07:19 -0700 Subject: [PATCH 32/98] disabling failing (new) tests --- widget/tests/test_keycodes.xul | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/widget/tests/test_keycodes.xul b/widget/tests/test_keycodes.xul index aa55bdcb098..d700a6b38c5 100644 --- a/widget/tests/test_keycodes.xul +++ b/widget/tests/test_keycodes.xul @@ -320,15 +320,16 @@ function runAccessKeyTests() "A", false); // Greek layout can activate a Latin accesskey - testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, - "a", true); - testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, - "A", true); +// tests disabled because they currently fail on tinderbox +// testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, +// "a", true); +// testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, +// "A", true); // ... and a Greek accesskey! - testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, - "\u03b1", true); - testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, - "\u0391", true); +// testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, +// "\u03b1", true); +// testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, +// "\u0391", true); } button.removeEventListener("click", onClick, false); From 5f43330749b553542cd7f79ec63d37ebc6b9060f Mon Sep 17 00:00:00 2001 From: "masayuki@d-toybox.com" Date: Mon, 5 May 2008 21:07:24 -0700 Subject: [PATCH 33/98] Bug 432112 Cmd+? does not give Help (? in the shifted position) r=gavin, a=beltzner --- browser/base/content/baseMenuOverlay.xul | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/browser/base/content/baseMenuOverlay.xul b/browser/base/content/baseMenuOverlay.xul index 0149cc1c573..95c83ae52f9 100644 --- a/browser/base/content/baseMenuOverlay.xul +++ b/browser/base/content/baseMenuOverlay.xul @@ -113,13 +113,8 @@ #ifdef XP_MACOSX - - From 94c0900f7e5792621cb8f5082d68be661fc08781 Mon Sep 17 00:00:00 2001 From: "masayuki@d-toybox.com" Date: Mon, 5 May 2008 21:11:52 -0700 Subject: [PATCH 34/98] Bug 429510 Web apps cannot handle Ctrl+foo/Alt+foo key on keypress event, gtk2 part r=karl, sr=roc, a=beltzner --- widget/src/gtk2/nsWindow.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp index df76c81241e..9e0d18739f3 100644 --- a/widget/src/gtk2/nsWindow.cpp +++ b/widget/src/gtk2/nsWindow.cpp @@ -2456,6 +2456,9 @@ nsWindow::OnKeyPressEvent(GtkWidget *aWidget, GdkEventKey *aEvent) g_free(keys); } if (minGroup >= 0) { + PRUint32 unmodifiedCh = + event.isShift ? altCharCodes.mShiftedCharCode : + altCharCodes.mUnshiftedCharCode; // unshifted charcode of found keyboard layout. PRUint32 ch = GetCharCodeFor(aEvent, baseState, minGroup); @@ -2470,6 +2473,17 @@ nsWindow::OnKeyPressEvent(GtkWidget *aWidget, GdkEventKey *aEvent) altCharCodes.mShiftedCharCode) { event.alternativeCharCodes.AppendElement(altCharCodes); } + // If the charCode is not Latin, and the level is 0 or 1, + // we should replace the charCode to Latin char if Alt and + // Meta keys are not pressed. (Alt should be sent the + // localized char for accesskey like handling of Web + // Applications.) + ch = event.isShift ? altCharCodes.mShiftedCharCode : + altCharCodes.mUnshiftedCharCode; + if (ch && !(event.isAlt || event.isMeta) && + event.charCode == unmodifiedCh) { + event.charCode = ch; + } } } } From d40696aaf667bd9c44d58559bcd685e794a8f5aa Mon Sep 17 00:00:00 2001 From: "dbaron@dbaron.org" Date: Mon, 5 May 2008 21:47:23 -0700 Subject: [PATCH 35/98] Allow diffbloatdump to read its own input back in (so that we can run fix-*-stack over its output (which is much faster than running it over a whole log) and still diff that output against different output. Not part of the build. --- tools/trace-malloc/diffbloatdump.pl | 63 +++++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 7 deletions(-) diff --git a/tools/trace-malloc/diffbloatdump.pl b/tools/trace-malloc/diffbloatdump.pl index 49ed12f2bf4..9ba57613268 100755 --- a/tools/trace-malloc/diffbloatdump.pl +++ b/tools/trace-malloc/diffbloatdump.pl @@ -54,6 +54,9 @@ $::opt_include_zero = 0; $::opt_allocation_count = 0; $::opt_use_address = 0; +# XXX Change --use-address to be the default and remove the option +# once tinderbox is no longer using it without --use-address. + Getopt::Long::Configure("pass_through"); Getopt::Long::GetOptions("help", "allocation-count", "depth=i", "include-zero", "use-address"); @@ -69,11 +72,53 @@ if ($::opt_help) { --use-address Don't ignore the address part of the stack trace (can make comparison more accurate when comparing results from the same build) + + The input files ( and above) are either trace-malloc + memory dumps OR this script's output. (If this script's output, + --allocation-count and --use-address are ignored.) If the input files + have .gz or .bz2 extension, they are uncompressed. "; } my $calltree = { count => 0 }; # leave children undefined +sub get_child($$) { + my ($node, $frame) = @_; + if (!defined($node->{children})) { + $node->{children} = {}; + } + if (!defined($node->{children}->{$frame})) { + $node->{children}->{$frame} = { count => 0 }; + } + return $node->{children}->{$frame}; +} + +sub add_tree_file($$$) { + my ($infile, $firstline, $factor) = @_; + + my @nodestack; + $nodestack[1] = $calltree; + $firstline =~ /^(-?\d+) malloc$/; + $calltree->{count} += $1 * $factor; + + my $lineno = 1; + while (!eof($infile)) { + my $line = <$infile>; + ++$lineno; + $line =~ /^( *)(-?\d+) (.*)$/ || die "malformed input, line $lineno"; + my $depth = length($1); + my $count = $2; + my $frame = $3; + die "malformed input, line $lineno" if ($depth % 2 != 0); + $depth /= 2; + die "malformed input, line $lineno" if ($depth > $#nodestack); + $#nodestack = $depth; + my $node = get_child($nodestack[$depth], $frame); + push @nodestack, $node; + $node->{count} += $count * $factor; + } +} + sub add_file($$) { # Takes (1) a reference to a file descriptor for input and (2) the # factor to multiply the stacks by (generally +1 or -1). @@ -113,13 +158,7 @@ sub add_file($$) { my $node = $calltree; while ($i < $#stack && $i < $::opt_depth) { $node->{count} += $factor; - if (!defined($node->{children})) { - $node->{children} = {}; - } - if (!defined($node->{children}->{$stack[$i]})) { - $node->{children}->{$stack[$i]} = { count => 0 }; - } - $node = $node->{children}->{$stack[$i]}; + $node = get_child($node, $stack[$i]); ++$i; } $node->{count} += $factor; @@ -136,9 +175,19 @@ sub add_file($$) { } else { open (INFILE, "<$infile") || die "Can't open input \"$infile\""; } + my $first = 1; while ( ! eof(INFILE) ) { # read the type and address my $line = ; + if ($first) { + $first = 0; + if ($line =~ /^-?\d+ malloc$/) { + # We're capable of reading in our own output as well. + add_tree_file(\*INFILE, $line, $factor); + close INFILE; + return; + } + } unless ($line =~ /.*\((\d*)\)[\r|\n]/) { die "badly formed allocation header in $infile"; } From 31960305544bfc1918c214c480c1d8c55bb804bd Mon Sep 17 00:00:00 2001 From: "mconnor@steelgryphon.com" Date: Mon, 5 May 2008 23:19:15 -0700 Subject: [PATCH 36/98] bug 399640 - update credits for Firefox 3. second pass on individuals + org credits, a=vlad --- browser/base/content/credits.xhtml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/browser/base/content/credits.xhtml b/browser/base/content/credits.xhtml index aabaeb73f7f..744e09e6e66 100644 --- a/browser/base/content/credits.xhtml +++ b/browser/base/content/credits.xhtml @@ -230,6 +230,7 @@
  • Jason Barnabe
  • David Baron
  • Colin Barrett
  • +
  • Bo Bayles
  • Christopher Beard
  • Glen Beasley
  • Juan Becerra
  • @@ -282,7 +283,9 @@
  • Kai Engert
  • Steve England
  • Madhava Enros
  • +
  • Behdad Esfahbod
  • Eleka Etimad
  • +
  • Anthony Evans
  • Jason Evans
  • Alex Faaborg
  • Jane Finette
  • @@ -300,6 +303,7 @@
  • Dão Gottwald
  • Zak Greant
  • Matthew Gregan
  • +
  • Will Guaraldi
  • Adam Guthrie
  • Andrei Hajdukewycz
  • Trevor Hardcastle
  • @@ -309,6 +313,7 @@
  • Axel Hecht
  • Frank Hecker
  • Robert Helmer
  • +
  • Stefan Hermes
  • Jon Hicks
  • Graydon Hoare
  • Chris Hofmann
  • @@ -333,6 +338,7 @@
  • Masatoshi Kimura
  • Ria Klaassen
  • Marcia Knous
  • +
  • Nelson Ko
  • Gary Kwong
  • David Lanham
  • Edward Lee
  • @@ -357,6 +363,7 @@
  • Federico Mena-Quintero
  • Mark Mentovai
  • Steven Michaud
  • +
  • Matthew Middleton
  • Ted Mielczarek
  • Bernd Mielke
  • Dave Miller
  • @@ -425,6 +432,7 @@
  • Gavin Sharp
  • Mike Shaver
  • Eric Shepherd
  • +
  • Hiroshi Shimoda
  • Atsushi Shimono
  • Jungshik Shin
  • Jonas Sicking
  • @@ -462,12 +470,14 @@
  • Daniel Veditz
  • Michael Ventnor
  • Alexei Volkov
  • -
  • Vladimir Vukicevic
  • +
  • Vladimir Vukićević
  • HÃ¥kan Waara
  • Jeff Walden
  • Tracy Walker
  • +
  • Cheng Wang
  • Martijn Wargers
  • Jonathan Watt
  • +
  • Peter Weilbacher
  • Frédéric Wenzel
  • Steffen Wilberg
  • Shawn Wilsher
  • @@ -480,6 +490,7 @@
  • Kohei Yoshino
  • Shigeru Yoshitake
  • Boris Zbarsky
  • +
  • Marco Zehe
  • Matthew Zeier
  • @@ -494,21 +505,22 @@
  • Yahoo!
  • IBM
  • Sun Microsystems
  • +
  • Red Hat
  • Oregon State University - Open Source Lab
  • -
  • A&R Edelman
  • -
  • arcendo communications GmbH
  • -
  • fuse pr
  • +
  • Global Netoptex, Inc
  • +
  • Internet Software Consortium
  • Cooley Godward, LLP
  • Greenburg Traurig, LLP
  • +
  • OutCast Communications
  • +
  • +
  • The Royal Order of Experience Design
  • Nobox
  • -
  • Glaxstar
  • -
  • Radiant Core
  • silverorange
  • -
  • Revver
  • +
  • Glaxstar
  • MozillaZine Community
  • From ef158127f2fdb59ad8c4e25de9f1f4607f1d670f Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Tue, 6 May 2008 00:33:08 -0700 Subject: [PATCH 37/98] Fixing bustage --- widget/src/windows/nsWindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index b9147e7d657..48144611efb 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -173,6 +173,7 @@ static const char kMozHeapDumpMessageString[] = "MOZ_HeapDump"; #endif #ifndef MAPVK_VSC_TO_VK +#define MAPVK_VK_TO_VSC 0 #define MAPVK_VSC_TO_VK 1 #define MAPVK_VK_TO_CHAR 2 #endif From 7d7dd4aa97a542e20b8e99a81b98fc07c9ff0afd Mon Sep 17 00:00:00 2001 From: "dolske@mozilla.com" Date: Tue, 6 May 2008 00:45:34 -0700 Subject: [PATCH 38/98] Bug 423460 - Saved Passwords are not imported from IE6 to Firefox on XP. r=gavin --- .../migration/src/nsIEProfileMigrator.cpp | 32 ++-- .../components/passwordmgr/public/Makefile.in | 1 + .../nsILoginManagerIEMigrationHelper.idl | 57 +++++++ .../passwordmgr/src/storage-Legacy.js | 92 ++++++++++- .../test/unit/test_storage_legacy_5.js | 151 ++++++++++++++++++ 5 files changed, 320 insertions(+), 13 deletions(-) create mode 100644 toolkit/components/passwordmgr/public/nsILoginManagerIEMigrationHelper.idl create mode 100644 toolkit/components/passwordmgr/test/unit/test_storage_legacy_5.js diff --git a/browser/components/migration/src/nsIEProfileMigrator.cpp b/browser/components/migration/src/nsIEProfileMigrator.cpp index 500d66caeaf..f929212e9b9 100644 --- a/browser/components/migration/src/nsIEProfileMigrator.cpp +++ b/browser/components/migration/src/nsIEProfileMigrator.cpp @@ -81,7 +81,7 @@ #include "nsIGlobalHistory.h" #include "nsIRDFRemoteDataSource.h" #include "nsIURI.h" -#include "nsILoginManager.h" +#include "nsILoginManagerIEMigrationHelper.h" #include "nsILoginInfo.h" #include "nsIFormHistory.h" #include "nsIRDFService.h" @@ -907,7 +907,8 @@ nsIEProfileMigrator::MigrateSiteAuthSignons(IPStore* aPStore) NS_ENSURE_ARG_POINTER(aPStore); - nsCOMPtr pwmgr(do_GetService("@mozilla.org/login-manager;1")); + nsCOMPtr pwmgr( + do_GetService("@mozilla.org/login-manager/storage/legacy;1")); if (!pwmgr) return NS_OK; @@ -941,7 +942,7 @@ nsIEProfileMigrator::MigrateSiteAuthSignons(IPStore* aPStore) int idx; idx = host.FindChar('/'); if (idx) { - realm.Assign(Substring(host, idx)); + realm.Assign(Substring(host, idx + 1)); host.Assign(Substring(host, 0, idx)); } // XXX: username and password are always ASCII in IPStore? @@ -958,8 +959,10 @@ nsIEProfileMigrator::MigrateSiteAuthSignons(IPStore* aPStore) aLogin->SetHttpRealm(realm); aLogin->SetUsername(NS_ConvertUTF8toUTF16((char *)data)); aLogin->SetPassword(NS_ConvertUTF8toUTF16((char *)password)); + aLogin->SetUsernameField(EmptyString()); + aLogin->SetPasswordField(EmptyString()); - pwmgr->AddLogin(aLogin); + pwmgr->MigrateAndAddLogin(aLogin); } ::CoTaskMemFree(data); } @@ -1101,7 +1104,8 @@ nsIEProfileMigrator::ResolveAndMigrateSignons(IPStore* aPStore, nsVoidArray* aSi void nsIEProfileMigrator::EnumerateUsernames(const nsAString& aKey, PRUnichar* aData, unsigned long aCount, nsVoidArray* aSignonsFound) { - nsCOMPtr pwmgr(do_GetService("@mozilla.org/login-manager;1")); + nsCOMPtr pwmgr( + do_GetService("@mozilla.org/login-manager/storage/legacy;1")); if (!pwmgr) return; @@ -1118,17 +1122,27 @@ nsIEProfileMigrator::EnumerateUsernames(const nsAString& aKey, PRUnichar* aData, if (curr.Equals(sd->user)) { // Bingo! Found a username in the saved data for this item. Now, add a Signon. nsDependentString usernameStr(sd->user), passStr(sd->pass); - nsDependentCString realm(sd->realm); + nsAutoString realm(NS_ConvertUTF8toUTF16(sd->realm)); nsresult rv; nsCOMPtr aLogin (do_CreateInstance(NS_LOGININFO_CONTRACTID, &rv)); NS_ENSURE_SUCCESS(rv, /* */); - // XXX Init() needs to treat EmptyString()s the same as void strings, disable for now - //aLogin->Init(realm, EmptyString(), nsnull, usernameStr, passStr, aKey, EmptyString()); + // nsStringAPI doesn't let us create void strings, so we won't + // use Init() here. + // IE doesn't have the form submit URL, so set to empty-string, + // which the login manager uses as a wildcard value. + // IE doesn't store the password field name either, so just set it + // to an empty string. + aLogin->SetHostname(realm); + aLogin->SetFormSubmitURL(EmptyString()); + aLogin->SetUsername(usernameStr); + aLogin->SetPassword(passStr); + aLogin->SetUsernameField(aKey); + aLogin->SetPasswordField(EmptyString()); - pwmgr->AddLogin(aLogin); + pwmgr->MigrateAndAddLogin(aLogin); } } diff --git a/toolkit/components/passwordmgr/public/Makefile.in b/toolkit/components/passwordmgr/public/Makefile.in index 7680dd492d6..f39adf01658 100644 --- a/toolkit/components/passwordmgr/public/Makefile.in +++ b/toolkit/components/passwordmgr/public/Makefile.in @@ -49,6 +49,7 @@ XPIDLSRCS = \ nsILoginManager.idl \ nsILoginManagerStorage.idl \ nsILoginManagerPrompter.idl \ + nsILoginManagerIEMigrationHelper.idl \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/toolkit/components/passwordmgr/public/nsILoginManagerIEMigrationHelper.idl b/toolkit/components/passwordmgr/public/nsILoginManagerIEMigrationHelper.idl new file mode 100644 index 00000000000..4a311162eef --- /dev/null +++ b/toolkit/components/passwordmgr/public/nsILoginManagerIEMigrationHelper.idl @@ -0,0 +1,57 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is mozilla.org code. + * + * The Initial Developer of the Original Code is Mozilla Corporation. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Justin Dolske (original author) + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + + +#include "nsISupports.idl" + +interface nsILoginInfo; + +[scriptable, uuid(8a59ea3d-b8d0-48af-a3e2-63e27a02cde7)] + +interface nsILoginManagerIEMigrationHelper : nsISupports { + /** + * Takes a login provided from nsIEProfileMigrator, migrates it to the + * current login manager format, and adds it to the list of stored logins. + * + * @param aLogin + * The login to be migrated. + * + * Note: In some cases, multiple logins may be created from a single input + * when the format is ambigious. + * + */ + void migrateAndAddLogin(in nsILoginInfo aLogin); +}; diff --git a/toolkit/components/passwordmgr/src/storage-Legacy.js b/toolkit/components/passwordmgr/src/storage-Legacy.js index 91d0ef2b073..dd2cc61c4fe 100644 --- a/toolkit/components/passwordmgr/src/storage-Legacy.js +++ b/toolkit/components/passwordmgr/src/storage-Legacy.js @@ -47,7 +47,8 @@ LoginManagerStorage_legacy.prototype = { classDescription : "LoginManagerStorage_legacy", contractID : "@mozilla.org/login-manager/storage/legacy;1", classID : Components.ID("{e09e4ca6-276b-4bb4-8b71-0635a3a2a007}"), - QueryInterface : XPCOMUtils.generateQI([Ci.nsILoginManagerStorage]), + QueryInterface : XPCOMUtils.generateQI([Ci.nsILoginManagerStorage, + Ci.nsILoginManagerIEMigrationHelper]), __logService : null, // Console logging service, used for debugging. get _logService() { @@ -655,9 +656,9 @@ LoginManagerStorage_legacy.prototype = { createInstance(Ci.nsILoginInfo); extraLogin.init("https://" + host + ":" + port, null, aLogin.httpRealm, - null, null, "", ""); - // We don't have decrypted values, so clone the encrypted - // bits into the new entry. + aLogin.username, aLogin.password, "", ""); + // We don't have decrypted values, unless we're importing from IE, + // so clone the encrypted bits into the new entry. extraLogin.wrappedJSObject.encryptedPassword = aLogin.wrappedJSObject.encryptedPassword; extraLogin.wrappedJSObject.encryptedUsername = @@ -1293,6 +1294,89 @@ LoginManagerStorage_legacy.prototype = { return [plainText, userCanceled]; }, + + + + /* ================== nsILoginManagerIEMigratorHelper ================== */ + + + + + _migrationLoginManager : null, + + /* + * migrateAndAddLogin + * + * Given a login with IE6-formatted fields, migrates it to the new format + * and adds it to the login manager. + * + * Experimentally derived format of IE6 logins, see: + * https://bugzilla.mozilla.org/attachment.cgi?id=319346 + * + * HTTP AUTH: + * - hostname is always "example.com:123" + * * "example.com", "http://example.com", "http://example.com:80" all + * end up as just "example.com:80" + * * Entering "example.com:80" in the URL bar isn't recognized as a + * valid URL by IE6. + * * "https://example.com" is saved as "example.com:443" + * * "https://example.com:666" is saved as "example.com:666". Thus, for + * non-standard ports we don't know the right scheme, so create both. + * + * - an empty or missing "realm" in the WWW-Authenticate reply is stored + * as just an empty string by IE6. + * + * - IE6 will store logins where one or both (!) of the username/password + * is left blank. We don't support logins without a password, so these + * logins won't be added [addLogin() will throw]. + * + * - IE6 won't recognize a URL with and embedded username/password (eg + * http://user@example.com, http://user:pass@example.com), so these + * shouldn't be encountered. + * + * - Our migration code doesn't extract non-HTTP logins (eg, FTP). So + * they shouldn't be encountered here. (Verified by saving FTP logins + * in IE and then importing in Firefox.) + * + * + * FORM LOGINS: + * - hostname is "http://site.com" or "https://site.com". + * * scheme always included + * * default port not included + * - port numbers, even for non-standard posts, are never present! + * unfortunately, this means logins will only work on the default + * port, because we don't know what the original was (or even that + * it wasn't originally stored for the original port). + * - Logins are stored without a field name by IE, but we look one up + * in the migrator for the username. The password field name will + * always be empty-string. + */ + migrateAndAddLogin : function (aLogin) { + // Initialize outself on the first call + if (!this._migrationLoginManager) { + // Connect to the correct preferences branch. + this._prefBranch = Cc["@mozilla.org/preferences-service;1"]. + getService(Ci.nsIPrefService); + this._prefBranch = this._prefBranch.getBranch("signon."); + this._prefBranch.QueryInterface(Ci.nsIPrefBranch2); + + this._debug = this._prefBranch.getBoolPref("debug"); + + this._migrationLoginManager = Cc["@mozilla.org/login-manager;1"]. + getService(Ci.nsILoginManager); + } + + this.log("Migrating login for " + aLogin.hostname); + + // The IE login is in the same format as the old password + // manager entries, so just reuse that code. + var logins = this._upgrade_entry_to_2E(aLogin); + + // Add logins via the login manager (and not this.addLogin), + // lest an alternative storage module be in use. + for each (var login in logins) + this._migrationLoginManager.addLogin(login); + } }; // end of nsLoginManagerStorage_legacy implementation var component = [LoginManagerStorage_legacy]; diff --git a/toolkit/components/passwordmgr/test/unit/test_storage_legacy_5.js b/toolkit/components/passwordmgr/test/unit/test_storage_legacy_5.js new file mode 100644 index 00000000000..0e4605c4c16 --- /dev/null +++ b/toolkit/components/passwordmgr/test/unit/test_storage_legacy_5.js @@ -0,0 +1,151 @@ +/* + * Test suite for storage-Legacy.js -- IE Migration Helper. + * + * This test exercises the migrateAndAddLogin helper interface. + * Although in the real-world it would only be invoked on Windows + * platforms, there's no point in limiting what platforms run + * this test. + * + */ + + +function cloneLogin(src, dst) { + dst.hostname = src.hostname; + dst.formSubmitURL = src.formSubmitURL; + dst.httpRealm = src.httpRealm; + dst.username = src.username; + dst.password = src.password; + dst.usernameField = src.usernameField; + dst.passwordField = src.passwordField; +} + + +function run_test() { + +try { + + +/* ========== 0 ========== */ +var testnum = 0; +var testdesc = "Initial connection to storage module" + +var storage = Cc["@mozilla.org/login-manager/storage/legacy;1"]. + getService(Ci.nsILoginManagerIEMigrationHelper); +if (!storage) + throw "Couldn't create storage instance."; + +var pwmgr = Cc["@mozilla.org/login-manager;1"]. + getService(Ci.nsILoginManager); +if (!pwmgr) + throw "Couldn't create pwmgr instance."; + +// Start with a clean slate +pwmgr.removeAllLogins(); + + +/* ========== 1 ========== */ +testnum++; +var testdesc = "Create nsILoginInfo instances for testing with" + +var testlogin = Cc["@mozilla.org/login-manager/loginInfo;1"]. + createInstance(Ci.nsILoginInfo); +var reflogin = Cc["@mozilla.org/login-manager/loginInfo;1"]. + createInstance(Ci.nsILoginInfo); +var reflogin2 = Cc["@mozilla.org/login-manager/loginInfo;1"]. + createInstance(Ci.nsILoginInfo); + + +/* ========== 2 ========== */ +testnum++; + +testdesc = "http auth, port 80"; +testlogin.init("example.com:80", null, "Port 80", + "username", "password", "", ""); +cloneLogin(testlogin, reflogin); +reflogin.hostname = "http://example.com"; + +storage.migrateAndAddLogin(testlogin); +do_check_eq(testlogin.hostname, "http://example.com"); + +LoginTest.checkStorageData(pwmgr, [], [reflogin]); +pwmgr.removeAllLogins(); + +/* ========== 3 ========== */ +testnum++; + +testdesc = "http auth, port 443"; +testlogin.init("example.com:443", null, "Port 443", + "username", "password", "", ""); +cloneLogin(testlogin, reflogin); +reflogin.hostname = "https://example.com"; + +storage.migrateAndAddLogin(testlogin); +do_check_eq(testlogin.hostname, "https://example.com"); + +LoginTest.checkStorageData(pwmgr, [], [reflogin]); +pwmgr.removeAllLogins(); + +/* ========== 4 ========== */ +testnum++; + +testdesc = "http auth, port 4242"; +testlogin.init("example.com:4242", null, "Port 4242", + "username", "password", "", ""); +cloneLogin(testlogin, reflogin); +cloneLogin(testlogin, reflogin2); +reflogin.hostname = "http://example.com:4242"; +reflogin2.hostname = "https://example.com:4242"; +storage.migrateAndAddLogin(testlogin); + +// scheme is ambigious, so 2 logins are created. +LoginTest.checkStorageData(pwmgr, [], [reflogin, reflogin2]); +pwmgr.removeAllLogins(); + +/* ========== 5 ========== */ +testnum++; + +testdesc = "http auth, port 80, no realm"; +testlogin.init("example.com:80", null, "", + "username", "password", "", ""); +cloneLogin(testlogin, reflogin); +reflogin.hostname = "http://example.com"; +reflogin.httpRealm = "http://example.com"; + +storage.migrateAndAddLogin(testlogin); +do_check_eq(testlogin.httpRealm, "http://example.com"); +LoginTest.checkStorageData(pwmgr, [], [reflogin]); +pwmgr.removeAllLogins(); + +/* ========== 6 ========== */ +testnum++; + +testdesc = "form auth, http"; +testlogin.init("http://example.com", "", null, + "username", "password", "uname", ""); +cloneLogin(testlogin, reflogin); +// nothing changes, so no need to edit reflogin + +storage.migrateAndAddLogin(testlogin); +LoginTest.checkStorageData(pwmgr, [], [reflogin]); +pwmgr.removeAllLogins(); + +/* ========== 7 ========== */ +testnum++; + +testdesc = "form auth, https"; +testlogin.init("https://example.com", "", null, + "username", "password", "uname", ""); +cloneLogin(testlogin, reflogin); +// nothing changes, so no need to edit reflogin + +storage.migrateAndAddLogin(testlogin); +LoginTest.checkStorageData(pwmgr, [], [reflogin]); +pwmgr.removeAllLogins(); + + +/* ========== end ========== */ +} catch (e) { + throw ("FAILED in test #" + testnum + " -- " + testdesc + ": " + e); +} + +}; From 5d843edc37e938991b4b99e38ecb0f1522bd1f5a Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Tue, 6 May 2008 06:06:54 -0700 Subject: [PATCH 39/98] Disable this test since it's failing sporadically (bug 432425) --- browser/base/content/test/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser/base/content/test/Makefile.in b/browser/base/content/test/Makefile.in index b07b61b8b6e..e6ca5ebf028 100644 --- a/browser/base/content/test/Makefile.in +++ b/browser/base/content/test/Makefile.in @@ -49,7 +49,8 @@ _TEST_FILES = test_feed_discovery.html \ bug395533-data.txt \ $(NULL) -# browser_bug423833.js disabled temporarily since it's unreliable +# browser_bug423833.js disabled temporarily since it's unreliable: bug 428712 +# browser_sanitize-download-history.js disabled temporarily since it's unreliable: bug 432425 _BROWSER_FILES = browser_bug321000.js \ browser_bug405137.js \ browser_bug409481.js \ @@ -58,7 +59,6 @@ _BROWSER_FILES = browser_bug321000.js \ autodiscovery.html \ moz.png \ browser_getshortcutoruri.js \ - browser_sanitize-download-history.js \ $(NULL) ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) From 011dc03f5a6463271f5da0a070de0471ce5867a1 Mon Sep 17 00:00:00 2001 From: "mconnor@steelgryphon.com" Date: Tue, 6 May 2008 06:40:22 -0700 Subject: [PATCH 40/98] bug 399640 - update credits for Firefox 3. fix name misspelling --- browser/base/content/credits.xhtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/base/content/credits.xhtml b/browser/base/content/credits.xhtml index 744e09e6e66..b7af61e6af2 100644 --- a/browser/base/content/credits.xhtml +++ b/browser/base/content/credits.xhtml @@ -284,7 +284,7 @@
  • Steve England
  • Madhava Enros
  • Behdad Esfahbod
  • -
  • Eleka Etimad
  • +
  • Elika Etemad
  • Anthony Evans
  • Jason Evans
  • Alex Faaborg
  • From aec9f367db274fad2e411b0d68531c9aba35114a Mon Sep 17 00:00:00 2001 From: "stefanh@inbox.com" Date: Tue, 6 May 2008 10:10:03 -0700 Subject: [PATCH 41/98] Bug 411226 - Migrate SeaMonkey's smart browsing preferences to new pref window (also rename panel to 'Location Bar'). r=IanN, sr=Neil. --- embedding/config/xulprefs.mn | 4 ---- .../autocomplete/resources/content/autocomplete.xml | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/embedding/config/xulprefs.mn b/embedding/config/xulprefs.mn index f4a394b421a..fd0b1144a82 100644 --- a/embedding/config/xulprefs.mn +++ b/embedding/config/xulprefs.mn @@ -98,9 +98,5 @@ locale/XXXX/communicator/pref/preftree.dtd, XXXX/locale/XXXX/communicator/pref/p locale/XXXX/communicator/pref/pref.dtd, XXXX/locale/XXXX/communicator/pref/pref.dtd locale/XXXX/communicator/pref/pref-mousewheel.dtd, XXXX/locale/XXXX/communicator/pref/pref-mousewheel.dtd locale/XXXX/communicator/pref/pref-winhooks.dtd, XXXX/locale/XXXX/communicator/pref/pref-winhooks.dtd -locale/XXXX/communicator/pref/autocomplete-autofill-on.gif, XXXX/locale/XXXX/communicator/pref/autocomplete-autofill-on.gif -locale/XXXX/communicator/pref/autocomplete-autofill-off.gif, XXXX/locale/XXXX/communicator/pref/autocomplete-autofill-off.gif -locale/XXXX/communicator/pref/autocomplete-showpopup.gif, XXXX/locale/XXXX/communicator/pref/autocomplete-showpopup.gif -locale/XXXX/communicator/pref/autocomplete-showsearch.gif, XXXX/locale/XXXX/communicator/pref/autocomplete-showsearch.gif locale/XXXX/global/dialog.properties, XXXX/locale/XXXX/global/dialog.properties. diff --git a/xpfe/components/autocomplete/resources/content/autocomplete.xml b/xpfe/components/autocomplete/resources/content/autocomplete.xml index ab144d5c890..fe6815b1e75 100644 --- a/xpfe/components/autocomplete/resources/content/autocomplete.xml +++ b/xpfe/components/autocomplete/resources/content/autocomplete.xml @@ -1124,7 +1124,7 @@ = this.minResultsForPopup || this.mFailureItems)) { var w = this.boxObject.width; @@ -1151,7 +1151,7 @@ Date: Tue, 6 May 2008 10:40:41 -0700 Subject: [PATCH 42/98] Bug 431900 - Add a commandline flag to make assertions fatal, for easy use in tinderbox scripts and the like, especially if we eventually set up a run of all the tests that don't trigger assertions and then run them with this argument specified. r=sayrer, a=testonlychange --- testing/mochitest/runtests.py.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/testing/mochitest/runtests.py.in b/testing/mochitest/runtests.py.in index 9d61667feae..0b2f751b4f9 100644 --- a/testing/mochitest/runtests.py.in +++ b/testing/mochitest/runtests.py.in @@ -175,6 +175,12 @@ class MochitestOptions(optparse.OptionParser): "than the given number") defaults["leakThreshold"] = 1.0e3000 + self.add_option("--fatal-assertions", + action = "store_true", dest = "fatalAssertions", + help = "abort testing whenever an assertion is hit " + "(requires a debug build to be effective)") + defaults["fatalAssertions"] = False + # -h, --help are automatically handled by OptionParser self.set_defaults(**defaults) @@ -333,6 +339,9 @@ Are you executing $objdir/_tests/testing/mochitest/runtests.py?""" browserEnv["XPCOM_MEM_BLOAT_LOG"] = LEAK_REPORT_FILE + if options.fatalAssertions: + browserEnv["XPCOM_DEBUG_BREAK"] = "stack-and-abort" + start = automation.runApp(testURL, browserEnv, options.app, PROFILE_DIRECTORY, options.browserArgs) From 7b1dc54fea84c62bfdfe63144431496f5ff013d1 Mon Sep 17 00:00:00 2001 From: "Olli.Pettay@helsinki.fi" Date: Tue, 6 May 2008 10:46:55 -0700 Subject: [PATCH 43/98] Bug 430858, Composer is unusable (can't type anything in the window etc), r+sr=peterv, a=beltzner --- editor/composer/src/nsEditingSession.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/editor/composer/src/nsEditingSession.cpp b/editor/composer/src/nsEditingSession.cpp index 80107814e76..56862f20207 100644 --- a/editor/composer/src/nsEditingSession.cpp +++ b/editor/composer/src/nsEditingSession.cpp @@ -1025,12 +1025,22 @@ nsEditingSession::EndDocumentLoad(nsIWebProgress *aWebProgress, if (makeEditable) { - // do we already have an editor here? - nsCOMPtr editor; - rv = editorDocShell->GetEditor(getter_AddRefs(editor)); - if (NS_FAILED(rv)) - return rv; - if (!editor) + // To keep pre Gecko 1.9 behavior, setup editor always when + // mMakeWholeDocumentEditable. + PRBool needsSetup; + if (mMakeWholeDocumentEditable) { + needsSetup = PR_TRUE; + } else { + // do we already have an editor here? + nsCOMPtr editor; + rv = editorDocShell->GetEditor(getter_AddRefs(editor)); + if (NS_FAILED(rv)) + return rv; + + needsSetup = !editor; + } + + if (needsSetup) { mCanCreateEditor = PR_FALSE; rv = SetupEditorOnWindow(domWindow); From 266b2a9a372afde9a4f032d13725242a1a3866d3 Mon Sep 17 00:00:00 2001 From: "alqahira@ardisson.org" Date: Tue, 6 May 2008 10:52:26 -0700 Subject: [PATCH 44/98] Bug 420659 - initial Mochitest support for running Camino. r=jwalden, a=test-only, Camino-only --- build/pgo/Makefile.in | 10 ++++++++++ build/pgo/automation.py.in | 13 +++++++++++-- testing/mochitest/Makefile.in | 10 ++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/build/pgo/Makefile.in b/build/pgo/Makefile.in index 4a54d75cc40..bb63b3c27fb 100644 --- a/build/pgo/Makefile.in +++ b/build/pgo/Makefile.in @@ -62,6 +62,9 @@ else PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX) endif +ifeq ($(MOZ_BUILD_APP),camino) +browser_path = \"$(DIST)/Camino.app/Contents/MacOS/Camino\" +else ifeq ($(OS_ARCH),Darwin) ifdef MOZ_DEBUG browser_path = \"$(DIST)/$(MOZ_APP_DISPLAYNAME)Debug.app/Contents/MacOS/$(PROGRAM)\" @@ -71,6 +74,7 @@ endif else browser_path = \"$(DIST)/bin/$(PROGRAM)\" endif +endif AUTOMATION_PPARGS = \ -DBROWSER_PATH=$(browser_path) \ @@ -83,6 +87,12 @@ else AUTOMATION_PPARGS += -DIS_MAC=0 endif +ifeq ($(MOZ_BUILD_APP),camino) +AUTOMATION_PPARGS += -DIS_CAMINO=1 +else +AUTOMATION_PPARGS += -DIS_CAMINO=0 +endif + ifeq ($(host_os), cygwin) AUTOMATION_PPARGS += -DIS_CYGWIN=1 endif diff --git a/build/pgo/automation.py.in b/build/pgo/automation.py.in index 2a0f6d7deec..bc2e12184a5 100644 --- a/build/pgo/automation.py.in +++ b/build/pgo/automation.py.in @@ -120,6 +120,7 @@ unprivilegedServers = [ #else IS_CYGWIN = False #endif +#expand IS_CAMINO = __IS_CAMINO__ != 0 UNIXISH = not IS_WIN32 and not IS_MAC @@ -242,6 +243,8 @@ user_pref("accessibility.typeaheadfind.autostart", false); user_pref("javascript.options.showInConsole", true); user_pref("layout.debug.enable_data_xbl", true); user_pref("browser.EULA.override", true); + +user_pref("camino.warn_when_closing", false); // Camino-only, harmless to others """ prefs.append(part) @@ -286,6 +289,8 @@ function FindProxyForURL(url, host) part = """ user_pref("network.proxy.type", 2); user_pref("network.proxy.autoconfig_url", "%(pacURL)s"); + +user_pref("camino.use_system_proxy_settings", false); // Camino-only, harmless to others """ % {"pacURL": pacURL} prefs.append(part) @@ -306,7 +311,7 @@ def runApp(testURL, env, app, profileDir, extraArgs): # now run with the profile we created cmd = app - if IS_MAC and not cmd.endswith("-bin"): + if IS_MAC and not IS_CAMINO and not cmd.endswith("-bin"): cmd += "-bin" cmd = os.path.abspath(cmd) @@ -319,7 +324,11 @@ def runApp(testURL, env, app, profileDir, extraArgs): else: profileDirectory = profileDir + "/" - args.extend(("-no-remote", "-profile", profileDirectory, testURL)) + args.extend(("-no-remote", "-profile", profileDirectory)) + if IS_CAMINO: + args.extend(("-url", testURL)) + else: + args.append((testURL)) args.extend(extraArgs) proc = Process(cmd, args, env = env) log.info("Application pid: %d", proc.pid) diff --git a/testing/mochitest/Makefile.in b/testing/mochitest/Makefile.in index d35815774af..a67103f5a5d 100644 --- a/testing/mochitest/Makefile.in +++ b/testing/mochitest/Makefile.in @@ -80,6 +80,9 @@ else PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX) endif +ifeq ($(MOZ_BUILD_APP),camino) +browser_path = \"../$(DIST)/Camino.app/Contents/MacOS/Camino\" +else ifeq ($(OS_ARCH),Darwin) ifdef MOZ_DEBUG browser_path = \"../$(DIST)/$(MOZ_APP_DISPLAYNAME)Debug.app/Contents/MacOS/$(PROGRAM)\" @@ -89,6 +92,7 @@ endif else browser_path = \"../$(DIST)/bin/$(PROGRAM)\" endif +endif # These go in _tests/ so they need to go up an extra path segement TEST_DRIVER_PPARGS = \ @@ -102,6 +106,12 @@ else TEST_DRIVER_PPARGS += -DIS_MAC=0 endif +ifeq ($(MOZ_BUILD_APP),camino) +TEST_DRIVER_PPARGS += -DIS_CAMINO=1 +else +TEST_DRIVER_PPARGS += -DIS_CAMINO=0 +endif + ifeq ($(host_os), cygwin) TEST_DRIVER_PPARGS += -DIS_CYGWIN=1 endif From 8daa231d090ff6200a90f336acd4bfb3893e1bd7 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Tue, 6 May 2008 11:52:09 -0700 Subject: [PATCH 45/98] Bug 432427: update 'download history' checkbox state to correctly reflect dependency on 'browsing history' checkbox, r=dietrich, a=beltzner --- browser/base/content/sanitize.xul | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/browser/base/content/sanitize.xul b/browser/base/content/sanitize.xul index 50f20ba4ae5..97dd04a2108 100644 --- a/browser/base/content/sanitize.xul +++ b/browser/base/content/sanitize.xul @@ -114,15 +114,34 @@ return undefined; }, + onReadDownloads: function (aEvent) + { + // Call the common function that will update the accept button if needed + this.onReadGeneric(); + + let historyPref = document.getElementById("privacy.item.history") + let downloadPref = document.getElementById("privacy.item.downloads"); + + // Disable the checkbox if history is selected + let downloads = document.getElementById("downloads-checkbox"); + downloads.disabled = historyPref.value; + + // The "Download History" checkbox is selected if either of the history or + // downloads preferences are true. + return historyPref.value || downloadPref.value; + }, + updateDownloadHistory: function () { // When toggling history, we automatically clear download history too, - // so we disable that control. + // so we disable that control and set its value to true. let downloads = document.getElementById("downloads-checkbox"); let history = document.getElementById("history-checkbox"); let s = new Sanitizer(); downloads.disabled = history.checked || !s.canClearItem("downloads"); + if (history.checked) + downloads.checked = true; }, }; ]]> @@ -152,7 +171,7 @@ label="&itemDownloads.label;" accesskey="&itemDownloads.accesskey;" preference="privacy.item.downloads" - onsyncfrompreference="return gSanitizePromptDialog.onReadGeneric();"/> + onsyncfrompreference="return gSanitizePromptDialog.onReadDownloads();"/> Date: Tue, 6 May 2008 12:21:10 -0700 Subject: [PATCH 46/98] Bug 407443 - menus for query based folders (smart bookmarks, saved searches) not refreshed after deleting an item (for mak77@supereva.it, r=dietrich, a=schrep) --- browser/components/places/content/menu.xml | 11 +++++++---- browser/components/places/content/toolbar.xml | 16 +++++++++++++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/browser/components/places/content/menu.xml b/browser/components/places/content/menu.xml index 6307b5381b7..2a6b3757d5b 100755 --- a/browser/components/places/content/menu.xml +++ b/browser/components/places/content/menu.xml @@ -819,10 +819,13 @@ } } - if (popupToRebuild) - popupToRebuild._built = false; - else - this._self._built = false; + if (!popupToRebuild) + popupToRebuild = this._self; + popupToRebuild._built = false; + + // if the menupopup is open we should live-update it + if (popupToRebuild.parentNode.open) + this._self._rebuild(popupToRebuild); }, invalidateAll: function PMV_invalidateAll() { diff --git a/browser/components/places/content/toolbar.xml b/browser/components/places/content/toolbar.xml index 69efae46c58..4df2eff0a12 100755 --- a/browser/components/places/content/toolbar.xml +++ b/browser/components/places/content/toolbar.xml @@ -654,8 +654,13 @@ } } - if (popupToRebuild) + if (popupToRebuild) { popupToRebuild._built = false; + + // if the menupopup is open we should live-update it + if (popupToRebuild.parentNode.open) + this._self._rebuildPopup(popupToRebuild); + } }, invalidateAll: function TV_V_invalidateAll() { @@ -1025,9 +1030,14 @@ + + + + Date: Tue, 6 May 2008 12:21:39 -0700 Subject: [PATCH 47/98] Adding test. --- content/html/content/test/Makefile.in | 1 + content/html/content/test/test_bug295561.html | 87 +++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 content/html/content/test/test_bug295561.html diff --git a/content/html/content/test/Makefile.in b/content/html/content/test/Makefile.in index d5b41991df5..834f57642d6 100644 --- a/content/html/content/test/Makefile.in +++ b/content/html/content/test/Makefile.in @@ -70,6 +70,7 @@ _TEST_FILES = test_bug589.html \ bug277890_iframe.html \ bug277890_load.html \ test_bug277890.html \ + test_bug295561.html \ test_bug300691-1.html \ test_bug300691-2.html \ test_bug300691-3.xhtml \ diff --git a/content/html/content/test/test_bug295561.html b/content/html/content/test/test_bug295561.html new file mode 100644 index 00000000000..1eed945e328 --- /dev/null +++ b/content/html/content/test/test_bug295561.html @@ -0,0 +1,87 @@ + + + + + Test for Bug 295561 + + + + + +Mozilla Bug 295561 +

    + +
    +
    +
    + + From 29833bf9db104f910f7d95686cd317bc358686ea Mon Sep 17 00:00:00 2001 From: "nrthomas@gmail.com" Date: Tue, 6 May 2008 13:20:55 -0700 Subject: [PATCH 48/98] Bug 428063, update all the CO_TAG's in client.mk, r=bhearsum --- tools/release/Bootstrap/Step/Tag/Bump.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/release/Bootstrap/Step/Tag/Bump.pm b/tools/release/Bootstrap/Step/Tag/Bump.pm index a740190abdf..18798ef6f8d 100644 --- a/tools/release/Bootstrap/Step/Tag/Bump.pm +++ b/tools/release/Bootstrap/Step/Tag/Bump.pm @@ -101,9 +101,9 @@ sub Execute { 'NSPR_CO_TAG = ' . $releaseTag, '^NSS_CO_TAG\s+=\s+\w*' => 'NSS_CO_TAG = ' . $releaseTag, - '^LOCALES_CO_TAG\s+=\s+' . $branchTag . '$' => + '^LOCALES_CO_TAG\s+=\s+' => 'LOCALES_CO_TAG = ' . $releaseTag, - '^LDAPCSDK_CO_TAG\s+=\s+' . $branchTag . '$' => + '^LDAPCSDK_CO_TAG\s+=\s+' => 'LDAPCSDK_CO_TAG = ' . $releaseTag); } elsif ($fileName eq $moduleVer) { $preVersion = $appVersion . 'pre'; From 41cc75cf2ea7ec91773f831c8d97c7a270091aa3 Mon Sep 17 00:00:00 2001 From: "jst@mozilla.org" Date: Tue, 6 May 2008 13:49:30 -0700 Subject: [PATCH 49/98] Fixing bug 430802 (and bug 405357). Prevent plugin instantiation code re-entrancy. r=jwatt@jwatt.org, sr=bzbarsky@mit.edu, a=beltzner --- content/base/src/nsObjectLoadingContent.cpp | 15 ++++++- layout/generic/nsObjectFrame.cpp | 43 +++++++++++++++------ layout/generic/nsObjectFrame.h | 2 +- 3 files changed, 47 insertions(+), 13 deletions(-) diff --git a/content/base/src/nsObjectLoadingContent.cpp b/content/base/src/nsObjectLoadingContent.cpp index 3f04456f057..0ca670a1167 100644 --- a/content/base/src/nsObjectLoadingContent.cpp +++ b/content/base/src/nsObjectLoadingContent.cpp @@ -1666,6 +1666,15 @@ nsObjectLoadingContent::Instantiate(nsIObjectFrame* aFrame, { NS_ASSERTION(aFrame, "Must have a frame here"); + // We're instantiating now, invalidate any pending async instantiate + // calls. + mPendingInstantiateEvent = nsnull; + + // Mark that we're instantiating now so that we don't end up + // re-entering instantiation code. + PRBool oldInstantiatingValue = mInstantiating; + mInstantiating = PR_TRUE; + nsCString typeToUse(aMIMEType); if (typeToUse.IsEmpty() && aURI) { IsPluginEnabledByExtension(aURI, typeToUse); @@ -1687,7 +1696,11 @@ nsObjectLoadingContent::Instantiate(nsIObjectFrame* aFrame, NS_ASSERTION(aURI || !typeToUse.IsEmpty(), "Need a URI or a type"); LOG(("OBJLC [%p]: Calling [%p]->Instantiate(<%s>, %p)\n", this, aFrame, typeToUse.get(), aURI)); - return aFrame->Instantiate(typeToUse.get(), aURI); + nsresult rv = aFrame->Instantiate(typeToUse.get(), aURI); + + mInstantiating = oldInstantiatingValue; + + return rv; } nsresult diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 3b64a1afddf..344f6224c0e 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -581,7 +581,7 @@ nsObjectFrame::Init(nsIContent* aContent, nsIFrame* aParent, nsIFrame* aPrevInFlow) { - mInstantiating = PR_FALSE; + mPreventInstantiation = PR_FALSE; PR_LOG(nsObjectFrameLM, PR_LOG_DEBUG, ("Initializing nsObjectFrame %p for content %p\n", this, aContent)); @@ -592,7 +592,7 @@ nsObjectFrame::Init(nsIContent* aContent, void nsObjectFrame::Destroy() { - NS_ASSERTION(!mInstantiating, "about to crash due to bug 136927"); + NS_ASSERTION(!mPreventInstantiation, "about to crash due to bug 136927"); // we need to finish with the plugin before native window is destroyed // doing this in the destructor is too late. @@ -831,6 +831,9 @@ nsObjectFrame::InstantiatePlugin(nsIPluginHost* aPluginHost, const char* aMimeType, nsIURI* aURI) { + NS_ASSERTION(mPreventInstantiation, + "Instantiation should be prevented here!"); + // If you add early return(s), be sure to balance this call to // appShell->SuspendNative() with additional call(s) to // appShell->ReturnNative(). @@ -839,9 +842,6 @@ nsObjectFrame::InstantiatePlugin(nsIPluginHost* aPluginHost, appShell->SuspendNative(); } - NS_PRECONDITION(!mInstantiating, "How did that happen?"); - mInstantiating = PR_TRUE; - NS_ASSERTION(mContent, "We should have a content node."); nsIDocument* doc = mContent->GetOwnerDoc(); @@ -859,7 +859,6 @@ nsObjectFrame::InstantiatePlugin(nsIPluginHost* aPluginHost, rv = aPluginHost->InstantiateEmbeddedPlugin(aMimeType, aURI, mInstanceOwner); } - mInstantiating = PR_FALSE; if (appShell) { appShell->ResumeNative(); @@ -1639,7 +1638,7 @@ nsObjectFrame::PrepareInstanceOwner() nsresult nsObjectFrame::Instantiate(nsIChannel* aChannel, nsIStreamListener** aStreamListener) { - if (mInstantiating) { + if (mPreventInstantiation) { return NS_OK; } @@ -1656,10 +1655,12 @@ nsObjectFrame::Instantiate(nsIChannel* aChannel, nsIStreamListener** aStreamList // This must be done before instantiating the plugin FixupWindow(mRect.Size()); - NS_ASSERTION(!mInstantiating, "Say what?"); - mInstantiating = PR_TRUE; + NS_ASSERTION(!mPreventInstantiation, "Say what?"); + mPreventInstantiation = PR_TRUE; rv = pluginHost->InstantiatePluginForChannel(aChannel, mInstanceOwner, aStreamListener); - mInstantiating = PR_FALSE; + NS_ASSERTION(mPreventInstantiation, + "Instantiation should still be prevented!"); + mPreventInstantiation = PR_FALSE; return rv; } @@ -1671,7 +1672,7 @@ nsObjectFrame::Instantiate(const char* aMimeType, nsIURI* aURI) ("nsObjectFrame::Instantiate(%s) called on frame %p\n", aMimeType, this)); - if (mInstantiating) { + if (mPreventInstantiation) { return NS_OK; } @@ -1691,6 +1692,8 @@ nsObjectFrame::Instantiate(const char* aMimeType, nsIURI* aURI) return rv; mInstanceOwner->SetPluginHost(pluginHost); + mPreventInstantiation = PR_TRUE; + rv = InstantiatePlugin(pluginHost, aMimeType, aURI); // finish up @@ -1699,6 +1702,11 @@ nsObjectFrame::Instantiate(const char* aMimeType, nsIURI* aURI) CallSetWindow(); } + NS_ASSERTION(mPreventInstantiation, + "Instantiation should still be prevented!"); + + mPreventInstantiation = PR_FALSE; + return rv; } @@ -1921,6 +1929,11 @@ nsObjectFrame::StopPluginInternal(PRBool aDelayedStop) // get reinstantiated we'll send the right messages to the plug-in. mWindowlessRect.Empty(); + PRBool oldVal = mPreventInstantiation; + mPreventInstantiation = PR_TRUE; + + nsWeakFrame weakFrame(this); + #ifdef XP_WIN if (aDelayedStop) { // If we're asked to do a delayed stop it means we're stopping the @@ -1942,6 +1955,14 @@ nsObjectFrame::StopPluginInternal(PRBool aDelayedStop) DoStopPlugin(owner, aDelayedStop); + // If |this| is still alive, reset mPreventInstantiation. + if (weakFrame.IsAlive()) { + NS_ASSERTION(mPreventInstantiation, + "Instantiation should still be prevented!"); + + mPreventInstantiation = oldVal; + } + // Break relationship between frame and plugin instance owner owner->SetOwner(nsnull); } diff --git a/layout/generic/nsObjectFrame.h b/layout/generic/nsObjectFrame.h index 998b0c50c76..91d2eb1d6f8 100644 --- a/layout/generic/nsObjectFrame.h +++ b/layout/generic/nsObjectFrame.h @@ -196,7 +196,7 @@ private: // For assertions that make it easier to determine if a crash is due // to the underlying problem described in bug 136927, and to prevent // reentry into instantiation. - PRBool mInstantiating; + PRBool mPreventInstantiation; }; From 1070f8fb323ae509409367a841b8122f78ace67e Mon Sep 17 00:00:00 2001 From: "dietrich@mozilla.com" Date: Tue, 6 May 2008 13:58:45 -0700 Subject: [PATCH 50/98] Bug 417228 - Bookmarks outside the three default folders aren't restored (r=mano, a=schrep) --- browser/components/places/content/places.js | 6 +- .../places/src/nsNavHistoryResult.cpp | 11 +- toolkit/components/places/src/utils.js | 137 +++++++----- .../test_417228-exclude-from-backup.js | 139 ++++++++++++ .../bookmarks/test_417228-other-roots.js | 201 ++++++++++++++++++ 5 files changed, 439 insertions(+), 55 deletions(-) create mode 100644 toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js create mode 100644 toolkit/components/places/tests/bookmarks/test_417228-other-roots.js diff --git a/browser/components/places/content/places.js b/browser/components/places/content/places.js index 1f5a1cd76c5..1ff29093f68 100755 --- a/browser/components/places/content/places.js +++ b/browser/components/places/content/places.js @@ -502,7 +502,7 @@ var PlacesOrganizer = { return; try { - PlacesUtils.restoreBookmarksFromJSONFile(aFile); + PlacesUtils.restoreBookmarksFromJSONFile(aFile, [PlacesUIUtils.leftPaneFolderId]); } catch(ex) { this._showErrorAlert(PlacesUIUtils.getString("bookmarksRestoreParseError")); @@ -542,11 +542,11 @@ var PlacesOrganizer = { [date]); if (fp.show() != Ci.nsIFilePicker.returnCancel) { - PlacesUtils.backupBookmarksToFile(fp.file); + PlacesUtils.backupBookmarksToFile(fp.file, [PlacesUIUtils.leftPaneFolderId]); // copy new backup to /backups dir (bug 424389) var latestBackup = PlacesUtils.getMostRecentBackup(); - if (latestBackup != fp.file) { + if (!latestBackup || latestBackup != fp.file) { latestBackup.remove(false); var date = new Date().toLocaleFormat("%Y-%m-%d"); var name = PlacesUtils.getFormattedString("bookmarksArchiveFilename", diff --git a/toolkit/components/places/src/nsNavHistoryResult.cpp b/toolkit/components/places/src/nsNavHistoryResult.cpp index fc5a1da0664..f059fe492b7 100644 --- a/toolkit/components/places/src/nsNavHistoryResult.cpp +++ b/toolkit/components/places/src/nsNavHistoryResult.cpp @@ -4066,10 +4066,13 @@ nsNavHistoryResult::OnBeginUpdateBatch() NS_IMETHODIMP nsNavHistoryResult::OnEndUpdateBatch() { - NS_ASSERTION(mBatchInProgress, "EndUpdateBatch without a begin"); - mBatchInProgress = PR_FALSE; - ENUMERATE_HISTORY_OBSERVERS(OnEndUpdateBatch()); - ENUMERATE_ALL_BOOKMARKS_OBSERVERS(OnEndUpdateBatch()); + if (mBatchInProgress) { + mBatchInProgress = PR_FALSE; + ENUMERATE_HISTORY_OBSERVERS(OnEndUpdateBatch()); + ENUMERATE_ALL_BOOKMARKS_OBSERVERS(OnEndUpdateBatch()); + } + else + NS_WARNING("EndUpdateBatch without a begin"); return NS_OK; } diff --git a/toolkit/components/places/src/utils.js b/toolkit/components/places/src/utils.js index 2e8ba95cc09..de5e78f6567 100644 --- a/toolkit/components/places/src/utils.js +++ b/toolkit/components/places/src/utils.js @@ -998,9 +998,15 @@ var PlacesUtils = { * Restores bookmarks/tags from a JSON file. * WARNING: This method *removes* any bookmarks in the collection before * restoring from the file. + * + * @param aFile + * nsIFile of bookmarks in JSON format to be restored. + * @param aExcludeItems + * Array of root item ids (ie: children of the places root) + * to not delete when restoring. */ restoreBookmarksFromJSONFile: - function PU_restoreBookmarksFromJSONFile(aFile) { + function PU_restoreBookmarksFromJSONFile(aFile, aExcludeItems) { // open file stream var stream = Cc["@mozilla.org/network/file-input-stream;1"]. createInstance(Ci.nsIFileInputStream); @@ -1020,7 +1026,7 @@ var PlacesUtils = { if (jsonStr.length == 0) return; // empty file - this.restoreBookmarksFromJSONString(jsonStr, true); + this.restoreBookmarksFromJSONString(jsonStr, true, aExcludeItems); }, /** @@ -1030,9 +1036,12 @@ var PlacesUtils = { * JSON string of serialized bookmark data. * @param aReplace * Boolean if true, replace existing bookmarks, else merge. + * @param aExcludeItems + * Array of root item ids (ie: children of the places root) + * to not delete when restoring. */ restoreBookmarksFromJSONString: - function PU_restoreBookmarksFromJSONString(aString, aReplace) { + function PU_restoreBookmarksFromJSONString(aString, aReplace, aExcludeItems) { // convert string to JSON var nodes = this.unwrapNodes(aString, this.TYPE_X_MOZ_PLACE_CONTAINER); @@ -1050,57 +1059,81 @@ var PlacesUtils = { _utils: this, nodes: nodes[0].children, runBatched: function restore_runBatched() { + if (aReplace) { + var excludeItems = aExcludeItems || []; + // delete existing children of the root node, excepting: + // 1. special folders: delete the child nodes + // 2. tags folder: untag via the tagging api + var query = this._utils.history.getNewQuery(); + query.setFolders([this._utils.placesRootId], 1); + var options = this._utils.history.getNewQueryOptions(); + options.expandQueries = false; + var root = this._utils.history.executeQuery(query, options).root; + root.containerOpen = true; + var childIds = []; + for (var i = 0; i < root.childCount; i++) { + var childId = root.getChild(i).itemId; + if (excludeItems.indexOf(childId) == -1) + childIds.push(childId); + } + root.containerOpen = false; + + for (var i = 0; i < childIds.length; i++) { + var rootItemId = childIds[i]; + if (rootItemId == this._utils.tagsFolderId) { + // remove tags via the tagging service + var tags = this._utils.tagging.allTags; + var uris = []; + for (let i in tags) { + var tagURIs = this._utils.tagging.getURIsForTag(tags[i]); + for (let j in tagURIs) + this._utils.tagging.untagURI(tagURIs[j], [tags[i]]); + } + } + else if ([this._utils.toolbarFolderId, + this._utils.unfiledBookmarksFolderId, + this._utils.bookmarksMenuFolderId].indexOf(rootItemId) != -1) + this._utils.bookmarks.removeFolderChildren(rootItemId); + else + this._utils.bookmarks.removeItem(rootItemId); + } + } + var searchIds = []; var folderIdMap = []; this.nodes.forEach(function(node) { - var root = node.root; - // FIXME support folders other than known roots - // restoring the library left pane, for example, breaks the library - if (!root) - return; - if (!node.children || node.children.length == 0) return; // nothing to restore for this root - var container = this.placesRootId; // default to places root - switch (root) { - case "bookmarksMenuFolder": - container = this.bookmarksMenuFolderId; - break; - case "tagsFolder": - container = this.tagsFolderId; - break; - case "unfiledBookmarksFolder": - container = this.unfiledBookmarksFolderId; - break; - case "toolbarFolder": - container = this.toolbarFolderId; - break; - } - - if (aReplace) { - if (container != this.tagsFolderId) - this.bookmarks.removeFolderChildren(container); - else { - // remove tags via the tagging service - var tags = this.tagging.allTags; - var uris = []; - tags.forEach(function(aTag) { - var tagURIs = this.tagging.getURIsForTag(aTag); - for (let i in tagURIs) - this.tagging.untagURI(tagURIs[i], [aTag]); - }, this); + if (node.root) { + var container = this.placesRootId; // default to places root + switch (node.root) { + case "bookmarksMenuFolder": + container = this.bookmarksMenuFolderId; + break; + case "tagsFolder": + container = this.tagsFolderId; + break; + case "unfiledBookmarksFolder": + container = this.unfiledBookmarksFolderId; + break; + case "toolbarFolder": + container = this.toolbarFolderId; + break; } + + // insert the data into the db + node.children.forEach(function(child) { + var index = child.index; + var [folders, searches] = this.importJSONNode(child, container, index); + folderIdMap = folderIdMap.concat(folders); + searchIds = searchIds.concat(searches); + }, this); } + else + this.importJSONNode(node, this.placesRootId, node.index); - // insert the data into the db - node.children.forEach(function(child) { - var index = child.index; - var [folders, searches] = this.importJSONNode(child, container, index); - folderIdMap = folderIdMap.concat(folders); - searchIds = searchIds.concat(searches); - }, this); }, this._utils); // fixup imported place: uris that contain folders @@ -1113,7 +1146,7 @@ var PlacesUtils = { }, this._utils); } }; - + this.bookmarks.runInBatchMode(batch, null); }, @@ -1260,9 +1293,13 @@ var PlacesUtils = { * For Example, tags are serialized inline with each bookmark. * @param aResolveShortcuts * Converts folder shortcuts into actual folders. + * @param aExcludeItems + * An array of item ids that should not be written to the backup. */ serializeNodeAsJSONToOutputStream: - function PU_serializeNodeAsJSONToOutputStream(aNode, aStream, aIsUICommand, aResolveShortcuts) { + function PU_serializeNodeAsJSONToOutputStream(aNode, aStream, aIsUICommand, + aResolveShortcuts, + aExcludeItems) { var self = this; function addGenericProperties(aPlacesNode, aJSNode) { @@ -1390,6 +1427,9 @@ var PlacesUtils = { aSourceNode.containerOpen = true; var cc = aSourceNode.childCount; for (var i = 0; i < cc; ++i) { + var childNode = aSourceNode.getChild(i); + if (aExcludeItems && aExcludeItems.indexOf(childNode.itemId) != -1) + continue; if (i != 0) aStream.write(",", 1); serializeNodeToJSONStream(aSourceNode.getChild(i), i); @@ -1439,7 +1479,7 @@ var PlacesUtils = { /** * Serializes bookmarks using JSON, and writes to the supplied file. */ - backupBookmarksToFile: function PU_backupBookmarksToFile(aFile) { + backupBookmarksToFile: function PU_backupBookmarksToFile(aFile, aExcludeItems) { if (aFile.exists() && !aFile.isWritable()) return; // XXX @@ -1469,7 +1509,8 @@ var PlacesUtils = { var result = this.history.executeQuery(query, options); result.root.containerOpen = true; // serialize as JSON, write to stream - this.serializeNodeAsJSONToOutputStream(result.root, streamProxy); + this.serializeNodeAsJSONToOutputStream(result.root, streamProxy, + false, false, aExcludeItems); result.root.containerOpen = false; // close converter and stream diff --git a/toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js b/toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js new file mode 100644 index 00000000000..5ec7043ed83 --- /dev/null +++ b/toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js @@ -0,0 +1,139 @@ +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et: */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Bug 384370 code. + * + * The Initial Developer of the Original Code is Mozilla Corp. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Dietrich Ayala + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +Components.utils.import("resource://gre/modules/utils.js"); +var tests = []; + +/* + +Backup/restore tests example: + +var myTest = { + populate: function () { ... add bookmarks ... }, + validate: function () { ... query for your bookmarks ... } +} + +this.push(myTest); + +*/ + +var test = { + populate: function populate() { + // check initial size + var rootNode = PlacesUtils.getFolderContents(PlacesUtils.placesRootId, + false, false).root; + + var idx = PlacesUtils.bookmarks.DEFAULT_INDEX; + + var testRoot = + PlacesUtils.bookmarks.createFolder(PlacesUtils.placesRootId, + "", idx); + + // create a folder to be restored + this._folderTitle1 = "test folder"; + this._folderId1 = + PlacesUtils.bookmarks.createFolder(testRoot, this._folderTitle1, idx); + + // add a test bookmark + this._testURI = uri("http://test"); + PlacesUtils.bookmarks.insertBookmark(this._folderId1, this._testURI, + idx, "test"); + + // create a folder to be excluded + this._folderTitle2 = "test folder"; + this._folderId2 = + PlacesUtils.bookmarks.createFolder(testRoot, this._folderTitle2, idx); + + // add a test bookmark + PlacesUtils.bookmarks.insertBookmark(this._folderId2, this._testURI, + idx, "test"); + + rootNode.containerOpen = false; + }, + + validate: function validate() { + var rootNode = PlacesUtils.getFolderContents(PlacesUtils.placesRootId, + false, false).root; + + var testRootNode = rootNode.getChild(rootNode.childCount-1); + + testRootNode.QueryInterface(Ci.nsINavHistoryQueryResultNode); + testRootNode.containerOpen = true; + do_check_eq(testRootNode.childCount, 1); + + var childNode = testRootNode.getChild(0); + do_check_eq(childNode.title, this._folderTitle1); + + rootNode.containerOpen = false; + } +} + +function run_test() { + do_check_eq(typeof PlacesUtils, "object"); + + // make json file + var jsonFile = dirSvc.get("ProfD", Ci.nsILocalFile); + jsonFile.append("bookmarks.json"); + if (jsonFile.exists()) + jsonFile.remove(false); + jsonFile.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, 0600); + if (!jsonFile.exists()) + do_throw("couldn't create file: bookmarks.exported.json"); + + // populate db + test.populate(); + + try { + PlacesUtils.backupBookmarksToFile(jsonFile, [test._folderId2]); + } catch(ex) { + do_throw("couldn't export to file: " + ex); + } + + // restore json file + try { + PlacesUtils.restoreBookmarksFromJSONFile(jsonFile); + } catch(ex) { + do_throw("couldn't import the exported file: " + ex); + } + + // validate + test.validate(); + + // clean up + jsonFile.remove(false); +} diff --git a/toolkit/components/places/tests/bookmarks/test_417228-other-roots.js b/toolkit/components/places/tests/bookmarks/test_417228-other-roots.js new file mode 100644 index 00000000000..2be9560d882 --- /dev/null +++ b/toolkit/components/places/tests/bookmarks/test_417228-other-roots.js @@ -0,0 +1,201 @@ +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et: */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Bug 384370 code. + * + * The Initial Developer of the Original Code is Mozilla Corp. + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Dietrich Ayala + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +Components.utils.import("resource://gre/modules/utils.js"); +var tests = []; + +/* + +Backup/restore tests example: + +var myTest = { + populate: function () { ... add bookmarks ... }, + validate: function () { ... query for your bookmarks ... } +} + +this.push(myTest); + +*/ + +tests.push({ + excludeItemsFromRestore: [], + populate: function populate() { + // check initial size + var rootNode = PlacesUtils.getFolderContents(PlacesUtils.placesRootId, + false, false).root; + do_check_eq(rootNode.childCount, 4); + + // create a test root + this._folderTitle = "test folder"; + this._folderId = + PlacesUtils.bookmarks.createFolder(PlacesUtils.placesRootId, + this._folderTitle, + PlacesUtils.bookmarks.DEFAULT_INDEX); + do_check_eq(rootNode.childCount, 5); + + // add a tag + this._testURI = PlacesUtils._uri("http://test"); + this._tags = ["a", "b"]; + PlacesUtils.tagging.tagURI(this._testURI, this._tags); + + // add a child to each root, including our test root + this._roots = [PlacesUtils.bookmarksMenuFolderId, PlacesUtils.toolbarFolderId, + PlacesUtils.unfiledBookmarksFolderId, this._folderId]; + this._roots.forEach(function(aRootId) { + // clean slate + PlacesUtils.bookmarks.removeFolderChildren(aRootId); + // add a test bookmark + PlacesUtils.bookmarks.insertBookmark(aRootId, this._testURI, + PlacesUtils.bookmarks.DEFAULT_INDEX, "test"); + }, this); + + // add a folder to exclude from replacing during restore + // this will still be present post-restore + excludedFolderId = + PlacesUtils.bookmarks.createFolder(PlacesUtils.placesRootId, + "excluded", + PlacesUtils.bookmarks.DEFAULT_INDEX); + do_check_eq(rootNode.childCount, 6); + this.excludeItemsFromRestore.push(excludedFolderId); + + // add a test bookmark to it + PlacesUtils.bookmarks.insertBookmark(excludedFolderId, this._testURI, + PlacesUtils.bookmarks.DEFAULT_INDEX, "test"); + }, + + inbetween: function inbetween() { + // add some items that should be removed by the restore + + // add a folder + this._litterTitle = "otter"; + PlacesUtils.bookmarks.createFolder(PlacesUtils.placesRootId, + this._litterTitle, 0); + + // add some tags + PlacesUtils.tagging.tagURI(this._testURI, ["c", "d"]); + }, + + validate: function validate() { + // validate tags restored + var tags = PlacesUtils.tagging.getTagsForURI(this._testURI, {}); + // also validates that litter tags are gone + do_check_eq(this._tags.toString(), tags.toString()); + + var rootNode = PlacesUtils.getFolderContents(PlacesUtils.placesRootId, + false, false).root; + + // validate litter is gone + do_check_neq(rootNode.getChild(0).title, this._litterTitle); + + // test root count is the same + do_check_eq(rootNode.childCount, 6); + + var foundTestFolder = 0; + for (var i = 0; i < rootNode.childCount; i++) { + var node = rootNode.getChild(i); + + LOG("validating " + node.title); + if (node.itemId != PlacesUtils.tagsFolderId) { + if (node.title == this._folderTitle) { + // check the test folder's properties + do_check_eq(node.type, node.RESULT_TYPE_FOLDER); + do_check_eq(node.title, this._folderTitle); + foundTestFolder++; + } + + // test contents + node.QueryInterface(Ci.nsINavHistoryContainerResultNode).containerOpen = true; + do_check_eq(node.childCount, 1); + var child = node.getChild(0); + do_check_true(PlacesUtils._uri(child.uri).equals(this._testURI)); + + // clean up + node.containerOpen = false; + } + } + do_check_eq(foundTestFolder, 1); + rootNode.containerOpen = false; + } +}); + +function run_test() { + do_check_eq(typeof PlacesUtils, "object"); + + // make json file + var jsonFile = dirSvc.get("ProfD", Ci.nsILocalFile); + jsonFile.append("bookmarks.json"); + if (jsonFile.exists()) + jsonFile.remove(false); + jsonFile.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, 0600); + if (!jsonFile.exists()) + do_throw("couldn't create file: bookmarks.exported.json"); + + // array of ids not to delete when restoring + var excludedItemsFromRestore = []; + + // populate db + tests.forEach(function(aTest) { + aTest.populate(); + // sanity + aTest.validate(); + + if (aTest.excludedItemsFromRestore) + excludedItemsFromRestore = excludedItems.concat(aTest.excludedItemsFromRestore); + }); + + try { + PlacesUtils.backupBookmarksToFile(jsonFile); + } catch(ex) { do_throw("couldn't export to file: " + ex); } + + tests.forEach(function(aTest) { + aTest.inbetween(); + }); + + // restore json file + try { + PlacesUtils.restoreBookmarksFromJSONFile(jsonFile, excludedItemsFromRestore); + } catch(ex) { do_throw("couldn't import the exported file: " + ex); } + + // validate + tests.forEach(function(aTest) { + aTest.validate(); + }); + + // clean up + jsonFile.remove(false); +} From 76d0947d40e331af6a0b368ccf498f6b4151fa2e Mon Sep 17 00:00:00 2001 From: "joshmoz@gmail.com" Date: Tue, 6 May 2008 14:00:59 -0700 Subject: [PATCH 51/98] use native event routing for synthesized key events. b=432405 r/sr=roc a=dsicore --- widget/src/cocoa/nsChildView.mm | 4 ++-- widget/tests/test_keycodes.xul | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index f4f991d43d5..c0b46fee81b 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -1305,8 +1305,8 @@ void nsChildView::SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, PRInt32 currentLayout = gOverrideKeyboardLayout; gOverrideKeyboardLayout = aNativeKeyboardLayout; ChildView* view = static_cast(mView); - [view keyDown:downEvent]; - [view keyUp:upEvent]; + [NSApp sendEvent:downEvent]; + [NSApp sendEvent:upEvent]; // processKeyDownEvent and keyUp block exceptions so we're sure to // reach here to restore gOverrideKeyboardLayout gOverrideKeyboardLayout = currentLayout; diff --git a/widget/tests/test_keycodes.xul b/widget/tests/test_keycodes.xul index d700a6b38c5..a000451660d 100644 --- a/widget/tests/test_keycodes.xul +++ b/widget/tests/test_keycodes.xul @@ -39,6 +39,8 @@ function synthesizeNativeKey(aLayout, aKeyCode, aModifiers, aSystemChars, if (!aWindow) aWindow = window; + document.getElementById("button").focus(); + var utils = aWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor). getInterface(Components.interfaces.nsIDOMWindowUtils); From 6e9dd3cedf8b53775c0bb8ce2693d2d7c32cadd6 Mon Sep 17 00:00:00 2001 From: "nrthomas@gmail.com" Date: Tue, 6 May 2008 14:28:13 -0700 Subject: [PATCH 52/98] Bug 431788, follow up for Tb3.0a1 build1, p=rtessner, r=me --- tools/release/configs/tb-moz19-bootstrap.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/release/configs/tb-moz19-bootstrap.cfg b/tools/release/configs/tb-moz19-bootstrap.cfg index 6871c5e1629..dbdfc0ef4de 100644 --- a/tools/release/configs/tb-moz19-bootstrap.cfg +++ b/tools/release/configs/tb-moz19-bootstrap.cfg @@ -70,14 +70,14 @@ ausServer = aus2-staging.mozilla.org ausServerUrl = https://aus2.mozilla.org buildTree = MozillaRelease # where QA updates/builds go -stagingUser = cltbld +stagingUser = tbirdbld stagingServer = stage-old.mozilla.org # where beta updates/builds go ftpServer = ftp.mozilla.org # where release updates/builds go bouncerServer = download.mozilla.org # username and server to push builds -sshUser = cltbld +sshUser = tbirdbld sshServer = stage-old.mozilla.org useTalkback = 0 useCvsCompression = 1 From eb31e166328deb4ef7693a11dce1f7b186335632 Mon Sep 17 00:00:00 2001 From: "bent.mozilla@gmail.com" Date: Tue, 6 May 2008 14:37:50 -0700 Subject: [PATCH 53/98] Bug 429442 - "crashes [@ nsJSIID::HasInstance][@ XPCNativeSet::FindInterfaceWithIID]". r+sr=jst, a=beltzner. --- dom/src/base/nsDOMClassInfo.cpp | 36 ++++++++++++++++++----- js/src/xpconnect/src/xpcmaps.h | 7 +++++ js/src/xpconnect/src/xpcwrappednative.cpp | 19 ++++++++++++ 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/dom/src/base/nsDOMClassInfo.cpp b/dom/src/base/nsDOMClassInfo.cpp index 6fe4b2017c5..c54556fef82 100644 --- a/dom/src/base/nsDOMClassInfo.cpp +++ b/dom/src/base/nsDOMClassInfo.cpp @@ -8872,11 +8872,22 @@ public: NS_IMETHOD Run() { + JSContext* cx = nsnull; + if (mContext) { + cx = (JSContext*)mContext->GetNativeContext(); + } else { + nsCOMPtr stack = + do_GetService("@mozilla.org/js/xpc/ContextStack;1"); + NS_ENSURE_TRUE(stack, NS_OK); + + stack->GetSafeJSContext(&cx); + NS_ENSURE_TRUE(cx, NS_OK); + } + JSObject* obj = nsnull; mWrapper->GetJSObject(&obj); NS_ASSERTION(obj, "Should never be null"); - nsHTMLPluginObjElementSH::SetupProtoChain( - mWrapper, (JSContext*)mContext->GetNativeContext(), obj); + nsHTMLPluginObjElementSH::SetupProtoChain(mWrapper, cx, obj); return NS_OK; } @@ -9024,15 +9035,24 @@ nsHTMLPluginObjElementSH::PostCreate(nsIXPConnectWrappedNative *wrapper, NS_ENSURE_SUCCESS(rv, rv); if (nsContentUtils::IsSafeToRunScript()) { - return SetupProtoChain(wrapper, cx, obj); + rv = SetupProtoChain(wrapper, cx, obj); + + // If SetupProtoChain failed then we're in real trouble. We're about to fail + // PostCreate but it's more than likely that we handed our (now invalid) + // wrapper to someone already. Bug 429442 is an example of the kind of crash + // that can result from such a situation. We'll return NS_OK for the time + // being and hope for the best. + NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "SetupProtoChain failed!"); + return NS_OK; } - nsCOMPtr scriptContext = - GetScriptContextFromJSContext(cx); - NS_ENSURE_TRUE(scriptContext, NS_ERROR_UNEXPECTED); + // This may be null if the JS context is not a DOM context. That's ok, we'll + // use the safe context from XPConnect in the runnable. + nsCOMPtr scriptContext = GetScriptContextFromJSContext(cx); - nsContentUtils::AddScriptRunner( - new nsPluginProtoChainInstallRunner(wrapper, scriptContext)); + nsRefPtr runner = + new nsPluginProtoChainInstallRunner(wrapper, scriptContext); + nsContentUtils::AddScriptRunner(runner); return NS_OK; } diff --git a/js/src/xpconnect/src/xpcmaps.h b/js/src/xpconnect/src/xpcmaps.h index 0b5b8609b90..c0790c3ba34 100644 --- a/js/src/xpconnect/src/xpcmaps.h +++ b/js/src/xpconnect/src/xpcmaps.h @@ -204,6 +204,13 @@ public: inline void Remove(XPCWrappedNative* wrapper) { NS_PRECONDITION(wrapper,"bad param"); +#ifdef DEBUG + XPCWrappedNative* wrapperInMap = Find(wrapper->GetIdentityObject()); + NS_ASSERTION(!wrapperInMap || wrapperInMap == wrapper, + "About to remove a different wrapper with the same " + "nsISupports identity! This will most likely cause serious " + "problems!"); +#endif JS_DHashTableOperate(mTable, wrapper->GetIdentityObject(), JS_DHASH_REMOVE); } diff --git a/js/src/xpconnect/src/xpcwrappednative.cpp b/js/src/xpconnect/src/xpcwrappednative.cpp index 8985e6cfa09..399b8d1b40c 100644 --- a/js/src/xpconnect/src/xpcwrappednative.cpp +++ b/js/src/xpconnect/src/xpcwrappednative.cpp @@ -546,11 +546,27 @@ XPCWrappedNative::GetNewOrUsed(XPCCallContext& ccx, PostCreate(wrapper, ccx, wrapper->GetFlatJSObject()); if(NS_FAILED(rv)) { + // PostCreate failed and that's Very Bad. We'll remove it from + // the map and mark it as invalid, but the PostCreate function + // may have handed the partially-constructed-and-now-invalid + // wrapper to someone before failing. Or, perhaps worse, the + // PostCreate call could have triggered code that reentered + // XPConnect and tried to wrap the same object. In that case + // *we* hand out the invalid wrapper since it is already in our + // map :( + NS_ERROR("PostCreate failed! This is known to cause " + "inconsistent state for some class types and may even " + "cause a crash in combination with a JS GC. Fix the " + "failing PostCreate ASAP!"); + { // scoped lock XPCAutoLock lock(mapLock); map->Remove(wrapper); } + // This would be a good place to tell the wrapper not to remove + // itself from the map when it dies... See bug 429442. + wrapper->Release(); return rv; } @@ -671,6 +687,9 @@ XPCWrappedNative::~XPCWrappedNative() // scoped lock XPCAutoLock lock(GetRuntime()->GetMapLock()); + + // Post-1.9 we should not remove this wrapper from the map if it is + // uninitialized. map->Remove(this); } From 0c68771a39c9e27033a35e873b253dbd05a5f5dc Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Tue, 6 May 2008 14:39:06 -0700 Subject: [PATCH 54/98] Bug 423104: ship en-US spellcheck dictionary README, extracted text by gerv@mozilla.org and handerson@mozilla.com, patch is r=gerv, sr=mconnor, a=beltzner --- toolkit/content/license.html | 91 ++++++++++++++++++++- xpfe/global/resources/content/license.html | 92 +++++++++++++++++++++- 2 files changed, 181 insertions(+), 2 deletions(-) diff --git a/toolkit/content/license.html b/toolkit/content/license.html index 78dfdac1302..aee51deff3e 100644 --- a/toolkit/content/license.html +++ b/toolkit/content/license.html @@ -170,11 +170,12 @@
  • Japan Network Information Centre License
  • Java Embedding Plugin License
  • jemalloc License
  • -
  • OpenVision License
  • Lithuanian Spellchecking Dictionary
  • +
  • OpenVision License
  • Red Hat xdg_user_dir_lookup License
  • Sparkle License
  • University of California License
  • +
  • US English Spellchecking Dictionary
    • @@ -2091,6 +2092,94 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +
      + +

      US English Spellchecking Dictionary

      + +

      This license applies to certain files in the directory + extensions/spellcheck/locales/en-US/hunspell/. (This + code only ships in some localized versions of this product.)

      + +
      +Different parts of the US English dictionary (SCOWL) are subject to the following licenses as 
      +shown below.  For additional details, sources, credits, and public domain references, see 
      +README.txt.
      +The collective work of the Spell Checking Oriented Word Lists (SCOWL) is under the 
      +following copyright:
      +Copyright 2000-2007 by Kevin Atkinson
      +Permission to use, copy, modify, distribute and sell these word lists, the associated scripts, 
      +the output created from the scripts, and its documentation for any purpose is hereby 
      +granted without fee, provided that the above copyright notice appears in all copies and that 
      +both that copyright notice and this permission notice appear in supporting documentation. 
      +Kevin Atkinson makes no representations about the suitability of this array for any 
      +purpose. It is provided  "as is" without express or implied warranty.
      +The WordNet database is under the following copyright:
      +This software and database is being provided to you, the LICENSEE, by Princeton 
      +University under the following license.  By obtaining, using and/or copying this software 
      +and database, you agree that you have read, understood, and will comply with these terms 
      +and conditions:
      +Permission to use, copy, modify and distribute this software and database and its 
      +documentation for any purpose and without fee or royalty is hereby granted, provided that 
      +you agree to comply with the following copyright notice and statements, including the 
      +disclaimer, and that the same appear on ALL copies of the software, database and 
      +documentation, including modifications that you make for internal use or for distribution.
      +WordNet 1.6 Copyright 1997 by Princeton University.  All rights reserved.
      +THIS SOFTWARE AND DATABASE IS PROVIDED "AS IS" AND PRINCETON UNIVERSITY 
      +MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.  BY WAY OF 
      +EXAMPLE, BUT NOT LIMITATION, PRINCETON UNIVERSITY MAKES NO 
      +REPRESENTATIONS OR WARRANTIES OF MERCHANT- ABILITY OR FITNESS FOR ANY 
      +PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE, DATABASE OR 
      +DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, 
      +TRADEMARKS OR OTHER RIGHTS.
      +The name of Princeton University or Princeton may not be used in advertising or publicity 
      +pertaining to distribution of the software and/or database.  Title to copyright in this 
      +software, database and any associated documentation shall at all times remain with 
      +Princeton University and LICENSEE agrees to preserve same.
      +
      +The "UK Advanced Cryptics Dictionary" is under the following copyright:
      +Copyright (c) J Ross Beresford 1993-1999. All Rights Reserved.
      +The following restriction is placed on the use of this publication: if The UK Advanced 
      +Cryptics Dictionary is used in a software package or redistributed in any form, the 
      +copyright notice must be prominently displayed and the text of this document must be 
      +included verbatim.   There are no other restrictions: I would like to see the list distributed 
      +as widely as possible.
      +
      +Various parts are under the Ispell copyright:
      +Copyright 1993, Geoff Kuenning, Granada Hills, CA
      + All rights reserved.   Redistribution and use in source and binary forms, with or without 
      +modification, are permitted provided that the following conditions are met:
      +  1. Redistributions of source code must retain the above copyright notice, this list of 
      +conditions and the following disclaimer.
      +  2. Redistributions in binary form must reproduce the above copyright notice, this list of 
      +conditions and the following disclaimer in the documentation and/or other materials 
      +provided with the distribution.
      +  3. All modifications to the source code must be clearly marked as such.  Binary 
      +redistributions based on modified source code must be clearly marked as modified 
      +versions in the documentation and/or other materials provided with the distribution.
      +  (clause 4 removed with permission from Geoff Kuenning)
      +  5. The name of Geoff Kuenning may not be used to endorse or promote products derived 
      +from this software without specific prior written permission.
      + THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS  IS'' AND 
      +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
      +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
      +PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS 
      +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
      +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
      +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
      +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
      +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
      +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE  
      +POSSIBILITY OF SUCH DAMAGE.
      +
      +Additional Contributors:
      + Alan Beale <biljir@pobox.com>
      + M Cooper <thegrendel@theriver.com>
      +
      + + +

      Expat License

      diff --git a/xpfe/global/resources/content/license.html b/xpfe/global/resources/content/license.html index 0556fdbb3f8..9b41ffbbf0d 100755 --- a/xpfe/global/resources/content/license.html +++ b/xpfe/global/resources/content/license.html @@ -172,11 +172,12 @@
    • Japan Network Information Centre License
    • Java Embedding Plugin License
    • jemalloc License
    • -
    • OpenVision License
    • Lithuanian Spellchecking Dictionary
    • +
    • OpenVision License
    • Red Hat xdg_user_dir_lookup License
    • Sparkle License
    • University of California License
    • +
    • US English Spellchecking Dictionary
      @@ -1901,6 +1902,7 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +

      Breakpad License

      @@ -2071,6 +2073,94 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +
      + +

      US English Spellchecking Dictionary

      + +

      This license applies to certain files in the directory + extensions/spellcheck/locales/en-US/hunspell/. (This + code only ships in some localized versions of this product.)

      + +
      +Different parts of the US English dictionary (SCOWL) are subject to the following licenses as 
      +shown below.  For additional details, sources, credits, and public domain references, see 
      +README.txt.
      +The collective work of the Spell Checking Oriented Word Lists (SCOWL) is under the 
      +following copyright:
      +Copyright 2000-2007 by Kevin Atkinson
      +Permission to use, copy, modify, distribute and sell these word lists, the associated scripts, 
      +the output created from the scripts, and its documentation for any purpose is hereby 
      +granted without fee, provided that the above copyright notice appears in all copies and that 
      +both that copyright notice and this permission notice appear in supporting documentation. 
      +Kevin Atkinson makes no representations about the suitability of this array for any 
      +purpose. It is provided  "as is" without express or implied warranty.
      +The WordNet database is under the following copyright:
      +This software and database is being provided to you, the LICENSEE, by Princeton 
      +University under the following license.  By obtaining, using and/or copying this software 
      +and database, you agree that you have read, understood, and will comply with these terms 
      +and conditions:
      +Permission to use, copy, modify and distribute this software and database and its 
      +documentation for any purpose and without fee or royalty is hereby granted, provided that 
      +you agree to comply with the following copyright notice and statements, including the 
      +disclaimer, and that the same appear on ALL copies of the software, database and 
      +documentation, including modifications that you make for internal use or for distribution.
      +WordNet 1.6 Copyright 1997 by Princeton University.  All rights reserved.
      +THIS SOFTWARE AND DATABASE IS PROVIDED "AS IS" AND PRINCETON UNIVERSITY 
      +MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.  BY WAY OF 
      +EXAMPLE, BUT NOT LIMITATION, PRINCETON UNIVERSITY MAKES NO 
      +REPRESENTATIONS OR WARRANTIES OF MERCHANT- ABILITY OR FITNESS FOR ANY 
      +PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE, DATABASE OR 
      +DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, 
      +TRADEMARKS OR OTHER RIGHTS.
      +The name of Princeton University or Princeton may not be used in advertising or publicity 
      +pertaining to distribution of the software and/or database.  Title to copyright in this 
      +software, database and any associated documentation shall at all times remain with 
      +Princeton University and LICENSEE agrees to preserve same.
      +
      +The "UK Advanced Cryptics Dictionary" is under the following copyright:
      +Copyright (c) J Ross Beresford 1993-1999. All Rights Reserved.
      +The following restriction is placed on the use of this publication: if The UK Advanced 
      +Cryptics Dictionary is used in a software package or redistributed in any form, the 
      +copyright notice must be prominently displayed and the text of this document must be 
      +included verbatim.   There are no other restrictions: I would like to see the list distributed 
      +as widely as possible.
      +
      +Various parts are under the Ispell copyright:
      +Copyright 1993, Geoff Kuenning, Granada Hills, CA
      + All rights reserved.   Redistribution and use in source and binary forms, with or without 
      +modification, are permitted provided that the following conditions are met:
      +  1. Redistributions of source code must retain the above copyright notice, this list of 
      +conditions and the following disclaimer.
      +  2. Redistributions in binary form must reproduce the above copyright notice, this list of 
      +conditions and the following disclaimer in the documentation and/or other materials 
      +provided with the distribution.
      +  3. All modifications to the source code must be clearly marked as such.  Binary 
      +redistributions based on modified source code must be clearly marked as modified 
      +versions in the documentation and/or other materials provided with the distribution.
      +  (clause 4 removed with permission from Geoff Kuenning)
      +  5. The name of Geoff Kuenning may not be used to endorse or promote products derived 
      +from this software without specific prior written permission.
      + THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS  IS'' AND 
      +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
      +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
      +PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS 
      +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
      +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
      +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
      +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
      +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
      +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE  
      +POSSIBILITY OF SUCH DAMAGE.
      +
      +Additional Contributors:
      + Alan Beale <biljir@pobox.com>
      + M Cooper <thegrendel@theriver.com>
      +
      + + +

      Expat License

      From c7da3a5b2c880abc8d741165947798c4d9afa7c9 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Tue, 6 May 2008 14:42:10 -0700 Subject: [PATCH 55/98] Bug 432511: remove unused theme files, a=beltzner --- .../winstripe/browser/siteButtons-aero.png | Bin 6520 -> 0 bytes browser/themes/winstripe/browser/siteButtons.png | Bin 7721 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 browser/themes/winstripe/browser/siteButtons-aero.png delete mode 100644 browser/themes/winstripe/browser/siteButtons.png diff --git a/browser/themes/winstripe/browser/siteButtons-aero.png b/browser/themes/winstripe/browser/siteButtons-aero.png deleted file mode 100644 index 4137bfb998dc22fcdd7319bdd5f3b2c5702d2830..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6520 zcmYjW1z3|``yMs=N4J0yDkVrtryw;z5C$VgcSv^%h?IzQD$?B|IXVXd!bG}J9H}_+ zzs=wGeg9q8yR)5hcFx{&?&rSm^Sp7oAT@FlW)c7ZK(78oP`4gMe7xp=$I8pp~YY3c5tUP|EFL0083`brnSe z|AnnQ(zmysVmTZ9>9!0^!%T{4w8VwO0PxK;HhO2Q%maK4k!)5?moo243vf!{gP zC$}IwC%9il$@kw^$b*$u^H#T|ZTZVJolHpB`Aodv&1q?JR#R>k2$u$N93bhX&0t#h zeXG9y$gB2~lfX*dnv`L6P51S}2gug+Sos`^o;tG!s4CG&6E5bwd|qii1mcIZd7{Ag zX>VzBQE$;rUdiWyhL(8G0`|-vn2iK)#Jw6Nxmy=ORV9hzzazck8(_b)=9lXQZ}5L~ zOV}~(SxOVh3|&SpNIsc&6d*1XNjDAx0D+)TLHc+bdj3b8D5;29!a@!708o0I!Y5Ty zfv5fNAIH-Viex2}KYe4~EC_~?`QBo5BL(7R1)OYi(S}|4l;cohYUN~P8s0ZI6CB#r z2yd7FsQ7B0vUw_XQr=Ys1xm9sF}Y^Tw(~r9dS+=`L4CopKu{sbmkCQUyGuM4RQVJ`GJO zFvpSx{fj;CDR~(g=6pvSfCz#I0J~CFR!$TV0HCM+i92`z1jfAo`)%ImDy*cW zS-%~L4CYUV9zyNiMVV1PM)N6>BHREdfe2z?>GslHw+~~zk6az{aSkV-1dU$O!K*#* zl)Y_FmyFCMr(RVS?U7Jm*H2PFX=zCfY4XWi&uKE>2%eLDOI{v&m}agSSb2!v<{qLs z{p@}r*_+FF))AZUggFJvc1wOY*4pNp=M~rvnKO6)Y)c4QyG<0V_-^G&R#Q1iTC%b( zJHaARO3N3yupa!D;N@IqN;2{NcVAfq+ib+b&f06CMiypyH65O=3)P-`SE1dy)h81S z;2wPOoTFL8wZTDz`|j;}?~yl+)Da5MS0)x?d}$Zmw#GcIqapcT@Iuc$jqMx_BLhRB z2=WBz1hInikHxW|poDC)90eb!vcA#WYwz$jQ~$w*{on&C=>${hY6U#)v^e zL1w1E7r!Bqoc`US@fBUbUl@qPz+BU>RZnzlGJU>(a%#!QaAxq&3wUN>C=``9!=pqI z+gCmxAX>X(yedjySLdZYGj;cMP2aUet2F@Mu5QLrcMO~^>5#px{>77xWERFU4pnRP z=g87Jw>L>;%!Gl&Zi|RYGEs~-0c^5Fls{6-2+7IGZQw#h*n1Q`#)gN%4kZMDacC*v z@TO#$+W#qYzT{z%C3_PytF~vn0>`B%b-I$ZPR9b<1Zd`{hgKdYu}VwGpNzX_JiXWJ zeH;3rESqRx<7hp5^h&;)9aKL#(qRi24M-dJ<27$c5O)6;Kt0Qy7Y|mtLWXRst0xRa z7hXaJ$iz4^jD&QJKjFT&KVkaHpR_eIQ93Og{_ouaZprxX#>&bLq1FdTwYf_2X=Y#C zQYwnjMaS>Ni_6y%GQo1}QH!C?zdbK7ASGxd0>F5qyW$Emc?dZHBn;}1_!9i}#^Ub$fK1W(prk^;Q z2?Q^WA#aD%jYD_Tl5UwjbYC{@flzV_mkWt9M0?hbrRqV=0`AD4)4#9*Y~J|Z263+F zk3|Z9LrL;`vZ7IU(ifZDzpEY>7lr>!?aqRrqZ?SXRLL_wX*NrLYmC<1!ep4nOH|9V z<{{A-()CNFhq12jreouyU<}KY18<$QHi?!x;&DVNtbP;X?#P|jFc7lOTG(VXaDWJG z+5s@^fx$lo8QD2UiYk{%zsjc2=i>L2W+Fj%jf%?b+1}u#n(<*sG8ZVKtQ@s*TIb;c zg+iNZYu%elOVxJ!<7mV(#@kz4{j`99FcV)d*a=-8GKaKf=B^S}%YwIEOv( z4gM~FM)%3!)*e!hJ{ztGU}1!j*zNdco-eb?oQx+)x3?#MpLOk*V2uJ`^$ZGkq%vtm zvUmHSwlYAvku6}Z#g^0kXs^zxH;qz41zvOO1fa8Ee(Su>2^wrT{ov8I$~3I)s>^d@ z3A=1m%NKRO?j0;-IPYcXrn;OCTW0I{Rk`x~pHJXHDVLK`26V_+gK}bG<_ ztt;DEIOc@}XBn>u>0JZmbCw#CCR`zcFKny&#A}0Le@VG+EyiAM)O*FOQV1)JBo7N2V(=|-AVRZT$ zB8=4u!<{Dv(nW?cf+BW=Z#B$GDt{AT5QPNp#cW#s9Im&J_~)$d zNux#9=EQ3a9Smc_e;yuwCdb=bJ36ra?Z-x(naVE%G2#f2t{SDl@~)T3i@_i_gbd2_ z%!oQ{QKTbb(D33SEoSEpImf@e+YGJr=(y28OLkfE+GxBvU*(fG36eN5X;9aSW-7~4U#~^iUhg2py(@F+9HlAqMWCP^JnYO~hbBH$hosmlL$_A2ungaM zwdTt5@->V?pd^+%UWV@1BK`3KAwLwCg^{#{ME)GH8FZOQ-YNiLCI?L~O~c@Nzbl3s zcBk?F(+ieO6Mn(Y=)9%6s`)dXLz~=E{#Wtjql?lEjbag{|0)IuK$aKAKTF$oNcQPT zPZUW&;IT=$f$Ebqb}YZd0~USGptHvW@{7XBCK@~%#2RH<>JSoH7?yluW;PCvncjKX zKlTxSyb`0qO>JC`U2>2tXGjJrDpWjeye{rzvB4?ti`PyT7~WmfLK&gRzl)1I@)`-} zQ(++mYVEszJZqU_XfjHtWA_Zb%cQ?;78sNp7yrB{Ha$`?#2P!v->`Nzb}K&_;WE?b zQUE1vWq?%Ht+^aW@Y;5`=g5!&wr+3D;k^js`}t_jJ6mr`VHo)B%cSHk(Dit|chLPW zvNtN(zn_U;O1?YxrBO2b7r zRc{he9|YYb%Z1dP9I~=%nrv5H45M6@&RhNOjaqa`R$x7WHOz1=?7T;(MlyI4F|XCF z!_KJD@N@EvSav7EW|>UT?)AT3#2Eybv$%+#qv;&#l95X(G(swmH$4(Fx`-Z6F!wS} zPu`aMmLI>hFGbP8MfmWqIMal8bs@>`fyi}E$Qd^WTvIB`CLl6Htn^$A!Fa? zdt6r^>?b-rWv(JIEaEw+-e&!r)5S2rXb_ffOGBSnrGO7_-(;@pr(j0*+pej&5rkS>0uW8Gp5{ zYLqz?ag~R0p42kHs=JgYD*=^!sw+Ntm!JnK%H4Ysbo~Ftr zbI2vQV9_Bhp5WrKopio8W4NG^QozHNzIC3>XM17Srjke*Wui|JV70?Iygn88pyg)w zPRqd|PRrS0XiMn@T}vtH0whRpIY|BDpM#9}Qh>{=T*+K&+hBd9j}*dq#aq zWOFxMn3?35k09n+jP%2^k%aFk7IhP;KnUt7qW?v6K zLPX|cyhxb&oeuh|!Zf*@t`L2qv9CVgM*-XX((x|u?mR9tX-e7VqYl_}tzn)jS+o$M zkuLQs%RfGuHD@0bBWVq&osxlgSybXQ?N=G;0&&Fr0R(inB}SG2xx z+=>vi^ur!x_cx^n1($c_sa`&_6a6vn@UVkUHe<$~1^yu1w(4X#1Mw2AdA@G3YRO?O z@~LFOW;vHX3gusFuSTHxfE z1$Fl~8m1BGEU65V_=Q}akV^ta!GVN>X7 z(yxZn_Wa+b#}XF*i^-;)ru0GY4TeeW0+x7`m3L6KA%`)Z0SX&{C(dF$RzKhx`M+AC zucK$vM2oc=fMuunoaiG9ZlUX!_b_jdtE{=KSs(s#17QGm+3WQ6Dcik4PH+gMOqHwp z!&6Bd-F=LMV8sE?5yI#95{URO_xnbX6Rd#7I$cIk~+@CDIwP20g{sJ z>nB{^gyesYpW9KJw4WFJxa>6oq@pv2;^si{E0IoAqo%nd-wQ;}8ZCYMNW%iwc4faI zEzLFO0GK{3jNI-pDz5BwiReVq1WJf9q%;McGTGFr9kAkmm(Ed2Kf>4kgv&kxpW%dkI{&ZlB) zsB4sWgbH51-P3$c(EsxnN+!G3@reVKhJTD+_7ev-t3>AlsUC-74xzBz5KE2#y|+Jt zuRL8Pi@^2%cWbmf8FcrE(f4j#H`Ih^&;GS7;p@Q4?>3M&N*r#5wGgw~aKEpYdsHgZ2*5oxYUB9(Qu-{uAawPqiyqHA=WI~zqoqkB{TAGSh`bp+52ME=DA$AH@esPr zEx#{-u(bT*pO4m?n;CpVA!*JhESEy*zluvd^>dy*a<7 zxCfnn;FFBRzp(hd*LJZJda*t`P(SG%91~*qF82N9*5CXD+KX8J7V*{gGCGmqD56?f z?Z5qPx|6%Ik8KzZ`470nBmg>%bE`+I^Ga9mZeM9gCpKqMm6A`C25{_@^oK;P*Rx|X zq;-*~W`K7+`8(v4WFky89VV!~SzwjGJQ@<{xs;VR9bIf_UNggmwY&Csb#Viya#stg z)ekQgO+#5iwS#qMnzKm=s7^Xa>CRfR&-cXRs~nrK?zb^@pSNfdd}~@6r07ZFq(+f7 zt3tiJlkk4yQn15$lhfHC6uO3oIdV1LX%T<@4u|%z)EIv2A^{Ayna>hCPj!D4XN34^ z*3(&ICs)%zO3%P@jXpuc2NAr1MIbKfb*^;Mf}8w_A1SGVxX_hMNm0T%6WjRc z6oJ@Vfm260yP??Sa*4)X%|tsx$A^VVt~MnWWBNdas#v2>gXX>{g7^t;Npvm~UbZ3H zs`i?a+S&~aQXE*sGyW5Dr=vUJ(FcLaV6G_c*!?<5Sgvj9-taYNRgjLvkKndc*7LDD zz8+_=D&K(HqYP|$f<98@9AMvI*<=|U}y z4TMX$fn|OErx7M^^{H_C%@!NAUR|m!cha}&Ec|co4(FOF@W+yDLTdOUgl+i@=uu%& z;Q0Z^tq1iSE_|EWI}DE;!i40DbeBIB@)Z>FX@|mW$?xNHhV*hDPu{FEn{JH@cIW(T zmT|<71AZ4}^suFWKppOhLz3}uOebEc#D$>pl+1_-%wG$XUhPi;$P94o)9Jlbjdt?* z5)K?#MmxoNuiwvAH^v(X2e``uZTOZy z_BzrI2+vvO7@@5Jn&6$^QE?%{>JIc@xJex?#=#ia{Zj(onNc9E+SwN-%mYuk?HPLh z*WX+FhGNp6kB^#Nlo|b;gCo!Y?5*!^=j~_dX$t`OFL-H<=x97U9M{&;A=l8>D#r&1 X<`T@-kdo5&@~91Vk9R8;3?jy1P4v1_{A` z2K@f-W39_!%{p`L;qG_8``PD4sH@5m;8NqFpr8;a$V+P?##e~zCpISHw|PJ)4PwA? zlGk@ejPiGvY`2{_@pJbKHIKVu$#F2`at0CQ z^pWQ-eHHRve&yBY)p9-3Z`?m3I4#gVphQP$8Gn64L(^>_TUB<@KkMCnxwt=Dw#ZXS zYiy#UpM6zyefECvX1@8i+wbksy3Tp`MX4boI=`(YVDo!${O0^*Wh=IBC+DxfhQ`L; zll<4eXXTim{J0;V!a4|GA6p%P*J(z}u z!k*j)u&vo3>yQd2Ot=wBoxBzcuJ~5q4b| zN8t_z9X7n!|K6WsP*MzH)>CF~sDq-BbA!u==SCcv((jc` z)xrM|5R89p#oZ|rtnEa+91-O3XZjT;j=!x(1O^4Ytv6F+GbaeF&#qGAd{C`(W$T@? z%HZDv>G2QmuEVk_kMx)`DjKK8vFui-DTJY0YUh7wbZy5jIf9e_R`XS7l5d4M zk&pERERj9YCOA~PK#}y2<9KOnrY<2h)_$B+Q>!6oq*y(ogB2)WLeYl$@b%1C#&1G_ zoCk<4y?JuGVo(w1P?p->q9w`L8gR(7oK%XPn9uf%Ln?YL_Fr zqUP;}dA0G^;kp?g{1Xy=i5&$PUmfEvRxz%DT^A{=&=F7k39+|*jdpi|ZMLG)2i`}H zn1wx&6JTO(knQ!nZ5g~pranrm-q#&$N6BR&b@~f96@6%z{k7Hs5g)$5gR&AGl1}rd zqZvnZR9mt2jKUKb<24WDU2+>#S*P@e3aL)Z&5E5r54fR}6BZ+)?Xmr%@1()#DrGwb z`Wn~T=mOqbHc_%eHt;6@L^D0c_I2S^AsWuXY&IskSkqyuG3AuWR^7I`buq3QrNedY zx;~G(`sZX+q>LJizWunVa_*IqE+tMNEf@ixoJlSVAB*;Fen3be)i+lNxAZQDtV90~u7sseE7YbK&O@{5;$r?uyWg#Ib0aBO zwJzZWE`HvRRxaQ0)QN>yDjW#rYTEcyZB&2?YtoJKMl`OWk|(!*g(z{|x>qHqe=gMx z3J49mqZ_N&hX-NGtnkf{%{FXZ?z->Zx4o95CjKk_F^(4-Sz)#QC*meyJ|UZfwZ+c! zy*XL-nf&l; zeWJ1{BH_r~(|{Kala1Y%OY|*um)-{rS(gJezXidKj0TKS>SJ!LXe{M{6}{|@x@>+z z>8eDZqGALUBUmi!4Wf)ft5FJ(Ry`aIE4z+~vVyC~N!J|cxfEJd<6 zi?m4h>QVYxwIWVRk(q4v(>&r0&$|WBkT!fb)UM>$1BI6Sx-LqV8%9%@yi*wapQ)pM z?lgR63vjkHS$I(io~z`T-Ae*ag%7dYpANI*BeZW-rN8_r+|@ILV8=-h9d`YDid3m|eag1rZ3P*vK}n+gG;(^|Hp&4s@&X6PuwMl^RVY zYFRll;9o4i`p;?l)z*N$3WwjgTD`8h=OiW8cqP4~ki6$pfX0K~>8-w`1K%gZ%RWRe z6s@c%a&1I~Me0m3i3HL7VTI8p&5VsI_4?Shm+KuZQFJ;J*4tiyA*;Nu=G_@?uQhi2 zE^Hwiso4Oky+d4ou$vpB?(!oW_HU)alrOgp&NMziB3x^?8_I^WNw7;uWZmZlCn}y! zOk0UzlItO!Y=xQAmgjklgsa#49{jq*udMrTMFK6Vi_F}WrKq;%+~=(=vUmfBi+Hy! z*N!$7whwMMVW7; zdFk@Z@(rCYGCvN{>9wK@a0ij~RifPPvi@!GKknPpYpAB~kmX@|ED7m;BWlU(D3AnC z`%E`txhQ%BO(xyQu3n!$!KFhy0p2Mg?b_QcO`B;-YC4zrf}B2Ofizd=%P(nzoAZG_ z8CL~906F?UYW42 z*}>P9vXXvtxd@VH@1Rns;AB*O-e=tybWlXQCf0{`w_8&R-YVzpG_I*N;7v8hQysh| ziOs@QwQJUk)ggcmswrLXl?~Guch^(j2IMX~_xgPNR&&jgV$dRIBUn=uswvctnxDr8 z#8qD5NvNZp=!Lr8R6~!6$hm7S;s6N4-PoWYk)pwTqqawj!^LEL%?H)C9w*A06jV{$ zVFTTqPn-=xdRl<3@46wUgRe|6MKTE$txB48_4V~RxH$VuI60J)HaGJot*i&-`}>s7 zb^KD-r>6_}U0(!wg7x{%8MyBx#5*+&WSE0?UiSRiQ?_)pDijrS%@yVMG}!6e)+#fI zFEgdd5fkIr*T4w41e$}7|Hjf=4pw>Q;v=|(YR}xM-1NjUj(D}+Ccem2Il1)X8ov3V zWGTCprptg&C+U}T|>0}Ql zJ70xZ`ss-GK|l>j+aZ4fRd{%i#VRx`Y@_fjmrAf>QRpZ(_l3%Nf6fI1K&Cbb@l)}JuJ3(s9NQp~`F*<4y32%~& zd)M;beM2BTo{L|(M93o9Fx)*&D2Mj|R>azz(L5Gus))8M&%xH`Y0* z9j;uYW4F(Es!KVGNIz4GgYVlLn{u+DnLK^PQ4FZO;lr$D{UM69juu+g!hFP{PwYYp zBGrq_y}+-?<=>i|%`t90knB~S9`v}*|BbF)Tz=SL8?s1+b@Q<$eMZoO>(vbTtq2-j z8oNkmF@aS%9+wr1XN%I2i@1b3fxB{s!?1AFWmAG#?TWLdmIfE#A%=A%BC>GnTAso} zOH(C&LDyVvUy7Eka54d%;_}J!5UP)c=P^b_E$Rm>)$aAC=DO!1gJ|v*kr%>S2-@-K@hbV_w^LhXog9xZr+2 zxYK2KpnYpAddWeh&th8FpQZsW;4hvq;Sp9+fuxIfbGeh@0Me@d1iF0N!{8_7KMsW~bA%4?ZmA5axqungt5aLJe%_}D6W5MiYwJNeb$s{=JoPChB z=;&8Px>13@`>hi14jw*=^EX9=0-Q>1ofj#i%-B#1CONoqI>XcM{inPmIW7h(w zTd^k)cD^g&wHeqRN?Z3ShBV*Eed~u$di3BKkd-18RC&3KK4u4Mfd?Z@9r+y5oMcvV zIhoRkd8B*E(h4C;t|DIgYx4ikED((HRkgofcA{cl@Lb90k2+zx9@)aUuYxb4l@*i3 z?zjdMRu1}IlCt+}0AB*3RrZ}ke=WOLmKL( zDq~FwC|}!VOYG_)Rffwf1|snX{K797214J`|B6>_2xXmjYhwe)CW9CrutHK#S0vM; zIR&Z}F%GtB@pQRi3$uCsmL1jIpQ_3@vVa+z5!Lr=0E5P#uh2*23;_tW6ND*h5j*#@ z0mGB+_%14ldAj@>Gx|GEizQ?ndpgKIl*XvO$e}+VKmod3nW1ZPcwwth=i88dcP1 z$*hvPH%wI=(HnNr`zFv`4iDDk8~ADbCrl8G!)II{-go-27%HYkmImsJV zQ+ID(o)gi$mylKukPsw7=1-tQv%8=z#(%j6Dx-Gf^lT8 zjZjZW3RSbu18;d?!y82b+*g?f{I4?aiJ*SF4Mauw6x2CN0xTPoxDTH*>RK4V`Db!Y zIXj&X32N$fAY}1tSI9fY7Hz|Iq%&B@R{IV|nrPRM;wguThiHTOFmEc;o#iG8)l>7a0hr@OW zUVOQ;0AvOp%^QMK^bN&t4}1D5IjGV#iDd5+2O#&^3BD7oq?K14q;6fK=xBu zO!7XPL}2ksp5JrJ4cizqznYE{AK-8zzc~E>36~qS#LP?2#cqo-Ieq`eW)8Rg^-OJc zI~9zzD|yKT?I6F4xLXuMR%82q1;6mkc-Yof=8eUg@JR!g!kxW5FLRp2esq|yPuEh- ztr0%D3-F}{-A3QIT)Ix4sw5e~%2X&?eCe;B)G3%XJNrsF1Y;mNGK(bOMSG0T{wqM$ z8RT+WAvKk2grjR`pwCdV>cq{Yx?DbRgJN2uZVUYurO&(9VD_}vv9;~4m1~wnKwTVLI`xUe)UjTPLxT*dTQscY0PGCYs8%g#2#!x#|R4v9_R_zB3es0yikX$Y|QAevOgzVsmI5ew$pfNIb2{@gKii-nlM*YG){##tNf~r-AVV za!|yuO08Y7Jfh+PDZaZFgmNED_nb~c23!Agm-0w2Pgk(3myRw4ESfF;Xz9gMf9sx8 z73Mr+DuS^oF_KmQQ6`OPEm20n(XLDdbEZmY_E#$SC&I&)0;lvG|~t zIruR7aSU;BT*`FF?AKz(xXPSg;b!)Nmym2xVSw~-gpZ6($C+))Z^`63Cb$S4{)wvW<@lKpbqD zWrDboL^;6E@Y}C`Baf^O=_>AafJyUOw z%(vI7-cBNRPj;i4I@%kJ$g@EASnoWGOes~`>-CXiJhhRv8=|43vV|_;G502yL&MXN zro~(mlfQuJn!FtD7)w2h5S4q^w?m|&VUI-Lr&3x0xm~R7_9Op1rQd&&&$4fKKV}YD zf-k_||Ln-w3^wQ9amka4?tAIZ@CTurupMJR0+Ne6-C%7^&^W?j3;s9PFy=#_&*OF= zQco0wU(9TfHD9fQMY;L-TzaQ|QR?iFr5b(7(Zb8SD&&o{{{9A5i!3U&ME{OTJVUx0 zY)%d_UVLh=H`3n_EN0iPvW@Lsu|EC$KkaRj-&$o!g#Gc%a+?|3xT0vgWNfw|jlmDK zXV8B(g($(mDL*^$wAmB|t2Ip5B2|K-EE$NM!uG$)X-YANTlT9exO`i{rleVxATLWr z0O&7&Uw2KrP<&wVqGR?2wX&9utgfYO-^bSe2VRH?V;G1x$&7f6B!xS(u@&w?Ae~7j zz5gYJHjR!$dTd;Oh1WmZUM73|!+E9m)Ar%apVxqNO?j z36g+&bB?AtwiMdq2qGuR)h(Dcn|G6$I}BTfT0Rbb9`-lp>FNyhC%V`jrx3lBPTS{L@;l$pSKv$O|p%n|AVDfY$`Q=PQN0aZa5R!WZ_qww|7*M zZj!c2%v?B5(b%Ru5JQcE?32G-!Qy!n-@{{N=U3=>a&>mv!tWPvlGm8@%x~1KMQ>(l zquGk1RyF(&s=WE#JV~#gVj^TzqHSa0#{{RIhRPHY4OtT1A?K{z=kj7H)=ZIZCiy>c zbeBg&HTjyQiuduTu|tpOhsO3nMyyVPMp$N8e!jJK6M^@@!?h_K>($w8MNCnVq%cv6 ztUmMJ(+lnJgQj%xvjMeXI2e{L?%B_JovUVa5&?iZD-;;-UfIxa#6?WEPOX#Ou1z{h za5vgqK*U6T|KbuT*44FvHjV(vdOHC}H}(H3KSJ*i@PhaYV)iv$(OW>BQl6w`-s1)i z!u6p4A(e}%79SrwFK*{~OOhmwQOA+@@egv-Q_1q<^JhXoI+Thl ztG+7oyHRebkJ|kEkC9IP1W-yxOAo~);;tPr$|^J*XNio#%o$}tp5c^7>Iu7fMt8^p zIqA%M0LL$B`2Wj=rWB4n>%`0>jZPtQz`Dk@` z$^tt5L{@954I|C~`t8R*R3Y?Vn&pK;Yr;0IA@#mLYI>HI?HTUB(o4*ILC}MhluJ?K zm7P_?t2w+P>=1;g4}`LxFV3%_u{Yw$Q7;w_qx_;i)ZX}FFnX}xbs@XS(?dNMG@i! z45p)gGU)5}rHyctOR6d$W3PxMi3OH(>s7K_=ljpkd)fDd1w~{;YRju%DUCnfE=UwC z^!UveBtcfVPu)Bh?rKuO$ZTbFRM>9%i=%3$?Eh^C_vv&=>I*<}=C8H&qP z&>e(R?LB5RKd=J`c%VnTB;wLYfgRG5a$XN3F1W(Ko~0qAG99+b^xwbGk%UkJLxT@m&8EyNQY$FGch zykq%=J1rBlDDQhidYRp{!$hGBEw?ovX}2}Lz7J({FOcUo)S@5JjM-O*-W{x3@09pW zzqnLr@FgEfpm>tO*(YZemiL|kwKD|G8rfa(n}*Xr{H6Ks2uF0_lSSAY8D>>OnUAs# ztPgQ#j%-nqpTe}n_`EQRYk5J@rsLu>|jX7xv3b6EVcW-+d=JMxpljc_}Fo1uh2l0#6^4 z5WZ|Kfr!9RD7-j=pe-OSIjPqJlu+A-?ARK7(Q(cZIFY$R%&hBK9r9e*?+_|~IwHpE zQ5{a=vO>e!T{xqe+{IHI*#o#kezyI;4-O^uBvB6+kgs>2cxmgoXo0O<+|AxwqM&%p qI4gInDe4^dsVJ)vD5@wIprdeo!5AyWFHk|g$5oI~l`fSu4f;P_!`H6> From 7ae3d85b7bbf833f2bd7c3751ae0637524b9cca3 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Tue, 6 May 2008 14:47:34 -0700 Subject: [PATCH 56/98] Bug 431713: re-enable EULA dialog by default for linux, now that bug 432321 is fixed --- browser/app/profile/firefox.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index bf1aba38369..c0024532609 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -653,9 +653,7 @@ pref("browser.EULA.3.accepted", true); #elifdef XP_WIN pref("browser.EULA.3.accepted", true); #else -# Need to fix the unittest and talos machine profiles before flipping this by default -#pref("browser.EULA.3.accepted", false); -pref("browser.EULA.3.accepted", true); +pref("browser.EULA.3.accepted", false); #endif // if we rev the EULA again, we should bump this so users agree to the new EULA From 84d826ee057b596d477f30063e2531d348d98e64 Mon Sep 17 00:00:00 2001 From: "crowder@fiverocks.com" Date: Tue, 6 May 2008 14:59:49 -0700 Subject: [PATCH 57/98] Bug 432275 - Regression - Java applets crashing browser [@ obj_eval], r=igor, a=beltzner --- js/src/jsobj.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/src/jsobj.c b/js/src/jsobj.c index ac173ccfe2e..a9540166152 100644 --- a/js/src/jsobj.c +++ b/js/src/jsobj.c @@ -1177,8 +1177,7 @@ obj_eval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) fp = cx->fp; caller = JS_GetScriptedCaller(cx, fp); - JS_ASSERT(!caller || caller->regs); - indirectCall = (caller && *caller->regs->pc != JSOP_EVAL); + indirectCall = (caller && caller->regs && *caller->regs->pc != JSOP_EVAL); /* * Ban all indirect uses of eval (global.foo = eval; global.foo(...)) and From db98c2faebb5704412ad9188803990639752909c Mon Sep 17 00:00:00 2001 From: "crowder@fiverocks.com" Date: Tue, 6 May 2008 15:01:32 -0700 Subject: [PATCH 58/98] Bug 432275: Regression - Java applets crashing browser [@ obj_eval], patch by mrbkap, r=crowder, a=beltzner --- js/src/liveconnect/nsCLiveconnect.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/src/liveconnect/nsCLiveconnect.cpp b/js/src/liveconnect/nsCLiveconnect.cpp index 417d666174a..4adfc740142 100644 --- a/js/src/liveconnect/nsCLiveconnect.cpp +++ b/js/src/liveconnect/nsCLiveconnect.cpp @@ -107,6 +107,7 @@ private: nsCOMPtr mContextStack; JSContext* mContext; JSStackFrame mFrame; + JSFrameRegs mRegs; nsresult mPushResult; }; @@ -185,11 +186,16 @@ AutoPushJSContext::AutoPushJSContext(nsISupports* aSecuritySupports, if (fun) { + JSScript *script = JS_GetFunctionScript(cx, fun); mFrame.fun = fun; - mFrame.script = JS_GetFunctionScript(cx, fun); + mFrame.script = script; mFrame.callee = JS_GetFunctionObject(fun); mFrame.scopeChain = JS_GetParent(cx, mFrame.callee); mFrame.down = cx->fp; + mRegs.pc = script->code + script->length + - JSOP_STOP_LENGTH; + mRegs.sp = NULL; + mFrame.regs = &mRegs; cx->fp = &mFrame; } else From 30436d48870fb8e3493ff07653e05155aa732548 Mon Sep 17 00:00:00 2001 From: "edward.lee@engineering.uiuc.edu" Date: Tue, 6 May 2008 16:24:14 -0700 Subject: [PATCH 59/98] Bug 391928 - Feedback required when hovering over DM UI elements. r=sdwilsh, a1.9=beltzner --- .../mozapps/downloads/buttons-aero.png | Bin 2257 -> 0 bytes .../winstripe/mozapps/downloads/buttons.png | Bin 1384 -> 0 bytes .../winstripe/mozapps/downloads/downloads.css | 37 +++++++++++++++++- toolkit/themes/winstripe/mozapps/jar.mn | 2 - 4 files changed, 35 insertions(+), 4 deletions(-) delete mode 100644 toolkit/themes/winstripe/mozapps/downloads/buttons-aero.png delete mode 100644 toolkit/themes/winstripe/mozapps/downloads/buttons.png diff --git a/toolkit/themes/winstripe/mozapps/downloads/buttons-aero.png b/toolkit/themes/winstripe/mozapps/downloads/buttons-aero.png deleted file mode 100644 index ae1727c1438ca78a9375993272750c6fc9bd9538..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2257 zcmV;?2rl=DP)aXpdc=4|NR>#tk)B5?XZ81xZXrz|Eg_{I zf&Xv$KQ=yB0fhuKI-7Xw31 zP=0|uTWhtEu4euDZjT|K|HJcVn3lRC_~&erc51EFA-)9hC0YEA)2C09HZ!h#&)^7u zToE3pjly%1LXZ)uA{N4NJuis0PFvw}b-8vDaS1kos?nMFnZc{k{k~wVK*7sYfgF31 z?}e2#7mZ70POGN0+EzHiOjF@MgZ!^<9QOv}c8=l{jQYeMSX>eHd|ayCX+{1vO)h`L z$9o3X2&kw8w1aN>0{%wZj* zCGbrN1;Z1uPUa`n;uyXq^!g?RJFxyI4w`9ySrnlUzx!S@<5+3%O$+wn2|k~{f}iH? zgkQOyqhnn8;ZE8(bi5K;YH)`T{8SY2LKd$o!0Eq}a#78Z6_*stdb`5{SI^YKu@0-U z6&Q_8uDh6%QOooG0IwqqAeDxJOA%ZAbMeuw+f5h`H8T%6aw_6S1t|){b|89vkcAuRC-(-}w z5z57DR1*q@Q%33!nCY_(Ov|y??eJ!^34Z$i99)~)fWVw!%<-_Kln3Tx99c19K?4^) zqe|>MTtOQLKD-C-d>B>+#DBs043~34DEvc$Q6_k@=Vj(SP}r;sAV1_AAAxx}pT9Xc zA2U(~VEOtB1~_%@GhA&Rx_@>XyiL{d;0GHn;BQ0hc;3o%_PU^1=nA}sR1lWL!bPf;?yvcigzC=Vp>r)$J{ z!e7t0X&tRk-akN83)pa%X`oZH<5A_GPS`jOd&tU4QGw_b zu#SGG=#<L(Hl`Lir{zM$Eylhd~sJ% z2=}HrU;QNvzr3`BTS7uoP6lEHd!I9f*jcKUTYKyE3IF(7u`2MuP>7PuETFI3 z1!sSIhmPxU>k}+6Qp@7r`jQahZKVGPe+w&evkCwHfo~2--#q?^*CT$_M)Y*<&x`P# zgAVw~+cmWD;%EfUUAYS!S_c`Q^i}by0`7KvwRrI6thUN~D{3b`VBg7cTye$oXB{I7 z-_~G`bi8OAWKoq`COVodmv2t4ANG!K6jXoX@5)|g`}geovq-n;O13pxG6(jUFSDo+ zvi$d$2X9WTSE0$;`>{VK0~0^eBVt% z+*MH=lBA3$8cmfgEX6sx?^z6>_!kM<8!VZwR~_Sr_LZMP%ydp5lXf|ZmqbxA@tf(| z`K6d1SPVd83Sxoy-r9itU#&Qg_MJ-SbA}yG(duKDnNZ2ohN2Kk!@Dib}OJ3l(~a>XeY3MX=X7~$VoZyMiOrd=*G7dcRXBA)QqaGAz> z!v^A~5&tgYKaW4d8xgNtwwpDG&*1z;jSle*bp-D~yz?Ra(`4vrI{Z`tTS@^WFe72I z3CV&~tU6hwb)-$^J2Kl*0c8JLFrRP2e7+6yc^l^QI+o8TFrQz=eBO)s{0*iIX*(%^ zth^QT`Gc6xdoU|CJmNlp?`qbMb$bj~uwv~=Sb}DYtiEn^Ced`kzv=PLBn;dGVza{@ zUwi?{fboT=+NxP@uh)4$=T_-UX?`md6Xx@6zDdFG1?~e3!xMZP^AoUL6kzdVBJ&vc z0XF6&VY_UB;$TS7J;r^2F6V^U77AeZ0iu$)sE(OsgV}F#A3!vqd19yFme~Sva@3Iv z6Pojr{GSNQuCO5couYogT~U}|vB9>nfOX9ASN-E_C13D9V3oxJ+a?askK9~q`}xq^ zA@8SaN(_*5AE5pp1G^94f6!C&(Y`&_CvpsK6$?n9KsQ2nV`X^sc}7(wsAA(Hk&BJi zui5ynjtNAm_*;$C>AtoiulHtI#BjT!8c=6Q(tWR18j5-1g+6hn~L3wwiBgs zq(xZY6sz$UMoRrjqW9jN^CY=sSz2#lFpXXf(R-iIeV%ik=Q-zmADJKsaFVYxaKbNn zZRsx+yor7E>LSKxVAUtf1EFE2ZJo*(M!>RSBJ3y&Kw3*Q1A9UWJ-TJ84* z`T1szRtpIU3BYqaZ0~G=XK@LpXQmzaqTAiw-BZyzKZ^Xz7cb$9FEbebn>(@vDn)?z2xpAyHj z6xc2mQgMGp_8!hRG&F$Q{U_teiNx2{*Gc9dJQ#=Z@o@-kPv@gYFflP9nI9b;h57k; zXl`z1&$?|k$o?iPDlY~>wOW-+OAP}B&NvU$cW3~8Xn@n{WG~d|bdan{&W#*EIDgA( zW#8lgy6Ua>kPse4uacfQ;eAv5-+x_~PPX7#SIX{rv+r>tnbjii*CC%8L%5 zJn8W)mYqvX#K@~;meD0Ec4)e);()Hi1P&MPM|VqVn>vB{VcMJ#+1B z;#sp+qlNqT$Hc+YEc*REgje9X%jLis8H%z5MSkSoJy2l!I^Y6ZsivkHDl02!kdpYD zRX6{|`+PphJdNK{Q^QtVVEgdz<;6O{Xf$qOetkoER;g58J`)$m;C;Uz-o4wzsQLz` zrv7lOuCCth>FJq^9KdnqWszd2wY4>!@?`4gR7xgeDGA`+@VeGkSDn~$2;mQwqQ{Mw zovOhTew{kt^gQ5*U8w5LqYAo$dR~uuJ|n2-7chm*VXB)&J^%K>&Q%dvaX&I6A9 z7NAszdOn~&gN9P@BN-m$JYXT_RsiLB)bo0Y=K*uExCLfW&tF14pL580fE(}4#$+MX z*4C!O2wz62j#3^KLUcO2v%8DNuYk+-+>LtvAxhfUG3kJyoi@ qehx=Ei^j)pDSWC1|A*^u0R{l{i0Zl1xY-r}0000=6 - skin/classic/aero/mozapps/downloads/buttons.png (downloads/buttons-aero.png) skin/classic/aero/mozapps/downloads/downloadButtons.png (downloads/downloadButtons-aero.png) skin/classic/aero/mozapps/downloads/downloadIcon.png (downloads/downloadIcon-aero.png) skin/classic/aero/mozapps/downloads/downloads.css (downloads/downloads.css) From 33ab985b80e42db8a6da11773186b20bd9211a0d Mon Sep 17 00:00:00 2001 From: "edward.lee@engineering.uiuc.edu" Date: Tue, 6 May 2008 16:25:36 -0700 Subject: [PATCH 60/98] Bug 431188 - Clear list active / inactive state not working properly. r=sdwilsh, a1.9=beltzner --- .../mozapps/downloads/content/downloads.js | 1 + .../downloads/tests/browser/Makefile.in | 1 + .../tests/browser/browser_search_clearlist.js | 148 ++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 toolkit/mozapps/downloads/tests/browser/browser_search_clearlist.js diff --git a/toolkit/mozapps/downloads/content/downloads.js b/toolkit/mozapps/downloads/content/downloads.js index 4312a691f4b..9e74c95a0ed 100644 --- a/toolkit/mozapps/downloads/content/downloads.js +++ b/toolkit/mozapps/downloads/content/downloads.js @@ -1165,6 +1165,7 @@ function stepListBuilder(aNumItems) { // If we're done adding all items, we can quit if (!gStmt.executeStep()) { // Send a notification that we finished, but wait for clear list to update + updateClearListButton(); setTimeout(function() Cc["@mozilla.org/observer-service;1"]. getService(Ci.nsIObserverService). notifyObservers(window, "download-manager-ui-done", null), 0); diff --git a/toolkit/mozapps/downloads/tests/browser/Makefile.in b/toolkit/mozapps/downloads/tests/browser/Makefile.in index aa3ce6fbb44..38359206bf5 100644 --- a/toolkit/mozapps/downloads/tests/browser/Makefile.in +++ b/toolkit/mozapps/downloads/tests/browser/Makefile.in @@ -58,6 +58,7 @@ _BROWSER_FILES = \ browser_bug_416303.js \ browser_cleanup_search.js \ browser_multi_select.js \ + browser_search_clearlist.js \ browser_select_all.js \ $(NULL) diff --git a/toolkit/mozapps/downloads/tests/browser/browser_search_clearlist.js b/toolkit/mozapps/downloads/tests/browser/browser_search_clearlist.js new file mode 100644 index 00000000000..60c76ff62ee --- /dev/null +++ b/toolkit/mozapps/downloads/tests/browser/browser_search_clearlist.js @@ -0,0 +1,148 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Download Manager UI Test Code. + * + * The Initial Developer of the Original Code is + * Edward Lee . + * Portions created by the Initial Developer are Copyright (C) 2008 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/** + * Test bug 431188 to make sure the Clear list button is enabled after doing a + * search and finding results. + */ + +function test() +{ + let dm = Cc["@mozilla.org/download-manager;1"]. + getService(Ci.nsIDownloadManager); + let db = dm.DBConnection; + + // Empty any old downloads + db.executeSimpleSQL("DELETE FROM moz_downloads"); + + // Make a file name for the downloads + let file = Cc["@mozilla.org/file/directory_service;1"]. + getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile); + file.append("cleanUp"); + let filePath = Cc["@mozilla.org/network/io-service;1"]. + getService(Ci.nsIIOService).newFileURI(file).spec; + + let stmt = db.createStatement( + "INSERT INTO moz_downloads (target, source, state, endTime) " + + "VALUES (?1, ?2, ?3, ?4)"); + + // Add a bunch of downloads that don't match the search + let sites = []; + for (let i = 0; i < 50; i++) + sites.push("i-hate.clear-list-" + i); + + // Add one download that matches the search + let searchTerm = "one-download.match-search"; + sites.push(searchTerm); + + try { + for each (let site in sites) { + stmt.bindStringParameter(0, filePath); + stmt.bindStringParameter(1, "http://" + site + "/file"); + stmt.bindInt32Parameter(2, dm.DOWNLOAD_FINISHED); + // Make the one that matches slightly older so it appears last + stmt.bindInt64Parameter(3, 1112223334445556 - (site == searchTerm)); + + // Add it! + stmt.execute(); + } + } + finally { + stmt.reset(); + stmt.finalize(); + } + + // Close the UI if necessary + let wm = Cc["@mozilla.org/appshell/window-mediator;1"]. + getService(Ci.nsIWindowMediator); + let win = wm.getMostRecentWindow("Download:Manager"); + if (win) win.close(); + + let obs = Cc["@mozilla.org/observer-service;1"]. + getService(Ci.nsIObserverService); + const DLMGR_UI_DONE = "download-manager-ui-done"; + + let testPhase = 0; + let testObs = { + observe: function(aSubject, aTopic, aData) { + if (aTopic != DLMGR_UI_DONE) + return; + + let win = aSubject.QueryInterface(Ci.nsIDOMWindow); + let $ = function(aId) win.document.getElementById(aId); + let downloadView = $("downloadView"); + let searchbox = $("searchbox"); + let clearList = $("clearListButton"); + + // The list must have built, so figure out what test to do + switch (testPhase++) { + case 0: + case 2: + // Search for the one download + searchbox.value = searchTerm; + searchbox.doCommand(); + + break; + case 1: + // Search came back with 1 item + is(downloadView.itemCount, 1, "Search found the item to delete"); + is(clearList.disabled, false, "Clear list is enabled for search matching 1 item"); + + // Clear the list that has the single matched item + clearList.doCommand(); + + break; + case 3: + // There's nothing that matches the search + is(downloadView.itemCount, 0, "Clear list killed the one matching download"); + is(clearList.disabled, true, "Clear list is disabled for no items"); + + // We're done! + obs.removeObserver(testObs, DLMGR_UI_DONE); + finish(); + + break; + } + } + }; + obs.addObserver(testObs, DLMGR_UI_DONE, false); + + // Show the Download Manager UI + Cc["@mozilla.org/download-manager-ui;1"]. + getService(Ci.nsIDownloadManagerUI).show(); + + waitForExplicitFinish(); +} From 5d98502608a64989d002f333ae24f654e288350e Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Tue, 6 May 2008 18:51:11 -0700 Subject: [PATCH 61/98] bug 432332: improve handling of duplicate chunks in url classifier client request, patch by Dave Camp , r=tony, a=beltzner --- .../src/nsUrlClassifierDBService.cpp | 43 ++++++++++++++++--- .../tests/unit/head_urlclassifier.js | 1 + .../url-classifier/tests/unit/test_addsub.js | 23 ++++++++++ .../tests/unit/test_streamupdater.js | 16 ++++--- 4 files changed, 72 insertions(+), 11 deletions(-) diff --git a/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp index c6d15a6173c..7abcd41c25a 100644 --- a/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp @@ -128,7 +128,7 @@ static const PRLogModuleInfo *gUrlClassifierDbServiceLog = nsnull; // want to change schema, or to recover from updating bugs. When an // implementation version change is detected, the database is scrapped // and we start over. -#define IMPLEMENTATION_VERSION 4 +#define IMPLEMENTATION_VERSION 5 #define MAX_HOST_COMPONENTS 5 #define MAX_PATH_COMPONENTS 4 @@ -1078,6 +1078,10 @@ private: // Flush the cached add/subtract lists to the database. nsresult FlushChunkLists(); + // Inserts a chunk id into the list, sorted. Returns TRUE if the + // number was successfully added, FALSE if the chunk already exists. + PRBool InsertChunkId(nsTArray& chunks, PRUint32 chunkNum); + // Add a list of entries to the database, merging with // existing entries as necessary nsresult AddChunk(PRUint32 tableId, PRUint32 chunkNum, @@ -2330,6 +2334,25 @@ nsUrlClassifierDBServiceWorker::ClearCachedChunkLists() mHaveCachedSubChunks = PR_FALSE; } +PRBool +nsUrlClassifierDBServiceWorker::InsertChunkId(nsTArray &chunks, + PRUint32 chunkNum) +{ + PRUint32 low = 0, high = chunks.Length(); + while (high > low) { + PRUint32 mid = (high + low) >> 1; + if (chunks[mid] == chunkNum) + return PR_FALSE; + if (chunks[mid] < chunkNum) + low = mid + 1; + else + high = mid; + } + + PRUint32 *item = chunks.InsertElementAt(low, chunkNum); + return (item != nsnull); +} + nsresult nsUrlClassifierDBServiceWorker::AddChunk(PRUint32 tableId, PRUint32 chunkNum, @@ -2342,11 +2365,15 @@ nsUrlClassifierDBServiceWorker::AddChunk(PRUint32 tableId, } #endif - LOG(("Adding %d entries to chunk %d in table %d", entries.Length(), chunkNum, tableId)); - nsresult rv = CacheChunkLists(tableId, PR_TRUE, PR_FALSE); NS_ENSURE_SUCCESS(rv, rv); - mCachedAddChunks.AppendElement(chunkNum); + + if (!InsertChunkId(mCachedAddChunks, chunkNum)) { + LOG(("Ignoring duplicate add chunk %d in table %d", chunkNum, tableId)); + return NS_OK; + } + + LOG(("Adding %d entries to chunk %d in table %d", entries.Length(), chunkNum, tableId)); nsTArray entryIDs; @@ -2433,7 +2460,13 @@ nsUrlClassifierDBServiceWorker::SubChunk(PRUint32 tableId, nsTArray& entries) { nsresult rv = CacheChunkLists(tableId, PR_FALSE, PR_TRUE); - mCachedSubChunks.AppendElement(chunkNum); + + if (!InsertChunkId(mCachedSubChunks, chunkNum)) { + LOG(("Ignoring duplicate sub chunk %d in table %d", chunkNum, tableId)); + return NS_OK; + } + + LOG(("Subbing %d entries in chunk %d in table %d", entries.Length(), chunkNum, tableId)); nsAutoTArray existingEntries; nsUrlClassifierDomainHash lastKey; diff --git a/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js b/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js index f056d08debc..6e423fe2c9c 100644 --- a/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js +++ b/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js @@ -20,6 +20,7 @@ if (!profileDir) { // It will simply return the current directory. var provider = { getFile: function(prop, persistent) { + dump("getting file " + prop + "\n"); persistent.value = true; if (prop == NS_APP_USER_PROFILE_50_DIR || prop == NS_APP_USER_PROFILE_LOCAL_50_DIR) { diff --git a/toolkit/components/url-classifier/tests/unit/test_addsub.js b/toolkit/components/url-classifier/tests/unit/test_addsub.js index 6395bbaa35f..daa8661dd81 100644 --- a/toolkit/components/url-classifier/tests/unit/test_addsub.js +++ b/toolkit/components/url-classifier/tests/unit/test_addsub.js @@ -335,6 +335,28 @@ function testExpireLists() { doTest([addUpdate, subUpdate, expireUpdate], assertions); } +// Test a duplicate add chunk. +function testDuplicateAddChunks() { + var addUrls1 = [ "foo.com/a" ]; + var addUrls2 = [ "bar.com/b" ]; + var update = buildPhishingUpdate( + [ + { "chunkNum" : 1, + "urls" : addUrls1 + }, + { "chunkNum" : 1, + "urls" : addUrls2 + }]); + + var assertions = { + "tableData" : "test-phish-simple;a:1", + "urlsExist" : addUrls1, + "urlsDontExist" : addUrls2 + }; + + doTest([update], assertions); +} + function run_test() { runTests([ @@ -350,6 +372,7 @@ function run_test() testSubPartiallyMatches2, testSubsDifferentChunks, testExpireLists, + testDuplicateAddChunks ]); } diff --git a/toolkit/components/url-classifier/tests/unit/test_streamupdater.js b/toolkit/components/url-classifier/tests/unit/test_streamupdater.js index 8bd4fdd2d23..0a1f842d5f2 100644 --- a/toolkit/components/url-classifier/tests/unit/test_streamupdater.js +++ b/toolkit/components/url-classifier/tests/unit/test_streamupdater.js @@ -100,12 +100,14 @@ function testInvalidUrlForward() { "urls" : add1Urls }]); update += "u:asdf://blah/blah\n"; // invalid URL scheme + // The first part of the update should have succeeded. + var assertions = { - "tableData" : "", - "urlsDontExist" : add1Urls + "tableData" : "test-phish-simple;a:1", + "urlsExist" : add1Urls }; - doTest([update], assertions, true); + doTest([update], assertions, false); } // A failed network request causes the update to fail. @@ -117,12 +119,14 @@ function testErrorUrlForward() { "urls" : add1Urls }]); update += "u:http://test.invalid/asdf/asdf\n"; // invalid URL scheme + // The first part of the update should have succeeded + var assertions = { - "tableData" : "", - "urlsDontExist" : add1Urls + "tableData" : "test-phish-simple;a:1", + "urlsExist" : add1Urls }; - doTest([update], assertions, true); + doTest([update], assertions, false); } function testMultipleTables() { From 2c1cf5226193bd8528f24891a837fbb90ff56780 Mon Sep 17 00:00:00 2001 From: "dietrich@mozilla.com" Date: Tue, 6 May 2008 20:26:19 -0700 Subject: [PATCH 62/98] Bug 419957 - History sidebar "By Site" should use visit_count to avoid display of empty sites (for ondrej@allpeers.com, r=dietrich, a=beltzner) --- toolkit/components/places/src/nsNavHistory.cpp | 10 ++++++---- .../places/tests/unit/test_history_sidebar.js | 8 +++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/toolkit/components/places/src/nsNavHistory.cpp b/toolkit/components/places/src/nsNavHistory.cpp index 2ebaa7c9955..6fcd0069af4 100644 --- a/toolkit/components/places/src/nsNavHistory.cpp +++ b/toolkit/components/places/src/nsNavHistory.cpp @@ -3184,9 +3184,7 @@ PlacesSQLQueryBuilder::SelectAsSite() history->GetStringFromName(NS_LITERAL_STRING("localhost").get(), localFiles); mAddParams.Put(NS_LITERAL_CSTRING(":localhost"), localFiles); - // We want just sites, but from whole database - we omit join with visits, - // it could happen, that we get later empty host, when we click on it, but - // this should be much faster. + // We want just sites, but from whole database. if (mConditions.IsEmpty()) { mQueryString = nsPrintfCString(2048, @@ -3196,6 +3194,7 @@ PlacesSQLQueryBuilder::SelectAsSite() "WHERE EXISTS(SELECT '*' " "FROM moz_places " "WHERE hidden <> 1 AND rev_host = '.' " + "AND visit_count > 0 " "AND url BETWEEN 'file://' AND 'file:/~') " "UNION ALL " "SELECT DISTINCT null, " @@ -3204,7 +3203,8 @@ PlacesSQLQueryBuilder::SelectAsSite() "FROM (SELECT get_unreversed_host(rev_host) host " "FROM (SELECT DISTINCT rev_host " "FROM moz_places " - "WHERE hidden <> 1 AND rev_host <> '.') inner0 " + "WHERE hidden <> 1 AND rev_host <> '.' " + "AND visit_count > 0 ) inner0 " "ORDER BY 1 ASC) inner1", nsINavHistoryQueryOptions::RESULTS_AS_URI, nsINavHistoryQueryOptions::SORT_BY_TITLE_ASCENDING, @@ -3222,6 +3222,7 @@ PlacesSQLQueryBuilder::SelectAsSite() "FROM moz_places h " "JOIN moz_historyvisits v ON h.id = v.place_id " "WHERE h.hidden <> 1 AND h.rev_host = '.' " + "AND h.visit_count > 0 " "AND h.url BETWEEN 'file://' AND 'file:/~' " "AND v.visit_type NOT IN (0,4) {ADDITIONAL_CONDITIONS} ) " "UNION ALL " @@ -3234,6 +3235,7 @@ PlacesSQLQueryBuilder::SelectAsSite() "FROM moz_places h " "JOIN moz_historyvisits v ON h.id = v.place_id " "WHERE h.hidden <> 1 AND h.rev_host <> '.' " + "AND h.visit_count > 0 " "AND v.visit_type NOT IN (0,4) " "{ADDITIONAL_CONDITIONS} ) inner0 " "ORDER BY 1 ASC) inner1", diff --git a/toolkit/components/places/tests/unit/test_history_sidebar.js b/toolkit/components/places/tests/unit/test_history_sidebar.js index 0fd6eb548e1..ea6cf7b42ef 100644 --- a/toolkit/components/places/tests/unit/test_history_sidebar.js +++ b/toolkit/components/places/tests/unit/test_history_sidebar.js @@ -206,6 +206,12 @@ function test_RESULTS_AS_DATE_QUERY() { function test_RESULTS_AS_SITE_QUERY() { + // add a bookmark with a domain not in the set of visits in the db + var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"]. + getService(Ci.nsINavBookmarksService); + bmsvc.insertBookmark(bmsvc.toolbarFolder, uri("http://foobar"), + bmsvc.DEFAULT_INDEX, ""); + var options = histsvc.getNewQueryOptions(); options.resultType = options.RESULTS_AS_SITE_QUERY; var query = histsvc.getNewQuery(); @@ -214,7 +220,7 @@ function test_RESULTS_AS_SITE_QUERY() { root.containerOpen = true; do_check_eq(root.childCount, dayLabels.length*2); - // We include this here, se that maintainer knows what is the expected result + // We include this here, so that maintainer knows what is the expected result var expectedResult = [ "mirror0.google.com", From 833ad69d76c5e2cc7d70f9a2c0fdbccc1d73aeaa Mon Sep 17 00:00:00 2001 From: "dietrich@mozilla.com" Date: Tue, 6 May 2008 20:28:03 -0700 Subject: [PATCH 63/98] backing out, tree is closed --- toolkit/components/places/src/nsNavHistory.cpp | 10 ++++------ .../places/tests/unit/test_history_sidebar.js | 8 +------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/toolkit/components/places/src/nsNavHistory.cpp b/toolkit/components/places/src/nsNavHistory.cpp index 6fcd0069af4..2ebaa7c9955 100644 --- a/toolkit/components/places/src/nsNavHistory.cpp +++ b/toolkit/components/places/src/nsNavHistory.cpp @@ -3184,7 +3184,9 @@ PlacesSQLQueryBuilder::SelectAsSite() history->GetStringFromName(NS_LITERAL_STRING("localhost").get(), localFiles); mAddParams.Put(NS_LITERAL_CSTRING(":localhost"), localFiles); - // We want just sites, but from whole database. + // We want just sites, but from whole database - we omit join with visits, + // it could happen, that we get later empty host, when we click on it, but + // this should be much faster. if (mConditions.IsEmpty()) { mQueryString = nsPrintfCString(2048, @@ -3194,7 +3196,6 @@ PlacesSQLQueryBuilder::SelectAsSite() "WHERE EXISTS(SELECT '*' " "FROM moz_places " "WHERE hidden <> 1 AND rev_host = '.' " - "AND visit_count > 0 " "AND url BETWEEN 'file://' AND 'file:/~') " "UNION ALL " "SELECT DISTINCT null, " @@ -3203,8 +3204,7 @@ PlacesSQLQueryBuilder::SelectAsSite() "FROM (SELECT get_unreversed_host(rev_host) host " "FROM (SELECT DISTINCT rev_host " "FROM moz_places " - "WHERE hidden <> 1 AND rev_host <> '.' " - "AND visit_count > 0 ) inner0 " + "WHERE hidden <> 1 AND rev_host <> '.') inner0 " "ORDER BY 1 ASC) inner1", nsINavHistoryQueryOptions::RESULTS_AS_URI, nsINavHistoryQueryOptions::SORT_BY_TITLE_ASCENDING, @@ -3222,7 +3222,6 @@ PlacesSQLQueryBuilder::SelectAsSite() "FROM moz_places h " "JOIN moz_historyvisits v ON h.id = v.place_id " "WHERE h.hidden <> 1 AND h.rev_host = '.' " - "AND h.visit_count > 0 " "AND h.url BETWEEN 'file://' AND 'file:/~' " "AND v.visit_type NOT IN (0,4) {ADDITIONAL_CONDITIONS} ) " "UNION ALL " @@ -3235,7 +3234,6 @@ PlacesSQLQueryBuilder::SelectAsSite() "FROM moz_places h " "JOIN moz_historyvisits v ON h.id = v.place_id " "WHERE h.hidden <> 1 AND h.rev_host <> '.' " - "AND h.visit_count > 0 " "AND v.visit_type NOT IN (0,4) " "{ADDITIONAL_CONDITIONS} ) inner0 " "ORDER BY 1 ASC) inner1", diff --git a/toolkit/components/places/tests/unit/test_history_sidebar.js b/toolkit/components/places/tests/unit/test_history_sidebar.js index ea6cf7b42ef..0fd6eb548e1 100644 --- a/toolkit/components/places/tests/unit/test_history_sidebar.js +++ b/toolkit/components/places/tests/unit/test_history_sidebar.js @@ -206,12 +206,6 @@ function test_RESULTS_AS_DATE_QUERY() { function test_RESULTS_AS_SITE_QUERY() { - // add a bookmark with a domain not in the set of visits in the db - var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"]. - getService(Ci.nsINavBookmarksService); - bmsvc.insertBookmark(bmsvc.toolbarFolder, uri("http://foobar"), - bmsvc.DEFAULT_INDEX, ""); - var options = histsvc.getNewQueryOptions(); options.resultType = options.RESULTS_AS_SITE_QUERY; var query = histsvc.getNewQuery(); @@ -220,7 +214,7 @@ function test_RESULTS_AS_SITE_QUERY() { root.containerOpen = true; do_check_eq(root.childCount, dayLabels.length*2); - // We include this here, so that maintainer knows what is the expected result + // We include this here, se that maintainer knows what is the expected result var expectedResult = [ "mirror0.google.com", From 90eb744768c17964162d824c7ca085e2eeafa30c Mon Sep 17 00:00:00 2001 From: "dietrich@mozilla.com" Date: Tue, 6 May 2008 21:33:05 -0700 Subject: [PATCH 64/98] Bug 419957 - History sidebar "By Site" should use visit_count to avoid display of empty sites (for ondrej@allpeers.com, r=dietrich, a=beltzner) --- toolkit/components/places/src/nsNavHistory.cpp | 10 ++++++---- .../places/tests/unit/test_history_sidebar.js | 8 +++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/toolkit/components/places/src/nsNavHistory.cpp b/toolkit/components/places/src/nsNavHistory.cpp index 2ebaa7c9955..6fcd0069af4 100644 --- a/toolkit/components/places/src/nsNavHistory.cpp +++ b/toolkit/components/places/src/nsNavHistory.cpp @@ -3184,9 +3184,7 @@ PlacesSQLQueryBuilder::SelectAsSite() history->GetStringFromName(NS_LITERAL_STRING("localhost").get(), localFiles); mAddParams.Put(NS_LITERAL_CSTRING(":localhost"), localFiles); - // We want just sites, but from whole database - we omit join with visits, - // it could happen, that we get later empty host, when we click on it, but - // this should be much faster. + // We want just sites, but from whole database. if (mConditions.IsEmpty()) { mQueryString = nsPrintfCString(2048, @@ -3196,6 +3194,7 @@ PlacesSQLQueryBuilder::SelectAsSite() "WHERE EXISTS(SELECT '*' " "FROM moz_places " "WHERE hidden <> 1 AND rev_host = '.' " + "AND visit_count > 0 " "AND url BETWEEN 'file://' AND 'file:/~') " "UNION ALL " "SELECT DISTINCT null, " @@ -3204,7 +3203,8 @@ PlacesSQLQueryBuilder::SelectAsSite() "FROM (SELECT get_unreversed_host(rev_host) host " "FROM (SELECT DISTINCT rev_host " "FROM moz_places " - "WHERE hidden <> 1 AND rev_host <> '.') inner0 " + "WHERE hidden <> 1 AND rev_host <> '.' " + "AND visit_count > 0 ) inner0 " "ORDER BY 1 ASC) inner1", nsINavHistoryQueryOptions::RESULTS_AS_URI, nsINavHistoryQueryOptions::SORT_BY_TITLE_ASCENDING, @@ -3222,6 +3222,7 @@ PlacesSQLQueryBuilder::SelectAsSite() "FROM moz_places h " "JOIN moz_historyvisits v ON h.id = v.place_id " "WHERE h.hidden <> 1 AND h.rev_host = '.' " + "AND h.visit_count > 0 " "AND h.url BETWEEN 'file://' AND 'file:/~' " "AND v.visit_type NOT IN (0,4) {ADDITIONAL_CONDITIONS} ) " "UNION ALL " @@ -3234,6 +3235,7 @@ PlacesSQLQueryBuilder::SelectAsSite() "FROM moz_places h " "JOIN moz_historyvisits v ON h.id = v.place_id " "WHERE h.hidden <> 1 AND h.rev_host <> '.' " + "AND h.visit_count > 0 " "AND v.visit_type NOT IN (0,4) " "{ADDITIONAL_CONDITIONS} ) inner0 " "ORDER BY 1 ASC) inner1", diff --git a/toolkit/components/places/tests/unit/test_history_sidebar.js b/toolkit/components/places/tests/unit/test_history_sidebar.js index 0fd6eb548e1..ea6cf7b42ef 100644 --- a/toolkit/components/places/tests/unit/test_history_sidebar.js +++ b/toolkit/components/places/tests/unit/test_history_sidebar.js @@ -206,6 +206,12 @@ function test_RESULTS_AS_DATE_QUERY() { function test_RESULTS_AS_SITE_QUERY() { + // add a bookmark with a domain not in the set of visits in the db + var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"]. + getService(Ci.nsINavBookmarksService); + bmsvc.insertBookmark(bmsvc.toolbarFolder, uri("http://foobar"), + bmsvc.DEFAULT_INDEX, ""); + var options = histsvc.getNewQueryOptions(); options.resultType = options.RESULTS_AS_SITE_QUERY; var query = histsvc.getNewQuery(); @@ -214,7 +220,7 @@ function test_RESULTS_AS_SITE_QUERY() { root.containerOpen = true; do_check_eq(root.childCount, dayLabels.length*2); - // We include this here, se that maintainer knows what is the expected result + // We include this here, so that maintainer knows what is the expected result var expectedResult = [ "mirror0.google.com", From f4e6581a2491beda02edf288835083db85cf1c49 Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Tue, 6 May 2008 21:46:37 -0700 Subject: [PATCH 65/98] Bug 432466. Allow sendNativeKeyEvent to return NS_ERROR_NOT_AVAILABLE to indicate that a keyboard layout is not available. Load keyboard layouts programmatically on Windows so we can detect whether a keyboard is available. This also makes keyboard layouts usable when they're installed but not enabled, which is true for most layouts, so we can reenable the Greek keyboard tests on tinderbox. r=karlt,a=beltzner --- dom/src/base/nsDOMWindowUtils.cpp | 5 ++--- widget/public/nsIWidget.h | 18 ++++++++++-------- widget/src/windows/nsWindow.cpp | 12 ++++++++++-- widget/src/windows/nsWindow.h | 12 ++++++------ widget/src/xpwidgets/nsBaseWidget.h | 11 ++++++----- widget/tests/test_keycodes.xul | 17 ++++++++--------- 6 files changed, 42 insertions(+), 33 deletions(-) diff --git a/dom/src/base/nsDOMWindowUtils.cpp b/dom/src/base/nsDOMWindowUtils.cpp index 82b351fb501..d2e2f0a7379 100644 --- a/dom/src/base/nsDOMWindowUtils.cpp +++ b/dom/src/base/nsDOMWindowUtils.cpp @@ -293,9 +293,8 @@ nsDOMWindowUtils::SendNativeKeyEvent(PRInt32 aNativeKeyboardLayout, if (!widget) return NS_ERROR_FAILURE; - widget->SynthesizeNativeKeyEvent(aNativeKeyboardLayout, aNativeKeyCode, - aModifiers, aCharacters, aUnmodifiedCharacters); - return NS_OK; + return widget->SynthesizeNativeKeyEvent(aNativeKeyboardLayout, aNativeKeyCode, + aModifiers, aCharacters, aUnmodifiedCharacters); } nsIWidget* diff --git a/widget/public/nsIWidget.h b/widget/public/nsIWidget.h index 0c0b795a3d0..28848152064 100644 --- a/widget/public/nsIWidget.h +++ b/widget/public/nsIWidget.h @@ -95,10 +95,10 @@ typedef nsEventStatus (*PR_CALLBACK EVENT_CALLBACK)(nsGUIEvent *event); #define NS_NATIVE_PLUGIN_PORT_CG 101 #endif -// e197eeba-a82b-46d9-8aa9-52e1133fc593 +// 517a0eef-cd1c-48b3-96f0-e341a50f120d #define NS_IWIDGET_IID \ -{ 0xe197eeba, 0xa82b, 0x46d9, \ - { 0x8a, 0xa9, 0x52, 0xe1, 0x13, 0x3f, 0xc5, 0x93 } } +{ 0x517a0eef, 0xcd1c, 0x48b3, \ + { 0x96, 0xf0, 0xe3, 0x41, 0xa5, 0x0f, 0x12, 0x0d } } // Hide the native window systems real window type so as to avoid // including native window system types and APIs. This is necessary @@ -1096,12 +1096,14 @@ class nsIWidget : public nsISupports { * @param aUnmodifiedCharacters characters that the OS would decide * to generate from the event if modifier keys (other than shift) * were assumed inactive. Needed on Mac, ignored on Windows. + * @return NS_ERROR_NOT_AVAILABLE to indicate that the keyboard + * layout is not supported and the event was not fired */ - virtual void SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, - PRInt32 aNativeKeyCode, - PRUint32 aModifierFlags, - const nsAString& aCharacters, - const nsAString& aUnmodifiedCharacters) = 0; + virtual nsresult SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, + PRInt32 aNativeKeyCode, + PRUint32 aModifierFlags, + const nsAString& aCharacters, + const nsAString& aUnmodifiedCharacters) = 0; protected: // keep the list of children. We also keep track of our siblings. diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index 48144611efb..f5dfda68844 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -3556,13 +3556,18 @@ SetupKeyModifiersSequence(nsTArray* aArray, PRUint32 aModifiers) } } -void +nsresult nsWindow::SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, PRInt32 aNativeKeyCode, PRUint32 aModifierFlags, const nsAString& aCharacters, const nsAString& aUnmodifiedCharacters) { + nsPrintfCString layoutName("%08x", aNativeKeyboardLayout); + HKL loadedLayout = LoadKeyboardLayoutA(layoutName.get(), KLF_NOTELLSHELL); + if (loadedLayout == NULL) + return NS_ERROR_NOT_AVAILABLE; + // Setup clean key state and load desired layout BYTE originalKbdState[256]; ::GetKeyboardState(originalKbdState); @@ -3572,7 +3577,7 @@ nsWindow::SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, // and we'll restore it soon, so this should be OK. ::SetKeyboardState(kbdState); HKL oldLayout = gKeyboardLayout; - gKeyboardLayout = (HKL)aNativeKeyboardLayout; + gKeyboardLayout = loadedLayout; gKbdLayout.LoadLayout(gKeyboardLayout); nsAutoTArray keySequence; @@ -3616,6 +3621,9 @@ nsWindow::SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, gKeyboardLayout = oldLayout; gKbdLayout.LoadLayout(gKeyboardLayout); SetupModKeyState(); + + UnloadKeyboardLayout(loadedLayout); + return NS_OK; } void nsWindow::ConstrainZLevel(HWND *aAfter) diff --git a/widget/src/windows/nsWindow.h b/widget/src/windows/nsWindow.h index 066f130148b..170c46cc1bc 100644 --- a/widget/src/windows/nsWindow.h +++ b/widget/src/windows/nsWindow.h @@ -369,12 +369,12 @@ protected: PRBool CanTakeFocus(); - virtual void SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, - PRInt32 aNativeKeyCode, - PRUint32 aModifierFlags, - const nsAString& aCharacters, - const nsAString& aUnmodifiedCharacters); - + virtual nsresult SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, + PRInt32 aNativeKeyCode, + PRUint32 aModifierFlags, + const nsAString& aCharacters, + const nsAString& aUnmodifiedCharacters); + private: diff --git a/widget/src/xpwidgets/nsBaseWidget.h b/widget/src/xpwidgets/nsBaseWidget.h index c4a4fe491d5..4829649c7d2 100644 --- a/widget/src/xpwidgets/nsBaseWidget.h +++ b/widget/src/xpwidgets/nsBaseWidget.h @@ -156,11 +156,12 @@ protected: return mLastRollup; } - virtual void SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, - PRInt32 aNativeKeyCode, - PRUint32 aModifierFlags, - const nsAString& aCharacters, - const nsAString& aUnmodifiedCharacters) {} + virtual nsresult SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, + PRInt32 aNativeKeyCode, + PRUint32 aModifierFlags, + const nsAString& aCharacters, + const nsAString& aUnmodifiedCharacters) + { return NS_ERROR_UNEXPECTED; } protected: void* mClientData; diff --git a/widget/tests/test_keycodes.xul b/widget/tests/test_keycodes.xul index a000451660d..a85423972ce 100644 --- a/widget/tests/test_keycodes.xul +++ b/widget/tests/test_keycodes.xul @@ -322,16 +322,15 @@ function runAccessKeyTests() "A", false); // Greek layout can activate a Latin accesskey -// tests disabled because they currently fail on tinderbox -// testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, -// "a", true); -// testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, -// "A", true); + testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, + "a", true); + testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, + "A", true); // ... and a Greek accesskey! -// testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, -// "\u03b1", true); -// testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, -// "\u0391", true); + testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, + "\u03b1", true); + testKey({layout:"Greek", keyCode:65, shift:1, alt:1, chars:"A"}, + "\u0391", true); } button.removeEventListener("click", onClick, false); From aee401973e58e9ea5476cd04ee108bf47f6d6036 Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Tue, 6 May 2008 22:17:40 -0700 Subject: [PATCH 66/98] Bug 432466, fixing bustage --- widget/src/cocoa/nsChildView.h | 10 +++++----- widget/src/cocoa/nsChildView.mm | 16 +++++++++------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/widget/src/cocoa/nsChildView.h b/widget/src/cocoa/nsChildView.h index 389d4f8760d..e4f7dedbc57 100644 --- a/widget/src/cocoa/nsChildView.h +++ b/widget/src/cocoa/nsChildView.h @@ -385,11 +385,11 @@ protected: virtual NSView* CreateCocoaView(NSRect inFrame); void TearDownView(); - virtual void SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, - PRInt32 aNativeKeyCode, - PRUint32 aModifierFlags, - const nsAString& aCharacters, - const nsAString& aUnmodifiedCharacters); + virtual nsresult SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, + PRInt32 aNativeKeyCode, + PRUint32 aModifierFlags, + const nsAString& aCharacters, + const nsAString& aUnmodifiedCharacters); protected: diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index c0b46fee81b..f0f13c22062 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -1270,13 +1270,13 @@ static const PRUint32 sModifierFlagMap[][2] = { { nsIWidget::HELP, NSHelpKeyMask }, { nsIWidget::FUNCTION, NSFunctionKeyMask } }; -void nsChildView::SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, - PRInt32 aNativeKeyCode, - PRUint32 aModifierFlags, - const nsAString& aCharacters, - const nsAString& aUnmodifiedCharacters) +nsresult nsChildView::SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, + PRInt32 aNativeKeyCode, + PRUint32 aModifierFlags, + const nsAString& aCharacters, + const nsAString& aUnmodifiedCharacters) { - NS_OBJC_BEGIN_TRY_ABORT_BLOCK; + NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; NS_ASSERTION(aNativeKeyboardLayout, "Layout cannot be 0"); @@ -1312,7 +1312,9 @@ void nsChildView::SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, gOverrideKeyboardLayout = currentLayout; } - NS_OBJC_END_TRY_ABORT_BLOCK; + return NS_OK; + + NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } #pragma mark - From c00faa39b0b41f38b461697561fa39c7c13683ec Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Wed, 7 May 2008 03:12:53 -0700 Subject: [PATCH 67/98] Bug 384625 - "Absolute Positioning grabber (mGrabber) hidden and inaccesible" (Max out grabber z-index) [p=amidude99@yahoo.com (Art Skiles) r=glazou sr=Neil] --- editor/composer/src/res/EditorOverride.css | 1 + 1 file changed, 1 insertion(+) diff --git a/editor/composer/src/res/EditorOverride.css b/editor/composer/src/res/EditorOverride.css index 455c112c7b2..1af76bceff5 100644 --- a/editor/composer/src/res/EditorOverride.css +++ b/editor/composer/src/res/EditorOverride.css @@ -225,6 +225,7 @@ span[\_moz_anonclass="mozGrabber"] { background-position: center center; -moz-user-select: none; cursor: move; + z-index: 2147483647; /* max value for this property */ } /* INLINE TABLE EDITING */ From fd5db83e9437d297355244999320bb4403a918fb Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Wed, 7 May 2008 03:13:46 -0700 Subject: [PATCH 68/98] Bug 422172 - ""Automatic proxy configuration URL" reload button does not work" [p=hugues.fournier@gmail.com (Hugues Fournier) r+sr=biesi a1.9=beltzner] --- netwerk/base/src/nsProtocolProxyService.cpp | 11 ++++++----- netwerk/base/src/nsProtocolProxyService.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/netwerk/base/src/nsProtocolProxyService.cpp b/netwerk/base/src/nsProtocolProxyService.cpp index 3b6f4990a49..937fb334e1e 100644 --- a/netwerk/base/src/nsProtocolProxyService.cpp +++ b/netwerk/base/src/nsProtocolProxyService.cpp @@ -498,7 +498,7 @@ nsProtocolProxyService::PrefsChanged(nsIPrefBranch *prefBranch, mSystemProxySettings->GetPACURI(tempString); } if (!tempString.IsEmpty()) - ConfigureFromPAC(tempString); + ConfigureFromPAC(tempString, PR_FALSE); } } @@ -758,7 +758,8 @@ nsProtocolProxyService::IsProxyDisabled(nsProxyInfo *pi) } nsresult -nsProtocolProxyService::ConfigureFromPAC(const nsCString &spec) +nsProtocolProxyService::ConfigureFromPAC(const nsCString &spec, + PRBool forceReload) { if (!mPACMan) { mPACMan = new nsPACMan(); @@ -771,7 +772,7 @@ nsProtocolProxyService::ConfigureFromPAC(const nsCString &spec) if (NS_FAILED(rv)) return rv; - if (mPACMan->IsPACURI(pacURI)) + if (mPACMan->IsPACURI(pacURI) && !forceReload) return NS_OK; mFailedProxies.Clear(); @@ -826,7 +827,7 @@ nsProtocolProxyService::ReloadPAC() pacSpec.AssignLiteral(WPAD_URL); if (!pacSpec.IsEmpty()) - ConfigureFromPAC(pacSpec); + ConfigureFromPAC(pacSpec, PR_TRUE); return NS_OK; } @@ -1256,7 +1257,7 @@ nsProtocolProxyService::Resolve_Internal(nsIURI *uri, !PACURI.IsEmpty()) { // Switch to new PAC file if that setting has changed. If the setting // hasn't changed, ConfigureFromPAC will exit early. - nsresult rv = ConfigureFromPAC(PACURI); + nsresult rv = ConfigureFromPAC(PACURI, PR_FALSE); if (NS_FAILED(rv)) return rv; } else { diff --git a/netwerk/base/src/nsProtocolProxyService.h b/netwerk/base/src/nsProtocolProxyService.h index 97bb49af805..f7d19e16ddc 100644 --- a/netwerk/base/src/nsProtocolProxyService.h +++ b/netwerk/base/src/nsProtocolProxyService.h @@ -114,7 +114,7 @@ protected: * @param pacURI * The URI spec of the PAC file to load. */ - NS_HIDDEN_(nsresult) ConfigureFromPAC(const nsCString &pacURI); + NS_HIDDEN_(nsresult) ConfigureFromPAC(const nsCString &pacURI, PRBool forceReload); /** * This method builds a list of nsProxyInfo objects from the given PAC- From 2439728c4160dc8ba0c90688fa0cddf6c23197a3 Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Wed, 7 May 2008 03:14:51 -0700 Subject: [PATCH 69/98] Bug 430551 - "bookmarks menu popup stays open after dragging bookmark over it" (set attribute "autoopened" on bookmarks menu when dragging) [p=jdarmochwal@gmx.de (Jan Darmochwal) r=Mano a1.9=beltzner] --- browser/base/content/browser-places.js | 1 + 1 file changed, 1 insertion(+) diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index 4be06a0d83f..4d47e0dda93 100644 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -914,6 +914,7 @@ var PlacesMenuDNDController = { delete this._timers.loadTime; if (event.target.id == "bookmarksMenu") { // If this is the bookmarks menu, tell its menupopup child to show. + event.target.lastChild.setAttribute("autoopened", "true"); event.target.lastChild.showPopup(event.target.lastChild); } }, From 9b09692af71c41ab4bb1cce23176a9b3172233fd Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Wed, 7 May 2008 03:16:27 -0700 Subject: [PATCH 70/98] Bug 223442 - "consider moving mac-specific files in gfx/public to a mac directory" (Remove nsWatchTask.h) [p=reg@openpave.org (Jeremy Lea) r+sr=biesi a1.9=beltzner] --- gfx/public/nsWatchTask.h | 105 --------------------------------------- 1 file changed, 105 deletions(-) delete mode 100644 gfx/public/nsWatchTask.h diff --git a/gfx/public/nsWatchTask.h b/gfx/public/nsWatchTask.h deleted file mode 100644 index 16d80a7d77a..00000000000 --- a/gfx/public/nsWatchTask.h +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - - -#ifndef WatchTask_h__ -#define WatchTask_h__ - - -#ifndef XP_MACOSX -#include -#endif -#include -#include "prtypes.h" -#include "gfxCore.h" - -// -// class nsWatchTask -// -// A nice little class that installs/removes a VBL to set the cursor to -// the watch if we're away from the event loop for a while. Will also -// animate the watch cursor. -// - -class nsWatchTask -{ -public: - nsWatchTask ( ) ; - ~nsWatchTask ( ) ; - - // Registers the VBL task and does other various init tasks to begin - // watching for time away from the event loop. It is ok to call other - // methods on this object w/out calling Start(). - NS_GFX void Start ( ) ; - - // call from the main event loop - NS_GFX void EventLoopReached ( ) ; - - // turn off when we know we're going into an area where it's ok - // that WNE is not called (eg, the menu code) - void Suspend ( ) { mSuspended = PR_TRUE; }; - void Resume ( ) { mSuspended = PR_FALSE; }; - - static NS_GFX nsWatchTask& GetTask ( ) ; - -private: - - enum { - kRepeatInterval = 10, // check every 1/6 of a second if we should show watch (10/60) - kTicksToShowWatch = 45, // show watch if haven't seen WNE for 3/4 second (45/60) - kStepsInAnimation = 12 - }; - - // the VBL task - static pascal void DoWatchTask(nsWatchTask* theTaskPtr) ; - -#if !TARGET_CARBON - VBLTask mTask; // this must be first!! -#endif - long mChecksum; // 'mozz' to validate we have real data at interrupt time (not needed?) - void* mSelf; // so we can get back to |this| from the static routine - long mTicks; // last time the event loop was hit - Cursor mWatchCursor; // the watch cursor - PRPackedBool mBusy; // are we currently spinning the cursor? - PRPackedBool mSuspended; // set if we've temporarily suspended operation - PRPackedBool mInstallSucceeded; // did we succeed in installing the task? (used in dtor) - short mAnimation; // stage of animation - -}; - - -#endif From 6ca94d2f96f752b8e668242079fbbda0de94627b Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Wed, 7 May 2008 03:17:22 -0700 Subject: [PATCH 71/98] Bug 431184 - "Composer badly handles XHTML documents" ((Av1) Adds |Components.results.|) [p=sgautherie.bz@free.fr (Serge Gautherie) r+sr=Neil] --- editor/ui/composer/content/ComposerCommands.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/editor/ui/composer/content/ComposerCommands.js b/editor/ui/composer/content/ComposerCommands.js index 35b62e90cbb..79fc27e8a34 100644 --- a/editor/ui/composer/content/ComposerCommands.js +++ b/editor/ui/composer/content/ComposerCommands.js @@ -1657,23 +1657,23 @@ function SaveDocument(aSaveAs, aSaveCopy, aMimeType) { var editor = GetCurrentEditor(); if (!aMimeType || aMimeType == "" || !editor) - throw NS_ERROR_NOT_INITIALIZED; + throw Components.results.NS_ERROR_NOT_INITIALIZED; var editorDoc = editor.document; if (!editorDoc) - throw NS_ERROR_NOT_INITIALIZED; + throw Components.results.NS_ERROR_NOT_INITIALIZED; // if we don't have the right editor type bail (we handle text and html) var editorType = GetCurrentEditorType(); if (editorType != "text" && editorType != "html" && editorType != "htmlmail" && editorType != "textmail") - throw NS_ERROR_NOT_IMPLEMENTED; + throw Components.results.NS_ERROR_NOT_IMPLEMENTED; var saveAsTextFile = IsSupportedTextMimeType(aMimeType); // check if the file is to be saved is a format we don't understand; if so, bail if (aMimeType != "text/html" && !saveAsTextFile) - throw NS_ERROR_NOT_IMPLEMENTED; + throw Components.results.NS_ERROR_NOT_IMPLEMENTED; if (saveAsTextFile) aMimeType = "text/plain"; From b754735e10bc59abee86c2bea987ab4df8edac07 Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Wed, 7 May 2008 03:18:31 -0700 Subject: [PATCH 72/98] Bug 430921 - "chrome mochitest for bug 304188 leaks the world" [p=chris@pearce.org.nz (Chris Pearce [cpearce]) r+sr=peterv a1.9=damons] --- docshell/base/nsDocShell.cpp | 7 +++++++ editor/composer/src/nsEditingSession.cpp | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 3da1422f09f..fbaad68cac9 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -3670,6 +3670,13 @@ nsDocShell::Destroy() // Fire unload event before we blow anything away. (void) FirePageHideNotification(PR_TRUE); + // Clear pointers to any detached nsEditorData that's lying + // around in shistory entries. Breaks cycle. See bug 430921. + if (mOSHE) + mOSHE->SetEditorData(nsnull); + if (mLSHE) + mLSHE->SetEditorData(nsnull); + // Note: mContentListener can be null if Init() failed and we're being // called from the destructor. if (mContentListener) { diff --git a/editor/composer/src/nsEditingSession.cpp b/editor/composer/src/nsEditingSession.cpp index 56862f20207..565e9117485 100644 --- a/editor/composer/src/nsEditingSession.cpp +++ b/editor/composer/src/nsEditingSession.cpp @@ -1407,7 +1407,6 @@ nsEditingSession::DetachFromWindow(nsIDOMWindow* aWindow) if (!mDoneSetup) return NS_OK; - NS_ASSERTION(mEditorFlags != 0, "mEditorFlags should not be 0"); NS_ASSERTION(mStateMaintainer, "mStateMaintainer should exist."); // Kill any existing reload timer @@ -1437,7 +1436,6 @@ nsEditingSession::ReattachToWindow(nsIDOMWindow* aWindow) if (!mDoneSetup) return NS_OK; - NS_ASSERTION(mEditorFlags != 0, "mEditorFlags should still be valid..."); NS_ASSERTION(mStateMaintainer, "mStateMaintainer should exist."); // Imitate nsEditorDocShell::MakeEditable() to reattach the From fb6fe8390ccb7c88a9badd6282cf70279d80aca2 Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Wed, 7 May 2008 03:21:11 -0700 Subject: [PATCH 73/98] Bug 432492 - "rate limit long-running safebrowsing updates" [p=dcamp@mozilla.com (Dave Camp) r=tony a1.9=beltzner] --- .../public/nsIUrlClassifierDBService.idl | 4 +- .../src/nsUrlClassifierDBService.cpp | 154 ++++++++++++++---- .../src/nsUrlClassifierStreamUpdater.cpp | 91 ++++++++--- .../src/nsUrlClassifierStreamUpdater.h | 8 +- 4 files changed, 200 insertions(+), 57 deletions(-) diff --git a/toolkit/components/url-classifier/public/nsIUrlClassifierDBService.idl b/toolkit/components/url-classifier/public/nsIUrlClassifierDBService.idl index e9386fb060e..0f7574a9a06 100644 --- a/toolkit/components/url-classifier/public/nsIUrlClassifierDBService.idl +++ b/toolkit/components/url-classifier/public/nsIUrlClassifierDBService.idl @@ -83,8 +83,10 @@ interface nsIUrlClassifierUpdateObserver : nsISupports { * A stream update has completed. * * @param status The state of the update process. + * @param delay The amount of time the updater should wait to fetch the + * next URL in ms. */ - void streamFinished(in nsresult status); + void streamFinished(in nsresult status, in unsigned long delay); /* The update has encountered an error and should be cancelled */ void updateError(in nsresult error); diff --git a/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp index 7abcd41c25a..fbb73fb656b 100644 --- a/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp @@ -154,6 +154,17 @@ static const PRLogModuleInfo *gUrlClassifierDbServiceLog = nsnull; #define UPDATE_CACHE_SIZE_PREF "urlclassifier.updatecachemax" #define UPDATE_CACHE_SIZE_DEFAULT -1 +// Amount of time to spend updating before committing and delaying, in +// seconds. This is checked after each update stream, so the actual +// time spent can be higher than this, depending on update stream size. +#define UPDATE_WORKING_TIME "urlclassifier.workingtime" +#define UPDATE_WORKING_TIME_DEFAULT 5 + +// The amount of time to delay after hitting UPDATE_WORKING_TIME, in +// seconds. +#define UPDATE_DELAY_TIME "urlclassifier.updatetime" +#define UPDATE_DELAY_TIME_DEFAULT 60 + #define PAGE_SIZE 4096 class nsUrlClassifierDBServiceWorker; @@ -172,6 +183,9 @@ static PRInt32 gFreshnessGuarantee = CONFIRM_AGE_DEFAULT_SEC; static PRInt32 gUpdateCacheSize = UPDATE_CACHE_SIZE_DEFAULT; +static PRInt32 gWorkingTimeThreshold = UPDATE_WORKING_TIME_DEFAULT; +static PRInt32 gDelayTime = UPDATE_DELAY_TIME_DEFAULT; + static void SplitTables(const nsACString& str, nsTArray& tables) { @@ -1102,6 +1116,12 @@ private: // Handle chunk data from a stream update nsresult ProcessChunk(PRBool* done); + // Sets up a transaction and begins counting update time. + nsresult SetupUpdate(); + + // Applies the current transaction and resets the update/working times. + nsresult ApplyUpdate(); + // Reset the in-progress update stream void ResetStream(); @@ -1217,6 +1237,10 @@ private: // The MAC stated by the server. nsCString mServerMAC; + // Start time of the current update interval. This will be reset + // every time weapply the update. + PRIntervalTime mUpdateStartTime; + nsCOMPtr mHMAC; // The number of noise entries to add to the set of lookup results. PRInt32 mGethashNoise; @@ -1256,6 +1280,7 @@ nsUrlClassifierDBServiceWorker::nsUrlClassifierDBServiceWorker() , mCachedListsTable(PR_UINT32_MAX) , mHaveCachedAddChunks(PR_FALSE) , mHaveCachedSubChunks(PR_FALSE) + , mUpdateStartTime(0) , mGethashNoise(0) , mPendingLookupLock(nsnull) { @@ -2757,19 +2782,7 @@ nsUrlClassifierDBServiceWorker::BeginUpdate(nsIUrlClassifierUpdateObserver *obse return rv; } - if (gUpdateCacheSize > 0) { - PRUint32 cachePages = gUpdateCacheSize / PAGE_SIZE; - nsCAutoString cacheSizePragma("PRAGMA cache_size="); - cacheSizePragma.AppendInt(cachePages); - rv = mConnection->ExecuteSimpleSQL(cacheSizePragma); - if (NS_FAILED(rv)) { - mUpdateStatus = rv; - return rv; - } - mGrewCache = PR_TRUE; - } - - rv = mConnection->BeginTransaction(); + rv = SetupUpdate(); if (NS_FAILED(rv)) { mUpdateStatus = rv; return rv; @@ -2801,9 +2814,15 @@ nsUrlClassifierDBServiceWorker::BeginStream(const nsACString &table, NS_ENSURE_STATE(mUpdateObserver); NS_ENSURE_STATE(!mInStream); - mInStream = PR_TRUE; + // We may have committed the update in FinishStream, if so set it up + // again here. + nsresult rv = SetupUpdate(); + if (NS_FAILED(rv)) { + mUpdateStatus = rv; + return rv; + } - nsresult rv; + mInStream = PR_TRUE; // If we're expecting a MAC, create the nsICryptoHMAC component now. if (!mUpdateClientKey.IsEmpty()) { @@ -2941,6 +2960,8 @@ nsUrlClassifierDBServiceWorker::FinishStream() NS_ENSURE_STATE(mInStream); NS_ENSURE_STATE(mUpdateObserver); + PRInt32 nextStreamDelay = 0; + if (NS_SUCCEEDED(mUpdateStatus) && mHMAC) { nsCAutoString clientMAC; mHMAC->Finish(PR_TRUE, clientMAC); @@ -2951,15 +2972,80 @@ nsUrlClassifierDBServiceWorker::FinishStream() mServerMAC.get(), clientMAC.get())); mUpdateStatus = NS_ERROR_FAILURE; } + PRIntervalTime updateTime = PR_IntervalNow() - mUpdateStartTime; + if (PR_IntervalToSeconds(updateTime) >= + static_cast(gWorkingTimeThreshold)) { + // We've spent long enough working that we should commit what we + // have and hold off for a bit. + ApplyUpdate(); + + nextStreamDelay = gDelayTime * 1000; + } } - mUpdateObserver->StreamFinished(mUpdateStatus); + mUpdateObserver->StreamFinished(mUpdateStatus, + static_cast(nextStreamDelay)); ResetStream(); return NS_OK; } +nsresult +nsUrlClassifierDBServiceWorker::SetupUpdate() +{ + LOG(("nsUrlClassifierDBServiceWorker::SetupUpdate")); + PRBool inProgress; + nsresult rv = mConnection->GetTransactionInProgress(&inProgress); + if (inProgress) { + return NS_OK; + } + + mUpdateStartTime = PR_IntervalNow(); + + rv = mConnection->BeginTransaction(); + NS_ENSURE_SUCCESS(rv, rv); + + if (gUpdateCacheSize > 0) { + PRUint32 cachePages = gUpdateCacheSize / PAGE_SIZE; + nsCAutoString cacheSizePragma("PRAGMA cache_size="); + cacheSizePragma.AppendInt(cachePages); + rv = mConnection->ExecuteSimpleSQL(cacheSizePragma); + NS_ENSURE_SUCCESS(rv, rv); + mGrewCache = PR_TRUE; + } + + return NS_OK; +} + +nsresult +nsUrlClassifierDBServiceWorker::ApplyUpdate() +{ + LOG(("nsUrlClassifierDBServiceWorker::ApplyUpdate")); + + if (NS_FAILED(mUpdateStatus)) { + mConnection->RollbackTransaction(); + } else { + mUpdateStatus = FlushChunkLists(); + if (NS_SUCCEEDED(mUpdateStatus)) { + mUpdateStatus = mConnection->CommitTransaction(); + } + } + + if (mGrewCache) { + // During the update we increased the page cache to bigger than we + // want to keep around. At the moment, the only reliable way to make + // sure that the page cache is freed is to reopen the connection. + mGrewCache = PR_FALSE; + CloseDb(); + OpenDb(); + } + + mUpdateStartTime = 0; + + return NS_OK; +} + NS_IMETHODIMP nsUrlClassifierDBServiceWorker::FinishUpdate() { @@ -2969,16 +3055,7 @@ nsUrlClassifierDBServiceWorker::FinishUpdate() NS_ENSURE_STATE(!mInStream); NS_ENSURE_STATE(mUpdateObserver); - if (NS_SUCCEEDED(mUpdateStatus)) { - mUpdateStatus = FlushChunkLists(); - } - - nsCAutoString arg; - if (NS_SUCCEEDED(mUpdateStatus)) { - mUpdateStatus = mConnection->CommitTransaction(); - } else { - mConnection->RollbackTransaction(); - } + ApplyUpdate(); if (NS_SUCCEEDED(mUpdateStatus)) { mUpdateObserver->UpdateSuccess(mUpdateWait); @@ -3011,13 +3088,6 @@ nsUrlClassifierDBServiceWorker::FinishUpdate() // database reset. if (NS_SUCCEEDED(mUpdateStatus) && resetRequested) { ResetDatabase(); - } else if (mGrewCache) { - // During the update we increased the page cache to bigger than we - // want to keep around. At the moment, the only reliable way to make - // sure that the page cache is freed is to reopen the connection. - mGrewCache = PR_FALSE; - CloseDb(); - OpenDb(); } return NS_OK; @@ -3668,6 +3738,14 @@ nsUrlClassifierDBService::Init() rv = prefs->GetIntPref(UPDATE_CACHE_SIZE_PREF, &tmpint); PR_AtomicSet(&gUpdateCacheSize, NS_SUCCEEDED(rv) ? tmpint : UPDATE_CACHE_SIZE_DEFAULT); + + rv = prefs->GetIntPref(UPDATE_WORKING_TIME, &tmpint); + PR_AtomicSet(&gWorkingTimeThreshold, + NS_SUCCEEDED(rv) ? tmpint : UPDATE_WORKING_TIME_DEFAULT); + + rv = prefs->GetIntPref(UPDATE_DELAY_TIME, &tmpint); + PR_AtomicSet(&gDelayTime, + NS_SUCCEEDED(rv) ? tmpint : UPDATE_DELAY_TIME_DEFAULT); } // Start the background thread. @@ -3960,6 +4038,16 @@ nsUrlClassifierDBService::Observe(nsISupports *aSubject, const char *aTopic, PRInt32 tmpint; rv = prefs->GetIntPref(UPDATE_CACHE_SIZE_PREF, &tmpint); PR_AtomicSet(&gUpdateCacheSize, NS_SUCCEEDED(rv) ? tmpint : UPDATE_CACHE_SIZE_DEFAULT); + } else if (NS_LITERAL_STRING(UPDATE_WORKING_TIME).Equals(aData)) { + PRInt32 tmpint; + rv = prefs->GetIntPref(UPDATE_WORKING_TIME, &tmpint); + PR_AtomicSet(&gWorkingTimeThreshold, + NS_SUCCEEDED(rv) ? tmpint : UPDATE_WORKING_TIME_DEFAULT); + } else if (NS_LITERAL_STRING(UPDATE_DELAY_TIME).Equals(aData)) { + PRInt32 tmpint; + rv = prefs->GetIntPref(UPDATE_DELAY_TIME, &tmpint); + PR_AtomicSet(&gDelayTime, + NS_SUCCEEDED(rv) ? tmpint : UPDATE_DELAY_TIME_DEFAULT); } } else if (!strcmp(aTopic, "profile-before-change") || !strcmp(aTopic, "xpcom-shutdown-threads")) { diff --git a/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp b/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp index 5dad171e349..fa1086a7cdc 100644 --- a/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp +++ b/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp @@ -75,7 +75,7 @@ nsUrlClassifierStreamUpdater::nsUrlClassifierStreamUpdater() } -NS_IMPL_THREADSAFE_ISUPPORTS8(nsUrlClassifierStreamUpdater, +NS_IMPL_THREADSAFE_ISUPPORTS9(nsUrlClassifierStreamUpdater, nsIUrlClassifierStreamUpdater, nsIUrlClassifierUpdateObserver, nsIRequestObserver, @@ -83,7 +83,8 @@ NS_IMPL_THREADSAFE_ISUPPORTS8(nsUrlClassifierStreamUpdater, nsIObserver, nsIBadCertListener2, nsISSLErrorListener, - nsIInterfaceRequestor) + nsIInterfaceRequestor, + nsITimerCallback) /** * Clear out the update. @@ -271,29 +272,54 @@ nsUrlClassifierStreamUpdater::RekeyRequested() nsnull); } -NS_IMETHODIMP -nsUrlClassifierStreamUpdater::StreamFinished(nsresult status) +nsresult +nsUrlClassifierStreamUpdater::FetchNext() { - nsresult rv; + if (mPendingUpdates.Length() == 0) { + return NS_OK; + } - // Pop off a pending URL and update it. - if (NS_SUCCEEDED(status) && mPendingUpdates.Length() > 0) { - PendingUpdate &update = mPendingUpdates[0]; - rv = FetchUpdate(update.mUrl, EmptyCString(), - update.mTable, update.mServerMAC); - if (NS_FAILED(rv)) { - LOG(("Error fetching update url: %s\n", update.mUrl.get())); - // We can commit the urls that we've applied so far. This is - // probably a transient server problem, so trigger backoff. - mDownloadErrorCallback->HandleEvent(EmptyCString()); - mDownloadError = PR_TRUE; - mDBService->FinishUpdate(); - return rv; - } - - mPendingUpdates.RemoveElementAt(0); - } else { + PendingUpdate &update = mPendingUpdates[0]; + LOG(("Fetching update url: %s\n", update.mUrl.get())); + nsresult rv = FetchUpdate(update.mUrl, EmptyCString(), + update.mTable, update.mServerMAC); + if (NS_FAILED(rv)) { + LOG(("Error fetching update url: %s\n", update.mUrl.get())); + // We can commit the urls that we've applied so far. This is + // probably a transient server problem, so trigger backoff. + mDownloadErrorCallback->HandleEvent(EmptyCString()); + mDownloadError = PR_TRUE; mDBService->FinishUpdate(); + return rv; + } + + mPendingUpdates.RemoveElementAt(0); + + return NS_OK; +} + +NS_IMETHODIMP +nsUrlClassifierStreamUpdater::StreamFinished(nsresult status, + PRUint32 requestedDelay) +{ + LOG(("nsUrlClassifierStreamUpdater::StreamFinished [%x, %d]", status, requestedDelay)); + if (NS_FAILED(status) || mPendingUpdates.Length() == 0) { + // We're done. + mDBService->FinishUpdate(); + return NS_OK; + } + + // Wait the requested amount of time before starting a new stream. + nsresult rv; + mTimer = do_CreateInstance("@mozilla.org/timer;1", &rv); + if (NS_SUCCEEDED(rv)) { + rv = mTimer->InitWithCallback(this, requestedDelay, + nsITimer::TYPE_ONE_SHOT); + } + + if (NS_FAILED(rv)) { + NS_WARNING("Unable to initialize timer, fetching next safebrowsing item immediately"); + return FetchNext(); } return NS_OK; @@ -500,6 +526,10 @@ nsUrlClassifierStreamUpdater::Observe(nsISupports *aSubject, const char *aTopic, mIsUpdating = PR_FALSE; mChannel = nsnull; } + if (mTimer) { + mTimer->Cancel(); + mTimer = nsnull; + } } return NS_OK; } @@ -538,3 +568,20 @@ nsUrlClassifierStreamUpdater::GetInterface(const nsIID & eventSinkIID, void* *_r { return QueryInterface(eventSinkIID, _retval); } + + +/////////////////////////////////////////////////////////////////////////////// +// nsITimerCallback implementation +NS_IMETHODIMP +nsUrlClassifierStreamUpdater::Notify(nsITimer *timer) +{ + LOG(("nsUrlClassifierStreamUpdater::Notify [%p]", this)); + + mTimer = nsnull; + + // Start the update process up again. + FetchNext(); + + return NS_OK; +} + diff --git a/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.h b/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.h index 5048b322f37..7279d72e8bb 100644 --- a/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.h +++ b/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.h @@ -49,6 +49,7 @@ #include "nsTArray.h" #include "nsIBadCertListener2.h" #include "nsISSLErrorListener.h" +#include "nsITimer.h" // Forward declare pointers class nsIURI; @@ -59,7 +60,8 @@ class nsUrlClassifierStreamUpdater : public nsIUrlClassifierStreamUpdater, public nsIObserver, public nsIBadCertListener2, public nsISSLErrorListener, - public nsIInterfaceRequestor + public nsIInterfaceRequestor, + public nsITimerCallback { public: nsUrlClassifierStreamUpdater(); @@ -73,6 +75,7 @@ public: NS_DECL_NSIBADCERTLISTENER2 NS_DECL_NSISSLERRORLISTENER NS_DECL_NSIOBSERVER + NS_DECL_NSITIMERCALLBACK private: // No subclassing @@ -96,6 +99,8 @@ private: const nsACString &aTable, const nsACString &aServerMAC); + nsresult FetchNext(); + PRBool mIsUpdating; PRBool mInitialized; PRBool mDownloadError; @@ -105,6 +110,7 @@ private: nsCString mServerMAC; nsCOMPtr mChannel; nsCOMPtr mDBService; + nsCOMPtr mTimer; struct PendingUpdate { nsCString mUrl; From 2d1c8b37c9003a9a484c5dcc2ec90570a21032d5 Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Wed, 7 May 2008 03:22:17 -0700 Subject: [PATCH 74/98] Bug 432492 - "rate limit long-running safebrowsing updates" [p=dcamp@mozilla.com (Dave Camp) r=tony a1.9=beltzner] --- .../components/url-classifier/src/nsUrlClassifierDBService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp index fbb73fb656b..c2619783af2 100644 --- a/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp @@ -1238,7 +1238,7 @@ private: nsCString mServerMAC; // Start time of the current update interval. This will be reset - // every time weapply the update. + // every time we apply the update. PRIntervalTime mUpdateStartTime; nsCOMPtr mHMAC; From 3cd803c5a8791e83c8304a156540f246ee475a7e Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Wed, 7 May 2008 03:23:08 -0700 Subject: [PATCH 75/98] Bug 431703 - "Crash [@ nsXMLContentSink::HandleEndElement] setting innerHTML with SVG, onload" (null check) [p=longsonr@gmail.com (Robert Longson) r+sr=bzbarsky a1.9=beltzner] --- content/xml/document/src/nsXMLContentSink.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/xml/document/src/nsXMLContentSink.cpp b/content/xml/document/src/nsXMLContentSink.cpp index 9cf68c6ee86..a5c102706dd 100644 --- a/content/xml/document/src/nsXMLContentSink.cpp +++ b/content/xml/document/src/nsXMLContentSink.cpp @@ -1156,7 +1156,8 @@ nsXMLContentSink::HandleEndElement(const PRUnichar *aName, DidAddContent(); #ifdef MOZ_SVG - if (content->GetNameSpaceID() == kNameSpaceID_SVG && + if (mDocument && + content->GetNameSpaceID() == kNameSpaceID_SVG && content->HasAttr(kNameSpaceID_None, nsGkAtoms::onload)) { FlushTags(); From 888518dda2b5b9286a9cac9eca9e7e6198f76f19 Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Wed, 7 May 2008 03:26:52 -0700 Subject: [PATCH 76/98] Bug 410606 - "AIX linker error for trunk build xpconnect module : ERROR: Undefined symbol: .JSAutoTempValueRooter::operator delete(void*,unsigned long)" [p=shailen.n.jain@gmail.com (Shailen) r+sr=mrbkap a1.9=beltzner] --- js/src/jscntxt.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/src/jscntxt.h b/js/src/jscntxt.h index dbb827d0a46..a63d6ece738 100644 --- a/js/src/jscntxt.h +++ b/js/src/jscntxt.h @@ -818,8 +818,10 @@ class JSAutoTempValueRooter } private: +#ifndef AIX static void *operator new(size_t); static void operator delete(void *, size_t); +#endif JSContext *mContext; JSTempValueRooter mTvr; From 0064c71a2adaa1cfdf6c1704f10a73580b1a8c49 Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Wed, 7 May 2008 03:27:35 -0700 Subject: [PATCH 77/98] Bug 431358 - "DOM Inspector doesn't work in Sunbird 0.6a1 Trunk builds" (use correct trunk version) [p=ssitter@gmail.com (Stefan Sitter) r=sdwilsh] --- extensions/inspector/install.rdf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/inspector/install.rdf b/extensions/inspector/install.rdf index 19d1c64bec0..db0382685c5 100644 --- a/extensions/inspector/install.rdf +++ b/extensions/inspector/install.rdf @@ -30,8 +30,8 @@ {718e30fb-e89b-41dd-9da7-e25a45638b28} - 0.8pre - 0.8.* + 0.6a1 + 0.6a1 From 595ff4a4f3a891cc10ae1f83404b81323c281ba9 Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Wed, 7 May 2008 03:30:57 -0700 Subject: [PATCH 78/98] Bug 424286 - "Use different icons for all special folders (all bookmarks, bookmark menu, bookmark sidebar, tags, history, unsorted bookmarks)" (Unfiled bookmarks icon for Tango) [p=michael.monreal@gmx.net (Michael Monreal) / ventnor.bugzilla@yahoo.com.au (Michael Ventnor) r=Mano ui-r+a1.9=beltzner] --- browser/themes/gnomestripe/browser/jar.mn | 1 + .../themes/gnomestripe/browser/places/places.css | 5 +++++ .../browser/places/unsortedBookmarks.png | Bin 0 -> 748 bytes 3 files changed, 6 insertions(+) create mode 100644 browser/themes/gnomestripe/browser/places/unsortedBookmarks.png diff --git a/browser/themes/gnomestripe/browser/jar.mn b/browser/themes/gnomestripe/browser/jar.mn index f8f686f4b6d..d9d577a0579 100644 --- a/browser/themes/gnomestripe/browser/jar.mn +++ b/browser/themes/gnomestripe/browser/jar.mn @@ -48,6 +48,7 @@ classic.jar: skin/classic/browser/places/starPage.png (places/starPage.png) skin/classic/browser/places/tag.png (places/tag.png) skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png) + skin/classic/browser/places/unsortedBookmarks.png (places/unsortedBookmarks.png) skin/classic/browser/places/wrench.png (places/wrench.png) skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png) skin/classic/browser/preferences/application.png (preferences/application.png) diff --git a/browser/themes/gnomestripe/browser/places/places.css b/browser/themes/gnomestripe/browser/places/places.css index ff99fdbe2a5..1ef422e72a4 100755 --- a/browser/themes/gnomestripe/browser/places/places.css +++ b/browser/themes/gnomestripe/browser/places/places.css @@ -60,6 +60,11 @@ treechildren::-moz-tree-image(container, OrganizerQuery_BookmarksMenu) { -moz-image-region: auto; } +treechildren::-moz-tree-image(container, OrganizerQuery_UnfiledBookmarks) { + list-style-image: url("chrome://browser/skin/places/unsortedBookmarks.png"); + -moz-image-region: auto; +} + /* query-nodes should be styled even if they're not expandable */ treechildren::-moz-tree-image(title, query) { list-style-image: url("chrome://browser/skin/places/query.png"); diff --git a/browser/themes/gnomestripe/browser/places/unsortedBookmarks.png b/browser/themes/gnomestripe/browser/places/unsortedBookmarks.png new file mode 100644 index 0000000000000000000000000000000000000000..4dcf761389fee2a8f067c0673d8ea59b48832e52 GIT binary patch literal 748 zcmVDy6wsp1NoCrYaIrOVSdK zm7NAE{*|<2g6<~eIB*W|XqtX2r@TD{#m>O9qA4NFhroBBtDsU&MgjE=by>QuH3}i} z&w3u{DH)eJ=*hz2^5XWC0t%}OuUKE5VR`-|)59(F&EGLKP3`urGg=1r>0YxJ4f=|Ee1TeB{N@cX>Uyy@%! za&Q_E)>I@b3)Pl{ zkTFOky6q5(>SB5^o((y-;}N3(_W?J#Ik{{sz93c>6C8ccw|877y6ebj20>jPP+)EZiA%yP{0OMbtz-k}jXdZ-@2#3PE0g*_Ap6*@%RP{C| z(@x+v-2kjAR~efNV9ovndUsne41=1g8_~;=(Gfbk-eOtSZ=g!xd?D#+>Cqg+F#Z5+ z7RR=VPAflF7# Date: Wed, 7 May 2008 03:54:06 -0700 Subject: [PATCH 79/98] Bug 418868 - "M3 Tango" (*Ghosted-64.png icons) [p=michael.monreal@gmx.net (Michael Monreal) / Tango team ui-r=faaborg a1.9=beltzner] --- .../gnomestripe/global/icons/errorGhosted-64.png | Bin 0 -> 1331 bytes .../global/icons/informationGhosted-64.png | Bin 0 -> 1687 bytes .../global/icons/questionGhosted-64.png | Bin 0 -> 1720 bytes .../global/icons/warningGhosted-64.png | Bin 0 -> 1680 bytes toolkit/themes/gnomestripe/global/jar.mn | 4 ++++ 5 files changed, 4 insertions(+) create mode 100644 toolkit/themes/gnomestripe/global/icons/errorGhosted-64.png create mode 100644 toolkit/themes/gnomestripe/global/icons/informationGhosted-64.png create mode 100644 toolkit/themes/gnomestripe/global/icons/questionGhosted-64.png create mode 100644 toolkit/themes/gnomestripe/global/icons/warningGhosted-64.png diff --git a/toolkit/themes/gnomestripe/global/icons/errorGhosted-64.png b/toolkit/themes/gnomestripe/global/icons/errorGhosted-64.png new file mode 100644 index 0000000000000000000000000000000000000000..9d9063bca22162a18e6935291c6b1c51cc250c7f GIT binary patch literal 1331 zcmV-31Aq)n-$n~sO~ zc4s%cJ3BKw^Cr9bTsFzRdGq~#^WN;+ncph~LBM)uAnz0S+Pf2Y3fKmW0%LWrW42it zn6t0dpU(r|OQHVDQ(q~M5#VcY3$O=x0eA+uJ7rflfUkkifiI;{|7N2wB+~$V?d=6# z1t!UUbX9;KfDffm$Fk})lK_0}JpsH6?C83)c$@~_ltTT~ZAV=N;A?Lia0Gb1TOlbq z4jhz1olo0AssMcLZ2;Z|-T*eHJ$Xi~0Pg|QQmETW4^A9_uf6+#Pl0EXo-Aj+0$!9t zT}yIMq5ypDJq(-x9!;jr8NUKkQmEhK9b@9l8H2T%ma^0q5g!(E8Ueocb^tRDL>0kKDb(ruKeQSF?>G`u1Wn!=0`RrB2iWCIj(c`l zk2O}0fY%&~DT)S(Dp?cGLgn!Fb$V{iQyDqVDPxLCtF^ z2m*ZV-2q$%HW#PKDT}~XDb%g%2$*F3mQz%wM@2)o2XD07j!)jtp<5RO%J;hT)+Ru3Vib;)c&Cgi|1L1oWDDh^2W9 z!T=&iK%WwS1oSBlBVawO09UgK!T`zz3Mq;*gaOPID5NOnAZ7s9ml8d0TN5nZSc>`x z1narF4v3rrv*o`S7#Qf8kHa81&Jwwn%C6sfD~#0Q(&}^ zgD6)lU`l7(dWftOltO7>AEqL^*H{7eSr2XLSSxJj&i<@aIb?skd0$VgVrePV2fzU! zaXo$k+y)L<%^gWvF8>^+di0)j+Hz+Jcu5NNMcf0@Y?ycqQ$PG*GHto@C+33pbCQE% z?-!_IPq3Y}RZBPnY)@()QUm}Xh584W0A2xR)AW%MvsS}|)s&d7x6S$5y9;<7vwR-x zsPcWPrW)&k zF1!32a|`Pj=4NKcCmu=2W$$nmUwb8BCng9*xM})+n)e&70G9|iPkR{SGp)YGWks$5 pw8PilMob9xyT>m{p`0(d{|7?3Uz#OE&(8n=002ovPDHLkV1oHeN>u;= literal 0 HcmV?d00001 diff --git a/toolkit/themes/gnomestripe/global/icons/informationGhosted-64.png b/toolkit/themes/gnomestripe/global/icons/informationGhosted-64.png new file mode 100644 index 0000000000000000000000000000000000000000..35997d6ec68cd8a1b89aba7d0a1b120ab4f8f3bf GIT binary patch literal 1687 zcmV;I259+-P)94_x3+fD0Fd_#+S!5(07wGB?DfQXPV0E-7v7B;+?Z@jCWS58fCjUMI1$ zvk4{Ni?wgo^M35SH*aR%2q`6BGIZ4pCMG6=tL4=T0(lCEf#^dJL&`p&&weeBq<|24 zka?gW5pP09=y^OIFR7GIs2Bm6OeSg=zDp7=BNzfA9d=bjGA!Uxxmovj0NL#5fYh|x0?xT0)3%WCN?6v7Wb#aU zw|(u(0ORAMXDy-K5^!<1f^-52&opV>JbCiWU!C^Rkpa@_wBFm-a|iex&^l%A5-i}} zRDS0Az`#JI-9NW&fJ`P6H3Gf|5(e94rV;{1%4YRyyMeMT17x$=1e*02NVF@UN62Am zza^8&+)n?nQD5K zZ1>`}2FPZ!34GQ|BvIGI^8$hes@nPO++j->$Ye56H0$war#yfpie^2|WHMXI-qHZ+ zbXqq8z6W^V^SbUQ9FCy-T=%eq5%4`or_(JvZrRY=*K@~J4@bZ520%*5?A&|i z=4V~&U&5fBv;5)I?id5c$4Adfq5X;CBT;wX?mFT&E6vuaxnVOQn;jkSDz|Sr0}0_eF98>`+0lW`^d7MB)TT3*~pTU=m%VO|M80q3%BUtejYZI}h@ z%?wXbn94IZKa1fvFv})uYimmR2`R1t4?jKIewfK*qW*wyhR-M6?G%+Yv)Z%1YOK3} zVfZfb|5qMBw{-;?3?Sk1-pJ!U8g&&?N+u>If~E4xES>M(?iz++p!;-IR#&`WR}32A z?sz<2(gAAw_G*>absb&zLVo zKjPDTTfS3V`KVfqI&7VvuE&6wYKHm3B=2XZDVNQb?-W;xs>NtT4C+BpG_OcpMzQ#j zx%oLJ3zLrRrdgs=X?s(57pUo6Gk{P(0_tpA>AFt92sBHvDf{a^9&>!pbx4NS%kS!mkbp<3_=Q5v*&jfu z^r-}}`{*&czB-I0EmdOF(Wq|2(W7g_$G=0Kzo0$w!M5p7rtNFnd5VCvWX zj`Z)o`JUrFF-)_>^z@Vp)=k)~;|2pHPn>=z;g#D=OJ?hG-%@Fnex^IO#q9~4S%*H1E; z%vqAFC`ywRp<+p{?xbjXM^U~%(LZ9r5CYfl?6?lW!cOai;hiPXR zI|vwAGppPB{ARSB=%iAqg+hL22)Ik_y2@U|0`3;_GeezRt2?+fb#QI&;Ns-L)mgXu h+<-6g^7Q9~{{UHlv-5W6@VNj0002ovPDHLkV1ghlB%J^N literal 0 HcmV?d00001 diff --git a/toolkit/themes/gnomestripe/global/icons/questionGhosted-64.png b/toolkit/themes/gnomestripe/global/icons/questionGhosted-64.png new file mode 100644 index 0000000000000000000000000000000000000000..15f9aa02ae59b6a12d9eb65ff39848b8999c4d42 GIT binary patch literal 1720 zcmV;p21ogcP)ktU7+c{P?Z)0rAU+)UfQY>7jp%I7FxA5>5`dbCYc$V2VW1JWG0#A+LQ0i z*VpHs-_IGxKF5xEo<}Eelw1kCtvB!3mU!HWJYrEB;3)Y9@EP#_j9u4(Pi;%wi!z@` z4RDnF5I76;)|rw8cG{NsCaRnwGr&=DJ#Yy~&ogxj*k)Ve>+rLJcod5`N^YPr@#s01 z^f93mx&e-o8-a^7CO#kyT-3*gN~i`nN^YWg@d1Geo6KfaO=t!@q<{-L zRw#sGfTQFV;5_Y#4@d#$bxh+JH^5PHD{u}o;sa8^IUU<5Mhyr_d_X8B7&E|8atL31 z(p1bEB=JocG8NE>0gjT}@bB=#6d#ZT&gwPWrfmZpC5MSld_Z8raJzxpGQd%CJ8%X_ zw3|o^B!DwIhn8vC07uD>fYWqFd_V#?t#fIKmJD!|+yR`Tv*H61z$u+m(==^>qvS5& zBnv})Kms_ab8CvG3~-d(4UDj`#0MmR5uIbhG;DyQ z$-Thm7!aRKCK>1-B%Ml=Or>yLm*Vs^`9hxOFP`DLZo5kWlz{`bB~H#aab5!)CHDcx zF(7{VvK0&tEG3&8C!5QXOe9!3xSXyoKXj>7;_;J5WV7S#E(N{`2W?A?%r$9F0~{qk z299As{L;Z?EMK;QQn|$Mf2hj%;zf&j{k7GVZO`+#|Ia=0`N?*d1mA>1wk1x~n^5-} z;3&BtLuVd*0{{|T2{M_U%J^h{lBuaeWjhv&@#@M|CYA(0_v2biO==q8D0u+?%o}-D zNT<7r$NvvC&_7tUe`L_Tj zj*{;HhY7h#?7HqO@u^g*O1$g3Jo@)hm}$g;!&)=3Uw`{01>6Qin5)*~m6faL@9PKr z`+x@z|0Z9^N3pa7)+T^;bVz(6k)&@)9{|~0mPd~t*1RBwgaFnhfVEMrIFr65eZ*oh zM#r8oI`*U!DXfj--z{~7Os1!k;sMHW;7+Gj?@o7{y5((^J8}FA;N4EFUYIJ(x(keu zyTI+3=Xp3vt^u8to!g|TjCtB2g4?Kp2zbS&#K0;Shz5!hv0;?jH*8+!iNfp+S^ z3!NhV+oto1hb9Ujwk5sFb!iEF?% zI%7icTK%xK>r()>+Lrj%L@;BG z5S`E#!u?Aq09#Cn2g98p+Y;Xan}IMo8+l-}Uc(s1TVb{(u4CSWK>T%sF@cbJfwm>S z2Q~pFYTlE;CLPl_p*2HoOWdG+69Vx!%w#p2P`kmlC4K-l0uwD9J^^ghF+wAf?*<(u z-vh1znFbG;05;f`_%Xb!d?NX7PzzZPK~#90?VIm!6h#=vzq5Ni?njIKXs@j;3X#%l3n3a4Lljbt zXktJkA-*6Xnm|m{Xh0#F2#N_t2}S{9cw^#UzzcnAOfG7C*Fe_F)~{bb6@(4|V9kCE>V|dhh&I14eTP-Sl(JVb>nlb`LMn+oVZP8Hx z{Yz9O1=zM>!{E=piz?BS5fE>SzKNwf4*-laoK2-tO`Dv3H^4N_4genr2M{)P_jDfg zPf;bl8(?$mW89kYg&?92wF}w486l99^^=?09QA6o;$yAo5js2pbjFo`)AkZwSzsGb0W)cclzt$J2_ zS!T{MQkTM+%=qKPm|x4-YurZv;NakOnMq}i0ENK(e0I01Avz&Dsk9N0&ZPG-Mqi88 zk3^z~Mxr1hTNC+nd@-q}&2_v2YZEosUIh6`cnF#uz#i-B49kB*mt#p2Pw7 zDxGQAfOI&IeoXCaD$NF*wjgm7%^{MZ`NHtW%_0Zhf`0K%g6>;0EQVj}6>~4PJ#*7bIskY_Gqpjl!JZ7@WFIGBh1W)BW~Qsk8Ze+mncpmV!nFa0F}@iL`@J>@ z05iEt18mzyK3{uo5MY~bjC@GJt{88TfP}J8^Xa*Z+}v#J33Al{V7PEmf=TiIASvUIF17sk)lWAFZ+FL-oFT zQ*#7lGMP3IKJiCa(^xm1n>tdjLhV~Xv5x@glC7vrEE+>cdjhLhwIi}D;#V^OaL6!5 zleI27-U6mM_K?jL4K7Z4+|Zfm!paqutJW)5Cvd~B`GB!hvTxu?r%R3_z$V4jF_#F7(*;7b*WLAAN1Mi=;+GZ z%PR~>rBWeAbjmjs0E)%h$N9D`<*2_FiI%WhHK|t^(AAT84S?s<6%i(Jou-P3shXoFJR0hA^|;1 literal 0 HcmV?d00001 diff --git a/toolkit/themes/gnomestripe/global/jar.mn b/toolkit/themes/gnomestripe/global/jar.mn index 155aa3eb90b..f7fb84c4197 100644 --- a/toolkit/themes/gnomestripe/global/jar.mn +++ b/toolkit/themes/gnomestripe/global/jar.mn @@ -33,12 +33,16 @@ classic.jar: + skin/classic/global/icons/autoscroll.png (icons/autoscroll.png) + skin/classic/global/icons/blacklist_favicon.png (icons/blacklist_favicon.png) + skin/classic/global/icons/blacklist_large.png (icons/blacklist_large.png) ++ skin/classic/global/icons/errorGhosted-64.png (icons/errorGhosted-64.png) + skin/classic/global/icons/find.png (icons/find.png) + skin/classic/global/icons/folder-item.png (icons/folder-item.png) ++ skin/classic/global/icons/informationGhosted-64.png (icons/informationGhosted-64.png) + skin/classic/global/icons/loading_16.png (icons/loading_16.png) + skin/classic/global/icons/notloading_16.png (icons/notloading_16.png) + skin/classic/global/icons/notfound.png (icons/notfound.png) ++ skin/classic/global/icons/questionGhosted-64.png (icons/questionGhosted-64.png) + skin/classic/global/icons/sslWarning.png (icons/sslWarning.png) ++ skin/classic/global/icons/warningGhosted-64.png (icons/warningGhosted-64.png) + skin/classic/global/icons/wrap.png (icons/wrap.png) + skin/classic/global/menu/Menu-arrow.png (menu/Menu-arrow.png) + skin/classic/global/menu/Menu-arrow-rtl.png (menu/Menu-arrow-rtl.png) From 6d6c27897cb4e35e9a76242444c7c1be63457a59 Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Wed, 7 May 2008 03:59:58 -0700 Subject: [PATCH 80/98] Bug 426453 - "Wrong plugin icon size used" [p=michael.monreal@gmx.net (Michael Monreal) / Tango team ui-r=faaborg a1.9=damons] --- toolkit/themes/gnomestripe/mozapps/jar.mn | 1 + .../mozapps/plugins/pluginGeneric-16.png | Bin 0 -> 565 bytes 2 files changed, 1 insertion(+) create mode 100644 toolkit/themes/gnomestripe/mozapps/plugins/pluginGeneric-16.png diff --git a/toolkit/themes/gnomestripe/mozapps/jar.mn b/toolkit/themes/gnomestripe/mozapps/jar.mn index 4388cc80db4..852e2dc93d6 100644 --- a/toolkit/themes/gnomestripe/mozapps/jar.mn +++ b/toolkit/themes/gnomestripe/mozapps/jar.mn @@ -13,6 +13,7 @@ classic.jar: + skin/classic/mozapps/extensions/viewButtons.png (extensions/viewButtons.png) + skin/classic/mozapps/passwordmgr/key.png (passwordmgr/key.png) + skin/classic/mozapps/plugins/pluginGeneric.png (plugins/pluginGeneric.png) ++ skin/classic/mozapps/plugins/pluginGeneric-16.png (plugins/pluginGeneric-16.png) + skin/classic/mozapps/viewsource/viewsource.css (viewsource/viewsource.css) + skin/classic/mozapps/xpinstall/xpinstallItemGeneric.png (xpinstall/xpinstallItemGeneric.png) #ifdef MOZ_PLACES diff --git a/toolkit/themes/gnomestripe/mozapps/plugins/pluginGeneric-16.png b/toolkit/themes/gnomestripe/mozapps/plugins/pluginGeneric-16.png new file mode 100644 index 0000000000000000000000000000000000000000..34cabf8553d93fadbec47e294f87842f60358384 GIT binary patch literal 565 zcmV-50?Pe~P)ibc!yt2Y4H-TT3Zt@j8LdGA}d8h4(^i}thcm*=mAU%zd$vlrn~ zht>*fN0`5Kg}0k;NRlpT>QGuynGUJW&au9+7A@49Gsb%#j*X77vm3EcZ)R^>SzRJY zV&b^lr`OJ%$2k|~GN_b8K7M+~;k_}2smXFqpPDQW4)IL&EOF8$>BZP$Kww8Ora*Oe zjwFfc{YoenEY=2t0oGcAAi#T%h-4Q^rEyB7@k~GZ?HS<9_Gd&STT0a59?9t Date: Wed, 7 May 2008 04:29:08 -0700 Subject: [PATCH 81/98] Back out Hugues Fournier's patch from bug 422172 as a possible cause of the crashes. --- netwerk/base/src/nsProtocolProxyService.cpp | 11 +++++------ netwerk/base/src/nsProtocolProxyService.h | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/netwerk/base/src/nsProtocolProxyService.cpp b/netwerk/base/src/nsProtocolProxyService.cpp index 937fb334e1e..3b6f4990a49 100644 --- a/netwerk/base/src/nsProtocolProxyService.cpp +++ b/netwerk/base/src/nsProtocolProxyService.cpp @@ -498,7 +498,7 @@ nsProtocolProxyService::PrefsChanged(nsIPrefBranch *prefBranch, mSystemProxySettings->GetPACURI(tempString); } if (!tempString.IsEmpty()) - ConfigureFromPAC(tempString, PR_FALSE); + ConfigureFromPAC(tempString); } } @@ -758,8 +758,7 @@ nsProtocolProxyService::IsProxyDisabled(nsProxyInfo *pi) } nsresult -nsProtocolProxyService::ConfigureFromPAC(const nsCString &spec, - PRBool forceReload) +nsProtocolProxyService::ConfigureFromPAC(const nsCString &spec) { if (!mPACMan) { mPACMan = new nsPACMan(); @@ -772,7 +771,7 @@ nsProtocolProxyService::ConfigureFromPAC(const nsCString &spec, if (NS_FAILED(rv)) return rv; - if (mPACMan->IsPACURI(pacURI) && !forceReload) + if (mPACMan->IsPACURI(pacURI)) return NS_OK; mFailedProxies.Clear(); @@ -827,7 +826,7 @@ nsProtocolProxyService::ReloadPAC() pacSpec.AssignLiteral(WPAD_URL); if (!pacSpec.IsEmpty()) - ConfigureFromPAC(pacSpec, PR_TRUE); + ConfigureFromPAC(pacSpec); return NS_OK; } @@ -1257,7 +1256,7 @@ nsProtocolProxyService::Resolve_Internal(nsIURI *uri, !PACURI.IsEmpty()) { // Switch to new PAC file if that setting has changed. If the setting // hasn't changed, ConfigureFromPAC will exit early. - nsresult rv = ConfigureFromPAC(PACURI, PR_FALSE); + nsresult rv = ConfigureFromPAC(PACURI); if (NS_FAILED(rv)) return rv; } else { diff --git a/netwerk/base/src/nsProtocolProxyService.h b/netwerk/base/src/nsProtocolProxyService.h index f7d19e16ddc..97bb49af805 100644 --- a/netwerk/base/src/nsProtocolProxyService.h +++ b/netwerk/base/src/nsProtocolProxyService.h @@ -114,7 +114,7 @@ protected: * @param pacURI * The URI spec of the PAC file to load. */ - NS_HIDDEN_(nsresult) ConfigureFromPAC(const nsCString &pacURI, PRBool forceReload); + NS_HIDDEN_(nsresult) ConfigureFromPAC(const nsCString &pacURI); /** * This method builds a list of nsProxyInfo objects from the given PAC- From fd124195860462ce5697534a61eca01db8d453ef Mon Sep 17 00:00:00 2001 From: "reed@reedloden.com" Date: Wed, 7 May 2008 05:01:40 -0700 Subject: [PATCH 82/98] Back out Chris Pearce's patch from bug 430921 in case it is the cause of the crashes. --- docshell/base/nsDocShell.cpp | 7 ------- editor/composer/src/nsEditingSession.cpp | 2 ++ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index fbaad68cac9..3da1422f09f 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -3670,13 +3670,6 @@ nsDocShell::Destroy() // Fire unload event before we blow anything away. (void) FirePageHideNotification(PR_TRUE); - // Clear pointers to any detached nsEditorData that's lying - // around in shistory entries. Breaks cycle. See bug 430921. - if (mOSHE) - mOSHE->SetEditorData(nsnull); - if (mLSHE) - mLSHE->SetEditorData(nsnull); - // Note: mContentListener can be null if Init() failed and we're being // called from the destructor. if (mContentListener) { diff --git a/editor/composer/src/nsEditingSession.cpp b/editor/composer/src/nsEditingSession.cpp index 565e9117485..56862f20207 100644 --- a/editor/composer/src/nsEditingSession.cpp +++ b/editor/composer/src/nsEditingSession.cpp @@ -1407,6 +1407,7 @@ nsEditingSession::DetachFromWindow(nsIDOMWindow* aWindow) if (!mDoneSetup) return NS_OK; + NS_ASSERTION(mEditorFlags != 0, "mEditorFlags should not be 0"); NS_ASSERTION(mStateMaintainer, "mStateMaintainer should exist."); // Kill any existing reload timer @@ -1436,6 +1437,7 @@ nsEditingSession::ReattachToWindow(nsIDOMWindow* aWindow) if (!mDoneSetup) return NS_OK; + NS_ASSERTION(mEditorFlags != 0, "mEditorFlags should still be valid..."); NS_ASSERTION(mStateMaintainer, "mStateMaintainer should exist."); // Imitate nsEditorDocShell::MakeEditable() to reattach the From 3b15782065c4b173038a05e13f61c47ac6deff78 Mon Sep 17 00:00:00 2001 From: "dtownsend@oxymoronical.com" Date: Wed, 7 May 2008 06:18:38 -0700 Subject: [PATCH 83/98] Backing out bug 432492 --- .../public/nsIUrlClassifierDBService.idl | 4 +- .../src/nsUrlClassifierDBService.cpp | 154 ++++-------------- .../src/nsUrlClassifierStreamUpdater.cpp | 89 +++------- .../src/nsUrlClassifierStreamUpdater.h | 8 +- 4 files changed, 56 insertions(+), 199 deletions(-) diff --git a/toolkit/components/url-classifier/public/nsIUrlClassifierDBService.idl b/toolkit/components/url-classifier/public/nsIUrlClassifierDBService.idl index 0f7574a9a06..e9386fb060e 100644 --- a/toolkit/components/url-classifier/public/nsIUrlClassifierDBService.idl +++ b/toolkit/components/url-classifier/public/nsIUrlClassifierDBService.idl @@ -83,10 +83,8 @@ interface nsIUrlClassifierUpdateObserver : nsISupports { * A stream update has completed. * * @param status The state of the update process. - * @param delay The amount of time the updater should wait to fetch the - * next URL in ms. */ - void streamFinished(in nsresult status, in unsigned long delay); + void streamFinished(in nsresult status); /* The update has encountered an error and should be cancelled */ void updateError(in nsresult error); diff --git a/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp index c2619783af2..7abcd41c25a 100644 --- a/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp @@ -154,17 +154,6 @@ static const PRLogModuleInfo *gUrlClassifierDbServiceLog = nsnull; #define UPDATE_CACHE_SIZE_PREF "urlclassifier.updatecachemax" #define UPDATE_CACHE_SIZE_DEFAULT -1 -// Amount of time to spend updating before committing and delaying, in -// seconds. This is checked after each update stream, so the actual -// time spent can be higher than this, depending on update stream size. -#define UPDATE_WORKING_TIME "urlclassifier.workingtime" -#define UPDATE_WORKING_TIME_DEFAULT 5 - -// The amount of time to delay after hitting UPDATE_WORKING_TIME, in -// seconds. -#define UPDATE_DELAY_TIME "urlclassifier.updatetime" -#define UPDATE_DELAY_TIME_DEFAULT 60 - #define PAGE_SIZE 4096 class nsUrlClassifierDBServiceWorker; @@ -183,9 +172,6 @@ static PRInt32 gFreshnessGuarantee = CONFIRM_AGE_DEFAULT_SEC; static PRInt32 gUpdateCacheSize = UPDATE_CACHE_SIZE_DEFAULT; -static PRInt32 gWorkingTimeThreshold = UPDATE_WORKING_TIME_DEFAULT; -static PRInt32 gDelayTime = UPDATE_DELAY_TIME_DEFAULT; - static void SplitTables(const nsACString& str, nsTArray& tables) { @@ -1116,12 +1102,6 @@ private: // Handle chunk data from a stream update nsresult ProcessChunk(PRBool* done); - // Sets up a transaction and begins counting update time. - nsresult SetupUpdate(); - - // Applies the current transaction and resets the update/working times. - nsresult ApplyUpdate(); - // Reset the in-progress update stream void ResetStream(); @@ -1237,10 +1217,6 @@ private: // The MAC stated by the server. nsCString mServerMAC; - // Start time of the current update interval. This will be reset - // every time we apply the update. - PRIntervalTime mUpdateStartTime; - nsCOMPtr mHMAC; // The number of noise entries to add to the set of lookup results. PRInt32 mGethashNoise; @@ -1280,7 +1256,6 @@ nsUrlClassifierDBServiceWorker::nsUrlClassifierDBServiceWorker() , mCachedListsTable(PR_UINT32_MAX) , mHaveCachedAddChunks(PR_FALSE) , mHaveCachedSubChunks(PR_FALSE) - , mUpdateStartTime(0) , mGethashNoise(0) , mPendingLookupLock(nsnull) { @@ -2782,7 +2757,19 @@ nsUrlClassifierDBServiceWorker::BeginUpdate(nsIUrlClassifierUpdateObserver *obse return rv; } - rv = SetupUpdate(); + if (gUpdateCacheSize > 0) { + PRUint32 cachePages = gUpdateCacheSize / PAGE_SIZE; + nsCAutoString cacheSizePragma("PRAGMA cache_size="); + cacheSizePragma.AppendInt(cachePages); + rv = mConnection->ExecuteSimpleSQL(cacheSizePragma); + if (NS_FAILED(rv)) { + mUpdateStatus = rv; + return rv; + } + mGrewCache = PR_TRUE; + } + + rv = mConnection->BeginTransaction(); if (NS_FAILED(rv)) { mUpdateStatus = rv; return rv; @@ -2814,16 +2801,10 @@ nsUrlClassifierDBServiceWorker::BeginStream(const nsACString &table, NS_ENSURE_STATE(mUpdateObserver); NS_ENSURE_STATE(!mInStream); - // We may have committed the update in FinishStream, if so set it up - // again here. - nsresult rv = SetupUpdate(); - if (NS_FAILED(rv)) { - mUpdateStatus = rv; - return rv; - } - mInStream = PR_TRUE; + nsresult rv; + // If we're expecting a MAC, create the nsICryptoHMAC component now. if (!mUpdateClientKey.IsEmpty()) { nsCOMPtr keyObjectFactory(do_GetService( @@ -2960,8 +2941,6 @@ nsUrlClassifierDBServiceWorker::FinishStream() NS_ENSURE_STATE(mInStream); NS_ENSURE_STATE(mUpdateObserver); - PRInt32 nextStreamDelay = 0; - if (NS_SUCCEEDED(mUpdateStatus) && mHMAC) { nsCAutoString clientMAC; mHMAC->Finish(PR_TRUE, clientMAC); @@ -2972,80 +2951,15 @@ nsUrlClassifierDBServiceWorker::FinishStream() mServerMAC.get(), clientMAC.get())); mUpdateStatus = NS_ERROR_FAILURE; } - PRIntervalTime updateTime = PR_IntervalNow() - mUpdateStartTime; - if (PR_IntervalToSeconds(updateTime) >= - static_cast(gWorkingTimeThreshold)) { - // We've spent long enough working that we should commit what we - // have and hold off for a bit. - ApplyUpdate(); - - nextStreamDelay = gDelayTime * 1000; - } } - mUpdateObserver->StreamFinished(mUpdateStatus, - static_cast(nextStreamDelay)); + mUpdateObserver->StreamFinished(mUpdateStatus); ResetStream(); return NS_OK; } -nsresult -nsUrlClassifierDBServiceWorker::SetupUpdate() -{ - LOG(("nsUrlClassifierDBServiceWorker::SetupUpdate")); - PRBool inProgress; - nsresult rv = mConnection->GetTransactionInProgress(&inProgress); - if (inProgress) { - return NS_OK; - } - - mUpdateStartTime = PR_IntervalNow(); - - rv = mConnection->BeginTransaction(); - NS_ENSURE_SUCCESS(rv, rv); - - if (gUpdateCacheSize > 0) { - PRUint32 cachePages = gUpdateCacheSize / PAGE_SIZE; - nsCAutoString cacheSizePragma("PRAGMA cache_size="); - cacheSizePragma.AppendInt(cachePages); - rv = mConnection->ExecuteSimpleSQL(cacheSizePragma); - NS_ENSURE_SUCCESS(rv, rv); - mGrewCache = PR_TRUE; - } - - return NS_OK; -} - -nsresult -nsUrlClassifierDBServiceWorker::ApplyUpdate() -{ - LOG(("nsUrlClassifierDBServiceWorker::ApplyUpdate")); - - if (NS_FAILED(mUpdateStatus)) { - mConnection->RollbackTransaction(); - } else { - mUpdateStatus = FlushChunkLists(); - if (NS_SUCCEEDED(mUpdateStatus)) { - mUpdateStatus = mConnection->CommitTransaction(); - } - } - - if (mGrewCache) { - // During the update we increased the page cache to bigger than we - // want to keep around. At the moment, the only reliable way to make - // sure that the page cache is freed is to reopen the connection. - mGrewCache = PR_FALSE; - CloseDb(); - OpenDb(); - } - - mUpdateStartTime = 0; - - return NS_OK; -} - NS_IMETHODIMP nsUrlClassifierDBServiceWorker::FinishUpdate() { @@ -3055,7 +2969,16 @@ nsUrlClassifierDBServiceWorker::FinishUpdate() NS_ENSURE_STATE(!mInStream); NS_ENSURE_STATE(mUpdateObserver); - ApplyUpdate(); + if (NS_SUCCEEDED(mUpdateStatus)) { + mUpdateStatus = FlushChunkLists(); + } + + nsCAutoString arg; + if (NS_SUCCEEDED(mUpdateStatus)) { + mUpdateStatus = mConnection->CommitTransaction(); + } else { + mConnection->RollbackTransaction(); + } if (NS_SUCCEEDED(mUpdateStatus)) { mUpdateObserver->UpdateSuccess(mUpdateWait); @@ -3088,6 +3011,13 @@ nsUrlClassifierDBServiceWorker::FinishUpdate() // database reset. if (NS_SUCCEEDED(mUpdateStatus) && resetRequested) { ResetDatabase(); + } else if (mGrewCache) { + // During the update we increased the page cache to bigger than we + // want to keep around. At the moment, the only reliable way to make + // sure that the page cache is freed is to reopen the connection. + mGrewCache = PR_FALSE; + CloseDb(); + OpenDb(); } return NS_OK; @@ -3738,14 +3668,6 @@ nsUrlClassifierDBService::Init() rv = prefs->GetIntPref(UPDATE_CACHE_SIZE_PREF, &tmpint); PR_AtomicSet(&gUpdateCacheSize, NS_SUCCEEDED(rv) ? tmpint : UPDATE_CACHE_SIZE_DEFAULT); - - rv = prefs->GetIntPref(UPDATE_WORKING_TIME, &tmpint); - PR_AtomicSet(&gWorkingTimeThreshold, - NS_SUCCEEDED(rv) ? tmpint : UPDATE_WORKING_TIME_DEFAULT); - - rv = prefs->GetIntPref(UPDATE_DELAY_TIME, &tmpint); - PR_AtomicSet(&gDelayTime, - NS_SUCCEEDED(rv) ? tmpint : UPDATE_DELAY_TIME_DEFAULT); } // Start the background thread. @@ -4038,16 +3960,6 @@ nsUrlClassifierDBService::Observe(nsISupports *aSubject, const char *aTopic, PRInt32 tmpint; rv = prefs->GetIntPref(UPDATE_CACHE_SIZE_PREF, &tmpint); PR_AtomicSet(&gUpdateCacheSize, NS_SUCCEEDED(rv) ? tmpint : UPDATE_CACHE_SIZE_DEFAULT); - } else if (NS_LITERAL_STRING(UPDATE_WORKING_TIME).Equals(aData)) { - PRInt32 tmpint; - rv = prefs->GetIntPref(UPDATE_WORKING_TIME, &tmpint); - PR_AtomicSet(&gWorkingTimeThreshold, - NS_SUCCEEDED(rv) ? tmpint : UPDATE_WORKING_TIME_DEFAULT); - } else if (NS_LITERAL_STRING(UPDATE_DELAY_TIME).Equals(aData)) { - PRInt32 tmpint; - rv = prefs->GetIntPref(UPDATE_DELAY_TIME, &tmpint); - PR_AtomicSet(&gDelayTime, - NS_SUCCEEDED(rv) ? tmpint : UPDATE_DELAY_TIME_DEFAULT); } } else if (!strcmp(aTopic, "profile-before-change") || !strcmp(aTopic, "xpcom-shutdown-threads")) { diff --git a/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp b/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp index fa1086a7cdc..5dad171e349 100644 --- a/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp +++ b/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp @@ -75,7 +75,7 @@ nsUrlClassifierStreamUpdater::nsUrlClassifierStreamUpdater() } -NS_IMPL_THREADSAFE_ISUPPORTS9(nsUrlClassifierStreamUpdater, +NS_IMPL_THREADSAFE_ISUPPORTS8(nsUrlClassifierStreamUpdater, nsIUrlClassifierStreamUpdater, nsIUrlClassifierUpdateObserver, nsIRequestObserver, @@ -83,8 +83,7 @@ NS_IMPL_THREADSAFE_ISUPPORTS9(nsUrlClassifierStreamUpdater, nsIObserver, nsIBadCertListener2, nsISSLErrorListener, - nsIInterfaceRequestor, - nsITimerCallback) + nsIInterfaceRequestor) /** * Clear out the update. @@ -272,54 +271,29 @@ nsUrlClassifierStreamUpdater::RekeyRequested() nsnull); } -nsresult -nsUrlClassifierStreamUpdater::FetchNext() -{ - if (mPendingUpdates.Length() == 0) { - return NS_OK; - } - - PendingUpdate &update = mPendingUpdates[0]; - LOG(("Fetching update url: %s\n", update.mUrl.get())); - nsresult rv = FetchUpdate(update.mUrl, EmptyCString(), - update.mTable, update.mServerMAC); - if (NS_FAILED(rv)) { - LOG(("Error fetching update url: %s\n", update.mUrl.get())); - // We can commit the urls that we've applied so far. This is - // probably a transient server problem, so trigger backoff. - mDownloadErrorCallback->HandleEvent(EmptyCString()); - mDownloadError = PR_TRUE; - mDBService->FinishUpdate(); - return rv; - } - - mPendingUpdates.RemoveElementAt(0); - - return NS_OK; -} - NS_IMETHODIMP -nsUrlClassifierStreamUpdater::StreamFinished(nsresult status, - PRUint32 requestedDelay) +nsUrlClassifierStreamUpdater::StreamFinished(nsresult status) { - LOG(("nsUrlClassifierStreamUpdater::StreamFinished [%x, %d]", status, requestedDelay)); - if (NS_FAILED(status) || mPendingUpdates.Length() == 0) { - // We're done. - mDBService->FinishUpdate(); - return NS_OK; - } - - // Wait the requested amount of time before starting a new stream. nsresult rv; - mTimer = do_CreateInstance("@mozilla.org/timer;1", &rv); - if (NS_SUCCEEDED(rv)) { - rv = mTimer->InitWithCallback(this, requestedDelay, - nsITimer::TYPE_ONE_SHOT); - } - if (NS_FAILED(rv)) { - NS_WARNING("Unable to initialize timer, fetching next safebrowsing item immediately"); - return FetchNext(); + // Pop off a pending URL and update it. + if (NS_SUCCEEDED(status) && mPendingUpdates.Length() > 0) { + PendingUpdate &update = mPendingUpdates[0]; + rv = FetchUpdate(update.mUrl, EmptyCString(), + update.mTable, update.mServerMAC); + if (NS_FAILED(rv)) { + LOG(("Error fetching update url: %s\n", update.mUrl.get())); + // We can commit the urls that we've applied so far. This is + // probably a transient server problem, so trigger backoff. + mDownloadErrorCallback->HandleEvent(EmptyCString()); + mDownloadError = PR_TRUE; + mDBService->FinishUpdate(); + return rv; + } + + mPendingUpdates.RemoveElementAt(0); + } else { + mDBService->FinishUpdate(); } return NS_OK; @@ -526,10 +500,6 @@ nsUrlClassifierStreamUpdater::Observe(nsISupports *aSubject, const char *aTopic, mIsUpdating = PR_FALSE; mChannel = nsnull; } - if (mTimer) { - mTimer->Cancel(); - mTimer = nsnull; - } } return NS_OK; } @@ -568,20 +538,3 @@ nsUrlClassifierStreamUpdater::GetInterface(const nsIID & eventSinkIID, void* *_r { return QueryInterface(eventSinkIID, _retval); } - - -/////////////////////////////////////////////////////////////////////////////// -// nsITimerCallback implementation -NS_IMETHODIMP -nsUrlClassifierStreamUpdater::Notify(nsITimer *timer) -{ - LOG(("nsUrlClassifierStreamUpdater::Notify [%p]", this)); - - mTimer = nsnull; - - // Start the update process up again. - FetchNext(); - - return NS_OK; -} - diff --git a/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.h b/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.h index 7279d72e8bb..5048b322f37 100644 --- a/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.h +++ b/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.h @@ -49,7 +49,6 @@ #include "nsTArray.h" #include "nsIBadCertListener2.h" #include "nsISSLErrorListener.h" -#include "nsITimer.h" // Forward declare pointers class nsIURI; @@ -60,8 +59,7 @@ class nsUrlClassifierStreamUpdater : public nsIUrlClassifierStreamUpdater, public nsIObserver, public nsIBadCertListener2, public nsISSLErrorListener, - public nsIInterfaceRequestor, - public nsITimerCallback + public nsIInterfaceRequestor { public: nsUrlClassifierStreamUpdater(); @@ -75,7 +73,6 @@ public: NS_DECL_NSIBADCERTLISTENER2 NS_DECL_NSISSLERRORLISTENER NS_DECL_NSIOBSERVER - NS_DECL_NSITIMERCALLBACK private: // No subclassing @@ -99,8 +96,6 @@ private: const nsACString &aTable, const nsACString &aServerMAC); - nsresult FetchNext(); - PRBool mIsUpdating; PRBool mInitialized; PRBool mDownloadError; @@ -110,7 +105,6 @@ private: nsCString mServerMAC; nsCOMPtr mChannel; nsCOMPtr mDBService; - nsCOMPtr mTimer; struct PendingUpdate { nsCString mUrl; From 55b1fdc4546a86738a39b2d00aadf4c2c275d730 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Wed, 7 May 2008 08:23:36 -0700 Subject: [PATCH 84/98] Bug 432511 followup: remove more unused theme files --- .../winstripe/browser/searchButtons-aero.png | Bin 891 -> 0 bytes .../themes/winstripe/browser/searchButtons.png | Bin 1528 -> 0 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 browser/themes/winstripe/browser/searchButtons-aero.png delete mode 100644 browser/themes/winstripe/browser/searchButtons.png diff --git a/browser/themes/winstripe/browser/searchButtons-aero.png b/browser/themes/winstripe/browser/searchButtons-aero.png deleted file mode 100644 index 36852b77be286b8d9b63a14bcb3446639600efd6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 891 zcmV->1BCpEP)1gh5XXPBJ9n3a4?%?lN&~z}C?e6Orl2BS9wk*m1J992@H%PeEP>BH z?=HppoEQl!$>lteZb!2GHM-yIc>en_w&m>XTVlkf0LRClH#&t7nw!tP_eCGS&d$%j zW6f89x~_lUC2LL7%pb__i8WuB53FTi##expQZyaCA%9~9BtZHO?snHO<98Jh?iATQ zg4p=JAwNsNIsj{aPQWsN(Dy<;6JW+yfXQU?%ZUHRny&yNeHWX4X32M^BYy;zE5LN* zkHAJ>0i#bqmH>>q0u)MPFr_y4mV8xJ4i7(Ubc`{s9afxk zzK>sL7Z*POO!?}ZqiLGiT{0I!SUiNEbFKnR`ME0$kUBA1joy%-D`0tV+7h$mX9-vb zV9n2S0OYnfbzM)4_%E&bqdyLhz9EtmU>$(9jeZUoeF8==fzc;G0d{tZSC&Co^5ydK zXY$_nztTM{gtmoe$(MtJkJbkvQ&SP)>^ zLI^At3)+%jRe%{^o%0k$kyMqkEC=5cEZ2T%HQ2H&`Rbe?B5A3IH1tFyBJBo51m~oC z&5W-gU0XWE7zdw(VvNvs!lhHEC0_wT2q}axc=ng9)$PV>W_$&>y1M#PmSyVJ;~_1^ z$b3GR`Ft+GQ)_%X8O-xS>N=;0u1OP9b1=Ow# RsZ9U?002ovPDHLkV1hgAjeYEh6Trf1f%gClPp?2={AO!w4RQ(aZl{Y_gQK73?cV~GIYef#Cs1N^6-e;vK? zBfvE6Tnqq4Z~O>=cM>?_tMj9~ON47305=hE;{b01yyeY;egqJq+-CVlKoHCfq$(7oska8k0&v;KN+%J)Fr-;0 z^e;b8{Okagf-2>PqRwPxYdx3Fu$AjgW@BW&E(iB`=C%lkT{$Dy>kJ z*GkE&TwhA|RRgPGt*Fg8Tl2Y!Cw>ID^ZrMl;3%H>a_vdcd-v|PP&&4ll``dsA7hN% zzyJB(!+|~YkM1rv4)8X>TW%cSZGg92dj~{-?d#K* z;KIsoyzwKztAAg;cz0i3NaK$ZPi!0rMw*6zhZ=(@UsJ)Sz%B75&^RGSo6LtK&$gAS9{3Hu4(t)uy&=e zvi(T;;Wt|RqG~H|_?dAi!UBYs?7KAV-jz|Du(Y;_;&>+8h!!_N-rszo0)`?%NF5uHN0pN)*4<3BsO^CTl6cK*-{_AvXYTC?r^y4oIxZ+0<0ZS=Q z4vu4lnbl8Rc{%QgA61oc98E=5pQ*1-Qc5JVhUbYNLkQfuwIOIggI@V4m>FqGOlfMx z&l5k!7}?yq%{UII22`)sfRv1sCbruhv3!>B#E+_h&1S=9GZN!qAzW=3PE%sP-${Ph z908vA#Q`HHCnq)xBgZgcw^IXTc7Pv#R25{0Q*(Uw@vSoQ%YAwAhV6;@x@kwT^vC?6+Ha{dx=Ke}+8qBf!(Af1Hlv zV8bxjc_H{V23^!ArNnNxlkIjVzz5#=jT9Bp{Fl01RLoLGC@P_;&v|sn$}aoNtgK?B zw#2PiRXp*t14{mBh^T1CwCIYRspq;}&{u0}+oEr^Q1h`RbTXu?_MZ58n;eRS+%FWx zNd--H&z)4K=eE*E)k;`N+r`!l(_&TXbV(sE0)*Y{08ji_JF6%fH1D&k_lJ3}F0DA{ zy}EtyY1ei@;)l||Jei83NtcQ0h+j5JDnW&yXDvw1nwp+BT|K|QkVqXsr@UEOr1hE>HAzZAicx%m(XL0Tb6tt98Fnn_EY$=H^d+I_}K z#o+^D2}IEru?d?3G9{#&@Oa`!fEaTAMak7T0h;p2q|{Z_0Hn;~Cg$~gO4)>j<-DzS zN%3@ooOVh~un$V?-U6QZ5#a9K&)(Z?HZ}~ykrpF6PESu;VtV4sS6_W&!!QtIL^T|T zkVq5z{hr-!2Y@I3e?0+vvs46&=l}o!B6?I{30000 Date: Wed, 7 May 2008 12:08:50 -0700 Subject: [PATCH 85/98] Disable test_characterdatagetdata.html to see whether it fixes the bm-xserve01 crashes (bug 432471, a=jimm) --- dom/tests/mochitest/dom-level1-core/Makefile.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dom/tests/mochitest/dom-level1-core/Makefile.in b/dom/tests/mochitest/dom-level1-core/Makefile.in index 2882789c0a0..03dffde63fd 100644 --- a/dom/tests/mochitest/dom-level1-core/Makefile.in +++ b/dom/tests/mochitest/dom-level1-core/Makefile.in @@ -47,6 +47,8 @@ DIRS = files include $(topsrcdir)/config/rules.mk +# temporarily disabled because it's causing crashes: bug 432471 +# test_characterdatagetdata.html _TEST_FILES_A = \ DOMTestCase.js \ exclusions.js \ @@ -81,7 +83,6 @@ _TEST_FILES_A = \ test_characterdatadeletedatamiddle.html \ test_characterdatadeletedatanomodificationallowederr.html \ test_characterdatadeletedatanomodificationallowederrEE.html \ - test_characterdatagetdata.html \ test_characterdatagetlength.html \ test_characterdataindexsizeerrdeletedatacountnegative.html \ test_characterdataindexsizeerrdeletedataoffsetgreater.html \ From bc19f4ddc6450af7038802aef0b4915a23fdb8ee Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Wed, 7 May 2008 12:53:48 -0700 Subject: [PATCH 86/98] Disable test_characterdatagetlength.html to see whether it fixes the bm-xserve01 crashes (bug 432471) --- dom/tests/mochitest/dom-level1-core/Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/tests/mochitest/dom-level1-core/Makefile.in b/dom/tests/mochitest/dom-level1-core/Makefile.in index 03dffde63fd..dfa8fb1e1e9 100644 --- a/dom/tests/mochitest/dom-level1-core/Makefile.in +++ b/dom/tests/mochitest/dom-level1-core/Makefile.in @@ -47,8 +47,9 @@ DIRS = files include $(topsrcdir)/config/rules.mk -# temporarily disabled because it's causing crashes: bug 432471 +# temporarily disabled because they're causing crashes: bug 432471 # test_characterdatagetdata.html +# test_characterdatagetlength.html _TEST_FILES_A = \ DOMTestCase.js \ exclusions.js \ @@ -83,7 +84,6 @@ _TEST_FILES_A = \ test_characterdatadeletedatamiddle.html \ test_characterdatadeletedatanomodificationallowederr.html \ test_characterdatadeletedatanomodificationallowederrEE.html \ - test_characterdatagetlength.html \ test_characterdataindexsizeerrdeletedatacountnegative.html \ test_characterdataindexsizeerrdeletedataoffsetgreater.html \ test_characterdataindexsizeerrdeletedataoffsetnegative.html \ From 3c35ac552c4c8e5d9a612791cfcb6e50f17cbfb7 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Wed, 7 May 2008 13:07:04 -0700 Subject: [PATCH 87/98] Reenabled these tests now that we have code dumps enabled on the crashing machine (bug 432471) --- dom/tests/mochitest/dom-level1-core/Makefile.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dom/tests/mochitest/dom-level1-core/Makefile.in b/dom/tests/mochitest/dom-level1-core/Makefile.in index dfa8fb1e1e9..2882789c0a0 100644 --- a/dom/tests/mochitest/dom-level1-core/Makefile.in +++ b/dom/tests/mochitest/dom-level1-core/Makefile.in @@ -47,9 +47,6 @@ DIRS = files include $(topsrcdir)/config/rules.mk -# temporarily disabled because they're causing crashes: bug 432471 -# test_characterdatagetdata.html -# test_characterdatagetlength.html _TEST_FILES_A = \ DOMTestCase.js \ exclusions.js \ @@ -84,6 +81,8 @@ _TEST_FILES_A = \ test_characterdatadeletedatamiddle.html \ test_characterdatadeletedatanomodificationallowederr.html \ test_characterdatadeletedatanomodificationallowederrEE.html \ + test_characterdatagetdata.html \ + test_characterdatagetlength.html \ test_characterdataindexsizeerrdeletedatacountnegative.html \ test_characterdataindexsizeerrdeletedataoffsetgreater.html \ test_characterdataindexsizeerrdeletedataoffsetnegative.html \ From 1aa00626a9ab005855058fe47706bfe166768c99 Mon Sep 17 00:00:00 2001 From: "nrthomas@gmail.com" Date: Wed, 7 May 2008 13:14:12 -0700 Subject: [PATCH 88/98] Bug 431788, need to use the cltbld key for releases, p=rtessner, r=me --- tools/release/configs/tb-moz19-bootstrap.cfg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/release/configs/tb-moz19-bootstrap.cfg b/tools/release/configs/tb-moz19-bootstrap.cfg index dbdfc0ef4de..6197a1d70e7 100644 --- a/tools/release/configs/tb-moz19-bootstrap.cfg +++ b/tools/release/configs/tb-moz19-bootstrap.cfg @@ -26,9 +26,9 @@ win32_l10n_buildDir = /e/tb19l10nrel linux_logDir = /builds/logs macosx_logDir = /builds/logs win32_logDir = /builds/logs -mozillaCvsroot = tbirdbld@cvs.mozilla.org:/cvsroot -l10nCvsroot = tbirdbld@cvs.mozilla.org:/l10n -mofoCvsroot = tbirdbld@cvs.mozilla.org:/mofo +mozillaCvsroot = cltbld@cvs.mozilla.org:/cvsroot +l10nCvsroot = cltbld@cvs.mozilla.org:/l10n +mofoCvsroot = cltbld@cvs.mozilla.org:/mofo anonCvsroot = :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot # private staging area stageHome = /data/cltbld @@ -70,14 +70,14 @@ ausServer = aus2-staging.mozilla.org ausServerUrl = https://aus2.mozilla.org buildTree = MozillaRelease # where QA updates/builds go -stagingUser = tbirdbld +stagingUser = cltbld stagingServer = stage-old.mozilla.org # where beta updates/builds go ftpServer = ftp.mozilla.org # where release updates/builds go bouncerServer = download.mozilla.org # username and server to push builds -sshUser = tbirdbld +sshUser = cltbld sshServer = stage-old.mozilla.org useTalkback = 0 useCvsCompression = 1 From 844a9ac9edb5aa456dc259fb5d1def1bb0ea7e41 Mon Sep 17 00:00:00 2001 From: "pavlov@pavlov.net" Date: Wed, 7 May 2008 13:29:48 -0700 Subject: [PATCH 89/98] bug 432065. deal with multiple fonts with the same name. r=roc a=schrep --- gfx/thebes/public/gfxWindowsFonts.h | 42 ++++++++++++--- gfx/thebes/src/gfxWindowsFonts.cpp | 80 ++++++++++++++++++++++++----- 2 files changed, 101 insertions(+), 21 deletions(-) diff --git a/gfx/thebes/public/gfxWindowsFonts.h b/gfx/thebes/public/gfxWindowsFonts.h index ba604a83388..ad6e4b95ca3 100644 --- a/gfx/thebes/public/gfxWindowsFonts.h +++ b/gfx/thebes/public/gfxWindowsFonts.h @@ -52,6 +52,26 @@ #include +/** + * List of different types of fonts we support on Windows. + * These can generally be lumped in to 3 categories where we have to + * do special things: Really old fonts bitmap and vector fonts (device + * and raster), Type 1 fonts, and TrueType/OpenType fonts. + * + * This list is sorted in order from least prefered to most prefered. + * We prefer Type1 fonts over OpenType fonts to avoid falling back to + * things like Arial (opentype) when you ask for Helvetica (type1) + **/ +enum gfxWindowsFontType { + GFX_FONT_TYPE_UNKNOWN = 0, + GFX_FONT_TYPE_DEVICE, + GFX_FONT_TYPE_RASTER, + GFX_FONT_TYPE_TRUETYPE, + GFX_FONT_TYPE_PS_OPENTYPE, + GFX_FONT_TYPE_TT_OPENTYPE, + GFX_FONT_TYPE_TYPE1 +}; + /** * FontFamily is a class that describes one of the fonts on the users system. It holds * each FontEntry (maps more directly to a font face) which holds font type, charset info @@ -92,8 +112,8 @@ public: THEBES_INLINE_DECL_REFCOUNTING(FontEntry) FontEntry(const nsString& aFaceName) : - mFaceName(aFaceName), mUnicodeFont(PR_FALSE), mSymbolFont(PR_FALSE), - mTrueType(PR_FALSE), mIsType1(PR_FALSE), + mFaceName(aFaceName), mFontType(GFX_FONT_TYPE_UNKNOWN), + mUnicodeFont(PR_FALSE), mSymbolFont(PR_FALSE), mIsBadUnderlineFont(PR_FALSE), mForceGDI(PR_FALSE), mUnknownCMAP(PR_FALSE), mCharset(0), mUnicodeRanges(0) { @@ -103,10 +123,9 @@ public: mFaceName(aFontEntry.mFaceName), mWindowsFamily(aFontEntry.mWindowsFamily), mWindowsPitch(aFontEntry.mWindowsPitch), + mFontType(aFontEntry.mFontType), mUnicodeFont(aFontEntry.mUnicodeFont), mSymbolFont(aFontEntry.mSymbolFont), - mTrueType(aFontEntry.mTrueType), - mIsType1(aFontEntry.mIsType1), mIsBadUnderlineFont(aFontEntry.mIsBadUnderlineFont), mForceGDI(aFontEntry.mForceGDI), mUnknownCMAP(aFontEntry.mUnknownCMAP), @@ -122,9 +141,19 @@ public: return mFaceName; } + PRBool IsType1() const { + return (mFontType == GFX_FONT_TYPE_TYPE1); + } + + PRBool IsTrueType() const { + return (mFontType == GFX_FONT_TYPE_TRUETYPE || + mFontType == GFX_FONT_TYPE_PS_OPENTYPE || + mFontType == GFX_FONT_TYPE_TT_OPENTYPE); + } + PRBool IsCrappyFont() const { /* return if it is a bitmap not a unicode font */ - return (!mUnicodeFont || mSymbolFont || mIsType1); + return (!mUnicodeFont || mSymbolFont || IsType1()); } PRBool MatchesGenericFamily(const nsACString& aGeneric) const { @@ -219,10 +248,9 @@ public: PRUint8 mWindowsFamily; PRUint8 mWindowsPitch; + gfxWindowsFontType mFontType; PRPackedBool mUnicodeFont : 1; PRPackedBool mSymbolFont : 1; - PRPackedBool mTrueType : 1; - PRPackedBool mIsType1 : 1; PRPackedBool mIsBadUnderlineFont : 1; PRPackedBool mForceGDI : 1; PRPackedBool mUnknownCMAP : 1; diff --git a/gfx/thebes/src/gfxWindowsFonts.cpp b/gfx/thebes/src/gfxWindowsFonts.cpp index dd6253250b8..8128fc7f4b8 100644 --- a/gfx/thebes/src/gfxWindowsFonts.cpp +++ b/gfx/thebes/src/gfxWindowsFonts.cpp @@ -78,6 +78,36 @@ static PRLogModuleInfo *gFontLog = PR_NewLogModule("winfonts"); #define ROUND(x) floor((x) + 0.5) +BYTE +FontTypeToOutPrecision(PRUint8 fontType) +{ +#ifdef WINCE + return OUT_DEFAULT_PRECIS; +#else + BYTE ret; + switch (fontType) { + case GFX_FONT_TYPE_TT_OPENTYPE: + case GFX_FONT_TYPE_TRUETYPE: + ret = OUT_TT_ONLY_PRECIS; + break; + case GFX_FONT_TYPE_PS_OPENTYPE: + ret = OUT_PS_ONLY_PRECIS; + break; + case GFX_FONT_TYPE_TYPE1: + ret = OUT_OUTLINE_PRECIS; + break; + case GFX_FONT_TYPE_RASTER: + ret = OUT_RASTER_PRECIS; + break; + case GFX_FONT_TYPE_DEVICE: + ret = OUT_DEVICE_PRECIS; + break; + default: + ret = OUT_DEFAULT_PRECIS; + } + return ret; +#endif +} struct DCFromContext { DCFromContext(gfxContext *aContext) { @@ -164,10 +194,37 @@ FontFamily::FamilyAddStylesProc(const ENUMLOGFONTEXW *lpelfe, // Some fonts claim to support things > 900, but we don't so clamp the sizes logFont.lfWeight = PR_MAX(PR_MIN(logFont.lfWeight, 900), 100); + gfxWindowsFontType feType; + if (metrics.ntmFlags & NTM_TYPE1) + feType = GFX_FONT_TYPE_TYPE1; + else if (metrics.ntmFlags & (NTM_PS_OPENTYPE)) + feType = GFX_FONT_TYPE_PS_OPENTYPE; + else if (metrics.ntmFlags & (NTM_TT_OPENTYPE)) + feType = GFX_FONT_TYPE_TT_OPENTYPE; + else if (fontType == TRUETYPE_FONTTYPE) + feType = GFX_FONT_TYPE_TRUETYPE; + else if (fontType == RASTER_FONTTYPE) + feType = GFX_FONT_TYPE_RASTER; + else if (fontType == DEVICE_FONTTYPE) + feType = GFX_FONT_TYPE_DEVICE; + else + feType = GFX_FONT_TYPE_UNKNOWN; + FontEntry *fe = nsnull; for (PRUint32 i = 0; i < ff->mVariations.Length(); ++i) { fe = ff->mVariations[i]; + if (feType > fe->mFontType) { + // if the new type is better than the old one, remove the old entries + ff->mVariations.RemoveElementAt(i); + --i; + } else if (feType < fe->mFontType) { + // otherwise if the new type is worse, skip it + return 1; + } + } + for (PRUint32 i = 0; i < ff->mVariations.Length(); ++i) { + fe = ff->mVariations[i]; // check if we already know about this face if (fe->mWeight == logFont.lfWeight && fe->mItalic == (logFont.lfItalic == 0xFF)) { @@ -179,16 +236,13 @@ FontFamily::FamilyAddStylesProc(const ENUMLOGFONTEXW *lpelfe, fe = new FontEntry(ff->mName); ff->mVariations.AppendElement(fe); + fe->mFontType = feType; fe->mItalic = (logFont.lfItalic == 0xFF); fe->mWeight = logFont.lfWeight; - if (metrics.ntmFlags & NTM_TYPE1) - fe->mIsType1 = fe->mForceGDI = PR_TRUE; - - // fontType == TRUETYPE_FONTTYPE when (metrics.ntmFlags & NTM_TT_OPENTYPE) - if (fontType == TRUETYPE_FONTTYPE || metrics.ntmFlags & (NTM_PS_OPENTYPE)) - fe->mTrueType = PR_TRUE; + if (fe->IsType1()) + fe->mForceGDI = PR_TRUE; // mark the charset bit fe->mCharset[metrics.tmCharSet] = 1; @@ -215,6 +269,8 @@ FontFamily::FamilyAddStylesProc(const ENUMLOGFONTEXW *lpelfe, // read in the character map logFont.lfCharSet = DEFAULT_CHARSET; + logFont.lfOutPrecision = FontTypeToOutPrecision(fe->mFontType); + HFONT font = CreateFontIndirectW(&logFont); NS_ASSERTION(font, "This font creation should never ever ever fail"); @@ -225,7 +281,7 @@ FontFamily::FamilyAddStylesProc(const ENUMLOGFONTEXW *lpelfe, if (NS_FAILED(ReadCMAP(hdc, fe))) { // Type1 fonts aren't necessarily Unicode but // this is the best guess we can make here - if (fe->mIsType1) + if (fe->IsType1()) fe->mUnicodeFont = PR_TRUE; else fe->mUnicodeFont = PR_FALSE; @@ -606,11 +662,7 @@ gfxWindowsFont::FillLogFont(gfxFloat aSize) mLogFont.lfUnderline = FALSE; mLogFont.lfStrikeOut = FALSE; mLogFont.lfCharSet = DEFAULT_CHARSET; -#ifndef WINCE - mLogFont.lfOutPrecision = OUT_TT_PRECIS; -#else - mLogFont.lfOutPrecision = OUT_DEFAULT_PRECIS; -#endif + mLogFont.lfOutPrecision = FontTypeToOutPrecision(mFontEntry->mFontType); mLogFont.lfClipPrecision = CLIP_TURNOFF_FONTASSOCIATION; mLogFont.lfQuality = DEFAULT_QUALITY; mLogFont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; @@ -928,7 +980,7 @@ SetupDCFont(HDC dc, gfxWindowsFont *aFont) // GetGlyphIndices is buggy for bitmap and vector fonts, so send them to uniscribe // Also sent Symbol fonts through Uniscribe as it has special code to deal with them - if (!aFont->GetFontEntry()->mTrueType || aFont->GetFontEntry()->mSymbolFont) + if (!aFont->GetFontEntry()->IsTrueType() || aFont->GetFontEntry()->mSymbolFont) return PR_FALSE; return PR_TRUE; @@ -1578,7 +1630,7 @@ public: WORD glyph[1]; PRBool hasGlyph = PR_FALSE; - if (aFontEntry->mIsType1) { + if (aFontEntry->IsType1()) { // Type1 fonts and uniscribe APIs don't get along. ScriptGetCMap will return E_HANDLE DWORD ret = GetGlyphIndicesW(dc, str, 1, glyph, GGI_MARK_NONEXISTING_GLYPHS); if (ret != GDI_ERROR && glyph[0] != 0xFFFF) From 7d64b6cbe74eeae8bb43cfea2e33336cb9148927 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Wed, 7 May 2008 13:33:45 -0700 Subject: [PATCH 90/98] Bug 432492: rate limit long-running safebrowsing updates, patch by Dave Camp , r=tony, a=beltzner --- .../public/nsIUrlClassifierDBService.idl | 6 +- .../src/nsUrlClassifierDBService.cpp | 159 ++++++++++++++---- .../src/nsUrlClassifierStreamUpdater.cpp | 91 +++++++--- .../src/nsUrlClassifierStreamUpdater.h | 8 +- 4 files changed, 204 insertions(+), 60 deletions(-) diff --git a/toolkit/components/url-classifier/public/nsIUrlClassifierDBService.idl b/toolkit/components/url-classifier/public/nsIUrlClassifierDBService.idl index e9386fb060e..e15323f11c5 100644 --- a/toolkit/components/url-classifier/public/nsIUrlClassifierDBService.idl +++ b/toolkit/components/url-classifier/public/nsIUrlClassifierDBService.idl @@ -57,7 +57,7 @@ interface nsIUrlClassifierCallback : nsISupports { * clients streaming updates to the url-classifier (usually * nsUrlClassifierStreamUpdater. */ -[scriptable, uuid(1c9bd1c2-f6fe-43a8-a2b9-48359eb4a9b1)] +[scriptable, uuid(bbb33c65-e783-476c-8db0-6ddb91826c07)] interface nsIUrlClassifierUpdateObserver : nsISupports { /** * The update requested a new URL whose contents should be downloaded @@ -83,8 +83,10 @@ interface nsIUrlClassifierUpdateObserver : nsISupports { * A stream update has completed. * * @param status The state of the update process. + * @param delay The amount of time the updater should wait to fetch the + * next URL in ms. */ - void streamFinished(in nsresult status); + void streamFinished(in nsresult status, in unsigned long delay); /* The update has encountered an error and should be cancelled */ void updateError(in nsresult error); diff --git a/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp b/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp index 7abcd41c25a..f4541455cae 100644 --- a/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp +++ b/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp @@ -154,6 +154,17 @@ static const PRLogModuleInfo *gUrlClassifierDbServiceLog = nsnull; #define UPDATE_CACHE_SIZE_PREF "urlclassifier.updatecachemax" #define UPDATE_CACHE_SIZE_DEFAULT -1 +// Amount of time to spend updating before committing and delaying, in +// seconds. This is checked after each update stream, so the actual +// time spent can be higher than this, depending on update stream size. +#define UPDATE_WORKING_TIME "urlclassifier.workingtime" +#define UPDATE_WORKING_TIME_DEFAULT 5 + +// The amount of time to delay after hitting UPDATE_WORKING_TIME, in +// seconds. +#define UPDATE_DELAY_TIME "urlclassifier.updatetime" +#define UPDATE_DELAY_TIME_DEFAULT 60 + #define PAGE_SIZE 4096 class nsUrlClassifierDBServiceWorker; @@ -172,6 +183,9 @@ static PRInt32 gFreshnessGuarantee = CONFIRM_AGE_DEFAULT_SEC; static PRInt32 gUpdateCacheSize = UPDATE_CACHE_SIZE_DEFAULT; +static PRInt32 gWorkingTimeThreshold = UPDATE_WORKING_TIME_DEFAULT; +static PRInt32 gDelayTime = UPDATE_DELAY_TIME_DEFAULT; + static void SplitTables(const nsACString& str, nsTArray& tables) { @@ -1102,6 +1116,12 @@ private: // Handle chunk data from a stream update nsresult ProcessChunk(PRBool* done); + // Sets up a transaction and begins counting update time. + nsresult SetupUpdate(); + + // Applies the current transaction and resets the update/working times. + nsresult ApplyUpdate(); + // Reset the in-progress update stream void ResetStream(); @@ -1217,6 +1237,10 @@ private: // The MAC stated by the server. nsCString mServerMAC; + // Start time of the current update interval. This will be reset + // every time we apply the update. + PRIntervalTime mUpdateStartTime; + nsCOMPtr mHMAC; // The number of noise entries to add to the set of lookup results. PRInt32 mGethashNoise; @@ -1256,6 +1280,7 @@ nsUrlClassifierDBServiceWorker::nsUrlClassifierDBServiceWorker() , mCachedListsTable(PR_UINT32_MAX) , mHaveCachedAddChunks(PR_FALSE) , mHaveCachedSubChunks(PR_FALSE) + , mUpdateStartTime(0) , mGethashNoise(0) , mPendingLookupLock(nsnull) { @@ -2757,19 +2782,7 @@ nsUrlClassifierDBServiceWorker::BeginUpdate(nsIUrlClassifierUpdateObserver *obse return rv; } - if (gUpdateCacheSize > 0) { - PRUint32 cachePages = gUpdateCacheSize / PAGE_SIZE; - nsCAutoString cacheSizePragma("PRAGMA cache_size="); - cacheSizePragma.AppendInt(cachePages); - rv = mConnection->ExecuteSimpleSQL(cacheSizePragma); - if (NS_FAILED(rv)) { - mUpdateStatus = rv; - return rv; - } - mGrewCache = PR_TRUE; - } - - rv = mConnection->BeginTransaction(); + rv = SetupUpdate(); if (NS_FAILED(rv)) { mUpdateStatus = rv; return rv; @@ -2801,9 +2814,15 @@ nsUrlClassifierDBServiceWorker::BeginStream(const nsACString &table, NS_ENSURE_STATE(mUpdateObserver); NS_ENSURE_STATE(!mInStream); - mInStream = PR_TRUE; + // We may have committed the update in FinishStream, if so set it up + // again here. + nsresult rv = SetupUpdate(); + if (NS_FAILED(rv)) { + mUpdateStatus = rv; + return rv; + } - nsresult rv; + mInStream = PR_TRUE; // If we're expecting a MAC, create the nsICryptoHMAC component now. if (!mUpdateClientKey.IsEmpty()) { @@ -2941,6 +2960,8 @@ nsUrlClassifierDBServiceWorker::FinishStream() NS_ENSURE_STATE(mInStream); NS_ENSURE_STATE(mUpdateObserver); + PRInt32 nextStreamDelay = 0; + if (NS_SUCCEEDED(mUpdateStatus) && mHMAC) { nsCAutoString clientMAC; mHMAC->Finish(PR_TRUE, clientMAC); @@ -2951,34 +2972,91 @@ nsUrlClassifierDBServiceWorker::FinishStream() mServerMAC.get(), clientMAC.get())); mUpdateStatus = NS_ERROR_FAILURE; } + PRIntervalTime updateTime = PR_IntervalNow() - mUpdateStartTime; + if (PR_IntervalToSeconds(updateTime) >= + static_cast(gWorkingTimeThreshold)) { + // We've spent long enough working that we should commit what we + // have and hold off for a bit. + ApplyUpdate(); + + nextStreamDelay = gDelayTime * 1000; + } } - mUpdateObserver->StreamFinished(mUpdateStatus); + mUpdateObserver->StreamFinished(mUpdateStatus, + static_cast(nextStreamDelay)); ResetStream(); return NS_OK; } +nsresult +nsUrlClassifierDBServiceWorker::SetupUpdate() +{ + LOG(("nsUrlClassifierDBServiceWorker::SetupUpdate")); + PRBool inProgress; + nsresult rv = mConnection->GetTransactionInProgress(&inProgress); + if (inProgress) { + return NS_OK; + } + + mUpdateStartTime = PR_IntervalNow(); + + rv = mConnection->BeginTransaction(); + NS_ENSURE_SUCCESS(rv, rv); + + if (gUpdateCacheSize > 0) { + PRUint32 cachePages = gUpdateCacheSize / PAGE_SIZE; + nsCAutoString cacheSizePragma("PRAGMA cache_size="); + cacheSizePragma.AppendInt(cachePages); + rv = mConnection->ExecuteSimpleSQL(cacheSizePragma); + NS_ENSURE_SUCCESS(rv, rv); + mGrewCache = PR_TRUE; + } + + return NS_OK; +} + +nsresult +nsUrlClassifierDBServiceWorker::ApplyUpdate() +{ + LOG(("nsUrlClassifierDBServiceWorker::ApplyUpdate")); + + if (NS_FAILED(mUpdateStatus)) { + mConnection->RollbackTransaction(); + } else { + mUpdateStatus = FlushChunkLists(); + if (NS_SUCCEEDED(mUpdateStatus)) { + mUpdateStatus = mConnection->CommitTransaction(); + } + } + + if (mGrewCache) { + // During the update we increased the page cache to bigger than we + // want to keep around. At the moment, the only reliable way to make + // sure that the page cache is freed is to reopen the connection. + mGrewCache = PR_FALSE; + CloseDb(); + OpenDb(); + } + + mUpdateStartTime = 0; + + return NS_OK; +} + NS_IMETHODIMP nsUrlClassifierDBServiceWorker::FinishUpdate() { + LOG(("nsUrlClassifierDBServiceWorker::FinishUpdate()")); if (gShuttingDownThread) return NS_ERROR_NOT_INITIALIZED; NS_ENSURE_STATE(!mInStream); NS_ENSURE_STATE(mUpdateObserver); - if (NS_SUCCEEDED(mUpdateStatus)) { - mUpdateStatus = FlushChunkLists(); - } - - nsCAutoString arg; - if (NS_SUCCEEDED(mUpdateStatus)) { - mUpdateStatus = mConnection->CommitTransaction(); - } else { - mConnection->RollbackTransaction(); - } + ApplyUpdate(); if (NS_SUCCEEDED(mUpdateStatus)) { mUpdateObserver->UpdateSuccess(mUpdateWait); @@ -3011,13 +3089,6 @@ nsUrlClassifierDBServiceWorker::FinishUpdate() // database reset. if (NS_SUCCEEDED(mUpdateStatus) && resetRequested) { ResetDatabase(); - } else if (mGrewCache) { - // During the update we increased the page cache to bigger than we - // want to keep around. At the moment, the only reliable way to make - // sure that the page cache is freed is to reopen the connection. - mGrewCache = PR_FALSE; - CloseDb(); - OpenDb(); } return NS_OK; @@ -3071,8 +3142,6 @@ NS_IMETHODIMP nsUrlClassifierDBServiceWorker::CloseDb() { if (mConnection) { - CancelUpdate(); - mMainStore.Close(); mPendingSubStore.Close(); @@ -3668,6 +3737,14 @@ nsUrlClassifierDBService::Init() rv = prefs->GetIntPref(UPDATE_CACHE_SIZE_PREF, &tmpint); PR_AtomicSet(&gUpdateCacheSize, NS_SUCCEEDED(rv) ? tmpint : UPDATE_CACHE_SIZE_DEFAULT); + + rv = prefs->GetIntPref(UPDATE_WORKING_TIME, &tmpint); + PR_AtomicSet(&gWorkingTimeThreshold, + NS_SUCCEEDED(rv) ? tmpint : UPDATE_WORKING_TIME_DEFAULT); + + rv = prefs->GetIntPref(UPDATE_DELAY_TIME, &tmpint); + PR_AtomicSet(&gDelayTime, + NS_SUCCEEDED(rv) ? tmpint : UPDATE_DELAY_TIME_DEFAULT); } // Start the background thread. @@ -3960,6 +4037,16 @@ nsUrlClassifierDBService::Observe(nsISupports *aSubject, const char *aTopic, PRInt32 tmpint; rv = prefs->GetIntPref(UPDATE_CACHE_SIZE_PREF, &tmpint); PR_AtomicSet(&gUpdateCacheSize, NS_SUCCEEDED(rv) ? tmpint : UPDATE_CACHE_SIZE_DEFAULT); + } else if (NS_LITERAL_STRING(UPDATE_WORKING_TIME).Equals(aData)) { + PRInt32 tmpint; + rv = prefs->GetIntPref(UPDATE_WORKING_TIME, &tmpint); + PR_AtomicSet(&gWorkingTimeThreshold, + NS_SUCCEEDED(rv) ? tmpint : UPDATE_WORKING_TIME_DEFAULT); + } else if (NS_LITERAL_STRING(UPDATE_DELAY_TIME).Equals(aData)) { + PRInt32 tmpint; + rv = prefs->GetIntPref(UPDATE_DELAY_TIME, &tmpint); + PR_AtomicSet(&gDelayTime, + NS_SUCCEEDED(rv) ? tmpint : UPDATE_DELAY_TIME_DEFAULT); } } else if (!strcmp(aTopic, "profile-before-change") || !strcmp(aTopic, "xpcom-shutdown-threads")) { @@ -3993,6 +4080,8 @@ nsUrlClassifierDBService::Shutdown() nsresult rv; // First close the db connection. if (mWorker) { + rv = mWorkerProxy->CancelUpdate(); + NS_ASSERTION(NS_SUCCEEDED(rv), "failed to post cancel udpate event"); rv = mWorkerProxy->CloseDb(); NS_ASSERTION(NS_SUCCEEDED(rv), "failed to post close db event"); } diff --git a/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp b/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp index 5dad171e349..fa1086a7cdc 100644 --- a/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp +++ b/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.cpp @@ -75,7 +75,7 @@ nsUrlClassifierStreamUpdater::nsUrlClassifierStreamUpdater() } -NS_IMPL_THREADSAFE_ISUPPORTS8(nsUrlClassifierStreamUpdater, +NS_IMPL_THREADSAFE_ISUPPORTS9(nsUrlClassifierStreamUpdater, nsIUrlClassifierStreamUpdater, nsIUrlClassifierUpdateObserver, nsIRequestObserver, @@ -83,7 +83,8 @@ NS_IMPL_THREADSAFE_ISUPPORTS8(nsUrlClassifierStreamUpdater, nsIObserver, nsIBadCertListener2, nsISSLErrorListener, - nsIInterfaceRequestor) + nsIInterfaceRequestor, + nsITimerCallback) /** * Clear out the update. @@ -271,29 +272,54 @@ nsUrlClassifierStreamUpdater::RekeyRequested() nsnull); } -NS_IMETHODIMP -nsUrlClassifierStreamUpdater::StreamFinished(nsresult status) +nsresult +nsUrlClassifierStreamUpdater::FetchNext() { - nsresult rv; + if (mPendingUpdates.Length() == 0) { + return NS_OK; + } - // Pop off a pending URL and update it. - if (NS_SUCCEEDED(status) && mPendingUpdates.Length() > 0) { - PendingUpdate &update = mPendingUpdates[0]; - rv = FetchUpdate(update.mUrl, EmptyCString(), - update.mTable, update.mServerMAC); - if (NS_FAILED(rv)) { - LOG(("Error fetching update url: %s\n", update.mUrl.get())); - // We can commit the urls that we've applied so far. This is - // probably a transient server problem, so trigger backoff. - mDownloadErrorCallback->HandleEvent(EmptyCString()); - mDownloadError = PR_TRUE; - mDBService->FinishUpdate(); - return rv; - } - - mPendingUpdates.RemoveElementAt(0); - } else { + PendingUpdate &update = mPendingUpdates[0]; + LOG(("Fetching update url: %s\n", update.mUrl.get())); + nsresult rv = FetchUpdate(update.mUrl, EmptyCString(), + update.mTable, update.mServerMAC); + if (NS_FAILED(rv)) { + LOG(("Error fetching update url: %s\n", update.mUrl.get())); + // We can commit the urls that we've applied so far. This is + // probably a transient server problem, so trigger backoff. + mDownloadErrorCallback->HandleEvent(EmptyCString()); + mDownloadError = PR_TRUE; mDBService->FinishUpdate(); + return rv; + } + + mPendingUpdates.RemoveElementAt(0); + + return NS_OK; +} + +NS_IMETHODIMP +nsUrlClassifierStreamUpdater::StreamFinished(nsresult status, + PRUint32 requestedDelay) +{ + LOG(("nsUrlClassifierStreamUpdater::StreamFinished [%x, %d]", status, requestedDelay)); + if (NS_FAILED(status) || mPendingUpdates.Length() == 0) { + // We're done. + mDBService->FinishUpdate(); + return NS_OK; + } + + // Wait the requested amount of time before starting a new stream. + nsresult rv; + mTimer = do_CreateInstance("@mozilla.org/timer;1", &rv); + if (NS_SUCCEEDED(rv)) { + rv = mTimer->InitWithCallback(this, requestedDelay, + nsITimer::TYPE_ONE_SHOT); + } + + if (NS_FAILED(rv)) { + NS_WARNING("Unable to initialize timer, fetching next safebrowsing item immediately"); + return FetchNext(); } return NS_OK; @@ -500,6 +526,10 @@ nsUrlClassifierStreamUpdater::Observe(nsISupports *aSubject, const char *aTopic, mIsUpdating = PR_FALSE; mChannel = nsnull; } + if (mTimer) { + mTimer->Cancel(); + mTimer = nsnull; + } } return NS_OK; } @@ -538,3 +568,20 @@ nsUrlClassifierStreamUpdater::GetInterface(const nsIID & eventSinkIID, void* *_r { return QueryInterface(eventSinkIID, _retval); } + + +/////////////////////////////////////////////////////////////////////////////// +// nsITimerCallback implementation +NS_IMETHODIMP +nsUrlClassifierStreamUpdater::Notify(nsITimer *timer) +{ + LOG(("nsUrlClassifierStreamUpdater::Notify [%p]", this)); + + mTimer = nsnull; + + // Start the update process up again. + FetchNext(); + + return NS_OK; +} + diff --git a/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.h b/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.h index 5048b322f37..7279d72e8bb 100644 --- a/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.h +++ b/toolkit/components/url-classifier/src/nsUrlClassifierStreamUpdater.h @@ -49,6 +49,7 @@ #include "nsTArray.h" #include "nsIBadCertListener2.h" #include "nsISSLErrorListener.h" +#include "nsITimer.h" // Forward declare pointers class nsIURI; @@ -59,7 +60,8 @@ class nsUrlClassifierStreamUpdater : public nsIUrlClassifierStreamUpdater, public nsIObserver, public nsIBadCertListener2, public nsISSLErrorListener, - public nsIInterfaceRequestor + public nsIInterfaceRequestor, + public nsITimerCallback { public: nsUrlClassifierStreamUpdater(); @@ -73,6 +75,7 @@ public: NS_DECL_NSIBADCERTLISTENER2 NS_DECL_NSISSLERRORLISTENER NS_DECL_NSIOBSERVER + NS_DECL_NSITIMERCALLBACK private: // No subclassing @@ -96,6 +99,8 @@ private: const nsACString &aTable, const nsACString &aServerMAC); + nsresult FetchNext(); + PRBool mIsUpdating; PRBool mInitialized; PRBool mDownloadError; @@ -105,6 +110,7 @@ private: nsCString mServerMAC; nsCOMPtr mChannel; nsCOMPtr mDBService; + nsCOMPtr mTimer; struct PendingUpdate { nsCString mUrl; From 3f4e8e6f69f5086db18acc44fc081cb9d39d0c63 Mon Sep 17 00:00:00 2001 From: "johnath@mozilla.com" Date: Wed, 7 May 2008 13:39:53 -0700 Subject: [PATCH 91/98] Hyperlinked ssl error page not useful for wildcards. b=432491 r=gavin a=beltzner --- docshell/resources/content/netError.xhtml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docshell/resources/content/netError.xhtml b/docshell/resources/content/netError.xhtml index f491eb2f35b..365def35ff0 100644 --- a/docshell/resources/content/netError.xhtml +++ b/docshell/resources/content/netError.xhtml @@ -223,6 +223,11 @@ var thisHost = document.location.hostname; var proto = document.location.protocol; + // If okHost is a wildcard domain ("*.example.com") let's + // use "www" instead. "*.example.com" isn't going to + // get anyone anywhere useful. bug 432491 + okHost = okHost.replace(/^\*\./, "www."); + /* case #1: * example.com uses an invalid security certificate. * From dcf90d5df874528e4b7728c7669c4645e1a66950 Mon Sep 17 00:00:00 2001 From: "joshmoz@gmail.com" Date: Wed, 7 May 2008 14:13:01 -0700 Subject: [PATCH 92/98] null check. patch by Steven Michaud. b=432556 r=josh sr=roc a=schrep --- widget/src/cocoa/nsCocoaWindow.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/widget/src/cocoa/nsCocoaWindow.mm b/widget/src/cocoa/nsCocoaWindow.mm index b9aea286a29..b2f481a20fa 100644 --- a/widget/src/cocoa/nsCocoaWindow.mm +++ b/widget/src/cocoa/nsCocoaWindow.mm @@ -1748,6 +1748,8 @@ NS_IMETHODIMP nsCocoaWindow::EndSecureKeyboardInput() NS_OBJC_BEGIN_TRY_ABORT_BLOCK; nsCocoaWindow *geckoWindow = [[self delegate] geckoWidget]; + if (!geckoWindow) + return; nsEventStatus status = nsEventStatus_eIgnore; nsGUIEvent guiEvent(PR_TRUE, NS_OS_TOOLBAR, geckoWindow); guiEvent.time = PR_IntervalNow(); From 5994730265df491bda30e9a5d305bcce679e882b Mon Sep 17 00:00:00 2001 From: "joshmoz@gmail.com" Date: Wed, 7 May 2008 14:15:57 -0700 Subject: [PATCH 93/98] fix active/inactive for sheets that are children of sheets. patch by Steven Michaud. b=432212 r=josh sr=roc a=schrep --- widget/src/cocoa/nsCocoaWindow.mm | 38 +++++++++++++++++++++++----- widget/src/cocoa/nsPIWidgetCocoa.idl | 6 ++++- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/widget/src/cocoa/nsCocoaWindow.mm b/widget/src/cocoa/nsCocoaWindow.mm index b2f481a20fa..704d23b6345 100644 --- a/widget/src/cocoa/nsCocoaWindow.mm +++ b/widget/src/cocoa/nsCocoaWindow.mm @@ -605,13 +605,15 @@ NS_IMETHODIMP nsCocoaWindow::Show(PRBool bState) if (![mWindow isVisible]) { mSheetNeedsShow = PR_FALSE; mSheetWindowParent = topNonSheetWindow; + // Only set contextInfo if our parent isn't a sheet. + NSWindow* contextInfo = parentIsSheet ? nil : mSheetWindowParent; [TopLevelWindowData deactivateInWindow:mSheetWindowParent]; [mWindow setAcceptsMouseMovedEvents:YES]; [NSApp beginSheet:mWindow modalForWindow:mSheetWindowParent modalDelegate:mDelegate didEndSelector:@selector(didEndSheet:returnCode:contextInfo:) - contextInfo:mSheetWindowParent]; + contextInfo:contextInfo]; [TopLevelWindowData activateInWindow:mWindow]; SendSetZLevelEvent(); } @@ -696,6 +698,18 @@ NS_IMETHODIMP nsCocoaWindow::Show(PRBool bState) else if (nativeParentWindow && piParentWidget && NS_SUCCEEDED(piParentWidget->GetIsSheet(&parentIsSheet)) && parentIsSheet) { + // Only set contextInfo if the parent of the parent sheet we're about + // to restore isn't itself a sheet. + NSWindow* contextInfo = sheetParent; + nsIWidget* grandparentWidget = nil; + if (NS_SUCCEEDED(piParentWidget->GetRealParent(&grandparentWidget)) && grandparentWidget) { + nsCOMPtr piGrandparentWidget(do_QueryInterface(grandparentWidget)); + PRBool grandparentIsSheet = PR_FALSE; + if (piGrandparentWidget && NS_SUCCEEDED(piGrandparentWidget->GetIsSheet(&grandparentIsSheet)) && + grandparentIsSheet) { + contextInfo = nil; + } + } // If there are no sibling sheets, but the parent is a sheet, restore // it. It wasn't sent any deactivate events when it was hidden, so // don't call through Show, just let the OS put it back up. @@ -704,7 +718,7 @@ NS_IMETHODIMP nsCocoaWindow::Show(PRBool bState) modalForWindow:sheetParent modalDelegate:[nativeParentWindow delegate] didEndSelector:@selector(didEndSheet:returnCode:contextInfo:) - contextInfo:sheetParent]; + contextInfo:contextInfo]; } else { // Sheet, that was hard. No more siblings or parents, going back @@ -1110,6 +1124,13 @@ NS_IMETHODIMP nsCocoaWindow::GetMenuBar(nsIMenuBar** menuBar) } +NS_IMETHODIMP nsCocoaWindow::GetRealParent(nsIWidget** parent) +{ + *parent = mParent; + return NS_OK; +} + + NS_IMETHODIMP nsCocoaWindow::GetIsSheet(PRBool* isSheet) { mWindowType == eWindowType_sheet ? *isSheet = PR_TRUE : *isSheet = PR_FALSE; @@ -1570,12 +1591,17 @@ NS_IMETHODIMP nsCocoaWindow::EndSecureKeyboardInput() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - // Note: 'contextInfo' is the window that is the parent of the sheet, - // we set that in nsCocoaWindow::Show. 'contextInfo' is always the top-level - // window, not another sheet itself. + // Note: 'contextInfo' (if it is set) is the window that is the parent of + // the sheet. The value of contextInfo is determined in + // nsCocoaWindow::Show(). If it's set, 'contextInfo' is always the top- + // level window, not another sheet itself. But 'contextInfo' is nil if + // our parent window is also a sheet -- in that case we shouldn't send + // the top-level window any activate events (because it's our parent + // window that needs to get these events, not the top-level window). [TopLevelWindowData deactivateInWindow:sheet]; [sheet orderOut:self]; - [TopLevelWindowData activateInWindow:(NSWindow*)contextInfo]; + if (contextInfo) + [TopLevelWindowData activateInWindow:(NSWindow*)contextInfo]; NS_OBJC_END_TRY_ABORT_BLOCK; } diff --git a/widget/src/cocoa/nsPIWidgetCocoa.idl b/widget/src/cocoa/nsPIWidgetCocoa.idl index 0f20cb8fce8..6126da56611 100644 --- a/widget/src/cocoa/nsPIWidgetCocoa.idl +++ b/widget/src/cocoa/nsPIWidgetCocoa.idl @@ -41,6 +41,7 @@ interface nsIMenuBar; interface nsCocoaWindow; +interface nsIWidget; [ptr] native NSWindowPtr(NSWindow); @@ -50,7 +51,7 @@ interface nsCocoaWindow; // A private interface (unfrozen, private to the widget implementation) that // gives us access to some extra features on a widget/window. // -[uuid(ce1a5550-f680-11da-974d-0800200c9a66)] +[uuid(F08E9D06-6705-4749-BE81-CEF931246E06)] interface nsPIWidgetCocoa : nsISupports { void SendSetZLevelEvent(); @@ -62,6 +63,9 @@ interface nsPIWidgetCocoa : nsISupports // wants to be displayed (if !aShown) nsCocoaWindow GetChildSheet(in boolean aShown); + // Get the parent widget (if any) StandardCreate() was called with. + nsIWidget GetRealParent(); + // If the object implementing this interface is a sheet, this will return the // native NSWindow it is attached to readonly attribute NSWindowPtr sheetWindowParent; From 018f91f57fff025290ec3c3166d8b65f833eb16c Mon Sep 17 00:00:00 2001 From: "pavlov@pavlov.net" Date: Wed, 7 May 2008 14:21:40 -0700 Subject: [PATCH 94/98] bug 427351. sbrk behaves poorly. disable it. patch from Jason Evans r=me a=schrep --- memory/jemalloc/jemalloc.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/memory/jemalloc/jemalloc.c b/memory/jemalloc/jemalloc.c index 63eeffdd0aa..67f8557ca74 100644 --- a/memory/jemalloc/jemalloc.c +++ b/memory/jemalloc/jemalloc.c @@ -157,17 +157,31 @@ * unnecessary, but we are burdened by history and the lack of resource limits * for anonymous mapped memory. */ -#if (!defined(MOZ_MEMORY_DARWIN) && !defined(MOZ_MEMORY_WINDOWS)) -#define MALLOC_DSS -#endif +/* + * Uniformly disable sbrk(2) use in Mozilla, since it has various problems + * across platforms: + * + * Linux: sbrk() fails to detect error conditions when using large amounts of + * memory, resulting in memory corruption. + * + * Darwin: sbrk() is severely limited in how much memory it can allocate, and + * its use is strongly discouraged. + * + * Solaris: sbrk() does not necessarily discard pages when the DSS is shrunk, + * which makes it possible to get non-zeroed pages when re-expanding + * the DSS. This is incompatible with jemalloc's assumptions, and a + * fix would require chunk_alloc_dss() to optionally zero memory as + * chunk_recycle_dss() does (though the cost could be reduced by + * keeping track of the DSS high water mark and zeroing only when + * below that mark). + */ +/* #define MALLOC_DSS */ #ifdef MOZ_MEMORY_LINUX #define _GNU_SOURCE /* For mremap(2). */ #define issetugid() 0 #if 0 /* Enable in order to test decommit code on Linux. */ # define MALLOC_DECOMMIT -/* The decommit code for Unix doesn't support DSS chunks. */ -# undef MALLOC_DSS #endif #endif From 745427ca3e02623fd50c390da910c9ad79f08687 Mon Sep 17 00:00:00 2001 From: "ajschult@verizon.net" Date: Wed, 7 May 2008 14:45:13 -0700 Subject: [PATCH 95/98] Bug 431464: TestRunner should try to ensure focus, r=sayrer --- .../mochitest/tests/SimpleTest/TestRunner.js | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/testing/mochitest/tests/SimpleTest/TestRunner.js b/testing/mochitest/tests/SimpleTest/TestRunner.js index 548ce66838d..89004089d8c 100644 --- a/testing/mochitest/tests/SimpleTest/TestRunner.js +++ b/testing/mochitest/tests/SimpleTest/TestRunner.js @@ -69,8 +69,24 @@ TestRunner._toggle = function(el) { /** * Creates the iframe that contains a test **/ -TestRunner._makeIframe = function (url) { +TestRunner._makeIframe = function (url, retry) { var iframe = $('testframe'); + if (url != "about:blank" && (!document.hasFocus() || + document.activeElement != iframe)) { + // typically calling ourselves from setTimeout is sufficient + // but we'll try focus() just in case that's needed + window.focus(); + iframe.focus(); + if (retry < 3) { + window.setTimeout('TestRunner._makeIframe("'+url+'", '+(retry+1)+')', 1000); + return; + } + + var frameWindow = $('testframe').contentWindow.wrappedJSObject || + $('testframe').contentWindow; + frameWindow.SimpleTest.ok(false, "Unable to restore focus, expect failures and timeouts."); + } + window.scrollTo(0, $('indicator').offsetTop); iframe.src = url; iframe.name = url; iframe.width = "500"; @@ -90,6 +106,8 @@ TestRunner.runTests = function (/*url...*/) { TestRunner._urls = flattenArguments(arguments); $('testframe').src=""; TestRunner._checkForHangs(); + window.focus(); + $('testframe').focus(); TestRunner.runNextTest(); }; @@ -110,10 +128,10 @@ TestRunner.runNextTest = function() { if (TestRunner.logEnabled) TestRunner.logger.log("Running " + url + "..."); - TestRunner._makeIframe(url); + TestRunner._makeIframe(url, 0); } else { $("current-test").innerHTML = "Finished"; - TestRunner._makeIframe("about:blank"); + TestRunner._makeIframe("about:blank", 0); if (TestRunner.logEnabled) { TestRunner.logger.log("Passed: " + $("pass-count").innerHTML); TestRunner.logger.log("Failed: " + $("fail-count").innerHTML); From aad8b1e42313b216b1fb63b5c5ba8fa335915e43 Mon Sep 17 00:00:00 2001 From: "joshmoz@gmail.com" Date: Wed, 7 May 2008 14:54:21 -0700 Subject: [PATCH 96/98] key translation fixes, patch by Masayuki. b=432388 r=josh r=karl sr=roc a=schrep --- widget/src/cocoa/nsChildView.mm | 246 +++++++++++++++++++++++++------- widget/tests/test_keycodes.xul | 21 ++- 2 files changed, 212 insertions(+), 55 deletions(-) diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index f0f13c22062..8d4140fcf28 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -3980,6 +3980,136 @@ static PRBool IsNormalCharInputtingEvent(const nsKeyEvent& aEvent) } +#define CHARCODE_MASK_1 0x00FF0000 +#define CHARCODE_MASK_2 0x000000FF +#define CHARCODE_MASK 0x00FF00FF +//#define DEBUG_KB 1 + +static PRUint32 +KeyTranslateToUnicode(Handle aHandle, UInt32 aKeyCode, UInt32 aModifiers, + TextEncoding aEncoding) +{ +#ifdef DEBUG_KB + NSLog(@"**** KeyTranslateToUnicode: aHandle: %p, aKeyCode: %X, aModifiers: %X, aEncoding: %X", + aHandle, aKeyCode, aModifiers, aEncoding); + PRBool isShift = aModifiers & shiftKey; + PRBool isCtrl = aModifiers & controlKey; + PRBool isOpt = aModifiers & optionKey; + PRBool isCmd = aModifiers & cmdKey; + PRBool isCL = aModifiers & alphaLock; + PRBool isNL = aModifiers & kEventKeyModifierNumLockMask; + NSLog(@" Shift: %s, Ctrl: %s, Opt: %s, Cmd: %s, CapsLock: %s, NumLock: %s", + isShift ? "ON" : "off", isCtrl ? "ON" : "off", isOpt ? "ON" : "off", + isCmd ? "ON" : "off", isCL ? "ON" : "off", isNL ? "ON" : "off"); +#endif + UInt32 state = 0; + UInt32 val = + ::KeyTranslate(aHandle, aKeyCode | aModifiers, &state) & CHARCODE_MASK; + // If state is not zero, it is in dead key state. Then, we need to recall + // KeyTranslate for getting the actual character. + if (state) { + val = + ::KeyTranslate(aHandle, aKeyCode | aModifiers, &state) & CHARCODE_MASK; + } + PRUint32 ch = 0; + UInt8 buf[2]; + CFIndex len = 0; + if (val & CHARCODE_MASK_1) + buf[len++] = (val & CHARCODE_MASK_1) >> 16; + buf[len++] = val & CHARCODE_MASK_2; + + CFStringRef str = + ::CFStringCreateWithBytes(kCFAllocatorDefault, buf, len, + (CFStringEncoding)aEncoding, false); + ch = ::CFStringGetLength(str) == 1 ? + ::CFStringGetCharacterAtIndex(str, 0) : 0; + ::CFRelease(str); +#ifdef DEBUG_KB + NSLog(@" result: %X(%C)", ch, ch > ' ' ? ch : ' '); +#endif + return ch; +} + +static PRUint32 +UCKeyTranslateToUnicode(UCKeyboardLayout* aHandle, UInt32 aKeyCode, UInt32 aModifiers, + UInt32 aKbType) +{ +#ifdef DEBUG_KB + NSLog(@"**** UCKeyTranslateToUnicode: aHandle: %p, aKeyCode: %X, aModifiers: %X, aKbType: %X", + aHandle, aKeyCode, aModifiers, aKbType); + PRBool isShift = aModifiers & shiftKey; + PRBool isCtrl = aModifiers & controlKey; + PRBool isOpt = aModifiers & optionKey; + PRBool isCmd = aModifiers & cmdKey; + PRBool isCL = aModifiers & alphaLock; + PRBool isNL = aModifiers & kEventKeyModifierNumLockMask; + NSLog(@" Shift: %s, Ctrl: %s, Opt: %s, Cmd: %s, CapsLock: %s, NumLock: %s", + isShift ? "ON" : "off", isCtrl ? "ON" : "off", isOpt ? "ON" : "off", + isCmd ? "ON" : "off", isCL ? "ON" : "off", isNL ? "ON" : "off"); +#endif + UInt32 deadKeyState = 0; + UniCharCount len; + UniChar chars[5]; + OSStatus err = ::UCKeyTranslate(aHandle, aKeyCode, + kUCKeyActionDown, aModifiers >> 8, + aKbType, kUCKeyTranslateNoDeadKeysMask, + &deadKeyState, 5, &len, chars); + PRUint32 ch = (err == noErr && len == 1) ? PRUint32(chars[0]) : 0; +#ifdef DEBUG_KB + NSLog(@" result: %X(%C)", ch, ch > ' ' ? ch : ' '); +#endif + return ch; +} + +struct KeyTranslateData { + KeyTranslateData() { + mUchr.mLayout = nsnull; + mUchr.mKbType = 0; + mKchr.mHandle = nsnull; + mKchr.mEncoding = nsnull; + } + + SInt16 mScript; + SInt32 mLayoutID; + + struct { + UCKeyboardLayout* mLayout; + UInt32 mKbType; + } mUchr; + struct { + Handle mHandle; + TextEncoding mEncoding; + } mKchr; +}; + +static PRUint32 +GetUniCharFromKeyTranslate(KeyTranslateData& aData, + UInt32 aKeyCode, UInt32 aModifiers) +{ + if (aData.mUchr.mLayout) { + return UCKeyTranslateToUnicode(aData.mUchr.mLayout, aKeyCode, aModifiers, + aData.mUchr.mKbType); + } + if (aData.mKchr.mHandle) { + return KeyTranslateToUnicode(aData.mKchr.mHandle, aKeyCode, aModifiers, + aData.mKchr.mEncoding); + } + return 0; +} + +static SInt32 +GetScriptFromKeyboardLayout(SInt32 aLayoutID) +{ + switch (aLayoutID) { + case 3: // German + case -2: return smRoman; // US-Extended + case -18944: return smGreek; // Greek + default: NS_NOTREACHED("unknown keyboard layout"); + } + return smRoman; +} + + - (void) convertCocoaKeyEvent:(NSEvent*)aKeyEvent toGeckoEvent:(nsKeyEvent*)outGeckoEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -4016,67 +4146,75 @@ static PRBool IsNormalCharInputtingEvent(const nsKeyEvent& aEvent) // unshiftCharCode for accessKeys and accelKeys. if (outGeckoEvent->isControl || outGeckoEvent->isMeta || outGeckoEvent->isAlt) { - SInt16 keyLayoutID = gOverrideKeyboardLayout ? gOverrideKeyboardLayout - : ::GetScriptVariable(::GetScriptManagerVariable(smKeyScript), - smScriptKeys); - Handle handle = ::GetResource('uchr', keyLayoutID); - PRUint32 unshiftedChar = 0; - PRUint32 shiftedChar = 0; - PRUint32 shiftedCmdChar = 0; - if (handle) { - UInt32 kbType = ::LMGetKbdType(); - UInt32 deadKeyState = 0; - UniCharCount len; - UniChar chars[1]; - OSStatus err; - err = ::UCKeyTranslate((UCKeyboardLayout*)*handle, - [aKeyEvent keyCode], - kUCKeyActionDown, 0, - kbType, 0, &deadKeyState, 1, &len, chars); - if (noErr == err && len > 0) - unshiftedChar = chars[0]; - deadKeyState = 0; - err = ::UCKeyTranslate((UCKeyboardLayout*)*handle, [aKeyEvent keyCode], - kUCKeyActionDown, shiftKey >> 8, - kbType, 0, &deadKeyState, 1, &len, chars); - if (noErr == err && len > 0) - shiftedChar = chars[0]; - deadKeyState = 0; - err = ::UCKeyTranslate((UCKeyboardLayout*)*handle, [aKeyEvent keyCode], - kUCKeyActionDown, (cmdKey | shiftKey) >> 8, - kbType, 0, &deadKeyState, 1, &len, chars); - if (noErr == err && len > 0) - shiftedCmdChar = chars[0]; + KeyTranslateData kt; + if (gOverrideKeyboardLayout) { + kt.mLayoutID = gOverrideKeyboardLayout; + kt.mScript = GetScriptFromKeyboardLayout(kt.mLayoutID); } else { - if (gOverrideKeyboardLayout) { - handle = ::GetResource('kchr', gOverrideKeyboardLayout); - } else { - handle = (char**)::GetScriptManagerVariable(smKCHRCache); - } - if (handle) { - UInt32 state = 0; - UInt32 keyCode = [aKeyEvent keyCode]; - unshiftedChar = ::KeyTranslate(handle, keyCode, &state) & charCodeMask; - keyCode = [aKeyEvent keyCode] | shiftKey; - shiftedChar = ::KeyTranslate(handle, keyCode, &state) & charCodeMask; - keyCode = [aKeyEvent keyCode] | shiftKey | cmdKey; - shiftedCmdChar = ::KeyTranslate(handle, keyCode, &state) & charCodeMask; + kt.mScript = ::GetScriptManagerVariable(smKeyScript); + kt.mLayoutID = ::GetScriptVariable(kt.mScript, smScriptKeys); + } + Handle handle = ::GetResource('uchr', kt.mLayoutID); + if (handle) { + kt.mUchr.mLayout = *((UCKeyboardLayout**)handle); + kt.mUchr.mKbType = ::LMGetKbdType(); + } else { + kt.mKchr.mHandle = ::GetResource('kchr', kt.mLayoutID); + if (!kt.mKchr.mHandle && !gOverrideKeyboardLayout) + kt.mKchr.mHandle = (char**)::GetScriptManagerVariable(smKCHRCache); + if (kt.mKchr.mHandle) { + OSStatus err = + ::GetTextEncodingFromScriptInfo(kt.mScript, kTextLanguageDontCare, + kTextRegionDontCare, + &kt.mKchr.mEncoding); + if (err != noErr) + kt.mKchr.mHandle = nsnull; } } - // If the current keyboad layout is switchable by Cmd key - // (e.g., Dvorak-QWERTY layout), we should not append the alternative - // char codes to unshiftedCharCodes and shiftedCharCodes. - // Because then, the alternative char codes might execute wrong item. - // Therefore, we should check whether the unshiftedChar and shiftedCmdChar - // are same. Because Cmd+Shift+'foo' returns unshifted 'foo'. So, they - // should be same for this case. - // Note that we cannot support the combination of Cmd and Shift needed - // char. (E.g., Cmd++ in US keyboard layout.) + PRUint32 unshiftedChar = 0; + PRUint32 shiftedChar = 0; + PRUint32 unshiftedCmdChar = 0; + PRUint32 shiftedCmdChar = 0; + + UInt32 key = [aKeyEvent keyCode]; + UInt32 mod; + + // normal chars + mod = 0; + unshiftedChar = GetUniCharFromKeyTranslate(kt, key, mod); + mod |= shiftKey; + shiftedChar = GetUniCharFromKeyTranslate(kt, key, mod); + + // with cmd chars + mod = cmdKey; + unshiftedCmdChar = GetUniCharFromKeyTranslate(kt, key, mod); + mod |= shiftKey; + shiftedCmdChar = GetUniCharFromKeyTranslate(kt, key, mod); + + // Is the keyboard layout changed by Cmd key? + // E.g., Arabic, Russian, Hebrew, Greek and Dvorak-QWERTY. + PRBool isCmdSwitchLayout = unshiftedChar != unshiftedCmdChar; + // Is the keyboard layout for Latin, but Cmd key switches the layout? + // I.e., Dvorak-QWERTY + PRBool isDvorakQWERTY = isCmdSwitchLayout && + unshiftedChar && unshiftedChar < 0x7F; + + // If the current keyboard is not Dvorak-QWERTY or Cmd is not pressed, + // we should append unshiftedChar and shiftedChar for handling the + // normal characters. if ((unshiftedChar || shiftedChar) && - (!outGeckoEvent->isMeta || unshiftedChar == shiftedCmdChar)) { + (!outGeckoEvent->isMeta || !isDvorakQWERTY)) { nsAlternativeCharCode altCharCodes(unshiftedChar, shiftedChar); outGeckoEvent->alternativeCharCodes.AppendElement(altCharCodes); } + // If the current keyboard layout is switched by the Cmd key, + // we should append unshiftedCmdChar and shiftedCmdChar that are + // Latin char for the key. But don't append at Dvorak-QWERTY. + if ((unshiftedCmdChar || shiftedCmdChar) && + isCmdSwitchLayout && !isDvorakQWERTY) { + nsAlternativeCharCode altCharCodes(unshiftedCmdChar, shiftedCmdChar); + outGeckoEvent->alternativeCharCodes.AppendElement(altCharCodes); + } } } else { diff --git a/widget/tests/test_keycodes.xul b/widget/tests/test_keycodes.xul index a85423972ce..5f4506f4fd5 100644 --- a/widget/tests/test_keycodes.xul +++ b/widget/tests/test_keycodes.xul @@ -68,9 +68,12 @@ var keyboardLayouts; if (navigator.platform.indexOf("Mac") == 0) { // These constants can be found by inspecting files under // /System/Library/Keyboard\ Layouts/Unicode.bundle/Contents/Resources/ + // XXX if you need a new keyboard layout and that uses KCHR resource, + // you need to modify GetScriptFromKeyboardLayout of nsChildView.mm keyboardLayouts = { "US-Extended":-2, - "Greek":-18944 + "Greek":-18944, + "German":3 }; } else if (navigator.platform.indexOf("Win") == 0) { // These constants can be found by inspecting registry keys under @@ -197,6 +200,12 @@ function runPressTests() "\u00a8"); testKey({layout:"Greek", keyCode:0, command:1, alt:1, shift:1, chars:"\u00b9", unmodifiedChars:"\u0391"}, "\u00b9"); + + // German (KCHR/KeyTranslate case) + testKey({layout:"German", keyCode:0, chars:"a", unmodifiedChars:"a"}, + "a"); + testKey({layout:"German", keyCode:33, chars:"\u00fc", unmodifiedChars:"\u00fc"}, + "\u00fc"); } if (navigator.platform.indexOf("Win") == 0) { @@ -304,6 +313,16 @@ function runAccessKeyTests() "\u03b1", true); testKey({layout:"Greek", keyCode:0, ctrl:1, chars:"\u0001", unmodifiedChars:"\u03b1"}, "\u0391", true); + + // German (KCHR/KeyTranslate case) + testKey({layout:"German", keyCode:0, ctrl:1, chars:"a", unmodifiedChars:"a"}, + "a", true); + testKey({layout:"German", keyCode:0, ctrl:1, chars:"a", unmodifiedChars:"a"}, + "A", true); + testKey({layout:"German", keyCode:33, ctrl:1, chars:"\u00fc", unmodifiedChars:"\u00fc"}, + "\u00fc", true); + testKey({layout:"German", keyCode:33, ctrl:1, chars:"\u00fc", unmodifiedChars:"\u00fc"}, + "\u00dc", true); } if (navigator.platform.indexOf("Win") == 0) { From b7b99f9181d2bdb69c66049c5f48a0e6107b5ace Mon Sep 17 00:00:00 2001 From: "joshmoz@gmail.com" Date: Wed, 7 May 2008 15:22:33 -0700 Subject: [PATCH 97/98] make widgets appear inactive when they are backgrounded. patch by Markus Stange. b=54488 r=josh sr=roc a=schrep --- widget/src/cocoa/nsChildView.mm | 3 + widget/src/cocoa/nsNativeThemeCocoa.h | 51 ++++---- widget/src/cocoa/nsNativeThemeCocoa.mm | 156 +++++++++++++++++-------- 3 files changed, 136 insertions(+), 74 deletions(-) diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index 8d4140fcf28..06cd5d94579 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -2495,6 +2495,9 @@ NSEvent* gLastDragEvent = nil; nsGUIEvent focusGuiEvent(PR_TRUE, eventType, mGeckoChild); focusGuiEvent.time = PR_IntervalNow(); mGeckoChild->DispatchEvent(&focusGuiEvent, status); + + // invalidate so that things with a different appearance in background windows will redraw + mGeckoChild->Invalidate(PR_FALSE); } diff --git a/widget/src/cocoa/nsNativeThemeCocoa.h b/widget/src/cocoa/nsNativeThemeCocoa.h index a046a4be0a1..01c03da7a55 100644 --- a/widget/src/cocoa/nsNativeThemeCocoa.h +++ b/widget/src/cocoa/nsNativeThemeCocoa.h @@ -95,37 +95,38 @@ protected: nsresult GetSystemFont(PRUint8 aWidgetType, nsSystemFontID& aFont); // HITheme drawing routines - void DrawFrame (CGContextRef context, HIThemeFrameKind inKind, - const HIRect& inBoxRect, PRBool inIsDisabled, - PRInt32 inState); + void DrawFrame(CGContextRef context, HIThemeFrameKind inKind, + const HIRect& inBoxRect, PRBool inIsDisabled, + PRInt32 inState); void DrawProgress(CGContextRef context, const HIRect& inBoxRect, PRBool inIsIndeterminate, PRBool inIsHorizontal, - PRInt32 inValue); - void DrawTab (CGContextRef context, const HIRect& inBoxRect, - PRBool inIsDisabled, PRBool inIsFrontmost, - PRBool inIsHorizontal, PRBool inTabBottom, - PRInt32 inState); - void DrawTabPanel (CGContextRef context, const HIRect& inBoxRect); - void DrawScale (CGContextRef context, const HIRect& inBoxRect, - PRBool inIsDisabled, PRInt32 inState, - PRBool inDirection, PRBool inIsReverse, - PRInt32 inCurrentValue, - PRInt32 inMinValue, PRInt32 inMaxValue); + PRInt32 inValue, nsIFrame* aFrame); + void DrawTab(CGContextRef context, const HIRect& inBoxRect, + PRBool inIsDisabled, PRBool inIsFrontmost, + PRBool inIsHorizontal, PRBool inTabBottom, + PRInt32 inState, nsIFrame* aFrame); + void DrawTabPanel(CGContextRef context, const HIRect& inBoxRect, nsIFrame* aFrame); + void DrawScale(CGContextRef context, const HIRect& inBoxRect, + PRBool inIsDisabled, PRInt32 inState, + PRBool inDirection, PRBool inIsReverse, + PRInt32 inCurrentValue, + PRInt32 inMinValue, PRInt32 inMaxValue, nsIFrame* aFrame); void DrawRadioButton(CGContextRef cgContext, const HIRect& inBoxRect, PRBool inSelected, - PRBool inDisabled, PRInt32 inState); + PRBool inDisabled, PRInt32 inState, nsIFrame* aFrame); void DrawPushButton(CGContextRef cgContext, const HIRect& inBoxRect, PRBool inIsDefault, - PRBool inDisabled, PRInt32 inState); - void DrawButton (CGContextRef context, ThemeButtonKind inKind, - const HIRect& inBoxRect, PRBool inIsDefault, - PRBool inDisabled, ThemeButtonValue inValue, - ThemeButtonAdornment inAdornment, PRInt32 inState); - void DrawSpinButtons (CGContextRef context, ThemeButtonKind inKind, - const HIRect& inBoxRect, - PRBool inDisabled, ThemeDrawState inDrawState, - ThemeButtonAdornment inAdornment, PRInt32 inState); + PRBool inDisabled, PRInt32 inState, nsIFrame* aFrame); + void DrawButton(CGContextRef context, ThemeButtonKind inKind, + const HIRect& inBoxRect, PRBool inIsDefault, + PRBool inDisabled, ThemeButtonValue inValue, + ThemeButtonAdornment inAdornment, PRInt32 inState, + nsIFrame* aFrame); + void DrawSpinButtons(CGContextRef context, ThemeButtonKind inKind, + const HIRect& inBoxRect, PRBool inDisabled, + ThemeDrawState inDrawState, ThemeButtonAdornment inAdornment, + PRInt32 inState, nsIFrame* aFrame); void DrawCheckbox(CGContextRef context, ThemeButtonKind inKind, const HIRect& inBoxRect, PRBool inChecked, - PRBool inDisabled, PRInt32 inState); + PRBool inDisabled, PRInt32 inState, nsIFrame* aFrame); // Scrollbars void DrawScrollbar(CGContextRef aCGContext, const HIRect& aBoxRect, nsIFrame *aFrame); void GetScrollbarPressStates (nsIFrame *aFrame, PRInt32 aButtonStates[]); diff --git a/widget/src/cocoa/nsNativeThemeCocoa.mm b/widget/src/cocoa/nsNativeThemeCocoa.mm index 6fcd993429d..bd8d625a837 100644 --- a/widget/src/cocoa/nsNativeThemeCocoa.mm +++ b/widget/src/cocoa/nsNativeThemeCocoa.mm @@ -57,6 +57,7 @@ #include "nsILookAndFeel.h" #include "nsWidgetAtoms.h" #include "nsToolkit.h" +#include "nsIWidget.h" #include "gfxContext.h" #include "gfxQuartzSurface.h" @@ -146,26 +147,54 @@ nsNativeThemeCocoa::~nsNativeThemeCocoa() NS_OBJC_END_TRY_ABORT_BLOCK; } +static BOOL frameIsInActiveWindow(nsIFrame* aFrame) +{ + // default return value should be YES here, so things are painted as active by default + if (!aFrame) + return YES; + + nsIWidget* widget = aFrame->GetWindow(); + if (!widget) + return YES; + + // get the top-level widget + nsIWidget* topLevelWidget; + while (widget) { + topLevelWidget = widget; + widget = widget->GetParent(); + } + + NSWindow* nativeWindow = (NSWindow*)topLevelWidget->GetNativeData(NS_NATIVE_WINDOW); + if (!nativeWindow) + return YES; + + nsWindowType windowType; + topLevelWidget->GetWindowType(windowType); + return [nativeWindow isKeyWindow] || (windowType == eWindowType_popup); +} + void nsNativeThemeCocoa::DrawCheckbox(CGContextRef cgContext, ThemeButtonKind inKind, const HIRect& inBoxRect, PRBool inChecked, - PRBool inDisabled, PRInt32 inState) + PRBool inDisabled, PRInt32 inState, nsIFrame* aFrame) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; HIThemeButtonDrawInfo bdi; bdi.version = 0; bdi.kind = inKind; + + BOOL isInActiveWindow = frameIsInActiveWindow(aFrame); if (inDisabled) bdi.state = kThemeStateUnavailable; else if ((inState & NS_EVENT_STATE_ACTIVE) && (inState & NS_EVENT_STATE_HOVER)) bdi.state = kThemeStatePressed; else - bdi.state = kThemeStateActive; + bdi.state = isInActiveWindow ? kThemeStateActive : kThemeStateInactive; bdi.value = inChecked ? kThemeButtonOn : kThemeButtonOff; - bdi.adornment = (inState & NS_EVENT_STATE_FOCUS) ? kThemeAdornmentFocus : kThemeAdornmentNone; + bdi.adornment = (inState & NS_EVENT_STATE_FOCUS && isInActiveWindow) ? kThemeAdornmentFocus : kThemeAdornmentNone; HIRect drawFrame = inBoxRect; @@ -317,7 +346,7 @@ nsNativeThemeCocoa::DrawCellWithScaling(NSCell *cell, NS_OBJC_END_TRY_ABORT_BLOCK; } - + // These are the sizes that Gecko needs to request to draw if it wants // to get a standard-sized Aqua radio button drawn. Note that the rects // that draw these are actually a little bigger. @@ -345,13 +374,13 @@ static const float radioButtonMargins[2][3][4] = void nsNativeThemeCocoa::DrawRadioButton(CGContextRef cgContext, const HIRect& inBoxRect, PRBool inSelected, - PRBool inDisabled, PRInt32 inState) + PRBool inDisabled, PRInt32 inState, nsIFrame* aFrame) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; NSRect drawRect = NSMakeRect(inBoxRect.origin.x, inBoxRect.origin.y, inBoxRect.size.width, inBoxRect.size.height); - [mRadioButtonCell setEnabled:!inDisabled]; + [mRadioButtonCell setEnabled:(!inDisabled && frameIsInActiveWindow(aFrame))]; [mRadioButtonCell setShowsFirstResponder:(inState & NS_EVENT_STATE_FOCUS)]; [mRadioButtonCell setState:(inSelected ? NSOnState : NSOffState)]; [mRadioButtonCell setHighlighted:((inState & NS_EVENT_STATE_ACTIVE) && (inState & NS_EVENT_STATE_HOVER))]; @@ -403,15 +432,20 @@ static const float pushButtonMargins[2][3][4] = void nsNativeThemeCocoa::DrawPushButton(CGContextRef cgContext, const HIRect& inBoxRect, PRBool inIsDefault, - PRBool inDisabled, PRInt32 inState) + PRBool inDisabled, PRInt32 inState, nsIFrame* aFrame) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; NSRect drawRect = NSMakeRect(inBoxRect.origin.x, inBoxRect.origin.y, inBoxRect.size.width, inBoxRect.size.height); + BOOL isInActiveWindow = frameIsInActiveWindow(aFrame); + [mPushButtonCell setEnabled:!inDisabled]; - [mPushButtonCell setHighlighted:((inState & NS_EVENT_STATE_ACTIVE) && (inState & NS_EVENT_STATE_HOVER) || (inIsDefault && !inDisabled))]; - [mPushButtonCell setShowsFirstResponder:(inState & NS_EVENT_STATE_FOCUS)]; + [mPushButtonCell setHighlighted:(((inState & NS_EVENT_STATE_ACTIVE) && + (inState & NS_EVENT_STATE_HOVER) || + (inIsDefault && !inDisabled)) && + isInActiveWindow)]; + [mPushButtonCell setShowsFirstResponder:(inState & NS_EVENT_STATE_FOCUS) && !inDisabled && isInActiveWindow]; CGAffineTransform savedCTM = CGContextGetCTM(cgContext); @@ -475,7 +509,7 @@ void nsNativeThemeCocoa::DrawButton(CGContextRef cgContext, ThemeButtonKind inKind, const HIRect& inBoxRect, PRBool inIsDefault, PRBool inDisabled, ThemeButtonValue inValue, ThemeButtonAdornment inAdornment, - PRInt32 inState) + PRInt32 inState, nsIFrame* aFrame) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -485,12 +519,18 @@ nsNativeThemeCocoa::DrawButton(CGContextRef cgContext, ThemeButtonKind inKind, bdi.value = inValue; bdi.adornment = inAdornment; - if (inDisabled) + if (inDisabled) { bdi.state = kThemeStateUnavailable; - else if ((inState & NS_EVENT_STATE_ACTIVE) && (inState & NS_EVENT_STATE_HOVER)) + } + else if ((inState & NS_EVENT_STATE_ACTIVE) && (inState & NS_EVENT_STATE_HOVER)) { bdi.state = kThemeStatePressed; - else - bdi.state = (inKind == kThemeArrowButton) ? kThemeStateUnavailable : kThemeStateActive; + } + else { + if (inKind == kThemeArrowButton) + bdi.state = kThemeStateUnavailable; // these are always drawn as unavailable + else + bdi.state = frameIsInActiveWindow(aFrame) ? kThemeStateActive : kThemeStateInactive; + } if (inState & NS_EVENT_STATE_FOCUS) bdi.adornment |= kThemeAdornmentFocus; @@ -602,7 +642,7 @@ nsNativeThemeCocoa::DrawSpinButtons(CGContextRef cgContext, ThemeButtonKind inKi const HIRect& inBoxRect, PRBool inDisabled, ThemeDrawState inDrawState, ThemeButtonAdornment inAdornment, - PRInt32 inState) + PRInt32 inState, nsIFrame* aFrame) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -615,6 +655,8 @@ nsNativeThemeCocoa::DrawSpinButtons(CGContextRef cgContext, ThemeButtonKind inKi if (inDisabled) bdi.state = kThemeStateUnavailable; + else + bdi.state = frameIsInActiveWindow(aFrame) ? kThemeStateActive : kThemeStateInactive; HIThemeDrawButton(&inBoxRect, &bdi, cgContext, HITHEME_ORIENTATION, NULL); @@ -624,14 +666,19 @@ nsNativeThemeCocoa::DrawSpinButtons(CGContextRef cgContext, ThemeButtonKind inKi void nsNativeThemeCocoa::DrawFrame(CGContextRef cgContext, HIThemeFrameKind inKind, - const HIRect& inBoxRect, PRBool inIsDisabled, PRInt32 inState) + const HIRect& inBoxRect, PRBool inIsDisabled, + PRInt32 inState) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; HIThemeFrameDrawInfo fdi; fdi.version = 0; fdi.kind = inKind; + + // We don't ever set an inactive state for this because it doesn't + // look right(see other apps). fdi.state = inIsDisabled ? kThemeStateUnavailable : kThemeStateActive; + // for some reason focus rings on listboxes draw incorrectly if (inKind == kHIThemeFrameListBox) fdi.isFocused = 0; @@ -671,9 +718,9 @@ nsNativeThemeCocoa::DrawFrame(CGContextRef cgContext, HIThemeFrameKind inKind, void -nsNativeThemeCocoa::DrawProgress(CGContextRef cgContext, - const HIRect& inBoxRect, PRBool inIsIndeterminate, - PRBool inIsHorizontal, PRInt32 inValue) +nsNativeThemeCocoa::DrawProgress(CGContextRef cgContext, const HIRect& inBoxRect, + PRBool inIsIndeterminate, PRBool inIsHorizontal, + PRInt32 inValue, nsIFrame* aFrame) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -689,7 +736,7 @@ nsNativeThemeCocoa::DrawProgress(CGContextRef cgContext, tdi.max = 100; tdi.value = inValue; tdi.attributes = inIsHorizontal ? kThemeTrackHorizontal : 0; - tdi.enableState = kThemeTrackActive; + tdi.enableState = frameIsInActiveWindow(aFrame) ? kThemeTrackActive : kThemeTrackInactive; tdi.trackInfo.progress.phase = PR_IntervalToMilliseconds(PR_IntervalNow()) / milliSecondsPerStep % 16; @@ -700,14 +747,15 @@ nsNativeThemeCocoa::DrawProgress(CGContextRef cgContext, void -nsNativeThemeCocoa::DrawTabPanel(CGContextRef cgContext, const HIRect& inBoxRect) +nsNativeThemeCocoa::DrawTabPanel(CGContextRef cgContext, const HIRect& inBoxRect, + nsIFrame* aFrame) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; HIThemeTabPaneDrawInfo tpdi; tpdi.version = 0; - tpdi.state = kThemeStateActive; + tpdi.state = frameIsInActiveWindow(aFrame) ? kThemeStateActive : kThemeStateInactive; tpdi.direction = kThemeTabNorth; tpdi.size = kHIThemeTabSizeNormal; @@ -721,8 +769,8 @@ void nsNativeThemeCocoa::DrawScale(CGContextRef cgContext, const HIRect& inBoxRect, PRBool inIsDisabled, PRInt32 inState, PRBool inIsVertical, PRBool inIsReverse, - PRInt32 inCurrentValue, - PRInt32 inMinValue, PRInt32 inMaxValue) + PRInt32 inCurrentValue, PRInt32 inMinValue, + PRInt32 inMaxValue, nsIFrame* aFrame) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -741,7 +789,10 @@ nsNativeThemeCocoa::DrawScale(CGContextRef cgContext, const HIRect& inBoxRect, tdi.attributes |= kThemeTrackRightToLeft; if (inState & NS_EVENT_STATE_FOCUS) tdi.attributes |= kThemeTrackHasFocus; - tdi.enableState = inIsDisabled ? kThemeTrackDisabled : kThemeTrackActive; + if (inIsDisabled) + tdi.enableState = kThemeTrackDisabled; + else + tdi.enableState = frameIsInActiveWindow(aFrame) ? kThemeTrackActive : kThemeTrackInactive; tdi.trackInfo.slider.thumbDir = kThemeThumbPlain; tdi.trackInfo.slider.pressState = 0; @@ -755,7 +806,7 @@ void nsNativeThemeCocoa::DrawTab(CGContextRef cgContext, const HIRect& inBoxRect, PRBool inIsDisabled, PRBool inIsFrontmost, PRBool inIsHorizontal, PRBool inTabBottom, - PRInt32 inState) + PRInt32 inState, nsIFrame* aFrame) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -767,14 +818,14 @@ nsNativeThemeCocoa::DrawTab(CGContextRef cgContext, const HIRect& inBoxRect, if (inIsDisabled) tdi.style = kThemeTabFrontUnavailable; else - tdi.style = kThemeTabFront; + tdi.style = frameIsInActiveWindow(aFrame) ? kThemeTabFront : kThemeTabFrontInactive; } else { if (inIsDisabled) tdi.style = kThemeTabNonFrontUnavailable; else if ((inState & NS_EVENT_STATE_ACTIVE) && (inState & NS_EVENT_STATE_HOVER)) tdi.style = kThemeTabNonFrontPressed; else - tdi.style = kThemeTabNonFront; + tdi.style = frameIsInActiveWindow(aFrame) ? kThemeTabNonFront : kThemeTabNonFrontInactive; } // don't yet support vertical tabs @@ -862,6 +913,13 @@ nsNativeThemeCocoa::GetScrollbarDrawInfo(HIThemeTrackDrawInfo& aTdi, nsIFrame *a aTdi.trackInfo.scrollbar.viewsize = (SInt32)thumbSize; + // This should be done early on so things like "kThemeTrackNothingToScroll" can + // override the active enable state. + if (frameIsInActiveWindow(aFrame)) + aTdi.enableState = kThemeTrackActive; + else + aTdi.enableState = kThemeTrackInactive; + /* Only display features if we have enough room for them. * Gecko still maintains the scrollbar info; this is just a visual issue (bug 380185). */ @@ -1099,26 +1157,26 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame break; case NS_THEME_CHECKBOX: - DrawCheckbox(cgContext, kThemeCheckBox, macRect, IsChecked(aFrame), IsDisabled(aFrame), eventState); + DrawCheckbox(cgContext, kThemeCheckBox, macRect, IsChecked(aFrame), IsDisabled(aFrame), eventState, aFrame); break; case NS_THEME_CHECKBOX_SMALL: - DrawCheckbox(cgContext, kThemeSmallCheckBox, macRect, IsChecked(aFrame), IsDisabled(aFrame), eventState); + DrawCheckbox(cgContext, kThemeSmallCheckBox, macRect, IsChecked(aFrame), IsDisabled(aFrame), eventState, aFrame); break; case NS_THEME_RADIO: case NS_THEME_RADIO_SMALL: - DrawRadioButton(cgContext, macRect, IsSelected(aFrame), IsDisabled(aFrame), eventState); + DrawRadioButton(cgContext, macRect, IsSelected(aFrame), IsDisabled(aFrame), eventState, aFrame); break; case NS_THEME_BUTTON: - DrawPushButton(cgContext, macRect, IsDefaultButton(aFrame), IsDisabled(aFrame), eventState); + DrawPushButton(cgContext, macRect, IsDefaultButton(aFrame), IsDisabled(aFrame), eventState, aFrame); break; case NS_THEME_BUTTON_BEVEL: DrawButton(cgContext, kThemeMediumBevelButton, macRect, IsDefaultButton(aFrame), IsDisabled(aFrame), - kThemeButtonOff, kThemeAdornmentNone, eventState); + kThemeButtonOff, kThemeAdornmentNone, eventState, aFrame); break; case NS_THEME_SPINNER: { @@ -1134,14 +1192,14 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame } DrawSpinButtons(cgContext, kThemeIncDecButton, macRect, IsDisabled(aFrame), - state, kThemeAdornmentNone, eventState); + state, kThemeAdornmentNone, eventState, aFrame); } break; case NS_THEME_TOOLBAR_BUTTON: DrawButton(cgContext, kThemePushButton, macRect, IsDefaultButton(aFrame), IsDisabled(aFrame), - kThemeButtonOn, kThemeAdornmentNone, eventState); + kThemeButtonOn, kThemeAdornmentNone, eventState, aFrame); break; case NS_THEME_TOOLBAR_SEPARATOR: { @@ -1161,13 +1219,13 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame case NS_THEME_DROPDOWN: DrawButton(cgContext, kThemePopupButton, macRect, IsDefaultButton(aFrame), IsDisabled(aFrame), - kThemeButtonOn, kThemeAdornmentNone, eventState); + kThemeButtonOn, kThemeAdornmentNone, eventState, aFrame); break; case NS_THEME_DROPDOWN_BUTTON: - DrawButton (cgContext, kThemeArrowButton, macRect, PR_FALSE, - IsDisabled(aFrame), kThemeButtonOn, - kThemeAdornmentArrowDownArrow, eventState); + DrawButton(cgContext, kThemeArrowButton, macRect, PR_FALSE, + IsDisabled(aFrame), kThemeButtonOn, + kThemeAdornmentArrowDownArrow, eventState, aFrame); break; case NS_THEME_GROUPBOX: { @@ -1195,12 +1253,12 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame case NS_THEME_PROGRESSBAR: DrawProgress(cgContext, macRect, IsIndeterminateProgress(aFrame), - PR_TRUE, GetProgressValue(aFrame)); + PR_TRUE, GetProgressValue(aFrame), aFrame); break; case NS_THEME_PROGRESSBAR_VERTICAL: DrawProgress(cgContext, macRect, IsIndeterminateProgress(aFrame), - PR_FALSE, GetProgressValue(aFrame)); + PR_FALSE, GetProgressValue(aFrame), aFrame); break; case NS_THEME_PROGRESSBAR_CHUNK: @@ -1210,12 +1268,12 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame case NS_THEME_TREEVIEW_TWISTY: DrawButton(cgContext, kThemeDisclosureButton, macRect, PR_FALSE, IsDisabled(aFrame), - kThemeDisclosureRight, kThemeAdornmentNone, eventState); + kThemeDisclosureRight, kThemeAdornmentNone, eventState, aFrame); break; case NS_THEME_TREEVIEW_TWISTY_OPEN: DrawButton(cgContext, kThemeDisclosureButton, macRect, PR_FALSE, IsDisabled(aFrame), - kThemeDisclosureDown, kThemeAdornmentNone, eventState); + kThemeDisclosureDown, kThemeAdornmentNone, eventState, aFrame); break; case NS_THEME_TREEVIEW_HEADER_CELL: { @@ -1223,7 +1281,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame DrawButton(cgContext, kThemeListHeaderButton, macRect, PR_FALSE, IsDisabled(aFrame), sortDirection == eTreeSortDirection_Natural ? kThemeButtonOff : kThemeButtonOn, sortDirection == eTreeSortDirection_Descending ? - kThemeAdornmentHeaderButtonSortUp : kThemeAdornmentNone, eventState); + kThemeAdornmentHeaderButtonSortUp : kThemeAdornmentNone, eventState, aFrame); } break; @@ -1256,7 +1314,7 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame NS_LITERAL_STRING("reverse"), eCaseMatters); DrawScale(cgContext, macRect, IsDisabled(aFrame), eventState, (aWidgetType == NS_THEME_SCALE_VERTICAL), reverse, - curpos, minpos, maxpos); + curpos, minpos, maxpos, aFrame); } break; @@ -1337,20 +1395,20 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame // HIThemeSetFill is not available on 10.3 CGContextSetRGBFillColor(cgContext, 1.0, 1.0, 1.0, 1.0); CGContextFillRect(cgContext, macRect); - DrawFrame(cgContext, kHIThemeFrameListBox, - macRect, (IsDisabled(aFrame) || IsReadOnly(aFrame)), eventState); + DrawFrame(cgContext, kHIThemeFrameListBox, macRect, + (IsDisabled(aFrame) || IsReadOnly(aFrame)), eventState); break; case NS_THEME_TAB: { DrawTab(cgContext, macRect, IsDisabled(aFrame), IsSelectedTab(aFrame), PR_TRUE, IsBottomTab(aFrame), - eventState); + eventState, aFrame); } break; case NS_THEME_TAB_PANELS: - DrawTabPanel(cgContext, macRect); + DrawTabPanel(cgContext, macRect, aFrame); break; } From a41de23bad1640573c36889c3d500c981beda7c2 Mon Sep 17 00:00:00 2001 From: "gavin@gavinsharp.com" Date: Wed, 7 May 2008 15:33:19 -0700 Subject: [PATCH 98/98] Bug 430695: add backoff algorithm to gethash requests, patch by Dave Camp , r=tony, a=beltzner --- .../src/nsUrlClassifierHashCompleter.cpp | 57 +++++++++++++++++++ .../src/nsUrlClassifierHashCompleter.h | 13 ++++- 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/toolkit/components/url-classifier/src/nsUrlClassifierHashCompleter.cpp b/toolkit/components/url-classifier/src/nsUrlClassifierHashCompleter.cpp index 4a8db016c9d..b838fe07b99 100644 --- a/toolkit/components/url-classifier/src/nsUrlClassifierHashCompleter.cpp +++ b/toolkit/components/url-classifier/src/nsUrlClassifierHashCompleter.cpp @@ -63,6 +63,16 @@ static const PRLogModuleInfo *gUrlClassifierHashCompleterLog = nsnull; #define LOG_ENABLED() (PR_FALSE) #endif +// Back off from making server requests if we have at least +// gBackoffErrors errors +static const PRUint32 gBackoffErrors = 2; +// .. within gBackoffTime seconds +static const PRUint32 gBackoffTime = 5 * 60; +// ... and back off gBackoffInterval seconds, doubling seach time +static const PRUint32 gBackoffInterval = 30 * 60; +// ... up to a maximum of gBackoffMax. +static const PRUint32 gBackoffMax = 8 * 60 * 60; + NS_IMPL_ISUPPORTS3(nsUrlClassifierHashCompleterRequest, nsIRequestObserver, nsIStreamListener, @@ -72,6 +82,13 @@ nsresult nsUrlClassifierHashCompleterRequest::Begin() { LOG(("nsUrlClassifierHashCompleterRequest::Begin [%p]", this)); + + if (PR_IntervalNow() < mCompleter->GetNextRequestTime()) { + NS_WARNING("Gethash server backed off, failing gethash request."); + NotifyFailure(NS_ERROR_ABORT); + return NS_ERROR_ABORT; + } + nsCOMPtr observerService = do_GetService("@mozilla.org/observer-service;1"); if (observerService) @@ -469,6 +486,8 @@ nsUrlClassifierHashCompleterRequest::OnStopRequest(nsIRequest *request, } } + mCompleter->NoteServerResponse(NS_SUCCEEDED(status)); + if (NS_SUCCEEDED(status)) status = HandleResponse(); @@ -663,3 +682,41 @@ nsUrlClassifierHashCompleter::RekeyRequested() return NS_OK; } + +void +nsUrlClassifierHashCompleter::NoteServerResponse(PRBool success) +{ + LOG(("nsUrlClassifierHashCompleter::NoteServerResponse [%p, %d]", + this, success)); + + if (success) { + mBackoff = PR_FALSE; + mNextRequestTime = 0; + mBackoffTime = 0; + return; + } + + PRIntervalTime now = PR_IntervalNow(); + + // Record the error time. + mErrorTimes.AppendElement(now); + if (mErrorTimes.Length() > gBackoffErrors) { + mErrorTimes.RemoveElementAt(0); + } + + if (mBackoff) { + mBackoffTime *= 2; + LOG(("Doubled backoff time to %d seconds", mBackoffTime)); + } else if (mErrorTimes.Length() == gBackoffErrors && + PR_IntervalToSeconds(now - mErrorTimes[0]) <= gBackoffTime) { + mBackoff = PR_TRUE; + mBackoffTime = gBackoffInterval; + LOG(("Starting backoff, backoff time is %d seconds", mBackoffTime)); + } + + if (mBackoff) { + mBackoffTime = PR_MIN(mBackoffTime, gBackoffMax); + LOG(("Using %d for backoff time", mBackoffTime)); + mNextRequestTime = now + PR_SecondsToInterval(mBackoffTime); + } +} diff --git a/toolkit/components/url-classifier/src/nsUrlClassifierHashCompleter.h b/toolkit/components/url-classifier/src/nsUrlClassifierHashCompleter.h index b3b23f4f393..32ec6095b88 100644 --- a/toolkit/components/url-classifier/src/nsUrlClassifierHashCompleter.h +++ b/toolkit/components/url-classifier/src/nsUrlClassifierHashCompleter.h @@ -130,7 +130,10 @@ public: NS_DECL_NSIOBSERVER nsUrlClassifierHashCompleter() - : mShuttingDown(PR_FALSE) + : mBackoff(PR_FALSE) + , mBackoffTime(0) + , mNextRequestTime(0) + , mShuttingDown(PR_FALSE) {} ~nsUrlClassifierHashCompleter() {} @@ -138,12 +141,20 @@ public: nsresult RekeyRequested(); + void NoteServerResponse(PRBool success); + PRIntervalTime GetNextRequestTime() { return mNextRequestTime; } + private: nsRefPtr mRequest; nsCString mGethashUrl; nsCString mClientKey; nsCString mWrappedKey; + nsTArray mErrorTimes; + PRBool mBackoff; + PRUint32 mBackoffTime; + PRIntervalTime mNextRequestTime; + PRBool mShuttingDown; };