diff options
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); |