Merge mozilla-central and tracemonkey. (a=blockers)

This commit is contained in:
Chris Leary 2011-02-17 15:30:14 -08:00
commit e5a463842a
24 changed files with 339 additions and 312 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -21,14 +21,24 @@ const CHROMEROOT = croot;
var gApp = document.getElementById("bundle_brand").getString("brandShortName");
var gVersion = Services.appinfo.version;
var check_notification;
function wait_for_notification(aCallback) {
info("Waiting for notification");
PopupNotifications.panel.addEventListener("popupshown", function() {
PopupNotifications.panel.removeEventListener("popupshown", arguments.callee, false);
check_notification = function() {
PopupNotifications.panel.removeEventListener("popupshown", check_notification, false);
info("Saw notification");
is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
aCallback(PopupNotifications.panel);
};
PopupNotifications.panel.addEventListener("popupshown", check_notification, false);
}
function wait_for_notification_close(aCallback) {
info("Waiting for notification to close");
PopupNotifications.panel.addEventListener("popuphidden", function() {
PopupNotifications.panel.removeEventListener("popuphidden", arguments.callee, false);
aCallback();
}, false);
}
@ -84,25 +94,27 @@ function test_disabled_install() {
is(notification.getAttribute("label"),
"Software installation is currently disabled. Click Enable and try again.");
wait_for_notification_close(function() {
try {
Services.prefs.getBoolPref("xpinstall.disabled");
ok(false, "xpinstall.disabled should not be set");
}
catch (e) {
ok(true, "xpinstall.disabled should not be set");
}
gBrowser.removeTab(gBrowser.selectedTab);
AddonManager.getAllInstalls(function(aInstalls) {
is(aInstalls.length, 1, "Should have been one install created");
aInstalls[0].cancel();
runNextTest();
});
});
// Click on Enable
EventUtils.synthesizeMouseAtCenter(notification.button, {});
try {
Services.prefs.getBoolPref("xpinstall.disabled");
ok(false, "xpinstall.disabled should not be set");
}
catch (e) {
ok(true, "xpinstall.disabled should not be set");
}
gBrowser.removeTab(gBrowser.selectedTab);
AddonManager.getAllInstalls(function(aInstalls) {
is(aInstalls.length, 1, "Should have been one install created");
aInstalls[0].cancel();
runNextTest();
});
});
var triggers = encodeURIComponent(JSON.stringify({
@ -138,8 +150,8 @@ function test_blocked_install() {
is(aInstalls.length, 1, "Should be one pending install");
aInstalls[0].cancel();
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
runNextTest();
});
});
@ -184,9 +196,9 @@ function test_whitelisted_install() {
is(aInstalls.length, 1, "Should be one pending install");
aInstalls[0].cancel();
gBrowser.removeTab(gBrowser.selectedTab);
Services.perms.remove("example.com", "install");
runNextTest();
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
});
});
@ -219,9 +231,9 @@ function test_failed_download() {
"on example.com.",
"Should have seen the right message");
gBrowser.removeTab(gBrowser.selectedTab);
Services.perms.remove("example.com", "install");
runNextTest();
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
});
});
@ -250,9 +262,9 @@ function test_corrupt_file() {
"because it appears to be corrupt.",
"Should have seen the right message");
gBrowser.removeTab(gBrowser.selectedTab);
Services.perms.remove("example.com", "install");
runNextTest();
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
});
});
@ -281,9 +293,9 @@ function test_incompatible() {
gApp + " " + gVersion + ".",
"Should have seen the right message");
gBrowser.removeTab(gBrowser.selectedTab);
Services.perms.remove("example.com", "install");
runNextTest();
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
});
});
@ -320,9 +332,9 @@ function test_restartless() {
AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(aAddon) {
aAddon.uninstall();
gBrowser.removeTab(gBrowser.selectedTab);
Services.perms.remove("example.com", "install");
runNextTest();
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
});
});
});
@ -365,9 +377,9 @@ function test_multiple() {
AddonManager.getAddonByID("restartless-xpi@tests.mozilla.org", function(aAddon) {
aAddon.uninstall();
gBrowser.removeTab(gBrowser.selectedTab);
Services.perms.remove("example.com", "install");
runNextTest();
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
});
});
});
@ -408,8 +420,8 @@ function test_url() {
is(aInstalls.length, 1, "Should be one pending install");
aInstalls[0].cancel();
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
runNextTest();
});
});
@ -422,17 +434,22 @@ function test_url() {
},
function test_localfile() {
// Wait for the complete notification
wait_for_notification(function(aPanel) {
let notification = aPanel.childNodes[0];
is(notification.id, "addon-install-failed-notification", "Should have seen the install fail");
is(notification.getAttribute("label"),
"This add-on could not be installed because it appears to be corrupt.",
"Should have seen the right message");
// Wait for the install to fail
Services.obs.addObserver(function() {
Services.obs.removeObserver(arguments.callee, "addon-install-failed");
gBrowser.removeTab(gBrowser.selectedTab);
runNextTest();
});
// Wait for the browser code to add the failure notification
executeSoon(function() {
let notification = PopupNotifications.panel.childNodes[0];
is(notification.id, "addon-install-failed-notification", "Should have seen the install fail");
is(notification.getAttribute("label"),
"This add-on could not be installed because it appears to be corrupt.",
"Should have seen the right message");
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
});
}, "addon-install-failed", false);
var cr = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
.getService(Components.interfaces.nsIChromeRegistry);
@ -466,8 +483,8 @@ function test_wronghost() {
"because it appears to be corrupt.",
"Should have seen the right message");
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
runNextTest();
});
});
@ -511,9 +528,9 @@ function test_reload() {
is(aInstalls.length, 1, "Should be one pending install");
aInstalls[0].cancel();
gBrowser.removeTab(gBrowser.selectedTab);
Services.perms.remove("example.com", "install");
runNextTest();
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
});
}, true);
gBrowser.loadURI(TESTROOT2 + "enabled.html");
@ -550,9 +567,6 @@ function test_theme() {
"Theme Test will be installed after you restart " + gApp + ".",
"Should have seen the right message");
gBrowser.removeTab(gBrowser.selectedTab);
Services.perms.remove("example.com", "install");
AddonManager.getAddonByID("{972ce4c6-7e08-4474-a285-3208198ce6fd}", function(aAddon) {
ok(aAddon.userDisabled, "Should be switching away from the default theme.");
// Undo the pending theme switch
@ -563,7 +577,8 @@ function test_theme() {
aAddon.uninstall();
Services.perms.remove("example.com", "install");
runNextTest();
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
});
});
});
@ -588,8 +603,7 @@ function test_renotify_blocked() {
let notification = aPanel.childNodes[0];
is(notification.id, "addon-install-blocked-notification", "Should have seen the install blocked");
aPanel.addEventListener("popuphidden", function () {
aPanel.removeEventListener("popuphidden", arguments.callee, false);
wait_for_notification_close(function () {
info("Timeouts after this probably mean bug 589954 regressed");
executeSoon(function () {
wait_for_notification(function(aPanel) {
@ -603,14 +617,14 @@ function test_renotify_blocked() {
aInstalls[1].cancel();
info("Closing browser tab");
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
runNextTest();
});
});
gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
});
}, false);
});
// hide the panel (this simulates the user dismissing it)
aPanel.hidePopup();
@ -637,9 +651,7 @@ function test_renotify_installed() {
is(notification.id, "addon-install-complete-notification", "Should have seen the install complete");
// Dismiss the notification
aPanel.addEventListener("popuphidden", function () {
aPanel.removeEventListener("popuphidden", arguments.callee, false);
wait_for_notification_close(function () {
// Install another
executeSoon(function () {
// Wait for the progress notification
@ -660,9 +672,9 @@ function test_renotify_installed() {
is(aInstalls.length, 1, "Should be one pending installs");
aInstalls[0].cancel();
gBrowser.removeTab(gBrowser.selectedTab);
Services.perms.remove("example.com", "install");
runNextTest();
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
});
});
@ -672,7 +684,7 @@ function test_renotify_installed() {
gBrowser.loadURI(TESTROOT + "installtrigger.html?" + triggers);
});
}, false);
});
// hide the panel (this simulates the user dismissing it)
aPanel.hidePopup();
@ -735,9 +747,9 @@ function test_cancel_restart() {
is(aInstalls.length, 1, "Should be one pending install");
aInstalls[0].cancel();
gBrowser.removeTab(gBrowser.selectedTab);
Services.perms.remove("example.com", "install");
runNextTest();
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
});
});
@ -791,20 +803,26 @@ function test_failed_security() {
Services.obs.addObserver(function() {
Services.obs.removeObserver(arguments.callee, "addon-install-failed");
// Wait for the browser code to add the failure notification
executeSoon(function() {
// Wait for the progress notification to dismiss itself
executeSoon(function() {
ok(PopupNotifications.isPanelOpen, "Notification should still be open");
is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
notification = aPanel.childNodes[0];
is(notification.id, "addon-install-failed-notification", "Should have seen the install fail");
function waitForSingleNotification() {
// Notification should never close while we wait
ok(PopupNotifications.isPanelOpen, "Notification should still be open");
if (PopupNotifications.panel.childNodes.length == 2) {
executeSoon(waitForSingleNotification);
return;
}
gBrowser.removeTab(gBrowser.selectedTab);
Services.prefs.setBoolPref(PREF_INSTALL_REQUIREBUILTINCERTS, true);
runNextTest();
});
});
is(PopupNotifications.panel.childNodes.length, 1, "Should be only one notification");
notification = aPanel.childNodes[0];
is(notification.id, "addon-install-failed-notification", "Should have seen the install fail");
Services.prefs.setBoolPref(PREF_INSTALL_REQUIREBUILTINCERTS, true);
wait_for_notification_close(runNextTest);
gBrowser.removeTab(gBrowser.selectedTab);
}
// Allow the browser code to add the failure notification and then wait
// for the progress notification to dismiss itself
executeSoon(waitForSingleNotification);
}, "addon-install-failed", false);
});
@ -822,6 +840,8 @@ function runNextTest() {
if (gTestStart)
info("Test part took " + (Date.now() - gTestStart) + "ms");
ok(!PopupNotifications.isPanelOpen, "Notification should be closed");
AddonManager.getAllInstalls(function(aInstalls) {
is(aInstalls.length, 0, "Should be no active installs");
@ -860,6 +880,7 @@ function test() {
registerCleanupFunction(function() {
// Make sure no more test parts run in case we were timed out
TESTS = [];
PopupNotifications.panel.removeEventListener("popupshown", check_notification, false);
AddonManager.getAllInstalls(function(aInstalls) {
aInstalls.forEach(function(aInstall) {

View File

@ -72,7 +72,8 @@
border-bottom: 1px solid ThreeDShadow;
}
#navigator-toolbox > toolbar:not(:-moz-lwtheme):not(#toolbar-menubar) {
#navigator-toolbox[tabsontop=true] > toolbar:not(:-moz-lwtheme):not(#toolbar-menubar):not(#TabsToolbar),
#navigator-toolbox[tabsontop=false] > toolbar:not(:-moz-lwtheme):not(#toolbar-menubar) {
-moz-appearance: none;
border-style: none;
background-color: -moz-Dialog;
@ -1380,7 +1381,11 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
padding: 0;
}
#TabsToolbar:not(:-moz-lwtheme),
#TabsToolbar[tabsontop=true]:not(:-moz-lwtheme) {
-moz-appearance: menubar;
color: -moz-menubartext;
}
#TabsToolbar[tabsontop=false] {
background-image:
-moz-linear-gradient(bottom, rgba(0,0,0,.3) 1px, rgba(0,0,0,.05) 1px, transparent 50%);
@ -1395,6 +1400,7 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
background-position: 1px 2px;
background-size: 100% -moz-calc(100% - 2px);
background-repeat: no-repeat;
color: inherit;
margin: 0;
padding: 0;
-moz-border-image: url(tabbrowser/tab.png) 4 5 3 6 / 4px 5px 3px 6px repeat stretch;
@ -1410,6 +1416,7 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
.tabbrowser-tab[selected="true"] {
background-image: -moz-linear-gradient(@selectedTabHighlight@, @toolbarHighlight@ 32%),
-moz-linear-gradient(-moz-dialog, -moz-dialog);
color: -moz-dialogtext;
}
#main-window[tabsontop=false]:not([disablechrome]) .tabbrowser-tab[selected=true]:not(:-moz-lwtheme) {
@ -1418,12 +1425,9 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
-moz-linear-gradient(-moz-dialog, -moz-dialog);
}
.tabbrowser-tab:-moz-lwtheme {
color: inherit;
}
.tabbrowser-tab[selected="true"]:-moz-lwtheme {
background-image: -moz-linear-gradient(@selectedTabHighlight@, @toolbarHighlight@ 32%);
color: inherit;
}
.tabbrowser-tab:-moz-lwtheme-brighttext:not([selected="true"]),
@ -1728,6 +1732,10 @@ toolbar[mode="text"] toolbarbutton.chevron > .toolbarbutton-icon {
-moz-margin-end: 1px;
}
#appmenu-toolbar-button:not(:hover):not([open]):not(:-moz-lwtheme) {
color: inherit;
}
#appmenu-toolbar-button > .toolbarbutton-text,
#appmenu-toolbar-button > .toolbarbutton-menu-dropmarker {
margin-top: -2px !important;

View File

@ -182,7 +182,6 @@
}
#navigator-toolbox[tabsontop=false] > #PersonalToolbar {
padding-top: 0 !important;
margin-top: 2px;
border-top: 1px solid @toolbarShadowColor@;
}

View File

@ -115,12 +115,6 @@
}
%endif
#navigator-toolbox[iconsize="small"] > #nav-bar,
#navigator-toolbox > toolbar:not(#nav-bar):not(#toolbar-menubar):not(#TabsToolbar)[iconsize="small"] {
padding-top: 1px;
padding-bottom: 1px;
}
#navigator-toolbox[tabsontop="true"] > #nav-bar,
#navigator-toolbox[tabsontop="true"]:not([customizing]) > #nav-bar[collapsed="true"] + toolbar,
#navigator-toolbox[tabsontop="true"]:not([customizing]) > #nav-bar[collapsed="true"] + #customToolbars + #PersonalToolbar {
@ -589,6 +583,16 @@ menuitem.bookmark-item {
counter-reset: smallicons;
}
#navigator-toolbox[iconsize=small] > #nav-bar {
padding-top: 1px;
padding-bottom: 1px;
}
#navigator-toolbox[iconsize=large][mode=icons] > #nav-bar {
padding-left: 2px;
padding-right: 2px;
}
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button,
#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker,
#nav-bar .toolbarbutton-1 {

