Ignore:
Timestamp:
Jan 2, 2020, 11:31:56 AM (5 years ago)
Author:
[email protected]
Message:

Simplify StringBuilder API/align with makeString by removing appendFixed* functions and using FormatNumber struct instead
https://bugs.webkit.org/show_bug.cgi?id=205671

Reviewed by Alex Christensen.

Source/JavaScriptCore:

  • API/tests/ExecutionTimeLimitTest.cpp:

(testExecutionTimeLimit):

  • runtime/Options.cpp:

(JSC::OptionReader::Option::dump const):
Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...)).

Source/WebCore:

  • css/CSSFontVariationValue.cpp:
  • css/CSSKeyframeRule.cpp:
  • css/CSSTimingFunctionValue.cpp:
  • css/parser/CSSParserToken.cpp:
  • html/HTMLImageElement.cpp:
  • page/scrolling/AxisScrollSnapOffsets.cpp:
  • platform/graphics/Color.cpp:
  • platform/graphics/ExtendedColor.cpp:
  • platform/graphics/ca/win/PlatformCALayerWin.cpp:
  • platform/graphics/freetype/FontCacheFreeType.cpp:
  • svg/SVGNumberList.h:
  • svg/SVGPathStringBuilder.cpp:
  • svg/SVGPointList.h:
  • svg/SVGTransformValue.h:
  • svg/properties/SVGPropertyTraits.h:
  • testing/Internals.cpp:

Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...))
and builder.appendFixedWidthNumber(...) with with builder.append(FormattedNumber::fixedWidth(...))

Source/WebKit:

  • NetworkProcess/cache/NetworkCache.cpp:

(WebKit::NetworkCache::Cache::dumpContentsToFile):

  • NetworkProcess/cache/NetworkCacheEntry.cpp:

(WebKit::NetworkCache::Entry::asJSON const):

  • Shared/Gamepad/GamepadData.cpp:

(WebKit::GamepadData::loggingString const):
Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...)).

Source/WTF:

In an ongoing attempt to simplify the StringBuilder interface and unify it's functionality with makeString,
this change removes appendFixedPrecisionNumber() and appendFixedWidthNumber(), replacing their uses
with direct calls to append(), using a FormattedNumber object to direct it to the appropriate StringTypeAdapter.

  • wtf/text/StringBuilder.h:
  • wtf/text/StringBuilder.cpp:

(WTF::StringBuilder::appendFixedPrecisionNumber): Deleted.
(WTF::StringBuilder::appendFixedWidthNumber): Deleted.
Remove StringBuilder::appendFixedPrecisionNumber() and StringBuilder::appendFixedWidthNumber(). The same functionality
is available and more flexible by passing FormattedNumbers to the variadic append() function.

  • wtf/text/TextStream.cpp:

(WTF::TextStream::operator<<):

  • wtf/MediaTime.cpp:

(WTF::MediaTime::toString const):
Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...))
and builder.appendFixedWidthNumber(...) with with builder.append(FormattedNumber::fixedWidth(...))

Tools:

  • WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:

Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...)).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/CSSKeyframeRule.cpp

    r251655 r253975  
    6464        if (i)
    6565            keyText.append(',');
    66         keyText.appendFixedPrecisionNumber(m_keys.at(i) * 100);
     66        keyText.append(FormattedNumber::fixedPrecision(m_keys.at(i) * 100));
    6767        keyText.append('%');
    6868    }
Note: See TracChangeset for help on using the changeset viewer.