Changeset 130513 in webkit
- Timestamp:
- Oct 5, 2012, 9:15:35 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r130511 r130513 1 2012-10-05 Kevin Ellis <kevers@chromium.org> 2 3 [chromium] Only inflate the height of rows in a popup menu when a touch device is detected. 4 https://bugs.webkit.org/show_bug.cgi?id=98515 5 6 Reviewed by Adam Barth. 7 8 Enforces a minimum row height for popup menus when a touch device is 9 detected. In a previous patch (r127597), the sizing of popup was 10 consolidated for touch and non-touch. Based on user feedback, reverting 11 to the old behavior for non-touch and only adding padding for touch 12 devices seems like a much safer strategy. This patch is not a direct 13 revert of r127567 since the padding previously used for touch is a bit 14 excessive. 15 16 Covered by existing tests. 17 18 * platform/chromium/PopupListBox.cpp: 19 (WebCore::PopupListBox::getRowHeight): 20 * platform/chromium/PopupMenuChromium.cpp: 21 (WebCore): 22 * platform/chromium/PopupMenuChromium.h: 23 (WebCore::PopupMenuChromium::optionRowHeightForTouch): 24 (WebCore::PopupMenuChromium::setOptionRowHeightForTouch): 25 (PopupMenuChromium): 26 1 27 2012-10-05 Alexander Pavlov <apavlov@chromium.org> 2 28 -
trunk/Source/WebCore/platform/chromium/PopupListBox.cpp
r127597 r130513 615 615 int PopupListBox::getRowHeight(int index) 616 616 { 617 int minimumHeight = PopupMenuChromium::minimumRowHeight(); 618 if (m_settings.deviceSupportsTouch) 619 minimumHeight = max(minimumHeight, PopupMenuChromium::optionRowHeightForTouch()); 620 617 621 if (index < 0 || m_popupClient->itemStyle(index).isDisplayNone()) 618 return PopupMenuChromium::minimumRowHeight();622 return minimumHeight; 619 623 620 624 // Separator row height is the same size as itself. 621 625 if (m_popupClient->itemIsSeparator(index)) 622 return max(separatorHeight, (PopupMenuChromium::minimumRowHeight()));626 return max(separatorHeight, minimumHeight); 623 627 624 628 String icon = m_popupClient->itemIcon(index); … … 630 634 int linePaddingHeight = m_popupClient->menuStyle().menuType() == PopupMenuStyle::AutofillPopup ? kLinePaddingHeight : 0; 631 635 int calculatedRowHeight = max(fontHeight, iconHeight) + linePaddingHeight * 2; 632 return max(calculatedRowHeight, PopupMenuChromium::minimumRowHeight());636 return max(calculatedRowHeight, minimumHeight); 633 637 } 634 638 -
trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp
r127597 r130513 41 41 namespace WebCore { 42 42 43 int PopupMenuChromium::s_minimumRowHeight = 28; 43 int PopupMenuChromium::s_minimumRowHeight = 0; 44 int PopupMenuChromium::s_optionRowHeightForTouch = 28; 44 45 45 46 // The settings used for the drop down menu. -
trunk/Source/WebCore/platform/chromium/PopupMenuChromium.h
r127597 r130513 57 57 static int minimumRowHeight() { return s_minimumRowHeight; } 58 58 static void setMinimumRowHeight(int minimumRowHeight) { s_minimumRowHeight = minimumRowHeight; } 59 static int optionRowHeightForTouch() { return s_optionRowHeightForTouch; } 60 static void setOptionRowHeightForTouch(int optionRowHeightForTouch) { s_optionRowHeightForTouch = optionRowHeightForTouch; } 59 61 60 62 private: … … 65 67 66 68 static int s_minimumRowHeight; 69 static int s_optionRowHeightForTouch; 67 70 }; 68 71
Note:
See TracChangeset
for help on using the changeset viewer.