source: webkit/trunk/Source/WebCore/css/CSSFontFeatureValue.cpp

Last change on this file was 277437, checked in by Darin Adler, 4 years ago

Remove StringBuilder::appendNumber
https://bugs.webkit.org/show_bug.cgi?id=225732

Reviewed by Sam Weinig.

Source/JavaScriptCore:

  • API/JSContextRef.cpp:

(BacktraceFunctor::operator() const): Use append instead of appendNumber.

  • API/tests/PingPongStackOverflowTest.cpp:

(PingPongStackOverflowObject_hasInstance): Ditto.

  • heap/HeapSnapshotBuilder.cpp:

(JSC::HeapSnapshotBuilder::json): Ditto.

  • interpreter/StackVisitor.cpp:

(JSC::StackVisitor::Frame::toString const): Use makeString instead of StringBuilder.

  • runtime/ConsoleClient.cpp:

(JSC::appendURLAndPosition): Ditto.
(JSC::ConsoleClient::printConsoleMessageWithArguments): Use append instead of appendNumber.

  • runtime/JSONObject.cpp:

(JSC::Stringifier::appendStringifiedValue): Ditto.

  • runtime/Options.cpp:

(JSC::OptionReader::Option::dump const): Ditto.

  • runtime/StackFrame.cpp:

(JSC::StackFrame::toString const): Use makeString instead of StringBuilder.

Source/WebCore:

  • Modules/indexeddb/server/IndexValueStore.cpp:

(WebCore::IDBServer::IndexValueStore::loggingString const):
Use append instead of appendNumber.

  • Modules/websockets/WebSocketHandshake.cpp:

(WebCore::hostName): Use makeString instead of StringBuilder.

  • contentextensions/CombinedURLFilters.cpp:

(WebCore::ContentExtensions::prefixTreeVertexToString):
Use append instead of appendNumber.

  • contentextensions/Term.h:

(WebCore::ContentExtensions::Term::toString const): Ditto.

  • css/CSSFontFeatureValue.cpp:

(WebCore::CSSFontFeatureValue::customCSSText const): Ditto.

  • css/CSSTimingFunctionValue.cpp:

(WebCore::CSSStepsTimingFunctionValue::customCSSText const): Ditto.

  • dom/Document.cpp:

(WebCore::Document::downgradeReferrerToRegistrableDomain): Use
makeString instead of StringBuilder.

  • editing/MarkupAccumulator.cpp:

(WebCore::MarkupAccumulator::generateUniquePrefix): Ditto.

  • editing/cocoa/DataDetection.mm:

(WebCore::dataDetectorStringForPath): Use append instead of appendNumber.

  • html/HTMLAnchorElement.cpp:

(WebCore::appendServerMapMousePosition): Ditto.

  • html/HTMLCanvasElement.cpp:

(WebCore::HTMLCanvasElement::createContext2d): Use makeString
instead of StringBuilder.
(WebCore::HTMLCanvasElement::createImageBuffer const): Ditto.

  • loader/ResourceLoadStatistics.cpp:

(WebCore::ResourceLoadStatistics::toString const): Use append instead
of appendNumber.

  • loader/SubresourceIntegrity.cpp:

(WebCore::integrityMismatchDescription): Use makeString instead of
StringBuilder.

  • page/IntersectionObserver.cpp:

(WebCore::IntersectionObserver::rootMargin const): Use append instead
of appendNumber.

  • page/SecurityOriginData.cpp:

(WebCore::SecurityOriginData::databaseIdentifier const): Use makeString
instead of StringBuilder.

  • platform/Decimal.cpp:

(WebCore::Decimal::toString const): Use append instead of appendNumber.

  • platform/graphics/GraphicsLayer.cpp:

(WebCore::GraphicsLayer::animationNameForTransition): Use makeString
instead of StringBuilder.

  • platform/graphics/ca/TileController.cpp:

(WebCore::TileController::createTileLayer): Ditto.

  • platform/graphics/ca/win/PlatformCALayerWin.cpp:

(printTransform): Use single append instead of a run of them.
(printLayer): Ditto, and use append instead of apppendNumber.
(PlatformCALayerWin::layerTreeAsString const): Ditto.

  • platform/mediarecorder/MediaRecorderPrivateMock.cpp:

(WebCore::MediaRecorderPrivateMock::generateMockCounterString):
Use append instead of appendNumber.

  • platform/network/ProxyServer.cpp:

(WebCore::appendProxyServerString): Ditto.

  • rendering/RenderTreeAsText.cpp:

(WebCore::nodePosition): Ditto.

  • svg/SVGPathUtilities.cpp:

