From 014a0f327acf34e3fdc77000d8a32d95c2461a50 Mon Sep 17 00:00:00 2001 From: Robert Strong Date: Tue, 19 Apr 2011 11:03:57 -0700 Subject: [PATCH 01/36] Bug 650254 - Permanent fail on update xpcshell tests for Thunderbird | TEST-UNEXPECTED-FAIL | test_0110_general.js and co failing in head_update.js. r=mossop --- .../test/unit/data/complete_cc_log_success | 34 ++++++++----------- .../test/unit/data/complete_log_success | 34 ++++++++----------- .../update/test/unit/data/partial_log_failure | 6 ---- .../update/test/unit/data/partial_log_success | 14 +++----- .../update/test/unit/head_update.js.in | 8 +++-- 5 files changed, 38 insertions(+), 58 deletions(-) diff --git a/toolkit/mozapps/update/test/unit/data/complete_cc_log_success b/toolkit/mozapps/update/test/unit/data/complete_cc_log_success index 30ddf209dd3..5345b914b91 100644 --- a/toolkit/mozapps/update/test/unit/data/complete_cc_log_success +++ b/toolkit/mozapps/update/test/unit/data/complete_cc_log_success @@ -94,8 +94,6 @@ PREPARE REMOVEFILE a/b/7/71/7xtest.exe PREPARE REMOVEFILE a/b/7/71/7xtext0 PREPARE REMOVEFILE a/b/7/71/7xtext1 PREPARE REMOVEDIR a/b/7/71/ -PREPARE REMOVEFILE a/b/7/7text0 -PREPARE REMOVEFILE a/b/7/7text1 PREPARE REMOVEDIR a/b/7/ PREPARE REMOVEDIR a/b/6/ PREPARE REMOVEFILE a/b/5/5text1 @@ -203,8 +201,6 @@ EXECUTE REMOVEFILE a/b/7/71/7xtest.exe EXECUTE REMOVEFILE a/b/7/71/7xtext0 EXECUTE REMOVEFILE a/b/7/71/7xtext1 EXECUTE REMOVEDIR a/b/7/71/ -EXECUTE REMOVEFILE a/b/7/7text0 -EXECUTE REMOVEFILE a/b/7/7text1 EXECUTE REMOVEDIR a/b/7/ EXECUTE REMOVEDIR a/b/6/ EXECUTE REMOVEFILE a/b/5/5text1 @@ -233,27 +229,27 @@ FINISH REMOVEFILE a/b/2/20/20png0.png FINISH REMOVEFILE a/b/0/0exe0.exe FINISH REMOVEFILE a/b/0/00/00text0 FINISH REMOVEDIR a/b/searchplugins/ -a/b/searchplugins/, rv: 0 +removing directory: a/b/searchplugins/, rv: 0 FINISH REMOVEDIR a/b/extensions/extensions1/ -a/b/extensions/extensions1/, rv: 0 +removing directory: a/b/extensions/extensions1/, rv: 0 FINISH REMOVEDIR a/b/extensions/extensions0/ -a/b/extensions/extensions0/, rv: 0 +removing directory: a/b/extensions/extensions0/, rv: 0 FINISH REMOVEDIR a/b/extensions/ -a/b/extensions/, rv: 0 +removing directory: a/b/extensions/, rv: 0 FINISH REMOVEDIR a/b/defaults/pref/ -a/b/defaults/pref/, rv: 0 +removing directory: a/b/defaults/pref/, rv: 0 FINISH REMOVEDIR a/b/defaults/ -a/b/defaults/, rv: 0 +removing directory: a/b/defaults/, rv: 0 FINISH REMOVEDIR a/b/2/20/ FINISH REMOVEDIR a/b/2/ FINISH REMOVEDIR a/b/0/00/ -a/b/0/00/, rv: 0 +removing directory: a/b/0/00/, rv: 0 FINISH REMOVEDIR a/b/0/ -a/b/0/, rv: 0 +removing directory: a/b/0/, rv: 0 FINISH REMOVEDIR a/b/ -a/b/, rv: 0 +removing directory: a/b/, rv: 0 FINISH REMOVEDIR a/ -a/, rv: 0 +removing directory: a/, rv: 0 FINISH ADD a/b/defaults/pref/channel-prefs.js FINISH ADD precomplete FINISH ADD a/b/searchplugins/searchpluginstext0 @@ -294,9 +290,9 @@ FINISH REMOVEDIR a/b/9/94/ directory no longer exists; skipping FINISH REMOVEDIR a/b/9/93/ FINISH REMOVEDIR a/b/9/92/ -a/b/9/92/, rv: 0 +removing directory: a/b/9/92/, rv: 0 FINISH REMOVEDIR a/b/9/91/ -a/b/9/91/, rv: 0 +removing directory: a/b/9/91/, rv: 0 FINISH REMOVEDIR a/b/9/90/ FINISH REMOVEDIR a/b/9/90/ directory no longer exists; skipping @@ -322,9 +318,9 @@ FINISH REMOVEDIR a/b/8/84/ directory no longer exists; skipping FINISH REMOVEDIR a/b/8/83/ FINISH REMOVEDIR a/b/8/82/ -a/b/8/82/, rv: 0 +removing directory: a/b/8/82/, rv: 0 FINISH REMOVEDIR a/b/8/81/ -a/b/8/81/, rv: 0 +removing directory: a/b/8/81/, rv: 0 FINISH REMOVEDIR a/b/8/80/ FINISH REMOVEDIR a/b/8/80/ directory no longer exists; skipping @@ -336,8 +332,6 @@ FINISH REMOVEFILE a/b/7/71/7xtest.exe FINISH REMOVEFILE a/b/7/71/7xtext0 FINISH REMOVEFILE a/b/7/71/7xtext1 FINISH REMOVEDIR a/b/7/71/ -FINISH REMOVEFILE a/b/7/7text0 -FINISH REMOVEFILE a/b/7/7text1 FINISH REMOVEDIR a/b/7/ FINISH REMOVEDIR a/b/6/ FINISH REMOVEFILE a/b/5/5text1 diff --git a/toolkit/mozapps/update/test/unit/data/complete_log_success b/toolkit/mozapps/update/test/unit/data/complete_log_success index c5baa2f7bce..d70e704eebf 100644 --- a/toolkit/mozapps/update/test/unit/data/complete_log_success +++ b/toolkit/mozapps/update/test/unit/data/complete_log_success @@ -91,8 +91,6 @@ PREPARE REMOVEFILE a/b/7/71/7xtest.exe PREPARE REMOVEFILE a/b/7/71/7xtext0 PREPARE REMOVEFILE a/b/7/71/7xtext1 PREPARE REMOVEDIR a/b/7/71/ -PREPARE REMOVEFILE a/b/7/7text0 -PREPARE REMOVEFILE a/b/7/7text1 PREPARE REMOVEDIR a/b/7/ PREPARE REMOVEDIR a/b/6/ PREPARE REMOVEFILE a/b/5/5text1 @@ -198,8 +196,6 @@ EXECUTE REMOVEFILE a/b/7/71/7xtest.exe EXECUTE REMOVEFILE a/b/7/71/7xtext0 EXECUTE REMOVEFILE a/b/7/71/7xtext1 EXECUTE REMOVEDIR a/b/7/71/ -EXECUTE REMOVEFILE a/b/7/7text0 -EXECUTE REMOVEFILE a/b/7/7text1 EXECUTE REMOVEDIR a/b/7/ EXECUTE REMOVEDIR a/b/6/ EXECUTE REMOVEFILE a/b/5/5text1 @@ -227,27 +223,27 @@ FINISH REMOVEFILE a/b/2/20/20png0.png FINISH REMOVEFILE a/b/0/0exe0.exe FINISH REMOVEFILE a/b/0/00/00text0 FINISH REMOVEDIR a/b/searchplugins/ -a/b/searchplugins/, rv: 0 +removing directory: a/b/searchplugins/, rv: 0 FINISH REMOVEDIR a/b/extensions/extensions1/ -a/b/extensions/extensions1/, rv: 0 +removing directory: a/b/extensions/extensions1/, rv: 0 FINISH REMOVEDIR a/b/extensions/extensions0/ -a/b/extensions/extensions0/, rv: 0 +removing directory: a/b/extensions/extensions0/, rv: 0 FINISH REMOVEDIR a/b/extensions/ -a/b/extensions/, rv: 0 +removing directory: a/b/extensions/, rv: 0 FINISH REMOVEDIR a/b/defaults/pref/ -a/b/defaults/pref/, rv: 0 +removing directory: a/b/defaults/pref/, rv: 0 FINISH REMOVEDIR a/b/defaults/ -a/b/defaults/, rv: 0 +removing directory: a/b/defaults/, rv: 0 FINISH REMOVEDIR a/b/2/20/ FINISH REMOVEDIR a/b/2/ FINISH REMOVEDIR a/b/0/00/ -a/b/0/00/, rv: 0 +removing directory: a/b/0/00/, rv: 0 FINISH REMOVEDIR a/b/0/ -a/b/0/, rv: 0 +removing directory: a/b/0/, rv: 0 FINISH REMOVEDIR a/b/ -a/b/, rv: 0 +removing directory: a/b/, rv: 0 FINISH REMOVEDIR a/ -a/, rv: 0 +removing directory: a/, rv: 0 FINISH ADD precomplete FINISH ADD a/b/searchplugins/searchpluginstext0 FINISH ADD a/b/searchplugins/searchpluginspng1.png @@ -287,9 +283,9 @@ FINISH REMOVEDIR a/b/9/94/ directory no longer exists; skipping FINISH REMOVEDIR a/b/9/93/ FINISH REMOVEDIR a/b/9/92/ -a/b/9/92/, rv: 0 +removing directory: a/b/9/92/, rv: 0 FINISH REMOVEDIR a/b/9/91/ -a/b/9/91/, rv: 0 +removing directory: a/b/9/91/, rv: 0 FINISH REMOVEDIR a/b/9/90/ FINISH REMOVEDIR a/b/9/90/ directory no longer exists; skipping @@ -315,9 +311,9 @@ FINISH REMOVEDIR a/b/8/84/ directory no longer exists; skipping FINISH REMOVEDIR a/b/8/83/ FINISH REMOVEDIR a/b/8/82/ -a/b/8/82/, rv: 0 +removing directory: a/b/8/82/, rv: 0 FINISH REMOVEDIR a/b/8/81/ -a/b/8/81/, rv: 0 +removing directory: a/b/8/81/, rv: 0 FINISH REMOVEDIR a/b/8/80/ FINISH REMOVEDIR a/b/8/80/ directory no longer exists; skipping @@ -329,8 +325,6 @@ FINISH REMOVEFILE a/b/7/71/7xtest.exe FINISH REMOVEFILE a/b/7/71/7xtext0 FINISH REMOVEFILE a/b/7/71/7xtext1 FINISH REMOVEDIR a/b/7/71/ -FINISH REMOVEFILE a/b/7/7text0 -FINISH REMOVEFILE a/b/7/7text1 FINISH REMOVEDIR a/b/7/ FINISH REMOVEDIR a/b/6/ FINISH REMOVEFILE a/b/5/5text1 diff --git a/toolkit/mozapps/update/test/unit/data/partial_log_failure b/toolkit/mozapps/update/test/unit/data/partial_log_failure index 42e60ef422a..b63504c73b8 100644 --- a/toolkit/mozapps/update/test/unit/data/partial_log_failure +++ b/toolkit/mozapps/update/test/unit/data/partial_log_failure @@ -72,8 +72,6 @@ PREPARE REMOVEFILE a/b/7/71/7xtest.exe PREPARE REMOVEFILE a/b/7/71/7xtext0 PREPARE REMOVEFILE a/b/7/71/7xtext1 PREPARE REMOVEDIR a/b/7/71/ -PREPARE REMOVEFILE a/b/7/7text0 -PREPARE REMOVEFILE a/b/7/7text1 PREPARE REMOVEDIR a/b/7/ PREPARE REMOVEDIR a/b/6/ PREPARE REMOVEFILE a/b/5/5text1 @@ -168,10 +166,6 @@ FINISH REMOVEFILE a/b/7/71/7xtext0 backup_restore: backup file doesn't exist: a/b/7/71/7xtext0.moz-backup FINISH REMOVEFILE a/b/7/71/7xtext1 backup_restore: backup file doesn't exist: a/b/7/71/7xtext1.moz-backup -FINISH REMOVEFILE a/b/7/7text0 -backup_restore: backup file doesn't exist: a/b/7/7text0.moz-backup -FINISH REMOVEFILE a/b/7/7text1 -backup_restore: backup file doesn't exist: a/b/7/7text1.moz-backup FINISH REMOVEFILE a/b/5/5text1 backup_restore: backup file doesn't exist: a/b/5/5text1.moz-backup FINISH REMOVEFILE a/b/5/5text0 diff --git a/toolkit/mozapps/update/test/unit/data/partial_log_success b/toolkit/mozapps/update/test/unit/data/partial_log_success index fd7aed80812..8dbf0241388 100644 --- a/toolkit/mozapps/update/test/unit/data/partial_log_success +++ b/toolkit/mozapps/update/test/unit/data/partial_log_success @@ -72,8 +72,6 @@ PREPARE REMOVEFILE a/b/7/71/7xtest.exe PREPARE REMOVEFILE a/b/7/71/7xtext0 PREPARE REMOVEFILE a/b/7/71/7xtext1 PREPARE REMOVEDIR a/b/7/71/ -PREPARE REMOVEFILE a/b/7/7text0 -PREPARE REMOVEFILE a/b/7/7text1 PREPARE REMOVEDIR a/b/7/ PREPARE REMOVEDIR a/b/6/ PREPARE REMOVEFILE a/b/5/5text1 @@ -160,8 +158,6 @@ EXECUTE REMOVEFILE a/b/7/71/7xtest.exe EXECUTE REMOVEFILE a/b/7/71/7xtext0 EXECUTE REMOVEFILE a/b/7/71/7xtext1 EXECUTE REMOVEDIR a/b/7/71/ -EXECUTE REMOVEFILE a/b/7/7text0 -EXECUTE REMOVEFILE a/b/7/7text1 EXECUTE REMOVEDIR a/b/7/ EXECUTE REMOVEDIR a/b/6/ EXECUTE REMOVEFILE a/b/5/5text1 @@ -220,9 +216,9 @@ FINISH REMOVEDIR a/b/9/94/ directory no longer exists; skipping FINISH REMOVEDIR a/b/9/93/ FINISH REMOVEDIR a/b/9/92/ -a/b/9/92/, rv: 0 +removing directory: a/b/9/92/, rv: 0 FINISH REMOVEDIR a/b/9/91/ -a/b/9/91/, rv: 0 +removing directory: a/b/9/91/, rv: 0 FINISH REMOVEDIR a/b/9/90/ FINISH REMOVEDIR a/b/9/90/ directory no longer exists; skipping @@ -248,9 +244,9 @@ FINISH REMOVEDIR a/b/8/84/ directory no longer exists; skipping FINISH REMOVEDIR a/b/8/83/ FINISH REMOVEDIR a/b/8/82/ -a/b/8/82/, rv: 0 +removing directory: a/b/8/82/, rv: 0 FINISH REMOVEDIR a/b/8/81/ -a/b/8/81/, rv: 0 +removing directory: a/b/8/81/, rv: 0 FINISH REMOVEDIR a/b/8/80/ FINISH REMOVEDIR a/b/8/80/ directory no longer exists; skipping @@ -262,8 +258,6 @@ FINISH REMOVEFILE a/b/7/71/7xtest.exe FINISH REMOVEFILE a/b/7/71/7xtext0 FINISH REMOVEFILE a/b/7/71/7xtext1 FINISH REMOVEDIR a/b/7/71/ -FINISH REMOVEFILE a/b/7/7text0 -FINISH REMOVEFILE a/b/7/7text1 FINISH REMOVEDIR a/b/7/ FINISH REMOVEDIR a/b/6/ FINISH REMOVEFILE a/b/5/5text1 diff --git a/toolkit/mozapps/update/test/unit/head_update.js.in b/toolkit/mozapps/update/test/unit/head_update.js.in index 725ed20ccea..e440b2495d1 100644 --- a/toolkit/mozapps/update/test/unit/head_update.js.in +++ b/toolkit/mozapps/update/test/unit/head_update.js.in @@ -673,12 +673,16 @@ function checkUpdateLogContents(aCompareLogFile) { // Replace error codes since they are different on each platform. updateLogContents = updateLogContents.replace(/, err:.*\n/g, "\n"); // Replace to make the log parsing happy. - updateLogContents = updateLogContents.replace(/non-fatal error removing directory: /g, ""); + updateLogContents = updateLogContents.replace(/non-fatal error /g, ""); + // The FindFile results when enumerating the filesystem on Windows is not + // determistic so the results matching the following need to be ignored. + updateLogContents = updateLogContents.replace(/.* a\/b\/7\/7text.*\n/g, ""); + let compareLog = do_get_file(aCompareLogFile); let compareLogContents = readFileBytes(compareLog); - do_check_eq(updateLogContents, compareLogContents); + do_check_eq(compareLogContents, updateLogContents); } function checkUpdateLogContains(aCheckString) { From 1957e6110e7f9949dda0d890753956bb9a6d9530 Mon Sep 17 00:00:00 2001 From: Robert Strong Date: Tue, 19 Apr 2011 11:04:12 -0700 Subject: [PATCH 02/36] Increase app update test timeout - Bug 645607 - Intermittent failure in toolkit/mozapps/update/test/chrome/test_0072_notify_verifyFailComplete_noPartial.xul | Test timed out. Maximum time allowed is 20 seconds. r=mossop --- toolkit/mozapps/update/test/chrome/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/mozapps/update/test/chrome/utils.js b/toolkit/mozapps/update/test/chrome/utils.js index d3e34b2a117..c782f64029a 100644 --- a/toolkit/mozapps/update/test/chrome/utils.js +++ b/toolkit/mozapps/update/test/chrome/utils.js @@ -154,7 +154,7 @@ const TEST_ADDONS = [ "appdisabled_1", "appdisabled_2", "userdisabled_1", "userdisabled_2" ]; -const TEST_TIMEOUT = 20000; // 20 seconds +const TEST_TIMEOUT = 25000; // 25 seconds var gTimeoutTimer; // The number of SimpleTest.executeSoon calls to perform when waiting on an From 889122621ea64e71a25447c958dc3a3eed83a42b Mon Sep 17 00:00:00 2001 From: Steven Michaud Date: Tue, 19 Apr 2011 14:13:58 -0500 Subject: [PATCH 03/36] Bug 651177 - [Mac] Crashes [@ nsObjectFrame::GetLayerState ]. r=bsmedberg --- layout/generic/nsObjectFrame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 3b2b9090ef5..0be218f4bed 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -4290,7 +4290,7 @@ NPDrawingModel nsPluginInstanceOwner::GetDrawingModel() PRBool nsPluginInstanceOwner::IsRemoteDrawingCoreAnimation() { - if (mInstance) + if (!mInstance) return PR_FALSE; PRBool coreAnimation; From 7edf0b347c74379fc6226e830c2362fda97fb9bc Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Wed, 13 Apr 2011 03:03:43 -0400 Subject: [PATCH 04/36] Add a comment to point out that branding changes often requires clobbers --- browser/confvars.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/browser/confvars.sh b/browser/confvars.sh index d3f315b0b59..33bf281934d 100755 --- a/browser/confvars.sh +++ b/browser/confvars.sh @@ -50,5 +50,7 @@ MOZ_SERVICES_SYNC=1 MOZ_APP_VERSION=$FIREFOX_VERSION MOZ_EXTENSIONS_DEFAULT=" gnomevfs" # MOZ_APP_DISPLAYNAME will be set by branding/configure.sh +# Changing either of these values requires a clobber to ensure correct results, +# because branding dependencies are broken. MOZ_BRANDING_DIRECTORY=browser/branding/nightly MOZ_OFFICIAL_BRANDING_DIRECTORY=browser/branding/official From 21fa52ed0e0b832af4f906a9d3384b18fb07293c Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Sat, 16 Apr 2011 21:17:17 -0400 Subject: [PATCH 05/36] Bug 513648: Fix mistake in the original patch that implemented middlemouse-paste whitespace stripping --- browser/base/content/browser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 55aeaec3f8b..acecd2afa89 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -5559,7 +5559,7 @@ function middleMousePaste(event) { // Strip embedded newlines and surrounding whitespace, to match the URL // bar's behavior (stripsurroundingwhitespace) - clipboard.replace(/\s*\n\s*/g, ""); + clipboard = clipboard.replace(/\s*\n\s*/g, ""); let url = getShortcutOrURI(clipboard); try { From 9bebd0df6fde2d2747776719e1adcfca9402b722 Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Fri, 18 Mar 2011 14:21:02 -0700 Subject: [PATCH 06/36] Bug 634065 - Implement design for identity block and persistent indicators, r=dao --- browser/base/content/browser.js | 2 +- .../themes/gnomestripe/browser/browser.css | 81 +++++++++++--- browser/themes/gnomestripe/browser/jar.mn | 2 +- .../gnomestripe/browser/urlbar-arrow.png | Bin 0 -> 305 bytes .../browser/urlbar-favicon-glow.png | Bin 619 -> 0 bytes browser/themes/pinstripe/browser/browser.css | 100 +++++++++++------- browser/themes/pinstripe/browser/jar.mn | 2 +- .../themes/pinstripe/browser/urlbar-arrow.png | Bin 0 -> 305 bytes .../pinstripe/browser/urlbar-favicon-glow.png | Bin 504 -> 0 bytes browser/themes/winstripe/browser/browser.css | 94 +++++++++++----- browser/themes/winstripe/browser/jar.mn | 4 +- .../themes/winstripe/browser/urlbar-arrow.png | Bin 0 -> 305 bytes .../winstripe/browser/urlbar-favicon-glow.png | Bin 619 -> 0 bytes 13 files changed, 201 insertions(+), 84 deletions(-) create mode 100644 browser/themes/gnomestripe/browser/urlbar-arrow.png delete mode 100644 browser/themes/gnomestripe/browser/urlbar-favicon-glow.png create mode 100644 browser/themes/pinstripe/browser/urlbar-arrow.png delete mode 100644 browser/themes/pinstripe/browser/urlbar-favicon-glow.png create mode 100644 browser/themes/winstripe/browser/urlbar-arrow.png delete mode 100644 browser/themes/winstripe/browser/urlbar-favicon-glow.png diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index acecd2afa89..7d1cd26fcd6 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -7794,7 +7794,7 @@ var gIdentityHandler = { dt.setData("text/uri-list", value); dt.setData("text/plain", value); dt.setData("text/html", htmlString); - dt.addElement(event.currentTarget); + dt.setDragImage(gProxyFavIcon, 16, 16); } }; diff --git a/browser/themes/gnomestripe/browser/browser.css b/browser/themes/gnomestripe/browser/browser.css index 7454417b0d3..5e5c40a02fb 100644 --- a/browser/themes/gnomestripe/browser/browser.css +++ b/browser/themes/gnomestripe/browser/browser.css @@ -970,7 +970,6 @@ toolbar[iconsize="small"] #feed-button { width: 24px; height: 20px; padding: 2px 4px; - background: url(urlbar-favicon-glow.png) center center no-repeat; } #page-proxy-favicon:not([src]) { @@ -987,37 +986,67 @@ toolbar[iconsize="small"] #feed-button { /* Identity indicator */ #identity-box { - background-color: rgb(95%,95%,95%); - background-image: -moz-linear-gradient(rgba(170,170,170,.25), rgba(0,0,0,.3)); - color: #444; - box-shadow: 0 0 0 1px rgba(0,0,0,.1) inset; - border-radius: 1.5px; + background-image: -moz-linear-gradient(hsl(0,0%,98%), hsl(0,0%,92%)); + box-shadow: 0 1px 0 hsla(0,0%,0%,.05) inset; + -moz-border-end: 1px solid rgba(0,0,0,.1); + padding: 1px; + margin: -1px; + -moz-margin-end: 0; +} + +#identity-box:-moz-locale-dir(ltr) { + border-top-left-radius: 2.5px; + border-bottom-left-radius: 2.5px; +} + +#identity-box:-moz-locale-dir(rtl) { + border-top-right-radius: 2.5px; + border-bottom-right-radius: 2.5px; } #identity-box:-moz-focusring { - outline: 1px dotted -moz-DialogText; + outline: 1px dotted #000; + outline-offset: -3px; } #identity-box:hover:active, #identity-box[open="true"] { - background-image: -moz-linear-gradient(rgba(0,0,0,.4), rgba(0,0,0,.1)); + background-image: -moz-linear-gradient(hsl(0,0%,92%), hsl(0,0%,82%)); + box-shadow: 0 1px 1px hsla(0,0%,0%,.3) inset, + 0 1px 3px hsla(0,0%,0%,.3) inset; } #identity-icon-labels { -moz-padding-start: 2px; - -moz-padding-end: 3px; + -moz-padding-end: 5px; } #identity-box.verifiedDomain { - background-color: rgba(30, 80, 170, 0.7); - color: white; - text-shadow: 0 1px 0 rgba(0,0,0,.25); + background-image: -moz-linear-gradient(hsl(215,60%,92%), hsl(215,58%,88%)); + box-shadow: 0 1px 0 hsla(215,54%,33%,.05) inset; + -moz-border-end-color: hsla(215,54%,33%,.2); + color: hsl(215,54%,33%); +} + +#identity-box.verifiedDomain:hover:active, +#identity-box.verifiedDomain[open="true"] { + background-image: -moz-linear-gradient(hsl(215,80%,80%), hsl(215,67%,65%)); + box-shadow: 0 1px 1px hsla(215,54%,33%,.7) inset, + 0 1px 3px 1px hsla(215,54%,33%,.5) inset; } #identity-box.verifiedIdentity { - background-color: rgba(50, 150, 50, 0.8); - color: white; - text-shadow: 0 1px 0 rgba(0,0,0,.25); + background-image: -moz-linear-gradient(hsl(91,70%,90%), hsl(93,60%,81%)); + box-shadow: 0 1px 0 hsla(92,81%,16%,.05) inset; + -moz-border-end-color: hsla(92,81%,16%,.2); + color: hsl(92,81%,16%); +} + +#identity-box.verifiedIdentity:hover:active, +#identity-box.verifiedIdentity[open="true"] { + background-image: -moz-linear-gradient(hsl(92,65%,70%), hsl(92,40%,48%)); + box-shadow: 0 1px 1px hsla(92,81%,16%,.6) inset, + 0 1px 3px 1px hsla(92,81%,16%,.5) inset; } /* Identity popup icons */ @@ -1146,7 +1175,25 @@ toolbar[iconsize="small"] #feed-button { /* Notification icon box */ #notification-popup-box { - margin: 0 3px; + position: relative; + background-color: #fff; + background-clip: padding-box; + padding-left: 4px; + border-radius: 2.5px 0 0 2.5px; + -moz-border-image: url("chrome://browser/skin/urlbar-arrow.png") 0 8 0 0 / 0 8px 0 0; + -moz-margin-end: -8px; + margin-top: -1px; + margin-bottom: -1px; +} + +#notification-popup-box:not([hidden]) + #identity-box { + -moz-padding-start: 10px; + border-radius: 0; +} + +#notification-popup-box:-moz-locale-dir(rtl), +.notification-anchor-icon:-moz-locale-dir(rtl) { + -moz-transform: scaleX(-1); } .notification-anchor-icon { @@ -1256,7 +1303,7 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action- #urlbar > toolbarbutton { -moz-appearance: none; list-style-image: url("chrome://browser/skin/reload-stop-go.png"); - margin: -2px; + margin: -1px; -moz-margin-start: 0; padding: 0 3px; background-origin: border-box; diff --git a/browser/themes/gnomestripe/browser/jar.mn b/browser/themes/gnomestripe/browser/jar.mn index 432e8e06d6e..0fe27e649eb 100644 --- a/browser/themes/gnomestripe/browser/jar.mn +++ b/browser/themes/gnomestripe/browser/jar.mn @@ -37,7 +37,7 @@ browser.jar: skin/classic/browser/setDesktopBackground.css skin/classic/browser/Toolbar.png skin/classic/browser/Toolbar-small.png - skin/classic/browser/urlbar-favicon-glow.png + skin/classic/browser/urlbar-arrow.png skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png) skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png) skin/classic/browser/feeds/videoFeedIcon.png (feeds/videoFeedIcon.png) diff --git a/browser/themes/gnomestripe/browser/urlbar-arrow.png b/browser/themes/gnomestripe/browser/urlbar-arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..fcab253bb301ddfb14e5cabfaa441a6fffff81ee GIT binary patch literal 305 zcmV-10nYx3P)wgfB*OF*|QzU<;SW31U`QJcn-)l0b(Ys3ZPb90tzYM zRPguj-~SyQ9YsK4F02Yb;KhpT^VTCu*0t6TU2HhI)hrNZJ00000NkvXXu0mjf DzTkRv literal 0 HcmV?d00001 diff --git a/browser/themes/gnomestripe/browser/urlbar-favicon-glow.png b/browser/themes/gnomestripe/browser/urlbar-favicon-glow.png deleted file mode 100644 index 19de6ff972550759b8eedb5b2caf6146d599973f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 619 zcmV-x0+juUP)qNDOG$e~OyR&mna;zAJA%+kZf->U* z;|SQ?+>x?_RZ!p(DVBrL4!vUn5j90{+D&*=atk%dM02^P;SQSuyf;DE# zR;s1=XdO3{*4$=10T15@a5E`Tqe52I(jr!HB^Etq++(hRKp|iS9Rw2dRRV^)COE7o`H8{UrqTX)@^`mb{#ee_X@(F0w1Dmy^e9!;@002ovPDHLk FV1f$<0{Z{} diff --git a/browser/themes/pinstripe/browser/browser.css b/browser/themes/pinstripe/browser/browser.css index 2553bc279a1..377eb94d45f 100644 --- a/browser/themes/pinstripe/browser/browser.css +++ b/browser/themes/pinstripe/browser/browser.css @@ -779,7 +779,7 @@ toolbar[mode="icons"] #zoom-in-button { width: 7em; min-width: 7em; -moz-appearance: none; - box-shadow: 0 1px rgba(255, 255, 255, 0.2), inset 0 1px #d6d6d6; + box-shadow: 0 1px rgba(255, 255, 255, 0.2), inset 0 1px hsla(0,0%,0%,.05); margin: 0 4px; padding: 0; border: 1px solid; @@ -807,45 +807,65 @@ toolbar[mode="icons"] #zoom-in-button { } #identity-box { - margin: 1px; - border-radius: 2px; - padding: 1px; - box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); - text-shadow: 0 1px rgba(255, 255, 255, 0.2); -} - - -#identity-box:-moz-focusring { - box-shadow: 0 0 2px 1px -moz-mac-focusring inset, - 0 0 2px 2px -moz-mac-focusring; -} - -#identity-box { - color: white; - text-shadow: 0 1px 1px rgba(0, 0, 0, 0.7); + background-image: -moz-linear-gradient(hsl(0,0%,98%), hsl(0,0%,92%)); + box-shadow: 0 1px 0 hsla(0,0%,0%,.05) inset; + -moz-border-end: 1px solid hsla(0,0%,0%,.1); -moz-margin-end: 3px; + padding: 1px 4px; } -#identity-box { - background-image: -moz-linear-gradient(#FFF, #DDD); +#identity-box:-moz-locale-dir(ltr) { + border-top-left-radius: 2px; + border-bottom-left-radius: 2px; +} + +#identity-box:-moz-locale-dir(rtl) { + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; } #identity-box:active:hover, #identity-box[open="true"] { - box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.35), - inset 0 0 0 20px rgba(0, 0, 0, 0.06); + background-image: -moz-linear-gradient(hsl(0,0%,93%), hsl(0,0%,80%)); + box-shadow: 0 1px 1px hsla(0,0%,0%,.3) inset, + 0 1px 3px hsla(0,0%,0%,.3) inset; } #identity-box.verifiedDomain { - background-image: -moz-linear-gradient(#588EC6, #3C68AE); + background-image: -moz-linear-gradient(hsl(215,60%,92%), hsl(215,58%,88%)); + -moz-border-end-color: hsla(215,54%,33%,.2); + color: hsl(215,54%,33%); +} + +#identity-box.verifiedDomain:active:hover, +#identity-box.verifiedDomain[open="true"] { + background-image: -moz-linear-gradient(hsl(215,85%,85%), hsl(215,70%,68%)); + box-shadow: 0 1px 1px hsla(215,54%,33%,.7) inset, + 0 1px 3px 1px hsla(215,54%,33%,.5) inset; } #identity-box.verifiedIdentity { - background-image: -moz-linear-gradient(#84BB40, #5BA020); + background-image: -moz-linear-gradient(hsl(91,70%,90%), hsl(93,60%,81%)); + -moz-border-end-color: hsla(92,81%,16%,.2); + color: hsl(92,100%,20%); +} + +#identity-box.verifiedIdentity:active:hover, +#identity-box.verifiedIdentity[open="true"] { + background-image: -moz-linear-gradient(hsl(92,69%,77%), hsl(92,44%,51%)); + box-shadow: 0 1px 1px hsla(92,81%,16%,.6) inset, + 0 1px 3px 1px hsla(92,81%,16%,.5) inset; +} + +#identity-box:-moz-focusring { + box-shadow: 0 0 2px 1px -moz-mac-focusring inset, + 0 0 2px 2px -moz-mac-focusring; + -moz-border-end-style: none; + -moz-padding-end: 5px; } #identity-icon-labels { - margin: 0 4px 1px; + -moz-margin-start: 6px; } .urlbar-input-box { @@ -875,20 +895,8 @@ toolbar[mode="icons"] #zoom-in-button { } #page-proxy-stack { - width: 18px; + width: 16px; height: 16px; - padding: 0 1px; -} - -#identity-box.verifiedIdentity > hbox > #page-proxy-stack, -#identity-box.verifiedDomain > hbox > #page-proxy-stack { - width: 24px; - padding: 0 4px; -} - -#identity-box.verifiedIdentity > hbox > #page-proxy-stack, -#identity-box.verifiedDomain > hbox > #page-proxy-stack { - background: url(urlbar-favicon-glow.png) center center no-repeat; } #page-proxy-favicon:not([src]) { @@ -2082,7 +2090,23 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker { } #notification-popup-box { - margin: 0 3px; + position: relative; + background-color: #fff; + background-clip: padding-box; + padding-left: 3px; + border-radius: 2px 0 0 2px; + -moz-border-image: url("chrome://browser/skin/urlbar-arrow.png") 0 8 0 0 / 0 8px 0 0; + -moz-margin-end: -8px; +} + +#notification-popup-box:not([hidden]) + #identity-box { + -moz-padding-start: 10px; + border-radius: 0; +} + +#notification-popup-box:-moz-locale-dir(rtl), +.notification-anchor-icon:-moz-locale-dir(rtl) { + -moz-transform: scaleX(-1); } .notification-anchor-icon { diff --git a/browser/themes/pinstripe/browser/jar.mn b/browser/themes/pinstripe/browser/jar.mn index 99f52b5c603..7f371640dc5 100644 --- a/browser/themes/pinstripe/browser/jar.mn +++ b/browser/themes/pinstripe/browser/jar.mn @@ -45,7 +45,7 @@ browser.jar: skin/classic/browser/Secure-background.gif skin/classic/browser/Toolbar.png skin/classic/browser/toolbarbutton-dropmarker.png - skin/classic/browser/urlbar-favicon-glow.png + skin/classic/browser/urlbar-arrow.png skin/classic/browser/urlbar-popup-blocked.png skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css) skin/classic/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css) diff --git a/browser/themes/pinstripe/browser/urlbar-arrow.png b/browser/themes/pinstripe/browser/urlbar-arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..fcab253bb301ddfb14e5cabfaa441a6fffff81ee GIT binary patch literal 305 zcmV-10nYx3P)wgfB*OF*|QzU<;SW31U`QJcn-)l0b(Ys3ZPb90tzYM zRPguj-~SyQ9YsK4F02Yb;KhpT^VTCu*0t6TU2HhI)hrNZJ00000NkvXXu0mjf DzTkRv literal 0 HcmV?d00001 diff --git a/browser/themes/pinstripe/browser/urlbar-favicon-glow.png b/browser/themes/pinstripe/browser/urlbar-favicon-glow.png deleted file mode 100644 index 68803e5d07861fc2fe1bec2fc0ef3ba2e05fed24..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 504 zcmVZ#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=0000wgfB*OF*|QzU<;SW31U`QJcn-)l0b(Ys3ZPb90tzYM zRPguj-~SyQ9YsK4F02Yb;KhpT^VTCu*0t6TU2HhI)hrNZJ00000NkvXXu0mjf DzTkRv literal 0 HcmV?d00001 diff --git a/browser/themes/winstripe/browser/urlbar-favicon-glow.png b/browser/themes/winstripe/browser/urlbar-favicon-glow.png deleted file mode 100644 index 19de6ff972550759b8eedb5b2caf6146d599973f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 619 zcmV-x0+juUP)qNDOG$e~OyR&mna;zAJA%+kZf->U* z;|SQ?+>x?_RZ!p(DVBrL4!vUn5j90{+D&*=atk%dM02^P;SQSuyf;DE# zR;s1=XdO3{*4$=10T15@a5E`Tqe52I(jr!HB^Etq++(hRKp|iS9Rw2dRRV^)COE7o`H8{UrqTX)@^`mb{#ee_X@(F0w1Dmy^e9!;@002ovPDHLk FV1f$<0{Z{} From 6e28b1dcf1bbda2a03f6ae71bad8787d553081c1 Mon Sep 17 00:00:00 2001 From: Mark Finkle Date: Tue, 19 Apr 2011 16:04:03 -0400 Subject: [PATCH 07/36] Bug 650676 - browser_autocompletesearch.js throws getting ProfD, then times out, on Android [r=vingtetun] --- .../tests/browser_autocompletesearch.js | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/mobile/chrome/tests/browser_autocompletesearch.js b/mobile/chrome/tests/browser_autocompletesearch.js index 95d0475a49d..a16016a5ad0 100644 --- a/mobile/chrome/tests/browser_autocompletesearch.js +++ b/mobile/chrome/tests/browser_autocompletesearch.js @@ -48,10 +48,29 @@ function saveMockCache() { info("mock path: " + mockCachePath); let mockCacheURI = getResolvedURI(mockCachePath); info("mock URI: " + mockCacheURI.spec); - let mockCacheFile = getChromeDir(mockCacheURI); - info("mock file: " + mockCacheFile.path); - mockCacheFile.append("mock_autocomplete.json"); - mockCacheFile.copyToFollowingLinks(gProfileDir, "autocomplete.json"); + if (mockCacheURI instanceof Ci.nsIJARURI) { + // Android tests are stored in a JAR file, so we need to extract the mock_autocomplete.json file + info("jar file: " + mockCacheURI.JARFile.spec); + let zReader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance(Ci.nsIZipReader); + let fileHandler = Cc["@mozilla.org/network/protocol;1?name=file"].getService(Ci.nsIFileProtocolHandler); + let fileName = fileHandler.getFileFromURLSpec(mockCacheURI.JARFile.spec); + zReader.open(fileName); + + let extract = mockCacheURI.JARFile.spec.split("!")[1]; + extract = extract.substring(1, extract.lastIndexOf("/") + 1); + extract += "mock_autocomplete.json"; + info("extract path: " + extract); + let target = gProfileDir.clone(); + target.append("autocomplete.json"); + info("target path: " + target.path); + zReader.extract(extract, target); + } else { + // Tests are run from a folder, so we can just copy the mock_autocomplete.json file + let mockCacheFile = getChromeDir(mockCacheURI); + info("mock file: " + mockCacheFile.path); + mockCacheFile.append("mock_autocomplete.json"); + mockCacheFile.copyToFollowingLinks(gProfileDir, "autocomplete.json"); + } // Listen for when the mock cache has been loaded Services.obs.addObserver(function (aSubject, aTopic, aData) { From d2f747fa567e4f8a99ebbd34d8ab34cd6f0843e6 Mon Sep 17 00:00:00 2001 From: Justin Dolske Date: Tue, 19 Apr 2011 14:18:17 -0700 Subject: [PATCH 08/36] Bug 638352 - tab-modal dialogs can get into bad focus state and key events can bleed through tabs. r=gavin --- browser/base/content/tabbrowser.xml | 38 ++++++++++-------- .../components/prompts/src/CommonDialog.jsm | 40 +++++++++++++------ toolkit/components/prompts/src/nsPrompter.js | 6 --- 3 files changed, 50 insertions(+), 34 deletions(-) diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index b647f11cd0e..710678dcdb9 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -357,15 +357,10 @@ let promptBox = { appendPrompt : function(args, onCloseCallback) { - let count = browser.getAttribute("tabmodalPromptShowing"); - if (count) - count = parseInt(count) + 1; - else - count = 1; - browser.setAttribute("tabmodalPromptShowing", count); - let newPrompt = document.createElementNS(XUL_NS, "tabmodalprompt"); stack.appendChild(newPrompt); + browser.setAttribute("tabmodalPromptShowing", true); + newPrompt.clientTop; // style flush to assure binding is attached let tab = self._getTabForContentWindow(browser.contentWindow); @@ -374,21 +369,22 @@ }, removePrompt : function(aPrompt) { - let count = parseInt(browser.getAttribute("tabmodalPromptShowing")); - count--; - if (count) - browser.setAttribute("tabmodalPromptShowing", count); - else - browser.removeAttribute("tabmodalPromptShowing"); stack.removeChild(aPrompt); + + let prompts = this.listPrompts(); + if (prompts.length) { + let prompt = prompts[prompts.length - 1]; + prompt.Dialog.setDefaultFocus(); + } else { + browser.removeAttribute("tabmodalPromptShowing"); + browser.focus(); + } }, listPrompts : function(aPrompt) { - let prompts = []; let els = stack.getElementsByTagNameNS(XUL_NS, "tabmodalprompt"); // NodeList --> real JS array - for (let i = 0; i < els.length; i++) - prompts.push(els[i]); + let prompts = Array.slice(els); return prompts; }, }; @@ -952,6 +948,16 @@ // Adjust focus do { + + // If there's a tabmodal prompt showing, focus it. + if (newBrowser.hasAttribute("tabmodalPromptShowing")) { + let XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; + let prompts = newBrowser.parentNode.getElementsByTagNameNS(XUL_NS, "tabmodalprompt"); + let prompt = prompts[prompts.length - 1]; + prompt.Dialog.setDefaultFocus(); + break; + } + // Focus the location bar if it was previously focused for that tab. // In full screen mode, only bother making the location bar visible // if the tab is a blank one. diff --git a/toolkit/components/prompts/src/CommonDialog.jsm b/toolkit/components/prompts/src/CommonDialog.jsm index 17eb824b112..f335c3fb259 100644 --- a/toolkit/components/prompts/src/CommonDialog.jsm +++ b/toolkit/components/prompts/src/CommonDialog.jsm @@ -190,18 +190,7 @@ CommonDialog.prototype = { button.setAttribute("default", "true"); // Set default focus / selection. - if (!this.hasInputField) { - let isOSX = ("nsILocalFileMac" in Components.interfaces); - if (isOSX) - this.ui.infoBody.focus(); - else - button.focus(); - } else { - if (this.args.promptType == "promptPassword") - this.ui.password1Textbox.select(); - else - this.ui.loginTextbox.select(); - } + this.setDefaultFocus(true); if (this.args.enableDelay) { this.setButtonsEnabledState(false); @@ -310,6 +299,33 @@ CommonDialog.prototype = { this.setButtonsEnabledState(true); }, + setDefaultFocus : function(isInitialLoad) { + let b = (this.args.defaultButtonNum || 0); + let button = this.ui["button" + b]; + + if (!this.hasInputField) { + let isOSX = ("nsILocalFileMac" in Components.interfaces); + if (isOSX) + this.ui.infoBody.focus(); + else + button.focus(); + } else { + // When the prompt is initialized, focus and select the textbox + // contents. Afterwards, only focus the textbox. + if (this.args.promptType == "promptPassword") { + if (isInitialLoad) + this.ui.password1Textbox.select(); + else + this.ui.password1Textbox.focus(); + } else { + if (isInitialLoad) + this.ui.loginTextbox.select(); + else + this.ui.loginTextbox.focus(); + } + } + }, + onCheckbox : function() { this.args.checked = this.ui.checkbox.checked; }, diff --git a/toolkit/components/prompts/src/nsPrompter.js b/toolkit/components/prompts/src/nsPrompter.js index 59c92ce01e2..a58625c49d9 100644 --- a/toolkit/components/prompts/src/nsPrompter.js +++ b/toolkit/components/prompts/src/nsPrompter.js @@ -438,12 +438,6 @@ function openTabPrompt(domWin, tabPrompt, args) { winUtils.leaveModalStateWithWindow(callerWin); PromptUtils.fireDialogEvent(domWin, "DOMModalDialogClosed"); - - // Restore focus to the previously focused element within tab. - let fm = Cc["@mozilla.org/focus-manager;1"]. - getService(Ci.nsIFocusManager); - let e = fm.getFocusedElementForWindow(domWin.top, false, {}); - fm.setFocus(e, fm.FLAG_NOSCROLL); } let newPrompt; From bfd240a0f923ae8f0651fadfc375820dc5e22d96 Mon Sep 17 00:00:00 2001 From: Justin Dolske Date: Tue, 19 Apr 2011 14:18:17 -0700 Subject: [PATCH 09/36] Bug 637160 - window-modal prompts used instead of tab-modal prompts when reentering a page using back/forward. r=bz --- layout/base/nsDocumentViewer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index 8815f856a68..3ef28eb3e7f 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -1360,6 +1360,8 @@ DocumentViewerImpl::Open(nsISupports *aState, nsISHEntry *aSHEntry) nsresult rv = InitInternal(mParentWidget, aState, mBounds, PR_FALSE); NS_ENSURE_SUCCESS(rv, rv); + mHidden = PR_FALSE; + if (mPresShell) mPresShell->SetForwardingContainer(nsnull); From 229fc65d2436697e1090123b03be24603f65ebb3 Mon Sep 17 00:00:00 2001 From: Dave Townsend Date: Tue, 19 Apr 2011 14:53:07 -0700 Subject: [PATCH 10/36] Bug 617289: PluginProvider doesn't keep IDs of plugins consistent between restarts. r=robstrong --- toolkit/mozapps/extensions/PluginProvider.jsm | 68 +++++-- .../test/xpcshell/test_duplicateplugins.js | 175 ++++++++++++++++++ .../extensions/test/xpcshell/test_plugins.js | 12 ++ 3 files changed, 235 insertions(+), 20 deletions(-) create mode 100644 toolkit/mozapps/extensions/test/xpcshell/test_duplicateplugins.js diff --git a/toolkit/mozapps/extensions/PluginProvider.jsm b/toolkit/mozapps/extensions/PluginProvider.jsm index 3e799d19512..b8dee6cdca8 100644 --- a/toolkit/mozapps/extensions/PluginProvider.jsm +++ b/toolkit/mozapps/extensions/PluginProvider.jsm @@ -54,10 +54,41 @@ Components.utils.import("resource://gre/modules/Services.jsm"); }); }, this); +function getIDHashForString(aStr) { + // return the two-digit hexadecimal code for a byte + function toHexString(charCode) + ("0" + charCode.toString(16)).slice(-2); + + let hasher = Cc["@mozilla.org/security/hash;1"]. + createInstance(Ci.nsICryptoHash); + hasher.init(Ci.nsICryptoHash.MD5); + let stringStream = Cc["@mozilla.org/io/string-input-stream;1"]. + createInstance(Ci.nsIStringInputStream); + stringStream.data = aStr ? aStr : "null"; + hasher.updateFromStream(stringStream, -1); + + // convert the binary hash data to a hex string. + let binary = hasher.finish(false); + let hash = [toHexString(binary.charCodeAt(i)) for (i in binary)].join("").toLowerCase(); + return "{" + hash.substr(0, 8) + "-" + + hash.substr(8, 4) + "-" + + hash.substr(12, 4) + "-" + + hash.substr(16, 4) + "-" + + hash.substr(20) + "}"; +} + var PluginProvider = { // A dictionary mapping IDs to names and descriptions plugins: null, + /** + * Called when the application is shutting down. Only necessary for tests + * to be able to simulate a shutdown. + */ + shutdown: function PL_shutdown() { + this.plugins = null; + }, + /** * Called to get an Addon with a particular ID. * @@ -73,17 +104,9 @@ var PluginProvider = { if (aId in this.plugins) { let name = this.plugins[aId].name; let description = this.plugins[aId].description; + let tags = this.plugins[aId].tags; - let tags = Cc["@mozilla.org/plugin/host;1"]. - getService(Ci.nsIPluginHost). - getPluginTags({}); - let selected = []; - tags.forEach(function(aTag) { - if (aTag.name == name && aTag.description == description) - selected.push(aTag); - }, this); - - aCallback(new PluginWrapper(aId, name, description, selected)); + aCallback(new PluginWrapper(aId, name, description, tags)); } else { aCallback(null); @@ -148,19 +171,24 @@ var PluginProvider = { getPluginTags({}); this.plugins = {}; - let seen = {}; + let plugins = {}; tags.forEach(function(aTag) { - if (!(aTag.name in seen)) - seen[aTag.name] = {}; - if (!(aTag.description in seen[aTag.name])) { - let id = Cc["@mozilla.org/uuid-generator;1"]. - getService(Ci.nsIUUIDGenerator). - generateUUID(); - this.plugins[id] = { + if (!(aTag.name in plugins)) + plugins[aTag.name] = {}; + if (!(aTag.description in plugins[aTag.name])) { + let plugin = { name: aTag.name, - description: aTag.description + description: aTag.description, + tags: [aTag] }; - seen[aTag.name][aTag.description] = true; + + let id = getIDHashForString(aTag.name + aTag.description); + + plugins[aTag.name][aTag.description] = plugin; + this.plugins[id] = plugin; + } + else { + plugins[aTag.name][aTag.description].tags.push(aTag); } }, this); } diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_duplicateplugins.js b/toolkit/mozapps/extensions/test/xpcshell/test_duplicateplugins.js new file mode 100644 index 00000000000..e6f2c8cf291 --- /dev/null +++ b/toolkit/mozapps/extensions/test/xpcshell/test_duplicateplugins.js @@ -0,0 +1,175 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +// This verifies that duplicate plugins are coalesced and maintain their ID +// across restarts. + +var PLUGINS = [{ + name: "Duplicate Plugin 1", + description: "A duplicate plugin", + version: "1", + blocklisted: false, + disabled: false, + filename: "/home/mozilla/.plugins/dupplugin1.so" +}, { + name: "Duplicate Plugin 1", + description: "A duplicate plugin", + version: "1", + blocklisted: false, + disabled: false, + filename: "", + filename: "/usr/lib/plugins/dupplugin1.so" +}, { + name: "Duplicate Plugin 2", + description: "Another duplicate plugin", + version: "1", + blocklisted: false, + disabled: false, + filename: "/home/mozilla/.plugins/dupplugin2.so" +}, { + name: "Duplicate Plugin 2", + description: "Another duplicate plugin", + version: "1", + blocklisted: false, + disabled: false, + filename: "", + filename: "/usr/lib/plugins/dupplugin2.so" +}, { + name: "Non-duplicate Plugin", // 3 + description: "Not a duplicate plugin", + version: "1", + blocklisted: false, + disabled: false, + filename: "/home/mozilla/.plugins/dupplugin3.so" +}, { + name: "Non-duplicate Plugin", // 4 + description: "Not a duplicate because the descriptions are different", + version: "1", + blocklisted: false, + disabled: false, + filename: "", + filename: "/usr/lib/plugins/dupplugin4.so" +}, { + name: "Another Non-duplicate Plugin", // 5 + description: "Not a duplicate plugin", + version: "1", + blocklisted: false, + disabled: false, + filename: "/home/mozilla/.plugins/dupplugin5.so" +}]; + +// A fake plugin host to return the plugins defined above +var PluginHost = { + getPluginTags: function(countRef) { + countRef.value = PLUGINS.length; + return PLUGINS; + }, + + QueryInterface: function(iid) { + if (iid.equals(Components.interfaces.nsIPluginHost) + || iid.equals(Components.interfaces.nsISupports)) + return this; + + throw Components.results.NS_ERROR_NO_INTERFACE; + } +} + +var PluginHostFactory = { + createInstance: function (outer, iid) { + if (outer != null) + throw Components.results.NS_ERROR_NO_AGGREGATION; + return PluginHost.QueryInterface(iid); + } +}; + +var registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar); +registrar.registerFactory(Components.ID("{721c3e73-969e-474b-a6dc-059fd288c428}"), + "Fake Plugin Host", + "@mozilla.org/plugin/host;1", PluginHostFactory); + +var gPluginIDs = [null, null, null, null, null]; + +function run_test() { + do_test_pending(); + createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2"); + + startupManager(); + + run_test_1(); +} + +function found_plugin(aNum, aId) { + if (gPluginIDs[aNum]) + do_throw("Found duplicate of plugin " + aNum); + gPluginIDs[aNum] = aId; +} + +// Test that the plugins were coalesced and all appear in the returned list +function run_test_1() { + AddonManager.getAddonsByTypes(["plugin"], function(aAddons) { + do_check_eq(aAddons.length, 5); + aAddons.forEach(function(aAddon) { + if (aAddon.name == "Duplicate Plugin 1") { + found_plugin(0, aAddon.id); + do_check_eq(aAddon.description, "A duplicate plugin"); + } + else if (aAddon.name == "Duplicate Plugin 2") { + found_plugin(1, aAddon.id); + do_check_eq(aAddon.description, "Another duplicate plugin"); + } + else if (aAddon.name == "Another Non-duplicate Plugin") { + found_plugin(5, aAddon.id); + do_check_eq(aAddon.description, "Not a duplicate plugin"); + } + else if (aAddon.name == "Non-duplicate Plugin") { + if (aAddon.description == "Not a duplicate plugin") + found_plugin(3, aAddon.id); + else if (aAddon.description == "Not a duplicate because the descriptions are different") + found_plugin(4, aAddon.id); + else + do_throw("Found unexpected plugin with description " + aAddon.description); + } + else { + do_throw("Found unexpected plugin " + aAddon.name); + } + }); + + run_test_2(); + }); +} + +// Test that disabling a coalesced plugin disables all its tags +function run_test_2() { + AddonManager.getAddonByID(gPluginIDs[0], function(p) { + do_check_false(p.userDisabled); + p.userDisabled = true; + do_check_true(PLUGINS[0].disabled); + do_check_true(PLUGINS[1].disabled); + + run_test_3(); + }); +} + +// Test that IDs persist across restart +function run_test_3() { + restartManager(); + + AddonManager.getAddonByID(gPluginIDs[0], function(p) { + do_check_neq(p, null); + do_check_eq(p.name, "Duplicate Plugin 1"); + do_check_eq(p.description, "A duplicate plugin"); + + // Reorder the plugins and restart again + [PLUGINS[0], PLUGINS[1]] = [PLUGINS[1], PLUGINS[0]]; + restartManager(); + + AddonManager.getAddonByID(gPluginIDs[0], function(p) { + do_check_neq(p, null); + do_check_eq(p.name, "Duplicate Plugin 1"); + do_check_eq(p.description, "A duplicate plugin"); + + do_test_finished(); + }); + }); +} diff --git a/toolkit/mozapps/extensions/test/xpcshell/test_plugins.js b/toolkit/mozapps/extensions/test/xpcshell/test_plugins.js index ace1f648e14..71e9ac14572 100644 --- a/toolkit/mozapps/extensions/test/xpcshell/test_plugins.js +++ b/toolkit/mozapps/extensions/test/xpcshell/test_plugins.js @@ -166,6 +166,18 @@ function run_test_3(p) { do_check_true(p.isActive); do_check_eq(p.name, "Test Plug-in"); + run_test_4(); + }); +} + +// Verify that after a restart the test plugin has the same ID +function run_test_4() { + restartManager(); + + AddonManager.getAddonByID(gID, function(p) { + do_check_neq(p, null); + do_check_eq(p.name, "Test Plug-in"); + do_test_finished(); }); } From 81d4a765c44f7d3e2d0fee40edbfcc1e431155a4 Mon Sep 17 00:00:00 2001 From: Neil Rashbrook Date: Tue, 19 Apr 2011 23:12:50 +0100 Subject: [PATCH 11/36] Bug 650950 Simplify DOMMouseScroll event handler r=dao --- browser/components/search/content/search.xml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/browser/components/search/content/search.xml b/browser/components/search/content/search.xml index ea43bf7276d..b1f474fff84 100644 --- a/browser/components/search/content/search.xml +++ b/browser/components/search/content/search.xml @@ -523,11 +523,8 @@ -#else - action="if (event.ctrlKey) this.selectEngine(event, (event.detail > 0));"/> -#endif + modifiers="accel" + action="this.selectEngine(event, (event.detail > 0));"/> From c491e58d068b0fbdfab42d0f6ff4291e57a01fa3 Mon Sep 17 00:00:00 2001 From: Joel Maher Date: Tue, 19 Apr 2011 15:17:01 -0700 Subject: [PATCH 12/36] Bug 650828 - change runtestremote and remotereftests to generate pid file. r=ctalbert --- layout/tools/reftest/remotereftest.py | 17 +++++++++++++++++ testing/mochitest/runtestsremote.py | 15 +++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/layout/tools/reftest/remotereftest.py b/layout/tools/reftest/remotereftest.py index abb225489c3..17375d7cb3e 100644 --- a/layout/tools/reftest/remotereftest.py +++ b/layout/tools/reftest/remotereftest.py @@ -101,6 +101,12 @@ class RemoteOptions(ReftestOptions): type = "string", dest = "remoteLogFile", help = "Name of log file on the device relative to device root. PLEASE USE ONLY A FILENAME.") defaults["remoteLogFile"] = None + + self.add_option("--pidfile", action = "store", + type = "string", dest = "pidFile", + help = "name of the pidfile to generate") + defaults["pidFile"] = "" + defaults["localLogName"] = None self.set_defaults(**defaults) @@ -153,6 +159,11 @@ class RemoteOptions(ReftestOptions): options.logFile = options.remoteLogFile + if (options.pidFile != ""): + f = open(options.pidFile, 'w') + f.write("%s" % os.getpid()) + f.close() + # TODO: Copied from main, but I think these are no longer used in a post xulrunner world #options.xrePath = options.remoteTestRoot + self._automation._product + '/xulrunner' #options.utilityPath = options.testRoot + self._automation._product + '/bin' @@ -238,6 +249,7 @@ class RemoteReftest(RefTest): self.remoteTestRoot = options.remoteTestRoot self.remoteLogFile = options.remoteLogFile self.localLogName = options.localLogName + self.pidFile = options.pidFile if self.automation.IS_DEBUG_BUILD: self.SERVER_STARTUP_TIMEOUT = 180 else: @@ -336,6 +348,11 @@ class RemoteReftest(RefTest): self._devicemanager.removeDir(self.remoteProfile) self._devicemanager.removeDir(self.remoteTestRoot) RefTest.cleanup(self, profileDir) + if (self.pidFile != ""): + try: + os.remove(self.pidFile) + except: + print "Warning: cleaning up pidfile '%s' was unsuccessful from the test harness" % self.pidFile def main(): dm_none = DeviceManager(None, None) diff --git a/testing/mochitest/runtestsremote.py b/testing/mochitest/runtestsremote.py index 3e84d243c25..6d29fde9042 100644 --- a/testing/mochitest/runtestsremote.py +++ b/testing/mochitest/runtestsremote.py @@ -96,6 +96,11 @@ class RemoteOptions(MochitestOptions): help = "ip address where the remote web server is hosted at") defaults["sslPort"] = automation.DEFAULT_SSL_PORT + self.add_option("--pidfile", action = "store", + type = "string", dest = "pidFile", + help = "name of the pidfile to generate") + defaults["pidFile"] = "" + defaults["remoteTestRoot"] = None defaults["logFile"] = "mochitest.log" defaults["autorun"] = True @@ -149,6 +154,11 @@ class RemoteOptions(MochitestOptions): else: options.xrePath = options.utilityPath + if (options.pidFile != ""): + f = open(options.pidFile, 'w') + f.write("%s" % os.getpid()) + f.close() + return options def verifyOptions(self, options, mochitest): @@ -183,6 +193,11 @@ class MochiRemote(Mochitest): self._dm.getFile(self.remoteLog, self.localLog) self._dm.removeFile(self.remoteLog) self._dm.removeDir(self.remoteProfile) + if (options.pidFile != ""): + try: + os.remove(options.pidFile) + except: + print "Warning: cleaning up pidfile '%s' was unsuccessful from the test harness" % options.pidFile def findPath(self, paths, filename = None): for path in paths: From bf026ce1e046db6deb4a03357ce0aecefbfa71e7 Mon Sep 17 00:00:00 2001 From: Joel Maher Date: Tue, 19 Apr 2011 15:17:02 -0700 Subject: [PATCH 13/36] Bug 649475 - [android-tests-only] remote jsreftests fail because user.js forces prompt for elevated privileges r=ctalbert --- layout/tools/reftest/remotereftest.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/layout/tools/reftest/remotereftest.py b/layout/tools/reftest/remotereftest.py index 17375d7cb3e..7d254e28f88 100644 --- a/layout/tools/reftest/remotereftest.py +++ b/layout/tools/reftest/remotereftest.py @@ -102,6 +102,10 @@ class RemoteOptions(ReftestOptions): help = "Name of log file on the device relative to device root. PLEASE USE ONLY A FILENAME.") defaults["remoteLogFile"] = None + self.add_option("--enable-privilege", action="store_true", dest = "enablePrivilege", + help = "add webserver and port to the user.js file for remote script access and universalXPConnect") + defaults["enablePrivilege"] = False + self.add_option("--pidfile", action = "store", type = "string", dest = "pidFile", help = "name of the pidfile to generate") @@ -316,6 +320,15 @@ class RemoteReftest(RefTest): def createReftestProfile(self, options, profileDir): RefTest.createReftestProfile(self, options, profileDir, server=options.remoteWebServer) + #workaround for jsreftests. + if options.enablePrivilege: + fhandle = open(os.path.join(profileDir, "user.js"), 'a') + fhandle.write(""" +user_pref("capability.principal.codebase.p2.granted", "UniversalPreferencesWrite UniversalXPConnect UniversalBrowserWrite UniversalPreferencesRead UniversalBrowserRead"); +user_pref("capability.principal.codebase.p2.id", "http://%s:%s"); +""" % (options.remoteWebServer, options.httpPort)) + fhandle.close() + if (self._devicemanager.pushDir(profileDir, options.remoteProfile) == None): raise devicemanager.FileError("Failed to copy profiledir to device") From e63a2989e772489b9e81086eb2ff042b0a0fea19 Mon Sep 17 00:00:00 2001 From: "Timothy B. Terriberry" Date: Mon, 18 Apr 2011 12:22:51 -0700 Subject: [PATCH 14/36] Bug 650834 - Add casts to pointer differences in assertion r=dougt --- gfx/ycbcr/ycbcr_to_rgb565.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gfx/ycbcr/ycbcr_to_rgb565.cpp b/gfx/ycbcr/ycbcr_to_rgb565.cpp index 95f2c862eb3..24845359d1d 100644 --- a/gfx/ycbcr/ycbcr_to_rgb565.cpp +++ b/gfx/ycbcr/ycbcr_to_rgb565.cpp @@ -377,7 +377,8 @@ NS_GFX_(void) ScaleYCbCrToRGB565(const PRUint8 *y_buf, that would require the mis-alignment to be the same for the U and V planes.*/ NS_ASSERTION((y_pitch&15) == 0 && (uv_pitch&15) == 0 && - ((y_buf-NULL)&15) == 0 && ((u_buf-NULL)&15) == 0 && ((v_buf-NULL)&15) == 0, + ((y_buf-(PRUint8 *)NULL)&15) == 0 && + ((u_buf-(PRUint8 *)NULL)&15) == 0 && ((v_buf-(PRUint8 *)NULL)&15) == 0, "ScaleYCbCrToRGB565 source image unaligned"); /*We take an area-based approach to pixel coverage to avoid shifting by small amounts (or not so small, when up-scaling or down-scaling by a large From b406fedd57c21da5c15e1cb1fe1ea4a4318ef74d Mon Sep 17 00:00:00 2001 From: ojab Date: Tue, 19 Apr 2011 12:00:48 +0200 Subject: [PATCH 15/36] Bug 650476 - Fix build --with-libxul-sdk. r=glandium --- config/config.mk | 2 +- js/src/config/config.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/config.mk b/config/config.mk index f52607b39aa..a56b7db47e7 100644 --- a/config/config.mk +++ b/config/config.mk @@ -450,7 +450,7 @@ XPIDL_COMPILE = $(LIBXUL_DIST)/host/bin/host_xpidl$(HOST_BIN_SUFFIX) else XPIDL_COMPILE = $(LIBXUL_DIST)/bin/xpidl$(BIN_SUFFIX) endif -XPIDL_LINK = $(PYTHON) $(SDK_BIN_DIR)/xpt.py link +XPIDL_LINK = $(PYTHON) $(LIBXUL_DIST)/sdk/bin/xpt.py link # Java macros JAVA_GEN_DIR = _javagen diff --git a/js/src/config/config.mk b/js/src/config/config.mk index f52607b39aa..a56b7db47e7 100644 --- a/js/src/config/config.mk +++ b/js/src/config/config.mk @@ -450,7 +450,7 @@ XPIDL_COMPILE = $(LIBXUL_DIST)/host/bin/host_xpidl$(HOST_BIN_SUFFIX) else XPIDL_COMPILE = $(LIBXUL_DIST)/bin/xpidl$(BIN_SUFFIX) endif -XPIDL_LINK = $(PYTHON) $(SDK_BIN_DIR)/xpt.py link +XPIDL_LINK = $(PYTHON) $(LIBXUL_DIST)/sdk/bin/xpt.py link # Java macros JAVA_GEN_DIR = _javagen From b22fdc0c5bf17fcd94c3cfca3abc687067f1a525 Mon Sep 17 00:00:00 2001 From: Andrew Paprocki Date: Wed, 20 Apr 2011 01:25:07 +0200 Subject: [PATCH 16/36] Bug 621031 - Fix jsstr.cpp #pragma pack for AIX. r=mrbkap --- js/src/jsstr.cpp | 54 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp index 8f0350dc16a..2242389d96b 100644 --- a/js/src/jsstr.cpp +++ b/js/src/jsstr.cpp @@ -3290,21 +3290,37 @@ static JSFunctionSpec string_methods[] = { offsetof(JSString::Data, inlineStorage)) }, \ { {(c), 0x00} } } -#ifdef __SUNPRO_CC +/* + * For all the pragma pack usage in this file, the following logic applies: + * To apply: To reset: + * Sun CC: pack(#) / pack(0) + * IBM xlC: pack(#) / pack(pop) + * HP aCC: pack # / pack + * Others: pack(push, #) / pack(pop) + * The -Dlint case is explicitly excluded because GCC will error out when + * pack pragmas are used on unsupported platforms. If GCC is being used + * simply for error checking, these errors will be avoided. + */ + +#if defined(__SUNPRO_CC) || defined(__xlC__) #pragma pack(8) -#else +#elif defined(__HP_aCC) +#pragma pack 8 +#elif !defined(lint) #pragma pack(push, 8) #endif const JSString::Data JSAtom::unitStaticTable[] -#ifdef __GNUC__ +#if defined(__GNUC__) || defined(__xlC__) __attribute__ ((aligned (8))) #endif = { R8(0) }; -#ifdef __SUNPRO_CC +#if defined(__SUNPRO_CC) #pragma pack(0) -#else +#elif defined(__HP_aCC) +#pragma pack +#elif !defined(lint) #pragma pack(pop) #endif @@ -3350,21 +3366,25 @@ const jschar JSAtom::fromSmallChar[] = { R6(0) }; offsetof(JSString::Data, inlineStorage)) }, \ { {FROM_SMALL_CHAR((c) >> 6), FROM_SMALL_CHAR((c) & 0x3F), 0x00} } } -#ifdef __SUNPRO_CC +#if defined(__SUNPRO_CC) || defined(__xlC__) #pragma pack(8) -#else +#elif defined(__HP_aCC) +#pragma pack 8 +#elif !defined(lint) #pragma pack(push, 8) #endif const JSString::Data JSAtom::length2StaticTable[] -#ifdef __GNUC__ +#if defined(__GNUC__) || defined(__xlC__) __attribute__ ((aligned (8))) #endif = { R12(0) }; -#ifdef __SUNPRO_CC +#if defined(__SUNPRO_CC) #pragma pack(0) -#else +#elif defined(__HP_aCC) +#pragma pack +#elif !defined(lint) #pragma pack(pop) #endif @@ -3386,14 +3406,16 @@ __attribute__ ((aligned (8))) JS_STATIC_ASSERT(100 + (1 << 7) + (1 << 4) + (1 << 3) + (1 << 2) == 256); -#ifdef __SUNPRO_CC +#if defined(__SUNPRO_CC) || defined(__xlC__) #pragma pack(8) -#else +#elif defined(__HP_aCC) +#pragma pack 8 +#elif !defined(lint) #pragma pack(push, 8) #endif const JSString::Data JSAtom::hundredStaticTable[] -#ifdef __GNUC__ +#if defined(__GNUC__) || defined(__xlC__) __attribute__ ((aligned (8))) #endif = { R7(100), /* 100 through 227 */ @@ -3414,9 +3436,11 @@ const JSString::Data *const JSAtom::intStaticTable[] = { R8(0) }; #undef R -#ifdef __SUNPRO_CC +#if defined(__SUNPRO_CC) #pragma pack(0) -#else +#elif defined(__HP_aCC) +#pragma pack +#elif !defined(lint) #pragma pack(pop) #endif From c7e1218869e106f52abb957aad8c3917d29490f7 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Wed, 20 Apr 2011 01:28:21 +0200 Subject: [PATCH 17/36] Bug 650987: Remove unused variable gOfflineCacheUpdateService from OfflineCacheUpdateParent.cpp and OfflineCacheUpdateChild.cpp. r=biesi --- uriloader/prefetch/OfflineCacheUpdateChild.cpp | 4 +--- uriloader/prefetch/OfflineCacheUpdateParent.cpp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/uriloader/prefetch/OfflineCacheUpdateChild.cpp b/uriloader/prefetch/OfflineCacheUpdateChild.cpp index b59575eab67..e68e8ae7c7f 100644 --- a/uriloader/prefetch/OfflineCacheUpdateChild.cpp +++ b/uriloader/prefetch/OfflineCacheUpdateChild.cpp @@ -62,8 +62,6 @@ #include "prlog.h" #include "nsIAsyncVerifyRedirectCallback.h" -static nsOfflineCacheUpdateService *gOfflineCacheUpdateService = nsnull; - #if defined(PR_LOGGING) // // To enable logging (see prlog.h for full details): @@ -528,4 +526,4 @@ OfflineCacheUpdateChild::RecvFinish(const bool &succeeded, } } -} \ No newline at end of file +} diff --git a/uriloader/prefetch/OfflineCacheUpdateParent.cpp b/uriloader/prefetch/OfflineCacheUpdateParent.cpp index c8dbd4320a3..29d21b1cf0a 100644 --- a/uriloader/prefetch/OfflineCacheUpdateParent.cpp +++ b/uriloader/prefetch/OfflineCacheUpdateParent.cpp @@ -40,8 +40,6 @@ #include "nsOfflineCacheUpdate.h" #include "nsIApplicationCache.h" -static nsOfflineCacheUpdateService *gOfflineCacheUpdateService = nsnull; - #if defined(PR_LOGGING) // // To enable logging (see prlog.h for full details): @@ -179,4 +177,4 @@ OfflineCacheUpdateParent::ApplicationCacheAvailable(nsIApplicationCache *aApplic } } // docshell -} // mozilla \ No newline at end of file +} // mozilla From ba9a18927d2d7ecd212425112ccacec1442ffe7c Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Wed, 20 Apr 2011 01:28:38 +0200 Subject: [PATCH 18/36] Bug 650871: Use unsigned int as loop counter in nsHttpConnectionMgr::OnMsgReclaimConnection, to fix GCC warning. r=biesi r=mcmanus --- netwerk/protocol/http/nsHttpConnectionMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index 773b4ddd792..35f741b8d55 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -1060,7 +1060,7 @@ nsHttpConnectionMgr::OnMsgReclaimConnection(PRInt32, void *param) // The linear search is ok here because the number of idleconns // in a single entry is generally limited to a small number (i.e. 6) - PRInt32 idx; + PRUint32 idx; for (idx = 0; idx < ent->mIdleConns.Length(); idx++) { nsHttpConnection *idleConn = ent->mIdleConns[idx]; if (idleConn->MaxBytesRead() < conn->MaxBytesRead()) From 4180bd56decef7523242ed115c2f9c5537721eab Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Wed, 20 Apr 2011 01:27:26 +0200 Subject: [PATCH 19/36] Bug 650742 - Define AVMPLUS_UNIX for OpenBSD. r=khuey --- js/src/configure.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/src/configure.in b/js/src/configure.in index 6b687809652..efb441b438a 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -2950,6 +2950,9 @@ case "$target" in *-freebsd*|*-kfreebsd*) AC_DEFINE(AVMPLUS_UNIX) ;; +*-openbsd*) + AC_DEFINE(AVMPLUS_UNIX) + ;; *-gnu*) AC_DEFINE(AVMPLUS_UNIX) ;; From d500e4028e07fa63f6af5690199da0914a04e01f Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Tue, 19 Apr 2011 18:54:02 +0200 Subject: [PATCH 20/36] Bug 648882 - TabPriorityQueue updates tabItems when UI is busy [f=raymond, r=ian] --- browser/base/content/tabview/tabitems.js | 8 +- browser/base/content/test/tabview/Makefile.in | 1 + .../test/tabview/browser_tabview_bug648882.js | 84 +++++++++++++++++++ 3 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 browser/base/content/test/tabview/browser_tabview_bug648882.js diff --git a/browser/base/content/tabview/tabitems.js b/browser/base/content/tabview/tabitems.js index ed53f449444..439c4d85dc2 100644 --- a/browser/base/content/tabview/tabitems.js +++ b/browser/base/content/tabview/tabitems.js @@ -1143,9 +1143,15 @@ let TabItems = { _checkHeartbeat: function TabItems__checkHeartbeat() { this._heartbeat = null; - if (this.isPaintingPaused() || !UI.isIdle) + if (this.isPaintingPaused()) return; + // restart the heartbeat to update all waiting tabs once the UI becomes idle + if (!UI.isIdle()) { + this.startHeartbeat(); + return; + } + let accumTime = 0; let items = this._tabsWaitingForUpdate.getItems(); // Do as many updates as we can fit into a "perceived" amount diff --git a/browser/base/content/test/tabview/Makefile.in b/browser/base/content/test/tabview/Makefile.in index 8b447d14f76..1318f50646d 100644 --- a/browser/base/content/test/tabview/Makefile.in +++ b/browser/base/content/test/tabview/Makefile.in @@ -130,6 +130,7 @@ _BROWSER_FILES = \ browser_tabview_bug641802.js \ browser_tabview_bug644097.js \ browser_tabview_bug645653.js \ + browser_tabview_bug648882.js \ browser_tabview_bug649006.js \ browser_tabview_dragdrop.js \ browser_tabview_exit_button.js \ diff --git a/browser/base/content/test/tabview/browser_tabview_bug648882.js b/browser/base/content/test/tabview/browser_tabview_bug648882.js new file mode 100644 index 00000000000..887abf93224 --- /dev/null +++ b/browser/base/content/test/tabview/browser_tabview_bug648882.js @@ -0,0 +1,84 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +function test() { + waitForExplicitFinish(); + + testHeartbeatAfterBusyUI(function () { + testTabUpdatesWithBusyUI(finish); + }); +} + +function testHeartbeatAfterBusyUI(callback) { + newWindowWithTabView(function (win) { + registerCleanupFunction(function () win.close()); + + let cw = win.TabView.getContentWindow(); + let tab = win.gBrowser.tabs[0]; + let tabItem = tab._tabViewTabItem; + + cw.TabItems.pausePainting(); + + tabItem.addSubscriber(tabItem, "updated", function () { + tabItem.removeSubscriber(tabItem, "updated"); + callback(); + }); + + cw.TabItems.update(tab); + + cw.UI.isIdle = function () { + cw.UI.isIdle = function () true; + return false; + } + + cw.TabItems.resumePainting(); + }); +} + +function testTabUpdatesWithBusyUI(callback) { + newWindowWithTabView(function (win) { + registerCleanupFunction(function () win.close()); + + let cw = win.TabView.getContentWindow(); + let tab = win.gBrowser.tabs[0]; + let tabItem = tab._tabViewTabItem; + let groupItem = cw.GroupItems.groupItems[0]; + let container = groupItem.container; + let resizer = groupItem.$resizer[0]; + + let intervalID; + let isIdle = false; + let numLoops = 10; + let interval = cw.UI._maxInteractiveWait / 2; + + let simulateBusyUI = function () { + let target = 5 < numLoops-- ? container : resizer; + + EventUtils.synthesizeMouse(target, 5, 5, {type: "mousedown"}, cw); + EventUtils.synthesizeMouse(target, 40, 20, {type: "mousemove"}, cw); + EventUtils.synthesizeMouse(target, 20, 20, {type: "mouseup"}, cw); + + win.setTimeout(function () { + if (numLoops) + simulateBusyUI(); + else + isIdle = true; + }, interval); + }; + + SimpleTest.waitForFocus(function () { + cw.TabItems.pausePainting(); + cw.TabItems.update(tab); + + tabItem.addSubscriber(tabItem, "updated", function () { + tabItem.removeSubscriber(tabItem, "updated"); + ok(isIdle, "tabItem is updated only when UI is idle"); + callback(); + }); + + simulateBusyUI(); + win.setTimeout(simulateBusyUI, interval); + cw.TabItems.resumePainting(); + }, cw); + }); +} From 7b7d89e131151c26f7bf1c786a8586c4e36aec3a Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Wed, 20 Apr 2011 10:35:50 +1200 Subject: [PATCH 21/36] Bug 645268 - Try to fix randomly failing browser_webconsole_bug_595934_message_categories.js by properly capturing a variable value in a closure r=ehsan --- .../browser_webconsole_bug_595934_message_categories.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_595934_message_categories.js b/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_595934_message_categories.js index d0e7173009f..32b0d4742e4 100644 --- a/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_595934_message_categories.js +++ b/toolkit/components/console/hudservice/tests/browser/browser_webconsole_bug_595934_message_categories.js @@ -157,9 +157,10 @@ function testNext() { pos++; if (pos < TESTS.length) { if (TESTS[pos].onload) { + let position = pos; browser.addEventListener("load", function(aEvent) { browser.removeEventListener(aEvent.type, arguments.callee, true); - TESTS[pos].onload(aEvent); + TESTS[position].onload(aEvent); }, true); } From 18ba9d8c47e997d71e63bd823da345e4adc1a6e5 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 19 Apr 2011 19:31:41 -0400 Subject: [PATCH 22/36] Bug 625222 - Disable test_chromeWorkerJSM.xul because the code in question has problems, and is being rewritten DONTBUILD --- dom/src/threads/test/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/src/threads/test/Makefile.in b/dom/src/threads/test/Makefile.in index e2311aa4d71..c139fb90be7 100644 --- a/dom/src/threads/test/Makefile.in +++ b/dom/src/threads/test/Makefile.in @@ -131,7 +131,7 @@ _SUBDIR_TEST_FILES = \ _CHROME_TEST_FILES = \ test_chromeWorker.xul \ test_chromeWorkerComponent.xul \ - test_chromeWorkerJSM.xul \ + $(warning test_chromeWorkerJSM.xul disabled because the respective code has major problems and is being rewritten, see bug 625222) \ chromeWorker_worker.js \ chromeWorker_subworker.js \ $(NULL) From 6886b301c0e17ae5efdcafe44bb7d8862cd7651a Mon Sep 17 00:00:00 2001 From: Mark Finkle Date: Tue, 19 Apr 2011 19:38:55 -0400 Subject: [PATCH 23/36] Bug 650676 - browser_autocompletesearch.js throws getting ProfD, then times out, on Android (more fixes) [r=vingtetun] --- mobile/chrome/tests/browser_autocompletesearch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/chrome/tests/browser_autocompletesearch.js b/mobile/chrome/tests/browser_autocompletesearch.js index a16016a5ad0..e7129eafe8e 100644 --- a/mobile/chrome/tests/browser_autocompletesearch.js +++ b/mobile/chrome/tests/browser_autocompletesearch.js @@ -56,7 +56,7 @@ function saveMockCache() { let fileName = fileHandler.getFileFromURLSpec(mockCacheURI.JARFile.spec); zReader.open(fileName); - let extract = mockCacheURI.JARFile.spec.split("!")[1]; + let extract = mockCacheURI.spec.split("!")[1]; extract = extract.substring(1, extract.lastIndexOf("/") + 1); extract += "mock_autocomplete.json"; info("extract path: " + extract); From ff19a13fe9e96e9fc40e3beaaa3ce6834b24beea Mon Sep 17 00:00:00 2001 From: Chris Pearce Date: Wed, 20 Apr 2011 13:16:40 +1200 Subject: [PATCH 24/36] Bug 593305 - Don't assert that media load isn't delaying the document load event at start of resource load. r=roc --- content/html/content/src/nsHTMLMediaElement.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/content/html/content/src/nsHTMLMediaElement.cpp b/content/html/content/src/nsHTMLMediaElement.cpp index 4f257d55dc6..81b302c1473 100644 --- a/content/html/content/src/nsHTMLMediaElement.cpp +++ b/content/html/content/src/nsHTMLMediaElement.cpp @@ -629,8 +629,6 @@ static PRBool HasPotentialResource(nsIContent *aElement) void nsHTMLMediaElement::SelectResource() { - NS_ASSERTION(!mDelayingLoadEvent, - "Load event should not be delayed at start of resource selection."); if (!HasPotentialResource(this)) { // The media element has neither a src attribute nor any source // element children, abort the load. From c0000045de16ca9a978e1f2959f3755e7a7261dc Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Wed, 20 Apr 2011 14:05:29 +1200 Subject: [PATCH 25/36] Bug 651036 - SMIL: Make discrete to-animations behave consistently with discrete from-to animations r=dholbert --- content/smil/nsSMILAnimationFunction.cpp | 45 ++++++++++--------- content/smil/test/test_smilKeyTimes.xhtml | 30 ++++++++----- .../reftests/svg/smil/anim-discrete-to-1.svg | 4 +- .../reftests/svg/smil/anim-discrete-to-2.svg | 4 +- .../svg/smil/anim-feFuncR-tableValues-01.svg | 4 +- .../svg/smil/anim-fill-overpaintserver-2.svg | 10 +++-- .../svg/smil/anim-indefinite-to-2.svg | 8 ++-- .../svg/smil/anim-indefinite-to-3.svg | 6 +-- layout/reftests/svg/smil/anim-path-d-01.svg | 2 +- .../svg/smil/anim-polygon-points-01.svg | 2 +- .../svg/smil/anim-polyline-points-01.svg | 2 +- .../reftests/svg/smil/anim-text-rotate-01.svg | 4 +- 12 files changed, 68 insertions(+), 53 deletions(-) diff --git a/content/smil/nsSMILAnimationFunction.cpp b/content/smil/nsSMILAnimationFunction.cpp index 23b05a3f3c2..7183731a675 100644 --- a/content/smil/nsSMILAnimationFunction.cpp +++ b/content/smil/nsSMILAnimationFunction.cpp @@ -395,6 +395,10 @@ nsSMILAnimationFunction::InterpolateResult(const nsSMILValueArray& aValues, return NS_ERROR_FAILURE; } + if (IsToAnimation() && aBaseValue.IsNull()) { + return NS_ERROR_FAILURE; + } + // Get the normalised progress through the simple duration. // // If we have an indefinite simple duration, just set the progress to be @@ -428,19 +432,15 @@ nsSMILAnimationFunction::InterpolateResult(const nsSMILValueArray& aValues, // NS_ABORT_IF_FALSE that tests that intervalProgress is in range will fail. double intervalProgress = -1.f; if (IsToAnimation()) { - if (aBaseValue.IsNull()) { - rv = NS_ERROR_FAILURE; + from = &aBaseValue; + to = &aValues[0]; + if (calcMode == CALC_PACED) { + // Note: key[Times/Splines/Points] are ignored for calcMode="paced" + intervalProgress = simpleProgress; } else { - from = &aBaseValue; - to = &aValues[0]; - if (calcMode == CALC_PACED) { - // Note: key[Times/Splines/Points] are ignored for calcMode="paced" - intervalProgress = simpleProgress; - } else { - double scaledSimpleProgress = - ScaleSimpleProgress(simpleProgress, calcMode); - intervalProgress = ScaleIntervalProgress(scaledSimpleProgress, 0); - } + double scaledSimpleProgress = + ScaleSimpleProgress(simpleProgress, calcMode); + intervalProgress = ScaleIntervalProgress(scaledSimpleProgress, 0); } } else if (calcMode == CALC_PACED) { rv = ComputePacedPosition(aValues, simpleProgress, @@ -474,13 +474,16 @@ nsSMILAnimationFunction::InterpolateResult(const nsSMILValueArray& aValues, // Note: If interpolation failed (isn't supported for this type), the SVG // spec says to force discrete mode. if (calcMode == CALC_DISCRETE || NS_FAILED(rv)) { + double scaledSimpleProgress = + ScaleSimpleProgress(simpleProgress, CALC_DISCRETE); if (IsToAnimation()) { - // SMIL 3, 12.6.4: Since a to animation has only 1 value, a discrete to - // animation will simply set the to value for the simple duration. - aResult = aValues[0]; + // We don't follow SMIL 3, 12.6.4, where discrete to animations + // are the same as animations. Instead, we treat it as a + // discrete animation with two values (the underlying value and + // the to="" value), and honor keyTimes="" as well. + PRUint32 index = (PRUint32)floor(scaledSimpleProgress * 2); + aResult = index == 0 ? aBaseValue : aValues[0]; } else { - double scaledSimpleProgress = - ScaleSimpleProgress(simpleProgress, CALC_DISCRETE); PRUint32 index = (PRUint32)floor(scaledSimpleProgress * aValues.Length()); aResult = aValues[index]; } @@ -865,11 +868,9 @@ nsSMILAnimationFunction::CheckKeyTimes(PRUint32 aNumValues) } // no. keyTimes == no. values - // For to-animation the number of values is considered to be 2 unless it's - // discrete to-animation in which case either 1 or 2 is acceptable. - PRBool matchingNumOfValues = IsToAnimation() ? - calcMode == CALC_DISCRETE ? numKeyTimes <= 2 : numKeyTimes == 2 : - numKeyTimes == aNumValues; + // For to-animation the number of values is considered to be 2. + PRBool matchingNumOfValues = + numKeyTimes == (IsToAnimation() ? 2 : aNumValues); if (!matchingNumOfValues) { SetKeyTimesErrorFlag(PR_TRUE); return; diff --git a/content/smil/test/test_smilKeyTimes.xhtml b/content/smil/test/test_smilKeyTimes.xhtml index 8130d91205b..9dace99cc9c 100644 --- a/content/smil/test/test_smilKeyTimes.xhtml +++ b/content/smil/test/test_smilKeyTimes.xhtml @@ -152,26 +152,36 @@ function main() 'times': [ [ 2, -100 ] ] }); - // to calcMode=discrete two keyTimes - // (technically, for discrete to-animation there is only ONE animation value - // but we allow two keyTimes to be specified since they're not going to have - // any effect anyway and this part of the spec is somewhat counter-intuitive. - // See bug 544855) + // unfrozen to calcMode=discrete two keyTimes + testCases.push({ + 'attr' : { 'to': '100', + 'calcMode': 'discrete', + 'keyTimes': '0.0; 1.0', + 'fill': 'remove' }, + 'times': [ [ 0, -100 ], + [ 7, -100 ], + [ 10, -100 ], + [ 12, -100 ]] + }); + + // frozen to calcMode=discrete two keyTimes testCases.push({ 'attr' : { 'to': '100', 'calcMode': 'discrete', 'keyTimes': '0.0; 1.0' }, - 'times': [ [ 0, 100 ], - [ 7, 100 ] ] + 'times': [ [ 0, -100 ], + [ 7, -100 ], + [ 10, 100 ], + [ 12, 100 ] ] }); - // to calcMode=discrete one keyTime + // to calcMode=discrete -- bad number of keyTimes (one, expecting two) testCases.push({ 'attr' : { 'to': '100', 'calcMode': 'discrete', 'keyTimes': '0' }, - 'times': [ [ 0, 100 ], - [ 7, 100 ] ] + 'times': [ [ 0, -100 ], + [ 7, -100 ] ] }); // values calcMode=discrete diff --git a/layout/reftests/svg/smil/anim-discrete-to-1.svg b/layout/reftests/svg/smil/anim-discrete-to-1.svg index 29f8b34a947..41a078764c3 100644 --- a/layout/reftests/svg/smil/anim-discrete-to-1.svg +++ b/layout/reftests/svg/smil/anim-discrete-to-1.svg @@ -3,8 +3,8 @@ class="reftest-wait" onload="setTimeAndSnapshot(0.0, true)"> From 1cbc3af87ed0c7c9ed73f0dcacad79da32d8e87e Mon Sep 17 00:00:00 2001 From: Mounir Lamouri Date: Wed, 20 Apr 2011 11:45:54 +0200 Subject: [PATCH 29/36] Bug 651077 - Make content/html/content/test/test_bug209275.xhtml and content/html/content/test/test_bug481335.xhtml non flaky. r=ehsan --- content/html/content/test/test_bug209275.xhtml | 4 ++-- content/html/content/test/test_bug481335.xhtml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/content/html/content/test/test_bug209275.xhtml b/content/html/content/test/test_bug209275.xhtml index ef53e897bf6..19e43cbbef0 100644 --- a/content/html/content/test/test_bug209275.xhtml +++ b/content/html/content/test/test_bug209275.xhtml @@ -153,13 +153,13 @@ function run() { // Because link coloring is asynchronous, we wait until it is updated (or we // timeout and fail anyway). while (getColor($('colorlink')) != visitedColor) { - setTimeout(continueTest, 10); + setTimeout(continueTest, 0); yield; } is(getColor($('colorlink')), visitedColor, "Wrong link color after base change."); while (getFill($('ellipselink')) != visitedFill) { - setTimeout(continueTest, 10); + setTimeout(continueTest, 0); yield; } is(getFill($('ellipselink')), visitedFill, diff --git a/content/html/content/test/test_bug481335.xhtml b/content/html/content/test/test_bug481335.xhtml index 525ff0e11e5..f121f698125 100644 --- a/content/html/content/test/test_bug481335.xhtml +++ b/content/html/content/test/test_bug481335.xhtml @@ -59,7 +59,7 @@ function checkLinkColor(aElmId, aExpectedColor, aMessage) { return utils.getVisitedDependentComputedStyle($(aElmId), "", "color"); } while (getColor() != aExpectedColor) { - setTimeout(continueTest, 10); + setTimeout(continueTest, 0); return false; } is(getColor(), aExpectedColor, aMessage); From 6850212a482bcf944d547bb94618c6306f950e4c Mon Sep 17 00:00:00 2001 From: Mounir Lamouri Date: Wed, 20 Apr 2011 11:46:16 +0200 Subject: [PATCH 30/36] Bug 651089 - Make content/events/test/test_bug534833.html non flaky. r=ehsan --- content/events/test/test_bug534833.html | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/content/events/test/test_bug534833.html b/content/events/test/test_bug534833.html index fd995b4d5c4..0b5bbeec22b 100644 --- a/content/events/test/test_bug534833.html +++ b/content/events/test/test_bug534833.html @@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=534833 - + Mozilla Bug 534833