<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[169898] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/169898">169898</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2014-06-12 07:53:51 -0700 (Thu, 12 Jun 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Subpixel rendering: Make <select> element's decoration subpixel aware.
https://bugs.webkit.org/show_bug.cgi?id=133781
<rdar://problem/17272083>
Reviewed by Simon Fraser.
Enable <select> decoration painting on subpixel positions.
The theme size is still integral, but its position is snapped to device pixels.
Theme's label, the InlineTextBox is already subpixel position aware.
webkit.org/b/132005 tracks the rest of the themes.
Not testable.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::paintMenuList):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::inflateRect):
(WebCore::RenderThemeMac::adjustRepaintRect):
(WebCore::RenderThemeMac::paintMenuList):
(WebCore::RenderThemeMac::progressBarRectForBounds):
(WebCore::RenderThemeMac::setPopupButtonCellState):
(WebCore::RenderThemeMac::inflateRect): Deleted.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformeflRenderThemeEflcpp">trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformeflRenderThemeEflh">trunk/Source/WebCore/platform/efl/RenderThemeEfl.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkRenderThemeGtkcpp">trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkRenderThemeGtkh">trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkRenderThemeGtk2cpp">trunk/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkRenderThemeGtk3cpp">trunk/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemecpp">trunk/Source/WebCore/rendering/RenderTheme.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeh">trunk/Source/WebCore/rendering/RenderTheme.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeMach">trunk/Source/WebCore/rendering/RenderThemeMac.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeMacmm">trunk/Source/WebCore/rendering/RenderThemeMac.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (169897 => 169898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-12 14:09:31 UTC (rev 169897)
+++ trunk/Source/WebCore/ChangeLog        2014-06-12 14:53:51 UTC (rev 169898)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2014-06-12 Zalan Bujtas <zalan@apple.com>
+
+ Subpixel rendering: Make <select> element's decoration subpixel aware.
+ https://bugs.webkit.org/show_bug.cgi?id=133781
+ <rdar://problem/17272083>
+
+ Reviewed by Simon Fraser.
+
+ Enable <select> decoration painting on subpixel positions.
+ The theme size is still integral, but its position is snapped to device pixels.
+ Theme's label, the InlineTextBox is already subpixel position aware.
+ webkit.org/b/132005 tracks the rest of the themes.
+
+ Not testable.
+
+ * rendering/RenderTheme.cpp:
+ (WebCore::RenderTheme::paint):
+ * rendering/RenderTheme.h:
+ (WebCore::RenderTheme::paintMenuList):
+ * rendering/RenderThemeMac.h:
+ * rendering/RenderThemeMac.mm:
+ (WebCore::inflateRect):
+ (WebCore::RenderThemeMac::adjustRepaintRect):
+ (WebCore::RenderThemeMac::paintMenuList):
+ (WebCore::RenderThemeMac::progressBarRectForBounds):
+ (WebCore::RenderThemeMac::setPopupButtonCellState):
+ (WebCore::RenderThemeMac::inflateRect): Deleted.
+
</ins><span class="cx"> 2014-06-12 Jer Noble <jer.noble@apple.com>
</span><span class="cx">
</span><span class="cx"> [MSE][Mac] Crash in MediaSourcePrivateAVFObjC::naturalSize()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformeflRenderThemeEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp (169897 => 169898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp        2014-06-12 14:09:31 UTC (rev 169897)
+++ trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp        2014-06-12 14:53:51 UTC (rev 169898)
</span><span class="lines">@@ -842,9 +842,9 @@
</span><span class="cx"> style->setLineHeight(RenderStyle::initialLineHeight());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool RenderThemeEfl::paintMenuList(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
</del><ins>+bool RenderThemeEfl::paintMenuList(const RenderObject& object, const PaintInfo& info, const FloatRect& rect)
</ins><span class="cx"> {
</span><del>- return paintThemePart(object, ComboBox, info, rect);
</del><ins>+ return paintThemePart(object, ComboBox, info, IntRect(rect));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void RenderThemeEfl::adjustMenuListButtonStyle(StyleResolver* styleResolver, RenderStyle* style, Element* element) const
</span><span class="lines">@@ -865,7 +865,7 @@
</span><span class="cx">
</span><span class="cx"> bool RenderThemeEfl::paintMenuListButtonDecorations(const RenderObject& object, const PaintInfo& info, const FloatRect& rect)
</span><span class="cx"> {
</span><del>- return paintMenuList(object, info, IntRect(rect));
</del><ins>+ return paintMenuList(object, info, rect);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void RenderThemeEfl::adjustTextFieldStyle(StyleResolver* styleResolver, RenderStyle* style, Element* element) const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformeflRenderThemeEflh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/efl/RenderThemeEfl.h (169897 => 169898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/efl/RenderThemeEfl.h        2014-06-12 14:09:31 UTC (rev 169897)
+++ trunk/Source/WebCore/platform/efl/RenderThemeEfl.h        2014-06-12 14:53:51 UTC (rev 169898)
</span><span class="lines">@@ -126,7 +126,7 @@
</span><span class="cx"> virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const FloatRect&) override;
</span><span class="cx">
</span><span class="cx"> virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const override;
</span><del>- virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&) override;
</del><ins>+ virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const FloatRect&) override;
</ins><span class="cx">
</span><span class="cx"> virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const override;
</span><span class="cx"> virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const FloatRect&) override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkRenderThemeGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp (169897 => 169898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp        2014-06-12 14:09:31 UTC (rev 169897)
+++ trunk/Source/WebCore/platform/gtk/RenderThemeGtk.cpp        2014-06-12 14:53:51 UTC (rev 169898)
</span><span class="lines">@@ -243,7 +243,7 @@
</span><span class="cx">
</span><span class="cx"> bool RenderThemeGtk::paintMenuListButtonDecorations(const RenderObject& object, const PaintInfo& info, const FloatRect& rect)
</span><span class="cx"> {
</span><del>- return paintMenuList(object, info, IntRect(rect));
</del><ins>+ return paintMenuList(object, info, rect);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool RenderThemeGtk::paintTextArea(const RenderObject& o, const PaintInfo& i, const FloatRect& r)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkRenderThemeGtkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h (169897 => 169898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h        2014-06-12 14:09:31 UTC (rev 169897)
+++ trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h        2014-06-12 14:53:51 UTC (rev 169898)
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx"> // we don't maintain this differentiation.
</span><span class="cx"> virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const override;
</span><span class="cx"> virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const override;
</span><del>- virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&) override;
</del><ins>+ virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const FloatRect&) override;
</ins><span class="cx"> virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const FloatRect&) override;
</span><span class="cx">
</span><span class="cx"> virtual void adjustSearchFieldResultsDecorationPartStyle(StyleResolver*, RenderStyle*, Element*) const override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkRenderThemeGtk2cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp (169897 => 169898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp        2014-06-12 14:09:31 UTC (rev 169897)
+++ trunk/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp        2014-06-12 14:53:51 UTC (rev 169898)
</span><span class="lines">@@ -365,8 +365,10 @@
</span><span class="cx"> return bottom;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool RenderThemeGtk::paintMenuList(const RenderObject& object, const PaintInfo& info, const IntRect& rect)
</del><ins>+bool RenderThemeGtk::paintMenuList(const RenderObject& object, const PaintInfo& info, const FloatRect& r)
</ins><span class="cx"> {
</span><ins>+ // FIXME: adopt subpixel themes.
+ IntRect rect = IntRect(r);
</ins><span class="cx"> if (paintButton(object, info, rect))
</span><span class="cx"> return true;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkRenderThemeGtk3cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp (169897 => 169898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp        2014-06-12 14:09:31 UTC (rev 169897)
+++ trunk/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp        2014-06-12 14:53:51 UTC (rev 169898)
</span><span class="lines">@@ -464,8 +464,11 @@
</span><span class="cx"> return borderWidth.bottom + focusWidth;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool RenderThemeGtk::paintMenuList(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
</del><ins>+bool RenderThemeGtk::paintMenuList(const RenderObject& renderObject, const PaintInfo& paintInfo, const FloatRect& r)
</ins><span class="cx"> {
</span><ins>+ // FIXME: adopt subpixel themes.
+ IntRect rect = IntRect(r);
+
</ins><span class="cx"> cairo_t* cairoContext = paintInfo.context->platformContext()->cr();
</span><span class="cx"> GtkTextDirection direction = static_cast<GtkTextDirection>(gtkTextDirection(renderObject.style().direction()));
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (169897 => 169898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTheme.cpp        2014-06-12 14:09:31 UTC (rev 169897)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp        2014-06-12 14:53:51 UTC (rev 169898)
</span><span class="lines">@@ -278,6 +278,7 @@
</span><span class="cx">
</span><span class="cx"> ControlPart part = o.style().appearance();
</span><span class="cx"> IntRect integralSnappedRect = pixelSnappedIntRect(r);
</span><ins>+ FloatRect devicePixelSnappedRect = pixelSnappedForPainting(r, o.document().deviceScaleFactor());
</ins><span class="cx">
</span><span class="cx"> #if USE(NEW_THEME)
</span><span class="cx"> switch (part) {
</span><span class="lines">@@ -314,7 +315,7 @@
</span><span class="cx"> return paintInnerSpinButton(o, paintInfo, integralSnappedRect);
</span><span class="cx"> #endif
</span><span class="cx"> case MenulistPart:
</span><del>- return paintMenuList(o, paintInfo, integralSnappedRect);
</del><ins>+ return paintMenuList(o, paintInfo, devicePixelSnappedRect);
</ins><span class="cx"> #if ENABLE(METER_ELEMENT)
</span><span class="cx"> case MeterPart:
</span><span class="cx"> case RelevancyLevelIndicatorPart:
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderTheme.h (169897 => 169898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderTheme.h        2014-06-12 14:09:31 UTC (rev 169897)
+++ trunk/Source/WebCore/rendering/RenderTheme.h        2014-06-12 14:53:51 UTC (rev 169898)
</span><span class="lines">@@ -299,7 +299,7 @@
</span><span class="cx"> virtual bool paintTextAreaDecorations(const RenderObject&, const PaintInfo&, const FloatRect&) { return true; }
</span><span class="cx">
</span><span class="cx"> virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
</span><del>- virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
</del><ins>+ virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const FloatRect&) { return true; }
</ins><span class="cx"> virtual bool paintMenuListDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
</span><span class="cx">
</span><span class="cx"> virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeMac.h (169897 => 169898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeMac.h        2014-06-12 14:09:31 UTC (rev 169897)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.h        2014-06-12 14:53:51 UTC (rev 169898)
</span><span class="lines">@@ -130,7 +130,7 @@
</span><span class="cx"> virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const FloatRect&) override;
</span><span class="cx"> virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const override;
</span><span class="cx">
</span><del>- virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&) override;
</del><ins>+ virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const FloatRect&) override;
</ins><span class="cx"> virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const override;
</span><span class="cx">
</span><span class="cx"> virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const FloatRect&) override;
</span><span class="lines">@@ -173,8 +173,6 @@
</span><span class="cx"> private:
</span><span class="cx"> virtual String fileListNameForWidth(const FileList*, const Font&, int width, bool multipleFilesAllowed) const override;
</span><span class="cx">
</span><del>- IntRect inflateRect(const IntRect&, const IntSize&, const int* margins, float zoomLevel = 1.0f) const;
-
</del><span class="cx"> FloatRect convertToPaintingRect(const RenderObject& inputRenderer, const RenderObject& partRenderer, const FloatRect& inputRect, const IntRect&) const;
</span><span class="cx">
</span><span class="cx"> // Get the control size based off the font. Used by some of the controls (like buttons).
</span><span class="lines">@@ -194,7 +192,7 @@
</span><span class="cx">
</span><span class="cx"> // Helpers for adjusting appearance and for painting
</span><span class="cx">
</span><del>- void setPopupButtonCellState(const RenderObject&, const IntRect&);
</del><ins>+ void setPopupButtonCellState(const RenderObject&, const IntSize&);
</ins><span class="cx"> const IntSize* popupButtonSizes() const;
</span><span class="cx"> const int* popupButtonMargins() const;
</span><span class="cx"> const int* popupButtonPadding(NSControlSize) const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (169897 => 169898)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeMac.mm        2014-06-12 14:09:31 UTC (rev 169897)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm        2014-06-12 14:53:51 UTC (rev 169898)
</span><span class="lines">@@ -615,6 +615,24 @@
</span><span class="cx"> return RenderTheme::isControlStyled(style, border, background, backgroundColor);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static FloatRect inflateRect(const FloatRect& rect, const IntSize& size, const int* margins, float zoomLevel)
+{
+ // Only do the inflation if the available width/height are too small. Otherwise try to
+ // fit the glow/check space into the available box's width/height.
+ int widthDelta = rect.width() - (size.width() + margins[leftMargin] * zoomLevel + margins[rightMargin] * zoomLevel);
+ int heightDelta = rect.height() - (size.height() + margins[topMargin] * zoomLevel + margins[bottomMargin] * zoomLevel);
+ FloatRect result(rect);
+ if (widthDelta < 0) {
+ result.setX(result.x() - margins[leftMargin] * zoomLevel);
+ result.setWidth(result.width() - widthDelta);
+ }
+ if (heightDelta < 0) {
+ result.setY(result.y() - margins[topMargin] * zoomLevel);
+ result.setHeight(result.height() - heightDelta);
+ }
+ return result;
+}
+
</ins><span class="cx"> void RenderThemeMac::adjustRepaintRect(const RenderObject& o, IntRect& r)
</span><span class="cx"> {
</span><span class="cx"> ControlPart part = o.style().appearance();
</span><span class="lines">@@ -637,32 +655,14 @@
</span><span class="cx"> float zoomLevel = o.style().effectiveZoom();
</span><span class="cx">
</span><span class="cx"> if (part == MenulistPart) {
</span><del>- setPopupButtonCellState(o, r);
</del><ins>+ setPopupButtonCellState(o, r.size());
</ins><span class="cx"> IntSize size = popupButtonSizes()[[popupButton() controlSize]];
</span><span class="cx"> size.setHeight(size.height() * zoomLevel);
</span><span class="cx"> size.setWidth(r.width());
</span><del>- r = inflateRect(r, size, popupButtonMargins(), zoomLevel);
</del><ins>+ r = IntRect(inflateRect(r, size, popupButtonMargins(), zoomLevel));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-IntRect RenderThemeMac::inflateRect(const IntRect& r, const IntSize& size, const int* margins, float zoomLevel) const
-{
- // Only do the inflation if the available width/height are too small. Otherwise try to
- // fit the glow/check space into the available box's width/height.
- int widthDelta = r.width() - (size.width() + margins[leftMargin] * zoomLevel + margins[rightMargin] * zoomLevel);
- int heightDelta = r.height() - (size.height() + margins[topMargin] * zoomLevel + margins[bottomMargin] * zoomLevel);
- IntRect result(r);
- if (widthDelta < 0) {
- result.setX(result.x() - margins[leftMargin] * zoomLevel);
- result.setWidth(result.width() - widthDelta);
- }
- if (heightDelta < 0) {
- result.setY(result.y() - margins[topMargin] * zoomLevel);
- result.setHeight(result.height() - heightDelta);
- }
- return result;
-}
-
</del><span class="cx"> FloatRect RenderThemeMac::convertToPaintingRect(const RenderObject& inputRenderer, const RenderObject& partRenderer, const FloatRect& inputRect, const IntRect& r) const
</span><span class="cx"> {
</span><span class="cx"> FloatRect partRect(inputRect);
</span><span class="lines">@@ -899,22 +899,22 @@
</span><span class="cx"> return padding[size];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool RenderThemeMac::paintMenuList(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
</del><ins>+bool RenderThemeMac::paintMenuList(const RenderObject& renderer, const PaintInfo& paintInfo, const FloatRect& rect)
</ins><span class="cx"> {
</span><span class="cx"> LocalCurrentGraphicsContext localContext(paintInfo.context);
</span><del>- setPopupButtonCellState(o, r);
</del><ins>+ setPopupButtonCellState(renderer, IntSize(rect.size()));
</ins><span class="cx">
</span><span class="cx"> NSPopUpButtonCell* popupButton = this->popupButton();
</span><span class="cx">
</span><del>- float zoomLevel = o.style().effectiveZoom();
</del><ins>+ float zoomLevel = renderer.style().effectiveZoom();
</ins><span class="cx"> IntSize size = popupButtonSizes()[[popupButton controlSize]];
</span><span class="cx"> size.setHeight(size.height() * zoomLevel);
</span><del>- size.setWidth(r.width());
</del><ins>+ size.setWidth(rect.width());
</ins><span class="cx">
</span><span class="cx"> // Now inflate it to account for the shadow.
</span><del>- IntRect inflatedRect = r;
- if (r.width() >= minimumMenuListSize(&o.style()))
- inflatedRect = inflateRect(inflatedRect, size, popupButtonMargins(), zoomLevel);
</del><ins>+ FloatRect inflatedRect = rect;
+ if (rect.width() >= minimumMenuListSize(&renderer.style()))
+ inflatedRect = inflateRect(rect, size, popupButtonMargins(), zoomLevel);
</ins><span class="cx">
</span><span class="cx"> GraphicsContextStateSaver stateSaver(*paintInfo.context);
</span><span class="cx">
</span><span class="lines">@@ -929,11 +929,11 @@
</span><span class="cx"> paintInfo.context->translate(-inflatedRect.x(), -inflatedRect.y());
</span><span class="cx"> }
</span><span class="cx">
</span><del>- NSView *view = documentViewFor(o);
</del><ins>+ NSView *view = documentViewFor(renderer);
</ins><span class="cx"> [popupButton drawWithFrame:inflatedRect inView:view];
</span><del>- if (isFocused(o) && o.style().outlineStyleIsAuto()) {
</del><ins>+ if (isFocused(renderer) && renderer.style().outlineStyleIsAuto()) {
</ins><span class="cx"> if (wkDrawCellFocusRingWithFrameAtTime(popupButton, inflatedRect, view, std::numeric_limits<double>::max()))
</span><del>- o.document().page()->focusController().setFocusedElementNeedsRepaint();
</del><ins>+ renderer.document().page()->focusController().setFocusedElementNeedsRepaint();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> [popupButton setControlView:nil];
</span><span class="lines">@@ -1080,7 +1080,7 @@
</span><span class="cx"> // Now inflate it to account for the shadow.
</span><span class="cx"> IntRect inflatedRect = progressBarBounds;
</span><span class="cx"> if (progressBarBounds.height() <= minimumProgressBarHeight(&renderObject.style()))
</span><del>- inflatedRect = inflateRect(inflatedRect, size, progressBarMargins(controlSize), zoomLevel);
</del><ins>+ inflatedRect = IntRect(inflateRect(inflatedRect, size, progressBarMargins(controlSize), zoomLevel));
</ins><span class="cx">
</span><span class="cx"> return inflatedRect;
</span><span class="cx"> }
</span><span class="lines">@@ -1433,12 +1433,12 @@
</span><span class="cx"> style->setLineHeight(RenderStyle::initialLineHeight());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void RenderThemeMac::setPopupButtonCellState(const RenderObject& o, const IntRect& r)
</del><ins>+void RenderThemeMac::setPopupButtonCellState(const RenderObject& o, const IntSize& buttonSize)
</ins><span class="cx"> {
</span><span class="cx"> NSPopUpButtonCell* popupButton = this->popupButton();
</span><span class="cx">
</span><span class="cx"> // Set the control size based off the rectangle we're painting into.
</span><del>- setControlSize(popupButton, popupButtonSizes(), r.size(), o.style().effectiveZoom());
</del><ins>+ setControlSize(popupButton, popupButtonSizes(), buttonSize, o.style().effectiveZoom());
</ins><span class="cx">
</span><span class="cx"> // Update the various states we respond to.
</span><span class="cx"> updateCheckedState(popupButton, o);
</span></span></pre>
</div>
</div>
</body>
</html>