View File

@ -55,6 +55,7 @@
#include "nsHashKeys.h"
#include "nsNodeInfoManager.h"
#include "nsIStreamListener.h"
#include "nsIVariant.h"
#include "nsIObserver.h"
#include "nsGkAtoms.h"
#include "nsAutoPtr.h"
@ -1422,26 +1423,13 @@ public:
Doc_Theme_Bright
};
/**
* Returns the document's pending state object (serialized to JSON), or the
* empty string if one doesn't exist.
*
* This field serves as a waiting place for the history entry's state object:
* We set the field's value to the history entry's state object early on in
* the load, then after we fire onload we deserialize the field's value and
* fire a popstate event containing the resulting object.
*/
nsAString& GetPendingStateObject()
{
return mPendingStateObject;
}
/**
* Set the document's pending state object (as serialized to JSON).
*/
void SetPendingStateObject(nsAString &obj)
void SetCurrentStateObject(nsAString &obj)
{
mPendingStateObject.Assign(obj);
mCurrentStateObject.Assign(obj);
mCurrentStateObjectCached = nsnull;
}
/**
@ -1736,7 +1724,7 @@ protected:
*/
PRUint32 mExternalScriptsBeingEvaluated;
nsString mPendingStateObject;
nsString mCurrentStateObject;
// Weak reference to mScriptGlobalObject QI:d to nsPIDOMWindow,
// updated on every set of mSecriptGlobalObject.
@ -1752,6 +1740,8 @@ protected:
// Our base target.
nsString mBaseTarget;
nsCOMPtr<nsIVariant> mCurrentStateObjectCached;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocument, NS_IDOCUMENT_IID)

