[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 16:11:55 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit d36eb0bdbfcf39ef92407345436ca2564303a62f
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 19 16:16:24 2010 +0000
2010-11-19 Sheriff Bot <webkit.review.bot at gmail.com>
Unreviewed, rolling out r72399.
http://trac.webkit.org/changeset/72399
https://bugs.webkit.org/show_bug.cgi?id=49805
Broke Chromium build (Requested by antonm_ on #webkit).
* page/chromium/ChromeClientChromium.h:
* platform/chromium/PopupMenuChromium.cpp:
(WebCore::PopupContainer::showPopup):
(WebCore::PopupContainer::showExternal):
(WebCore::PopupListBox::layout):
(WebCore::PopupMenuChromium::show):
* platform/chromium/PopupMenuChromium.h:
2010-11-19 Sheriff Bot <webkit.review.bot at gmail.com>
Unreviewed, rolling out r72399.
http://trac.webkit.org/changeset/72399
https://bugs.webkit.org/show_bug.cgi?id=49805
Broke Chromium build (Requested by antonm_ on #webkit).
* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::popupOpened):
* src/ChromeClientImpl.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72403 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 27d86ea..ef6e4d9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-11-19 Sheriff Bot <webkit.review.bot at gmail.com>
+
+ Unreviewed, rolling out r72399.
+ http://trac.webkit.org/changeset/72399
+ https://bugs.webkit.org/show_bug.cgi?id=49805
+
+ Broke Chromium build (Requested by antonm_ on #webkit).
+
+ * page/chromium/ChromeClientChromium.h:
+ * platform/chromium/PopupMenuChromium.cpp:
+ (WebCore::PopupContainer::showPopup):
+ (WebCore::PopupContainer::showExternal):
+ (WebCore::PopupListBox::layout):
+ (WebCore::PopupMenuChromium::show):
+ * platform/chromium/PopupMenuChromium.h:
+
2010-11-19 Yael Aharon <yael.aharon at nokia.com>
Reviewed by Antonio Gomes.
diff --git a/WebCore/page/chromium/ChromeClientChromium.h b/WebCore/page/chromium/ChromeClientChromium.h
index b518b3d..02e2a94 100644
--- a/WebCore/page/chromium/ChromeClientChromium.h
+++ b/WebCore/page/chromium/ChromeClientChromium.h
@@ -44,9 +44,11 @@ class ChromeClientChromium : public ChromeClient {
public:
// Notifies the client of a new popup widget. The client should place
// and size the widget with the given bounds, relative to the screen.
- virtual void popupOpened(PopupContainer* popupContainer,
- const IntRect& bounds) = 0;
-
+ // If handleExternal is true, then drawing and input handling for the
+ // popup will be handled by the external embedder.
+ virtual void popupOpened(PopupContainer* popupContainer, const IntRect& bounds,
+ bool handleExternal) = 0;
+
// Notifies the client a popup was closed.
virtual void popupClosed(PopupContainer* popupContainer) = 0;
};
diff --git a/WebCore/platform/chromium/PopupMenuChromium.cpp b/WebCore/platform/chromium/PopupMenuChromium.cpp
index 7a3024b..04eeb93 100644
--- a/WebCore/platform/chromium/PopupMenuChromium.cpp
+++ b/WebCore/platform/chromium/PopupMenuChromium.cpp
@@ -371,7 +371,7 @@ void PopupContainer::showPopup(FrameView* view)
widgetRect.move(0, -(widgetRect.height() + selectHeight));
}
}
- chromeClient->popupOpened(this, widgetRect);
+ chromeClient->popupOpened(this, widgetRect, false);
m_popupOpen = true;
}
@@ -387,6 +387,34 @@ void PopupContainer::showPopup(FrameView* view)
invalidate();
}
+void PopupContainer::showExternal(const IntRect& rect, FrameView* v, int index)
+{
+ if (!listBox())
+ return;
+
+ listBox()->setBaseWidth(rect.width());
+ listBox()->updateFromElement();
+
+ if (listBox()->numItems() < 1) {
+ hidePopup();
+ return;
+ }
+
+ // Adjust the popup position to account for scrolling.
+ IntPoint location = v->contentsToWindow(rect.location());
+ IntRect popupRect(location, rect.size());
+
+ // Get the ChromeClient and pass it the popup menu's listbox data.
+ m_frameView = v;
+ chromeClientChromium()->popupOpened(this, popupRect, true);
+
+ // The popup sends its "closed" notification through its parent. Set the
+ // parent, even though external popups have no real on-screen widget but a
+ // native menu (see |PopupListBox::hidePopup()|);
+ if (!m_listBox->parent())
+ addChild(m_listBox.get());
+}
+
void PopupContainer::hidePopup()
{
listBox()->hidePopup();
@@ -1268,14 +1296,27 @@ void PopupListBox::layout()
// Calculate scroll bar width.
int windowHeight = 0;
+#if OS(DARWIN)
+ // Set the popup's window to contain all available items on Mac only, which
+ // uses native controls that manage their own scrolling. This allows hit
+ // testing to work when selecting items in popups that have more menu entries
+ // than the maximum window size.
+ m_visibleRows = numItems();
+#else
m_visibleRows = min(numItems(), kMaxVisibleRows);
+#endif
for (int i = 0; i < m_visibleRows; ++i) {
int rowHeight = getRowHeight(i);
+
+#if !OS(DARWIN)
+ // Only clip the window height for non-Mac platforms.
if (windowHeight + rowHeight > m_maxHeight) {
m_visibleRows = i;
break;
}
+#endif
+
windowHeight += rowHeight;
}
@@ -1342,13 +1383,19 @@ PopupMenuChromium::~PopupMenuChromium()
hide();
}
+// The Mac Chromium implementation relies on external control (a Cocoa control)
+// to display, handle the input tracking and menu item selection for the popup.
// Windows and Linux Chromium let our WebKit port handle the display, while
// another process manages the popup window and input handling.
void PopupMenuChromium::show(const IntRect& r, FrameView* v, int index)
{
if (!p.popup)
p.popup = PopupContainer::create(client(), PopupContainer::Select, dropDownSettings);
+#if OS(DARWIN)
+ p.popup->showExternal(r, v, index);
+#else
p.popup->show(r, v, index);
+#endif
}
void PopupMenuChromium::hide()
diff --git a/WebCore/platform/chromium/PopupMenuChromium.h b/WebCore/platform/chromium/PopupMenuChromium.h
index 76665ff..ca47ccf 100644
--- a/WebCore/platform/chromium/PopupMenuChromium.h
+++ b/WebCore/platform/chromium/PopupMenuChromium.h
@@ -142,6 +142,9 @@ public:
// Show the popup
void showPopup(FrameView*);
+ // Used on Mac Chromium for HTML select popup menus.
+ void showExternal(const IntRect&, FrameView*, int index);
+
// Show the popup in the specified rect for the specified frame.
// Note: this code was somehow arbitrarily factored-out of the Popup class
// so WebViewImpl can create a PopupContainer. This method is used for
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 4a58f88..0c35b8e 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,15 @@
+2010-11-19 Sheriff Bot <webkit.review.bot at gmail.com>
+
+ Unreviewed, rolling out r72399.
+ http://trac.webkit.org/changeset/72399
+ https://bugs.webkit.org/show_bug.cgi?id=49805
+
+ Broke Chromium build (Requested by antonm_ on #webkit).
+
+ * src/ChromeClientImpl.cpp:
+ (WebKit::ChromeClientImpl::popupOpened):
+ * src/ChromeClientImpl.h:
+
2010-11-19 Jay Civelli <jcivelli at chromium.org>
Reviewed by David Levin.
diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp
index 9e9fc41..c43a0b0 100644
--- a/WebKit/chromium/src/ChromeClientImpl.cpp
+++ b/WebKit/chromium/src/ChromeClientImpl.cpp
@@ -678,14 +678,25 @@ void ChromeClientImpl::chooseIconForFiles(const Vector<WTF::String>&, WebCore::F
}
void ChromeClientImpl::popupOpened(PopupContainer* popupContainer,
- const IntRect& bounds)
+ const IntRect& bounds,
+ bool handleExternally)
{
if (!m_webView->client())
return;
- WebWidget* webwidget = m_webView->client()->createPopupMenu(
- convertPopupType(popupContainer->popupType()));
- m_webView->popupOpened(popupContainer);
+ WebWidget* webwidget;
+ if (handleExternally) {
+ WebPopupMenuInfo popupInfo;
+ getPopupMenuInfo(popupContainer, &popupInfo);
+ webwidget = m_webView->client()->createPopupMenu(popupInfo);
+ } else {
+ webwidget = m_webView->client()->createPopupMenu(
+ convertPopupType(popupContainer->popupType()));
+ // We only notify when the WebView has to handle the popup, as when
+ // the popup is handled externally, the fact that a popup is showing is
+ // transparent to the WebView.
+ m_webView->popupOpened(popupContainer);
+ }
static_cast<WebPopupMenuImpl*>(webwidget)->Init(popupContainer, bounds);
}
diff --git a/WebKit/chromium/src/ChromeClientImpl.h b/WebKit/chromium/src/ChromeClientImpl.h
index fde46df..87c1653 100644
--- a/WebKit/chromium/src/ChromeClientImpl.h
+++ b/WebKit/chromium/src/ChromeClientImpl.h
@@ -162,7 +162,8 @@ public:
// ChromeClientChromium methods:
virtual void popupOpened(WebCore::PopupContainer* popupContainer,
- const WebCore::IntRect& bounds);
+ const WebCore::IntRect& bounds,
+ bool handleExternally);
virtual void popupClosed(WebCore::PopupContainer* popupContainer);
virtual void postAccessibilityNotification(WebCore::AccessibilityObject*, WebCore::AXObjectCache::AXNotification);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list