Title: [251003] trunk/Source/WTF
Revision
251003
Author
calva...@igalia.com
Date
2019-10-11 01:21:02 -0700 (Fri, 11 Oct 2019)

Log Message

MediaTime pretty printer can print if time is invalid
https://bugs.webkit.org/show_bug.cgi?id=202735

Reviewed by Eric Carlson.

* wtf/MediaTime.cpp:
(WTF::MediaTime::toString const): Append ", invalid" if isInvalid().
(WTF::MediaTime::toJSONObject const): Set boolean invalid to true
when invalid.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (251002 => 251003)


--- trunk/Source/WTF/ChangeLog	2019-10-11 06:59:35 UTC (rev 251002)
+++ trunk/Source/WTF/ChangeLog	2019-10-11 08:21:02 UTC (rev 251003)
@@ -1,3 +1,15 @@
+2019-10-11  Xabier Rodriguez Calvar  <calva...@igalia.com>
+
+        MediaTime pretty printer can print if time is invalid
+        https://bugs.webkit.org/show_bug.cgi?id=202735
+
+        Reviewed by Eric Carlson.
+
+        * wtf/MediaTime.cpp:
+        (WTF::MediaTime::toString const): Append ", invalid" if isInvalid().
+        (WTF::MediaTime::toJSONObject const): Set boolean invalid to true
+        when invalid.
+
 2019-10-09  Keith Rollin  <krol...@apple.com>
 
         Remove some support for < iOS 13

Modified: trunk/Source/WTF/wtf/MediaTime.cpp (251002 => 251003)


--- trunk/Source/WTF/wtf/MediaTime.cpp	2019-10-11 06:59:35 UTC (rev 251002)
+++ trunk/Source/WTF/wtf/MediaTime.cpp	2019-10-11 08:21:02 UTC (rev 251003)
@@ -594,6 +594,8 @@
         builder.appendLiteral(" = ");
     }
     builder.appendFixedPrecisionNumber(toDouble());
+    if (isInvalid())
+        builder.appendLiteral(", invalid");
     builder.append('}');
     return builder.toString();
 }
@@ -607,7 +609,9 @@
         return object;
     }
 
-    if (isInvalid() || isIndefinite())
+    if (isInvalid())
+        object->setBoolean("invalid"_s, true);
+    else if (isIndefinite())
         object->setString("value"_s, "NaN"_s);
     else if (isPositiveInfinite())
         object->setString("value"_s, "POSITIVE_INFINITY"_s);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to