WebKit Bugzilla
Attachment 372207 Details for
Bug 198896
: Convert some uses of fixed width and fixed precision floating point formatting to use shortest instead
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198896-20190615181149.patch (text/plain), 9.83 KB, created by
Darin Adler
on 2019-06-15 18:11:49 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Darin Adler
Created:
2019-06-15 18:11:49 PDT
Size:
9.83 KB
patch
obsolete
>Subversion Revision: 246468 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 5c19611fdbdb840c871f874ae474657a0f2fd5a2..3c38c9b659452ddd3a59ae53582af80a1c2b25e5 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2019-06-15 Darin Adler <darin@apple.com> >+ >+ Convert some uses of fixed width and fixed precision floating point formatting to use shortest instead >+ https://bugs.webkit.org/show_bug.cgi?id=198896 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Modules/indexeddb/IDBKeyData.cpp: >+ (WebCore::IDBKeyData::loggingString const): Removed unneeded use of >+ FormattedNumber::fixedWidth to override the default shortest-form formatting. >+ * page/History.cpp: >+ (WebCore::History::stateObjectAdded): Ditto. >+ >+ * page/PrintContext.cpp: >+ (WebCore::PrintContext::pageProperty): Use String::number instead of >+ String::numberToStringFixedPrecision. Also removed some uses of >+ FormattedNumber::fixedPrecision. >+ * platform/graphics/FloatPolygon.cpp: >+ (WebCore::FloatPolygonEdge::debugString const): Ditto. >+ > 2019-06-15 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Fix available width for non-floating positioned float avoiders. >diff --git a/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp b/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp >index 7bd2ac5202bdb1d295e616b70347b0fe60b7d55d..45c189d95211e93155f85c3f544d37a017ab835c 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp >@@ -364,9 +364,9 @@ String IDBKeyData::loggingString() const > result = "<string> - " + WTF::get<String>(m_value); > break; > case IndexedDB::KeyType::Date: >- return makeString("<date> - ", FormattedNumber::fixedWidth(WTF::get<double>(m_value), 6)); >+ return makeString("<date> - ", WTF::get<double>(m_value)); > case IndexedDB::KeyType::Number: >- return makeString("<number> - ", FormattedNumber::fixedWidth(WTF::get<double>(m_value), 6)); >+ return makeString("<number> - ", WTF::get<double>(m_value)); > case IndexedDB::KeyType::Max: > return "<maximum>"_s; > case IndexedDB::KeyType::Min: >diff --git a/Source/WebCore/page/History.cpp b/Source/WebCore/page/History.cpp >index cbb7199fa764b54385898b8e63d5c51720219545..9c58b06f4c471130ce4815f11d14cb78f81b49a0 100644 >--- a/Source/WebCore/page/History.cpp >+++ b/Source/WebCore/page/History.cpp >@@ -226,8 +226,8 @@ ExceptionOr<void> History::stateObjectAdded(RefPtr<SerializedScriptValue>&& data > > if (mainHistory.m_currentStateObjectTimeSpanObjectsAdded >= perStateObjectTimeSpanLimit) { > if (stateObjectType == StateObjectType::Replace) >- return Exception { SecurityError, makeString("Attempt to use history.replaceState() more than ", perStateObjectTimeSpanLimit, " times per ", FormattedNumber::fixedWidth(stateObjectTimeSpan.seconds(), 6), " seconds") }; >- return Exception { SecurityError, makeString("Attempt to use history.pushState() more than ", perStateObjectTimeSpanLimit, " times per ", FormattedNumber::fixedWidth(stateObjectTimeSpan.seconds(), 6), " seconds") }; >+ return Exception { SecurityError, makeString("Attempt to use history.replaceState() more than ", perStateObjectTimeSpanLimit, " times per ", stateObjectTimeSpan.seconds(), " seconds") }; >+ return Exception { SecurityError, makeString("Attempt to use history.pushState() more than ", perStateObjectTimeSpanLimit, " times per ", stateObjectTimeSpan.seconds(), " seconds") }; > } > > Checked<unsigned> titleSize = title.length(); >diff --git a/Source/WebCore/page/PrintContext.cpp b/Source/WebCore/page/PrintContext.cpp >index 00c0c4ea5fa88ca362063f6f4a1408fdad5814d2..0370f2887f65b57b3cd897e4fc69e8a2efb875df 100644 >--- a/Source/WebCore/page/PrintContext.cpp >+++ b/Source/WebCore/page/PrintContext.cpp >@@ -357,16 +357,16 @@ String PrintContext::pageProperty(Frame* frame, const char* propertyName, int pa > if (!strcmp(propertyName, "margin-left")) { > if (style->marginLeft().isAuto()) > return "auto"_s; >- return String::numberToStringFixedPrecision(style->marginLeft().value()); >+ return String::number(style->marginLeft().value()); > } > if (!strcmp(propertyName, "line-height")) >- return String::numberToStringFixedPrecision(style->lineHeight().value()); >+ return String::number(style->lineHeight().value()); > if (!strcmp(propertyName, "font-size")) > return String::number(style->fontDescription().computedPixelSize()); > if (!strcmp(propertyName, "font-family")) > return style->fontDescription().firstFamily(); > if (!strcmp(propertyName, "size")) >- return makeString(FormattedNumber::fixedPrecision(style->pageSize().width.value()), ' ', FormattedNumber::fixedPrecision(style->pageSize().height.value())); >+ return makeString(style->pageSize().width.value(), ' ', style->pageSize().height.value()); > > return makeString("pageProperty() unimplemented for: ", propertyName); > } >diff --git a/Source/WebCore/platform/graphics/FloatPolygon.cpp b/Source/WebCore/platform/graphics/FloatPolygon.cpp >index 504cfaddf6e43f2f22d3487bbe9b5aac3c28ed41..0f2423c3678ca3a232d10db3b09a886259137e0a 100644 >--- a/Source/WebCore/platform/graphics/FloatPolygon.cpp >+++ b/Source/WebCore/platform/graphics/FloatPolygon.cpp >@@ -259,7 +259,7 @@ bool VertexPair::intersection(const VertexPair& other, FloatPoint& point) const > > String FloatPolygonEdge::debugString() const > { >- return makeString("0x", hex(reinterpret_cast<uintptr_t>(this)), " (", FormattedNumber::fixedPrecision(vertex1().x()), ',', FormattedNumber::fixedPrecision(vertex1().y()), ' ', FormattedNumber::fixedPrecision(vertex2().x()), ',', FormattedNumber::fixedPrecision(vertex2().y()), ')'); >+ return makeString("0x", hex(reinterpret_cast<uintptr_t>(this)), " (", vertex1().x(), ',', vertex1().y(), ' ', vertex2().x(), ',', vertex2().y(), ')'); > } > > #endif >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 7676916c4afe7b21e998213caf6c7dbeff4fff94..1133827dfbea85c73101ac9156eb69aa7088073c 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2019-06-15 Darin Adler <darin@apple.com> >+ >+ Convert some uses of fixed width and fixed precision floating point formatting to use shortest instead >+ https://bugs.webkit.org/show_bug.cgi?id=198896 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/loader/stateobjects/pushstate-frequency-expected.txt: >+ * fast/loader/stateobjects/pushstate-frequency-iframe-expected.txt: >+ * fast/loader/stateobjects/replacestate-frequency-expected.txt: >+ * fast/loader/stateobjects/replacestate-frequency-iframe-expected.txt: >+ Updated to expect cleaner output without ".000000". >+ > 2019-06-15 Rob Buis <rbuis@igalia.com> > > Add tests for prefetch redirects >diff --git a/LayoutTests/fast/loader/stateobjects/pushstate-frequency-expected.txt b/LayoutTests/fast/loader/stateobjects/pushstate-frequency-expected.txt >index 1bf0fe6fcb6ad3fff1053380b974a0ced5995ed7..8a325f6a040f94230a3ab603954d1ba51d2272cf 100644 >--- a/LayoutTests/fast/loader/stateobjects/pushstate-frequency-expected.txt >+++ b/LayoutTests/fast/loader/stateobjects/pushstate-frequency-expected.txt >@@ -99,6 +99,6 @@ Successfully added item: 96 > Successfully added item: 97 > Successfully added item: 98 > Successfully added item: 99 >-SecurityError: Attempt to use history.pushState() more than 100 times per 30.000000 seconds >+SecurityError: Attempt to use history.pushState() more than 100 times per 30 seconds > Test complete > >diff --git a/LayoutTests/fast/loader/stateobjects/pushstate-frequency-iframe-expected.txt b/LayoutTests/fast/loader/stateobjects/pushstate-frequency-iframe-expected.txt >index d8d4095859895a9c06e2827d7154a625f0230817..ce496e0dbda4d41fc3ff7b7085cbe989dae9e1da 100644 >--- a/LayoutTests/fast/loader/stateobjects/pushstate-frequency-iframe-expected.txt >+++ b/LayoutTests/fast/loader/stateobjects/pushstate-frequency-iframe-expected.txt >@@ -107,5 +107,5 @@ Successfully added item: 21 > Successfully added item: 22 > Successfully added item: 23 > Successfully added item: 24 >-Expected exception: SecurityError: Attempt to use history.pushState() more than 100 times per 30.000000 seconds >+Expected exception: SecurityError: Attempt to use history.pushState() more than 100 times per 30 seconds > >diff --git a/LayoutTests/fast/loader/stateobjects/replacestate-frequency-expected.txt b/LayoutTests/fast/loader/stateobjects/replacestate-frequency-expected.txt >index b4646b3a65afa6e857cea0e61bf829df214b9047..4481204a35248eee4d986c618f8fcd4477549164 100644 >--- a/LayoutTests/fast/loader/stateobjects/replacestate-frequency-expected.txt >+++ b/LayoutTests/fast/loader/stateobjects/replacestate-frequency-expected.txt >@@ -99,6 +99,6 @@ Successfully added item: 96 > Successfully added item: 97 > Successfully added item: 98 > Successfully added item: 99 >-SecurityError: Attempt to use history.replaceState() more than 100 times per 30.000000 seconds >+SecurityError: Attempt to use history.replaceState() more than 100 times per 30 seconds > Test complete > >diff --git a/LayoutTests/fast/loader/stateobjects/replacestate-frequency-iframe-expected.txt b/LayoutTests/fast/loader/stateobjects/replacestate-frequency-iframe-expected.txt >index 3aad9fd11a244edd524747ae10f04a021715bc0c..f3d9d7690b52d9710a1fb44d1740434c591fd1f2 100644 >--- a/LayoutTests/fast/loader/stateobjects/replacestate-frequency-iframe-expected.txt >+++ b/LayoutTests/fast/loader/stateobjects/replacestate-frequency-iframe-expected.txt >@@ -106,5 +106,5 @@ Successfully added item: 21 > Successfully added item: 22 > Successfully added item: 23 > Successfully added item: 24 >-Expected exception: SecurityError: Attempt to use history.replaceState() more than 100 times per 30.000000 seconds >+Expected exception: SecurityError: Attempt to use history.replaceState() more than 100 times per 30 seconds >
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 198896
: 372207