Title: [292915] trunk/Source/WebCore
Revision
292915
Author
timothy_hor...@apple.com
Date
2022-04-15 11:08:04 -0700 (Fri, 15 Apr 2022)

Log Message

Non-fatal fault under RenderThemeIOS::paintAttachment due to use of dynamic UIColors
https://bugs.webkit.org/show_bug.cgi?id=239376
<rdar://88141235>

Reviewed by Wenson Hsieh.

No new tests; not observable except for the lack of os_log_fault,
which we currently don't capture.

* rendering/RenderThemeIOS.mm:
(WebCore::attachmentTitleColor):
(WebCore::attachmentSubtitleColor):
(WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
Make use of RenderThemeIOS's cache of system colors, instead of
retrieving them from UIColor directly, for <attachment> text colors.

This is important because we must avoid using dynamic UIColors in the
Web Content process directly (see r254373); this is just repairing
a small missing piece of that patch.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (292914 => 292915)


--- trunk/Source/WebCore/ChangeLog	2022-04-15 18:02:23 UTC (rev 292914)
+++ trunk/Source/WebCore/ChangeLog	2022-04-15 18:08:04 UTC (rev 292915)
@@ -1,5 +1,27 @@
 2022-04-15  Tim Horton  <timothy_hor...@apple.com>
 
+        Non-fatal fault under RenderThemeIOS::paintAttachment due to use of dynamic UIColors
+        https://bugs.webkit.org/show_bug.cgi?id=239376
+        <rdar://88141235>
+
+        Reviewed by Wenson Hsieh.
+
+        No new tests; not observable except for the lack of os_log_fault,
+        which we currently don't capture.
+
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::attachmentTitleColor):
+        (WebCore::attachmentSubtitleColor):
+        (WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
+        Make use of RenderThemeIOS's cache of system colors, instead of
+        retrieving them from UIColor directly, for <attachment> text colors.
+
+        This is important because we must avoid using dynamic UIColors in the
+        Web Content process directly (see r254373); this is just repairing
+        a small missing piece of that patch.
+
+2022-04-15  Tim Horton  <timothy_hor...@apple.com>
+
         Make it possible to adjust the final trait collection applied by LocalCurrentTraitCollection
         https://bugs.webkit.org/show_bug.cgi?id=239375
         rdar://problem/87115393

Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (292914 => 292915)


--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2022-04-15 18:02:23 UTC (rev 292914)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2022-04-15 18:08:04 UTC (rev 292915)
@@ -1665,11 +1665,15 @@
     return std::max<CGFloat>(1, dynamicPointSize / fixedPointSize);
 }
 
-static UIColor *attachmentTitleColor() { return [PAL::getUIColorClass() systemGrayColor]; }
+static UIColor *attachmentTitleColor(const RenderAttachment& renderer)
+{
+    return cocoaColor(RenderTheme::singleton().systemColor(CSSValueAppleSystemGray, renderer.styleColorOptions())).autorelease();
+}
 
 static RetainPtr<CTFontRef> attachmentSubtitleFont() { return attachmentTitleFont(); }
-static UIColor *attachmentSubtitleColor() { return [PAL::getUIColorClass() systemGrayColor]; }
 
+static UIColor *attachmentSubtitleColor(const RenderAttachment& renderer) { return attachmentTitleColor(renderer); }
+
 struct RenderAttachmentInfo {
     explicit RenderAttachmentInfo(const RenderAttachment&);
 
@@ -1876,8 +1880,8 @@
         buildWrappedLines(action, attachmentActionFont().get(), attachmentActionColor(attachment).get(), attachmentWrappingTextMaximumLineCount);
 
     bool forceSingleLineTitle = !action.isEmpty() || !subtitle.isEmpty() || hasProgress;
-    buildWrappedLines(title, attachmentTitleFont().get(), attachmentTitleColor(), forceSingleLineTitle ? 1 : attachmentWrappingTextMaximumLineCount);
-    buildSingleLine(subtitle, attachmentSubtitleFont().get(), attachmentSubtitleColor());
+    buildWrappedLines(title, attachmentTitleFont().get(), attachmentTitleColor(attachment), forceSingleLineTitle ? 1 : attachmentWrappingTextMaximumLineCount);
+    buildSingleLine(subtitle, attachmentSubtitleFont().get(), attachmentSubtitleColor(attachment));
 
     if (!lines.isEmpty()) {
         for (auto& line : lines) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to