diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-10 19:10:20 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-10 19:10:20 +0200 |
commit | 284837daa07b29d6a63a748544a90b1f5842ac5c (patch) | |
tree | ecd258180bde91fe741e0cfd2638beb3c6da7e8e /Source/WebCore/css/CSSStyleRule.cpp | |
parent | 2e2ba8ff45915f40ed3e014101269c175f2a89a0 (diff) | |
download | qtwebkit-284837daa07b29d6a63a748544a90b1f5842ac5c.tar.gz |
Imported WebKit commit 68645295d2e3e09af2c942f092556f06aa5f8b0d (http://svn.webkit.org/repository/webkit/trunk@128073)
New snapshot
Diffstat (limited to 'Source/WebCore/css/CSSStyleRule.cpp')
-rw-r--r-- | Source/WebCore/css/CSSStyleRule.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Source/WebCore/css/CSSStyleRule.cpp b/Source/WebCore/css/CSSStyleRule.cpp index 7f82ae593..365d8d90f 100644 --- a/Source/WebCore/css/CSSStyleRule.cpp +++ b/Source/WebCore/css/CSSStyleRule.cpp @@ -26,10 +26,10 @@ #include "CSSSelector.h" #include "CSSStyleSheet.h" #include "Document.h" -#include "MemoryInstrumentation.h" #include "PropertySetCSSStyleDeclaration.h" #include "StylePropertySet.h" #include "StyleRule.h" +#include "WebCoreMemoryInstrumentation.h" #include <wtf/text/StringBuilder.h> namespace WebCore { @@ -101,24 +101,25 @@ void CSSStyleRule::setSelectorText(const String& selectorText) CSSStyleSheet::RuleMutationScope mutationScope(this); - String oldSelectorText = this->selectorText(); m_styleRule->wrapperAdoptSelectorList(selectorList); if (hasCachedSelectorText()) { - ASSERT(selectorTextCache().contains(this)); - selectorTextCache().set(this, generateSelectorText()); + selectorTextCache().remove(this); + setHasCachedSelectorText(false); } } String CSSStyleRule::cssText() const { - String result = selectorText(); - - result += " { "; - result += m_styleRule->properties()->asText(); - result += "}"; - - return result; + StringBuilder result; + result.append(selectorText()); + result.appendLiteral(" { "); + String decls = m_styleRule->properties()->asText(); + result.append(decls); + if (!decls.isEmpty()) + result.append(' '); + result.append('}'); + return result.toString(); } void CSSStyleRule::reattach(StyleRule* rule) @@ -130,7 +131,7 @@ void CSSStyleRule::reattach(StyleRule* rule) void CSSStyleRule::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const { - MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::CSS); + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); CSSRule::reportBaseClassMemoryUsage(memoryObjectInfo); info.addInstrumentedMember(m_styleRule); info.addInstrumentedMember(m_propertiesCSSOMWrapper); |