Title: [279320] trunk/Source/WebCore
Revision
279320
Author
[email protected]
Date
2021-06-27 12:49:51 -0700 (Sun, 27 Jun 2021)

Log Message

[iOS 15] Fix the internal build after rdar://76549109
https://bugs.webkit.org/show_bug.cgi?id=227430
rdar://79832425

Reviewed by Sam Weinig.

Fix the build by replacing the use of the `UIFloatIsZero` macro with its actual definition. The immediate cause
of this build failure is a UIKit change that changed the definition of `UIFloatIsZero`, such that we end up
redefining `UIFloatIsZero` in HTMLConverter.mm. However, since `UIFloatIsZero` is specific to iOS family and
HTMLConverter is used only in this one place on both macOS and iOS, it makes more sense to simply use the macro
definition itself.

* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::computedAttributesForElement):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (279319 => 279320)


--- trunk/Source/WebCore/ChangeLog	2021-06-27 19:17:19 UTC (rev 279319)
+++ trunk/Source/WebCore/ChangeLog	2021-06-27 19:49:51 UTC (rev 279320)
@@ -1,3 +1,20 @@
+2021-06-27  Wenson Hsieh  <[email protected]>
+
+        [iOS 15] Fix the internal build after rdar://76549109
+        https://bugs.webkit.org/show_bug.cgi?id=227430
+        rdar://79832425
+
+        Reviewed by Sam Weinig.
+
+        Fix the build by replacing the use of the `UIFloatIsZero` macro with its actual definition. The immediate cause
+        of this build failure is a UIKit change that changed the definition of `UIFloatIsZero`, such that we end up
+        redefining `UIFloatIsZero` in HTMLConverter.mm. However, since `UIFloatIsZero` is specific to iOS family and
+        HTMLConverter is used only in this one place on both macOS and iOS, it makes more sense to simply use the macro
+        definition itself.
+
+        * editing/cocoa/HTMLConverter.mm:
+        (HTMLConverter::computedAttributesForElement):
+
 2021-06-27  Peng Liu  <[email protected]>
 
         Backgrounding and returning to a FaceTime call in MobileSafari leads to a blank black sreen

Modified: trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm (279319 => 279320)


--- trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm	2021-06-27 19:17:19 UTC (rev 279319)
+++ trunk/Source/WebCore/editing/cocoa/HTMLConverter.mm	2021-06-27 19:49:51 UTC (rev 279320)
@@ -924,8 +924,6 @@
     return (__bridge PlatformFont *)renderer->style().fontCascade().primaryFont().getCTFont();
 }
 
-#define UIFloatIsZero(number) (fabs(number - 0) < FLT_EPSILON)
-
 NSDictionary *HTMLConverter::computedAttributesForElement(Element& element)
 {
     NSMutableDictionary *attrs = [NSMutableDictionary dictionary];
@@ -1022,7 +1020,7 @@
             [attrs setObject:@0.0 forKey:NSKernAttributeName];
         else {
             double kernVal = letterSpacing.length() ? letterSpacing.toDouble() : 0.0;
-            if (UIFloatIsZero(kernVal))
+            if (fabs(kernVal - 0) < FLT_EPSILON)
                 [attrs setObject:@0.0 forKey:NSKernAttributeName]; // auto and normal, the other possible values, are both "kerning enabled"
             else
                 [attrs setObject:@(kernVal) forKey:NSKernAttributeName];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to