Skip to content

Commit ac0474c

Browse files
Bug 769207 - part 14: Get rid of the pref to enable the legacy DOM mutation events and delete tests checking or depending on mutation events r=smaug,dom-core
Differential Revision: https://phabricator.services.mozilla.com/D263065
1 parent a27e993 commit ac0474c

File tree

77 files changed

+16
-3454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+16
-3454
lines changed

docshell/base/crashtests/432114-2.html

Lines changed: 0 additions & 25 deletions
This file was deleted.

docshell/base/crashtests/crashtests.list

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ load 369126-1.html
33
load 430124-1.html
44
load 430628-1.html
55
load 432114-1.html
6-
load 432114-2.html
76
load 436900-1.html
87
asserts(0-1) load 436900-2.html # bug 566159
98
load 443655.html

docshell/base/crashtests/file_432114-2.xhtml

Lines changed: 0 additions & 1 deletion
This file was deleted.

dom/base/Document.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8195,16 +8195,6 @@ void Document::SetScopeObject(nsIGlobalObject* aGlobal) {
81958195
MOZ_ASSERT_IF(
81968196
mNodeInfoManager->GetArenaAllocator(),
81978197
mNodeInfoManager->GetArenaAllocator() == mDocGroup->ArenaAllocator());
8198-
8199-
// Update data document's mMutationEventsEnabled early on so that we can
8200-
// avoid extra IsURIInPrefList calls.
8201-
if (mLoadedAsData && window->GetExtantDoc() &&
8202-
window->GetExtantDoc() != this &&
8203-
window->GetExtantDoc()->NodePrincipal() == NodePrincipal() &&
8204-
mMutationEventsEnabled.isNothing()) {
8205-
mMutationEventsEnabled.emplace(
8206-
window->GetExtantDoc()->MutationEventsEnabled());
8207-
}
82088198
}
82098199
}
82108200

@@ -20744,17 +20734,6 @@ already_AddRefed<Document> Document::ParseHTML(GlobalObject& aGlobal,
2074420734
return doc.forget();
2074520735
}
2074620736

