Changeset 110405 in webkit
- Timestamp:
- Mar 11, 2012 6:29:44 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r110402 r110405 1 2012-03-11 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r110359. 4 http://trac.webkit.org/changeset/110359 5 https://bugs.webkit.org/show_bug.cgi?id=80799 6 7 SelectPopupMenuTest.ClickItem failure (Requested by ukai on 8 #webkit). 9 10 * platform/chromium/PopupListBox.cpp: 11 (WebCore::PopupListBox::paint): 12 (WebCore::PopupListBox::paintRow): 13 (WebCore::PopupListBox::getRowHeight): 14 * platform/chromium/PopupListBox.h: 15 (PopupContainerSettings): 16 * platform/chromium/PopupMenuChromium.cpp: 17 (WebCore): 18 (WebCore::PopupMenuChromium::show): 19 * platform/chromium/PopupMenuChromium.h: 20 (PopupMenuChromium): 21 * rendering/RenderMenuList.cpp: 22 (WebCore::RenderMenuList::showPopup): 23 1 24 2012-03-11 Timothy Hatcher <timothy@apple.com> 2 25 -
trunk/Source/WebCore/platform/chromium/PopupListBox.cpp
r110359 r110405 45 45 #include "PopupMenuClient.h" 46 46 #include "RenderTheme.h" 47 #include "RuntimeEnabledFeatures.h"48 47 #include "ScrollbarTheme.h" 49 48 #include "StringTruncator.h" … … 354 353 void PopupListBox::paint(GraphicsContext* gc, const IntRect& rect) 355 354 { 356 int scale = m_settings.defaultDeviceScaleFactor;357 355 // adjust coords for scrolled frame 358 356 IntRect r = intersection(rect, frameRect()); … … 369 367 // FIXME: Can we optimize scrolling to not require repainting the entire 370 368 // window? Should we? 371 if (scale != 1)372 gc->scale(FloatSize(scale, scale));373 369 for (int i = 0; i < numItems(); ++i) 374 370 paintRow(gc, r, i); … … 393 389 if (!rowRect.intersects(rect)) 394 390 return; 395 396 int scale = m_settings.defaultDeviceScaleFactor;397 // RowRect has already been scaled by the defaultDeviceScaleFactor.398 // To avoid scaling it twice, we have to unscale it before drawing.399 if (scale != 1) {400 // Height and y should both be evenly divisible by scale.401 ASSERT(!(rowRect.y() % scale));402 rowRect.setY(rowRect.y() / scale);403 ASSERT(!(rowRect.height() % scale));404 rowRect.setHeight(rowRect.height() / scale);405 rowRect.setWidth(ceilf(static_cast<float>(rowRect.width()) / scale));406 // rowRect.x is always 0.407 }408 391 409 392 PopupMenuStyle style = m_popupClient->itemStyle(rowIndex); … … 631 614 int PopupListBox::getRowHeight(int index) 632 615 { 633 int scale = m_settings.defaultDeviceScaleFactor; 634 int paddingForTouch = 0; 635 if (RuntimeEnabledFeatures::touchEnabled()) 636 paddingForTouch = PopupMenuChromium::optionPaddingForTouch(); 637 if (index < 0 || m_popupClient->itemStyle(index).isDisplayNone()) 638 return PopupMenuChromium::minimumRowHeight() * scale; 616 if (index < 0) 617 return PopupMenuChromium::minimumRowHeight(); 618 619 if (m_popupClient->itemStyle(index).isDisplayNone()) 620 return PopupMenuChromium::minimumRowHeight(); 639 621 640 622 // Separator row height is the same size as itself. 641 623 if (m_popupClient->itemIsSeparator(index)) 642 return max(separatorHeight, (PopupMenuChromium::minimumRowHeight())) * scale;624 return max(separatorHeight, PopupMenuChromium::minimumRowHeight()); 643 625 644 626 String icon = m_popupClient->itemIcon(index); … … 650 632 int linePaddingHeight = m_popupClient->menuStyle().menuType() == PopupMenuStyle::AutofillPopup ? kLinePaddingHeight : 0; 651 633 int calculatedRowHeight = max(fontHeight, iconHeight) + linePaddingHeight * 2; 652 return (max(calculatedRowHeight, PopupMenuChromium::minimumRowHeight()) + paddingForTouch) * scale;634 return max(calculatedRowHeight, PopupMenuChromium::minimumRowHeight()); 653 635 } 654 636 -
trunk/Source/WebCore/platform/chromium/PopupListBox.h
r110359 r110405 80 80 // Autocomplete popups are restricted, combo-boxes (select tags) aren't. 81 81 bool restrictWidthOfListBox; 82 83 int defaultDeviceScaleFactor;84 82 }; 85 83 -
trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp
r110359 r110405 32 32 #include "config.h" 33 33 #include "PopupMenuChromium.h" 34 35 #include "Frame.h"36 #include "FrameView.h"37 #include "Page.h"38 34 #include "PopupContainer.h" 39 #include "Settings.h"40 35 41 36 namespace WebCore { 42 37 43 38 int PopupMenuChromium::s_minimumRowHeight = 0; 44 int PopupMenuChromium::s_optionPaddingForTouch = 30;45 39 46 40 // The settings used for the drop down menu. … … 69 63 void PopupMenuChromium::show(const IntRect& r, FrameView* v, int index) 70 64 { 71 if (!p.popup) { 72 PopupContainerSettings popupSettings = dropDownSettings; 73 popupSettings.defaultDeviceScaleFactor = 74 v->frame()->page()->settings()->defaultDeviceScaleFactor(); 75 if (!popupSettings.defaultDeviceScaleFactor) 76 popupSettings.defaultDeviceScaleFactor = 1; 77 p.popup = PopupContainer::create(client(), PopupContainer::Select, popupSettings); 78 } 65 if (!p.popup) 66 p.popup = PopupContainer::create(client(), PopupContainer::Select, dropDownSettings); 79 67 p.popup->showInRect(r, v, index); 80 68 } -
trunk/Source/WebCore/platform/chromium/PopupMenuChromium.h
r110359 r110405 58 58 static void setMinimumRowHeight(int minimumRowHeight) { s_minimumRowHeight = minimumRowHeight; } 59 59 60 static int optionPaddingForTouch() { return s_optionPaddingForTouch; }61 static void setOptionPaddingForTouch(int optionPaddingForTouch) { s_optionPaddingForTouch = optionPaddingForTouch; }62 63 60 private: 64 61 PopupMenuClient* client() const { return m_popupClient; } … … 68 65 69 66 static int s_minimumRowHeight; 70 static int s_optionPaddingForTouch;71 67 }; 72 68 -
trunk/Source/WebCore/rendering/RenderMenuList.cpp
r110359 r110405 44 44 #include "RenderScrollbar.h" 45 45 #include "RenderTheme.h" 46 #include "Settings.h"47 46 #include "TextRun.h" 48 47 #include <math.h> … … 310 309 FloatPoint absTopLeft = localToAbsolute(FloatPoint(), false, true); 311 310 LayoutRect absBounds = absoluteBoundingBoxRectIgnoringTransforms(); 312 int scale = document()->page()->settings()->defaultDeviceScaleFactor();313 if (scale && scale != 1)314 absBounds.scale(scale);315 311 absBounds.setLocation(roundedLayoutPoint(absTopLeft)); 316 312 HTMLSelectElement* select = toHTMLSelectElement(node()); -
trunk/Source/WebKit/chromium/ChangeLog
r110391 r110405 1 2012-03-11 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r110359. 4 http://trac.webkit.org/changeset/110359 5 https://bugs.webkit.org/show_bug.cgi?id=80799 6 7 SelectPopupMenuTest.ClickItem failure (Requested by ukai on 8 #webkit). 9 10 * src/WebViewImpl.cpp: 11 (WebKit::WebViewImpl::gestureEvent): 12 (WebKit::WebViewImpl::applyAutofillSuggestions): 13 1 14 2012-03-11 Pavel Feldman <pfeldman@chromium.org> 2 15 -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r110364 r110405 603 603 bool WebViewImpl::gestureEvent(const WebGestureEvent& event) 604 604 { 605 RefPtr<WebCore::PopupContainer> selectPopup;606 605 PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event); 607 if (event.type == WebInputEvent::GestureTap) { 608 selectPopup = m_selectPopup; 609 hideSelectPopup(); 610 ASSERT(!m_selectPopup); 611 } 612 613 bool gestureHandled = mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent); 614 615 if (m_selectPopup && m_selectPopup == selectPopup) { 616 // That tap triggered a select popup which is the same as the one that 617 // was showing before the tap. It means the user tapped the select 618 // while the popup was showing, and as a result we first closed then 619 // immediately reopened the select popup. It needs to be closed. 620 hideSelectPopup(); 621 } 622 623 return gestureHandled; 606 return mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent); 624 607 } 625 608 … … 2709 2692 2710 2693 if (!m_autofillPopup) { 2711 PopupContainerSettings popupSettings = autofillPopupSettings;2712 popupSettings.defaultDeviceScaleFactor =2713 m_page->settings()->defaultDeviceScaleFactor();2714 if (!popupSettings.defaultDeviceScaleFactor)2715 popupSettings.defaultDeviceScaleFactor = 1;2716 2694 m_autofillPopup = PopupContainer::create(m_autofillPopupClient.get(), 2717 2695 PopupContainer::Suggestion, 2718 popupSettings);2696 autofillPopupSettings); 2719 2697 } 2720 2698
Note: See TracChangeset
for help on using the changeset viewer.