WebKit Bugzilla
Attachment 360775 Details for
Bug 194108
: Web Inspector: Timeline time range selection sometimes shows 0.000, should be just 0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
[PATCH] Proposed Fix
sub-zero-1.patch (text/plain), 5.54 KB, created by
Joseph Pecoraro
on 2019-01-31 14:08:04 PST
(
hide
)
Description:
[PATCH] Proposed Fix
Filename:
MIME Type:
Creator:
Joseph Pecoraro
Created:
2019-01-31 14:08:04 PST
Size:
5.54 KB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index b0be8865e22..d98817e9e70 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2019-01-31 Joseph Pecoraro <pecoraro@apple.com> >+ >+ Web Inspector: Timeline time range selection sometimes shows 0.000, should be just 0 >+ https://bugs.webkit.org/show_bug.cgi?id=194108 >+ <rdar://problem/47714273> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * inspector/unit-tests/number-utilities-expected.txt: >+ * inspector/unit-tests/number-utilities.html: >+ > 2019-01-31 Zalan Bujtas <zalan@apple.com> > > [LFC] Use the used margin values in outOfFlowReplacedHorizontalGeometry consistently >diff --git a/LayoutTests/inspector/unit-tests/number-utilities-expected.txt b/LayoutTests/inspector/unit-tests/number-utilities-expected.txt >index 8c0fee67a7e..dfa43114ccf 100644 >--- a/LayoutTests/inspector/unit-tests/number-utilities-expected.txt >+++ b/LayoutTests/inspector/unit-tests/number-utilities-expected.txt >@@ -26,6 +26,7 @@ PASS: normal resolution of greater than 1min but sub 1hr should be minutes > PASS: normal resolution of greater than 1hr but sub 1 day should be hrs > PASS: normal resolution of greater than 1 day should be days > PASS: normal resolution of greater than 1 day should be days >+PASS: normal resolution of super small value should be ms with no decimals > PASS: high resolution of 0ms should be ms with no decimals > PASS: high resolution of sub 1ms should be ms with decimals > PASS: high resolution of sub 10ms should be ms with decimals >@@ -35,6 +36,7 @@ PASS: high resolution of greater than 1s should be seconds with decimals > PASS: high resolution of greater than 1s should be seconds with decimals > PASS: high resolution of greater than 1s should be seconds with decimals > PASS: high resolution greater than 1s should be seconds with decimals >+PASS: high resolution of super small value should be ms with no decimals > > -- Running test case: Number.bytesToString > PASS: normal resolution of sub 1k should be bytes >diff --git a/LayoutTests/inspector/unit-tests/number-utilities.html b/LayoutTests/inspector/unit-tests/number-utilities.html >index 8ef3282ea26..d18339f4cd2 100644 >--- a/LayoutTests/inspector/unit-tests/number-utilities.html >+++ b/LayoutTests/inspector/unit-tests/number-utilities.html >@@ -5,6 +5,9 @@ > <script> > function test() > { >+ // This is the floating point precision error value from: `0.3 - 0.2 - 0.1` >+ const superSmallValue = -2.7755575615628914e-17; >+ > let suite = InspectorTest.createSyncSuite("NumberUtilities"); > > suite.addTestCase({ >@@ -44,6 +47,7 @@ function test() > InspectorTest.expectEqual(Number.secondsToString(12345, false), "3.4hrs", "normal resolution of greater than 1hr but sub 1 day should be hrs"); > InspectorTest.expectEqual(Number.secondsToString(123456, false), "1.4 days", "normal resolution of greater than 1 day should be days"); > InspectorTest.expectEqual(Number.secondsToString(1234567, false), "14.3 days", "normal resolution of greater than 1 day should be days"); >+ InspectorTest.expectEqual(Number.secondsToString(superSmallValue, false), "0ms", "normal resolution of super small value should be ms with no decimals"); > > // High resolution. > InspectorTest.expectEqual(Number.secondsToString(0, true), "0ms", "high resolution of 0ms should be ms with no decimals"); >@@ -55,6 +59,7 @@ function test() > InspectorTest.expectEqual(Number.secondsToString(30.123456, true), "30.12s", "high resolution of greater than 1s should be seconds with decimals"); > InspectorTest.expectEqual(Number.secondsToString(60.123456, true), "60.12s", "high resolution of greater than 1s should be seconds with decimals"); > InspectorTest.expectEqual(Number.secondsToString(100.123456, true), "100.12s", "high resolution greater than 1s should be seconds with decimals"); >+ InspectorTest.expectEqual(Number.secondsToString(superSmallValue, true), "0ms", "high resolution of super small value should be ms with no decimals"); > > return true; > } >diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index 2d74f41efe3..e1d4d35137f 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,14 @@ >+2019-01-31 Joseph Pecoraro <pecoraro@apple.com> >+ >+ Web Inspector: Timeline time range selection sometimes shows 0.000, should be just 0 >+ https://bugs.webkit.org/show_bug.cgi?id=194108 >+ <rdar://problem/47714273> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UserInterface/Base/Utilities.js: >+ Check under epsilon for the zero case. >+ > 2019-01-29 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: Improve API and documentation of ColumnChart >diff --git a/Source/WebInspectorUI/UserInterface/Base/Utilities.js b/Source/WebInspectorUI/UserInterface/Base/Utilities.js >index 524d3f03f59..93a4f9ea904 100644 >--- a/Source/WebInspectorUI/UserInterface/Base/Utilities.js >+++ b/Source/WebInspectorUI/UserInterface/Base/Utilities.js >@@ -1156,12 +1156,12 @@ Object.defineProperty(Number, "secondsToString", > { > value(seconds, higherResolution) > { >- let ms = seconds * 1000; >- if (!ms) >- return WI.UIString("%.0fms").format(0); >- > const epsilon = 0.0001; > >+ let ms = seconds * 1000; >+ if (ms < epsilon) >+ return WI.UIString("%.0fms").format(0); >+ > if (Math.abs(ms) < (10 + epsilon)) { > if (higherResolution) > return WI.UIString("%.3fms").format(ms);
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 194108
:
360766
| 360775