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

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

Issue 1224673002: Implement proposed shadow tree cascade order. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added documentation Created 5 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
Index: Source/core/css/resolver/MatchedPropertiesCache.cpp
diff --git a/Source/core/css/resolver/MatchedPropertiesCache.cpp b/Source/core/css/resolver/MatchedPropertiesCache.cpp
index 5d9211751a7e272c78d71d885e374b78c3f91f27..888f8bc8ab59ea888fe4a214f47f47c2f79f0234 100644
--- a/Source/core/css/resolver/MatchedPropertiesCache.cpp
+++ b/Source/core/css/resolver/MatchedPropertiesCache.cpp
@@ -35,9 +35,9 @@
namespace blink {
-void CachedMatchedProperties::set(const ComputedStyle& style, const ComputedStyle& parentStyle, const MatchResult& matchResult)
+void CachedMatchedProperties::set(const ComputedStyle& style, const ComputedStyle& parentStyle, const MatchedPropertiesVector& properties)
{
- matchedProperties.appendVector(matchResult.matchedProperties);
+ matchedProperties.appendVector(properties);
// Note that we don't cache the original ComputedStyle instance. It may be further modified.
// The ComputedStyle in the cache is really just a holder for the substructures and never used as-is.
@@ -60,7 +60,7 @@ MatchedPropertiesCache::MatchedPropertiesCache()
{
}
-const CachedMatchedProperties* MatchedPropertiesCache::find(unsigned hash, const StyleResolverState& styleResolverState, const MatchResult& matchResult)
+const CachedMatchedProperties* MatchedPropertiesCache::find(unsigned hash, const StyleResolverState& styleResolverState, const MatchedPropertiesVector& properties)
{
ASSERT(hash);
@@ -70,19 +70,19 @@ const CachedMatchedProperties* MatchedPropertiesCache::find(unsigned hash, const
CachedMatchedProperties* cacheItem = it->value.get();
ASSERT(cacheItem);
- size_t size = matchResult.matchedProperties.size();
+ size_t size = properties.size();
if (size != cacheItem->matchedProperties.size())
return 0;
if (cacheItem->computedStyle->insideLink() != styleResolverState.style()->insideLink())
return 0;
for (size_t i = 0; i < size; ++i) {
- if (matchResult.matchedProperties[i] != cacheItem->matchedProperties[i])
+ if (properties[i] != cacheItem->matchedProperties[i])
return 0;
}
return cacheItem;
}
-void MatchedPropertiesCache::add(const ComputedStyle& style, const ComputedStyle& parentStyle, unsigned hash, const MatchResult& matchResult)
+void MatchedPropertiesCache::add(const ComputedStyle& style, const ComputedStyle& parentStyle, unsigned hash, const MatchedPropertiesVector& properties)
{
#if !ENABLE(OILPAN)
static const unsigned maxAdditionsBetweenSweeps = 100;
@@ -102,7 +102,7 @@ void MatchedPropertiesCache::add(const ComputedStyle& style, const ComputedStyle
if (!addResult.isNewEntry)
cacheItem->clear();
- cacheItem->set(style, parentStyle, matchResult);
+ cacheItem->set(style, parentStyle, properties);
}
void MatchedPropertiesCache::clear()

Powered by Google App Engine
This is Rietveld 408576698