(WebCore::buildStringFromPath): Ditto.

  • testing/Internals.cpp:

(WebCore::Internals::parserMetaData): Use makeString instead of
StringBuilder.
(WebCore::appendOffsets): Use append instead of appendNumber.

  • testing/MockPageOverlayClient.cpp:

(WebCore::MockPageOverlayClient::drawRect): Use makeString instead
of StringBuilder.
(WebCore::MockPageOverlayClient::mouseEvent): Ditto.

  • xml/XMLErrors.cpp:

(WebCore::XMLErrors::appendErrorMessage): Use append instead of
appendNumber.

Source/WebDriver:

  • SessionHost.cpp:

(WebDriver::SessionHost::sendCommandToBackend): Use append instead
of appendNumber.

  • socket/HTTPServerSocket.cpp:

(WebDriver::HTTPRequestHandler::packHTTPMessage const): Ditto.

Source/WebKit:

  • NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:

(WebKit::buildList): Use append instead of appendNumber.
(WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources): Ditto.
(WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const): Ditto.
(WebKit::ResourceLoadStatisticsDatabaseStore::attributionToString): Ditto.
(WebKit::ResourceLoadStatisticsDatabaseStore::privateClickMeasurementToString): Ditto.

  • Shared/WebMemorySampler.cpp:

(WebKit::WebMemorySampler::appendCurrentMemoryUsageToFile): Ditto.

  • UIProcess/API/glib/WebKitWebView.cpp:

(webkitWebViewRunJavaScriptCallback): Ditto.

  • UIProcess/WebBackForwardList.cpp:

(WebKit::WebBackForwardList::loggingString): Ditto.

  • WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:

(PageResourceLoadClient::didReceiveResponseForResource): Use makeString instead
of StringBuilder.

  • WebProcess/Plugins/PluginView.cpp:

(WebKit::buildHTTPHeaders): Use append instead of appendNumber.

Source/WebKitLegacy/win:

  • WebKitStatistics.cpp:

(WebKitStatistics::comClassNameCounts): Use append instead of
appendNumber.

Source/WTF:

We originally added StringBuilder::appendNumber to resolve the ambiguity
between UChar and uint16_t, but that problem was solved long ago and it
is safe to use StringBuilder::append, including the variadic form, on all
types of numbers and we'll get the same results we did with appendNumber.

  • wtf/JSONValues.cpp:

(WTF::JSONImpl::Value::writeJSON const): Use append instead of appendNumber.

  • wtf/text/StringBuilder.cpp:

(WTF::StringBuilder::appendNumber): Deleted.

  • wtf/text/StringBuilder.h: Removed appendNumber.
  • wtf/text/TextStream.cpp:

(WTF::TextStream::operator<<): Use append instead of appendNumber.

Tools:

  • TestWebKitAPI/Tests/WTF/StringBuilder.cpp:

Test append with a number instead of appendNumber.

  • TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp:

Use append instead of appendNumber.

  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:

(WTR::dumpResponseDescriptionSuitableForTestResult): Use append instead
of appendNumber.
(WTR::dumpFrameScrollPosition): Ditto.
(WTR::InjectedBundlePage::didFinishDocumentLoadForFrame): Use makeString
instead of StringBuilder.
(WTR::InjectedBundlePage::shouldCacheResponse): Ditto.

  • WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:

(WTR::attributesOfElement): Use append instead of appendNumber.
(WTR::AccessibilityUIElement::attributedStringForRange): Ditto.
(WTR::stringAtOffset): Ditto.

  • Property svn:eol-style set to native
File size: 2.1 KB
Line 
1/*
2 * Copyright (C) 2011 Google 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 "CSSFontFeatureValue.h"
28
29#include "CSSValueKeywords.h"
30#include <wtf/text/StringBuilder.h>
31
32namespace WebCore {
33
34CSSFontFeatureValue::CSSFontFeatureValue(FontTag&& tag, int value)
35 : CSSValue(FontFeatureClass)
36 , m_tag(WTFMove(tag))
37 , m_value(value)
38{
39}
40
41String CSSFontFeatureValue::customCSSText() const
42{
43 StringBuilder builder;
44 builder.append('"');
45 for (char c : m_tag)
46 builder.append(c);
47 builder.append('"');
48 // Omit the value if it's 1 as 1 is implied by default.
49 if (m_value != 1)
50 builder.append(' ', m_value);
51 return builder.toString();
52}
53
54bool CSSFontFeatureValue::equals(const CSSFontFeatureValue& other) const
55{
56 return m_tag == other.m_tag && m_value == other.m_value;
57}
58
59}
Note: See TracBrowser for help on using the repository browser.