20747-
bool Document::MutationEventsEnabled() {
20748-
if (StaticPrefs::dom_mutation_events_enabled()) {
20749-
return true;
20750-
}
20751-
if (mMutationEventsEnabled.isNothing()) {
20752-
mMutationEventsEnabled.emplace(
20753-
NodePrincipal()->IsURIInPrefList("dom.mutation_events.forceEnable"));
20754-
}
20755-
return mMutationEventsEnabled.value();
20756-
}
20757-
2075820737
void Document::GetAllInProcessDocuments(
2075920738
nsTArray<RefPtr<Document>>& aAllDocuments) {
2076020739
for (Document* doc : AllDocumentsList()) {

dom/base/Document.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3789,10 +3789,6 @@ class Document : public nsINode,
37893789
void ClearClipboardCopyTriggered() { mClipboardCopyTriggered = false; }
37903790
void SetClipboardCopyTriggered() { mClipboardCopyTriggered = true; }
37913791

3792-
// Even if mutation events are disabled by default,
3793-
// dom.mutation_events.forceEnable can be used to enable them per site.
3794-
bool MutationEventsEnabled();
3795-
37963792
// This should be called when this document receives events which are likely
37973793
// to be user interaction with the document, rather than the byproduct of
37983794
// interaction with the browser (i.e. a keypress to scroll the view port,
@@ -5098,8 +5094,6 @@ class Document : public nsINode,
50985094
// while a paste event is being handled in JS.
50995095
bool mClipboardCopyTriggered : 1;
51005096

5101-
Maybe<bool> mMutationEventsEnabled;
5102-
51035097
// The fingerprinting protections overrides for this document. The value will
51045098
// override the default enabled fingerprinting protections for this document.
51055099
// This will only get populated if these is one that comes from the local

dom/base/crashtests/338391-1.xhtml

Lines changed: 0 additions & 33 deletions
This file was deleted.

dom/base/crashtests/crashtests.list

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ load 327695-1.html
1717
load 329481-1.xhtml
1818
load 336381-1.xhtml
1919
load 336715-1.xhtml
20-
load 338391-1.xhtml
2120
load 338674-1.xhtml
2221
load 340733-1.html
2322
load 343730-1.xhtml

dom/base/test/mochitest.toml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,6 @@ skip-if = [
386386
"http2",
387387
]
388388

389-
["test_bug339494.html"]
390-
391-
["test_bug339494.xhtml"]
392-
393389
["test_bug343596.html"]
394390

395391
["test_bug345339.html"]
@@ -419,18 +415,10 @@ support-files = ["file_bug357450.js"]
419415

420416
["test_bug358660.html"]
421417

422-
["test_bug362391.xhtml"]
423-
424-
["test_bug364092.xhtml"]
425-
426-
["test_bug364413.xhtml"]
427-
428418
["test_bug366944.html"]
429419

430420
["test_bug366946.html"]
431421

432-
["test_bug367164.html"]
433-
434422
["test_bug368972.html"]
435423

436424
["test_bug371576-2.html"]
@@ -500,8 +488,6 @@ support-files = ["test_bug402150.html^headers^"]
500488

501489
["test_bug403868.xml"]
502490

503-
["test_bug405182.html"]
504-
505491
["test_bug409380.html"]
506492

507493
["test_bug410229.html"]
@@ -732,8 +718,6 @@ support-files = ["file_bug518104.js"]
732718

733719
["test_bug562169-2.html"]
734720

735-
["test_bug562652.html"]
736-
737721
["test_bug564047.html"]
738722

739723
["test_bug564863.xhtml"]
@@ -914,8 +898,6 @@ skip-if = [
914898

915899
["test_bug719533.html"]
916900

917-
["test_bug726364.html"]
918-
919901
["test_bug737087.html"]
920902

921903
["test_bug737565.html"]
@@ -1151,8 +1133,6 @@ support-files = ["bug1739957.sjs"]
11511133

11521134
["test_bug1784187.html"]
11531135

1154-
["test_bug1799354.html"]
1155-
11561136
["test_caretPositionFromPoint.html"]
11571137

11581138
["test_change_policy.html"]

dom/base/test/test_bug1075702.html

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -41,42 +41,11 @@
4141
"Should be UPPERCASE AGAIN!");
4242
is(document.documentElement.getAttributeNS("", "AA"), "UPPERCASE", "Should be UPPERCASE!");
4343

44-
var removedNodeAccordingToEvent;
45-
46-
function mutationHandler(aEvent) {
47-
removedNodeAccordingToEvent = aEvent.relatedNode;
48-
}
49-
50-
var test1 = document.createElement("div");
51-
test1.setAttribute("x", "y");
52-
removedNodeAccordingToEvent = null;
53-
54-
function testremoveNamedItemNS() {
55-
test1.addEventListener("DOMAttrModified", mutationHandler, true);
56-
var removedNodeAccordingToRemoveNamedItemNS = test1.attributes.removeNamedItemNS(null, "x");
57-
test1.removeEventListener("DOMAttrModified", mutationHandler, true);
58-
is(removedNodeAccordingToEvent, removedNodeAccordingToRemoveNamedItemNS, "Node removed according to event is not same as node removed by removeNamedItemNS.");
59-
}
60-
61-
testremoveNamedItemNS();
62-
63-
var test2 = document.createElement("div");
64-
test2.setAttribute("x", "y");
65-
removedNodeAccordingToEvent = null;
66-
67-
function testremoveNamedItem() {
68-
test2.addEventListener("DOMAttrModified", mutationHandler, true);
69-
var removedNodeAccordingToRemoveNamedItem = test2.attributes.removeNamedItem("x");
70-
test2.removeEventListener("DOMAttrModified", mutationHandler, true);
71-
is(removedNodeAccordingToEvent, removedNodeAccordingToRemoveNamedItem, "Node removed according to event is not same as node removed by removeNamedItem.");
72-
}
73-
74-
testremoveNamedItem();
7544
SimpleTest.finish();
7645
}
7746

7847
SimpleTest.waitForExplicitFinish();
79-
SpecialPowers.pushPrefEnv({"set": [["dom.mutation_events.enabled", true]]}, test);
48+
SimpleTest.executeSoon(test);
8049
</script>
8150
</body>
8251
</html>

dom/base/test/test_bug1799354.html

Lines changed: 0 additions & 81 deletions
This file was deleted.

0 commit comments

Comments
 (0)