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

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

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rename browser zoom to page zoom Created 6 years, 12 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/MatchedPropertiesCache.h ('k') | Source/core/css/resolver/StyleBuilderConverter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/MatchedPropertiesCache.cpp
diff --git a/Source/core/css/resolver/MatchedPropertiesCache.cpp b/Source/core/css/resolver/MatchedPropertiesCache.cpp
index d3c222a1f1ebd376142c9127f55921f6945042c6..cbd9419cf4eae250937f17f1401a1438b7da66e5 100644
--- a/Source/core/css/resolver/MatchedPropertiesCache.cpp
+++ b/Source/core/css/resolver/MatchedPropertiesCache.cpp
@@ -109,6 +109,18 @@ void MatchedPropertiesCache::clear()
m_cache.clear();
}
+void MatchedPropertiesCache::clearViewportDependent()
+{
+ Vector<unsigned, 16> toRemove;
+ for (Cache::iterator it = m_cache.begin(); it != m_cache.end(); ++it) {
+ CachedMatchedProperties* cacheItem = it->value.get();
+ if (cacheItem->renderStyle->hasViewportUnits())
+ toRemove.append(it->key);
+ }
+ for (size_t i = 0; i < toRemove.size(); ++i)
+ m_cache.remove(toRemove[i]);
+}
+
void MatchedPropertiesCache::sweep(Timer<MatchedPropertiesCache>*)
{
// Look for cache entries containing a style declaration with a single ref and remove them.
« no previous file with comments | « Source/core/css/resolver/MatchedPropertiesCache.h ('k') | Source/core/css/resolver/StyleBuilderConverter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698