Title: [110405] trunk/Source
Revision
110405
Author
[email protected]
Date
2012-03-11 18:29:44 -0700 (Sun, 11 Mar 2012)

Log 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 <[email protected]> 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (110404 => 110405)


--- trunk/Source/WebCore/ChangeLog	2012-03-12 01:29:21 UTC (rev 110404)
+++ trunk/Source/WebCore/ChangeLog	2012-03-12 01:29:44 UTC (rev 110405)
@@ -1,3 +1,26 @@
+2012-03-11  Sheriff Bot  <[email protected]>
+
+        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).
+
+        * 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):
+
 2012-03-11  Timothy Hatcher  <[email protected]>
 
         Fix a crash opening the Web Inspector in WebKit1 clients.

Modified: trunk/Source/WebCore/platform/chromium/PopupListBox.cpp (110404 => 110405)


--- trunk/Source/WebCore/platform/chromium/PopupListBox.cpp	2012-03-12 01:29:21 UTC (rev 110404)
+++ trunk/Source/WebCore/platform/chromium/PopupListBox.cpp	2012-03-12 01:29:44 UTC (rev 110405)
@@ -44,7 +44,6 @@
 #include "PopupMenuChromium.h"
 #include "PopupMenuClient.h"
 #include "RenderTheme.h"
-#include "RuntimeEnabledFeatures.h"
 #include "ScrollbarTheme.h"
 #include "StringTruncator.h"
 #include "TextRun.h"
@@ -353,7 +352,6 @@
 
 void PopupListBox::paint(GraphicsContext* gc, const IntRect& rect)
 {
-    int scale = m_settings.defaultDeviceScaleFactor;
     // adjust coords for scrolled frame
     IntRect r = intersection(rect, frameRect());
     int tx = x() - scrollX();
@@ -368,8 +366,6 @@
 
     // FIXME: Can we optimize scrolling to not require repainting the entire
     // window? Should we?
-    if (scale != 1)
-        gc->scale(FloatSize(scale, scale));
     for (int i = 0; i < numItems(); ++i)
         paintRow(gc, r, i);
 
@@ -393,19 +389,6 @@
     if (!rowRect.intersects(rect))
         return;
 
-    int scale = m_settings.defaultDeviceScaleFactor;
-    // RowRect has already been scaled by the defaultDeviceScaleFactor.
-    // To avoid scaling it twice, we have to unscale it before drawing.
-    if (scale != 1) {
-        // Height and y should both be evenly divisible by scale.
-        ASSERT(!(rowRect.y() % scale));
-        rowRect.setY(rowRect.y() / scale);
-        ASSERT(!(rowRect.height() % scale));
-        rowRect.setHeight(rowRect.height() / scale);
-        rowRect.setWidth(ceilf(static_cast<float>(rowRect.width()) / scale));
-        // rowRect.x is always 0.
-    }
-
     PopupMenuStyle style = m_popupClient->itemStyle(rowIndex);
 
     // Paint background
@@ -630,16 +613,15 @@
 
 int PopupListBox::getRowHeight(int index)
 {
-    int scale = m_settings.defaultDeviceScaleFactor;
-    int paddingForTouch = 0;
-    if (RuntimeEnabledFeatures::touchEnabled())
-        paddingForTouch = PopupMenuChromium::optionPaddingForTouch();
-    if (index < 0 || m_popupClient->itemStyle(index).isDisplayNone())
-        return PopupMenuChromium::minimumRowHeight() * scale;
+    if (index < 0)
+        return PopupMenuChromium::minimumRowHeight();
 
+    if (m_popupClient->itemStyle(index).isDisplayNone())
+        return PopupMenuChromium::minimumRowHeight();
+
     // Separator row height is the same size as itself.
     if (m_popupClient->itemIsSeparator(index))
-        return max(separatorHeight, (PopupMenuChromium::minimumRowHeight())) * scale;
+        return max(separatorHeight, PopupMenuChromium::minimumRowHeight());
 
     String icon = m_popupClient->itemIcon(index);
     RefPtr<Image> image(Image::loadPlatformResource(icon.utf8().data()));
@@ -649,7 +631,7 @@
 
     int linePaddingHeight = m_popupClient->menuStyle().menuType() == PopupMenuStyle::AutofillPopup ? kLinePaddingHeight : 0;
     int calculatedRowHeight = max(fontHeight, iconHeight) + linePaddingHeight * 2;
-    return (max(calculatedRowHeight, PopupMenuChromium::minimumRowHeight()) + paddingForTouch) * scale;
+    return max(calculatedRowHeight, PopupMenuChromium::minimumRowHeight());
 }
 
 IntRect PopupListBox::getRowBounds(int index)

Modified: trunk/Source/WebCore/platform/chromium/PopupListBox.h (110404 => 110405)


--- trunk/Source/WebCore/platform/chromium/PopupListBox.h	2012-03-12 01:29:21 UTC (rev 110404)
+++ trunk/Source/WebCore/platform/chromium/PopupListBox.h	2012-03-12 01:29:44 UTC (rev 110405)
@@ -79,8 +79,6 @@
     // Whether we should restrict the width of the PopupListBox or not.
     // Autocomplete popups are restricted, combo-boxes (select tags) aren't.
     bool restrictWidthOfListBox;
-
-    int defaultDeviceScaleFactor;
 };
 
 // A container for the data for each menu item (e.g. represented by <option>

Modified: trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp (110404 => 110405)


--- trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp	2012-03-12 01:29:21 UTC (rev 110404)
+++ trunk/Source/WebCore/platform/chromium/PopupMenuChromium.cpp	2012-03-12 01:29:44 UTC (rev 110405)
@@ -31,17 +31,11 @@
 
 #include "config.h"
 #include "PopupMenuChromium.h"
