<attachment> title text disappears when dragging
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Mar 2015 19:33:46 +0000 (19:33 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Mar 2015 19:33:46 +0000 (19:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=142263
<rdar://problem/20035515>

Reviewed by Sam Weinig.

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintAttachment):
We use NSColors with CoreText, which requires that Cocoa knows the current
CGContext out-of-band (through the NSGraphicsContext currentContext mechanism).
Otherwise, sometimes (especially when dragging), it will try to apply the
text foreground color to a null context, complain to the system log, and fail
to render the text.

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderThemeMac.mm

index 82d7484..2d57392 100644 (file)
@@ -1,3 +1,19 @@
+2015-03-04  Timothy Horton  <timothy_horton@apple.com>
+
+        <attachment> title text disappears when dragging
+        https://bugs.webkit.org/show_bug.cgi?id=142263
+        <rdar://problem/20035515>
+
+        Reviewed by Sam Weinig.
+
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintAttachment):
+        We use NSColors with CoreText, which requires that Cocoa knows the current
+        CGContext out-of-band (through the NSGraphicsContext currentContext mechanism).
+        Otherwise, sometimes (especially when dragging), it will try to apply the
+        text foreground color to a null context, complain to the system log, and fail
+        to render the text.
+
 2015-03-04  Jer Noble  <jer.noble@apple.com>
 
         [Mac] YouTube playback at 1.5x speed has audible distortion
index a0c31a1..b4f05cd 100644 (file)
@@ -2459,7 +2459,7 @@ bool RenderThemeMac::paintAttachment(const RenderObject& renderer, const PaintIn
     AttachmentLayout layout(attachment);
 
     GraphicsContext& context = *paintInfo.context;
-
+    LocalCurrentGraphicsContext localContext(&context);
     GraphicsContextStateSaver saver(context);
 
     context.translate(toFloatSize(paintRect.location()));