<!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>[169134] trunk/Source</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/169134">169134</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2014-05-20 14:03:54 -0700 (Tue, 20 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Mac] Allow popup menus to override default appearance
https://bugs.webkit.org/show_bug.cgi?id=133129

Reviewed by Tim Horton.

Source/WebCore:
WebKitSystemInterface's WKPopupMenu has a flag to hide
the arrows at the end of a popup-menu (e.g. &lt;select&gt;).
Expose that via adding a hasDefaultAppearance flag to
PopupMenuStyle, which then passes it on to WKSI.

* platform/PopupMenuStyle.h:
(WebCore::PopupMenuStyle::PopupMenuStyle): New flag in constructor.
(WebCore::PopupMenuStyle::hasDefaultAppearance): New flag.
* platform/mac/WebCoreSystemInterface.h: wkPopupMenu signature has changed to accept
the new flag.
* platform/mac/WebCoreSystemInterface.mm: Ditto.
* rendering/RenderMenuList.cpp:
(RenderMenuList::itemStyle): Pass in true as default appearance when creating
the PopupMenuStyle. We don't need it.
(RenderMenuList::menuStyle): In this case we pass in the negated value of
style().hasAppearance(), which indicates if we are overriding the built-in drawing.
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::menuStyle): Use true as the default value.

Source/WebKit/mac:
Replace the call to wkPopupMenuWithSize with wkPopupMenu, now
with extra parameters to indicate the control size and whether
or not to draw the arrows at the end.

* WebCoreSupport/PopupMenuMac.mm:
(PopupMenuMac::show):

Source/WebKit2:
Add an extra &quot;hideArrows&quot; flag to PlatformPopupMenuData
and replace the call to WKPopupMenuWithSize with WKPopupMenu.