View File

@ -104,6 +104,7 @@
#include "nsDOMError.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsIJSON.h"
#include "nsThreadUtils.h"
#include "nsNodeInfoManager.h"
#include "nsIXBLService.h"
@ -1726,6 +1727,7 @@ NS_INTERFACE_TABLE_HEAD(nsDocument)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIRadioGroupContainer)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIMutationObserver)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIApplicationCacheContainer)
NS_INTERFACE_TABLE_ENTRY(nsDocument, nsIDOMNSDocument_MOZILLA_2_0_BRANCH)
NS_OFFSET_AND_INTERFACE_TABLE_END
NS_OFFSET_AND_INTERFACE_TABLE_TO_MAP_SEGUE
NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(nsDocument)
@ -1905,6 +1907,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mDOMImplementation)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mOriginalDocument)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mCachedEncoder)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mCurrentStateObjectCached)
// Traverse all our nsCOMArrays.
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(mStyleSheets)
@ -8122,6 +8125,52 @@ nsIDocument::ScheduleBeforePaintEvent(nsIAnimationFrameListener* aListener)
}
NS_IMETHODIMP
nsDocument::GetMozCurrentStateObject(nsIVariant** aState)
{
// Get the document's current state object. This is the object returned form
// both document.mozCurrentStateObject as well as popStateEvent.state
nsCOMPtr<nsIVariant> stateObj;
// Parse the JSON, if there's any to parse.
if (!mCurrentStateObjectCached && !mCurrentStateObject.IsEmpty()) {
// Get the JSContext associated with this document. We need this for
// deserialization.
nsIScriptGlobalObject *sgo = GetScopeObject();
NS_ENSURE_TRUE(sgo, NS_ERROR_FAILURE);
nsIScriptContext *scx = sgo->GetContext();
NS_ENSURE_TRUE(scx, NS_ERROR_FAILURE);
JSContext *cx = (JSContext*) scx->GetNativeContext();
// Make sure we in the request while we have jsval on the native stack.
JSAutoRequest ar(cx);
// If our json call triggers a JS-to-C++ call, we want that call to use cx
// as the context. So we push cx onto the context stack.
nsCxPusher cxPusher;
jsval jsStateObj = JSVAL_NULL;
// Deserialize the state object into an nsIVariant.
nsCOMPtr<nsIJSON> json = do_GetService("@mozilla.org/dom/json;1");
NS_ENSURE_TRUE(cxPusher.Push(cx), NS_ERROR_FAILURE);
nsresult rv = json->DecodeToJSVal(mCurrentStateObject, cx, &jsStateObj);
NS_ENSURE_SUCCESS(rv, rv);
cxPusher.Pop();
nsCOMPtr<nsIXPConnect> xpconnect = do_GetService(nsIXPConnect::GetCID());
NS_ENSURE_TRUE(xpconnect, NS_ERROR_FAILURE);
rv = xpconnect->JSValToVariant(cx, &jsStateObj, getter_AddRefs(mCurrentStateObjectCached));
NS_ENSURE_SUCCESS(rv, rv);
}
NS_IF_ADDREF(*aState = mCurrentStateObjectCached);
return NS_OK;
}
nsresult
nsDocument::AddImage(imgIRequest* aImage)
{

View File

@ -517,7 +517,8 @@ class nsDocument : public nsIDocument,
public nsIScriptObjectPrincipal,
public nsIRadioGroupContainer,
public nsIApplicationCacheContainer,
public nsStubMutationObserver
public nsStubMutationObserver,
public nsIDOMNSDocument_MOZILLA_2_0_BRANCH
{
public:
typedef mozilla::dom::Element Element;
@ -808,6 +809,7 @@ public:
// nsIDOMNSDocument
NS_DECL_NSIDOMNSDOCUMENT
NS_DECL_NSIDOMNSDOCUMENT_MOZILLA_2_0_BRANCH
// nsIDOMDocumentEvent
NS_DECL_NSIDOMDOCUMENTEVENT

View File

@ -22,8 +22,7 @@ function init()
}
description('Verify texImage2D and texSubImage2D code paths taking Video Elements');
dump('Verify texImage2D and texSubImage2D code paths taking Video Elements\n');
var canvas = document.getElementById("example");
gl = wtu.create3DContext(canvas);
var program = wtu.setupTexturedQuad(gl);
@ -49,8 +48,6 @@ function runOneIteration(videoElement, useTexSubImage2D, flipY, topColor, bottom
{
debug('Testing ' + (useTexSubImage2D ? 'texSubImage2D' : 'texImage2D') +
' with flipY=' + flipY);
dump('Testing ' + (useTexSubImage2D ? 'texSubImage2D' : 'texImage2D') +
' with flipY=' + flipY + '\n');
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
// Disable any writes to the alpha channel
gl.colorMask(1, 1, 1, 0);

View File

@ -6074,7 +6074,7 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress,
if (!mEODForCurrentDocument && mContentViewer) {
// Set the pending state object which will be returned to the page in
// the popstate event.
SetDocPendingStateObj(mLSHE);
SetDocCurrentStateObj(mLSHE);
mIsExecutingOnLoadHandler = PR_TRUE;
rv = mContentViewer->LoadComplete(aStatus);
@ -7766,7 +7766,7 @@ nsDocShell::SetupNewViewer(nsIContentViewer * aNewViewer)
}
nsresult
nsDocShell::SetDocPendingStateObj(nsISHEntry *shEntry)
nsDocShell::SetDocCurrentStateObj(nsISHEntry *shEntry)
{
nsresult rv;
@ -7782,7 +7782,7 @@ nsDocShell::SetDocPendingStateObj(nsISHEntry *shEntry)
// empty string.
}
document->SetPendingStateObject(stateData);
document->SetCurrentStateObject(stateData);
return NS_OK;
}
@ -8432,7 +8432,7 @@ nsDocShell::InternalLoad(nsIURI * aURI,
doc->SetDocumentURI(newURI);
}
SetDocPendingStateObj(mOSHE);
SetDocCurrentStateObj(mOSHE);
// Dispatch the popstate and hashchange events, as appropriate.
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(mScriptGlobal);

View File

@ -564,10 +564,10 @@ protected:
nsIChannel * aChannel,
nsresult aResult);
// Sets the current document's pending state object to the given SHEntry's
// state object. The pending state object is eventually given to the page
// Sets the current document's current state object to the given SHEntry's
// state object. The current state object is eventually given to the page
// in the PopState event.
nsresult SetDocPendingStateObj(nsISHEntry *shEntry);
nsresult SetDocCurrentStateObj(nsISHEntry *shEntry);
nsresult CheckLoadingPermissions();

View File

@ -2193,7 +2193,8 @@ nsDOMClassInfo::WrapNativeParent(JSContext *cx, JSObject *scope,
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Document) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXPathEvaluator) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeSelector)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeSelector) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSDocument_MOZILLA_2_0_BRANCH)
#define DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES \
@ -2496,7 +2497,7 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(PopStateEvent, nsIDOMPopStateEvent_MOZILLA_2_BRANCH)
DOM_CLASSINFO_MAP_BEGIN(PopStateEvent, nsIDOMPopStateEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMPopStateEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMPopStateEvent_MOZILLA_2_BRANCH)
DOM_CLASSINFO_EVENT_MAP_ENTRIES

