Title: [283638] trunk/Source/WebCore
Revision
283638
Author
[email protected]
Date
2021-10-06 11:17:38 -0700 (Wed, 06 Oct 2021)

Log Message

ASSERTion failure in WebCore::deviceClass() on macCatalyst
https://bugs.webkit.org/show_bug.cgi?id=231279

Reviewed by Anders Carlsson.

* platform/ios/Device.cpp:
(WebCore::deviceClass):
Simplify deviceClass(); there's no reason to assert here, callers
should be written to assume they don't know the future. Also, this
has been asserting on macOS for ages...

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (283637 => 283638)


--- trunk/Source/WebCore/ChangeLog	2021-10-06 18:11:18 UTC (rev 283637)
+++ trunk/Source/WebCore/ChangeLog	2021-10-06 18:17:38 UTC (rev 283638)
@@ -1,3 +1,16 @@
+2021-10-06  Tim Horton  <[email protected]>
+
+        ASSERTion failure in WebCore::deviceClass() on macCatalyst
+        https://bugs.webkit.org/show_bug.cgi?id=231279
+
+        Reviewed by Anders Carlsson.
+
+        * platform/ios/Device.cpp:
+        (WebCore::deviceClass):
+        Simplify deviceClass(); there's no reason to assert here, callers
+        should be written to assume they don't know the future. Also, this
+        has been asserting on macOS for ages...
+
 2021-10-06  Aditya Keerthi  <[email protected]>
 
         Fix serialization of CSSMediaRule

Modified: trunk/Source/WebCore/platform/ios/Device.cpp (283637 => 283638)


--- trunk/Source/WebCore/platform/ios/Device.cpp	2021-10-06 18:11:18 UTC (rev 283637)
+++ trunk/Source/WebCore/platform/ios/Device.cpp	2021-10-06 18:17:38 UTC (rev 283638)
@@ -37,21 +37,7 @@
 
 MGDeviceClass deviceClass()
 {
-    static MGDeviceClass deviceClass = [] {
-        int deviceClassNumber = MGGetSInt32Answer(kMGQDeviceClassNumber, MGDeviceClassInvalid);
-        switch (deviceClassNumber) {
-        case MGDeviceClassInvalid:
-        case MGDeviceClassiPhone:
-        case MGDeviceClassiPod:
-        case MGDeviceClassiPad:
-        case MGDeviceClassAppleTV:
-        case MGDeviceClassWatch:
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        return static_cast<MGDeviceClass>(deviceClassNumber);
-    }();
+    static MGDeviceClass deviceClass = static_cast<MGDeviceClass>(MGGetSInt32Answer(kMGQDeviceClassNumber, MGDeviceClassInvalid));
     return deviceClass;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to