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

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

Issue 2213223004: Revert of Add a fast-path for independent inherited properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@computedstyle_cleanup_rename_final_member_fields
Patch Set: Created 4 years, 4 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/Element.h ('k') | third_party/WebKit/Source/core/dom/Node.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/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index a464c53c1574e27f6ff9a3b58cc174f5ec4976a9..ef260adf32dc31fb8e8c0d0dfbfbde675c104369 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -1710,13 +1710,12 @@
if (hasCustomStyleCallbacks())
willRecalcStyle(change);
- if (change >= IndependentInherit || needsStyleRecalc()) {
+ if (change >= Inherit || needsStyleRecalc()) {
if (hasRareData()) {
ElementRareData* data = elementRareData();
- if (change != IndependentInherit)
- data->clearComputedStyle();
-
- if (change >= IndependentInherit) {
+ data->clearComputedStyle();
+
+ if (change >= Inherit) {
if (ElementAnimations* elementAnimations = data->elementAnimations())
elementAnimations->setAnimationStyleChange(false);
}
@@ -1760,40 +1759,15 @@
reattachWhitespaceSiblingsIfNeeded(nextTextSibling);
}
-PassRefPtr<ComputedStyle> Element::propagateInheritedProperties(StyleRecalcChange change)
-{
- if (change != IndependentInherit)
- return nullptr;
- if (needsStyleRecalc())
- return nullptr;
- if (hasAnimations())
- return nullptr;
- const ComputedStyle* parentStyle = parentComputedStyle();
- DCHECK(parentStyle);
- const ComputedStyle* style = computedStyle();
- if (!style || style->animations() || style->transitions())
- return nullptr;
- RefPtr<ComputedStyle> newStyle = ComputedStyle::clone(*style);
- newStyle->propagateIndependentInheritedProperties(*parentStyle);
- INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), independentInheritedStylesPropagated, 1);
- return newStyle;
-}
-
StyleRecalcChange Element::recalcOwnStyle(StyleRecalcChange change)
{
DCHECK(document().inStyleRecalc());
DCHECK(!parentOrShadowHostNode()->needsStyleRecalc());
- DCHECK(change >= IndependentInherit || needsStyleRecalc());
+ DCHECK(change >= Inherit || needsStyleRecalc());
DCHECK(parentComputedStyle());
RefPtr<ComputedStyle> oldStyle = mutableComputedStyle();
-
- // When propagating inherited changes, we don't need to do a full style recalc
- // if the only changed properties are independent. In this case, we can simply
- // set these directly on the ComputedStyle object.
- RefPtr<ComputedStyle> newStyle = propagateInheritedProperties(change);
- if (!newStyle)
- newStyle = styleForLayoutObject();
+ RefPtr<ComputedStyle> newStyle = styleForLayoutObject();
DCHECK(newStyle);
StyleRecalcChange localChange = ComputedStyle::stylePropagationDiff(oldStyle.get(), newStyle.get());
@@ -1833,7 +1807,7 @@
if (change > Inherit || localChange > Inherit)
return max(localChange, change);
- if (localChange < IndependentInherit) {
+ if (localChange < Inherit) {
if (oldStyle->hasChildDependentFlags()) {
if (childNeedsStyleRecalc())
return Inherit;
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698