View File

@ -183,7 +183,6 @@
#include "nsIXULAppInfo.h"
#include "nsNetUtil.h"
#include "nsFocusManager.h"
#include "nsIJSON.h"
#include "nsIXULWindow.h"
#include "nsEventStateManager.h"
#ifdef MOZ_XUL
@ -7717,60 +7716,17 @@ nsGlobalWindow::DispatchSyncPopState(PRBool aIsInitial)
return NS_OK;
}
// Bail if there's no document or the document's readystate isn't "complete".
if (!mDoc) {
return NS_OK;
}
nsIDocument::ReadyState readyState = mDoc->GetReadyStateEnum();
if (readyState != nsIDocument::READYSTATE_COMPLETE) {
return NS_OK;
}
// Get the document's pending state object -- it contains the data we're
// going to send along with the popstate event. The object is serialized as
// JSON.
nsAString& stateObjJSON = mDoc->GetPendingStateObject();
nsCOMPtr<nsIVariant> stateObj;
// Parse the JSON, if there's any to parse.
if (!stateObjJSON.IsEmpty()) {
// Get the JSContext associated with our document. We need this for
// deserialization.
nsCOMPtr<nsIDocument> document = do_QueryInterface(mDocument);
NS_ENSURE_TRUE(document, NS_ERROR_FAILURE);
// Get the JSContext from the document, like we do in
// nsContentUtils::GetContextFromDocument().
nsIScriptGlobalObject *sgo = document->GetScopeObject();
NS_ENSURE_TRUE(sgo, NS_ERROR_FAILURE);
nsIScriptContext *scx = sgo->GetContext();
NS_ENSURE_TRUE(scx, NS_ERROR_FAILURE);
JSContext *cx = (JSContext*) scx->GetNativeContext();
// Make sure we in the request while we have jsval on the native stack.
JSAutoRequest ar(cx);
// If our json call triggers a JS-to-C++ call, we want that call to use cx
// as the context. So we push cx onto the context stack.
nsCxPusher cxPusher;
jsval jsStateObj = JSVAL_NULL;
// Deserialize the state object into an nsIVariant.
nsCOMPtr<nsIJSON> json = do_GetService("@mozilla.org/dom/json;1");
NS_ENSURE_TRUE(cxPusher.Push(cx), NS_ERROR_FAILURE);
rv = json->DecodeToJSVal(stateObjJSON, cx, &jsStateObj);
NS_ENSURE_SUCCESS(rv, rv);
cxPusher.Pop();
nsCOMPtr<nsIXPConnect> xpconnect = do_GetService(nsIXPConnect::GetCID());
NS_ENSURE_TRUE(xpconnect, NS_ERROR_FAILURE);
rv = xpconnect->JSValToVariant(cx, &jsStateObj, getter_AddRefs(stateObj));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMNSDocument_MOZILLA_2_0_BRANCH> doc2 = do_QueryInterface(mDoc);
if (!doc2) {
return NS_OK;
}
rv = doc2->GetMozCurrentStateObject(getter_AddRefs(stateObj));
NS_ENSURE_SUCCESS(rv, rv);
// Obtain a presentation shell for use in creating a popstate event.
nsIPresShell *shell = mDoc->GetShell();

View File

@ -42,6 +42,7 @@
interface nsIBoxObject;
interface nsIDOMLocation;
interface nsIVariant;
[scriptable, uuid(92f2c6f8-3668-4a47-8251-2a900afe11fa)]
interface nsIDOMNSDocument : nsISupports
@ -129,3 +130,9 @@ interface nsIDOMNSDocument : nsISupports
void mozSetImageElement(in DOMString aImageElementId,
in nsIDOMElement aImageElement);
};
[scriptable, uuid(fee67aed-3b94-4136-ad7d-fb88ef23f45f)]
interface nsIDOMNSDocument_MOZILLA_2_0_BRANCH : nsISupports
{
readonly attribute nsIVariant mozCurrentStateObject;
};

