Selects should scale when rendering while zoomed
[WebKit-https.git] / Source / WebCore / rendering / RenderThemeMac.mm
index 941e0a4cbd4eb03a204c9ac9336b22d6e5d92854..0e4131e382b3c0cb212719c5c3a9d50fa50ab477 100644 (file)
@@ -947,11 +947,14 @@ bool RenderThemeMac::paintMenuList(const RenderObject& renderer, const PaintInfo
     }
 
     NSView *view = documentViewFor(renderer);
-    [popupButton drawWithFrame:inflatedRect inView:view];
-    if (isFocused(renderer) && renderer.style().outlineStyleIsAuto()) {
-        if (wkDrawCellFocusRingWithFrameAtTime(popupButton, inflatedRect, view, std::numeric_limits<double>::max()))
-            renderer.document().page()->focusController().setFocusedElementNeedsRepaint();
-    }
+    Page* page = renderer.document().page();
+    float pageScaleFactor = page->pageScaleFactor();
+    float deviceScaleFactor = page->deviceScaleFactor();
+    bool shouldDrawFocusRing = isFocused(renderer) && renderer.style().outlineStyleIsAuto();
+    bool shouldUseImageBuffer = zoomLevel != 1.0f || pageScaleFactor != 1.0f;
+    bool shouldDrawCell = true;
+    if (ThemeMac::drawCellOrFocusRingWithViewIntoContext(popupButton, paintInfo.context, inflatedRect, view, shouldDrawCell, shouldDrawFocusRing, shouldUseImageBuffer, deviceScaleFactor))
+        page->focusController().setFocusedElementNeedsRepaint();
 
     [popupButton setControlView:nil];