+2007-03-06 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Adele.
+
+ <rdar://problem/4619663> REGRESSION (NativePopup): Popup menu doesn't draw at the correct vertical position (9816)
+
+ * platform/mac/PopupMenuMac.mm:
+ (WebCore::PopupMenu::show): Make a temporary dummy view with the
+ passed in rect, since AppKit will use the view bounds to determine
+ what area to exclude when popping up a menu moved to the top of
+ the screen.
+
2007-03-06 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
NSPoint location;
NSFont* font = client()->clientStyle()->font().primaryFont()->getNSFont();
-
+
// These values were borrowed from AppKit to match their placement of the menu.
const int popOverHorizontalAdjust = -10;
const int popUnderHorizontalAdjust = 6;
NSEvent* event = [frame->eventHandler()->currentNSEvent() retain];
RefPtr<PopupMenu> protector(this);
+
+ RetainPtr<NSView> dummyView(AdoptNS, [[NSView alloc] initWithFrame:r]);
+ [view addSubview:dummyView.get()];
+ location = [dummyView.get() convertPoint:location fromView:view];
frame->willPopupMenu(menu);
- wkPopupMenu(menu, location, roundf(NSWidth(r)), view, index, font);
+ wkPopupMenu(menu, location, roundf(NSWidth(r)), dummyView.get(), index, font);
+
+ [dummyView.get() removeFromSuperview];
if (client()) {
int newIndex = [m_popup.get() indexOfSelectedItem];