- Revision
- 174485
- Author
- [email protected]
- Date
- 2014-10-08 17:12:55 -0700 (Wed, 08 Oct 2014)
Log Message
PopupMenus should indicate if they are using a custom rendering
https://bugs.webkit.org/show_bug.cgi?id=137543
<rdar://problem/18544212>
Reviewed by Beth Dakin.
On Yosemite there is an animation as a popup menu closes. We can't use
this when there is a custom rendering, since the animation doesn't match
the final result. Implement this by hooking into the existing code
for hiding the arrows during animation - a WebKitSystemInterface update
will implement the other side.
* platform/mac/WebCoreSystemInterface.h: Rename parameter to be more clear.
* platform/mac/WebCoreSystemInterface.mm:
* rendering/RenderMenuList.cpp:
(RenderMenuList::menuStyle): We need to check that we are a native-looking
button, not just something with appearance.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (174484 => 174485)
--- trunk/Source/WebCore/ChangeLog 2014-10-09 00:08:47 UTC (rev 174484)
+++ trunk/Source/WebCore/ChangeLog 2014-10-09 00:12:55 UTC (rev 174485)
@@ -1,3 +1,23 @@
+2014-10-08 Dean Jackson <[email protected]>
+
+ PopupMenus should indicate if they are using a custom rendering
+ https://bugs.webkit.org/show_bug.cgi?id=137543
+ <rdar://problem/18544212>
+
+ Reviewed by Beth Dakin.
+
+ On Yosemite there is an animation as a popup menu closes. We can't use
+ this when there is a custom rendering, since the animation doesn't match
+ the final result. Implement this by hooking into the existing code
+ for hiding the arrows during animation - a WebKitSystemInterface update
+ will implement the other side.
+
+ * platform/mac/WebCoreSystemInterface.h: Rename parameter to be more clear.
+ * platform/mac/WebCoreSystemInterface.mm:
+ * rendering/RenderMenuList.cpp:
+ (RenderMenuList::menuStyle): We need to check that we are a native-looking
+ button, not just something with appearance.
+
2014-10-08 Christophe Dumez <[email protected]>
Use is<>() / downcast<>() for RenderBlock objects
Modified: trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h (174484 => 174485)
--- trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h 2014-10-09 00:08:47 UTC (rev 174484)
+++ trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h 2014-10-09 00:12:55 UTC (rev 174485)
@@ -187,7 +187,7 @@
extern void (*wkWindowSetScaledFrame)(NSWindow *, NSRect, NSRect);
#if defined(__OBJC__)
-extern void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*, NSControlSize controlSize, bool hideArrows);
+extern void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*, NSControlSize controlSize, bool usesCustomAppearance);
#endif
extern unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
Modified: trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm (174484 => 174485)
--- trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm 2014-10-09 00:08:47 UTC (rev 174484)
+++ trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm 2014-10-09 00:12:55 UTC (rev 174485)
@@ -62,7 +62,7 @@
BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
UInt8 (*wkGetNSEventKeyChar)(NSEvent *);
-void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*, NSControlSize controlSize, bool hideArrows);
+void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*, NSControlSize controlSize, bool usesCustomAppearance);
unsigned (*wkQTIncludeOnlyModernMediaFileTypes)(void);
void (*wkQTMovieDisableComponent)(uint32_t[5]);
float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
Modified: trunk/Source/WebCore/rendering/RenderMenuList.cpp (174484 => 174485)
--- trunk/Source/WebCore/rendering/RenderMenuList.cpp 2014-10-09 00:08:47 UTC (rev 174484)
+++ trunk/Source/WebCore/rendering/RenderMenuList.cpp 2014-10-09 00:12:55 UTC (rev 174485)
@@ -567,7 +567,8 @@
const RenderStyle& styleToUse = m_innerBlock ? m_innerBlock->style() : style();
IntRect absBounds = absoluteBoundingBoxRectIgnoringTransforms();
return PopupMenuStyle(styleToUse.visitedDependentColor(CSSPropertyColor), styleToUse.visitedDependentColor(CSSPropertyBackgroundColor),
- styleToUse.font(), styleToUse.visibility() == VISIBLE, styleToUse.display() == NONE, style().hasAppearance(), styleToUse.textIndent(),
+ styleToUse.font(), styleToUse.visibility() == VISIBLE, styleToUse.display() == NONE,
+ style().hasAppearance() && style().appearance() == MenulistPart, styleToUse.textIndent(),
style().direction(), isOverride(style().unicodeBidi()), PopupMenuStyle::DefaultBackgroundColor,
PopupMenuStyle::SelectPopup, theme().popupMenuSize(styleToUse, absBounds));
}