[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

jhoneycutt at apple.com jhoneycutt at apple.com
Wed Dec 22 18:28:12 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 1ce7a1f1699c8dd6ae72ae9b6a7c72c8e1cb6c7e
Author: jhoneycutt at apple.com <jhoneycutt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Dec 11 12:36:14 2010 +0000

    Select menus with short option titles do not paint properly
    https://bugs.webkit.org/show_bug.cgi?id=50860
    <rdar://problem/8660807>
    
    The backing stores used for painting the popup menu items were only as
    wide as the widest option title, but the popup window that we create is
    at least as wide as the <select> element. This adjusts the backing
    stores to be at least as wide as the <select>, as well.
    
    Reviewed by Sam Weinig.
    
    * UIProcess/win/WebPopupMenuProxyWin.cpp:
    (WebKit::WebPopupMenuProxyWin::paint):
    Paint using the width of the backing store.
    
    * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
    (WebKit::WebPopupMenu::show):
    Pass the page coordinates of the <select> element to
    setUpPlatformData().
    
    * WebProcess/WebCoreSupport/WebPopupMenu.h:
    Added new parameter to setUpPlatformData().
    
    * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
    (WebKit::WebPopupMenu::setUpPlatformData):
    Ditto.
    
    * WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp:
    (WebKit::WebPopupMenu::setUpPlatformData):
    Ditto.
    
    * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
    (WebKit::WebPopupMenu::setUpPlatformData):
    Fixed a typo in a comment. Adjust the backing store size to be at least
    as wide as the <select> element, and use that width when painting the
    items to the backing store.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73852 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 9762632..1908047 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,42 @@
+2010-12-10  Jon Honeycutt  <jhoneycutt at apple.com>
+
+        Select menus with short option titles do not paint properly
+        https://bugs.webkit.org/show_bug.cgi?id=50860
+        <rdar://problem/8660807>
+
+        The backing stores used for painting the popup menu items were only as
+        wide as the widest option title, but the popup window that we create is
+        at least as wide as the <select> element. This adjusts the backing
+        stores to be at least as wide as the <select>, as well.
+
+        Reviewed by Sam Weinig.
+
+        * UIProcess/win/WebPopupMenuProxyWin.cpp:
+        (WebKit::WebPopupMenuProxyWin::paint):
+        Paint using the width of the backing store.
+
+        * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
+        (WebKit::WebPopupMenu::show):
+        Pass the page coordinates of the <select> element to
+        setUpPlatformData().
+
+        * WebProcess/WebCoreSupport/WebPopupMenu.h:
+        Added new parameter to setUpPlatformData().
+
+        * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
+        (WebKit::WebPopupMenu::setUpPlatformData):
+        Ditto.
+
+        * WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp:
+        (WebKit::WebPopupMenu::setUpPlatformData):
+        Ditto.
+
+        * WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp:
+        (WebKit::WebPopupMenu::setUpPlatformData):
+        Fixed a typo in a comment. Adjust the backing store size to be at least
+        as wide as the <select> element, and use that width when painting the
+        items to the backing store.
+
 2010-12-11  Csaba Osztrogonác  <ossy at webkit.org>
 
         Unreviewed Qt buildfix after r73808.
diff --git a/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp b/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp
index 601100a..76d40d8 100644
--- a/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp
+++ b/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp
@@ -816,7 +816,7 @@ void WebPopupMenuProxyWin::paint(const IntRect& damageRect, HDC hdc)
     translatedDamageRect.move(IntSize(0, m_scrollOffset * m_itemHeight));
     m_data.m_notSelectedBackingStore->paint(context, damageRect.location(), translatedDamageRect);
 
-    IntRect selectedIndexRectInBackingStore(0, focusedIndex() * m_itemHeight, m_data.m_popupWidth, m_itemHeight);
+    IntRect selectedIndexRectInBackingStore(0, focusedIndex() * m_itemHeight, m_data.m_selectedBackingStore->size().width(), m_itemHeight);
     IntPoint selectedIndexDstPoint = selectedIndexRectInBackingStore.location();
     selectedIndexDstPoint.move(0, -m_scrollOffset * m_itemHeight);
 
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.cpp b/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.cpp
index 49a5a31..782c549 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.cpp
@@ -100,7 +100,7 @@ void WebPopupMenu::show(const IntRect& rect, FrameView* view, int index)
     IntRect pageCoordinates(view->contentsToWindow(rect.location()), rect.size());
 
     PlatformPopupMenuData platformData;
-    setUpPlatformData(platformData);
+    setUpPlatformData(pageCoordinates, platformData);
 
     WebProcess::shared().connection()->send(Messages::WebPageProxy::ShowPopupMenu(pageCoordinates, items, index, platformData), m_page->pageID());
 }
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.h b/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.h
index c3ff1ca..d1e7a97 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.h
+++ b/WebKit2/WebProcess/WebCoreSupport/WebPopupMenu.h
@@ -55,7 +55,7 @@ private:
     WebPopupMenu(WebPage*, WebCore::PopupMenuClient*);
 
     Vector<WebPopupItem> populateItems();
