Title: [121036] trunk/Source
Revision
121036
Author
[email protected]
Date
2012-06-22 10:42:18 -0700 (Fri, 22 Jun 2012)

Log Message

Unreviewed, rolling out r121025.
http://trac.webkit.org/changeset/121025
https://bugs.webkit.org/show_bug.cgi?id=89580

Caused crash in
EventHandler.shouldTurnVerticalTicksIntoHorizontal webkit unit
test on 10.7

Source/WebCore:

* page/EventHandler.cpp:
(WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):
(WebCore::EventHandler::handleWheelEvent):
* page/EventHandler.h:
(EventHandler):
* page/chromium/EventHandlerChromium.cpp:
(WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):
* page/gtk/EventHandlerGtk.cpp:
(WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):

Source/WebKit/chromium:

* WebKit.gypi:
* tests/EventHandlerTest.cpp: Removed.

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (121035 => 121036)


--- trunk/Source/WebCore/ChangeLog	2012-06-22 17:40:14 UTC (rev 121035)
+++ trunk/Source/WebCore/ChangeLog	2012-06-22 17:42:18 UTC (rev 121036)
@@ -1,3 +1,23 @@
+2012-06-22  Kenneth Russell  <[email protected]>
+
+        Unreviewed, rolling out r121025.
+        http://trac.webkit.org/changeset/121025
+        https://bugs.webkit.org/show_bug.cgi?id=89580
+
+        Caused crash in
+        EventHandler.shouldTurnVerticalTicksIntoHorizontal webkit unit
+        test on 10.7
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):
+        (WebCore::EventHandler::handleWheelEvent):
+        * page/EventHandler.h:
+        (EventHandler):
+        * page/chromium/EventHandlerChromium.cpp:
+        (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):
+        * page/gtk/EventHandlerGtk.cpp:
+        (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):
+
 2012-06-21  Andrey Kosyakov  <[email protected]>
 
         Web Inspector: only increase length for timeline bars below minimal width

Modified: trunk/Source/WebCore/page/EventHandler.cpp (121035 => 121036)


--- trunk/Source/WebCore/page/EventHandler.cpp	2012-06-22 17:40:14 UTC (rev 121035)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2012-06-22 17:42:18 UTC (rev 121036)
@@ -2284,7 +2284,7 @@
 }
 
 #if !PLATFORM(GTK) && !(PLATFORM(CHROMIUM) && (OS(UNIX) && !OS(DARWIN)))
-bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&, const PlatformWheelEvent&) const
+bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&) const
 {
     return false;
 }
@@ -2339,7 +2339,7 @@
     // Instead, the handlers should know convert vertical scrolls
     // appropriately.
     PlatformWheelEvent event = e;
-    if (m_baseEventType == PlatformEvent::NoType && shouldTurnVerticalTicksIntoHorizontal(result, e))
+    if (m_baseEventType == PlatformEvent::NoType && shouldTurnVerticalTicksIntoHorizontal(result))
         event = event.copyTurningVerticalTicksIntoHorizontalTicks();
 
     if (node) {

Modified: trunk/Source/WebCore/page/EventHandler.h (121035 => 121036)


--- trunk/Source/WebCore/page/EventHandler.h	2012-06-22 17:40:14 UTC (rev 121035)
+++ trunk/Source/WebCore/page/EventHandler.h	2012-06-22 17:42:18 UTC (rev 121036)
@@ -48,8 +48,6 @@
 #include <wtf/HashMap.h>
 #endif
 
-class EventHandlerTest;
-
 namespace WebCore {
 
 class Clipboard;
@@ -229,8 +227,6 @@
 #endif
 
 private:
-    friend class ::EventHandlerTest;
-
 #if ENABLE(DRAG_SUPPORT)
     static DragState& dragState();
     static const double TextDragDelay;
@@ -270,7 +266,7 @@
     void autoscrollTimerFired(Timer<EventHandler>*);
     bool logicalScrollOverflow(ScrollLogicalDirection, ScrollGranularity, Node* startingNode = 0);
     
-    bool shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&, const PlatformWheelEvent&) const;
+    bool shouldTurnVerticalTicksIntoHorizontal(const HitTestResult&) const;
     bool mouseDownMayStartSelect() const { return m_mouseDownMayStartSelect; }
 
     static bool isKeyboardOptionTab(KeyboardEvent*);

Modified: trunk/Source/WebCore/page/chromium/EventHandlerChromium.cpp (121035 => 121036)


--- trunk/Source/WebCore/page/chromium/EventHandlerChromium.cpp	2012-06-22 17:40:14 UTC (rev 121035)
+++ trunk/Source/WebCore/page/chromium/EventHandlerChromium.cpp	2012-06-22 17:42:18 UTC (rev 121036)
@@ -158,9 +158,9 @@
 // GTK+ must scroll horizontally if the mouse pointer is on top of the
 // horizontal scrollbar while scrolling with the wheel.
 // This code comes from gtk/EventHandlerGtk.cpp.
-bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result, const PlatformWheelEvent& event) const
+bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result) const
 {
-    return !event.hasPreciseScrollingDeltas() && result.scrollbar() && result.scrollbar()->orientation() == HorizontalScrollbar;
+    return result.scrollbar() && result.scrollbar()->orientation() == HorizontalScrollbar;
 }
 #endif
 

