Change String::number to use "shortest" instead of "fixed precision 6 digits"
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 19 May 2019 18:17:40 +0000 (18:17 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 19 May 2019 18:17:40 +0000 (18:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178319

Reviewed by Sam Weinig.

Source/WebCore:

* accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
(webkitAccessibleSetNewValue): Use String::numberToStringFixedPrecision
instead of String::number to be explicit about the fact that it's fixed precision.
* page/linux/ResourceUsageOverlayLinux.cpp:
(gcTimerString): Ditto.

* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(printTransform): Use appendFixedPrecisionNumber instead of appendNumber
to be explicit about the fact that it's fixed precision.
(printLayer): Ditto.
(WebCore::PlatformCALayerWin::layerTreeAsString const): Ditto.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(buildVariationSettings): Ditto.

* svg/SVGNumberList.h: Use appendFixedPrecisionNumber instead of appendNumber
to be explicit about the fact that it's fixed precision. We'll consider moving
to shortest later.

* svg/SVGPathUtilities.cpp:
(WebCore::buildStringFromPath): Use appendNumberShortest instead of
appendNumberECMAScript since these are single-precision.

* svg/SVGPointList.h: Use appendFixedPrecisionNumber instead of appendNumber
to be explicit about the fact that it's fixed precision. We'll consider moving
to shortest later.
* svg/SVGTransformValue.h: Ditto.

Source/WTF:

* wtf/text/StringBuilder.h: Delete appendNumber for floating point and
appendECMAScriptNumber for single-precision.

* wtf/text/WTFString.h: Delete String::number for floating point and
numberToStringECMAScript for single-precision.

Tools:

* TestWebKitAPI/Tests/WTF/WTFString.cpp:
(TestWebKitAPI::testStringNumberFixedPrecision): Use String::numberToStringFixedPrecision.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(attributesOfElement): Use appendFixedPrecisionNumber.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@245504 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/text/StringBuilder.h
Source/WTF/wtf/text/WTFString.h
Source/WebCore/ChangeLog
Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceValue.cpp
Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp
Source/WebCore/svg/SVGNumberList.h
Source/WebCore/svg/SVGPathUtilities.cpp
Source/WebCore/svg/SVGPointList.h
Source/WebCore/svg/SVGTransformValue.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp

index 0ccc8bb..41d8028 100644 (file)
@@ -1,3 +1,16 @@
+2019-05-19  Darin Adler  <darin@apple.com>
+
+        Change String::number to use "shortest" instead of "fixed precision 6 digits"
+        https://bugs.webkit.org/show_bug.cgi?id=178319
+
+        Reviewed by Sam Weinig.
+
+        * wtf/text/StringBuilder.h: Delete appendNumber for floating point and
+        appendECMAScriptNumber for single-precision.
+
+        * wtf/text/WTFString.h: Delete String::number for floating point and
+        numberToStringECMAScript for single-precision.
+
 2019-05-18  Tadeu Zagallo  <tzagallo@apple.com>
 
         Add extra information to dumpJITMemory
index 1f508bc..ebaf73e 100644 (file)
@@ -222,9 +222,9 @@ public:
     WTF_EXPORT_PRIVATE void appendNumber(unsigned long);
     WTF_EXPORT_PRIVATE void appendNumber(long long);
     WTF_EXPORT_PRIVATE void appendNumber(unsigned long long);
-    // FIXME: Change appendNumber to be appendShortestFormNumber instead of appendFixedPrecisionNumber.
-    void appendNumber(float);
-    void appendNumber(double, unsigned precision = 6, TrailingZerosTruncatingPolicy = TruncateTrailingZeros);
+    // FIXME: Change to call appendShortestFormNumber.
+    void appendNumber(float) = delete;
+    void appendNumber(double) = delete;
 
     WTF_EXPORT_PRIVATE void appendShortestFormNumber(float);
     WTF_EXPORT_PRIVATE void appendShortestFormNumber(double);
@@ -234,7 +234,7 @@ public:
     WTF_EXPORT_PRIVATE void appendFixedWidthNumber(double, unsigned decimalPlaces);
 
     // FIXME: Delete in favor of the name appendShortestFormNumber or just appendNumber.
-    void appendECMAScriptNumber(float);
+    void appendECMAScriptNumber(float) = delete;
     void appendECMAScriptNumber(double);
 
     String toString()
@@ -394,23 +394,6 @@ ALWAYS_INLINE UChar* StringBuilder::getBufferCharacters<UChar>()
     return m_bufferCharacters16;
 }
 
-inline void StringBuilder::appendNumber(float number)
-{
-    appendFixedPrecisionNumber(number);
-}
-
-inline void StringBuilder::appendNumber(double number, unsigned precision, TrailingZerosTruncatingPolicy policy)
-{
-    appendFixedPrecisionNumber(number, precision, policy);
-}
-
-inline void StringBuilder::appendECMAScriptNumber(float number)
-{
-    // FIXME: This preserves existing behavior but is not what we want.
-    // In the future, this should either be a compilation error or call appendShortestFormNumber without converting to double.
-    appendShortestFormNumber(static_cast<double>(number));
-}
-
 inline void StringBuilder::appendECMAScriptNumber(double number)
 {
     appendShortestFormNumber(number);
index 1d9f0db..007ac57 100644 (file)
@@ -179,9 +179,9 @@ public:
     WTF_EXPORT_PRIVATE static String number(unsigned long);
     WTF_EXPORT_PRIVATE static String number(long long);
     WTF_EXPORT_PRIVATE static String number(unsigned long long);
-    // FIXME: Change number to be numberToStringShortest instead of numberToStringFixedPrecision.
-    static String number(float);
-    static String number(double, unsigned precision = 6, TrailingZerosTruncatingPolicy = TruncateTrailingZeros);
+    // FIXME: Change to call numberToStringShortest.
+    static String number(float) = delete;
+    static String number(double) = delete;
 
     WTF_EXPORT_PRIVATE static String numberToStringShortest(float);
     WTF_EXPORT_PRIVATE static String numberToStringShortest(double);
@@ -191,7 +191,7 @@ public:
     WTF_EXPORT_PRIVATE static String numberToStringFixedWidth(double, unsigned decimalPlaces);
 
     // FIXME: Delete in favor of the name numberToStringShortest or just number.
-    static String numberToStringECMAScript(float);
+    static String numberToStringECMAScript(float) = delete;
     static String numberToStringECMAScript(double);
 
     // Find a single character or string, also with match function & latin1 forms.
@@ -654,23 +654,6 @@ template<unsigned length> inline bool startsWithLettersIgnoringASCIICase(const S
     return startsWithLettersIgnoringASCIICase(string.impl(), lowercaseLetters);
 }
 
-inline String String::number(float number)
-{
-    return numberToStringFixedPrecision(number);
-}
-
-inline String String::number(double number, unsigned precision, TrailingZerosTruncatingPolicy policy)
-{
-    return numberToStringFixedPrecision(number, precision, policy);
-}
-
-inline String String::numberToStringECMAScript(float number)
-{
-    // FIXME: This preserves existing behavior but is not what we want.
-    // In the future, this should either be a compilation error or call numberToStringShortest without converting to double.
-    return numberToStringShortest(static_cast<double>(number));
-}
-
 inline String String::numberToStringECMAScript(double number)
 {
     return numberToStringShortest(number);
index 33b640b..1accda3 100644 (file)
@@ -1,3 +1,37 @@
+2019-05-19  Darin Adler  <darin@apple.com>
+
+        Change String::number to use "shortest" instead of "fixed precision 6 digits"
+        https://bugs.webkit.org/show_bug.cgi?id=178319
+
+        Reviewed by Sam Weinig.
+
+        * accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
+        (webkitAccessibleSetNewValue): Use String::numberToStringFixedPrecision
+        instead of String::number to be explicit about the fact that it's fixed precision.
+        * page/linux/ResourceUsageOverlayLinux.cpp:
+        (gcTimerString): Ditto.
+
+        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
+        (printTransform): Use appendFixedPrecisionNumber instead of appendNumber
+        to be explicit about the fact that it's fixed precision.
+        (printLayer): Ditto.
+        (WebCore::PlatformCALayerWin::layerTreeAsString const): Ditto.
+        * platform/graphics/freetype/FontCacheFreeType.cpp:
+        (buildVariationSettings): Ditto.
+
+        * svg/SVGNumberList.h: Use appendFixedPrecisionNumber instead of appendNumber
+        to be explicit about the fact that it's fixed precision. We'll consider moving
+        to shortest later.
+
+        * svg/SVGPathUtilities.cpp:
+        (WebCore::buildStringFromPath): Use appendNumberShortest instead of
+        appendNumberECMAScript since these are single-precision.
+
+        * svg/SVGPointList.h: Use appendFixedPrecisionNumber instead of appendNumber
+        to be explicit about the fact that it's fixed precision. We'll consider moving
+        to shortest later.
+        * svg/SVGTransformValue.h: Ditto.
+
 2019-05-19  Simon Fraser  <simon.fraser@apple.com>
 
         Layers painting into shared backing need to contribute to overlap
index edb5e85..a6b15f8 100644 (file)
@@ -49,7 +49,7 @@ static bool webkitAccessibleSetNewValue(AtkValue* coreValue, const gdouble newVa
     value = std::max(static_cast<double>(coreObject->minValueForRange()), newValue);
     value = std::min(static_cast<double>(coreObject->maxValueForRange()), newValue);
 
-    coreObject->setValue(String::number(value));
+    coreObject->setValue(String::numberToStringFixedPrecision(value));
     return TRUE;
 }
 
index 9571d12..a824e53 100644 (file)
@@ -64,7 +64,7 @@ static String gcTimerString(MonotonicTime timerFireDate, MonotonicTime now)
 {
     if (std::isnan(timerFireDate))
         return "[not scheduled]"_s;
-    return String::number((timerFireDate - now).seconds());
+    return String::numberToStringFixedPrecision((timerFireDate - now).seconds());
 }
 
 static const float gFontSize = 14;
index eeb4c54..15d4e46 100644 (file)
@@ -704,37 +704,37 @@ static void printIndent(StringBuilder& builder, int indent)
 static void printTransform(StringBuilder& builder, const CATransform3D& transform)
 {
     builder.append('[');
-    builder.appendNumber(transform.m11);
+    builder.appendFixedPrecisionNumber(transform.m11);
     builder.append(' ');
-    builder.appendNumber(transform.m12);
+    builder.appendFixedPrecisionNumber(transform.m12);
     builder.append(' ');
-    builder.appendNumber(transform.m13);
+    builder.appendFixedPrecisionNumber(transform.m13);
     builder.append(' ');
-    builder.appendNumber(transform.m14);
+    builder.appendFixedPrecisionNumber(transform.m14);
     builder.append("; ");
-    builder.appendNumber(transform.m21);
+    builder.appendFixedPrecisionNumber(transform.m21);
     builder.append(' ');
-    builder.appendNumber(transform.m22);
+    builder.appendFixedPrecisionNumber(transform.m22);
     builder.append(' ');
-    builder.appendNumber(transform.m23);
+    builder.appendFixedPrecisionNumber(transform.m23);
     builder.append(' ');
-    builder.appendNumber(transform.m24);
+    builder.appendFixedPrecisionNumber(transform.m24);
     builder.append("; ");
-    builder.appendNumber(transform.m31);
+    builder.appendFixedPrecisionNumber(transform.m31);
     builder.append(' ');
-    builder.appendNumber(transform.m32);
+    builder.appendFixedPrecisionNumber(transform.m32);
     builder.append(' ');
-    builder.appendNumber(transform.m33);
+    builder.appendFixedPrecisionNumber(transform.m33);
     builder.append(' ');
-    builder.appendNumber(transform.m34);
+    builder.appendFixedPrecisionNumber(transform.m34);
     builder.append("; ");
-    builder.appendNumber(transform.m41);
+    builder.appendFixedPrecisionNumber(transform.m41);
     builder.append(' ');
-    builder.appendNumber(transform.m42);
+    builder.appendFixedPrecisionNumber(transform.m42);
     builder.append(' ');
-    builder.appendNumber(transform.m43);
+    builder.appendFixedPrecisionNumber(transform.m43);
     builder.append(' ');
-    builder.appendNumber(transform.m44);
+    builder.appendFixedPrecisionNumber(transform.m44);
     builder.append(']');
 }
 
@@ -785,25 +785,25 @@ static void printLayer(StringBuilder& builder, const PlatformCALayer* layer, int
     builder.append("(");
     builder.append(layerTypeName);
     builder.append(" [");
-    builder.appendNumber(layerPosition.x());
+    builder.appendFixedPrecisionNumber(layerPosition.x());
     builder.append(' ');
-    builder.appendNumber(layerPosition.y());
+    builder.appendFixedPrecisionNumber(layerPosition.y());
     builder.append(' ');
-    builder.appendNumber(layerPosition.z());
+    builder.appendFixedPrecisionNumber(layerPosition.z());
     builder.append("] [");
-    builder.appendNumber(layerBounds.x());
+    builder.appendFixedPrecisionNumber(layerBounds.x());
     builder.append(' ');
-    builder.appendNumber(layerBounds.y());
+    builder.appendFixedPrecisionNumber(layerBounds.y());
     builder.append(' ');
-    builder.appendNumber(layerBounds.width());
+    builder.appendFixedPrecisionNumber(layerBounds.width());
     builder.append(' ');
-    builder.appendNumber(layerBounds.height());
+    builder.appendFixedPrecisionNumber(layerBounds.height());
     builder.append("] [");
-    builder.appendNumber(layerAnchorPoint.x());
+    builder.appendFixedPrecisionNumber(layerAnchorPoint.x());
     builder.append(' ');
-    builder.appendNumber(layerAnchorPoint.y());
+    builder.appendFixedPrecisionNumber(layerAnchorPoint.y());
     builder.append(' ');
-    builder.appendNumber(layerAnchorPoint.z());
+    builder.appendFixedPrecisionNumber(layerAnchorPoint.z());
     builder.append("] superlayer=");
     builder.appendNumber(reinterpret_cast<unsigned long long>(layer->superlayer()));
 
@@ -822,7 +822,7 @@ static void printLayer(StringBuilder& builder, const PlatformCALayer* layer, int
         builder.append('\n');
         printIndent(builder, indent + 1);
         builder.append("(borderWidth ");
-        builder.appendNumber(borderWidth);
+        builder.appendFixedPrecisionNumber(borderWidth);
         builder.append(')');
     }
 
@@ -851,7 +851,7 @@ static void printLayer(StringBuilder& builder, const PlatformCALayer* layer, int
         builder.append('\n');
         printIndent(builder, indent + 1);
         builder.append("(opacity ");
-        builder.appendNumber(layerOpacity);
+        builder.appendFixedPrecisionNumber(layerOpacity);
         builder.append(')');
     }
 
@@ -927,15 +927,15 @@ String PlatformCALayerWin::layerTreeAsString() const
 
     StringBuilder builder;
     builder.append("\n\n** Render tree at time ");
-    builder.appendNumber(MonotonicTime::now().secondsSinceEpoch().seconds());
+    builder.appendFixedPrecisionNumber(MonotonicTime::now().secondsSinceEpoch().seconds());
     builder.append(" (bounds ");
-    builder.appendNumber(rootBounds.origin.x);
+    builder.appendFixedPrecisionNumber(rootBounds.origin.x);
     builder.append(", ");
-    builder.appendNumber(rootBounds.origin.y);
+    builder.appendFixedPrecisionNumber(rootBounds.origin.y);
     builder.append(' ');
-    builder.appendNumber(rootBounds.size.width);
+    builder.appendFixedPrecisionNumber(rootBounds.size.width);
     builder.append('x');
-    builder.appendNumber(rootBounds.size.height);
+    builder.appendFixedPrecisionNumber(rootBounds.size.height);
     builder.append(") **\n\n");
 
     // Print layer tree from the root
index d5ac0ed..db0485d 100644 (file)
@@ -522,7 +522,7 @@ String buildVariationSettings(FT_Face face, const FontDescription& fontDescripti
         builder.append(variation.key[2]);
         builder.append(variation.key[3]);
         builder.append('=');
-        builder.appendNumber(variation.value);
+        builder.appendFixedPrecisionNumber(variation.value);
     }
     return builder.toString();
 }
index 5e2c114..5b5d57e 100644 (file)
@@ -78,7 +78,7 @@ public:
             if (builder.length())
                 builder.append(' ');
 
-            builder.appendNumber(number->value());
+            builder.appendFixedPrecisionNumber(number->value());
         }
 
         return builder.toString();
index e5746ca..4b79c1f 100644 (file)
@@ -60,39 +60,39 @@ String buildStringFromPath(const Path& path)
             switch (element.type) {
             case PathElementMoveToPoint:
                 builder.append('M');
-                builder.appendECMAScriptNumber(element.points[0].x());
+                builder.appendShortestFormNumber(element.points[0].x());
                 builder.append(' ');
-                builder.appendECMAScriptNumber(element.points[0].y());
+                builder.appendShortestFormNumber(element.points[0].y());
                 break;
             case PathElementAddLineToPoint:
                 builder.append('L');
-                builder.appendECMAScriptNumber(element.points[0].x());
+                builder.appendShortestFormNumber(element.points[0].x());
                 builder.append(' ');
-                builder.appendECMAScriptNumber(element.points[0].y());
+                builder.appendShortestFormNumber(element.points[0].y());
                 break;
             case PathElementAddQuadCurveToPoint:
                 builder.append('Q');
-                builder.appendECMAScriptNumber(element.points[0].x());
+                builder.appendShortestFormNumber(element.points[0].x());
                 builder.append(' ');
-                builder.appendECMAScriptNumber(element.points[0].y());
+                builder.appendShortestFormNumber(element.points[0].y());
                 builder.append(',');
-                builder.appendECMAScriptNumber(element.points[1].x());
+                builder.appendShortestFormNumber(element.points[1].x());
                 builder.append(' ');
-                builder.appendECMAScriptNumber(element.points[1].y());
+                builder.appendShortestFormNumber(element.points[1].y());
                 break;
             case PathElementAddCurveToPoint:
                 builder.append('C');
-                builder.appendECMAScriptNumber(element.points[0].x());
+                builder.appendShortestFormNumber(element.points[0].x());
                 builder.append(' ');
-                builder.appendECMAScriptNumber(element.points[0].y());
+                builder.appendShortestFormNumber(element.points[0].y());
                 builder.append(',');
-                builder.appendECMAScriptNumber(element.points[1].x());
+                builder.appendShortestFormNumber(element.points[1].x());
                 builder.append(' ');
-                builder.appendECMAScriptNumber(element.points[1].y());
+                builder.appendShortestFormNumber(element.points[1].y());
                 builder.append(',');
-                builder.appendECMAScriptNumber(element.points[2].x());
+                builder.appendShortestFormNumber(element.points[2].x());
                 builder.append(' ');
-                builder.appendECMAScriptNumber(element.points[2].y());
+                builder.appendShortestFormNumber(element.points[2].y());
                 break;
             case PathElementCloseSubpath:
                 builder.append('Z');
index 80b8390..8c6c50b 100644 (file)
@@ -93,9 +93,9 @@ public:
             if (builder.length())
                 builder.append(' ');
 
-            builder.appendNumber(point->x());
+            builder.appendFixedPrecisionNumber(point->x());
             builder.append(' ');
-            builder.appendNumber(point->y());
+            builder.appendFixedPrecisionNumber(point->y());
         }
 
         return builder.toString();
index 659208e..077350e 100644 (file)
@@ -229,33 +229,33 @@ public:
     }
 
 private:
-    static void appendNumbers(StringBuilder& builder)
+    static void appendFixedPrecisionNumbers(StringBuilder& builder)
     {
         builder.append(')');
     }
 
     template<typename Number, typename... Numbers>
-    static void appendNumbers(StringBuilder& builder, Number number, Numbers... numbers)
+    static void appendFixedPrecisionNumbers(StringBuilder& builder, Number number, Numbers... numbers)
     {
         if (builder.length() && builder[builder.length() - 1] != '(')
             builder.append(' ');
-        builder.appendNumber(number);
-        appendNumbers(builder, numbers...);
+        builder.appendFixedPrecisionNumber(number);
+        appendFixedPrecisionNumbers(builder, numbers...);
     }
 
     void appendMatrix(StringBuilder& builder) const
     {
-        appendNumbers(builder, m_matrix->a(), m_matrix->b(), m_matrix->c(), m_matrix->d(), m_matrix->e(), m_matrix->f());
+        appendFixedPrecisionNumbers(builder, m_matrix->a(), m_matrix->b(), m_matrix->c(), m_matrix->d(), m_matrix->e(), m_matrix->f());
     }
 
     void appendTranslate(StringBuilder& builder) const
     {
-        appendNumbers(builder, m_matrix->e(), m_matrix->f());
+        appendFixedPrecisionNumbers(builder, m_matrix->e(), m_matrix->f());
     }
 
     void appendScale(StringBuilder& builder) const
     {
-        appendNumbers(builder, m_matrix->value().xScale(), m_matrix->value().yScale());
+        appendFixedPrecisionNumbers(builder, m_matrix->value().xScale(), m_matrix->value().yScale());
     }
 
     void appendRotate(StringBuilder& builder) const
@@ -268,19 +268,19 @@ private:
         float cy = narrowPrecisionToFloat(cosAngle != 1 ? (m_matrix->e() * sinAngle / (1 - cosAngle) + m_matrix->f()) / 2 : 0);
 
         if (cx || cy)
-            appendNumbers(builder, m_angle, cx, cy);
+            appendFixedPrecisionNumbers(builder, m_angle, cx, cy);
         else
-            appendNumbers(builder, m_angle);
+            appendFixedPrecisionNumbers(builder, m_angle);
     }
 
     void appendSkewX(StringBuilder& builder) const
     {
-        appendNumbers(builder, m_angle);
+        appendFixedPrecisionNumbers(builder, m_angle);
     }
 
     void appendSkewY(StringBuilder& builder) const
     {
-        appendNumbers(builder, m_angle);
+        appendFixedPrecisionNumbers(builder, m_angle);
     }
 
     SVGTransformType m_type { SVG_TRANSFORM_UNKNOWN };
