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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@91896
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-07-27 Fady Samuel <fsamuel@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 <morrita@google.com>
Inconsistent state of TreeScope reference.
namespace WebCore {
+int PopupMenuChromium::s_minimumRowHeight = 0;
+
typedef unsigned long long TimeStamp;
static const int kMaxVisibleRows = 20;
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()));
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)
private:
friend class WTF::RefCounted<PopupContainer>;
- PopupContainer(PopupMenuClient*, PopupType popupType, const PopupContainerSettings&);
+ PopupContainer(PopupMenuClient*, PopupType, const PopupContainerSettings&);
~PopupContainer();
// Paint the border.
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
+2011-07-27 Fady Samuel <fsamuel@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 <penghuang@chromium.org>
Add more text input types for chromium
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
{
}
+void WebPopupMenu::setMinimumRowHeight(int minimumRowHeight)
+{
+ PopupMenuChromium::setMinimumRowHeight(minimumRowHeight);
+}
+
bool WebPopupMenuImpl::setComposition(
const WebString& text, const WebVector<WebCompositionUnderline>& underlines,
int selectionStart, int selectionEnd)