Merge mozilla-central into Electrolysis

This commit is contained in:
Benjamin Smedberg 2009-11-30 12:59:43 -05:00
Родитель 68235ed431 e34baa4873
Коммит ebb5f3fbbd
104 изменённых файлов: 857 добавлений и 509 удалений

Просмотреть файл

@ -544,7 +544,7 @@ nsXULTreeAccessible::GetTreeItemAccessible(PRInt32 aRow,
{
*aAccessible = nsnull;
if (aRow < 0)
if (aRow < 0 || IsDefunct())
return;
PRInt32 rowCount = 0;

Просмотреть файл

@ -83,7 +83,7 @@
#ifdef XP_MACOSX
key="key_openHelpMac"/>
#else
key="key_openHelp"/>
/>
#endif
# Show IE Users menu item on Windows only
#ifdef XP_WIN
@ -132,10 +132,6 @@
<key id="key_hideOtherAppsCmdMac"
key="&hideOtherAppsCmdMac.commandkey;"
modifiers="accel,alt"/>
#else
<key id="key_openHelp"
oncommand="openHelpLink('firefox-f1');"
keycode="&openHelp.commandkey;"/>
#endif
</keyset>

Просмотреть файл

@ -83,6 +83,10 @@ window.addEventListener("focus", function () {
window.fullScreen = true;
window.addEventListener("deactivate", function () {
window.close();
}, false);
video = document.querySelector("video");
video.addEventListener("loadeddata", function () {
@ -138,10 +142,6 @@ window.addEventListener("unload", function () {
}
}, false);
window.addEventListener("deactivate", function () {
window.close();
}, false);
window.addEventListener("keypress", function (event) {
if (event.keyCode == event.DOM_VK_ESCAPE) {
window.close();

Просмотреть файл

@ -67,6 +67,9 @@ const TYPE_BOOKMARK = 1;
const TEST_URL = "http://www.mozilla.org/";
const DIALOG_URL = "chrome://browser/content/places/bookmarkProperties.xul";
const DIALOG_URL_MINIMAL_UI = "chrome://browser/content/places/bookmarkProperties2.xul";
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator);
var win = wm.getMostRecentWindow("navigator:browser");
@ -224,7 +227,8 @@ gTests.push({
var windowObserver = {
observe: function(aSubject, aTopic, aData) {
if (aTopic === "domwindowclosed") {
if (aTopic === "domwindowclosed" &&
aSubject.QueryInterface(Ci.nsIDOMWindow).location == DIALOG_URL) {
ww.unregisterNotification(this);
tagsField.popup.removeEventListener("popuphidden", popupListener, true);
ok(false, "Dialog window should not be closed by pressing Enter on the autocomplete popup");
@ -382,7 +386,8 @@ gTests.push({
var windowObserver = {
observe: function(aSubject, aTopic, aData) {
if (aTopic === "domwindowclosed") {
if (aTopic === "domwindowclosed" &&
aSubject.QueryInterface(Ci.nsIDOMWindow).location == DIALOG_URL) {
ww.unregisterNotification(this);
tagsField.popup.removeEventListener("popuphidden", popupListener, true);
ok(false, "Dialog window should not be closed by pressing Escape on the autocomplete popup");
@ -483,7 +488,8 @@ gTests.push({
var windowObserver = {
observe: function(aSubject, aTopic, aData) {
if (aTopic === "domwindowclosed") {
if (aTopic === "domwindowclosed" &&
aSubject.QueryInterface(Ci.nsIDOMWindow).location == DIALOG_URL_MINIMAL_UI) {
ww.unregisterNotification(this);
ok(self._cleanShutdown,
"Dialog window should not be closed by pressing ESC in folder name textbox");
@ -543,6 +549,9 @@ function runNextTest() {
if (gCurrentTest) {
gCurrentTest.cleanup();
info("End of test: " + gCurrentTest.desc);
gCurrentTest = null;
executeSoon(runNextTest);
return;
}
if (gTests.length > 0) {

Просмотреть файл

@ -76,7 +76,7 @@ function run_test() {
// Restore could take some time, usually less than 1s.
// We will poll later in continue_test to be sure restore has finished.
do_test_pending();
do_timeout(1000, "continue_test();");
do_timeout(1000, continue_test);
}
function continue_test() {
@ -85,7 +85,7 @@ function continue_test() {
if (bs.getIdForItemAt(bs.toolbarFolder, 0) == -1) {
// Not enough time to complete restore, poll again later.
do_timeout(1000, "continue_test();");
do_timeout(1000, continue_test);
return;
}

Просмотреть файл

@ -56,7 +56,7 @@ let observer = {
observe: function(aSubject, aTopic, aData) {
if (aTopic == TOPIC_CUSTOMIZATION_COMPLETE) {
os.removeObserver(this, TOPIC_CUSTOMIZATION_COMPLETE);
do_timeout(0, "continue_test();");
do_timeout(0, continue_test);
}
}
}

Просмотреть файл

@ -90,7 +90,7 @@ function run_test() {
// Import could take some time, usually less than 1s, but to be sure we will
// check after 3s.
do_test_pending();
do_timeout(3000, "continue_test();");
do_timeout(3000, continue_test);
}
function continue_test() {

Просмотреть файл

@ -71,7 +71,7 @@ function run_test() {
// Restore could take some time, usually less than 1s.
// We will poll later in continue_test() to be sure restore has finished.
do_test_pending();
do_timeout(1000, "continue_test();");
do_timeout(1000, continue_test);
}
function continue_test() {
@ -80,7 +80,7 @@ function continue_test() {
if (bs.getIdForItemAt(bs.toolbarFolder, 0) == -1) {
// Not enough time to complete restore, poll again later.
do_timeout(1000, "continue_test();");
do_timeout(1000, continue_test);
return;
}

Просмотреть файл

@ -143,7 +143,7 @@ function run_test() {
// Kick-off tests.
do_test_pending();
do_timeout(0, "run_next_test();");
do_timeout(0, run_next_test);
}
function run_next_test() {
@ -160,7 +160,7 @@ function run_next_test() {
do_check_true(compareJSON(gReferenceJSON, leftPaneJSON));
do_check_eq(PlacesUtils.bookmarks.getItemTitle(gFolderId), "test");
// Go to next test.
do_timeout(0, "run_next_test();");
do_timeout(0, run_next_test);
}
else {
// All tests finished.

Просмотреть файл

@ -43,43 +43,26 @@ function test() {
// initialization
let pb = Cc["@mozilla.org/privatebrowsing;1"].
getService(Ci.nsIPrivateBrowsingService);
let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
getService(Ci.nsIWindowWatcher);
const EXCEPTIONS_DLG_URL = 'chrome://pippki/content/exceptionDialog.xul';
const EXCEPTIONS_DLG_FEATURES = 'chrome,centerscreen,modal';
const EXCEPTIONS_DLG_FEATURES = 'chrome,centerscreen';
const INVALID_CERT_LOCATION = 'https://nocert.example.com/';
waitForExplicitFinish();
// enter private browsing mode
pb.privateBrowsingEnabled = true;
let testCheckbox;
let obs = {
observe: function(aSubject, aTopic, aData) {
// unregister ourself
ww.unregisterNotification(this);
let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
win.addEventListener("load", function() {
win.removeEventListener("load", arguments.callee, false);
testCheckbox(win.document.defaultView);
}, false);
}
};
step1();
// Test the certificate exceptions dialog as it is invoked from about:certerror
function step1() {
ww.registerNotification(obs);
let params = {
exceptionAdded : false,
location: INVALID_CERT_LOCATION,
handlePrivateBrowsing : true,
prefetchCert: true,
};
testCheckbox = function(win) {
function testCheckbox() {
let obsSvc = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
obsSvc.addObserver({
@ -96,19 +79,19 @@ function test() {
step2();
}
}, "cert-exception-ui-ready", false);
};
window.openDialog(EXCEPTIONS_DLG_URL, '', EXCEPTIONS_DLG_FEATURES, params);
}
var win = openDialog(EXCEPTIONS_DLG_URL, "", EXCEPTIONS_DLG_FEATURES, params);
win.addEventListener("load", testCheckbox, false);
}
// Test the certificate excetions dialog as it is invoked from the Preferences dialog
function step2() {
ww.registerNotification(obs);
let params = {
exceptionAdded : false,
location: INVALID_CERT_LOCATION,
prefetchCert: true,
};
testCheckbox = function(win) {
function testCheckbox() {
let obsSvc = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
obsSvc.addObserver({
@ -125,8 +108,9 @@ function test() {
cleanup();
}
}, "cert-exception-ui-ready", false);
};
window.openDialog(EXCEPTIONS_DLG_URL, '', EXCEPTIONS_DLG_FEATURES, params);
}
var win = openDialog(EXCEPTIONS_DLG_URL, "", EXCEPTIONS_DLG_FEATURES, params);
win.addEventListener("load", testCheckbox, false);
}
function cleanup() {

Просмотреть файл

@ -56,8 +56,8 @@ function test() {
waitForExplicitFinish();
const REFERRER1 = "http://www.example.net/?" + Date.now();
const REFERRER2 = "http://www.example.net/?" + Math.random();
const REFERRER1 = "http://example.org/?" + Date.now();
const REFERRER2 = "http://example.org/?" + Math.random();
let tab = gBrowser.addTab();
gBrowser.selectedTab = tab;
@ -92,5 +92,5 @@ function test() {
},true);
let referrerURI = ioService.newURI(REFERRER1, null, null);
browser.loadURI("http://www.example.net", referrerURI, null);
browser.loadURI("http://example.org", referrerURI, null);
}

Просмотреть файл

@ -16,7 +16,6 @@
<!ENTITY productHelp.accesskey "H">
<!ENTITY helpForIEUsers.label "For Internet Explorer Users">
<!ENTITY helpForIEUsers.accesskey "I">
<!ENTITY openHelp.commandkey "VK_F1">
<!ENTITY helpMac.commandkey "?">
<!ENTITY helpReleaseNotes.label "Release Notes">

Просмотреть файл

@ -661,9 +661,9 @@ def runApp(testURL, env, app, profileDir, extraArgs,
if status != 0 and not didTimeout:
log.info("TEST-UNEXPECTED-FAIL | automation.py | Exited with code %d during test run", status)
if stackFixerProcess is not None:
status = stackFixerProcess.wait()
if status != 0 and not didTimeout:
log.info("TEST-UNEXPECTED-FAIL | automation.py | Stack fixer process exited with code %d during test run", status)
fixerStatus = stackFixerProcess.wait()
if fixerStatus != 0 and not didTimeout:
log.info("TEST-UNEXPECTED-FAIL | automation.py | Stack fixer process exited with code %d during test run", fixerStatus)
log.info("INFO | automation.py | Application ran for: %s", str(datetime.now() - startTime))
# Do a final check for zombie child processes.

Двоичные данные
build/pgo/certs/cert8.db

Двоичный файл не отображается.

Двоичные данные
build/pgo/certs/key3.db

Двоичный файл не отображается.

Просмотреть файл

@ -4790,6 +4790,7 @@ cairo-gtk2|cairo-gtk2-x11)
AC_DEFINE(MOZ_X11)
MOZ_X11=1
USE_FC_FREETYPE=1
TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
TK_LIBS='$(MOZ_GTK2_LIBS)'
@ -4822,6 +4823,7 @@ cairo-qt)
AC_DEFINE(MOZ_X11)
MOZ_X11=1
USE_FC_FREETYPE=1
TK_CFLAGS='$(MOZ_QT_CFLAGS)'
TK_LIBS='$(MOZ_QT_LIBS)'
@ -4830,12 +4832,14 @@ cairo-qt)
cairo-beos)
MOZ_WIDGET_TOOLKIT=beos
USE_FC_FREETYPE=1
TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
TK_LIBS='$(MOZ_CAIRO_LIBS)'
;;
cairo-os2)
MOZ_WIDGET_TOOLKIT=os2
USE_FC_FREETYPE=1
TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
TK_LIBS='$(MOZ_CAIRO_LIBS)'
;;
@ -7529,7 +7533,6 @@ if test "$MOZ_TREE_CAIRO"; then
PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
MOZ_ENABLE_CAIRO_FT=1
CAIRO_FT_CFLAGS="$FT2_CFLAGS"
fi
@ -7579,7 +7582,6 @@ if test "$MOZ_TREE_CAIRO"; then
if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
MOZ_ENABLE_CAIRO_FT=1
CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
@ -7589,9 +7591,11 @@ if test "$MOZ_TREE_CAIRO"; then
PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
MOZ_ENABLE_CAIRO_FT=1
fi
if test "$USE_FC_FREETYPE"; then
FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
fi
AC_SUBST(MOZ_ENABLE_CAIRO_FT)
AC_SUBST(CAIRO_FT_CFLAGS)
AC_SUBST(HAS_OGLES)
@ -8147,6 +8151,18 @@ if test -n "$MOZ_WEBGL"; then
fi # MOZ_WEBGL
fi # COMPILE_ENVIRONMENT
if test "$USE_FC_FREETYPE"; then
if test "$COMPILE_ENVIRONMENT"; then
_SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $FT2_CFLAGS"
AC_CHECK_HEADERS(fontconfig/fcfreetype.h, ,
[AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)])
CPPFLAGS="$_SAVE_CPPFLAGS"
else
AC_DEFINE(HAVE_FONTCONFIG_FCFREETYPE_H)
fi
fi
dnl Set various defines and substitutions
dnl ========================================================

Просмотреть файл

@ -1163,6 +1163,11 @@ public:
*/
static nsresult DropJSObjects(void* aScriptObjectHolder);
#ifdef DEBUG
static void CheckCCWrapperTraversal(nsISupports* aScriptObjectHolder,
nsWrapperCache* aCache);
#endif
static void PreserveWrapper(nsISupports* aScriptObjectHolder,
nsWrapperCache* aCache)
{
@ -1171,6 +1176,10 @@ public:
CallQueryInterface(aScriptObjectHolder, &participant);
HoldJSObjects(aScriptObjectHolder, participant);
aCache->SetPreservingWrapper(PR_TRUE);
#ifdef DEBUG
// Make sure the cycle collector will be able to traverse to the wrapper.
CheckCCWrapperTraversal(aScriptObjectHolder, aCache);
#endif
}
}
static void ReleaseWrapper(nsISupports* aScriptObjectHolder,

Просмотреть файл

@ -44,7 +44,7 @@ interface nsIDOMFileError : nsISupports
const unsigned short NOT_FOUND_ERR = 8;
const unsigned short NOT_READABLE_ERR = 24;
const unsigned short SECURITY_ERR = 18;
const unsigned short ABORT_ERR = 25;
const unsigned short ABORT_ERR = 20;
const unsigned short ENCODING_ERR = 26;
readonly attribute unsigned short code;

Просмотреть файл

@ -5174,6 +5174,84 @@ nsContentUtils::WrapNative(JSContext *cx, JSObject *scope, nsISupports *native,
return rv;
}
#ifdef DEBUG
class DebugWrapperTraversalCallback : public nsCycleCollectionTraversalCallback
{
public:
DebugWrapperTraversalCallback(void* aWrapper) : mFound(PR_FALSE),
mWrapper(aWrapper)
{
mFlags = WANT_ALL_TRACES;
}
NS_IMETHOD_(void) DescribeNode(CCNodeType type,
nsrefcnt refcount,
size_t objsz,
const char* objname)
{
}
NS_IMETHOD_(void) NoteXPCOMRoot(nsISupports *root)
{
}
NS_IMETHOD_(void) NoteRoot(PRUint32 langID, void* root,
nsCycleCollectionParticipant* helper)
{
}
NS_IMETHOD_(void) NoteScriptChild(PRUint32 langID, void* child)
{
if (langID == nsIProgrammingLanguage::JAVASCRIPT) {
mFound = child == mWrapper;
}
}
NS_IMETHOD_(void) NoteXPCOMChild(nsISupports *child)
{
}
NS_IMETHOD_(void) NoteNativeChild(void* child,
nsCycleCollectionParticipant* helper)
{
}
NS_IMETHOD_(void) NoteNextEdgeName(const char* name)
{
}
PRBool mFound;
private:
void* mWrapper;
};
static void
DebugWrapperTraceCallback(PRUint32 langID, void *p, void *closure)
{
DebugWrapperTraversalCallback* callback =
static_cast<DebugWrapperTraversalCallback*>(closure);
callback->NoteScriptChild(langID, p);
}
// static
void
nsContentUtils::CheckCCWrapperTraversal(nsISupports* aScriptObjectHolder,
nsWrapperCache* aCache)
{
nsXPCOMCycleCollectionParticipant* participant;
CallQueryInterface(aScriptObjectHolder, &participant);
DebugWrapperTraversalCallback callback(aCache->GetWrapper());
participant->Traverse(aScriptObjectHolder, callback);
NS_ASSERTION(callback.mFound,
"Cycle collection participant didn't traverse to preserved "
"wrapper! This will probably crash.");
callback.mFound = PR_FALSE;
participant->Trace(aScriptObjectHolder, DebugWrapperTraceCallback, &callback);
NS_ASSERTION(callback.mFound,
"Cycle collection participant didn't trace preserved wrapper! "
"This will probably crash.");
}
#endif
mozAutoRemovableBlockerRemover::mozAutoRemovableBlockerRemover(nsIDocument* aDocument)
{
mNestingLevel = nsContentUtils::GetRemovableScriptBlockerLevel();

Просмотреть файл

@ -123,10 +123,6 @@ NS_INTERFACE_MAP_END_INHERITING(nsXHREventTarget)
NS_IMPL_ADDREF_INHERITED(nsDOMFileReader, nsXHREventTarget)
NS_IMPL_RELEASE_INHERITED(nsDOMFileReader, nsXHREventTarget)
static const PRUint32 FILE_AS_BINARY = 1;
static const PRUint32 FILE_AS_TEXT = 2;
static const PRUint32 FILE_AS_DATAURL = 3;
NS_IMETHODIMP
nsDOMFileReader::GetOnloadend(nsIDOMEventListener** aOnloadend)
{
@ -153,7 +149,7 @@ nsDOMFileReader::Notify(const char *aCharset, nsDetectionConfident aConf)
nsDOMFileReader::nsDOMFileReader()
: mFileData(nsnull),
mDataLen(0), mDataFormat(0),
mDataLen(0), mDataFormat(FILE_AS_BINARY),
mReadyState(nsIDOMFileReader::EMPTY),
mProgressEventWasDelayed(PR_FALSE),
mTimerIsActive(PR_FALSE),
@ -454,7 +450,7 @@ nsDOMFileReader::OnStopRequest(nsIRequest *aRequest,
return NS_OK;
}
nsresult rv;
nsresult rv = NS_OK;
switch (mDataFormat) {
case FILE_AS_BINARY:
break; //Already accumulated mResult
@ -464,17 +460,20 @@ nsDOMFileReader::OnStopRequest(nsIRequest *aRequest,
case FILE_AS_DATAURL:
rv = GetAsDataURL(mFile, mFileData, mDataLen, mResult);
break;
default:
return NS_ERROR_FAILURE;
}
FreeFileData();
if (NS_FAILED(rv)) {
DispatchError(rv);
return NS_OK;
}
//Dispatch load event to signify end of a successful load
DispatchProgressEvent(NS_LITERAL_STRING(LOAD_STR));
DispatchProgressEvent(NS_LITERAL_STRING(LOADEND_STR));
return rv;
return NS_OK;
}
// Helper methods
@ -482,8 +481,8 @@ nsDOMFileReader::OnStopRequest(nsIRequest *aRequest,
nsresult
nsDOMFileReader::ReadFileContent(nsIDOMFile* aFile,
const nsAString &aCharset,
PRUint32 aDataFormat)
{
eDataFormat aDataFormat)
{
NS_ENSURE_TRUE(aFile, NS_ERROR_NULL_POINTER);
//Implicit abort to clear any other activity going on

Просмотреть файл

@ -111,7 +111,13 @@ public:
nsresult Init();
protected:
nsresult ReadFileContent(nsIDOMFile *aFile, const nsAString &aCharset, PRUint32 aDataFormat);
enum eDataFormat {
FILE_AS_BINARY,
FILE_AS_TEXT,
FILE_AS_DATAURL
};
nsresult ReadFileContent(nsIDOMFile *aFile, const nsAString &aCharset, eDataFormat aDataFormat);
nsresult GetAsText(const nsAString &aCharset,
const char *aFileData, PRUint32 aDataLen, nsAString &aResult);
nsresult GetAsDataURL(nsIFile *aFile, const char *aFileData, PRUint32 aDataLen, nsAString &aResult);
@ -130,7 +136,8 @@ protected:
nsCOMPtr<nsIFile> mFile;
nsString mCharset;
PRUint32 mDataLen;
PRUint32 mDataFormat;
eDataFormat mDataFormat;
nsString mResult;
PRUint16 mReadyState;

Просмотреть файл

@ -58,7 +58,7 @@ var asyncXHR = {
function run_test() {
do_test_pending();
do_timeout(0, "run_test_pt1()");
do_timeout(0, run_test_pt1);
}
// network offline

Просмотреть файл

@ -230,7 +230,9 @@ static nsresult GenerateFlatTextContent(nsIRange* aRange,
NS_ASSERTION(aString.IsEmpty(), "aString must be empty string");
nsINode* startNode = aRange->GetStartParent();
NS_ENSURE_TRUE(startNode, NS_ERROR_FAILURE);
nsINode* endNode = aRange->GetEndParent();
NS_ENSURE_TRUE(endNode, NS_ERROR_FAILURE);
if (startNode == endNode && startNode->IsNodeOfType(nsINode::eTEXT)) {
nsIContent* content = static_cast<nsIContent*>(startNode);

Просмотреть файл

@ -1767,6 +1767,8 @@ nsDOMClassInfo::~nsDOMClassInfo()
}
}
NS_DEFINE_STATIC_IID_ACCESSOR(nsDOMClassInfo, NS_DOMCLASSINFO_IID)
NS_IMPL_ADDREF(nsDOMClassInfo)
NS_IMPL_RELEASE(nsDOMClassInfo)
@ -1774,6 +1776,11 @@ NS_INTERFACE_MAP_BEGIN(nsDOMClassInfo)
NS_INTERFACE_MAP_ENTRY(nsIXPCScriptable)
NS_INTERFACE_MAP_ENTRY(nsIClassInfo)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIXPCScriptable)
if (aIID.Equals(NS_GET_IID(nsDOMClassInfo))) {
*aInstancePtr = static_cast<nsIXPCScriptable*>(this);
return NS_OK;
}
else
NS_INTERFACE_MAP_END
@ -4454,10 +4461,13 @@ nsDOMClassInfo::GetClassInfoInstance(nsDOMClassInfoData* aData)
void
nsDOMClassInfo::PreserveNodeWrapper(nsIXPConnectWrappedNative *aWrapper)
{
nsWrapperCache* cache = nsnull;
CallQueryInterface(aWrapper->Native(), &cache);
if (cache) {
nsContentUtils::PreserveWrapper(aWrapper->Native(), cache);
nsCOMPtr<nsIClassInfo> ci = do_QueryInterface(aWrapper->Native());
if (ci) {
nsDOMClassInfo* domci = nsnull;
CallQueryInterface(ci, &domci);
if (domci) {
domci->PreserveWrapper(aWrapper->Native());
}
}
}
@ -7236,8 +7246,7 @@ NS_IMETHODIMP
nsNodeSH::AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsval id, jsval *vp, PRBool *_retval)
{
nsINode* node = static_cast<nsINode*>(GetNative(wrapper, obj));
nsContentUtils::PreserveWrapper(node, node);
nsNodeSH::PreserveWrapper(GetNative(wrapper, obj));
return nsEventReceiverSH::AddProperty(wrapper, cx, obj, id, vp, _retval);
}
@ -7254,8 +7263,7 @@ nsNodeSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
if (id == sOnload_id || id == sOnerror_id) {
// Make sure that this node can't go away while waiting for a
// network load that could fire an event handler.
nsINode* node = static_cast<nsINode*>(GetNative(wrapper, obj));
nsContentUtils::PreserveWrapper(node, node);
nsNodeSH::PreserveWrapper(GetNative(wrapper, obj));
}
return nsEventReceiverSH::NewResolve(wrapper, cx, obj, id, flags, objp,
@ -7326,6 +7334,13 @@ nsNodeSH::GetFlags(PRUint32 *aFlags)
return NS_OK;
}
void
nsNodeSH::PreserveWrapper(nsISupports *aNative)
{
nsINode *node = static_cast<nsINode*>(aNative);
nsContentUtils::PreserveWrapper(aNative, node);
}
// EventReceiver helper
// static
@ -7694,13 +7709,18 @@ nsEventTargetSH::AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
return NS_OK;
}
nsISupports *target = GetNative(wrapper, obj);
nsContentUtils::PreserveWrapper(target,
nsXHREventTarget::FromSupports(target));
nsEventTargetSH::PreserveWrapper(GetNative(wrapper, obj));
return NS_OK;
}
void
nsEventTargetSH::PreserveWrapper(nsISupports *aNative)
{
nsXHREventTarget *target = nsXHREventTarget::FromSupports(aNative);
nsContentUtils::PreserveWrapper(aNative, target);
}
// Element helper

Просмотреть файл

@ -102,10 +102,16 @@ typedef PRUptrdiff PtrBits;
#define IS_EXTERNAL(_ptr) (PtrBits(_ptr) & 0x1)
#define NS_DOMCLASSINFO_IID \
{ 0x7da6858c, 0x5c12, 0x4588, \
{ 0x82, 0xbe, 0x01, 0xa2, 0x45, 0xc5, 0xc0, 0xb0 } }
class nsDOMClassInfo : public nsIXPCScriptable,
public nsIClassInfo
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOMCLASSINFO_IID)
nsDOMClassInfo(nsDOMClassInfoData* aData);
virtual ~nsDOMClassInfo();
@ -217,6 +223,10 @@ protected:
const nsDOMClassInfoData* mData;
virtual void PreserveWrapper(nsISupports *aNative)
{
}
static nsresult Init();
static nsresult RegisterClassName(PRInt32 aDOMClassInfoID);
static nsresult RegisterClassProtos(PRInt32 aDOMClassInfoID);
@ -475,6 +485,8 @@ public:
NS_IMETHOD AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
virtual void PreserveWrapper(nsISupports *aNative);
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
{
return new nsEventTargetSH(aData);
@ -658,6 +670,8 @@ public:
JSObject *obj, jsval id, jsval *vp, PRBool *_retval);
NS_IMETHOD GetFlags(PRUint32 *aFlags);
virtual void PreserveWrapper(nsISupports *aNative);
static nsIClassInfo *doCreate(nsDOMClassInfoData* aData)
{
return new nsNodeSH(aData);

Просмотреть файл

@ -37,16 +37,16 @@
#include "domstubs.idl"
[scriptable, uuid(98808DEB-C8E4-422C-BA97-08BF2031464C)]
[scriptable, uuid(0DF49C5C-9845-42F9-A76C-62E09C110986)]
interface nsIDOMGeoPositionAddress : nsISupports
{
readonly attribute string streetNumber;
readonly attribute string street;
readonly attribute string premises;
readonly attribute string city;
readonly attribute string county;
readonly attribute string region;
readonly attribute string country;
readonly attribute string countryCode;
readonly attribute string postalCode;
readonly attribute DOMString streetNumber;
readonly attribute DOMString street;
readonly attribute DOMString premises;
readonly attribute DOMString city;
readonly attribute DOMString county;
readonly attribute DOMString region;
readonly attribute DOMString country;
readonly attribute DOMString countryCode;
readonly attribute DOMString postalCode;
};

Просмотреть файл

@ -56,6 +56,7 @@ interface nsIPlaintextEditor : nsISupports
const long eEditorWidgetMask = 0x0200; /* bit for widgets */
const long eEditorNoCSSMask = 0x0400; /* this HTML editor should not create css styles */
const long eEditorAllowInteraction = 0x0800; /* */
const long eEditorDontEchoPassword = 0x1000;
/*
* The valid values for newlines handling.

Просмотреть файл

@ -520,6 +520,38 @@ nsTextEditRules::DidInsertBreak(nsISelection *aSelection, nsresult aResult)
return res;
}
static inline already_AddRefed<nsIDOMNode>
GetTextNode(nsISelection *selection, nsEditor *editor) {
PRInt32 selOffset;
nsCOMPtr<nsIDOMNode> selNode;
nsresult res = editor->GetStartNodeAndOffset(selection, address_of(selNode), &selOffset);
if (NS_FAILED(res)) return nsnull;
if (!editor->IsTextNode(selNode)) {
// Get an nsINode from the nsIDOMNode
nsCOMPtr<nsINode> node = do_QueryInterface(selNode);
// if node is null, return it to indicate there's no text
if (!node) return nsnull;
// This should be the root node, walk the tree looking for text nodes
nsNodeIterator iter(node, nsIDOMNodeFilter::SHOW_TEXT, nsnull, PR_TRUE);
while (!editor->IsTextNode(selNode)) {
if (NS_FAILED(res = iter.NextNode(getter_AddRefs(selNode))) || !selNode) {
return nsnull;
}
}
}
return selNode.forget();
}
#ifdef DEBUG
#define ASSERT_PASSWORD_LENGTHS_EQUAL() \
if (mFlags & nsIPlaintextEditor::eEditorPasswordMask) { \
PRInt32 txtLen; \
mEditor->GetTextLength(&txtLen); \
NS_ASSERTION(mPasswordText.Length() == txtLen, \
"password length not equal to number of asterisks"); \
}
#else
#define ASSERT_PASSWORD_LENGTHS_EQUAL()
#endif
nsresult
nsTextEditRules::WillInsertText(PRInt32 aAction,
@ -672,10 +704,9 @@ nsTextEditRules::WillInsertText(PRInt32 aAction,
mPasswordText.Insert(*outString, start);
nsCOMPtr<nsILookAndFeel> lookAndFeel = do_GetService(kLookAndFeelCID);
if (lookAndFeel->GetEchoPassword()) {
if (mPasswordText.Length() > outString->Length()) {
HideLastPWInput();
}
if (lookAndFeel->GetEchoPassword() &&
!(mFlags & nsIPlaintextEditor::eEditorDontEchoPassword)) {
HideLastPWInput();
mLastStart = start;
mLastLength = outString->Length();
if (mTimer)
@ -862,6 +893,7 @@ nsTextEditRules::WillInsertText(PRInt32 aAction,
selPrivate->SetInterlinePosition(endsWithLF);
}
}
ASSERT_PASSWORD_LENGTHS_EQUAL()
return res;
}
@ -942,6 +974,18 @@ nsTextEditRules::WillDeleteSelection(nsISelection *aSelection,
PRUint32 start, end;
mEditor->GetTextSelectionOffsets(aSelection, start, end);
NS_ENSURE_SUCCESS(res, res);
nsCOMPtr<nsILookAndFeel> lookAndFeel = do_GetService(kLookAndFeelCID);
if (lookAndFeel->GetEchoPassword()) {
HideLastPWInput();
mLastStart = start;
mLastLength = 0;
if (mTimer)
{
mTimer->Cancel();
}
}
if (end == start)
{ // collapsed selection
if (nsIEditor::ePrevious==aCollapsedAction && 0<start) { // del back
@ -983,6 +1027,7 @@ nsTextEditRules::WillDeleteSelection(nsISelection *aSelection,
NS_ENSURE_SUCCESS(res, res);
*aHandled = PR_TRUE;
ASSERT_PASSWORD_LENGTHS_EQUAL()
return NS_OK;
}
@ -1401,38 +1446,36 @@ nsTextEditRules::RemoveIMETextFromPWBuf(PRUint32 &aStart, nsAString *aIMEString)
}
NS_IMETHODIMP nsTextEditRules::Notify(class nsITimer *) {
return HideLastPWInput();
nsresult res = HideLastPWInput();
ASSERT_PASSWORD_LENGTHS_EQUAL();
mLastLength = 0;
return res;
}
nsresult nsTextEditRules::HideLastPWInput() {
nsCOMPtr<nsIDOMNode> selNode;
if (!mLastLength) {
// Special case, we're trying to replace a range that no longer exists
return NS_OK;
}
nsAutoString hiddenText;
FillBufWithPWChars(&hiddenText, mLastLength);
nsCOMPtr<nsISelection> selection;
PRInt32 selOffset;
PRUint32 start, end;
nsresult res = mEditor->GetSelection(getter_AddRefs(selection));
if (NS_FAILED(res)) return res;
res = mEditor->GetTextSelectionOffsets(selection, start, end);
if (NS_FAILED(res)) return res;
res = mEditor->GetStartNodeAndOffset(selection, address_of(selNode), &selOffset);
if (NS_FAILED(res)) return res;
if (!mEditor->IsTextNode(selNode)) {
// Get an nsINode from the nsIDOMNode
nsCOMPtr<nsINode> node = do_QueryInterface(selNode);
// if node is null, return NS_OK because there's no text to hide
if (!node) return NS_OK;
// This should be the root node, walk the tree looking for text nodes
nsNodeIterator iter(node, nsIDOMNodeFilter::SHOW_TEXT, nsnull, PR_TRUE);
while (!mEditor->IsTextNode(selNode)) {
if (NS_FAILED(res = iter.NextNode(getter_AddRefs(selNode))) ||
selNode == nsnull) {
return NS_SUCCEEDED(res) ? NS_ERROR_NULL_POINTER : res;
}
}
}
nsCOMPtr<nsIDOMNode> selNode = GetTextNode(selection, mEditor);
if (!selNode)
return NS_OK;
nsCOMPtr<nsIDOMCharacterData> nodeAsText(do_QueryInterface(selNode));
if (!nodeAsText) return NS_ERROR_FAILURE;
nsAutoString hiddenText;
FillBufWithPWChars(&hiddenText, mLastLength);
if (!nodeAsText)
return NS_OK;
nodeAsText->ReplaceData(mLastStart, mLastLength, hiddenText);
selection->Collapse(selNode, start);
if (start != end)

Просмотреть файл

@ -32,15 +32,15 @@ function run_test() {
// ... and the first one has
do_test_pending();
do_timeout(10, "verifyFirstExpiration();");
do_timeout(10, verifyFirstExpiration);
// ... and that the short-term one will
do_test_pending();
do_timeout(200, "verifyExpiration();");
do_timeout(200, verifyExpiration);
// clean up
do_test_pending();
do_timeout(300, "end_test();");
do_timeout(300, end_test);
}
function verifyFirstExpiration() {

Просмотреть файл

@ -114,7 +114,7 @@ function run_test() {
do_test_pending(); // for 'cleared' notification
pm.removeAll();
do_timeout(100, "cleanup();");
do_timeout(100, cleanup);
}
function cleanup() {

Просмотреть файл

@ -221,7 +221,7 @@ nsSystemFontsGTK2::GetSystemFontInfo(GtkWidget *aWidget, nsString *aFontName,
if (!MOZ_pango_font_description_get_size_is_absolute(desc)) {
// |size| is in pango-points, so convert to pixels.
size *= float(gfxPlatformGtk::GetPlatformDPI()) / POINTS_PER_INCH_FLOAT;
size *= float(gfxPlatform::GetDPI()) / POINTS_PER_INCH_FLOAT;
}
// |size| is now pixels

Просмотреть файл

@ -79,7 +79,7 @@ nsSystemFontsQt::GetSystemFontInfo(const char *aClassName, nsString *aFontName,
aFontStyle->weight = qFont.weight();
// FIXME: Set aFontStyle->stretch correctly!
aFontStyle->stretch = NS_FONT_STRETCH_NORMAL;
aFontStyle->size = qFont.pointSizeF() * float(gfxQtPlatform::GetPlatformDPI()) / 72.0f;
aFontStyle->size = qFont.pointSizeF() * float(gfxPlatform::GetDPI()) / 72.0f;
return NS_OK;
}

Просмотреть файл

@ -129,34 +129,11 @@ public:
GdkDrawable *drawable);
GdkDrawable *GetGdkDrawable(gfxASurface *target);
static PRInt32 GetPlatformDPI() {
if (sPlatformDPI < 0) {
gfxPlatformGtk::GetPlatform()->InitDisplayCaps();
}
NS_ASSERTION(sPlatformDPI > 0, "Something is wrong");
return sPlatformDPI;
}
#ifdef MOZ_PLATFORM_HILDON
static PRInt32 GetMaemoClassic() {
if (sMaemoClassic < 0) {
gfxPlatformGtk::GetPlatform()->InitDisplayCaps();
}
NS_ASSERTION(sMaemoClassic > 0, "Something is wrong");
return sMaemoClassic == 1;
}
#endif
protected:
void InitDisplayCaps();
static PRInt32 sPlatformDPI;
static gfxFontconfigUtils *sFontconfigUtils;
#ifdef MOZ_PLATFORM_HILDON
static PRInt32 sMaemoClassic;
#endif
private:
virtual qcms_profile *GetPlatformCMSOutputProfile();
};

Просмотреть файл

@ -85,10 +85,6 @@ public:
FT_Library GetFTLibrary();
static PRInt32 GetPlatformDPI() {
return 96;
}
protected:
static gfxFontconfigUtils *sFontconfigUtils;

Просмотреть файл

@ -45,7 +45,7 @@
#include FT_TRUETYPE_TAGS_H
#include FT_TRUETYPE_TABLES_H
#ifdef CAIRO_HAS_FC_FONT
#ifdef HAVE_FONTCONFIG_FCFREETYPE_H
#include <fontconfig/fcfreetype.h>
#endif
@ -305,7 +305,7 @@ gfxFT2LockedFace::GetGlyph(PRUint32 aCharCode)
if (NS_UNLIKELY(!mFace))
return 0;
#ifdef CAIRO_HAS_FC_FONT
#ifdef HAVE_FONTCONFIG_FCFREETYPE_H
// FcFreeTypeCharIndex will search starting from the most recently
// selected charmap. This can cause non-determistic behavior when more
// than one charmap supports a character but with different glyphs, as

Просмотреть файл

@ -709,7 +709,7 @@ gfx_pango_fc_font_describe(PangoFont *font)
gfxFcFont *gfxFont = gfxPangoFcFont::GfxFont(self);
if (gfxFont) {
double pixelsize = gfxFont->GetStyle()->size;
double dpi = gfxPlatformGtk::GetPlatformDPI();
double dpi = gfxPlatform::GetDPI();
gint size = moz_pango_units_from_double(pixelsize * dpi / 72.0);
pango_font_description_set_size(result, size);
}
@ -1706,8 +1706,8 @@ gfx_pango_font_map_get_resolution(PangoFcFontMap *fcfontmap,
PangoContext *context)
{
// This merely enables the FC_SIZE field of the pattern to be accurate.
// We use gfxPlatformGtk::GetPlatformDPI() much of the time...
return gfxPlatformGtk::GetPlatformDPI();
// We use gfxPlatform::GetDPI() much of the time...
return gfxPlatform::GetDPI();
}
#ifdef MOZ_WIDGET_GTK2

Просмотреть файл

@ -91,12 +91,6 @@
#include FT_FREETYPE_H
#endif
#ifdef MOZ_PLATFORM_HILDON
#include "nsIPropertyBag2.h"
PRInt32 gfxPlatformGtk::sMaemoClassic = -1;
#endif
PRInt32 gfxPlatformGtk::sPlatformDPI = -1;
gfxFontconfigUtils *gfxPlatformGtk::sFontconfigUtils = nsnull;
#ifndef MOZ_PANGO
@ -529,41 +523,10 @@ gfxPlatformGtk::CreateFontGroup(const nsAString &aFamilies,
void
gfxPlatformGtk::InitDisplayCaps()
{
// Make sure init is run so we have a resolution
GdkScreen *screen = gdk_screen_get_default();
gtk_settings_get_for_screen(screen); // Make sure init is run so we have a resolution
gfxPlatformGtk::sPlatformDPI = PRInt32(round(gdk_screen_get_resolution(screen)));
if (gfxPlatformGtk::sPlatformDPI <= 0) {
// Fall back to something sane
gfxPlatformGtk::sPlatformDPI = 96;
}
#ifdef MOZ_PLATFORM_HILDON
// Check the cached value
if (gfxPlatform::sDPI == -1) {
nsresult rv;
nsCOMPtr<nsIPropertyBag2> infoService = do_GetService("@mozilla.org/system-info;1", &rv);
if (NS_FAILED(rv)) {
NS_ASSERTION(infoService, "Could not find a system info service");
return;
}
nsCString deviceType;
rv = infoService->GetPropertyAsACString(NS_LITERAL_STRING("device"), deviceType);
if (NS_SUCCEEDED(rv)) {
if (deviceType.EqualsLiteral("Nokia N900")) {
gfxPlatform::sDPI = 265; // It's an N900
gfxPlatformGtk::sMaemoClassic = 0;
}
else if (deviceType.EqualsLiteral("Nokia N8xx")) {
gfxPlatform::sDPI = 225; // It's an N810/N800
gfxPlatformGtk::sMaemoClassic = 1;
}
}
}
#else
gfxPlatform::sDPI = gfxPlatformGtk::sPlatformDPI;
#endif
gtk_settings_get_for_screen(screen);
gfxPlatform::sDPI = PRInt32(round(gdk_screen_get_resolution(screen)));
if (gfxPlatform::sDPI <= 0) {
// Fall back to something sane
gfxPlatform::sDPI = 96;

Просмотреть файл

@ -2585,7 +2585,7 @@ AssertValidPropertyCacheHit(JSContext *cx, JSScript *script, JSFrameRegs& regs,
jsval v;
JS_ASSERT(PCVAL_IS_OBJECT(entry->vword));
JS_ASSERT(entry->vword != PCVAL_NULL);
JS_ASSERT(OBJ_SCOPE(pobj)->branded() || OBJ_SCOPE(pobj)->hasMethodBarrier());
JS_ASSERT(OBJ_SCOPE(pobj)->brandedOrHasMethodBarrier());
JS_ASSERT(SPROP_HAS_STUB_GETTER_OR_IS_METHOD(sprop));
JS_ASSERT(SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(pobj)));
v = LOCKED_OBJ_GET_SLOT(pobj, sprop->slot);

Просмотреть файл

@ -629,7 +629,7 @@ END_CASE(JSOP_PICK)
TRACE_2(SetPropHit, entry, sprop); \
if (SPROP_HAS_STUB_SETTER(sprop) && \
(sprop)->slot != SPROP_INVALID_SLOT && \
!OBJ_SCOPE(obj)->branded()) { \
!OBJ_SCOPE(obj)->brandedOrHasMethodBarrier()) { \
/* Fast path for, e.g., plain Object instance properties. */ \
LOCKED_OBJ_SET_SLOT(obj, (sprop)->slot, *vp); \
} else { \
@ -3257,7 +3257,7 @@ BEGIN_CASE(JSOP_LAMBDA)
if (FUN_NULL_CLOSURE(fun)) {
parent = fp->scopeChain;
if (0 && OBJ_GET_PARENT(cx, obj) == parent) {
if (OBJ_GET_PARENT(cx, obj) == parent) {
op = JSOp(regs.pc[JSOP_LAMBDA_LENGTH]);
/*

Просмотреть файл

@ -387,6 +387,15 @@ struct JSScope : public JSObjectMap
bool hasMethodBarrier() { return flags & METHOD_BARRIER; }
void setMethodBarrier() { flags |= METHOD_BARRIER; }
/*
* Test whether this scope may be branded due to method calls, which means
* any assignment to a function-valued property must regenerate shape; else
* test whether this scope has method properties, which require a method
* write barrier.
*/
bool
brandedOrHasMethodBarrier() { return flags & (BRANDED | METHOD_BARRIER); }
bool owned() { return object != NULL; }
};

Просмотреть файл

@ -11182,7 +11182,7 @@ TraceRecorder::setProp(jsval &l, JSPropCacheEntry* entry, JSScopeProperty* sprop
* this, because functions have distinct trace-type from other values and
* branded-ness is implied by the shape, which we've already guarded on.
*/
if (scope->branded() && VALUE_IS_FUNCTION(cx, v) && entry->directHit()) {
if (scope->brandedOrHasMethodBarrier() && VALUE_IS_FUNCTION(cx, v) && entry->directHit()) {
if (obj == globalObj)
RETURN_STOP("can't trace function-valued property set in branded global scope");

Просмотреть файл

@ -1 +1,10 @@
<html><head> <title>test</title></head> <body> <div id="test" style="position: absolute;">test</div> <script type="application/x-javascript">document.getElementById("test").style.position = "fixed";</script> </body> </html>
<html>
<head>
<title>test</title>
</head>
<body>
<div id="test" style="position: absolute;">test</div>
<script type="application/x-javascript">document.getElementById("test").style.position = "fixed";</script>
</body>
</html>

Просмотреть файл

@ -180,33 +180,38 @@ ARENA_POISON_init()
return PR_SUCCESS;
} else {
// Probe 1024 pages (four megabytes, typically) in both directions from
// the baseline address before giving up.
// First see if we can allocate the preferred poison address from the OS.
PRUword candidate = (0xF0DEAFFF & ~(rgnsize-1));
PRUword step = rgnsize;
int direction = +1;
PRUword limit = candidate + 1024*rgnsize;
while (candidate < limit) {
void *result = ReserveRegion(candidate, rgnsize);
if (result == (void *)candidate) {
// success - inaccessible page allocated
ARENA_POISON = candidate + rgnsize/2 - 1;
return PR_SUCCESS;
void *result = ReserveRegion(candidate, rgnsize);
if (result == (void *)candidate) {
// success - inaccessible page allocated
ARENA_POISON = candidate + rgnsize/2 - 1;
return PR_SUCCESS;
}
} else {
if (result != RESERVE_FAILED)
ReleaseRegion(result, rgnsize);
// That didn't work, so see if the preferred address is within a range
// of permanently inacessible memory.
if (ProbeRegion(candidate, rgnsize)) {
// success - selected page cannot be usable memory
ARENA_POISON = candidate + rgnsize/2 - 1;
if (result != RESERVE_FAILED)
ReleaseRegion(result, rgnsize);
return PR_SUCCESS;
}
if (ProbeRegion(candidate, rgnsize)) {
// success - selected page cannot be usable memory
ARENA_POISON = candidate + rgnsize/2 - 1;
return PR_SUCCESS;
}
}
// The preferred address is already in use. Did the OS give us a
// consolation prize?
if (result != RESERVE_FAILED) {
ARENA_POISON = PRUword(result) + rgnsize/2 - 1;
return PR_SUCCESS;
}
candidate += step*direction;
step = step + rgnsize;
direction = -direction;
// It didn't, so try to allocate again, without any constraint on
// the address.
result = ReserveRegion(0, rgnsize);
if (result != RESERVE_FAILED) {
ARENA_POISON = PRUword(result) + rgnsize/2 - 1;
return PR_SUCCESS;
}
NS_RUNTIMEABORT("no usable poison region identified");

Просмотреть файл

@ -1900,6 +1900,8 @@ PresShell::Destroy()
mCurrentEventFrameStack[i] = nsnull;
}
mFramesToDirty.Clear();
if (mViewManager) {
// Clear the view manager's weak pointer back to |this| in case it
// was leaked.
@ -2862,6 +2864,29 @@ PresShell::NotifyDestroyingFrame(nsIFrame* aFrame)
// Remove frame properties
mPresContext->PropertyTable()->DeleteAllPropertiesFor(aFrame);
if (aFrame == mCurrentEventFrame) {
mCurrentEventContent = aFrame->GetContent();
mCurrentEventFrame = nsnull;
}
#ifdef NS_DEBUG
if (aFrame == mDrawEventTargetFrame) {
mDrawEventTargetFrame = nsnull;
}
#endif
for (unsigned int i=0; i < mCurrentEventFrameStack.Length(); i++) {
if (aFrame == mCurrentEventFrameStack.ElementAt(i)) {
//One of our stack frames was deleted. Get its content so that when we
//pop it we can still get its new frame from its content
nsIContent *currentEventContent = aFrame->GetContent();
mCurrentEventContentStack.ReplaceObjectAt(currentEventContent, i);
mCurrentEventFrameStack[i] = nsnull;
}
}
mFramesToDirty.RemoveEntry(aFrame);
}
return NS_OK;
@ -3633,29 +3658,6 @@ NS_IMETHODIMP
PresShell::ClearFrameRefs(nsIFrame* aFrame)
{
mPresContext->EventStateManager()->ClearFrameRefs(aFrame);
if (aFrame == mCurrentEventFrame) {
mCurrentEventContent = aFrame->GetContent();
mCurrentEventFrame = nsnull;
}
#ifdef NS_DEBUG
if (aFrame == mDrawEventTargetFrame) {
mDrawEventTargetFrame = nsnull;
}
#endif
for (unsigned int i=0; i < mCurrentEventFrameStack.Length(); i++) {
if (aFrame == mCurrentEventFrameStack.ElementAt(i)) {
//One of our stack frames was deleted. Get its content so that when we
//pop it we can still get its new frame from its content
nsIContent *currentEventContent = aFrame->GetContent();
mCurrentEventContentStack.ReplaceObjectAt(currentEventContent, i);
mCurrentEventFrameStack[i] = nsnull;
}
}
mFramesToDirty.RemoveEntry(aFrame);
nsWeakFrame* weakFrame = mWeakFrames;
while (weakFrame) {

Просмотреть файл

@ -303,35 +303,42 @@ ReservePoisonArea()
printf("INFO | poison area assumed at 0x%.*"PRIxPTR"\n", SIZxPTR, result);
return result;
} else {
// Probe 1024 pages (four megabytes, typically) in both directions from
// the baseline address before giving up.
uintptr_t candidate = (0xF0DEAFFF & ~(uintptr_t)(PAGESIZE-1));
uintptr_t step = PAGESIZE;
intptr_t direction = +1;
uintptr_t limit = candidate + 1024*PAGESIZE;
while (candidate < limit) {
void *result = ReserveRegion(candidate, false);
if (result == (void *)candidate) {
// success - inaccessible page allocated
printf("INFO | poison area allocated at 0x%.*"PRIxPTR"\n",
SIZxPTR, (uintptr_t)result);
return candidate;
// First see if we can allocate the preferred poison address from the OS.
uintptr_t candidate = (0xF0DEAFFF & ~(PAGESIZE-1));
void *result = ReserveRegion(candidate, false);
if (result == (void *)candidate) {
// success - inaccessible page allocated
printf("INFO | poison area allocated at 0x%.*"PRIxPTR
" (preferred addr)\n", SIZxPTR, (uintptr_t)result);
return candidate;
}
} else {
if (result != MAP_FAILED)
ReleaseRegion(result);
// That didn't work, so see if the preferred address is within a range
// of permanently inacessible memory.
if (ProbeRegion(candidate)) {
// success - selected page cannot be usable memory
if (result != MAP_FAILED)
ReleaseRegion(result);
printf("INFO | poison area assumed at 0x%.*"PRIxPTR
" (preferred addr)\n", SIZxPTR, candidate);
return candidate;
}
if (ProbeRegion(candidate)) {
// success - selected page cannot be usable memory
printf("INFO | poison area probed at 0x%.*"PRIxPTR" | %s\n",
SIZxPTR, candidate, LastErrMsg());
return candidate;
}
}
// The preferred address is already in use. Did the OS give us a
// consolation prize?
if (result != MAP_FAILED) {
printf("INFO | poison area allocated at 0x%.*"PRIxPTR
" (consolation prize)\n", SIZxPTR, (uintptr_t)result);
return (uintptr_t)result;
}
candidate += step*direction;
step = step + PAGESIZE;
direction = -direction;
// It didn't, so try to allocate again, without any constraint on
// the address.
result = ReserveRegion(0, false);
if (result != MAP_FAILED) {
printf("INFO | poison area allocated at 0x%.*"PRIxPTR
" (fallback)\n", SIZxPTR, (uintptr_t)result);
return (uintptr_t)result;
}
printf("ERROR | no usable poison area found\n");

Просмотреть файл

@ -2675,6 +2675,7 @@ nsTextControlFrame::SetValue(const nsAString& aValue)
flags &= ~(nsIPlaintextEditor::eEditorDisabledMask);
flags &= ~(nsIPlaintextEditor::eEditorReadonlyMask);
flags |= nsIPlaintextEditor::eEditorUseAsyncUpdatesMask;
flags |= nsIPlaintextEditor::eEditorDontEchoPassword;
editor->SetFlags(flags);
// Also don't enforce max-length here

Просмотреть файл

@ -2218,6 +2218,7 @@ NS_IMETHODIMP nsFrame::HandleDrag(nsPresContext* aPresContext,
getter_AddRefs(parentContent),
&contentOffset, &target);
nsWeakFrame weakThis = this;
if (NS_SUCCEEDED(result) && parentContent) {
frameselection->HandleTableSelection(parentContent, contentOffset, target, me);
} else {
@ -2225,6 +2226,12 @@ NS_IMETHODIMP nsFrame::HandleDrag(nsPresContext* aPresContext,
frameselection->HandleDrag(this, pt);
}
// The frameselection object notifies selection listeners synchronously above
// which might have killed us.
if (!weakThis.IsAlive()) {
return NS_OK;
}
// get the nearest scrollframe
nsIFrame* checkFrame = this;
nsIScrollableFrame *scrollFrame = nsnull;

Просмотреть файл

@ -2108,6 +2108,12 @@ GetMIMEType(nsIPluginInstance *aPluginInstance)
static PRBool
DoDelayedStop(nsPluginInstanceOwner *aInstanceOwner, PRBool aDelayedStop)
{
#ifdef MOZ_PLATFORM_HILDON
// Don't delay stop on Maemo/Hildon (bug 530739).
if (aDelayedStop && aInstanceOwner->MatchPluginName("Shockwave Flash"))
return PR_FALSE;
#endif
// Don't delay stopping QuickTime (bug 425157), Flip4Mac (bug 426524),
// XStandard (bug 430219), CMISS Zinc (bug 429604).
if (aDelayedStop
@ -5788,7 +5794,7 @@ nsPluginInstanceOwner::SetAbsoluteScreenPosition(nsIDOMElement* element,
PRBool simpleImageRender = PR_FALSE;
mInstance->GetValueFromPlugin(NPPVpluginWindowlessLocalBool,
&simpleImageRender);
if (mInstance)
if (simpleImageRender)
NativeImageDraw();
return NS_OK;
}

Просмотреть файл

@ -164,7 +164,8 @@ inDOMUtils::GetCSSStyleRules(nsIDOMElement *aElement,
nsRuleNode* ruleNode = nsnull;
nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
GetRuleNodeForContent(content, &ruleNode);
nsRefPtr<nsStyleContext> styleContext;
GetRuleNodeForContent(content, getter_AddRefs(styleContext), &ruleNode);
if (!ruleNode) {
// This can fail for content nodes that are not in the document or
// if the document they're in doesn't have a presshell. Bail out.
@ -271,9 +272,12 @@ inDOMUtils::GetContentState(nsIDOMElement *aElement, PRInt32* aState)
}
/* static */ nsresult
inDOMUtils::GetRuleNodeForContent(nsIContent* aContent, nsRuleNode** aRuleNode)
inDOMUtils::GetRuleNodeForContent(nsIContent* aContent,
nsStyleContext** aStyleContext,
nsRuleNode** aRuleNode)
{
*aRuleNode = nsnull;
*aStyleContext = nsnull;
nsIDocument* doc = aContent->GetDocument();
NS_ENSURE_TRUE(doc, NS_ERROR_UNEXPECTED);
@ -284,5 +288,6 @@ inDOMUtils::GetRuleNodeForContent(nsIContent* aContent, nsRuleNode** aRuleNode)
nsRefPtr<nsStyleContext> sContext =
nsComputedDOMStyle::GetStyleContextForContent(aContent, nsnull, presShell);
*aRuleNode = sContext->GetRuleNode();
sContext.forget(aStyleContext);
return NS_OK;
}

Просмотреть файл

@ -44,6 +44,7 @@
#include "nsISupportsArray.h"
class nsRuleNode;
class nsStyleContext;
class inDOMUtils : public inIDOMUtils
{
@ -55,7 +56,9 @@ public:
virtual ~inDOMUtils();
private:
// aStyleContext must be released by the caller once he's done with aRuleNode.
static nsresult GetRuleNodeForContent(nsIContent* aContent,
nsStyleContext** aStyleContext,
nsRuleNode** aRuleNode);
};

Просмотреть файл

@ -139,7 +139,6 @@ nsComputedDOMStyle::nsComputedDOMStyle()
nsComputedDOMStyle::~nsComputedDOMStyle()
{
ClearWrapper();
}
void
@ -154,20 +153,7 @@ nsComputedDOMStyle::Shutdown()
}
NS_IMPL_CYCLE_COLLECTION_CLASS(nsComputedDOMStyle)
NS_IMPL_CYCLE_COLLECTION_ROOT_BEGIN(nsComputedDOMStyle)
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_ROOT_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsComputedDOMStyle)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mContent)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsComputedDOMStyle)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsComputedDOMStyle)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mContent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_1(nsComputedDOMStyle, mContent)
// QueryInterface implementation for nsComputedDOMStyle
NS_INTERFACE_TABLE_HEAD(nsComputedDOMStyle)

Просмотреть файл

@ -61,7 +61,7 @@ class nsComputedDOMStyle : public nsICSSDeclaration,
{
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsComputedDOMStyle)
NS_DECL_CYCLE_COLLECTION_CLASS(nsComputedDOMStyle)
NS_IMETHOD Init(nsIDOMElement *aElement,
const nsAString& aPseudoElt,

Просмотреть файл

@ -72,24 +72,7 @@ nsDOMCSSAttributeDeclaration::~nsDOMCSSAttributeDeclaration()
MOZ_COUNT_DTOR(nsDOMCSSAttributeDeclaration);
}
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMCSSAttributeDeclaration)
NS_IMPL_CYCLE_COLLECTION_ROOT_BEGIN(nsDOMCSSAttributeDeclaration)
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_ROOT_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMCSSAttributeDeclaration)
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mContent)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsDOMCSSAttributeDeclaration)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMCSSAttributeDeclaration)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mContent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_1(nsDOMCSSAttributeDeclaration, mContent)
NS_INTERFACE_MAP_BEGIN(nsDOMCSSAttributeDeclaration)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY

Просмотреть файл

@ -61,7 +61,7 @@ public:
~nsDOMCSSAttributeDeclaration();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMCSSAttributeDeclaration)
NS_DECL_CYCLE_COLLECTION_CLASS(nsDOMCSSAttributeDeclaration)
// If GetCSSDeclaration returns non-null, then the decl it returns
// is owned by our current style rule.

Просмотреть файл

@ -2109,9 +2109,17 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
return NPERR_GENERIC_ERROR;
}
#else
case NPNVDOMElement:
// fall through
case NPNVDOMWindow:
// fall through
#endif /* WINCE */
case NPNVserviceManager: // old XPCOM object, no longer supported
case NPNVserviceManager:
// old XPCOM objects, no longer supported, but null out the out
// param to avoid crashing plugins that still try to use this.
*(nsISupports**)result = nsnull;
// fall through
default:
return NPERR_GENERIC_ERROR;
}
@ -2476,9 +2484,9 @@ _getvalueforurl(NPP instance, NPNURLVariable variable, const char *url,
}
nsXPIDLCString cookieStr;
if (NS_FAILED(cookieService->GetCookieString(uri, nsnull,
getter_Copies(cookieStr))) ||
!cookieStr) {
nsresult cookieReturn = cookieService->GetCookieString(uri, nsnull,
getter_Copies(cookieStr));
if (NS_FAILED(cookieReturn) || !cookieStr) {
return NPERR_GENERIC_ERROR;
}

Просмотреть файл

@ -121,7 +121,7 @@ function checkValueAndTrigger(request, data, ctx) {
if (index < tests.length - 1) {
var delay = tests[index++].delay;
if (delay) {
do_timeout(delay, "triggerNextTest()");
do_timeout(delay, triggerNextTest);
} else {
triggerNextTest();
}

Просмотреть файл

@ -21,7 +21,7 @@ TestListener.prototype.onStartRequest = function(request, context) {
TestListener.prototype.onStopRequest = function(request, context, status) {
change_content_type();
do_timeout(0, "after_channel_closed()");
do_timeout(0, after_channel_closed);
}
function after_channel_closed() {

Просмотреть файл

@ -59,7 +59,7 @@ var copyObserver =
do_check_true(test_source_closed);
}
do_timeout(0, "do_test();");
do_timeout(0, do_test);
},
QueryInterface: function(aIID)
@ -119,8 +119,9 @@ function do_test() {
pipe1.outputStream.write(test_content, test_content.length);
pipe1.outputStream.flush();
do_timeout(20,
"copier.cancel(test_result);" +
"pipe1.outputStream.write(\"a\", 1);");
function(){
copier.cancel(test_result);
pipe1.outputStream.write("a", 1);});
break;
case 5:
case 6: // close sink
@ -156,10 +157,12 @@ function do_test() {
// we will close the sink
test_sink_closed = true;
do_timeout(20,
"pipe2.outputStream" +
" .QueryInterface(Ci.nsIAsyncOutputStream)" +
" .closeWithStatus(test_result);" +
"pipe1.outputStream.write(\"a\", 1);");
function()
{
pipe2.outputStream
.QueryInterface(Ci.nsIAsyncOutputStream)
.closeWithStatus(test_result);
pipe1.outputStream.write("a", 1);});
break;
case 13:
do_test_finished();
@ -169,6 +172,6 @@ function do_test() {
function run_test() {
test_nr = 0;
do_timeout(0, "do_test();");
do_timeout(0, do_test);
do_test_pending();
}

Просмотреть файл

@ -35,7 +35,7 @@ var listener = {
do_check_eq(buffer, "0123456789");
do_check_eq(observers_called, results[test_nr]);
test_nr++;
do_timeout(0, "do_test();");
do_timeout(0, do_test);
}
};
@ -53,7 +53,7 @@ function run_test() {
obs.addObserver(observer, "http-on-examine-merged-response", false);
obs.addObserver(observer, "http-on-examine-cached-response", false);
do_timeout(0, "do_test();");
do_timeout(0, do_test);
do_test_pending();
}

Просмотреть файл

@ -72,7 +72,7 @@ function checkValueAndTrigger(request, data, ctx) {
index++;
// this call happens in onStopRequest from the channel, and opening a
// new channel to the same url here is no good idea... post it instead
do_timeout(1, "triggerNextTest();");
do_timeout(1, triggerNextTest);
} else {
httpserver.stop(do_test_finished);
}

Просмотреть файл

@ -57,7 +57,7 @@ Test.prototype = {
do_check_eq(this._isFromCache, this.readFromCache);
do_check_eq(gHitServer, this.hitServer);
do_timeout(0, "run_next_test();");
do_timeout(0, run_next_test);
},
run: function() {

Просмотреть файл

@ -77,7 +77,7 @@ var listener = {
// Once onStopRequest is reached, the channel is marked as having been
// opened
check_async_open_throws(NS_ERROR_ALREADY_OPENED);
do_timeout(0, "after_channel_closed()");
do_timeout(0, after_channel_closed);
}
};

Просмотреть файл

@ -49,5 +49,5 @@ function run_test() {
do_check_true(true);
do_test_pending();
do_timeout(100, "do_test_finished();");
do_timeout(100, do_test_finished);
}

Просмотреть файл

@ -75,13 +75,13 @@ if ("@mozilla.org/toolkit/crash-reporter;1" in Components.classes) {
function _TimerCallback(expr, timer) {
this._expr = expr;
this._func = typeof expr === "function"
? expr
: function() { eval(expr); };
// Keep timer alive until it fires
_pendingCallbacks.push(timer);
}
_TimerCallback.prototype = {
_expr: "",
QueryInterface: function(iid) {
if (iid.Equals(Components.interfaces.nsITimerCallback) ||
iid.Equals(Components.interfaces.nsISupports))
@ -92,7 +92,7 @@ _TimerCallback.prototype = {
notify: function(timer) {
_pendingCallbacks.splice(_pendingCallbacks.indexOf(timer), 1);
eval(this._expr);
this._func.call(null);
}
};

Просмотреть файл

@ -91,6 +91,9 @@ public:
nsDownloadManager() :
mDBType(DATABASE_DISK)
, mInPrivateBrowsing(PR_FALSE)
#ifdef DOWNLOAD_SCANNER
, mScanner(nsnull)
#endif
{
}

Просмотреть файл

@ -58,7 +58,7 @@ function checkResult() {
// Need to poll RecentDocs value because the SHAddToRecentDocs call
// doesn't update the registry immediately.
do_timeout(POLL_REGISTRY_TIMEOUT, "pollRecentDocs();");
do_timeout(POLL_REGISTRY_TIMEOUT, pollRecentDocs);
}
var gPollsCount = 0;
@ -74,7 +74,7 @@ function pollRecentDocs() {
do_test_finished();
}
else
do_timeout(POLL_REGISTRY_TIMEOUT, "pollRecentDocs();");
do_timeout(POLL_REGISTRY_TIMEOUT, pollRecentDocs);
}
function checkRecentDocsFor(aFileName) {

Просмотреть файл

@ -63,7 +63,7 @@ function run_test() {
do_test_pending();
gItemId1 = bmsvc.insertBookmark(gTestRoot, gURI, bmsvc.DEFAULT_INDEX, "");
do_timeout(100, "phase2();");
do_timeout(100, phase2);
}
function phase2() {
@ -71,7 +71,7 @@ function phase2() {
var b = bmsvc.getBookmarkIdsForURI(gURI);
do_check_eq(b[0], gItemId2);
do_check_eq(b[1], gItemId1);
do_timeout(100, "phase3();");
do_timeout(100, phase3);
}
function phase3() {

Просмотреть файл

@ -567,6 +567,8 @@ function flush_main_thread_events()
// flushes are active, so we turn off syncing for them.
let randomFailingSyncTests = [
"test_results-as-visit.js",
"test_sorting.js",
"test_redirectsMode.js",
];
let currentTestFilename = do_get_file(_TEST_FILE[0], true).leafName;
if (randomFailingSyncTests.indexOf(currentTestFilename) != -1) {

Просмотреть файл

@ -97,7 +97,7 @@ var observer = {
// The database connection will be closed after this sync, but we can't
// know how much time it will take, so we use a polling strategy.
do_timeout(POLLING_TIMEOUT_MS, "check_results();");
do_timeout(POLLING_TIMEOUT_MS, check_results);
}
}
}
@ -111,7 +111,7 @@ function check_results() {
}
if (hs.QueryInterface(Ci.nsPIPlacesDatabase).DBConnection.connectionReady) {
do_timeout(POLLING_TIMEOUT_MS, "check_results();");
do_timeout(POLLING_TIMEOUT_MS, check_results);
return;
}

Просмотреть файл

@ -305,6 +305,8 @@ let randomFailingSyncTests = [
"test_removeVisitsByTimeframe.js",
"test_tagging.js",
"test_utils_getURLsForContainerNode.js",
"test_exclude_livemarks.js",
"test_402799.js",
];
let currentTestFilename = do_get_file(_TEST_FILE[0], true).leafName;
if (randomFailingSyncTests.indexOf(currentTestFilename) != -1) {

Просмотреть файл

@ -85,7 +85,7 @@ function run_test() {
ghist.addURI(testURI, false, true, null);
ghist.addURI(testURI, false, true, testURI);
// lazy message timer is 3000, see LAZY_MESSAGE_TIMEOUT
do_timeout(3500, "confirm_results();");
do_timeout(3500, confirm_results);
}
function confirm_results() {

Просмотреть файл

@ -124,7 +124,7 @@ function run_test() {
do_test_pending();
// lazy timeout is 3s and favicons are lazy added
do_timeout(3500, "end_test();");
do_timeout(3500, end_test);
}
function end_test() {

Просмотреть файл

@ -77,5 +77,5 @@ function run_test() {
bs.DEFAULT_INDEX, "bookmark");
do_test_pending();
do_timeout(1000, "verify();");
do_timeout(1000, verify);
}

Просмотреть файл

@ -527,7 +527,7 @@ function startExpireNeither() {
// Changing expiration preferences triggers partial expiration.
// Check results.
do_timeout(600, "checkExpireNeither();");
do_timeout(600, checkExpireNeither);
}
function checkExpireNeither() {
@ -588,7 +588,7 @@ function startExpireDaysOnly() {
// Changing expiration preferences triggers partial expiration.
// Check results.
do_timeout(600, "checkExpireDaysOnly();");
do_timeout(600, checkExpireDaysOnly);
}
function checkExpireDaysOnly() {
@ -658,7 +658,7 @@ function startExpireBoth() {
// Changing expiration preferences triggers partial expiration.
// Check results.
do_timeout(600, "checkExpireBoth();"); // incremental expiration timer is 3500
do_timeout(600, checkExpireBoth); // incremental expiration timer is 3500
}
function checkExpireBoth() {
@ -716,7 +716,7 @@ function startExpireNeitherOver() {
// Changing expiration preferences triggers partial expiration.
// Check results.
do_timeout(600, "checkExpireNeitherOver();");
do_timeout(600, checkExpireNeitherOver);
}
function checkExpireNeitherOver() {
@ -765,7 +765,7 @@ function startExpireHistoryDisabled() {
// Changing expiration preferences triggers partial expiration.
// Check results.
do_timeout(600, "checkExpireHistoryDisabled();");
do_timeout(600, checkExpireHistoryDisabled);
}
function checkExpireHistoryDisabled() {
@ -817,7 +817,7 @@ function startExpireBadPrefs() {
// Changing expiration preferences triggers partial expiration.
// Check results.
do_timeout(600, "checkExpireBadPrefs();");
do_timeout(600, checkExpireBadPrefs);
}
function checkExpireBadPrefs() {

Просмотреть файл

@ -77,5 +77,5 @@ function run_test() {
hs.TRANSITION_TYPED, false, 0);
do_test_pending();
do_timeout(1000, "verify();");
do_timeout(1000, verify);
}

Просмотреть файл

@ -133,7 +133,7 @@ function run_test()
// test too soon the timestamp will be the same! So, we'll wait a short
// period of time to make sure the timestamp will differ.
do_test_pending();
do_timeout(50, "delayed_test()");
do_timeout(50, delayed_test);
} catch (e) {
throw "FAILED in test #" + testnum + " -- " + e;

Просмотреть файл

@ -1219,7 +1219,10 @@ Engine.prototype = {
var dialogMessage =
stringBundle.formatStringFromName("addEngineConfirmation",
[this._name, this._uri.host], 2);
var checkboxMessage = stringBundle.GetStringFromName("addEngineUseNowText");
var checkboxMessage = null;
if (!getBoolPref(BROWSER_SEARCH_PREF + "noCurrentEngine", false))
checkboxMessage = stringBundle.GetStringFromName("addEngineUseNowText");
var addButtonLabel =
stringBundle.GetStringFromName("addEngineAddButtonLabel");

Просмотреть файл

@ -42,7 +42,7 @@ function LightweightThemeConsumer(aDocument) {
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)
.addObserver(this, "lightweight-theme-changed", false);
.addObserver(this, "lightweight-theme-styling-update", false);
var temp = {};
Components.utils.import("resource://gre/modules/LightweightThemeManager.jsm", temp);
@ -51,7 +51,7 @@ function LightweightThemeConsumer(aDocument) {
LightweightThemeConsumer.prototype = {
observe: function (aSubject, aTopic, aData) {
if (aTopic != "lightweight-theme-changed")
if (aTopic != "lightweight-theme-styling-update")
return;
this._update(JSON.parse(aData));
@ -60,7 +60,7 @@ LightweightThemeConsumer.prototype = {
destroy: function () {
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)
.removeObserver(this, "lightweight-theme-changed");
.removeObserver(this, "lightweight-theme-styling-update");
this._doc = null;
},

Просмотреть файл

@ -50,6 +50,7 @@ _TEST_FILES = test_bug360220.xul \
test_bug382990.xul \
test_bug457632.xul \
test_bug460942.xul \
test_bug509732.xul \
test_button.xul \
test_closemenu_attribute.xul \
test_colorpicker_popup.xul \

Просмотреть файл

@ -0,0 +1,54 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
<!--
XUL Widget Test for bug 509732
-->
<window title="Bug 509732" width="500" height="600"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="/MochiKit/packed.js"></script>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<notificationbox id="nb" hidden="true"/>
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"
onload="test()"/>
<!-- test code goes here -->
<script type="application/javascript">
<![CDATA[
var gNotificationBox;
// Tests that a notification that is added in an hidden box didn't throw the animation
function test() {
SimpleTest.waitForExplicitFinish();
gNotificationBox = document.getElementById("nb");
is(gNotificationBox.allNotifications.length, 0, "There should be no initial notifications");
gNotificationBox.appendNotification("Test notification",
"notification1", null,
gNotificationBox.PRIORITY_INFO_LOW,
null);
is(gNotificationBox.allNotifications.length, 1, "Notification exists");
is(gNotificationBox._timer, null, "Notification timer should be null");
test1();
}
// Tests that a notification that is removed from an hidden box didn't throw the animation
function test1() {
let notification = gNotificationBox.getNotificationWithValue("notification1");
gNotificationBox.removeNotification(notification);
ok(!gNotificationBox.currentNotification, "Test 1 should show no current animation");
is(gNotificationBox._timer, null, "Notification timer should be null");
is(gNotificationBox.allNotifications.length, 0, "Test 1 should show no notifications present");
SimpleTest.finish();
}
]]>
</script>
</window>

Просмотреть файл

@ -64,7 +64,7 @@
<![CDATA[
var notifications = this.allNotifications;
for (var n = notifications.length - 1; n >= 0; n--) {
if (aValue == notifications[n].value)
if (aValue == notifications[n].getAttribute("value"))
return notifications[n];
}
return null;
@ -220,6 +220,7 @@
}
var height = aNotification.boxObject.height;
var skipAnimation = (height == 0);
var change = height / this.slideSteps;
var margin;
if (aSlideIn) {
@ -230,6 +231,12 @@
this.currentNotification = aNotification;
aNotification.style.removeProperty("position");
aNotification.style.removeProperty("top");
if (skipAnimation) {
this._setBlockingState(this.currentNotification);
return;
}
aNotification.style.marginTop = -height + "px";
aNotification.style.opacity = 0;
margin = -height;
@ -239,10 +246,15 @@
this._closedNotification = aNotification;
var notifications = this.allNotifications;
var idx = notifications.length - 1;
if (idx >= 0)
this.currentNotification = notifications[idx];
else
this.currentNotification = null;
this.currentNotification = (idx >= 0) ? notifications[idx] : null;
if (skipAnimation) {
this.removeChild(this._closedNotification);
this._closedNotification = null;
this._setBlockingState(this.currentNotification);
return;
}
var style = window.getComputedStyle(aNotification, null);
margin = style.getPropertyCSSValue("margin-top").
getFloatValue(CSSPrimitiveValue.CSS_PX);

Просмотреть файл

@ -171,9 +171,9 @@
// Hide the emptytext for a bit, in case the textbox will be focused subsequently
this.inputField.setAttribute("emptytextdelay", "true");
setTimeout(function (textbox) {
textbox.inputField.removeAttribute("emptytextdelay");
}, 100, this);
setTimeout(function (input) {
input.removeAttribute("emptytextdelay");
}, 100, this.inputField);
try {
this.editor.transactionManager.beginBatch();

Просмотреть файл

@ -133,6 +133,7 @@ var LightweightThemeManager = {
_prefs.setBoolPref("isThemeSelected", aData != null);
_notifyWindows(aData);
_observerService.notifyObservers(null, "lightweight-theme-changed", null);
if (PERSIST_ENABLED && aData)
_persistImages(aData);
@ -282,7 +283,7 @@ function _updateUsedThemes(aList) {
}
function _notifyWindows(aThemeData) {
_observerService.notifyObservers(null, "lightweight-theme-changed",
_observerService.notifyObservers(null, "lightweight-theme-styling-update",
JSON.stringify(aThemeData));
}

Просмотреть файл

@ -362,7 +362,7 @@ function run_test() {
do_test_pending();
// Give time for phone home to complete.
do_timeout(DELAY, "run_test_pt2()");
do_timeout(DELAY, run_test_pt2);
}
/**

Просмотреть файл

@ -437,7 +437,7 @@ var WindowWatcher = {
gNewBlocks.push(list[i].name + " " + list[i].version);
// Call the callback after the blocklist has finished up
do_timeout(0, "gCallback()");
do_timeout(0, gCallback);
},
QueryInterface: function(iid) {

Просмотреть файл

@ -174,7 +174,7 @@ var WindowWatcher = {
}
// Call the next test after the blocklist has finished up
do_timeout(0, "gTestCheck()");
do_timeout(0, gTestCheck);
},
QueryInterface: function(iid) {

Просмотреть файл

@ -107,7 +107,7 @@ var WindowWatcher = {
do_check_neq(item.name, "test_bug514327_outdated");
// Call the next test after the blocklist has finished up
do_timeout(0, "gNextTestPart()");
do_timeout(0, gNextTestPart);
},
QueryInterface: function(iid) {

Просмотреть файл

@ -345,8 +345,10 @@ BOOL nsInstallerDlg::SilentFirstRun()
NULL, NULL, FALSE, 0, NULL, NULL, NULL, &pi);
if (bResult)
{
// Wait for it to finish
WaitForSingleObject(pi.hProcess, INFINITE);
// Wait for it to finish (since the system is likely to be busy
// while it launches anyways). The process may never terminate
// if FastStart is enabled, so don't wait longer than 10 seconds.
WaitForSingleObject(pi.hProcess, 10000);
}
SetWindowText(GetDlgItem(m_hDlg, IDC_STATUS_TEXT), L"");
return bResult;

Просмотреть файл

@ -603,7 +603,7 @@ xhr.prototype = {
responseXML: null,
responseText: null,
send: function(body) {
do_timeout(0, "gXHRCallback()"); // Use a timeout so the XHR completes
do_timeout(0, gXHRCallback); // Use a timeout so the XHR completes
},
_onprogress: null,
set onprogress(val) { gXHR._onprogress = val; },
@ -656,7 +656,7 @@ const updateCheckListener = {
"update.statusText = " + request.statusText + ", " +
"updateCount = " + updateCount + "\n");
// Use a timeout to allow the XHR to complete
do_timeout(0, "gCheckFunc()");
do_timeout(0, gCheckFunc);
},
onError: function(request, update) {
@ -667,7 +667,7 @@ const updateCheckListener = {
"request.status = " + gStatusCode + ", " +
"update.statusText = " + gStatusText + "\n");
// Use a timeout to allow the XHR to complete
do_timeout(0, "gCheckFunc()");
do_timeout(0, gCheckFunc);
},
QueryInterface: function(aIID) {

Просмотреть файл

@ -52,7 +52,7 @@ function run_test() {
overrideXHR(callHandleEvent);
startAUS();
startUpdateChecker();
do_timeout(0, "run_test_pt1()");
do_timeout(0, run_test_pt1);
}
function end_test() {

Просмотреть файл

@ -52,7 +52,7 @@ function run_test() {
startUpdateChecker();
// The HTTP server is only used for the mar file downloads which is slow
start_httpserver(DIR_DATA);
do_timeout(0, "run_test_pt1()");
do_timeout(0, run_test_pt1);
}
function end_test() {
@ -218,7 +218,7 @@ const downloadListener = {
onStopRequest: function(request, context, status) {
gStatusResult = status;
// Use a timeout to allow the request to complete
do_timeout(0, "gCheckFunc()");
do_timeout(0, gCheckFunc);
},
QueryInterface: function(iid) {

Просмотреть файл

@ -57,7 +57,7 @@ function run_test() {
gAppInfo = AUS_Cc["@mozilla.org/xre/app-info;1"].
getService(AUS_Ci.nsIXULAppInfo).
QueryInterface(AUS_Ci.nsIXULRuntime);
do_timeout(0, "run_test_pt1()");
do_timeout(0, run_test_pt1);
}
function end_test() {

Просмотреть файл

@ -56,7 +56,7 @@ function run_test() {
getPrefBranch().setCharPref(PREF_APP_UPDATE_URL_OVERRIDE,
URL_HOST + "update.xml");
overrideXHR(callHandleEvent);
do_timeout(0, "run_test_pt1()");
do_timeout(0, run_test_pt1);
}
function end_test() {

Просмотреть файл

@ -72,7 +72,7 @@ function run_test() {
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1.0", "2.0");
setDefaultPrefs();
do_timeout(0, "run_test_pt1()");
do_timeout(0, run_test_pt1);
}
function end_test() {
@ -111,7 +111,7 @@ function run_test_pt1() {
do_check_true(privBrowsing.autoStarted);
// Use a timeout to give private browsing time to reset necko.
do_timeout(0, "run_test_pt2()");
do_timeout(0, run_test_pt2);
}
function run_test_pt2() {
dump("Testing: update count should equal 1\n");

Просмотреть файл

@ -161,7 +161,7 @@ function end_test() {
}
function run_test1thru6() {
gNextFunc = "check_test1thru6()";
gNextFunc = check_test1thru6;
// bogus default interval
gCompReg.registerFactory(TESTS[0].classID, TESTS[0].desc,
TESTS[0].contractID, gTest1Factory);
@ -271,11 +271,11 @@ function check_test1thru6() {
"registered\n");
do_check_eq(count, 0);
do_timeout(0, "run_test7()");
do_timeout(0, run_test7());
}
function run_test7() {
gNextFunc = "check_test7()";
gNextFunc = check_test7;
gPref.setIntPref(PREF_BRANCH_LAST_UPDATE_TIME + TESTS[6].timerID, 1);
gCompReg.registerFactory(TESTS[6].classID, TESTS[6].desc,
TESTS[6].contractID, gTest7Factory);
@ -386,7 +386,7 @@ var gTest6Factory = {
var gTest7TimerCallback = {
notify: function T7CB_notify(aTimer) {
TESTS[6].notified = true;
do_timeout(0, "check_test7()");
do_timeout(0, check_test7);
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
};

Просмотреть файл

@ -58,7 +58,7 @@ function checkFile() {
}
else {
// Wait a bit longer then try again
do_timeout(1000, "checkFile()");
do_timeout(1000, checkFile);
}
}
@ -155,5 +155,5 @@ function run_test() {
localHandler.launchWithURI(uri);
do_test_pending();
do_timeout(1000, "checkFile()");
do_timeout(1000, checkFile);
}

Просмотреть файл

@ -990,7 +990,8 @@ moz_gtk_button_paint(GdkDrawable* drawable, GdkRectangle* rect,
}
if (relief != GTK_RELIEF_NONE || state->depressed ||
button_state == GTK_STATE_PRELIGHT) {
(button_state != GTK_STATE_NORMAL &&
button_state != GTK_STATE_INSENSITIVE)) {
TSOffsetStyleGCs(style, x, y);
/* the following line can trigger an assertion (Crux theme)
file ../../gdk/gdkwindow.c: line 1846 (gdk_window_clear_area):

Просмотреть файл

@ -46,6 +46,7 @@
#include "nsIServiceManager.h"
#include "nsImageToPixbuf.h"
#include "nsStringStream.h"
#include "nsIObserverService.h"
#include "imgIContainer.h"
@ -62,19 +63,18 @@
#include <poll.h>
#endif
// Callback when someone asks us for the selection
// Callback when someone asks us for the data
void
invisible_selection_get_cb (GtkWidget *aWidget,
GtkSelectionData *aSelectionData,
guint aTime,
guint aInfo,
nsClipboard *aClipboard);
gboolean
selection_clear_event_cb (GtkWidget *aWidget,
GdkEventSelection *aEvent,
nsClipboard *aClipboard);
clipboard_get_cb(GtkClipboard *aGtkClipboard,
GtkSelectionData *aSelectionData,
guint info,
gpointer user_data);
// Callback when someone asks us to clear a clipboard
void
clipboard_clear_cb(GtkClipboard *aGtkClipboard,
gpointer user_data);
static void
ConvertHTMLtoUCS2 (guchar *data,
PRInt32 dataLength,
@ -121,33 +121,46 @@ clipboard_text_received(GtkClipboard *clipboard,
gpointer data);
nsClipboard::nsClipboard()
{
mWidget = nsnull;
{
}
nsClipboard::~nsClipboard()
{
if (mWidget)
gtk_widget_destroy(mWidget);
}
NS_IMPL_ISUPPORTS1(nsClipboard, nsIClipboard)
nsresult
nsClipboard::Init(void)
{
nsresult rv;
nsCOMPtr<nsIObserverService> os
(do_GetService("@mozilla.org/observer-service;1", &rv));
NS_ENSURE_SUCCESS(rv, rv);
os->AddObserver(this, "quit-application", PR_FALSE);
return NS_OK;
}
NS_IMETHODIMP
nsClipboard::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData)
{
mWidget = gtk_invisible_new();
if (!mWidget)
return NS_ERROR_FAILURE;
g_signal_connect(G_OBJECT(mWidget), "selection_get",
G_CALLBACK(invisible_selection_get_cb), this);
g_signal_connect(G_OBJECT(mWidget), "selection_clear_event",
G_CALLBACK(selection_clear_event_cb), this);
// XXX make sure to set up the selection_clear event
if (strcmp(aTopic, "quit-application") == 0) {
// application is going to quit, save clipboard content
Store();
}
return NS_OK;
}
nsresult
nsClipboard::Store(void)
{
// Ask the clipboard manager to store the current clipboard content
if (mGlobalTransferable) {
GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
gtk_clipboard_store(clipboard);
}
return NS_OK;
}
@ -176,24 +189,8 @@ nsClipboard::SetData(nsITransferable *aTransferable,
// Clear out the clipboard in order to set the new data
EmptyClipboard(aWhichClipboard);
if (aWhichClipboard == kSelectionClipboard) {
mSelectionOwner = aOwner;
mSelectionTransferable = aTransferable;
}
else {
mGlobalOwner = aOwner;
mGlobalTransferable = aTransferable;
}
// Which selection are we about to claim, CLIPBOARD or PRIMARY?
GdkAtom selectionAtom = GetSelectionAtom(aWhichClipboard);
// Make ourselves the owner. If we fail to, return.
if (!gtk_selection_owner_set(mWidget, selectionAtom, GDK_CURRENT_TIME))
return NS_ERROR_FAILURE;
// Clear the old selection target list.
gtk_selection_clear_targets(mWidget, selectionAtom);
// List of suported targets
GtkTargetList *list = gtk_target_list_new(NULL, 0);
// Get the types of supported flavors
nsCOMPtr<nsISupportsArray> flavors;
@ -203,7 +200,7 @@ nsClipboard::SetData(nsITransferable *aTransferable,
return NS_ERROR_FAILURE;
// Add all the flavors to this widget's supported type.
gint nImageTargets = 0;
PRBool imagesAdded = PR_FALSE;
PRUint32 count;
flavors->Count(&count);
for (PRUint32 i=0; i < count; i++) {
@ -218,13 +215,10 @@ nsClipboard::SetData(nsITransferable *aTransferable,
// special case text/unicode since we can handle all of
// the string types
if (!strcmp(flavorStr, kUnicodeMime)) {
AddTarget(gdk_atom_intern("UTF8_STRING", FALSE),
selectionAtom);
AddTarget(gdk_atom_intern("COMPOUND_TEXT", FALSE),
selectionAtom);
AddTarget(gdk_atom_intern("TEXT", FALSE), selectionAtom);
AddTarget(GDK_SELECTION_TYPE_STRING, selectionAtom);
// next loop iteration
gtk_target_list_add(list, gdk_atom_intern("UTF8_STRING", FALSE), 0, 0);
gtk_target_list_add(list, gdk_atom_intern("COMPOUND_TEXT", FALSE), 0, 0);
gtk_target_list_add(list, gdk_atom_intern("TEXT", FALSE), 0, 0);
gtk_target_list_add(list, GDK_SELECTION_TYPE_STRING, 0, 0);
continue;
}
@ -233,26 +227,53 @@ nsClipboard::SetData(nsITransferable *aTransferable,
flavorStr.EqualsLiteral(kJPEGImageMime) ||
flavorStr.EqualsLiteral(kGIFImageMime)) {
// don't bother adding image targets twice
if (!nImageTargets) {
if (!imagesAdded) {
// accept any writable image type
GtkTargetList *list = gtk_target_list_new(NULL, 0);
gtk_target_list_add_image_targets(list, 0, TRUE);
GtkTargetEntry *targets = gtk_target_table_new_from_list(list, &nImageTargets);
gtk_selection_add_targets(mWidget, selectionAtom, targets, nImageTargets);
gtk_target_table_free(targets, nImageTargets);
gtk_target_list_unref(list);
imagesAdded = PR_TRUE;
}
// next loop iteration
continue;
}
// Add this to our list of valid targets
GdkAtom atom = gdk_atom_intern(flavorStr, FALSE);
AddTarget(atom, selectionAtom);
gtk_target_list_add(list, atom, 0, 0);
}
}
// Get GTK clipboard (CLIPBOARD or PRIMARY)
GtkClipboard *gtkClipboard = gtk_clipboard_get(GetSelectionAtom(aWhichClipboard));
gint numTargets;
GtkTargetEntry *gtkTargets = gtk_target_table_new_from_list(list, &numTargets);
// Set getcallback and request to store data after an application exit
if (gtk_clipboard_set_with_data(gtkClipboard, gtkTargets, numTargets,
clipboard_get_cb, clipboard_clear_cb, this))
{
// We managed to set-up the clipboard so update internal state
// We have to set it now because gtk_clipboard_set_with_data() calls clipboard_clear_cb()
// which reset our internal state
if (aWhichClipboard == kSelectionClipboard) {
mSelectionOwner = aOwner;
mSelectionTransferable = aTransferable;
}
else {
mGlobalOwner = aOwner;
mGlobalTransferable = aTransferable;
gtk_clipboard_set_can_store(gtkClipboard, gtkTargets, numTargets);
}
return NS_OK;
rv = NS_OK;
}
else {
rv = NS_ERROR_FAILURE;
}
gtk_target_table_free(gtkTargets, numTargets);
gtk_target_list_unref(list);
return rv;
}
NS_IMETHODIMP
@ -431,6 +452,9 @@ nsClipboard::HasDataMatchingFlavors(const char** aFlavorList, PRUint32 aLength,
for (PRInt32 j = 0; j < n_targets; j++) {
gchar *atom_name = gdk_atom_name(targets[j]);
if (!atom_name)
continue;
if (!strcmp(atom_name, aFlavorList[i]))
*_retval = PR_TRUE;
@ -489,15 +513,8 @@ nsClipboard::GetTransferable(PRInt32 aWhichClipboard)
}
void
nsClipboard::AddTarget(GdkAtom aName, GdkAtom aClipboard)
{
gtk_selection_add_target(mWidget, aClipboard, aName, 0);
}
void
nsClipboard::SelectionGetEvent (GtkWidget *aWidget,
GtkSelectionData *aSelectionData,
guint aTime)
nsClipboard::SelectionGetEvent(GtkClipboard *aClipboard,
GtkSelectionData *aSelectionData)
{
// Someone has asked us to hand them something. The first thing
// that we want to do is see if that something includes text. If
@ -515,7 +532,15 @@ nsClipboard::SelectionGetEvent (GtkWidget *aWidget,
return; // THAT AIN'T NO CLIPBOARD I EVER HEARD OF
nsCOMPtr<nsITransferable> trans = GetTransferable(whichClipboard);
if (!trans) {
// We have nothing to serve
#ifdef DEBUG_CLIPBOARD
printf("nsClipboard::SelectionGetEvent() - %s clipboard is empty!\n",
whichClipboard == kSelectionClipboard ? "Selection" : "Global");
#endif
return;
}
nsresult rv;
nsCOMPtr<nsISupports> item;
PRUint32 len;
@ -632,15 +657,14 @@ nsClipboard::SelectionGetEvent (GtkWidget *aWidget,
}
void
nsClipboard::SelectionClearEvent (GtkWidget *aWidget,
GdkEventSelection *aEvent)
nsClipboard::SelectionClearEvent(GtkClipboard *aGtkClipboard)
{
PRInt32 whichClipboard;
// which clipboard?
if (aEvent->selection == GDK_SELECTION_PRIMARY)
if (aGtkClipboard == gtk_clipboard_get(GDK_SELECTION_PRIMARY))
whichClipboard = kSelectionClipboard;
else if (aEvent->selection == GDK_SELECTION_CLIPBOARD)
else if (aGtkClipboard == gtk_clipboard_get(GDK_SELECTION_CLIPBOARD))
whichClipboard = kGlobalClipboard;
else
return; // THAT AIN'T NO CLIPBOARD I EVER HEARD OF
@ -649,22 +673,21 @@ nsClipboard::SelectionClearEvent (GtkWidget *aWidget,
}
void
invisible_selection_get_cb (GtkWidget *aWidget,
GtkSelectionData *aSelectionData,
guint aTime,
guint aInfo,
nsClipboard *aClipboard)
clipboard_get_cb(GtkClipboard *aGtkClipboard,
GtkSelectionData *aSelectionData,
guint info,
gpointer user_data)
{
aClipboard->SelectionGetEvent(aWidget, aSelectionData, aTime);
nsClipboard *aClipboard = static_cast<nsClipboard *>(user_data);
aClipboard->SelectionGetEvent(aGtkClipboard, aSelectionData);
}
gboolean
selection_clear_event_cb (GtkWidget *aWidget,
GdkEventSelection *aEvent,
nsClipboard *aClipboard)
void
clipboard_clear_cb(GtkClipboard *aGtkClipboard,
gpointer user_data)
{
aClipboard->SelectionClearEvent(aWidget, aEvent);
return TRUE;
nsClipboard *aClipboard = static_cast<nsClipboard *>(user_data);
aClipboard->SelectionClearEvent(aGtkClipboard);
}
/*

Просмотреть файл

@ -44,7 +44,8 @@
#include "nsAutoPtr.h"
#include <gtk/gtk.h>
class nsClipboard : public nsIClipboard
class nsClipboard : public nsIClipboard,
public nsIObserver
{
public:
nsClipboard();
@ -53,33 +54,29 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSICLIPBOARD
NS_DECL_NSIOBSERVER
// Make sure we are initialized, called from the factory
// constructor
nsresult Init (void);
// Someone requested the selection from the hidden widget
void SelectionGetEvent (GtkWidget *aWidget,
GtkSelectionData *aSelectionData,
guint aTime);
void SelectionClearEvent (GtkWidget *aWidget,
GdkEventSelection *aEvent);
nsresult Init (void);
// Someone requested the selection
void SelectionGetEvent (GtkClipboard *aGtkClipboard,
GtkSelectionData *aSelectionData);
void SelectionClearEvent (GtkClipboard *aGtkClipboard);
private:
// Utility methods
static GdkAtom GetSelectionAtom (PRInt32 aWhichClipboard);
static GtkSelectionData *GetTargets (GdkAtom aWhichClipboard);
// Save global clipboard content to gtk
nsresult Store (void);
// Get our hands on the correct transferable, given a specific
// clipboard
nsITransferable *GetTransferable (PRInt32 aWhichClipboard);
// Add a target type to the hidden widget
void AddTarget (GdkAtom aName,
GdkAtom aClipboard);
// The hidden widget where we do all of our operations
GtkWidget *mWidget;
// Hang on to our owners and transferables so we can transfer data
// when asked.
nsCOMPtr<nsIClipboardOwner> mSelectionOwner;

Просмотреть файл

@ -981,7 +981,7 @@ nsDragService::IsTargetContextList(void)
GdkAtom atom = GDK_POINTER_TO_ATOM(tmp->data);
gchar *name = NULL;
name = gdk_atom_name(atom);
if (strcmp(name, gMimeListType) == 0)
if (name && strcmp(name, gMimeListType) == 0)
retval = PR_TRUE;
g_free(name);
if (retval)

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше