[Webkit-unassigned] [Bug 147868] Selects should scale when rendering while zoomed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 11 11:44:11 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=147868

--- Comment #2 from Daniel Bates <dbates at webkit.org> ---
Comment on attachment 258715
  --> https://bugs.webkit.org/attachment.cgi?id=258715
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=258715&action=review

> Source/WebCore/rendering/RenderThemeMac.mm:951
> +    float pageScaleFactor = renderer.document().page() ? renderer.document().page()->pageScaleFactor() : 1.0f;
> +    float deviceScaleFactor = renderer.document().page() ? renderer.document().page()->deviceScaleFactor() : 1.0f;

Can you elaborate on a case where this function is called and renderer.document().page() returns nullptr? I mean both the old code and new code assume renderer.document().page() is non-null after drawing the cell (well, the new code actually never calls renderer.document().page()->focusController().setFocusedElementNeedsRepaint() after drawing the cell per my remark below).

1.0f => 1.0 (by <http://www.webkit.org/coding/coding-style.html#float-suffixes> since it is unnecessary to explicitly force floating point given the context).

> Source/WebCore/rendering/RenderThemeMac.mm:954
> +    if (ThemeMac::drawCellOrFocusRingWithViewIntoContext(popupButton, paintInfo.context, inflatedRect, view, true, shouldDrawFocusRing, shouldUseImageBuffer, deviceScaleFactor) && shouldDrawFocusRing)

I do not understand the purpose of the conjunct shouldDrawButtonCell. I mean, the condition of this if-statement will always evaluate to false because drawCellFocusRing(), called by ThemeMac::drawCellOrFocusRingWithViewIntoContext(), is hardcoded to return false (why?). Regardless, it should ThemeMac::drawCellOrFocusRingWithViewIntoContext() that tells the caller whether to the repaint

On another note, it is unclear from looking at this line what is the purpose of the fifth argument to drawCellOrFocusRingWithViewIntoContext() without looking at its prototype. I suggest we define a local variable called shouldDrawButtonCell defined to be true and pass this variable as the fifth argument.

> Source/WebCore/rendering/RenderThemeMac.mm:955
> +        renderer.document().page()->focusController().setFocusedElementNeedsRepaint();

We repeatedly make use of the value of renderer.document().page(). Although the compiler is likely smart enough, I suggest that we cache the return value of renderer.document().page() in a local variable and make us of this local variable.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150811/8b9d319e/attachment.html>


More information about the webkit-unassigned mailing list