source:
webkit/trunk/Source/WebCore/css/CSSLineBoxContainValue.cpp
Last change on this file was 277967, checked in by Darin Adler, 4 years ago | |
---|---|
Remove StringBuilder::appendLiteral
Reviewed by Chris Dumez.
Source/JavaScriptCore:
(PingPongStackOverflowObject_hasInstance): Use append instead of appendLiteral.
(Deprecated::ScriptCallArgumentHandler::appendArgument): Remove unnecessary cast
(JSC::ArrayPatternNode::toString const): Use append instead of appendLiteral.
(JSC::HeapSnapshotBuilder::json): Use append instead of appendLiteral.
(Inspector::InspectorAuditAgent::run): Use makeString instead of StringBuilder.
(JSC::IdentifierArena::makePrivateIdentifier): Use auto for the result of makeString.
(JSC::ConsoleClient::printConsoleMessage): Use append instead of appendLiteral.
(JSC::formatDateTime): Ditto.
(JSC::ErrorInstance::sanitizedToString): Use makeString instead of StringBuilder.
(JSC::notAFunctionSourceAppender): Use append instead of appendLiteral.
(JSC::IntlDateTimeFormat::initializeDateTimeFormat): Ditto.
(JSC::IntlNumberFormat::initializeNumberFormat): Ditto.
(JSC::JSCustomGetterFunction::create): Use auto and cut down on reference count
(JSC::JSCustomSetterFunction::create): Ditto.
append for better efficiency.
(JSC::Stringifier::appendStringifiedValue): Use append instead of appendLiteral.
Unrelated to StringBuilder::appendLiteral, but dead code.
(JSC::Options::dumpOption): Use append instead of appendLiteral.
(JSC::appendLineTerminatorEscape<UChar>): Ditto.
(JSC::SamplingProfiler::reportTopFunctions): Use auto for the result of makeString.
(JSC::TypeProfiler::typeInformationForExpressionAtOffset): Use append instead of
(JSC::TypeSet::dumpTypes const): Use append instead of appendLiteral.
Source/WebCore:
(WebCore::packageFormData): Use auto for the result of makeString.
(WebCore::IDBKeyData::loggingString const): Use append instead
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use auto
(WebCore::IDBServer::buildPreIndexStatement): Use makeString
(WebCore::encodeProtocolString): Use append instead of appendLiteral.
(WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension): Ditto.
(WebCore::WebSocketHandshake::clientHandshakeMessage const): Use
(formatForDebugger): Use makeString instead of StringBuilder.
(WebCore::ContentExtensions::prefixTreeVertexToString): Use
(WebCore::buildCircleString): Ditto.
(WebCore::CSSLinearGradientValue::customCSSText const): Ditto.
(WebCore::CSSGridIntegerRepeatValue::customCSSText const):
(WebCore::CSSImageSetValue::customCSSText const): Use append
(WebCore::CSSImportRule::cssText const): Use makeString instead
(WebCore::StyleRuleKeyframe::cssText const): Ditto.
(WebCore::CSSKeyframesRule::cssText const): Use variadic append.
(WebCore::CSSLineBoxContainValue::customCSSText const): Use
(WebCore::CSSNamespaceRule::cssText const): Ditto.
(WebCore::CSSPageRule::cssText const): Use makeString instead of
(WebCore::CSSPaintImageValue::customCSSText const): Ditto.
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const):
(WebCore::appendLangArgumentList): Use variadic append.
(WebCore::CSSSelectorList::buildSelectorsText const): Use
(WebCore::CSSStyleSheet::CSSStyleSheet): Moved more of the
(WebCore::CSSStepsTimingFunctionValue::customCSSText const):
(WebCore::MediaQuerySet::mediaText const): Use append instead
(WebCore::MediaQuery::serialize const): Ditto.
(WebCore::MediaQueryExpression::serialize const): Use makeString
(WebCore::StyleProperties::getLayeredShorthandValue const):
(WebCore::CSSParserToken::serialize const): Removed a lot of
(WebCore::Document::initSecurityContext): Use auto for the result
(WebCore::appendAttributes): Use variadic append and append
(WebCore::SecurityContext::parseSandboxPolicy): Ditto.
(WebCore::convertHTMLTextToInterchangeFormat): Ditto.
(WebCore::createSearcher): Use auto for the result of makeString.
(WebCore::StyledMarkupAccumulator::appendStyleNodeOpenTag):
(WebCore::recordFormStructure): Ditto.
(WebCore::HTMLFormControlElement::reportValidity): Use auto for
(WebCore::HTMLFormElement::validateInteractively): Ditto.
(WebCore::HTMLImageElement::completeURLsInAttributeValue const):
(WebCore::restrictionNames): Use auto for the result of makeString.
(WebCore::WebGLRenderingContextBase::getUniformLocation): Ditto.
(WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemaining): Ditto.
(WebCore::buildConsoleError): Use makeString instead of StringBuilder.
(WebCore::TextTrackCue::rebuildDisplayTree): Ditto.
(WebCore::expressionForEvaluatingCommand): Use append instead of appendLiteral.
(WebCore::InspectorOverlay::drawElementTitle): Use auto for the result of makeString.
(WebCore::InspectorStyleSheet::addRule): Use append instead of appendLiteral.
(WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource):
(WebCore::WebConsoleAgent::didReceiveResponse): Use auto for the result of makeString.
(WebCore::logWarning): Ditto
(WebCore::makeValidURL): Added. Used for various cases below that all construct
(WebCore::appendBoolean): Use append instead of appendLiteral.
(WebCore::WorkerThreadableLoader::loadResourceSynchronously): Use auto for
(WebCore::DOMWindow::postMessage): Ditto.
(WebCore::createRegExpForLabels): Use append instead of appendLiteral.
(WebCore::FrameView::logMockScrollAnimatorMessage const): Use makeString
(WebCore::PageSerializer::SerializerMarkupAccumulator::appendStartTag):
(WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString):
(WebCore::ResourceUsageOverlay::platformDraw): Use auto for the result of
(WebCore::consoleMessageForViolation): Use makeString instsead of StringBuilder.
(WebCore::ContentSecurityPolicyDirectiveList::create): Get rid of local
(WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
(WebCore::Decimal::toString const): Use append instead of appendLiteral.
(WebCore::TimingFunction::createFromCSSText): Use makeString instead
(WebCore::HRTFElevation::calculateKernelsForAzimuthElevation): Use auto
(WebCore::buildUserAgentString): Use append instead of appendLiteral.
(WebCore::InbandTextTrackPrivateAVF::processCueAttributes): Use
(WebCore::GraphicsLayerCA::recursiveCommitChanges): Got rid of local
(WebCore::TileController::tileRevalidationTimerFired): Update to
(WebCore::validationPolicyAsString): Use OptionSet.
Removed some type names.
(WebCore::PlatformCAFilters::setFiltersOnLayer): Use auto for
(WebCore::MockRealtimeVideoSource::drawText): Ditto.
(WebCore::ScrollAnimatorMock::scrollbarPrefix const): Added
(WebCore::appendProxyServerString): Use append instead of appendLiteral.
(WebCore::ResourceResponseBase::sanitizeSuggestedFilename): Get rid
(WebCore::platformForUAString): Deleted. No need for a global variable
(WebCore::SQLiteDatabase::open): Use auto for result of makeString.
(WebCore::SQLiteFileSystem::deleteDatabaseFile): Ditto.
(WebCore::DateTimeFormat::quoteAndAppendLiteral): Use append instead
(WebCore::replaceNewlinesWithWindowsStyleNewlines): Use append
(WebCore::standardUserAgent): Use makeString instead of StringBuildeer.
(WebCore::RenderLayer::name const): Ditto.
(WebCore::RenderLayerCompositor::logLayerInfo): Use append instead of
(WebCore::quoteAndEscapeNonPrintables): Ditto.
(WebCore::SVGPathStringBuilder::moveTo): Ditto.
(WebCore::Internals::dumpMarkerRects): Ditto.
(WebCore::WorkerScriptLoader::validateWorkerResponse): Use auto
Source/WebKit:
(WebKit::ResourceLoadStatisticsDatabaseStore::ensureAndMakeDomainList): Use append
(WebKit::ResourceLoadStatisticsMemoryStore::dumpResourceLoadStatistics): Ditto.
(WebKit::domainsToString): Ditto.
(WebKit::WebResourceLoadStatisticsStore::create): Moved this here from the header.
functions of the nested structures into the implementation file and fixed
(WebKit::NetworkLoadChecker::continueCheckingRequest): Do not use a local
(WebKit::NetworkProcess::newTestingSession): Ditto.
(WebKit::NetworkCache::Cache::dumpContentsToFile): Use append instead of appendLiteral
(WebKit::NetworkCache::Entry::asJSON const): Ditto.
(WebKit::NetworkCache::makeVersionedDirectoryPath): Do not use a local variable for
(WebKit::buildAcceptLanguages): Use append instead of appendLiteral.
(WebKit::WebSocketTask::acceptedExtensions const): Ditto.
(WebKit::NetworkMDNSRegister::registerMDNSName): Use auto for the result of makeString.
(WebKit::WebMemorySampler::writeHeaders): Ditto.
(WebKit::initializeSandboxParameters): Do not use a local variable for the result of
(WebKit::WebMemorySampler::sampleWebKit const): Use ASCIILiteral and remove explicit
(webkitWebViewRunJavaScriptCallback): Use append instead of appendLiteral.
(WebKit::fileCanBeAcceptedForUpload): Use auto for result of makeString.
StringBuilder.
(WebKit::NetworkProcessProxy::requestStorageSpace): Use auto for result of makeString.
(WebKit::WebBackForwardList::loggingString): Use append instead of appendLiteral.
(WebKit::WebProcessPool::processDidFinishLaunching): Use auto for result of makeString.
(WebKit::dumpHistoryItem): Use append instead of appendLiteral.
Source/WebKitLegacy:
(NetworkStorageSessionMap::switchToNewTestingSession): Do not use local
Source/WebKitLegacy/mac:
(regExpForLabels): Use append instead of appendLiteral.
Source/WebKitLegacy/win:
(AccessibleBase::get_accKeyboardShortcut): Use append instead of appnedLiteral.
Source/WTF:
The optimization done by appendLiteral has minimal value and is something we
If we decide we need an optimization for literals, we can come up with a
(WTF::FileSystemImpl::encodeForFileName): Streamline logic,
(WTF::JSONImpl::Value::escapeString): Use append instead
(WTF::Logger::log): Use auto for result of makeString.
(WTF::MediaTime::toString const): Use makeString instead of StringBuilder.
Made lengthOfIntegerAsString a constexpr function so we can use it to
(WTF::StringBuilder::appendLiteral): Deleted.
StringImpl*, AtomStringImpl&, and AtomStringImpl*.
Tools:
Use append instead of appendLiteral.
(TestWebKitAPI::createCommand): Use makeString instead of StringBuilder.
(TestWebKitAPI::TEST_F): Made lots of fixes to code inside #if TEST_OUTPUT,
(TestWebKitAPI::testDecode): Use append instead of appendLiteral.
(WTR::AccessibilityUIElement::helpText const): Ditto. |
|
|
|
File size: 2.4 KB |
Line | |
---|---|
1 | /* |
2 | * Copyright (C) 2011 Apple Inc. All rights reserved. |
3 | * |
4 | * Redistribution and use in source and binary forms, with or without |
5 | * modification, are permitted provided that the following conditions |
6 | * are met: |
7 | * 1. Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. |
9 | * 2. Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. |
12 | * |
13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' |
14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS |
17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
23 | * THE POSSIBILITY OF SUCH DAMAGE. |
24 | */ |
25 | |
26 | #include "config.h" |
27 | #include "CSSLineBoxContainValue.h" |
28 | |
29 | #include <wtf/text/StringBuilder.h> |
30 | |
31 | namespace WebCore { |
32 | |
33 | CSSLineBoxContainValue::CSSLineBoxContainValue(OptionSet<LineBoxContain> value) |
34 | : CSSValue(LineBoxContainClass) |
35 | , m_value(value) |
36 | { |
37 | } |
38 | |
39 | String CSSLineBoxContainValue::customCSSText() const |
40 | { |
41 | StringBuilder text; |
42 | if (m_value.contains(LineBoxContain::Block)) |
43 | text.append("block"); |
44 | if (m_value.contains(LineBoxContain::Inline)) |
45 | text.append(text.isEmpty() ? "" : " ", "inline"); |
46 | if (m_value.contains(LineBoxContain::Font)) |
47 | text.append(text.isEmpty() ? "" : " ", "font"); |
48 | if (m_value.contains(LineBoxContain::Glyphs)) |
49 | text.append(text.isEmpty() ? "" : " ", "glyphs"); |
50 | if (m_value.contains(LineBoxContain::Replaced)) |
51 | text.append(text.isEmpty() ? "" : " ", "replaced"); |
52 | if (m_value.contains(LineBoxContain::InlineBox)) |
53 | text.append(text.isEmpty() ? "" : " ", "inline-box"); |
54 | if (m_value.contains(LineBoxContain::InitialLetter)) |
55 | text.append(text.isEmpty() ? "" : " ", "initial-letter"); |
56 | return text.toString(); |
57 | } |
58 | |
59 | } |