index 8ce5fcd..7b4154c 100644 (file)
@@ -1,3 +1,16 @@
+2019-05-19  Darin Adler  <darin@apple.com>
+
+        Change String::number to use "shortest" instead of "fixed precision 6 digits"
+        https://bugs.webkit.org/show_bug.cgi?id=178319
+
+        Reviewed by Sam Weinig.
+
+        * TestWebKitAPI/Tests/WTF/WTFString.cpp:
+        (TestWebKitAPI::testStringNumberFixedPrecision): Use String::numberToStringFixedPrecision.
+
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+        (attributesOfElement): Use appendFixedPrecisionNumber.
+
 2019-05-18  Jiewen Tan  <jiewen_tan@apple.com>
 
         [WebAuthN] Allow authenticators that support both CTAP and U2F to try U2F if CTAP fails in authenticatorGetAssertion
index a06a671..7a057dc 100644 (file)
@@ -74,7 +74,7 @@ TEST(WTF, StringASCII)
 static inline const char* testStringNumberFixedPrecision(double number)
 {
     static char testBuffer[100] = { };
-    std::strncpy(testBuffer, String::number(number).utf8().data(), 99);
+    std::strncpy(testBuffer, String::numberToStringFixedPrecision(number).utf8().data(), 99);
     return testBuffer;
 }
 
index d62a8e4..32d164b 100644 (file)
@@ -631,15 +631,15 @@ String attributesOfElement(AccessibilityUIElement* element)
     builder.append('\n');
 
     builder.appendLiteral("AXPosition:  { ");
-    builder.appendNumber(element->x(), 6, KeepTrailingZeros);
+    builder.appendFixedPrecisionNumber(element->x(), 6, KeepTrailingZeros);
     builder.appendLiteral(", ");
-    builder.appendNumber(element->y(), 6, KeepTrailingZeros);
+    builder.appendFixedPrecisionNumber(element->y(), 6, KeepTrailingZeros);
     builder.appendLiteral(" }\n");
 
     builder.appendLiteral("AXSize: { ");
-    builder.appendNumber(element->width(), 6, KeepTrailingZeros);
+    builder.appendFixedPrecisionNumber(element->width(), 6, KeepTrailingZeros);
     builder.appendLiteral(", ");
-    builder.appendNumber(element->height(), 6, KeepTrailingZeros);
+    builder.appendFixedPrecisionNumber(element->height(), 6, KeepTrailingZeros);
     builder.appendLiteral(" }\n");
 
     String title = element->title()->string();