* Shared/PlatformPopupMenuData.cpp: Encode and decode the new data value.
(WebKit::PlatformPopupMenuData::encode):
(WebKit::PlatformPopupMenuData::decode):
* Shared/PlatformPopupMenuData.h: Add hideArrows boolean.
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::showPopupMenu):
* WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
(WebKit::WebPopupMenu::setUpPlatformData): The hideArrows flag is
true if we don't have the default appearance.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformPopupMenuStyleh">trunk/Source/WebCore/platform/PopupMenuStyle.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebCoreSystemInterfaceh">trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebCoreSystemInterfacemm">trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderMenuListcpp">trunk/Source/WebCore/rendering/RenderMenuList.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderSearchFieldcpp">trunk/Source/WebCore/rendering/RenderSearchField.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportPopupMenuMacmm">trunk/Source/WebKit/mac/WebCoreSupport/PopupMenuMac.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedPlatformPopupMenuDatacpp">trunk/Source/WebKit2/Shared/PlatformPopupMenuData.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedPlatformPopupMenuDatah">trunk/Source/WebKit2/Shared/PlatformPopupMenuData.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWebPopupMenuProxyMacmm">trunk/Source/WebKit2/UIProcess/mac/WebPopupMenuProxyMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportmacWebPopupMenuMacmm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (169133 => 169134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-05-20 20:59:58 UTC (rev 169133)
+++ trunk/Source/WebCore/ChangeLog        2014-05-20 21:03:54 UTC (rev 169134)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2014-05-20  Dean Jackson  &lt;dino@apple.com&gt;
+
+        [Mac] Allow popup menus to override default appearance
+        https://bugs.webkit.org/show_bug.cgi?id=133129
+
+        Reviewed by Tim Horton.
+
+        WebKitSystemInterface's WKPopupMenu has a flag to hide
+        the arrows at the end of a popup-menu (e.g. &lt;select&gt;).
+        Expose that via adding a hasDefaultAppearance flag to
+        PopupMenuStyle, which then passes it on to WKSI.
+
+        * platform/PopupMenuStyle.h:
+        (WebCore::PopupMenuStyle::PopupMenuStyle): New flag in constructor.
+        (WebCore::PopupMenuStyle::hasDefaultAppearance): New flag.
+        * platform/mac/WebCoreSystemInterface.h: wkPopupMenu signature has changed to accept
+        the new flag.
+        * platform/mac/WebCoreSystemInterface.mm: Ditto.
+        * rendering/RenderMenuList.cpp:
+        (RenderMenuList::itemStyle): Pass in true as default appearance when creating
+        the PopupMenuStyle. We don't need it.
+        (RenderMenuList::menuStyle): In this case we pass in the negated value of
+        style().hasAppearance(), which indicates if we are overriding the built-in drawing.
+        * rendering/RenderSearchField.cpp:
+        (WebCore::RenderSearchField::menuStyle): Use true as the default value.
+
</ins><span class="cx"> 2014-05-20  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac] do not deactivate an audio session that has running I/O
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformPopupMenuStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/PopupMenuStyle.h (169133 => 169134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/PopupMenuStyle.h        2014-05-20 20:59:58 UTC (rev 169133)
+++ trunk/Source/WebCore/platform/PopupMenuStyle.h        2014-05-20 21:03:54 UTC (rev 169134)
</span><span class="lines">@@ -43,12 +43,13 @@
</span><span class="cx">         PopupMenuSizeMini
</span><span class="cx">     };
</span><span class="cx"> 
</span><del>-    PopupMenuStyle(const Color&amp; foreground, const Color&amp; background, const Font&amp; font, bool visible, bool isDisplayNone, Length textIndent, TextDirection textDirection, bool hasTextDirectionOverride, BackgroundColorType backgroundColorType = DefaultBackgroundColor, PopupMenuType menuType = SelectPopup, PopupMenuSize menuSize = PopupMenuSizeNormal)
</del><ins>+    PopupMenuStyle(const Color&amp; foreground, const Color&amp; background, const Font&amp; font, bool visible, bool isDisplayNone, bool hasDefaultAppearance, Length textIndent, TextDirection textDirection, bool hasTextDirectionOverride, BackgroundColorType backgroundColorType = DefaultBackgroundColor, PopupMenuType menuType = SelectPopup, PopupMenuSize menuSize = PopupMenuSizeNormal)
</ins><span class="cx">         : m_foregroundColor(foreground)
</span><span class="cx">         , m_backgroundColor(background)
</span><span class="cx">         , m_font(font)
</span><span class="cx">         , m_visible(visible)
</span><span class="cx">         , m_isDisplayNone(isDisplayNone)
</span><ins>+        , m_hasDefaultAppearance(hasDefaultAppearance)
</ins><span class="cx">         , m_textIndent(textIndent)
</span><span class="cx">         , m_textDirection(textDirection)
</span><span class="cx">         , m_hasTextDirectionOverride(hasTextDirectionOverride)
</span><span class="lines">@@ -63,6 +64,7 @@
</span><span class="cx">     const Font&amp; font() const { return m_font; }
</span><span class="cx">     bool isVisible() const { return m_visible; }
</span><span class="cx">     bool isDisplayNone() const { return m_isDisplayNone; }
</span><ins>+    bool hasDefaultAppearance() const { return m_hasDefaultAppearance; }
</ins><span class="cx">     Length textIndent() const { return m_textIndent; }
</span><span class="cx">     TextDirection textDirection() const { return m_textDirection; }
</span><span class="cx">     bool hasTextDirectionOverride() const { return m_hasTextDirectionOverride; }
</span><span class="lines">@@ -76,6 +78,7 @@
</span><span class="cx">     Font m_font;
</span><span class="cx">     bool m_visible;
</span><span class="cx">     bool m_isDisplayNone;
</span><ins>+    bool m_hasDefaultAppearance;
</ins><span class="cx">     Length m_textIndent;
</span><span class="cx">     TextDirection m_textDirection;
</span><span class="cx">     bool m_hasTextDirectionOverride;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebCoreSystemInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h (169133 => 169134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h        2014-05-20 20:59:58 UTC (rev 169133)
+++ trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h        2014-05-20 21:03:54 UTC (rev 169134)
</span><span class="lines">@@ -202,8 +202,8 @@
</span><span class="cx"> extern void (*wkWindowSetAlpha)(NSWindow *, float);
</span><span class="cx"> extern void (*wkWindowSetScaledFrame)(NSWindow *, NSRect, NSRect);
</span><span class="cx"> 
</span><del>-extern void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
</del><span class="cx"> #if defined(__OBJC__)
</span><ins>+extern void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*, NSControlSize controlSize, bool hideArrows);
</ins><span class="cx"> extern void (*wkPopupMenuWithSize)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*, NSControlSize controlSize);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebCoreSystemInterfacemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm (169133 => 169134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm        2014-05-20 20:59:58 UTC (rev 169133)
+++ trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm        2014-05-20 21:03:54 UTC (rev 169134)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx"> BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
</span><span class="cx"> void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
</span><span class="cx"> UInt8 (*wkGetNSEventKeyChar)(NSEvent *);
</span><del>-void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
</del><ins>+void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*, NSControlSize controlSize, bool hideArrows);
</ins><span class="cx"> void (*wkPopupMenuWithSize)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*, NSControlSize controlSize);
</span><span class="cx"> unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
</span><span class="cx"> int (*wkQTMovieDataRate)(QTMovie*);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderMenuListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderMenuList.cpp (169133 => 169134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderMenuList.cpp        2014-05-20 20:59:58 UTC (rev 169133)
+++ trunk/Source/WebCore/rendering/RenderMenuList.cpp        2014-05-20 21:03:54 UTC (rev 169134)
</span><span class="lines">@@ -522,7 +522,7 @@
</span><span class="cx"> 
</span><span class="cx">     RenderStyle* style = element-&gt;renderStyle() ? element-&gt;renderStyle() : element-&gt;computedStyle();
</span><span class="cx">     return style ? PopupMenuStyle(style-&gt;visitedDependentColor(CSSPropertyColor), itemBackgroundColor, style-&gt;font(), style-&gt;visibility() == VISIBLE,
</span><del>-        style-&gt;display() == NONE, style-&gt;textIndent(), style-&gt;direction(), isOverride(style-&gt;unicodeBidi()),
</del><ins>+        style-&gt;display() == NONE, true, style-&gt;textIndent(), style-&gt;direction(), isOverride(style-&gt;unicodeBidi()),
</ins><span class="cx">         itemHasCustomBackgroundColor ? PopupMenuStyle::CustomBackgroundColor : PopupMenuStyle::DefaultBackgroundColor) : menuStyle();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -562,7 +562,7 @@
</span><span class="cx">     const RenderStyle&amp; styleToUse = m_innerBlock ? m_innerBlock-&gt;style() : style();
</span><span class="cx">     IntRect absBounds = absoluteBoundingBoxRectIgnoringTransforms();
</span><span class="cx">     return PopupMenuStyle(styleToUse.visitedDependentColor(CSSPropertyColor), styleToUse.visitedDependentColor(CSSPropertyBackgroundColor),
</span><del>-        styleToUse.font(), styleToUse.visibility() == VISIBLE, styleToUse.display() == NONE, styleToUse.textIndent(),
</del><ins>+        styleToUse.font(), styleToUse.visibility() == VISIBLE, styleToUse.display() == NONE, style().hasAppearance(), styleToUse.textIndent(),
</ins><span class="cx">         style().direction(), isOverride(style().unicodeBidi()), PopupMenuStyle::DefaultBackgroundColor,
</span><span class="cx">         PopupMenuStyle::SelectPopup, theme().popupMenuSize(&amp;styleToUse, absBounds));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderSearchFieldcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderSearchField.cpp (169133 => 169134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderSearchField.cpp        2014-05-20 20:59:58 UTC (rev 169133)
+++ trunk/Source/WebCore/rendering/RenderSearchField.cpp        2014-05-20 21:03:54 UTC (rev 169134)
</span><span class="lines">@@ -261,7 +261,7 @@
</span><span class="cx"> PopupMenuStyle RenderSearchField::menuStyle() const
</span><span class="cx"> {
</span><span class="cx">     return PopupMenuStyle(style().visitedDependentColor(CSSPropertyColor), style().visitedDependentColor(CSSPropertyBackgroundColor), style().font(), style().visibility() == VISIBLE,
</span><del>-        style().display() == NONE, style().textIndent(), style().direction(), isOverride(style().unicodeBidi()), PopupMenuStyle::CustomBackgroundColor);
</del><ins>+        style().display() == NONE, true, style().textIndent(), style().direction(), isOverride(style().unicodeBidi()), PopupMenuStyle::CustomBackgroundColor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int RenderSearchField::clientInsetLeft() const
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (169133 => 169134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-05-20 20:59:58 UTC (rev 169133)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-05-20 21:03:54 UTC (rev 169134)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-05-20  Dean Jackson  &lt;dino@apple.com&gt;
+
+        [Mac] Allow popup menus to override default appearance
+        https://bugs.webkit.org/show_bug.cgi?id=133129
+
+        Reviewed by Tim Horton.
+
+        Replace the call to wkPopupMenuWithSize with wkPopupMenu, now
+        with extra parameters to indicate the control size and whether
+        or not to draw the arrows at the end.
+
+        * WebCoreSupport/PopupMenuMac.mm:
+        (PopupMenuMac::show):
+
</ins><span class="cx"> 2014-05-20  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac] do not deactivate an audio session that has running I/O
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportPopupMenuMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/PopupMenuMac.mm (169133 => 169134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/PopupMenuMac.mm        2014-05-20 20:59:58 UTC (rev 169133)
+++ trunk/Source/WebKit/mac/WebCoreSupport/PopupMenuMac.mm        2014-05-20 21:03:54 UTC (rev 169134)
</span><span class="lines">@@ -204,7 +204,7 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    wkPopupMenuWithSize(menu, location, roundf(NSWidth(r)), dummyView.get(), index, font, controlSize);
</del><ins>+    wkPopupMenu(menu, location, roundf(NSWidth(r)), dummyView.get(), index, font, controlSize, !m_client-&gt;menuStyle().hasDefaultAppearance());
</ins><span class="cx"> 
</span><span class="cx">     [m_popup dismissPopUp];
</span><span class="cx">     [dummyView removeFromSuperview];
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (169133 => 169134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-05-20 20:59:58 UTC (rev 169133)
+++ trunk/Source/WebKit2/ChangeLog        2014-05-20 21:03:54 UTC (rev 169134)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2014-05-20  Dean Jackson  &lt;dino@apple.com&gt;
+
+        [Mac] Allow popup menus to override default appearance
+        https://bugs.webkit.org/show_bug.cgi?id=133129
+
+        Reviewed by Tim Horton.
+
+        Add an extra &quot;hideArrows&quot; flag to PlatformPopupMenuData
+        and replace the call to WKPopupMenuWithSize with WKPopupMenu.
+
+        * Shared/PlatformPopupMenuData.cpp: Encode and decode the new data value.
+        (WebKit::PlatformPopupMenuData::encode):
+        (WebKit::PlatformPopupMenuData::decode):
+        * Shared/PlatformPopupMenuData.h: Add hideArrows boolean.
+        * UIProcess/mac/WebPopupMenuProxyMac.mm:
+        (WebKit::WebPopupMenuProxyMac::showPopupMenu):
+        * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
+        (WebKit::WebPopupMenu::setUpPlatformData): The hideArrows flag is
+        true if we don't have the default appearance.
+
</ins><span class="cx"> 2014-05-20  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac] do not deactivate an audio session that has running I/O
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedPlatformPopupMenuDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/PlatformPopupMenuData.cpp (169133 => 169134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/PlatformPopupMenuData.cpp        2014-05-20 20:59:58 UTC (rev 169133)
+++ trunk/Source/WebKit2/Shared/PlatformPopupMenuData.cpp        2014-05-20 21:03:54 UTC (rev 169134)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     encoder &lt;&lt; fontInfo;
</span><span class="cx">     encoder &lt;&lt; shouldPopOver;
</span><ins>+    encoder &lt;&lt; hideArrows;
</ins><span class="cx">     encoder.encodeEnum(menuSize);
</span><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(encoder);
</span><span class="lines">@@ -52,6 +53,8 @@
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(data.shouldPopOver))
</span><span class="cx">         return false;
</span><ins>+    if (!decoder.decode(data.hideArrows))
+        return false;
</ins><span class="cx">     if (!decoder.decodeEnum(data.menuSize))
</span><span class="cx">         return false;
</span><span class="cx"> #else
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedPlatformPopupMenuDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/PlatformPopupMenuData.h (169133 => 169134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/PlatformPopupMenuData.h        2014-05-20 20:59:58 UTC (rev 169133)
+++ trunk/Source/WebKit2/Shared/PlatformPopupMenuData.h        2014-05-20 21:03:54 UTC (rev 169134)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     FontInfo fontInfo;
</span><span class="cx">     bool shouldPopOver;
</span><ins>+    bool hideArrows;
</ins><span class="cx">     WebCore::PopupMenuStyle::PopupMenuSize menuSize;
</span><span class="cx"> #endif
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWebPopupMenuProxyMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WebPopupMenuProxyMac.mm (169133 => 169134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WebPopupMenuProxyMac.mm        2014-05-20 20:59:58 UTC (rev 169133)
+++ trunk/Source/WebKit2/UIProcess/mac/WebPopupMenuProxyMac.mm        2014-05-20 21:03:54 UTC (rev 169134)
</span><span class="lines">@@ -147,7 +147,7 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    WKPopupMenuWithSize(menu, location, roundf(NSWidth(rect)), dummyView.get(), selectedIndex, font, controlSize);
</del><ins>+    WKPopupMenu(menu, location, roundf(NSWidth(rect)), dummyView.get(), selectedIndex, font, controlSize, data.hideArrows);
</ins><span class="cx"> 
</span><span class="cx">     [m_popup dismissPopUp];
</span><span class="cx">     [dummyView removeFromSuperview];
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportmacWebPopupMenuMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm (169133 => 169134)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm        2014-05-20 20:59:58 UTC (rev 169133)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm        2014-05-20 21:03:54 UTC (rev 169134)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx">     
</span><span class="cx">     data.fontInfo.fontAttributeDictionary = fontDescriptorAttributes;
</span><span class="cx">     data.shouldPopOver = m_popupClient-&gt;shouldPopOver();
</span><ins>+    data.hideArrows = !m_popupClient-&gt;menuStyle().hasDefaultAppearance();
</ins><span class="cx">     data.menuSize = m_popupClient-&gt;menuStyle().menuSize();
</span><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(data);
</span></span></pre>
</div>
</div>

</body>
</html>