summaryrefslogtreecommitdiff
path: root/dom/html/HTMLSharedObjectElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/html/HTMLSharedObjectElement.cpp')
-rw-r--r--dom/html/HTMLSharedObjectElement.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/dom/html/HTMLSharedObjectElement.cpp b/dom/html/HTMLSharedObjectElement.cpp
index d7eec215a0..2aeb51573a 100644
--- a/dom/html/HTMLSharedObjectElement.cpp
+++ b/dom/html/HTMLSharedObjectElement.cpp
@@ -16,6 +16,10 @@
#include "nsIScriptError.h"
#include "nsIWidget.h"
#include "nsContentUtils.h"
+#ifdef XP_MACOSX
+#include "mozilla/EventDispatcher.h"
+#include "mozilla/dom/Event.h"
+#endif
#include "mozilla/dom/HTMLObjectElement.h"
@@ -38,6 +42,9 @@ HTMLSharedObjectElement::HTMLSharedObjectElement(already_AddRefed<mozilla::dom::
HTMLSharedObjectElement::~HTMLSharedObjectElement()
{
+#ifdef XP_MACOSX
+ HTMLObjectElement::OnFocusBlurPlugin(this, false);
+#endif
UnregisterActivityObserver();
DestroyImageLoadingContent();
}
@@ -89,6 +96,17 @@ NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement)
NS_IMPL_ELEMENT_CLONE(HTMLSharedObjectElement)
+#ifdef XP_MACOSX
+
+NS_IMETHODIMP
+HTMLSharedObjectElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
+{
+ HTMLObjectElement::HandleFocusBlurPlugin(this, aVisitor.mEvent);
+ return NS_OK;
+}
+
+#endif // #ifdef XP_MACOSX
+
void
HTMLSharedObjectElement::AsyncEventRunning(AsyncEventDispatcher* aEvent)
{
@@ -130,6 +148,14 @@ void
HTMLSharedObjectElement::UnbindFromTree(bool aDeep,
bool aNullParent)
{
+#ifdef XP_MACOSX
+ // When a page is reloaded (when an nsIDocument's content is removed), the
+ // focused element isn't necessarily sent an eBlur event. See
+ // nsFocusManager::ContentRemoved(). This means that a widget may think it
+ // still contains a focused plugin when it doesn't -- which in turn can
+ // disable text input in the browser window. See bug 1137229.
+ HTMLObjectElement::OnFocusBlurPlugin(this, false);
+#endif
nsObjectLoadingContent::UnbindFromTree(aDeep, aNullParent);
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
}