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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2895283003: DCHECK style is cacheable in ComputedStyle::CopyNonInheritedFromCached. (Closed)
Patch Set: Address comments Created 3 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
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index b5ab770317cabc093a7b0c1be6f5ba91342dfac2..ba02a3849ad153d66217000a32fc18022ac3753b 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -334,6 +334,8 @@ void ComputedStyle::InheritFrom(const ComputedStyle& inherit_parent,
}
void ComputedStyle::CopyNonInheritedFromCached(const ComputedStyle& other) {
+ DCHECK(MatchedPropertiesCache::IsStyleCacheable(other));
+
ComputedStyleBase::CopyNonInheritedFromCached(other);
rare_non_inherited_data_ = other.rare_non_inherited_data_;
@@ -352,13 +354,6 @@ void ComputedStyle::CopyNonInheritedFromCached(const ComputedStyle& other) {
// Set correctly while computing style for children:
// m_explicitInheritance
- // unique() styles are not cacheable.
- DCHECK(!other.Unique());
-
- // styles with non inherited properties that reference variables are not
- // cacheable.
- DCHECK(!other.HasVariableReferenceFromNonInheritedProperty());
-
// The following flags are set during matching before we decide that we get a
// match in the MatchedPropertiesCache which in turn calls this method. The
// reason why we don't copy these flags is that they're already correctly set
@@ -380,7 +375,6 @@ void ComputedStyle::CopyNonInheritedFromCached(const ComputedStyle& other) {
if (svg_style_ != other.svg_style_)
svg_style_.Access()->CopyNonInheritedFromCached(other.svg_style_.Get());
- DCHECK_EQ(Zoom(), InitialZoom());
}
bool ComputedStyle::operator==(const ComputedStyle& o) const {
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698