summaryrefslogtreecommitdiffstats
path: root/dom/base/nsObjectLoadingContent.cpp
diff options
context:
space:
mode:
authorwin7-7 <win7-7@users.noreply.github.com>2019-07-14 23:08:23 +0300
committerwin7-7 <win7-7@users.noreply.github.com>2019-07-14 23:08:23 +0300
commit6b9d8adeb337d4fb73c1eba4eaea84e753a0e797 (patch)
treed53630856503013c12ce8ddae1fa2b915ae120e6 /dom/base/nsObjectLoadingContent.cpp
parent69970c911be3c9189006c61fea7c059bf4f7e005 (diff)
downloadUXP-6b9d8adeb337d4fb73c1eba4eaea84e753a0e797.tar
UXP-6b9d8adeb337d4fb73c1eba4eaea84e753a0e797.tar.gz
UXP-6b9d8adeb337d4fb73c1eba4eaea84e753a0e797.tar.lz
UXP-6b9d8adeb337d4fb73c1eba4eaea84e753a0e797.tar.xz
UXP-6b9d8adeb337d4fb73c1eba4eaea84e753a0e797.zip
Dispatch a PluginRemoved event for actual plugins, not images/unknown/iframe-type <objects>
If a page uses or removes many <object> elements which are not actually plugins, loading the page goes to a crawl because UXP recalculates the plugin UI every time. Only dispatch a PluginRemoved event for actual plugins.
Diffstat (limited to 'dom/base/nsObjectLoadingContent.cpp')
-rw-r--r--dom/base/nsObjectLoadingContent.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/dom/base/nsObjectLoadingContent.cpp b/dom/base/nsObjectLoadingContent.cpp
index c1b732258..3c850c4cd 100644
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -715,11 +715,13 @@ nsObjectLoadingContent::UnbindFromTree(bool aDeep, bool aNullParent)
/// would keep the docshell around, but trash the frameloader
UnloadObject();
}
- nsIDocument* doc = thisContent->GetComposedDoc();
- if (doc && doc->IsActive()) {
+ if (mType == eType_Plugin) {
+ nsIDocument* doc = thisContent->GetComposedDoc();
+ if (doc && doc->IsActive()) {
nsCOMPtr<nsIRunnable> ev = new nsSimplePluginEvent(doc,
NS_LITERAL_STRING("PluginRemoved"));
NS_DispatchToCurrentThread(ev);
+ }
}
}