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

Unified Diff: third_party/WebKit/Source/core/css/invalidation/InvalidationSet.cpp

Issue 2303443003: CSS: Additional asserts for style invalidation (Closed)
Patch Set: key not empty Created 4 years, 3 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/RuleFeature.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/css/invalidation/InvalidationSet.cpp
diff --git a/third_party/WebKit/Source/core/css/invalidation/InvalidationSet.cpp b/third_party/WebKit/Source/core/css/invalidation/InvalidationSet.cpp
index 18d29abe552fb900fc462fb563ab51613d222661..78e61dd1336680fd7292c56d2fc2b4bd48fe4ff6 100644
--- a/third_party/WebKit/Source/core/css/invalidation/InvalidationSet.cpp
+++ b/third_party/WebKit/Source/core/css/invalidation/InvalidationSet.cpp
@@ -104,7 +104,10 @@ bool InvalidationSet::invalidatesElement(Element& element) const
void InvalidationSet::combine(const InvalidationSet& other)
{
- ASSERT(type() == other.type());
+ RELEASE_ASSERT(m_isAlive);
+ RELEASE_ASSERT(other.m_isAlive);
+ RELEASE_ASSERT(&other != this);
+ RELEASE_ASSERT(type() == other.type());
if (type() == InvalidateSiblings) {
SiblingInvalidationSet& siblings = toSiblingInvalidationSet(*this);
const SiblingInvalidationSet& otherSiblings = toSiblingInvalidationSet(other);
@@ -201,6 +204,7 @@ void InvalidationSet::addClass(const AtomicString& className)
{
if (wholeSubtreeInvalid())
return;
+ RELEASE_ASSERT(!className.isEmpty());
ensureClassSet().add(className);
}
@@ -208,6 +212,7 @@ void InvalidationSet::addId(const AtomicString& id)
{
if (wholeSubtreeInvalid())
return;
+ RELEASE_ASSERT(!id.isEmpty());
ensureIdSet().add(id);
}
@@ -215,6 +220,7 @@ void InvalidationSet::addTagName(const AtomicString& tagName)
{
if (wholeSubtreeInvalid())
return;
+ RELEASE_ASSERT(!tagName.isEmpty());
ensureTagNameSet().add(tagName);
}
@@ -222,6 +228,7 @@ void InvalidationSet::addAttribute(const AtomicString& attribute)
{
if (wholeSubtreeInvalid())
return;
+ RELEASE_ASSERT(!attribute.isEmpty());
ensureAttributeSet().add(attribute);
}
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleFeature.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698