diff --git a/docshell/test/chrome/bug113934_window.xhtml b/docshell/test/chrome/bug113934_window.xhtml
index 794b8b28363f..c5b676b6b8e0 100644
--- a/docshell/test/chrome/bug113934_window.xhtml
+++ b/docshell/test/chrome/bug113934_window.xhtml
@@ -85,7 +85,6 @@
// which are a result of swapping the docshells.
var DOMLinkListener = {
_afterFirst: false,
- _removedDispatched: false,
_addedDispatched: false,
async handleEvent(aEvent) {
if (!this._afterFirst) {
@@ -134,16 +133,10 @@
is(this._addedDispatched, false);
this._addedDispatched = true;
}
- else {
- is(this._removedDispatched, false);
- this._removedDispatched = true;
- }
- if (this._addedDispatched && this._removedDispatched) {
+ if (this._addedDispatched) {
$("f1").removeEventListener("DOMLinkAdded", this);
- $("f1").removeEventListener("DOMLinkRemoved", this);
$("f3").removeEventListener("DOMLinkAdded", this);
- $("f3").removeEventListener("DOMLinkRemoved", this);
window.close();
SimpleTest.finish();
}
@@ -151,9 +144,7 @@
};
$("f1").addEventListener("DOMLinkAdded", DOMLinkListener);
- $("f1").addEventListener("DOMLinkRemoved", DOMLinkListener);
$("f3").addEventListener("DOMLinkAdded", DOMLinkListener);
- $("f3").addEventListener("DOMLinkRemoved", DOMLinkListener);
var linkElement = $("f1").contentDocument.createElement("link");
linkElement.setAttribute("rel", "alternate");
diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp
index 7af91579e3d2..20073e552558 100644
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -11827,19 +11827,6 @@ void Document::OnPageHide(bool aPersisted, EventTarget* aDispatchStartTarget,
inFrameLoaderSwap ==
(mDocumentContainer && mDocumentContainer->InFrameSwap()));
- // Send out notifications that our elements are detached,
- // but only if this is not a full unload.
- Element* root = GetRootElement();
- if (aPersisted && root) {
- RefPtr links =
- NS_GetContentList(root, kNameSpaceID_XHTML, u"link"_ns);
-
- uint32_t linkCount = links->Length(true);
- for (uint32_t i = 0; i < linkCount; ++i) {
- static_cast(links->Item(i, false))->LinkRemoved();
- }
- }
-
if (mAnimationController) {
mAnimationController->OnPageHide();
}
diff --git a/dom/html/HTMLLinkElement.cpp b/dom/html/HTMLLinkElement.cpp
index f78e24453b80..9d5dc0bca952 100644
--- a/dom/html/HTMLLinkElement.cpp
+++ b/dom/html/HTMLLinkElement.cpp
@@ -108,10 +108,6 @@ void HTMLLinkElement::LinkAdded() {
CreateAndDispatchEvent(u"DOMLinkAdded"_ns);
}
-void HTMLLinkElement::LinkRemoved() {
- CreateAndDispatchEvent(u"DOMLinkRemoved"_ns);
-}
-
void HTMLLinkElement::UnbindFromTree(bool aNullParent) {
CancelDNSPrefetch(*this);
CancelPrefetchOrPreload();
@@ -130,8 +126,6 @@ void HTMLLinkElement::UnbindFromTree(bool aNullParent) {
eIgnoreCase)) {
oldDoc->LocalizationLinkRemoved(this);
}
-
- CreateAndDispatchEvent(u"DOMLinkRemoved"_ns);
}
nsGenericHTMLElement::UnbindFromTree(aNullParent);
diff --git a/dom/html/HTMLLinkElement.h b/dom/html/HTMLLinkElement.h
index 49969b2c9ab0..6bbeb9a39750 100644
--- a/dom/html/HTMLLinkElement.h
+++ b/dom/html/HTMLLinkElement.h
@@ -40,7 +40,6 @@ class HTMLLinkElement final : public nsGenericHTMLElement,
NS_DECL_ADDSIZEOFEXCLUDINGTHIS
void LinkAdded();
- void LinkRemoved();
// nsINode
nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;