-    void setUpPlatformData(PlatformPopupMenuData&);
+    void setUpPlatformData(const WebCore::IntRect& pageCoordinates, PlatformPopupMenuData&);
 
     WebCore::PopupMenuClient* m_popupClient;
     WebPage* m_page;
diff --git a/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm b/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm
index 9d6c520..4d3d167 100644
--- a/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm
+++ b/WebKit2/WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm
@@ -27,9 +27,11 @@
 
 #include "PlatformPopupMenuData.h"
 
+using namespace WebCore;
+
 namespace WebKit {
 
-void WebPopupMenu::setUpPlatformData(PlatformPopupMenuData&)
+void WebPopupMenu::setUpPlatformData(const IntRect&, PlatformPopupMenuData&)
 {
 }
 
diff --git a/WebKit2/WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp b/WebKit2/WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp
index 9d6c520..4d3d167 100644
--- a/WebKit2/WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/qt/WebPopupMenuQt.cpp
@@ -27,9 +27,11 @@
 
 #include "PlatformPopupMenuData.h"
 
+using namespace WebCore;
+
 namespace WebKit {
 
-void WebPopupMenu::setUpPlatformData(PlatformPopupMenuData&)
+void WebPopupMenu::setUpPlatformData(const IntRect&, PlatformPopupMenuData&)
 {
 }
 
diff --git a/WebKit2/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp b/WebKit2/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp
index 561141f..32d276e 100644
--- a/WebKit2/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp
@@ -41,7 +41,7 @@ static const int separatorPadding = 4;
 static const int separatorHeight = 1;
 static const int popupWindowBorderWidth = 1;
 
-void WebPopupMenu::setUpPlatformData(PlatformPopupMenuData& data)
+void WebPopupMenu::setUpPlatformData(const WebCore::IntRect& pageCoordinates, PlatformPopupMenuData& data)
 {
     int itemCount = m_popupClient->listSize();
 
@@ -68,13 +68,16 @@ void WebPopupMenu::setUpPlatformData(PlatformPopupMenuData& data)
         popupWidth = std::max(popupWidth, itemFont.width(TextRun(text.characters(), text.length())));
     }
 
-    // FIXME: popupWidth should probably take into account monitor constraits as is done with WebPopupMenuProxyWin::calculatePositionAndSize.
+    // FIXME: popupWidth should probably take into account monitor constraints as is done with WebPopupMenuProxyWin::calculatePositionAndSize.
 
     popupWidth += max(0, data.m_clientPaddingRight - data.m_clientInsetRight) + max(0, data.m_clientPaddingLeft - data.m_clientInsetLeft);
     popupWidth += 2 * popupWindowBorderWidth;
     data.m_popupWidth = popupWidth;
 
-    data.m_backingStoreSize = IntSize(data.m_popupWidth, (itemCount * data.m_itemHeight));
+    // The backing stores should be drawn at least as wide as the control on the page to match the width of the popup window we'll create.
+    int backingStoreWidth = max(pageCoordinates.width() - m_popupClient->clientInsetLeft() - m_popupClient->clientInsetRight(), popupWidth);
+
+    data.m_backingStoreSize = IntSize(backingStoreWidth, (itemCount * data.m_itemHeight));
     data.m_notSelectedBackingStore = BackingStore::createSharable(data.m_backingStoreSize);
     data.m_selectedBackingStore = BackingStore::createSharable(data.m_backingStoreSize);
 
@@ -92,7 +95,7 @@ void WebPopupMenu::setUpPlatformData(PlatformPopupMenuData& data)
         Color optionBackgroundColor = itemStyle.backgroundColor();
         Color optionTextColor = itemStyle.foregroundColor();
 
-        IntRect itemRect(0, y, data.m_popupWidth, data.m_itemHeight);
+        IntRect itemRect(0, y, backingStoreWidth, data.m_itemHeight);
 
         // Draw the background for this menu item
         if (itemStyle.isVisible()) {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list