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

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

Issue 2821193003: Store nonAttachedStyle on NodeLayoutData instead of on HashMap in Document. (Closed)
Patch Set: Revert back to rune@'s lgtmed patch Created 3 years, 8 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.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/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 69ad410b845dbacf75de6f30e7f823ac720a2961..af9e5794c6a16bbad7a3b998bdbbfbaea49a69b9 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -1433,19 +1433,6 @@ Element* Document::ScrollingElementNoLayout() {
return body();
}
-// 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::AddNonAttachedStyle(const Node& node,
- RefPtr<ComputedStyle> computed_style) {
- DCHECK(node.IsElementNode() || node.IsTextNode());
- non_attached_style_.Set(&node, computed_style);
-}
-
-ComputedStyle* Document::GetNonAttachedStyle(const Node& node) const {
- return non_attached_style_.at(&node);
-}
-
/*
* Performs three operations:
* 1. Convert control characters to spaces
@@ -2127,9 +2114,6 @@ void Document::UpdateStyle() {
View()->RecalcOverflowAfterStyleChange();
- // Only retain the HashMap for the duration of StyleRecalc and
- // LayoutTreeConstruction.
- non_attached_style_.clear();
ClearChildNeedsStyleRecalc();
ClearChildNeedsReattachLayoutTree();
@@ -2141,7 +2125,6 @@ void Document::UpdateStyle() {
DCHECK(!ChildNeedsReattachLayoutTree());
DCHECK(InStyleRecalc());
DCHECK_EQ(GetStyleResolver(), &resolver);
- DCHECK(non_attached_style_.IsEmpty());
lifecycle_.AdvanceTo(DocumentLifecycle::kStyleClean);
if (should_record_stats) {
TRACE_EVENT_END2(
@@ -6649,7 +6632,6 @@ DEFINE_TRACE(Document) {
visitor->Trace(snap_coordinator_);
visitor->Trace(resize_observer_controller_);
visitor->Trace(property_registry_);
- visitor->Trace(non_attached_style_);
visitor->Trace(network_state_observer_);
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.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698