-
-#include "Frame.h"
-#include "FrameView.h"
-#include "Page.h"
 #include "PopupContainer.h"
-#include "Settings.h"
 
 namespace WebCore {
 
 int PopupMenuChromium::s_minimumRowHeight = 0;
-int PopupMenuChromium::s_optionPaddingForTouch = 30;
 
 // The settings used for the drop down menu.
 // This is the delegate used if none is provided.
@@ -68,14 +62,8 @@
 
 void PopupMenuChromium::show(const IntRect& r, FrameView* v, int index)
 {
-    if (!p.popup) {
-        PopupContainerSettings popupSettings = dropDownSettings;
-        popupSettings.defaultDeviceScaleFactor =
-            v->frame()->page()->settings()->defaultDeviceScaleFactor();
-        if (!popupSettings.defaultDeviceScaleFactor)
-            popupSettings.defaultDeviceScaleFactor = 1;
-        p.popup = PopupContainer::create(client(), PopupContainer::Select, popupSettings);
-    }
+    if (!p.popup)
+        p.popup = PopupContainer::create(client(), PopupContainer::Select, dropDownSettings);
     p.popup->showInRect(r, v, index);
 }
 

Modified: trunk/Source/WebCore/platform/chromium/PopupMenuChromium.h (110404 => 110405)


--- trunk/Source/WebCore/platform/chromium/PopupMenuChromium.h	2012-03-12 01:29:21 UTC (rev 110404)
+++ trunk/Source/WebCore/platform/chromium/PopupMenuChromium.h	2012-03-12 01:29:44 UTC (rev 110405)
@@ -57,9 +57,6 @@
     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 @@
     PopupMenuPrivate p;
 
     static int s_minimumRowHeight;
-    static int s_optionPaddingForTouch;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/rendering/RenderMenuList.cpp (110404 => 110405)


--- trunk/Source/WebCore/rendering/RenderMenuList.cpp	2012-03-12 01:29:21 UTC (rev 110404)
+++ trunk/Source/WebCore/rendering/RenderMenuList.cpp	2012-03-12 01:29:44 UTC (rev 110405)
@@ -43,7 +43,6 @@
 #include "RenderBR.h"
 #include "RenderScrollbar.h"
 #include "RenderTheme.h"
-#include "Settings.h"
 #include "TextRun.h"
 #include <math.h>
 
@@ -309,9 +308,6 @@
     // the actual width of the element to size the popup.
     FloatPoint absTopLeft = localToAbsolute(FloatPoint(), false, true);
     LayoutRect absBounds = absoluteBoundingBoxRectIgnoringTransforms();
-    int scale = document()->page()->settings()->defaultDeviceScaleFactor();
-    if (scale && scale != 1)
-        absBounds.scale(scale);
     absBounds.setLocation(roundedLayoutPoint(absTopLeft));
     HTMLSelectElement* select = toHTMLSelectElement(node());
     m_popup->show(absBounds, document()->view(), select->optionToListIndex(select->selectedIndex()));

Modified: trunk/Source/WebKit/chromium/ChangeLog (110404 => 110405)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-03-12 01:29:21 UTC (rev 110404)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-03-12 01:29:44 UTC (rev 110405)
@@ -1,3 +1,16 @@
+2012-03-11  Sheriff Bot  <[email protected]>
+
+        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).
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::gestureEvent):
+        (WebKit::WebViewImpl::applyAutofillSuggestions):
+
 2012-03-11  Pavel Feldman  <[email protected]>
 
         Web Inspector: [chromium] add provisional test for the downstream sanity test.

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (110404 => 110405)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-03-12 01:29:21 UTC (rev 110404)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-03-12 01:29:44 UTC (rev 110405)
@@ -602,25 +602,8 @@
 #if ENABLE(GESTURE_EVENTS)
 bool WebViewImpl::gestureEvent(const WebGestureEvent& event)
 {
-    RefPtr<WebCore::PopupContainer> selectPopup;
     PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event);
-    if (event.type == WebInputEvent::GestureTap) {
-        selectPopup = m_selectPopup;
-        hideSelectPopup();
-        ASSERT(!m_selectPopup);
-    }
-
-    bool gestureHandled = mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent);
-
-    if (m_selectPopup && m_selectPopup == selectPopup) {
-        // That tap triggered a select popup which is the same as the one that
-        // was showing before the tap. It means the user tapped the select
-        // while the popup was showing, and as a result we first closed then
-        // immediately reopened the select popup. It needs to be closed.
-        hideSelectPopup();
-    }
-
-    return gestureHandled;
+    return mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent);
 }
 
 void WebViewImpl::startPageScaleAnimation(const IntPoint& scroll, bool useAnchor, float newScale, double durationSec)
@@ -2708,14 +2691,9 @@
         inputElem, names, labels, icons, uniqueIDs, separatorIndex);
 
     if (!m_autofillPopup) {
-        PopupContainerSettings popupSettings = autofillPopupSettings;
-        popupSettings.defaultDeviceScaleFactor =
-            m_page->settings()->defaultDeviceScaleFactor();
-        if (!popupSettings.defaultDeviceScaleFactor)
-            popupSettings.defaultDeviceScaleFactor = 1;
         m_autofillPopup = PopupContainer::create(m_autofillPopupClient.get(),
                                                  PopupContainer::Suggestion,
-                                                 popupSettings);
+                                                 autofillPopupSettings);
     }
 
     if (m_autofillPopupShowing) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to