Title: [114336] trunk/Source/WebKit/chromium
- Revision
- 114336
- Author
- [email protected]
- Date
- 2012-04-16 20:42:46 -0700 (Mon, 16 Apr 2012)
Log Message
[Chromium] Move popup location detection code from WebViewImpl to WebPagePopupImpl
https://bugs.webkit.org/show_bug.cgi?id=84116
Reviewed by Kentaro Hara.
This makes no behavior change. Just move some code.
To fix Bug 84007, WebPagePopupImpl needs to know if the popup is
above the target element or below the target element.
* src/WebPagePopupImpl.cpp:
(WebKit::WebPagePopupImpl::init): Move some code from WebViewImpl::openPagePopup().
* src/WebPagePopupImpl.h:
(WebPagePopupImpl): Rename an argument name.
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::openPagePopup): Move some code to WebPagePopupImpl::init().
Modified Paths
Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (114335 => 114336)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-04-17 03:04:11 UTC (rev 114335)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-04-17 03:42:46 UTC (rev 114336)
@@ -1,3 +1,21 @@
+2012-04-16 Kent Tamura <[email protected]>
+
+ [Chromium] Move popup location detection code from WebViewImpl to WebPagePopupImpl
+ https://bugs.webkit.org/show_bug.cgi?id=84116
+
+ Reviewed by Kentaro Hara.
+
+ This makes no behavior change. Just move some code.
+ To fix Bug 84007, WebPagePopupImpl needs to know if the popup is
+ above the target element or below the target element.
+
+ * src/WebPagePopupImpl.cpp:
+ (WebKit::WebPagePopupImpl::init): Move some code from WebViewImpl::openPagePopup().
+ * src/WebPagePopupImpl.h:
+ (WebPagePopupImpl): Rename an argument name.
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::openPagePopup): Move some code to WebPagePopupImpl::init().
+
2012-04-13 James Robinson <[email protected]>
[chromium] Expose WebVideoLayer to Platform API and port WebMediaPlayerClientImpl to using it
Modified: trunk/Source/WebKit/chromium/src/WebPagePopupImpl.cpp (114335 => 114336)
--- trunk/Source/WebKit/chromium/src/WebPagePopupImpl.cpp 2012-04-17 03:04:11 UTC (rev 114335)
+++ trunk/Source/WebKit/chromium/src/WebPagePopupImpl.cpp 2012-04-17 03:42:46 UTC (rev 114336)
@@ -31,6 +31,7 @@
#include "config.h"
#include "WebPagePopupImpl.h"
+#include "Chrome.h"
#include "EmptyClients.h"
#include "FileChooser.h"
#include "FocusController.h"
@@ -44,9 +45,11 @@
#include "WebInputEvent.h"
#include "WebInputEventConversion.h"
#include "WebPagePopup.h"
+#include "WebViewImpl.h"
#include "WebWidgetClient.h"
using namespace WebCore;
+using namespace std;
namespace WebKit {
@@ -133,13 +136,22 @@
ASSERT(!m_page);
}
-bool WebPagePopupImpl::init(WebViewImpl* webView, PagePopupClient* popupClient, const IntRect& boundsInScreen)
+bool WebPagePopupImpl::init(WebViewImpl* webView, PagePopupClient* popupClient, const IntRect& originBoundsInRootView)
{
ASSERT(webView);
ASSERT(popupClient);
m_webView = webView;
m_popupClient = popupClient;
+ WebSize rootViewSize = webView->size();
+ IntSize popupSize = popupClient->contentSize();
+ IntRect popupBoundsInRootView(IntPoint(max(0, originBoundsInRootView.x()), max(0, originBoundsInRootView.maxY())), popupSize);
+ if (popupBoundsInRootView.maxY() > rootViewSize.height)
+ popupBoundsInRootView.setY(max(0, originBoundsInRootView.y() - popupSize.height()));
+ if (popupBoundsInRootView.maxX() > rootViewSize.width)
+ popupBoundsInRootView.setX(max(0, rootViewSize.width - popupSize.width()));
+ IntRect boundsInScreen = webView->page()->chrome()->rootViewToScreen(popupBoundsInRootView);
+
m_widgetClient->setWindowRect(boundsInScreen);
m_windowRectInScreen = boundsInScreen;
if (!initPage())
Modified: trunk/Source/WebKit/chromium/src/WebPagePopupImpl.h (114335 => 114336)
--- trunk/Source/WebKit/chromium/src/WebPagePopupImpl.h 2012-04-17 03:04:11 UTC (rev 114335)
+++ trunk/Source/WebKit/chromium/src/WebPagePopupImpl.h 2012-04-17 03:42:46 UTC (rev 114336)
@@ -56,7 +56,7 @@
WTF_MAKE_FAST_ALLOCATED;
public:
- bool init(WebViewImpl*, WebCore::PagePopupClient*, const WebCore::IntRect& boundsInScreen);
+ bool init(WebViewImpl*, WebCore::PagePopupClient*, const WebCore::IntRect& originBoundsInRootView);
bool handleKeyEvent(const WebCore::PlatformKeyboardEvent&);
void closePopup();
WebWidgetClient* widgetClient() const { return m_widgetClient; }
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (114335 => 114336)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2012-04-17 03:04:11 UTC (rev 114335)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2012-04-17 03:42:46 UTC (rev 114336)
@@ -1207,14 +1207,7 @@
WebWidget* popupWidget = m_client->createPopupMenu(WebPopupTypePage);
ASSERT(popupWidget);
m_pagePopup = static_cast<WebPagePopupImpl*>(popupWidget);
- WebSize rootViewSize = size();
- IntSize popupSize = client->contentSize();
- IntRect popupBoundsInRootView(IntPoint(max(0, originBoundsInRootView.x()), max(0, originBoundsInRootView.maxY())), popupSize);
- if (popupBoundsInRootView.maxY() > rootViewSize.height)
- popupBoundsInRootView.setY(max(0, originBoundsInRootView.y() - popupSize.height()));
- if (popupBoundsInRootView.maxX() > rootViewSize.width)
- popupBoundsInRootView.setX(max(0, rootViewSize.width - popupSize.width()));
- if (!m_pagePopup->init(this, client, m_chromeClientImpl.rootViewToScreen(popupBoundsInRootView))) {
+ if (!m_pagePopup->init(this, client, originBoundsInRootView)) {
m_pagePopup->closePopup();
m_pagePopup = 0;
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes