Title: [128008] trunk/Source/WebCore
- Revision
- 128008
- Author
- [email protected]
- Date
- 2012-09-09 17:45:58 -0700 (Sun, 09 Sep 2012)
Log Message
Replace WTF::numberToString() with String::numberToStringECMAScript()
https://bugs.webkit.org/show_bug.cgi?id=96130
Reviewed by Benjamin Poulain.
The String class provides a nice wrapper for this function
in the meantime, so just use it to avoid code duplication.
* html/parser/HTMLParserIdioms.cpp:
(WebCore::serializeForNumberType):
* platform/Decimal.cpp:
(WebCore::Decimal::fromDouble):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (128007 => 128008)
--- trunk/Source/WebCore/ChangeLog 2012-09-10 00:33:32 UTC (rev 128007)
+++ trunk/Source/WebCore/ChangeLog 2012-09-10 00:45:58 UTC (rev 128008)
@@ -1,3 +1,18 @@
+2012-09-09 Patrick Gansterer <[email protected]>
+
+ Replace WTF::numberToString() with String::numberToStringECMAScript()
+ https://bugs.webkit.org/show_bug.cgi?id=96130
+
+ Reviewed by Benjamin Poulain.
+
+ The String class provides a nice wrapper for this function
+ in the meantime, so just use it to avoid code duplication.
+
+ * html/parser/HTMLParserIdioms.cpp:
+ (WebCore::serializeForNumberType):
+ * platform/Decimal.cpp:
+ (WebCore::Decimal::fromDouble):
+
2012-09-09 Emil A Eklund <[email protected]>
Rename Node::getRect/getPixelSnappedRect and remove ContainerNode::getRect
Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp (128007 => 128008)
--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp 2012-09-10 00:33:32 UTC (rev 128007)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp 2012-09-10 00:45:58 UTC (rev 128008)
@@ -28,7 +28,6 @@
#include "Decimal.h"
#include <limits>
#include <wtf/MathExtras.h>
-#include <wtf/dtoa.h>
#include <wtf/text/AtomicString.h>
#include <wtf/text/StringBuilder.h>
@@ -87,8 +86,7 @@
{
// According to HTML5, "the best representation of the number n as a floating
// point number" is a string produced by applying ToString() to n.
- NumberToStringBuffer buffer;
- return String(numberToString(number, buffer));
+ return String::numberToStringECMAScript(number);
}
Decimal parseToDecimalForNumberType(const String& string, const Decimal& fallbackValue)
Modified: trunk/Source/WebCore/platform/Decimal.cpp (128007 => 128008)
--- trunk/Source/WebCore/platform/Decimal.cpp 2012-09-10 00:33:32 UTC (rev 128007)
+++ trunk/Source/WebCore/platform/Decimal.cpp 2012-09-10 00:45:58 UTC (rev 128008)
@@ -37,7 +37,6 @@
#include <wtf/Assertions.h>
#include <wtf/MathExtras.h>
#include <wtf/Noncopyable.h>
-#include <wtf/dtoa.h>
#include <wtf/text/StringBuilder.h>
namespace WebCore {
@@ -681,10 +680,8 @@
Decimal Decimal::fromDouble(double doubleValue)
{
- if (isfinite(doubleValue)) {
- NumberToStringBuffer buffer;
- return fromString(numberToString(doubleValue, buffer));
- }
+ if (isfinite(doubleValue))
+ return fromString(String::numberToStringECMAScript(doubleValue));
if (isinf(doubleValue))
return infinity(doubleValue < 0 ? Negative : Positive);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes