WebKit Bugzilla
Attachment 372424 Details for
Bug 198918
: Use even more "shortest form" formatting, and less "fixed precision" and "fixed width"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198918-20190618204738.patch (text/plain), 27.71 KB, created by
Darin Adler
on 2019-06-18 20:47:39 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Darin Adler
Created:
2019-06-18 20:47:39 PDT
Size:
27.71 KB
patch
obsolete
>Subversion Revision: 246497 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index d28e15aff5b0cd9cf733300a08c28b93406c6f98..3c6ae788d44694b36e9d54ce4dde24601643e020 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,16 @@ >+2019-06-17 Darin Adler <darin@apple.com> >+ >+ Use even more "shortest form" formatting, and less "fixed precision" and "fixed width" >+ https://bugs.webkit.org/show_bug.cgi?id=198918 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/Logger.h: >+ (WTF::LogArgument::toString): >+ * wtf/text/ValueToString.h: >+ (WTF::ValueToString<float>::string): >+ (WTF::ValueToString<double>::string): >+ > 2019-06-16 Darin Adler <darin@apple.com> > > Rename AtomicString to AtomString >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2ad133abf16425ca0e5233bdc01ebb04b40e4433..1b0c7f594f0d8ee087911a4fcae1330987dc00c1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,55 @@ >+2019-06-17 Darin Adler <darin@apple.com> >+ >+ Use even more "shortest form" formatting, and less "fixed precision" and "fixed width" >+ https://bugs.webkit.org/show_bug.cgi?id=198918 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * accessibility/AccessibilityNodeObject.cpp: >+ (WebCore::AccessibilityNodeObject::changeValueByStep): >+ (WebCore::AccessibilityNodeObject::changeValueByPercent): >+ * css/CSSAspectRatioValue.cpp: >+ (WebCore::CSSAspectRatioValue::customCSSText const): >+ * css/CSSFontVariationValue.cpp: >+ (WebCore::CSSFontVariationValue::customCSSText const): >+ * css/MediaQueryEvaluator.cpp: >+ (WebCore::aspectRatioValueAsString): >+ * html/HTMLImageElement.cpp: >+ (WebCore::HTMLImageElement::completeURLsInAttributeValue const): >+ * inspector/InspectorOverlay.cpp: >+ (WebCore::InspectorOverlay::drawRulers): >+ * platform/LayoutUnit.h: >+ (WTF::ValueToString<WebCore::LayoutUnit>::string): >+ * platform/graphics/Color.cpp: >+ (WebCore::Color::cssText const): >+ * platform/graphics/ExtendedColor.cpp: >+ (WebCore::ExtendedColor::cssText const): >+ * svg/SVGAngleValue.cpp: >+ (WebCore::SVGAngleValue::valueAsString const): >+ * svg/SVGLengthValue.cpp: >+ (WebCore::SVGLengthValue::valueAsString const): >+ * svg/SVGPathStringBuilder.cpp: >+ (WebCore::appendNumber): >+ (WebCore::appendPoint): >+ * svg/SVGTransformValue.h: >+ (WebCore::SVGTransformValue::appendNumber): >+ (WebCore::SVGTransformValue::appendNumbers): >+ (WebCore::SVGTransformValue::appendMatrix const): >+ (WebCore::SVGTransformValue::appendTranslate const): >+ (WebCore::SVGTransformValue::appendScale const): >+ (WebCore::SVGTransformValue::appendRotate const): >+ (WebCore::SVGTransformValue::appendSkewX const): >+ (WebCore::SVGTransformValue::appendSkewY const): >+ (WebCore::SVGTransformValue::appendFixedPrecisionNumbers): Deleted. >+ * svg/properties/SVGPropertyTraits.h: >+ (WebCore::SVGPropertyTraits<float>::toString): >+ (WebCore::SVGPropertyTraits<FloatPoint>::toString): >+ (WebCore::SVGPropertyTraits<FloatRect>::toString): >+ * testing/Internals.cpp: >+ (WebCore::Internals::dumpMarkerRects): >+ (WebCore::Internals::configurationForViewport): >+ (WebCore::Internals::getCurrentCursorInfo): >+ > 2019-06-17 Ludovico de Nittis <ludovico.denittis@collabora.com> > > [GTK] Stop accessing GdkEvent fields when possible >diff --git a/Source/WTF/wtf/Logger.h b/Source/WTF/wtf/Logger.h >index 4f5e1a370ec902a9ce69ceef6c5ab03aa96d2761..8286a0714b51e57892a0662c4721b0542e3370b8 100644 >--- a/Source/WTF/wtf/Logger.h >+++ b/Source/WTF/wtf/Logger.h >@@ -39,8 +39,8 @@ struct LogArgument { > template<typename U = T> static typename std::enable_if<std::is_same<U, unsigned long long>::value, String>::type toString(unsigned long argument) { return String::number(argument); } > template<typename U = T> static typename std::enable_if<std::is_same<U, long long>::value, String>::type toString(long argument) { return String::number(argument); } > template<typename U = T> static typename std::enable_if<std::is_enum<U>::value, String>::type toString(U argument) { return String::number(static_cast<typename std::underlying_type<U>::type>(argument)); } >- template<typename U = T> static typename std::enable_if<std::is_same<U, float>::value, String>::type toString(float argument) { return String::numberToStringFixedPrecision(argument); } >- template<typename U = T> static typename std::enable_if<std::is_same<U, double>::value, String>::type toString(double argument) { return String::numberToStringFixedPrecision(argument); } >+ template<typename U = T> static typename std::enable_if<std::is_same<U, float>::value, String>::type toString(float argument) { return String::number(argument); } >+ template<typename U = T> static typename std::enable_if<std::is_same<U, double>::value, String>::type toString(double argument) { return String::number(argument); } > template<typename U = T> static typename std::enable_if<std::is_same<typename std::remove_reference<U>::type, AtomString>::value, String>::type toString(const AtomString& argument) { return argument.string(); } > template<typename U = T> static typename std::enable_if<std::is_same<typename std::remove_reference<U>::type, String>::value, String>::type toString(String argument) { return argument; } > template<typename U = T> static typename std::enable_if<std::is_same<typename std::remove_reference<U>::type, StringBuilder*>::value, String>::type toString(StringBuilder* argument) { return argument->toString(); } >diff --git a/Source/WTF/wtf/text/ValueToString.h b/Source/WTF/wtf/text/ValueToString.h >index c1ef993d4b25f2ee573c7af8fff560e1e7fc5978..4c5eb67ac37952c9c08ce4dd47f6282f21ca18df 100644 >--- a/Source/WTF/wtf/text/ValueToString.h >+++ b/Source/WTF/wtf/text/ValueToString.h >@@ -42,11 +42,11 @@ template<> struct ValueToString<int> { > }; > > template<> struct ValueToString<float> { >- static String string(float value) { return String::numberToStringFixedPrecision(value); } >+ static String string(float value) { return String::number(value); } > }; > > template<> struct ValueToString<double> { >- static String string(double value) { return String::numberToStringFixedPrecision(value); } >+ static String string(double value) { return String::number(value); } > }; > > } // namespace WTF >diff --git a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp >index a2d327f8cf17808caf25a6805a488e88f8d4e5bf..0b477365cda13dbdf471e1f22a2f34d7ab451734 100644 >--- a/Source/WebCore/accessibility/AccessibilityNodeObject.cpp >+++ b/Source/WebCore/accessibility/AccessibilityNodeObject.cpp >@@ -1104,7 +1104,7 @@ void AccessibilityNodeObject::changeValueByStep(bool increase) > > value += increase ? step : -step; > >- setValue(String::numberToStringFixedPrecision(value)); >+ setValue(String::number(value)); > > auto objectCache = axObjectCache(); > if (objectCache) >@@ -1122,7 +1122,7 @@ void AccessibilityNodeObject::changeValueByPercent(float percentChange) > step = std::abs(percentChange) * (1 / percentChange); > > value += step; >- setValue(String::numberToStringFixedPrecision(value)); >+ setValue(String::number(value)); > > auto objectCache = axObjectCache(); > if (objectCache) >diff --git a/Source/WebCore/css/CSSAspectRatioValue.cpp b/Source/WebCore/css/CSSAspectRatioValue.cpp >index 7856097f64d9d3c98099e21ea1f4cdaf61451c60..e8251fc36de500b0678c646834a216a0ae9a2510 100644 >--- a/Source/WebCore/css/CSSAspectRatioValue.cpp >+++ b/Source/WebCore/css/CSSAspectRatioValue.cpp >@@ -35,7 +35,7 @@ namespace WebCore { > > String CSSAspectRatioValue::customCSSText() const > { >- return makeString(FormattedNumber::fixedPrecision(m_numeratorValue), '/', FormattedNumber::fixedPrecision(m_denominatorValue)); >+ return makeString(m_numeratorValue, '/', m_denominatorValue); > } > > bool CSSAspectRatioValue::equals(const CSSAspectRatioValue& other) const >diff --git a/Source/WebCore/css/CSSFontVariationValue.cpp b/Source/WebCore/css/CSSFontVariationValue.cpp >index 9fcd0b1661cd2b8a410e94758102a2124fe6f7b7..72ddc1a1737821e1705b91f07a97feb9a79c1dc2 100644 >--- a/Source/WebCore/css/CSSFontVariationValue.cpp >+++ b/Source/WebCore/css/CSSFontVariationValue.cpp >@@ -47,7 +47,7 @@ String CSSFontVariationValue::customCSSText() const > for (char c : m_tag) > builder.append(c); > builder.appendLiteral("\" "); >- builder.appendFixedPrecisionNumber(m_value); >+ builder.appendNumber(m_value); > return builder.toString(); > } > >diff --git a/Source/WebCore/css/MediaQueryEvaluator.cpp b/Source/WebCore/css/MediaQueryEvaluator.cpp >index 6cac9e1e36ad99acf8dabc09dff79f15ad8e2302..6d149de1842401b41252e4043f54d37e28d2aac2 100644 >--- a/Source/WebCore/css/MediaQueryEvaluator.cpp >+++ b/Source/WebCore/css/MediaQueryEvaluator.cpp >@@ -245,7 +245,7 @@ static String aspectRatioValueAsString(CSSValue* value) > return emptyString(); > > auto& aspectRatio = downcast<CSSAspectRatioValue>(*value); >- return makeString(FormattedNumber::fixedWidth(aspectRatio.numeratorValue(), 6), '/', FormattedNumber::fixedWidth(aspectRatio.denominatorValue(), 6)); >+ return makeString(aspectRatio.numeratorValue(), '/', aspectRatio.denominatorValue()); > } > > #endif >diff --git a/Source/WebCore/html/HTMLImageElement.cpp b/Source/WebCore/html/HTMLImageElement.cpp >index 93ead5cccb0d27845536f7c7a73cfcd343efac45..96c8495c7b145f4444d58709ce7a1b98a55cedce 100644 >--- a/Source/WebCore/html/HTMLImageElement.cpp >+++ b/Source/WebCore/html/HTMLImageElement.cpp >@@ -550,7 +550,7 @@ String HTMLImageElement::completeURLsInAttributeValue(const URL& base, const Att > result.append(URL(base, candidate.string.toString()).string()); > if (candidate.density != UninitializedDescriptor) { > result.append(' '); >- result.appendFixedPrecisionNumber(candidate.density); >+ result.appendNumber(candidate.density); > result.append('x'); > } > if (candidate.resourceWidth != UninitializedDescriptor) { >diff --git a/Source/WebCore/inspector/InspectorOverlay.cpp b/Source/WebCore/inspector/InspectorOverlay.cpp >index 09cbf6564181eed5b37c9fd43ad64a1640acadd3..3c1b68accee9c988aa139217111d79ee4079a4f8 100644 >--- a/Source/WebCore/inspector/InspectorOverlay.cpp >+++ b/Source/WebCore/inspector/InspectorOverlay.cpp >@@ -790,7 +790,7 @@ void InspectorOverlay::drawRulers(GraphicsContext& context, const Highlight::Bou > > GraphicsContextStateSaver verticalLabelStateSaver(context); > context.translate(zoom(x) + 0.5f, scrollY); >- context.drawText(font, TextRun(String::numberToStringFixedPrecision(x)), { 2, drawTopEdge ? rulerLabelSize : rulerLabelSize - rulerSize + font.fontMetrics().height() - 1.0f }); >+ context.drawText(font, TextRun(String::number(x)), { 2, drawTopEdge ? rulerLabelSize : rulerLabelSize - rulerSize + font.fontMetrics().height() - 1.0f }); > } > } > >@@ -828,7 +828,7 @@ void InspectorOverlay::drawRulers(GraphicsContext& context, const Highlight::Bou > GraphicsContextStateSaver horizontalLabelStateSaver(context); > context.translate(scrollX, zoom(y) + 0.5f); > context.rotate(drawLeftEdge ? -piOverTwoFloat : piOverTwoFloat); >- context.drawText(font, TextRun(String::numberToStringFixedPrecision(y)), { 2, drawLeftEdge ? rulerLabelSize : rulerLabelSize - rulerSize }); >+ context.drawText(font, TextRun(String::number(y)), { 2, drawLeftEdge ? rulerLabelSize : rulerLabelSize - rulerSize }); > } > } > } >diff --git a/Source/WebCore/platform/LayoutUnit.h b/Source/WebCore/platform/LayoutUnit.h >index 46a9634bba45c9a0f424b60696c8294a9676921e..c9b5d3a68d95f20de1c52be6e4c3c1fc59b87168 100644 >--- a/Source/WebCore/platform/LayoutUnit.h >+++ b/Source/WebCore/platform/LayoutUnit.h >@@ -846,7 +846,7 @@ namespace WTF { > > // This structure is used by PODIntervalTree for debugging. > template<> struct ValueToString<WebCore::LayoutUnit> { >- static String string(WebCore::LayoutUnit value) { return String::numberToStringFixedPrecision(value.toFloat()); } >+ static String string(WebCore::LayoutUnit value) { return String::number(value.toFloat()); } > }; > > } // namespace WTF >diff --git a/Source/WebCore/platform/graphics/Color.cpp b/Source/WebCore/platform/graphics/Color.cpp >index c74d0219610c7bc738fc9c17b3551624c3987924..896450978747c01c1227f7a8e7a1e3feecfd1300 100644 >--- a/Source/WebCore/platform/graphics/Color.cpp >+++ b/Source/WebCore/platform/graphics/Color.cpp >@@ -377,7 +377,7 @@ String Color::cssText() const > builder.appendNumber(static_cast<unsigned char>(blue())); > if (colorHasAlpha) { > builder.appendLiteral(", "); >- builder.appendFixedPrecisionNumber(alpha() / 255.0f); >+ builder.appendNumber(alpha() / 255.0f); > } > > builder.append(')'); >diff --git a/Source/WebCore/platform/graphics/ExtendedColor.cpp b/Source/WebCore/platform/graphics/ExtendedColor.cpp >index 2a3c83e53ecfc67067847399e6159ad9bed34b22..fc27c080e739234f9646252d29c34d227d3e98ea 100644 >--- a/Source/WebCore/platform/graphics/ExtendedColor.cpp >+++ b/Source/WebCore/platform/graphics/ExtendedColor.cpp >@@ -56,16 +56,16 @@ String ExtendedColor::cssText() const > return WTF::emptyString(); > } > >- builder.appendFixedPrecisionNumber(red()); >+ builder.appendNumber(red()); > builder.append(' '); > >- builder.appendFixedPrecisionNumber(green()); >+ builder.appendNumber(green()); > builder.append(' '); > >- builder.appendFixedPrecisionNumber(blue()); >+ builder.appendNumber(blue()); > if (!WTF::areEssentiallyEqual(alpha(), 1.0f)) { > builder.appendLiteral(" / "); >- builder.appendFixedPrecisionNumber(alpha()); >+ builder.appendNumber(alpha()); > } > builder.append(')'); > >diff --git a/Source/WebCore/svg/SVGAngleValue.cpp b/Source/WebCore/svg/SVGAngleValue.cpp >index 1ea285fb6f4e5a8ca897e40b4f67af0bd76f37c9..85a71987253616384959f9f898ca4fb22cc565d3 100644 >--- a/Source/WebCore/svg/SVGAngleValue.cpp >+++ b/Source/WebCore/svg/SVGAngleValue.cpp >@@ -66,14 +66,14 @@ String SVGAngleValue::valueAsString() const > { > switch (m_unitType) { > case SVG_ANGLETYPE_DEG: >- return makeString(FormattedNumber::fixedPrecision(m_valueInSpecifiedUnits), "deg"); >+ return makeString(m_valueInSpecifiedUnits, "deg"); > case SVG_ANGLETYPE_RAD: >- return makeString(FormattedNumber::fixedPrecision(m_valueInSpecifiedUnits), "rad"); >+ return makeString(m_valueInSpecifiedUnits, "rad"); > case SVG_ANGLETYPE_GRAD: >- return makeString(FormattedNumber::fixedPrecision(m_valueInSpecifiedUnits), "grad"); >+ return makeString(m_valueInSpecifiedUnits, "grad"); > case SVG_ANGLETYPE_UNSPECIFIED: > case SVG_ANGLETYPE_UNKNOWN: >- return String::numberToStringFixedPrecision(m_valueInSpecifiedUnits); >+ return String::number(m_valueInSpecifiedUnits); > } > > ASSERT_NOT_REACHED(); >diff --git a/Source/WebCore/svg/SVGLengthValue.cpp b/Source/WebCore/svg/SVGLengthValue.cpp >index dd2ede14fb717c16a0fb8e602a41ae9874a118ef..78ec686fedfdb4f3ce37afba071dc59b5133e4b5 100644 >--- a/Source/WebCore/svg/SVGLengthValue.cpp >+++ b/Source/WebCore/svg/SVGLengthValue.cpp >@@ -232,7 +232,7 @@ ExceptionOr<void> SVGLengthValue::setValueAsString(const String& string) > > String SVGLengthValue::valueAsString() const > { >- return makeString(FormattedNumber::fixedPrecision(m_valueInSpecifiedUnits), lengthTypeToString(extractType(m_unit))); >+ return makeString(m_valueInSpecifiedUnits, lengthTypeToString(extractType(m_unit))); > } > > ExceptionOr<void> SVGLengthValue::newValueSpecifiedUnits(unsigned short type, float value) >diff --git a/Source/WebCore/svg/SVGPathStringBuilder.cpp b/Source/WebCore/svg/SVGPathStringBuilder.cpp >index a832b9fdd7d27867e29f7acc1152ba27f8184599..105391cf866722dd9cbfb9fef11dc5313e1d013a 100644 >--- a/Source/WebCore/svg/SVGPathStringBuilder.cpp >+++ b/Source/WebCore/svg/SVGPathStringBuilder.cpp >@@ -57,15 +57,15 @@ static void appendFlag(StringBuilder& stringBuilder, bool flag) > > static void appendNumber(StringBuilder& stringBuilder, float number) > { >- stringBuilder.appendFixedPrecisionNumber(number); >+ stringBuilder.appendNumber(number); > stringBuilder.append(' '); > } > > static void appendPoint(StringBuilder& stringBuilder, const FloatPoint& point) > { >- stringBuilder.appendFixedPrecisionNumber(point.x()); >+ stringBuilder.appendNumber(point.x()); > stringBuilder.append(' '); >- stringBuilder.appendFixedPrecisionNumber(point.y()); >+ stringBuilder.appendNumber(point.y()); > stringBuilder.append(' '); > } > >diff --git a/Source/WebCore/svg/SVGTransformValue.h b/Source/WebCore/svg/SVGTransformValue.h >index 077350e6fd5cf31c8bd4d26eb6f4e454ce3f5662..dfecc00b1dffa2e879dee33bf644ffb73e74929c 100644 >--- a/Source/WebCore/svg/SVGTransformValue.h >+++ b/Source/WebCore/svg/SVGTransformValue.h >@@ -1,7 +1,7 @@ > /* > * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> >- * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * Copyright (C) 2019 Apple Inc. All rights reserved. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -229,33 +229,39 @@ public: > } > > private: >- static void appendFixedPrecisionNumbers(StringBuilder& builder) >+ template<typename Number> >+ static void appendNumber(StringBuilder& builder, Number number) >+ { >+ if (builder.length() && builder[builder.length() - 1] != '(') >+ builder.append(' '); >+ builder.appendNumber(number); >+ } >+ >+ static void appendNumbers(StringBuilder& builder) > { > builder.append(')'); > } > > template<typename Number, typename... Numbers> >- static void appendFixedPrecisionNumbers(StringBuilder& builder, Number number, Numbers... numbers) >+ static void appendNumbers(StringBuilder& builder, Number number, Numbers... numbers) > { >- if (builder.length() && builder[builder.length() - 1] != '(') >- builder.append(' '); >- builder.appendFixedPrecisionNumber(number); >- appendFixedPrecisionNumbers(builder, numbers...); >+ appendNumber(builder, number); >+ appendNumbers(builder, numbers...); > } > > void appendMatrix(StringBuilder& builder) const > { >- appendFixedPrecisionNumbers(builder, m_matrix->a(), m_matrix->b(), m_matrix->c(), m_matrix->d(), m_matrix->e(), m_matrix->f()); >+ appendNumbers(builder, m_matrix->a(), m_matrix->b(), m_matrix->c(), m_matrix->d(), m_matrix->e(), m_matrix->f()); > } > > void appendTranslate(StringBuilder& builder) const > { >- appendFixedPrecisionNumbers(builder, m_matrix->e(), m_matrix->f()); >+ appendNumbers(builder, m_matrix->e(), m_matrix->f()); > } > > void appendScale(StringBuilder& builder) const > { >- appendFixedPrecisionNumbers(builder, m_matrix->value().xScale(), m_matrix->value().yScale()); >+ appendNumbers(builder, m_matrix->value().xScale(), m_matrix->value().yScale()); > } > > void appendRotate(StringBuilder& builder) const >@@ -268,19 +274,19 @@ private: > float cy = narrowPrecisionToFloat(cosAngle != 1 ? (m_matrix->e() * sinAngle / (1 - cosAngle) + m_matrix->f()) / 2 : 0); > > if (cx || cy) >- appendFixedPrecisionNumbers(builder, m_angle, cx, cy); >+ appendNumbers(builder, m_angle, cx, cy); > else >- appendFixedPrecisionNumbers(builder, m_angle); >+ appendNumbers(builder, m_angle); > } > > void appendSkewX(StringBuilder& builder) const > { >- appendFixedPrecisionNumbers(builder, m_angle); >+ appendNumbers(builder, m_angle); > } > > void appendSkewY(StringBuilder& builder) const > { >- appendFixedPrecisionNumbers(builder, m_angle); >+ appendNumbers(builder, m_angle); > } > > SVGTransformType m_type { SVG_TRANSFORM_UNKNOWN }; >diff --git a/Source/WebCore/svg/properties/SVGPropertyTraits.h b/Source/WebCore/svg/properties/SVGPropertyTraits.h >index bb83e77d364ddd541c3d1cd4b19d4b3238b89c12..dfff9420cd6f687b8ca2c91a85a56dead182ff11 100644 >--- a/Source/WebCore/svg/properties/SVGPropertyTraits.h >+++ b/Source/WebCore/svg/properties/SVGPropertyTraits.h >@@ -103,7 +103,7 @@ struct SVGPropertyTraits<float> { > return WTF::nullopt; > return number; > } >- static String toString(float type) { return String::numberToStringFixedPrecision(type); } >+ static String toString(float type) { return String::number(type); } > }; > > template<> >@@ -140,9 +140,9 @@ struct SVGPropertyTraits<FloatPoint> { > static String toString(const FloatPoint& type) > { > StringBuilder builder; >- builder.appendFixedPrecisionNumber(type.x()); >+ builder.appendNumber(type.x()); > builder.append(' '); >- builder.appendFixedPrecisionNumber(type.y()); >+ builder.appendNumber(type.y()); > return builder.toString(); > } > }; >@@ -167,13 +167,13 @@ struct SVGPropertyTraits<FloatRect> { > static String toString(const FloatRect& type) > { > StringBuilder builder; >- builder.appendFixedPrecisionNumber(type.x()); >+ builder.appendNumber(type.x()); > builder.append(' '); >- builder.appendFixedPrecisionNumber(type.y()); >+ builder.appendNumber(type.y()); > builder.append(' '); >- builder.appendFixedPrecisionNumber(type.width()); >+ builder.appendNumber(type.width()); > builder.append(' '); >- builder.appendFixedPrecisionNumber(type.height()); >+ builder.appendNumber(type.height()); > return builder.toString(); > } > }; >diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp >index 7efc7c4469712f06c734fee2fadc534532047c4a..317b9e28f6ba991dc89630ea81f68e0852c838a5 100644 >--- a/Source/WebCore/testing/Internals.cpp >+++ b/Source/WebCore/testing/Internals.cpp >@@ -1636,13 +1636,13 @@ ExceptionOr<String> Internals::dumpMarkerRects(const String& markerTypeString) > rectString.appendLiteral("marker rects: "); > for (const auto& rect : rects) { > rectString.append('('); >- rectString.appendFixedPrecisionNumber(rect.x()); >+ rectString.appendNumber(rect.x()); > rectString.appendLiteral(", "); >- rectString.appendFixedPrecisionNumber(rect.y()); >+ rectString.appendNumber(rect.y()); > rectString.appendLiteral(", "); >- rectString.appendFixedPrecisionNumber(rect.width()); >+ rectString.appendNumber(rect.width()); > rectString.appendLiteral(", "); >- rectString.appendFixedPrecisionNumber(rect.height()); >+ rectString.appendNumber(rect.height()); > rectString.appendLiteral(") "); > } > return rectString.toString(); >@@ -1825,7 +1825,7 @@ ExceptionOr<String> Internals::configurationForViewport(float devicePixelRatio, > restrictMinimumScaleFactorToViewportSize(attributes, IntSize(availableWidth, availableHeight), devicePixelRatio); > restrictScaleFactorToInitialScaleIfNotUserScalable(attributes); > >- return makeString("viewport size ", FormattedNumber::fixedPrecision(attributes.layoutSize.width()), 'x', FormattedNumber::fixedPrecision(attributes.layoutSize.height()), " scale ", FormattedNumber::fixedPrecision(attributes.initialScale), " with limits [", FormattedNumber::fixedPrecision(attributes.minimumScale), ", ", FormattedNumber::fixedPrecision(attributes.maximumScale), "] and userScalable ", (attributes.userScalable ? "true" : "false")); >+ return makeString("viewport size ", attributes.layoutSize.width(), 'x', attributes.layoutSize.height(), " scale ", attributes.initialScale, " with limits [", attributes.minimumScale, ", ", attributes.maximumScale, "] and userScalable ", (attributes.userScalable ? "true" : "false")); > } > > ExceptionOr<bool> Internals::wasLastChangeUserEdit(Element& textField) >@@ -3360,14 +3360,14 @@ ExceptionOr<String> Internals::getCurrentCursorInfo() > if (cursor.image()) { > FloatSize size = cursor.image()->size(); > result.appendLiteral(" image="); >- result.appendFixedPrecisionNumber(size.width()); >+ result.appendNumber(size.width()); > result.append('x'); >- result.appendFixedPrecisionNumber(size.height()); >+ result.appendNumber(size.height()); > } > #if ENABLE(MOUSE_CURSOR_SCALE) > if (cursor.imageScaleFactor() != 1) { > result.appendLiteral(" scale="); >- result.appendFixedPrecisionNumber(cursor.imageScaleFactor(), 8); >+ result.appendNumber(cursor.imageScaleFactor()); > } > #endif > return result.toString(); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index a14429e843eeaf60031c3e1a443fc758e8d9622f..8c24d2707b29b8f1d2b4e5e2d31f90dbfb0688b7 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,12 @@ >+2019-06-17 Darin Adler <darin@apple.com> >+ >+ Use even more "shortest form" formatting, and less "fixed precision" and "fixed width" >+ https://bugs.webkit.org/show_bug.cgi?id=198918 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * svg/dom/length-list-parser-expected.txt: >+ > 2019-06-16 Darin Adler <darin@apple.com> > > Convert some uses of fixed width and fixed precision floating point formatting to use shortest instead >diff --git a/LayoutTests/svg/dom/length-list-parser-expected.txt b/LayoutTests/svg/dom/length-list-parser-expected.txt >index eef063076bd4de61794511937a61f0165507b7ba..dd5689ccdc4c493e4cda42be9e86c29ab83bd250 100644 >--- a/LayoutTests/svg/dom/length-list-parser-expected.txt >+++ b/LayoutTests/svg/dom/length-list-parser-expected.txt >@@ -4,7 +4,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE > > > Parsed as 1 length(s) [ 8.847 ]: 8.847 >-Parsed as 1 length(s) [ 8.62569e+6 ]: 8625686 3.0-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, 90,e4997..,782-4326e. -0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013e,+e9 e 4829.,063721-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e6 072 >+Parsed as 1 length(s) [ 8625686 ]: 8625686 3.0-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001, 90,e4997..,782-4326e. -0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000013e,+e9 e 4829.,063721-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001.-0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e6 072 > Parsed as 1 length(s) [ 61822 ]: 61822,15-00.166.7 > Parsed as 2 length(s) [ 2, 0.5 ]: 2 .5,658-7 e ,8477553 > Parsed as 3 length(s) [ 8, 2, 589 ]: 8 2 589 -45e58 -4 -0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e58-++689.-98-,42 94564.,967-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011+ ,9+6- .765+-87 e. 68 9452182-0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016.. 1 +
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198918
:
372248
|
372424
|
372428
|
372429
|
372430
|
372432
|
372433
|
386589
|
386592
|
386689
|
386693
|
386697
|
386700
|
386719
|
386738
|
386747
|
387480
|
387495
|
387496
|
387538