Bug 380454, r=benjamin, sr=sicking

This commit is contained in:
Olli.Pettay%helsinki.fi 2008-02-19 13:06:23 +00:00
Родитель 38efd51236
Коммит c57eb7ac12
3 изменённых файлов: 10 добавлений и 4 удалений

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

@ -58,6 +58,7 @@
#include "nsParserUtils.h" #include "nsParserUtils.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsPIDOMWindow.h" #include "nsPIDOMWindow.h"
#include "nsPLDOMEvent.h"
class nsHTMLLinkElement : public nsGenericHTMLElement, class nsHTMLLinkElement : public nsGenericHTMLElement,
public nsIDOMHTMLLinkElement, public nsIDOMHTMLLinkElement,
@ -273,9 +274,10 @@ nsHTMLLinkElement::CreateAndDispatchEvent(nsIDocument* aDoc,
strings, eIgnoreCase) != ATTR_VALUE_NO_MATCH) strings, eIgnoreCase) != ATTR_VALUE_NO_MATCH)
return; return;
nsContentUtils::DispatchTrustedEvent(aDoc, nsRefPtr<nsPLDOMEvent> event = new nsPLDOMEvent(this, aEventName);
static_cast<nsIContent*>(this), if (event) {
aEventName, PR_TRUE, PR_TRUE); event->PostDOMEvent();
}
} }
nsresult nsresult

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

@ -200,6 +200,9 @@ nsThreadManager::GetCurrentThread()
if (data) if (data)
return static_cast<nsThread *>(data); return static_cast<nsThread *>(data);
if (!mInitialized)
return nsnull;
// OK, that's fine. We'll dynamically create one :-) // OK, that's fine. We'll dynamically create one :-)
nsRefPtr<nsThread> thread = new nsThread(); nsRefPtr<nsThread> thread = new nsThread();
if (!thread || NS_FAILED(thread->InitCurrentThread())) if (!thread || NS_FAILED(thread->InitCurrentThread()))

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

@ -69,7 +69,8 @@ public:
// method must be called when the given thread is the current thread. // method must be called when the given thread is the current thread.
void UnregisterCurrentThread(nsThread *thread); void UnregisterCurrentThread(nsThread *thread);
// Returns the current thread. Returns null if OOM. // Returns the current thread. Returns null if OOM or if ThreadManager isn't
// initialized.
nsThread *GetCurrentThread(); nsThread *GetCurrentThread();
// This needs to be public in order to support static instantiation of this // This needs to be public in order to support static instantiation of this