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/CSSPageRule.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/CSSPageRule.cpp')
-rw-r--r-- | Source/WebCore/css/CSSPageRule.cpp | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/Source/WebCore/css/CSSPageRule.cpp b/Source/WebCore/css/CSSPageRule.cpp index f5e63276d..839bc20f7 100644 --- a/Source/WebCore/css/CSSPageRule.cpp +++ b/Source/WebCore/css/CSSPageRule.cpp @@ -30,6 +30,7 @@ #include "StylePropertySet.h" #include "StyleRule.h" #include <wtf/Vector.h> +#include <wtf/text/StringBuilder.h> namespace WebCore { @@ -54,14 +55,17 @@ CSSStyleDeclaration* CSSPageRule::style() const String CSSPageRule::selectorText() const { - String text = "@page"; + StringBuilder text; + text.appendLiteral("@page"); const CSSSelector* selector = m_pageRule->selector(); if (selector) { String pageSpecification = selector->selectorText(); - if (!pageSpecification.isEmpty() && pageSpecification != starAtom) - text += " " + pageSpecification; + if (!pageSpecification.isEmpty() && pageSpecification != starAtom) { + text.append(' '); + text.append(pageSpecification); + } } - return text; + return text.toString(); } void CSSPageRule::setSelectorText(const String& selectorText) @@ -74,17 +78,20 @@ void CSSPageRule::setSelectorText(const String& selectorText) CSSStyleSheet::RuleMutationScope mutationScope(this); - String oldSelectorText = this->selectorText(); m_pageRule->wrapperAdoptSelectorList(selectorList); } String CSSPageRule::cssText() const { - String result = selectorText(); - result += " { "; - result += m_pageRule->properties()->asText(); - result += "}"; - return result; + StringBuilder result; + result.append(selectorText()); + result.appendLiteral(" { "); + String decls = m_pageRule->properties()->asText(); + result.append(decls); + if (!decls.isEmpty()) + result.append(' '); + result.append('}'); + return result.toString(); } void CSSPageRule::reattach(StyleRulePage* rule) @@ -97,7 +104,7 @@ void CSSPageRule::reattach(StyleRulePage* rule) void CSSPageRule::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const { - MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::CSS); + MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); CSSRule::reportBaseClassMemoryUsage(memoryObjectInfo); info.addInstrumentedMember(m_pageRule); info.addInstrumentedMember(m_propertiesCSSOMWrapper); |