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

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

Issue 2740823005: Track lastTextNode during rebuildLayoutTree. (Closed)
Patch Set: Missing reset of lastTextNode for elements. Created 3 years, 9 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 | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/Element.h » ('j') | 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 9e54c16af26a4d3b3e0b77d7e4ea247ec6f65287..70160494a39bbef3adea1497b56f8e14387bdc76 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -1417,14 +1417,14 @@ Element* Document::scrollingElementNoLayout() {
// We use HashMap::set over HashMap::add here as we want to
// replace the ComputedStyle but not the Node if the Node is
// already present.
-void Document::addStyleReattachData(const Node& node,
- StyleReattachData& styleReattachData) {
+void Document::addNonAttachedStyle(const Node& node,
+ RefPtr<ComputedStyle> computedStyle) {
DCHECK(node.isElementNode() || node.isTextNode());
- m_styleReattachDataMap.set(&node, styleReattachData);
+ m_nonAttachedStyle.set(&node, computedStyle);
}
-StyleReattachData Document::getStyleReattachData(const Node& node) const {
- return m_styleReattachDataMap.at(&node);
+ComputedStyle* Document::getNonAttachedStyle(const Node& node) const {
+ return m_nonAttachedStyle.at(&node);
}
/*
@@ -2107,7 +2107,7 @@ void Document::updateStyle() {
// Only retain the HashMap for the duration of StyleRecalc and
// LayoutTreeConstruction.
- m_styleReattachDataMap.clear();
+ m_nonAttachedStyle.clear();
clearChildNeedsStyleRecalc();
clearChildNeedsReattachLayoutTree();
@@ -2119,7 +2119,7 @@ void Document::updateStyle() {
DCHECK(!childNeedsReattachLayoutTree());
DCHECK(inStyleRecalc());
DCHECK_EQ(styleResolver(), &resolver);
- DCHECK(m_styleReattachDataMap.isEmpty());
+ DCHECK(m_nonAttachedStyle.isEmpty());
m_lifecycle.advanceTo(DocumentLifecycle::StyleClean);
if (shouldRecordStats) {
TRACE_EVENT_END2("blink,blink_style", "Document::updateStyle",
@@ -6610,7 +6610,7 @@ DEFINE_TRACE(Document) {
visitor->trace(m_snapCoordinator);
visitor->trace(m_resizeObserverController);
visitor->trace(m_propertyRegistry);
- visitor->trace(m_styleReattachDataMap);
+ visitor->trace(m_nonAttachedStyle);
visitor->trace(m_networkStateObserver);
Supplementable<Document>::trace(visitor);
TreeScope::trace(visitor);
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698