Modified: trunk/Source/WebCore/page/gtk/EventHandlerGtk.cpp (121035 => 121036)


--- trunk/Source/WebCore/page/gtk/EventHandlerGtk.cpp	2012-06-22 17:40:14 UTC (rev 121035)
+++ trunk/Source/WebCore/page/gtk/EventHandlerGtk.cpp	2012-06-22 17:42:18 UTC (rev 121036)
@@ -126,7 +126,7 @@
 // horizontal scrollbar while scrolling with the wheel; we need to
 // add the deltas and ticks here so that this behavior is consistent
 // for styled scrollbars.
-bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result, const PlatformWheelEvent&) const
+bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result) const
 {
     return result.scrollbar() && result.scrollbar()->orientation() == HorizontalScrollbar;
 }

Modified: trunk/Source/WebKit/chromium/ChangeLog (121035 => 121036)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-06-22 17:40:14 UTC (rev 121035)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-06-22 17:42:18 UTC (rev 121036)
@@ -1,3 +1,16 @@
+2012-06-22  Kenneth Russell  <[email protected]>
+
+        Unreviewed, rolling out r121025.
+        http://trac.webkit.org/changeset/121025
+        https://bugs.webkit.org/show_bug.cgi?id=89580
+
+        Caused crash in
+        EventHandler.shouldTurnVerticalTicksIntoHorizontal webkit unit
+        test on 10.7
+
+        * WebKit.gypi:
+        * tests/EventHandlerTest.cpp: Removed.
+
 2012-06-22  Peter Beverloo  <[email protected]>
 
         [Chromium] Disable c++0x compatibility warnings in _javascript_Core.gyp when building for Android

Modified: trunk/Source/WebKit/chromium/WebKit.gypi (121035 => 121036)


--- trunk/Source/WebKit/chromium/WebKit.gypi	2012-06-22 17:40:14 UTC (rev 121035)
+++ trunk/Source/WebKit/chromium/WebKit.gypi	2012-06-22 17:42:18 UTC (rev 121036)
@@ -102,7 +102,6 @@
             'tests/DecimalTest.cpp',
             'tests/DragImageTest.cpp',
             'tests/DrawingBufferChromiumTest.cpp',
-            'tests/EventHandlerTest.cpp',
             'tests/EventListenerTest.cpp',
             'tests/FakeCCLayerTreeHostClient.h',
             'tests/FakeGraphicsContext3DTest.cpp',

Deleted: trunk/Source/WebKit/chromium/tests/EventHandlerTest.cpp (121035 => 121036)


