[iOS] Using file upload can trigger a crash under RenderThemeIOS::paintFileUploadIcon...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Dec 2018 00:02:19 +0000 (00:02 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Dec 2018 00:02:19 +0000 (00:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192357
<rdar://problem/42852260>

Reviewed by Simon Fraser.

Do not try to paint the file picker when painting is disabled.

* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239526 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderFileUploadControl.cpp

index afe006a..9f38d7c 100644 (file)
@@ -1,3 +1,16 @@
+2018-12-21  Zalan Bujtas  <zalan@apple.com>
+
+        [iOS] Using file upload can trigger a crash under RenderThemeIOS::paintFileUploadIconDecorations()
+        https://bugs.webkit.org/show_bug.cgi?id=192357
+        <rdar://problem/42852260>
+
+        Reviewed by Simon Fraser.
+
+        Do not try to paint the file picker when painting is disabled.
+
+        * rendering/RenderFileUploadControl.cpp:
+        (WebCore::RenderFileUploadControl::paintObject):
+
 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
 
         [WebAuthN] userPresence should always be true
 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
 
         [WebAuthN] userPresence should always be true
index 6c547cf..1cd32b3 100644 (file)
@@ -117,6 +117,9 @@ void RenderFileUploadControl::paintObject(PaintInfo& paintInfo, const LayoutPoin
     if (style().visibility() != Visibility::Visible)
         return;
     
     if (style().visibility() != Visibility::Visible)
         return;
     
+    if (paintInfo.context().paintingDisabled())
+        return;
+
     // Push a clip.
     GraphicsContextStateSaver stateSaver(paintInfo.context(), false);
     if (paintInfo.phase == PaintPhase::Foreground || paintInfo.phase == PaintPhase::ChildBlockBackgrounds) {
     // Push a clip.
     GraphicsContextStateSaver stateSaver(paintInfo.context(), false);
     if (paintInfo.phase == PaintPhase::Foreground || paintInfo.phase == PaintPhase::ChildBlockBackgrounds) {