Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / web / PopupListBox.cpp
index bc7fb83..44502e0 100644 (file)
 #include "wtf/CurrentTime.h"
 #include <limits>
 
-namespace WebCore {
+namespace blink {
 
 using namespace WTF::Unicode;
+using namespace WebCore;
 
 const int PopupListBox::defaultMaxHeight = 500;
 static const int maxVisibleRows = 20;
@@ -374,6 +375,8 @@ void PopupListBox::paint(GraphicsContext* gc, const IntRect& rect)
 
 static const int separatorPadding = 4;
 static const int separatorHeight = 1;
+static const int minRowHeight = 0;
+static const int optionRowHeightForTouch = 28;
 
 void PopupListBox::paintRow(GraphicsContext* gc, const IntRect& rect, int rowIndex)
 {
@@ -468,7 +471,7 @@ Font PopupListBox::getRowFont(int rowIndex)
         // Bold-ify labels (ie, an <optgroup> heading).
         FontDescription d = itemFont.fontDescription();
         d.setWeight(FontWeightBold);
-        Font font(d, itemFont.letterSpacing(), itemFont.wordSpacing());
+        Font font(d);
         font.update(0);
         return font;
     }
@@ -564,9 +567,7 @@ void PopupListBox::setOriginalIndex(int index)
 
 int PopupListBox::getRowHeight(int index)
 {
-    int minimumHeight = PopupMenuChromium::minimumRowHeight();
-    if (m_deviceSupportsTouch)
-        minimumHeight = max(minimumHeight, PopupMenuChromium::optionRowHeightForTouch());
+    int minimumHeight = m_deviceSupportsTouch ? optionRowHeightForTouch : minRowHeight;
 
     if (index < 0 || m_popupClient->itemStyle(index).isDisplayNone())
         return minimumHeight;
@@ -823,4 +824,4 @@ int PopupListBox::popupContentHeight() const
     return height();
 }
 
-} // namespace WebCore
+} // namespace blink