View File

@ -222,6 +222,8 @@ function runTest() {
popstateExpected("Going back to page 1 should trigger a popstate.");
is(JSON.stringify(gLastPopStateEvent.state), JSON.stringify(testObj1),
"Wrong state object popped after going back to page 1.");
ok(gLastPopStateEvent.state === iframeCw.document.mozCurrentStateObject,
"Wrong state object in document after going back to page 1.");
ok(iframeCw.location.toString().match(/file_bug500328_1.html$/),
"Going back to page 1 hould take us to original page.");
@ -229,6 +231,8 @@ function runTest() {
popstateExpected("Going back to page 0 should trigger a popstate.");
is(gLastPopStateEvent.state, null,
"Going back to page 0 should pop a null state.");
is(iframeCw.document.mozCurrentStateObject, null,
"Going back to page 0 should pop a null state.");
is(iframeCw.location.search, "",
"Going back to page 0 should clear the querystring.");
@ -236,6 +240,8 @@ function runTest() {
popstateExpected("Going forward to page 1 should trigger a popstate.");
is(JSON.stringify(gLastPopStateEvent.state), JSON.stringify(testObj1),
"Wrong state object popped after going forward to page 1.");
ok(gLastPopStateEvent.state === iframeCw.document.mozCurrentStateObject,
"Wrong state object in document after going forward to page 1.");
ok(iframeCw.location.toString().match(/file_bug500328_1.html$/),
"Going forward to page 1 should leave us at original page.");
@ -246,6 +252,8 @@ function runTest() {
popstateExpected("Going forward to page 2 should trigger a popstate.");
is(JSON.stringify(gLastPopStateEvent.state), JSON.stringify(testObj2),
"Wrong state object popped after going forward to page 2.");
ok(iframeCw.document.mozCurrentStateObject === gLastPopStateEvent.state,
"Wrong state object in document after going forward to page 2.");
ok(iframeCw.location.toString().match(/file_bug500328_1.html\?test1#foo$/),
"Going forward to page 2 took us to " + iframeCw.location.toString());

View File

@ -1,86 +1,85 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=366682
-->
<head>
<title>Test for Bug 366682</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=366682">Mozilla Bug 366682</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 366682 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(runTest);
var gMisspeltWords;
function getEdit() {
return document.getElementById('edit');
}
function editDoc() {
return getEdit().contentDocument;
}
function getSpellCheckSelection() {
var Ci = Components.interfaces;
var win = editDoc().defaultView;
var editingSession = win.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIEditingSession);
var editor = editingSession.getEditorForWindow(win);
var selcon = editor.selectionController;
return selcon.getSelection(selcon.SELECTION_SPELLCHECK);
}
function runTest() {
editDoc().body.innerHTML = "<div>errror and an other errror</div>";
gMisspeltWords = ["errror", "errror"];
editDoc().designMode = "on";
setTimeout(function() { evalTest(); }, 0);
}
function evalTest() {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
is(isSpellingCheckOk(), true, "All misspellings accounted for.");
SimpleTest.finish();
}
function isSpellingCheckOk() {
var sel = getSpellCheckSelection();
var numWords = sel.rangeCount;
is(numWords, gMisspeltWords.length, "Correct number of misspellings and words.");
if (numWords != gMisspeltWords.length)
return false;
for (var i=0; i<numWords; i++) {
var word = sel.getRangeAt(i);
is (word, gMisspeltWords[i], "Misspelling is what we think it is.");
if (word != gMisspeltWords[i])
return false;
}
return true;
}
</script>
</pre>
<iframe id="edit" width="200" height="100" src="about:blank"></iframe>
</body>
</html>
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=366682
-->
<head>
<title>Test for Bug 366682</title>
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=366682">Mozilla Bug 366682</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script type="application/javascript">
/** Test for Bug 366682 **/
SimpleTest.waitForExplicitFinish();
addLoadEvent(runTest);
var gMisspeltWords;
function getEdit() {
return document.getElementById('edit');
}
function editDoc() {
return getEdit().contentDocument;
}
function getSpellCheckSelection() {
var Ci = Components.interfaces;
var win = editDoc().defaultView;
var editingSession = win.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIEditingSession);
var editor = editingSession.getEditorForWindow(win);
var selcon = editor.selectionController;
return selcon.getSelection(selcon.SELECTION_SPELLCHECK);
}
function runTest() {
editDoc().body.innerHTML = "<div>errror and an other errror</div>";
gMisspeltWords = ["errror", "errror"];
editDoc().designMode = "on";
setTimeout(function() { evalTest(); }, 0);
}
function evalTest() {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
is(isSpellingCheckOk(), true, "All misspellings accounted for.");
SimpleTest.finish();
}
function isSpellingCheckOk() {
var sel = getSpellCheckSelection();
var numWords = sel.rangeCount;
is(numWords, gMisspeltWords.length, "Correct number of misspellings and words.");
if (numWords != gMisspeltWords.length)
return false;
for (var i=0; i<numWords; i++) {
var word = sel.getRangeAt(i);
is (word, gMisspeltWords[i], "Misspelling is what we think it is.");
if (word != gMisspeltWords[i])
return false;
}
return true;
}
</script>
</pre>
<iframe id="edit" width="200" height="100" src="about:blank"></iframe>
</body>
</html>

View File

@ -743,15 +743,6 @@ CairoImageOGL::SetData(const CairoImage::Data &aData)
InitTexture(gl, tex, LOCAL_GL_RGBA, aData.mSize);
mSize = aData.mSize;
if (!mASurfaceAsGLContext) {
mASurfaceAsGLContext = GLContextProvider::CreateForNativePixmapSurface(aData.mSurface);
if (mASurfaceAsGLContext)
mASurfaceAsGLContext->BindTexImage();
}
if (mASurfaceAsGLContext)
return;
mLayerProgram =
gl->UploadSurfaceToTexture(aData.mSurface,
nsIntRect(0,0, mSize.width, mSize.height),

View File

@ -236,7 +236,6 @@ public:
GLTexture mTexture;
gfxIntSize mSize;
nsRefPtr<GLContext> mASurfaceAsGLContext;
gl::ShaderProgramType mLayerProgram;
};

View File

@ -379,11 +379,9 @@ BasicBufferOGL::GetQuadrantRectangle(XSide aXSide, YSide aYSide)
static void
FillSurface(gfxASurface* aSurface, const nsIntRegion& aRegion,
const nsIntPoint& aOffset, const gfxRGBA& aColor,
float aXRes, float aYRes)
const nsIntPoint& aOffset, const gfxRGBA& aColor)
{
nsRefPtr<gfxContext> ctx = new gfxContext(aSurface);
ctx->Scale(aXRes, aYRes);
ctx->Translate(-gfxPoint(aOffset.x, aOffset.y));
gfxUtils::ClipToRegion(ctx, aRegion);
ctx->SetColor(aColor);
@ -451,14 +449,15 @@ BasicBufferOGL::BeginPaint(ContentType aContentType,
return result;
nsIntRect visibleBounds = mLayer->GetVisibleRegion().GetBounds();
if (visibleBounds.width > gl()->GetMaxTextureSize() ||
visibleBounds.height > gl()->GetMaxTextureSize()) {
return result;
}
nsIntRect drawBounds = result.mRegionToDraw.GetBounds();
nsIntSize destBufferDims = ScaledSize(visibleBounds.Size(),
aXResolution, aYResolution);
if (destBufferDims.width > gl()->GetMaxTextureSize() ||
destBufferDims.height > gl()->GetMaxTextureSize()) {
return result;
}
nsRefPtr<TextureImage> destBuffer;
nsRefPtr<TextureImage> destBufferOnWhite;
nsIntRect destBufferRect;
@ -609,8 +608,8 @@ BasicBufferOGL::BeginPaint(ContentType aContentType,
gfxASurface *onWhite = mTexImageOnWhite->BeginUpdate(result.mRegionToDraw);
NS_ASSERTION(result.mRegionToDraw == drawRegionCopy,
"BeginUpdate should always modify the draw region in the same way!");
FillSurface(onBlack, result.mRegionToDraw, nsIntPoint(0,0), gfxRGBA(0.0, 0.0, 0.0, 1.0), aXResolution, aYResolution);
FillSurface(onWhite, result.mRegionToDraw, nsIntPoint(0,0), gfxRGBA(1.0, 1.0, 1.0, 1.0), aXResolution, aYResolution);
FillSurface(onBlack, result.mRegionToDraw, nsIntPoint(0,0), gfxRGBA(0.0, 0.0, 0.0, 1.0));
FillSurface(onWhite, result.mRegionToDraw, nsIntPoint(0,0), gfxRGBA(1.0, 1.0, 1.0, 1.0));
gfxASurface* surfaces[2] = { onBlack, onWhite };
nsRefPtr<gfxTeeSurface> surf = new gfxTeeSurface(surfaces, NS_ARRAY_LENGTH(surfaces));

View File

@ -392,6 +392,7 @@ mozJSSubScriptLoader::LoadSubScript (const PRUnichar * aURL
if (NS_FAILED(rv))
{
JSPRINCIPALS_DROP(cx, jsPrincipals);
errmsg = JS_NewStringCopyZ(cx, LOAD_ERROR_BADCHARSET);
goto return_exception;
}
@ -405,6 +406,8 @@ mozJSSubScriptLoader::LoadSubScript (const PRUnichar * aURL
buf, len, uriStr.get(), 1, rval);
}
JSPRINCIPALS_DROP(cx, jsPrincipals);
if (ok)
{
JSAutoEnterCompartment rac;
@ -417,8 +420,6 @@ mozJSSubScriptLoader::LoadSubScript (const PRUnichar * aURL
JS_SetErrorReporter (cx, er);
cc->SetReturnValueWasSet (ok);
JSPRINCIPALS_DROP(cx, jsPrincipals);
return NS_OK;
return_exception:

View File

@ -1526,8 +1526,6 @@ nsLayoutUtils::PaintFrame(nsIRenderingContext* aRenderingContext, nsIFrame* aFra
PRUint32 flags = nsDisplayList::PAINT_DEFAULT;
if (aFlags & PAINT_WIDGET_LAYERS) {
flags |= nsDisplayList::PAINT_USE_WIDGET_LAYERS;
nsIWidget *widget = aFrame->GetNearestWidget();
if (willFlushRetainedLayers) {
// The caller wanted to paint from retained layers, but set up
// the paint in such a way that we can't use them. We're going
@ -1537,17 +1535,15 @@ nsLayoutUtils::PaintFrame(nsIRenderingContext* aRenderingContext, nsIFrame* aFra
// not do this.
NS_WARNING("Flushing retained layers!");
flags |= nsDisplayList::PAINT_FLUSH_LAYERS;
} else if (widget && !(aFlags & PAINT_DOCUMENT_RELATIVE)) {
nsIWidget_MOZILLA_2_0_BRANCH* widget2 =
static_cast<nsIWidget_MOZILLA_2_0_BRANCH*>(widget);
PRInt32 pixelRatio = presContext->AppUnitsPerDevPixel();
nsIntRegion visibleWindowRegion(visibleRegion.ToOutsidePixels(pixelRatio));
builder.SetFinalTransparentRegion(visibleRegion);
widget2->UpdateTransparentRegion(visibleWindowRegion);
// If we're finished building display list items for painting of the outermost
// pres shell, notify the widget about any toolbars we've encountered.
widget2->UpdateThemeGeometries(builder.GetThemeGeometries());
} else if (!(aFlags & PAINT_DOCUMENT_RELATIVE)) {
nsIWidget_MOZILLA_2_0_BRANCH *widget2 =
static_cast<nsIWidget_MOZILLA_2_0_BRANCH*>(aFrame->GetNearestWidget());
if (widget2) {
builder.SetFinalTransparentRegion(visibleRegion);
// If we're finished building display list items for painting of the outermost
// pres shell, notify the widget about any toolbars we've encountered.
widget2->UpdateThemeGeometries(builder.GetThemeGeometries());
}
}
}
if (aFlags & PAINT_EXISTING_TRANSACTION) {
@ -1556,6 +1552,20 @@ nsLayoutUtils::PaintFrame(nsIRenderingContext* aRenderingContext, nsIFrame* aFra
list.PaintRoot(&builder, aRenderingContext, flags);
// Update the widget's transparent region information. This sets
// glass boundaries on Windows.
if ((aFlags & PAINT_WIDGET_LAYERS) &&
!willFlushRetainedLayers &&
!(aFlags & PAINT_DOCUMENT_RELATIVE)) {
nsIWidget_MOZILLA_2_0_BRANCH *widget2 =
static_cast<nsIWidget_MOZILLA_2_0_BRANCH*>(aFrame->GetNearestWidget());
if (widget2) {
PRInt32 pixelRatio = presContext->AppUnitsPerDevPixel();
nsIntRegion visibleWindowRegion(visibleRegion.ToOutsidePixels(presContext->AppUnitsPerDevPixel()));
widget2->UpdateTransparentRegion(visibleWindowRegion);
}
}
#ifdef DEBUG
if (gDumpPaintList) {
fprintf(stderr, "Painting --- after optimization:\n");

View File

@ -6419,6 +6419,9 @@
* passed to the macro and all other shortcuts installed by the application with
* the current application user model ID. Requires ApplicationID.
*
* NOTE: this does not update Desktop shortcut application user model ID due to
* bug 633728.
*
* @param _EXE_PATH
* The main application executable path
* @param _APP_ID
@ -6503,27 +6506,6 @@
${EndIf}
${Loop}
; Update the Desktop shortcuts' App ID for this application
StrCpy $R2 -1
${Do}
IntOp $R2 $R2 + 1 ; Increment the counter
ClearErrors
ReadINIStr $R5 "$R6" "DESKTOP" "Shortcut$R2"
${If} ${Errors}
${ExitDo}
${EndIf}
${If} ${FileExists} "$DESKTOP\$R5"
ShellLink::GetShortCutTarget "$DESKTOP\$R5"
Pop $R4
${GetLongPath} "$R4" $R4
${If} "$R4" == "$R9" ; link path == install path
ApplicationID::Set "$DESKTOP\$R5" "$R8"
Pop $R4
${EndIf}
${EndIf}
${Loop}
; Update the Start Menu Programs shortcuts' App ID for this application
ClearErrors
ReadINIStr $R7 "$R6" "SMPROGRAMS" "RelativePathToDir"

View File

@ -66,6 +66,10 @@ notification[type="critical"] .messageImage {
-moz-image-region: rect(0, 16px, 16px, 0);
}
notification[type="warning"] .messageCloseButton {
list-style-image: url("chrome://global/skin/icons/close.png");
}
.messageCloseButton > .toolbarbutton-text {
display: none;
}

View File

@ -102,7 +102,7 @@ static DllBlockInfo sWindowsDllBlocklist[] = {
// Music download filter for vkontakte.ru - old instances
// of this DLL cause crashes
{"vksaver.dll", MAKE_VERSION(1,0,0,1)},
{"vksaver.dll", MAKE_VERSION(2,2,2,0)},
// Topcrash in Firefox 4.0b1
{"rlxf.dll", MAKE_VERSION(1,2,323,1)},