Changeset 110405 in webkit


Ignore:
Timestamp:
Mar 11, 2012 6:29:44 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r110359.
http://trac.webkit.org/changeset/110359
https://bugs.webkit.org/show_bug.cgi?id=80799

SelectPopupMenuTest.ClickItem failure (Requested by ukai on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-03-11

Source/WebCore:

  • platform/chromium/PopupListBox.cpp:

(WebCore::PopupListBox::paint):
(WebCore::PopupListBox::paintRow):
(WebCore::PopupListBox::getRowHeight):

  • platform/chromium/PopupListBox.h:

(PopupContainerSettings):

  • platform/chromium/PopupMenuChromium.cpp:

(WebCore):
(WebCore::PopupMenuChromium::show):

  • platform/chromium/PopupMenuChromium.h:

(PopupMenuChromium):

  • rendering/RenderMenuList.cpp:

(WebCore::RenderMenuList::showPopup):

Source/WebKit/chromium:

  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::gestureEvent):
(WebKit::WebViewImpl::applyAutofillSuggestions):

Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r110402 r110405  
     12012-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
    1242012-03-11  Timothy Hatcher  <timothy@apple.com>
    225
  • trunk/Source/WebCore/platform/chromium/PopupListBox.cpp

    r110359 r110405  
    4545#include "PopupMenuClient.h"
    4646#include "RenderTheme.h"
    47 #include "RuntimeEnabledFeatures.h"
    4847#include "ScrollbarTheme.h"
    4948#include "StringTruncator.h"
     
    354353void PopupListBox::paint(GraphicsContext* gc, const IntRect& rect)
    355354{
    356     int scale = m_settings.defaultDeviceScaleFactor;
    357355    // adjust coords for scrolled frame
    358356    IntRect r = intersection(rect, frameRect());
     
    369367    // FIXME: Can we optimize scrolling to not require repainting the entire
    370368    // window? Should we?
    371     if (scale != 1)
    372         gc->scale(FloatSize(scale, scale));
    373369    for (int i = 0; i < numItems(); ++i)
    374370        paintRow(gc, r, i);
     
    393389    if (!rowRect.intersects(rect))
    394390        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     }
    408391
    409392    PopupMenuStyle style = m_popupClient->itemStyle(rowIndex);
     
    631614int PopupListBox::getRowHeight(int index)
    632615{
    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();
    639621
    640622    // Separator row height is the same size as itself.
    641623    if (m_popupClient->itemIsSeparator(index))
    642         return max(separatorHeight, (PopupMenuChromium::minimumRowHeight())) * scale;
     624        return max(separatorHeight, PopupMenuChromium::minimumRowHeight());
    643625
    644626    String icon = m_popupClient->itemIcon(index);
     
    650632    int linePaddingHeight = m_popupClient->menuStyle().menuType() == PopupMenuStyle::AutofillPopup ? kLinePaddingHeight : 0;
    651633    int calculatedRowHeight = max(fontHeight, iconHeight) + linePaddingHeight * 2;
    652     return (max(calculatedRowHeight, PopupMenuChromium::minimumRowHeight()) + paddingForTouch) * scale;
     634    return max(calculatedRowHeight, PopupMenuChromium::minimumRowHeight());
    653635}
    654636
  • trunk/Source/WebCore/platform/chromium/PopupListBox.h

    r110359 r110405  
    8080    // Autocomplete popups are restricted, combo-boxes (select tags) aren't.
    8181    bool restrictWidthOfListBox;
    82 
    83     int defaultDeviceScaleFactor;
    8482};
    8583
  • trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp

    r110359 r110405  
    3232#include "config.h"
    3333#include "PopupMenuChromium.h"
    34 
    35 #include "Frame.h"
    36 #include "FrameView.h"
    37 #include "Page.h"
    3834#include "PopupContainer.h"
    39 #include "Settings.h"
    4035
    4136namespace WebCore {
    4237
    4338int PopupMenuChromium::s_minimumRowHeight = 0;
    44 int PopupMenuChromium::s_optionPaddingForTouch = 30;
    4539
    4640// The settings used for the drop down menu.
     
    6963void PopupMenuChromium::show(const IntRect& r, FrameView* v, int index)
    7064{
    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);
    7967    p.popup->showInRect(r, v, index);
    8068}
  • trunk/Source/WebCore/platform/chromium/PopupMenuChromium.h

    r110359 r110405  
    5858    static void setMinimumRowHeight(int minimumRowHeight) { s_minimumRowHeight = minimumRowHeight; }
    5959
    60     static int optionPaddingForTouch() { return s_optionPaddingForTouch; }
    61     static void setOptionPaddingForTouch(int optionPaddingForTouch) { s_optionPaddingForTouch = optionPaddingForTouch; }
    62 
    6360private:
    6461    PopupMenuClient* client() const { return m_popupClient; }
     
    6865
    6966    static int s_minimumRowHeight;
    70     static int s_optionPaddingForTouch;
    7167};
    7268
  • trunk/Source/WebCore/rendering/RenderMenuList.cpp

    r110359 r110405  
    4444#include "RenderScrollbar.h"
    4545#include "RenderTheme.h"
    46 #include "Settings.h"
    4746#include "TextRun.h"
    4847#include <math.h>
     
    310309    FloatPoint absTopLeft = localToAbsolute(FloatPoint(), false, true);
    311310    LayoutRect absBounds = absoluteBoundingBoxRectIgnoringTransforms();
    312     int scale = document()->page()->settings()->defaultDeviceScaleFactor();
    313     if (scale && scale != 1)
    314         absBounds.scale(scale);
    315311    absBounds.setLocation(roundedLayoutPoint(absTopLeft));
    316312    HTMLSelectElement* select = toHTMLSelectElement(node());
  • trunk/Source/WebKit/chromium/ChangeLog

    r110391 r110405  
     12012-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
    1142012-03-11  Pavel Feldman  <pfeldman@chromium.org>
    215
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r110364 r110405  
    603603bool WebViewImpl::gestureEvent(const WebGestureEvent& event)
    604604{
    605     RefPtr<WebCore::PopupContainer> selectPopup;
    606605    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);
    624607}
    625608
     
    27092692
    27102693    if (!m_autofillPopup) {
    2711         PopupContainerSettings popupSettings = autofillPopupSettings;
    2712         popupSettings.defaultDeviceScaleFactor =
    2713             m_page->settings()->defaultDeviceScaleFactor();
    2714         if (!popupSettings.defaultDeviceScaleFactor)
    2715             popupSettings.defaultDeviceScaleFactor = 1;
    27162694        m_autofillPopup = PopupContainer::create(m_autofillPopupClient.get(),
    27172695                                                 PopupContainer::Suggestion,
    2718                                                  popupSettings);
     2696                                                 autofillPopupSettings);
    27192697    }
    27202698
Note: See TracChangeset for help on using the changeset viewer.