Title: [232325] branches/safari-606.1.17.20-branch/Source/WebCore
Revision
232325
Author
d...@apple.com
Date
2018-05-30 17:41:28 -0700 (Wed, 30 May 2018)

Log Message

Cherry-pick r232320. rdar://problem/40662705

Modified Paths

Diff

Modified: branches/safari-606.1.17.20-branch/Source/WebCore/ChangeLog (232324 => 232325)


--- branches/safari-606.1.17.20-branch/Source/WebCore/ChangeLog	2018-05-31 00:39:57 UTC (rev 232324)
+++ branches/safari-606.1.17.20-branch/Source/WebCore/ChangeLog	2018-05-31 00:41:28 UTC (rev 232325)
@@ -1,3 +1,23 @@
+2018-05-30  Dean Jackson  <d...@apple.com>
+
+        Cherry-pick r232320. rdar://problem/40662705
+
+    2018-05-30  Dean Jackson  <d...@apple.com>
+
+            WebContent crashes with system preview content
+            https://bugs.webkit.org/show_bug.cgi?id=186118
+
+            Reviewed by Myles Maxfield.
+
+            We were receiving crash reports on iOS devices when getting
+            platformContext() from a GraphicsContext. This usually
+            occurred when the page was invisible. Debugging showed that
+            it was trying to draw with a disabled context.
+
+            * rendering/RenderThemeIOS.mm:
+            (WebCore::RenderThemeIOS::paintSystemPreviewBadge): Early
+            return if the context has painting disabled.
+
 2018-05-22  Babak Shafiei  <bshaf...@apple.com>
 
         Cherry-pick r232090. rdar://problem/40306056

Modified: branches/safari-606.1.17.20-branch/Source/WebCore/rendering/RenderThemeIOS.mm (232324 => 232325)


--- branches/safari-606.1.17.20-branch/Source/WebCore/rendering/RenderThemeIOS.mm	2018-05-31 00:39:57 UTC (rev 232324)
+++ branches/safari-606.1.17.20-branch/Source/WebCore/rendering/RenderThemeIOS.mm	2018-05-31 00:41:28 UTC (rev 232325)
@@ -1852,8 +1852,14 @@
     // Create a circle to be used for the clipping path in the badge, as well as the drop shadow.
     RetainPtr<CGPathRef> circle = adoptCF(CGPathCreateWithRoundedRect(absoluteBadgeRect, badgeDimension / 2, badgeDimension / 2, nullptr));
 
-    CGContextRef ctx = paintInfo.context().platformContext();
+    auto& graphicsContext = paintInfo.context();
+    if (graphicsContext.paintingDisabled())
+        return;
 
+    CGContextRef ctx = graphicsContext.platformContext();
+    if (!ctx)
+        return;
+
     CGContextSaveGState(ctx);
 
     // Draw a drop shadow around the circle.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to