[chromium] Unify size of popup menu for touch and non-touch.

https://bugs.webkit.org/show_bug.cgi?id=95606

Patch by Kevin Ellis <kevers@chromium.org> on 2012-09-05
Reviewed by Adam Barth.

Use minimum height for popup menus entries regardless of whether the
popup menu is displayed on a touch screen.  Replaces use of touch
padding.  Height meets minimum size requirement for a low error rate
while still looking aesthetic for non-touch.

Covered by existing tests.

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127597 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2ccb17c0
2012-09-05 Kevin Ellis <kevers@chromium.org>
[chromium] Unify size of popup menu for touch and non-touch.
https://bugs.webkit.org/show_bug.cgi?id=95606
Reviewed by Adam Barth.
Use minimum height for popup menus entries regardless of whether the
popup menu is displayed on a touch screen. Replaces use of touch
padding. Height meets minimum size requirement for a low error rate
while still looking aesthetic for non-touch.
Covered by existing tests.
* platform/chromium/PopupListBox.cpp:
(WebCore::PopupListBox::getRowHeight):
* platform/chromium/PopupMenuChromium.cpp:
(WebCore):
* platform/chromium/PopupMenuChromium.h:
(PopupMenuChromium):
2012-09-05 Mihnea Ovidenie <mihnea@adobe.com>
[CSS Regions] Auto width is not working for Regions
......@@ -614,9 +614,6 @@ void PopupListBox::setOriginalIndex(int index)
int PopupListBox::getRowHeight(int index)
{
int paddingForTouch = 0;
if (m_settings.deviceSupportsTouch)
paddingForTouch = PopupMenuChromium::optionPaddingForTouch();
if (index < 0 || m_popupClient->itemStyle(index).isDisplayNone())
return PopupMenuChromium::minimumRowHeight();
......@@ -632,7 +629,7 @@ int PopupListBox::getRowHeight(int index)
int linePaddingHeight = m_popupClient->menuStyle().menuType() == PopupMenuStyle::AutofillPopup ? kLinePaddingHeight : 0;
int calculatedRowHeight = max(fontHeight, iconHeight) + linePaddingHeight * 2;
return (max(calculatedRowHeight, PopupMenuChromium::minimumRowHeight()) + paddingForTouch);
return max(calculatedRowHeight, PopupMenuChromium::minimumRowHeight());
}
IntRect PopupListBox::getRowBounds(int index)
......
......@@ -40,8 +40,7 @@
namespace WebCore {
int PopupMenuChromium::s_minimumRowHeight = 0;
int PopupMenuChromium::s_optionPaddingForTouch = 16;
int PopupMenuChromium::s_minimumRowHeight = 28;
// The settings used for the drop down menu.
// This is the delegate used if none is provided.
......
......@@ -57,9 +57,6 @@ public:
static int minimumRowHeight() { return s_minimumRowHeight; }
static void setMinimumRowHeight(int minimumRowHeight) { s_minimumRowHeight = minimumRowHeight; }
static int optionPaddingForTouch() { return s_optionPaddingForTouch; }
static void setOptionPaddingForTouch(int optionPaddingForTouch) { s_optionPaddingForTouch = optionPaddingForTouch; }
private:
PopupMenuClient* client() const { return m_popupClient; }
......@@ -67,7 +64,6 @@ private:
PopupMenuPrivate p;
static int s_minimumRowHeight;
static int s_optionPaddingForTouch;
};
} // namespace WebCore
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment