Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / page / AutoscrollController.cpp
index 4a5f7cc..281e16b 100644 (file)
@@ -36,6 +36,7 @@
 #include "core/page/Page.h"
 #include "core/rendering/HitTestResult.h"
 #include "core/rendering/RenderBox.h"
+#include "core/rendering/RenderListBox.h"
 #include "wtf/CurrentTime.h"
 
 namespace WebCore {
@@ -73,6 +74,8 @@ void AutoscrollController::startAutoscrollForSelection(RenderObject* renderer)
         return;
     RenderBox* scrollable = RenderBox::findAutoscrollable(renderer);
     if (!scrollable)
+        scrollable = renderer->isListBox() ? toRenderListBox(renderer) : 0;
+    if (!scrollable)
         return;
     m_autoscrollType = AutoscrollForSelection;
     m_autoscrollRenderer = scrollable;
@@ -171,8 +174,7 @@ void AutoscrollController::updateDragAndDrop(Node* dropTargetNode, const IntPoin
 #if OS(WIN)
 void AutoscrollController::handleMouseReleaseForPanScrolling(Frame* frame, const PlatformMouseEvent& mouseEvent)
 {
-    Page* page = frame->page();
-    if (!page || page->mainFrame() != frame)
+    if (!frame->isMainFrame())
         return;
     switch (m_autoscrollType) {
     case AutoscrollForPan: