Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: third_party/WebKit/Source/core/dom/DocumentTest.cpp

Issue 2650353002: Revert of Introduce SynchronousMutationObserver::didChangeAttribute() (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/DocumentTest.cpp
diff --git a/third_party/WebKit/Source/core/dom/DocumentTest.cpp b/third_party/WebKit/Source/core/dom/DocumentTest.cpp
index df592898ecdc892382732b589870bf50156a047e..d9e2f2fa11a05e89f2ccce87903289a10a8db15c 100644
--- a/third_party/WebKit/Source/core/dom/DocumentTest.cpp
+++ b/third_party/WebKit/Source/core/dom/DocumentTest.cpp
@@ -123,10 +123,6 @@
return m_contextDestroyedCalledCounter;
}
- const HeapVector<Member<const Element>>& attributeChangedElements() const {
- return m_attributeChangedElements;
- }
-
const HeapVector<Member<const ContainerNode>>& childrenChangedNodes() const {
return m_childrenChangedNodes;
}
@@ -162,7 +158,6 @@
private:
// Implement |SynchronousMutationObserver| member functions.
void contextDestroyed(Document*) final;
- void didChangeAttribute(const Element&) final;
void didChangeChildren(const ContainerNode&) final;
void didMergeTextNodes(const Text&, const NodeWithIndex&, unsigned) final;
void didMoveTreeToNewDocument(const Node& root) final;
@@ -175,7 +170,6 @@
void nodeWillBeRemoved(Node&) final;
int m_contextDestroyedCalledCounter = 0;
- HeapVector<Member<const Element>> m_attributeChangedElements;
HeapVector<Member<const ContainerNode>> m_childrenChangedNodes;
HeapVector<Member<MergeTextNodesRecord>> m_mergeTextNodesRecords;
HeapVector<Member<const Node>> m_moveTreeToNewDocumentNodes;
@@ -196,11 +190,6 @@
++m_contextDestroyedCalledCounter;
}
-void TestSynchronousMutationObserver::didChangeAttribute(
- const Element& element) {
- m_attributeChangedElements.push_back(&element);
-}
-
void TestSynchronousMutationObserver::didChangeChildren(
const ContainerNode& container) {
m_childrenChangedNodes.push_back(&container);
@@ -242,7 +231,6 @@
}
DEFINE_TRACE(TestSynchronousMutationObserver) {
- visitor->trace(m_attributeChangedElements);
visitor->trace(m_childrenChangedNodes);
visitor->trace(m_mergeTextNodesRecords);
visitor->trace(m_moveTreeToNewDocumentNodes);
@@ -517,24 +505,6 @@
EXPECT_EQ(1, observer.countContextDestroyedCalled());
}
-TEST_F(DocumentTest, SynchronousMutationNotifierChangeAttribute) {
- auto& observer = *new TestSynchronousMutationObserver(document());
- Element* divNode = document().createElement("div");
- document().body()->appendChild(divNode);
- divNode->setAttribute(HTMLNames::classAttr, "foo");
-
- ASSERT_EQ(1u, observer.attributeChangedElements().size());
- EXPECT_EQ(divNode, observer.attributeChangedElements()[0]);
-
- divNode->setAttribute(HTMLNames::classAttr, "bar");
- ASSERT_EQ(2u, observer.attributeChangedElements().size());
- EXPECT_EQ(divNode, observer.attributeChangedElements()[1]);
-
- divNode->removeAttribute(HTMLNames::classAttr);
- ASSERT_EQ(3u, observer.attributeChangedElements().size());
- EXPECT_EQ(divNode, observer.attributeChangedElements()[2]);
-}
-
TEST_F(DocumentTest, SynchronousMutationNotifieAppendChild) {
auto& observer = *new TestSynchronousMutationObserver(document());
document().body()->appendChild(document().createTextNode("a123456789"));
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698