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

Unified Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 1266723004: Revert of Delete AuthorStyleInfo and move its data into ComputedStyle.RareNonInheritedData. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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 | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/layout/LayoutTheme.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleResolver.cpp
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp
index 4ba22f6562f6ad8c03a40102d0aa266b4e86ffc0..788a2a176a6e85ee1c6f82977ceb34e78cc756ce 100644
--- a/Source/core/css/resolver/StyleResolver.cpp
+++ b/Source/core/css/resolver/StyleResolver.cpp
@@ -478,10 +478,32 @@
return documentStyle.release();
}
+AuthorStyleInfo StyleResolver::authorStyleInfo(StyleResolverState& state)
+{
+ const CachedUAStyle* cachedUAStyle = state.cachedUAStyle();
+
+ if (!cachedUAStyle)
+ return AuthorStyleInfo();
+
+ // Exclude background-repeat from comparison by resetting it.
+ FillLayer backgroundCopy = cachedUAStyle->backgroundLayers;
+ FillLayer backgroundLayersCopy = state.style()->backgroundLayers();
+ backgroundCopy.setRepeatX(NoRepeatFill);
+ backgroundCopy.setRepeatY(NoRepeatFill);
+ backgroundLayersCopy.setRepeatX(NoRepeatFill);
+ backgroundLayersCopy.setRepeatY(NoRepeatFill);
+
+ bool backgroundChanged = backgroundLayersCopy != backgroundCopy
+ || state.style()->backgroundColor() != cachedUAStyle->backgroundColor;
+ bool borderChanged = state.style()->border() != cachedUAStyle->border;
+
+ return AuthorStyleInfo(backgroundChanged, borderChanged);
+}
+
void StyleResolver::adjustComputedStyle(StyleResolverState& state, Element* element)
{
StyleAdjuster adjuster(document().inQuirksMode());
- adjuster.adjustComputedStyle(state.mutableStyleRef(), *state.parentStyle(), element);
+ adjuster.adjustComputedStyle(state.mutableStyleRef(), *state.parentStyle(), element, authorStyleInfo(state));
}
// Start loading resources referenced by this style.
@@ -1321,12 +1343,6 @@
applyMatchedProperties<LowPropertyPriority>(state, matchResult, true, matchResult.beginAuthor(), matchResult.endAuthor(), applyInheritedOnly);
applyMatchedProperties<LowPropertyPriority>(state, matchResult, true, matchResult.beginUA(), matchResult.endUA(), applyInheritedOnly);
- if (state.style()->hasAppearance()) {
- // Populate if the cached UA border and background has been changed.
- state.style()->setHasAuthorBackground(hasAuthorBackground(state));
- state.style()->setHasAuthorBorder(hasAuthorBorder(state));
- }
-
loadPendingResources(state);
if (!cachedMatchedProperties && cacheHash && MatchedPropertiesCache::isCacheable(element, *state.style(), *state.parentStyle())) {
@@ -1335,29 +1351,6 @@
}
ASSERT(!state.fontBuilder().fontDirty());
-}
-
-bool StyleResolver::hasAuthorBackground(const StyleResolverState& state)
-{
- const CachedUAStyle* cachedUAStyle = state.cachedUAStyle();
- if (!cachedUAStyle)
- return false;
-
- FillLayer oldFill = cachedUAStyle->backgroundLayers;
- FillLayer newFill = state.style()->backgroundLayers();
- // Exclude background-repeat from comparison by resetting it.
- oldFill.setRepeatX(NoRepeatFill);
- oldFill.setRepeatY(NoRepeatFill);
- newFill.setRepeatX(NoRepeatFill);
- newFill.setRepeatY(NoRepeatFill);
-
- return (oldFill != newFill || cachedUAStyle->backgroundColor != state.style()->backgroundColor());
-}
-
-bool StyleResolver::hasAuthorBorder(const StyleResolverState& state)
-{
- const CachedUAStyle* cachedUAStyle = state.cachedUAStyle();
- return cachedUAStyle && (cachedUAStyle->border != state.style()->border());
}
void StyleResolver::applyCallbackSelectors(StyleResolverState& state)
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/layout/LayoutTheme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698