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

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

Issue 1962953002: Storage of ComputedStyle separate from LayoutObject. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed ComputedStyle from ElementRareData Created 4 years, 7 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
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index ad733eb0c4ddb3bace00238d67d869cb8e823127..07c5d863076fce5e3459ba361029480548363717 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -1517,7 +1517,7 @@ void Element::attach(const AttachContext& context)
// need to clear any state that's been added since then.
if (hasRareData() && getStyleChangeType() == NeedsReattachStyleChange) {
ElementRareData* data = elementRareData();
- data->clearComputedStyle();
+ data->setComputedStyle(nullptr);
}
if (!isSlotOrActiveInsertionPoint())
@@ -1563,7 +1563,7 @@ void Element::detach(const AttachContext& context)
// attach() will clear the computed style for us when inside recalcStyle.
if (!document().inStyleRecalc())
- data->clearComputedStyle();
+ data->setComputedStyle(nullptr);
if (ElementAnimations* elementAnimations = data->elementAnimations()) {
if (context.performingReattach) {
@@ -1688,7 +1688,7 @@ void Element::recalcStyle(StyleRecalcChange change, Text* nextTextSibling)
if (change >= Inherit || needsStyleRecalc()) {
if (hasRareData()) {
ElementRareData* data = elementRareData();
- data->clearComputedStyle();
+ data->setComputedStyle(nullptr);
if (change >= Inherit) {
if (ElementAnimations* elementAnimations = data->elementAnimations())
@@ -2791,9 +2791,9 @@ const ComputedStyle* Element::ensureComputedStyle(PseudoId pseudoElementSpecifie
ComputedStyle* elementStyle = mutableComputedStyle();
if (!elementStyle) {
ElementRareData& rareData = ensureElementRareData();
- if (!rareData.ensureComputedStyle())
+ if (!rareData.computedStyle())
rareData.setComputedStyle(document().styleForElementIgnoringPendingStylesheets(this));
- elementStyle = rareData.ensureComputedStyle();
+ elementStyle = rareData.computedStyle();
}
if (!pseudoElementSpecifier)

Powered by Google App Engine
This is Rietveld 408576698