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

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

Issue 2476163002: Fixed perf regression by removing tree traversal for text sibling. (Closed)
Patch Set: Rebased Created 4 years, 1 month 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 0ec25824974f8beea269725f8fe42799c637f914..6caa7c0565e121dac16b4505fca1bb88f6696191 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -1288,13 +1288,13 @@ 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
// already present.
-void Document::addNonAttachedStyle(Element& element,
- RefPtr<ComputedStyle> computedStyle) {
- m_nonAttachedStyle.set(&element, computedStyle);
+void Document::addStyleReattachData(Element& element,
+ StyleReattachData& styleReattachData) {
+ m_styleReattachDataMap.set(&element, styleReattachData);
}
-ComputedStyle* Document::getNonAttachedStyle(Element& element) {
- return m_nonAttachedStyle.get(&element);
+StyleReattachData Document::getStyleReattachData(Element& element) {
+ return m_styleReattachDataMap.get(&element);
}
/*
@@ -1977,7 +1977,7 @@ void Document::updateStyle() {
// Only retain the HashMap for the duration of StyleRecalc and
// LayoutTreeConstruction.
- m_nonAttachedStyle.clear();
+ m_styleReattachDataMap.clear();
clearChildNeedsStyleRecalc();
clearChildNeedsReattachLayoutTree();
@@ -1989,7 +1989,7 @@ void Document::updateStyle() {
DCHECK(!childNeedsReattachLayoutTree());
DCHECK(inStyleRecalc());
DCHECK_EQ(styleResolver(), &resolver);
- DCHECK(m_nonAttachedStyle.isEmpty());
+ DCHECK(m_styleReattachDataMap.isEmpty());
m_lifecycle.advanceTo(DocumentLifecycle::StyleClean);
if (shouldRecordStats) {
TRACE_EVENT_END2("blink,blink_style", "Document::updateStyle",
@@ -6400,7 +6400,7 @@ DEFINE_TRACE(Document) {
visitor->trace(m_snapCoordinator);
visitor->trace(m_resizeObserverController);
visitor->trace(m_propertyRegistry);
- visitor->trace(m_nonAttachedStyle);
+ visitor->trace(m_styleReattachDataMap);
Supplementable<Document>::trace(visitor);
TreeScope::trace(visitor);
ContainerNode::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