Title: [91896] trunk/Source
Revision
91896
Author
fsam...@chromium.org
Date
2011-07-27 20:55:58 -0700 (Wed, 27 Jul 2011)

Log Message

Source/WebCore: Popups on Chromium now check the minimum row height set through the Chromium WebKit API when
computing the height of a row in a popup listbox.
https://bugs.webkit.org/show_bug.cgi?id=64897

Reviewed by Darin Fisher.

No new tests.

* platform/chromium/PopupMenuChromium.cpp:
(WebCore::PopupListBox::getRowHeight):
* platform/chromium/PopupMenuChromium.h:
(WebCore::PopupMenuChromium::minimumRowHeight):
(WebCore::PopupMenuChromium::setMinimumRowHeight):

Source/WebKit/chromium: Added a Chromium WebKit API method to set the minimum row height of a popup listbox.
https://bugs.webkit.org/show_bug.cgi?id=64897

Reviewed by Darin Fisher.

* public/WebPopupMenu.h:
* src/WebPopupMenuImpl.cpp:
(WebKit::WebPopupMenu::setMinimumRowHeight):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (91895 => 91896)


--- trunk/Source/WebCore/ChangeLog	2011-07-28 03:44:57 UTC (rev 91895)
+++ trunk/Source/WebCore/ChangeLog	2011-07-28 03:55:58 UTC (rev 91896)
@@ -1,3 +1,19 @@
+2011-07-27  Fady Samuel  <fsam...@chromium.org>
+
+        Popups on Chromium now check the minimum row height set through the Chromium WebKit API when
+        computing the height of a row in a popup listbox.
+        https://bugs.webkit.org/show_bug.cgi?id=64897
+
+        Reviewed by Darin Fisher.
+
+        No new tests.
+
+        * platform/chromium/PopupMenuChromium.cpp:
+        (WebCore::PopupListBox::getRowHeight):
+        * platform/chromium/PopupMenuChromium.h:
+        (WebCore::PopupMenuChromium::minimumRowHeight):
+        (WebCore::PopupMenuChromium::setMinimumRowHeight):
+
 2011-07-27  MORITA Hajime  <morr...@google.com>
 
         Inconsistent state of TreeScope reference.

Modified: trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp (91895 => 91896)


--- trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp	2011-07-28 03:44:57 UTC (rev 91895)
+++ trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp	2011-07-28 03:55:58 UTC (rev 91896)
@@ -67,6 +67,8 @@
 
 namespace WebCore {
 
+int PopupMenuChromium::s_minimumRowHeight = 0;
+
 typedef unsigned long long TimeStamp;
 
 static const int kMaxVisibleRows = 20;
@@ -1176,14 +1178,14 @@
 int PopupListBox::getRowHeight(int index)
 {
     if (index < 0)
-        return 0;
+        return PopupMenuChromium::minimumRowHeight();
 
     if (m_popupClient->itemStyle(index).isDisplayNone())
-        return 0;
+        return PopupMenuChromium::minimumRowHeight();
 
     // Separator row height is the same size as itself.
     if (m_popupClient->itemIsSeparator(index))
-        return separatorHeight;
+        return max(separatorHeight, PopupMenuChromium::minimumRowHeight());
 
     String icon = m_popupClient->itemIcon(index);
     RefPtr<Image> image(Image::loadPlatformResource(icon.utf8().data()));
@@ -1192,7 +1194,8 @@
     int iconHeight = (image && !image->isNull()) ? image->rect().height() : 0;
 
     int linePaddingHeight = m_popupClient->menuStyle().menuType() == PopupMenuStyle::AutofillPopup ? kLinePaddingHeight : 0;
-    return max(fontHeight, iconHeight) + linePaddingHeight * 2;
+    int calculatedRowHeight = max(fontHeight, iconHeight) + linePaddingHeight * 2;
+    return max(calculatedRowHeight, PopupMenuChromium::minimumRowHeight());
 }
 
 IntRect PopupListBox::getRowBounds(int index)

Modified: trunk/Source/WebCore/platform/chromium/PopupMenuChromium.h (91895 => 91896)


--- trunk/Source/WebCore/platform/chromium/PopupMenuChromium.h	2011-07-28 03:44:57 UTC (rev 91895)
+++ trunk/Source/WebCore/platform/chromium/PopupMenuChromium.h	2011-07-28 03:55:58 UTC (rev 91896)
@@ -175,7 +175,7 @@
 private:
     friend class WTF::RefCounted<PopupContainer>;
 
-    PopupContainer(PopupMenuClient*, PopupType popupType, const PopupContainerSettings&);
+    PopupContainer(PopupMenuClient*, PopupType, const PopupContainerSettings&);
     ~PopupContainer();
 
     // Paint the border.
@@ -207,11 +207,16 @@
     virtual void updateFromElement();
     virtual void disconnectClient();
 
+    static int minimumRowHeight() { return s_minimumRowHeight; }
+    static void setMinimumRowHeight(int minimumRowHeight) { s_minimumRowHeight = minimumRowHeight; }
+
 private:
     PopupMenuClient* client() const { return m_popupClient; }
 
     PopupMenuClient* m_popupClient;
     PopupMenuPrivate p;
+
+    static int s_minimumRowHeight;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebKit/chromium/ChangeLog (91895 => 91896)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-07-28 03:44:57 UTC (rev 91895)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-07-28 03:55:58 UTC (rev 91896)
@@ -1,3 +1,14 @@
+2011-07-27  Fady Samuel  <fsam...@chromium.org>
+
+        Added a Chromium WebKit API method to set the minimum row height of a popup listbox.
+        https://bugs.webkit.org/show_bug.cgi?id=64897
+
+        Reviewed by Darin Fisher.
+
+        * public/WebPopupMenu.h:
+        * src/WebPopupMenuImpl.cpp:
+        (WebKit::WebPopupMenu::setMinimumRowHeight):
+
 2011-07-27  Peng Huang  <penghu...@chromium.org>
 
         Add more text input types for chromium

Modified: trunk/Source/WebKit/chromium/public/WebPopupMenu.h (91895 => 91896)


--- trunk/Source/WebKit/chromium/public/WebPopupMenu.h	2011-07-28 03:44:57 UTC (rev 91895)
+++ trunk/Source/WebKit/chromium/public/WebPopupMenu.h	2011-07-28 03:55:58 UTC (rev 91896)
@@ -41,6 +41,9 @@
 class WebPopupMenu : public WebWidget {
 public:
     WEBKIT_API static WebPopupMenu* create(WebWidgetClient*);
+
+    // Sets the minimum height of a popup listbox row.
+    WEBKIT_API static void setMinimumRowHeight(int);
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp (91895 => 91896)


--- trunk/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp	2011-07-28 03:44:57 UTC (rev 91895)
+++ trunk/Source/WebKit/chromium/src/WebPopupMenuImpl.cpp	2011-07-28 03:55:58 UTC (rev 91896)
@@ -251,6 +251,11 @@
 {
 }
 
+void WebPopupMenu::setMinimumRowHeight(int minimumRowHeight)
+{
+    PopupMenuChromium::setMinimumRowHeight(minimumRowHeight);
+}
+
 bool WebPopupMenuImpl::setComposition(
     const WebString& text, const WebVector<WebCompositionUnderline>& underlines,
     int selectionStart, int selectionEnd)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to