source:
webkit/trunk/Source/WebCore/css/CSSNamespaceRule.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.2 KB |
Line | |
---|---|
1 | /* |
2 | * Copyright (C) 2016 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. ``AS IS'' AND ANY |
14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 | */ |
25 | |
26 | #include "config.h" |
27 | #include "CSSNamespaceRule.h" |
28 | |
29 | #include "CSSMarkup.h" |
30 | #include "StyleRule.h" |
31 | #include <wtf/text/StringBuilder.h> |
32 | |
33 | namespace WebCore { |
34 | |
35 | CSSNamespaceRule::CSSNamespaceRule(StyleRuleNamespace& namespaceRule, CSSStyleSheet* parent) |
36 | : CSSRule(parent) |
37 | , m_namespaceRule(namespaceRule) |
38 | { |
39 | } |
40 | |
41 | CSSNamespaceRule::~CSSNamespaceRule() = default; |
42 | |
43 | AtomString CSSNamespaceRule::namespaceURI() const |
44 | { |
45 | return m_namespaceRule->uri(); |
46 | } |
47 | |
48 | AtomString CSSNamespaceRule::prefix() const |
49 | { |
50 | return m_namespaceRule->prefix(); |
51 | } |
52 | |
53 | String CSSNamespaceRule::cssText() const |
54 | { |
55 | auto prefix = this->prefix(); |
56 | StringBuilder result; |
57 | result.append("@namespace "); |
58 | serializeIdentifier(prefix, result); |
59 | result.append(prefix.isEmpty() ? "" : " ", "url(", serializeString(namespaceURI()), ");"); |
60 | return result.toString(); |
61 | } |
62 | |
63 | void CSSNamespaceRule::reattach(StyleRuleBase&) |
64 | { |
65 | } |
66 | |
67 | } // namespace WebCore |