--- trunk/Source/WebKit/chromium/tests/EventHandlerTest.cpp	2012-06-22 17:40:14 UTC (rev 121035)
+++ trunk/Source/WebKit/chromium/tests/EventHandlerTest.cpp	2012-06-22 17:42:18 UTC (rev 121036)
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include "EventHandler.h"
-
-#include "Frame.h"
-#include "HitTestResult.h"
-#include "PlatformWheelEvent.h"
-#include "ScrollTypes.h"
-#include "Scrollbar.h"
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
-using namespace std;
-using namespace WebCore;
-
-class MockScrollbar : public Scrollbar {
-public:
-    MockScrollbar(ScrollbarOrientation orientation) : Scrollbar(0, orientation, RegularScrollbar) { }
-    virtual ~MockScrollbar() { }
-};
-
-class MockHitTestResult : public HitTestResult {
-public:
-    MockHitTestResult(Scrollbar* scrollbar) : HitTestResult()
-    {
-        setScrollbar(scrollbar);
-    }
-
-};
-
-class MockPlatformWheelEvent : public PlatformWheelEvent {
-public:
-    MockPlatformWheelEvent(bool hasPreciseScrollingDeltas) : PlatformWheelEvent()
-    {
-        m_hasPreciseScrollingDeltas = hasPreciseScrollingDeltas;
-    }
-};
-
-class EventHandlerTest : public EventHandler {
-public:
-    EventHandlerTest() : EventHandler(0) { };
-    bool externalShouldTurnVerticalTicksIntoHorizontal(const HitTestResult& hitTestResult, const PlatformWheelEvent& wheelEvent)
-    {
-         return EventHandler::shouldTurnVerticalTicksIntoHorizontal(hitTestResult, wheelEvent);
-    }
-};
-
-TEST(EventHandler, shouldTurnVerticalTicksIntoHorizontal)
-{
-    EventHandlerTest handler;
-
-    RefPtr<MockScrollbar> verticalScrollbar = adoptRef(new MockScrollbar(VerticalScrollbar));
-    RefPtr<MockScrollbar> horizontalScrollbar = adoptRef(new MockScrollbar(HorizontalScrollbar));
-
-    // Verify that the MockScrollbar instances have the correct orientations.
-    EXPECT_EQ(VerticalScrollbar, verticalScrollbar->orientation());
-    EXPECT_EQ(HorizontalScrollbar, horizontalScrollbar->orientation());
-
-    MockHitTestResult noScrollbarHitTestResult(0);
-    MockHitTestResult horizontalScrollbarHitTestResult(horizontalScrollbar.get());
-    MockHitTestResult verticalScrollbarHitTestResult(verticalScrollbar.get());
-
-    // Verify that the MockHitTestResult instances have the right scrollbars.
-    EXPECT_EQ(horizontalScrollbar, horizontalScrollbarHitTestResult.scrollbar());
-    EXPECT_EQ(verticalScrollbar, verticalScrollbarHitTestResult.scrollbar());
-    EXPECT_EQ(0, noScrollbarHitTestResult.scrollbar());
-    EXPECT_EQ(HorizontalScrollbar, horizontalScrollbarHitTestResult.scrollbar()->orientation());
-
-    MockPlatformWheelEvent preciseWheelEvent(true);
-    MockPlatformWheelEvent basicWheelEvent(false);
-
-    // Verify that the wheel event instances have the right hasPreciseScrollingDeltas setting.
-    EXPECT_TRUE(preciseWheelEvent.hasPreciseScrollingDeltas());
-    EXPECT_FALSE(basicWheelEvent.hasPreciseScrollingDeltas());
-
-#if OS(UNIX) && !OS(DARWIN)
-    EXPECT_FALSE(handler.externalShouldTurnVerticalTicksIntoHorizontal(noScrollbarHitTestResult, basicWheelEvent));
-    EXPECT_FALSE(handler.externalShouldTurnVerticalTicksIntoHorizontal(noScrollbarHitTestResult, preciseWheelEvent));
-
-    EXPECT_FALSE(handler.externalShouldTurnVerticalTicksIntoHorizontal(verticalScrollbarHitTestResult, basicWheelEvent));
-    EXPECT_FALSE(handler.externalShouldTurnVerticalTicksIntoHorizontal(verticalScrollbarHitTestResult, preciseWheelEvent));
-
-    EXPECT_TRUE(handler.externalShouldTurnVerticalTicksIntoHorizontal(horizontalScrollbarHitTestResult, basicWheelEvent));
-    EXPECT_FALSE(handler.externalShouldTurnVerticalTicksIntoHorizontal(horizontalScrollbarHitTestResult, preciseWheelEvent));
-#else
-    EXPECT_FALSE(handler.externalShouldTurnVerticalTicksIntoHorizontal(noScrollbarHitTestResult, basicWheelEvent));
-    EXPECT_FALSE(handler.externalShouldTurnVerticalTicksIntoHorizontal(noScrollbarHitTestResult, preciseWheelEvent));
-
-    EXPECT_FALSE(handler.externalShouldTurnVerticalTicksIntoHorizontal(verticalScrollbarHitTestResult, basicWheelEvent));
-    EXPECT_FALSE(handler.externalShouldTurnVerticalTicksIntoHorizontal(verticalScrollbarHitTestResult, preciseWheelEvent));
-
-    EXPECT_FALSE(handler.externalShouldTurnVerticalTicksIntoHorizontal(horizontalScrollbarHitTestResult, basicWheelEvent));
-    EXPECT_FALSE(handler.externalShouldTurnVerticalTicksIntoHorizontal(horizontalScrollbarHitTestResult, preciseWheelEvent));
-#endif
-}
-
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to