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

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

Issue 2560673002: Change key of m_styleReattachDataMap to Node instead of Element (Closed)
Patch Set: Add comment and DCHECK Created 4 years 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 | « third_party/WebKit/Source/core/dom/Document.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 159c5c957ff0881ceb7cd21d0c093449fe56cd64..29ba52b55ea0d02da77725f16084e735de41dcb3 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -1359,15 +1359,16 @@ Element* Document::scrollingElement() {
}
// We use HashMap::set over HashMap::add here as we want to
-// replace the ComputedStyle but not the Element if the Element is
+// replace the ComputedStyle but not the Node if the Node is
// already present.
-void Document::addStyleReattachData(Element& element,
+void Document::addStyleReattachData(Node& node,
StyleReattachData& styleReattachData) {
- m_styleReattachDataMap.set(&element, styleReattachData);
+ DCHECK(node.isElementNode() || node.isTextNode());
+ m_styleReattachDataMap.set(&node, styleReattachData);
}
-StyleReattachData Document::getStyleReattachData(Element& element) {
- return m_styleReattachDataMap.get(&element);
+StyleReattachData Document::getStyleReattachData(Node& node) {
+ return m_styleReattachDataMap.get(&node);
}
/*
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698