Changeset 139503 in webkit
- Timestamp:
- Jan 11, 2013 2:52:31 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r139502 r139503 1 2013-01-11 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r139044. 4 http://trac.webkit.org/changeset/139044 5 https://bugs.webkit.org/show_bug.cgi?id=106702 6 7 Caused various scrolling anomolies on Mac with drag and drop 8 (Requested by smfr on #webkit). 9 10 * fast/events/drag-and-drop-autoscroll-expected.txt: Removed. 11 * fast/events/drag-and-drop-autoscroll.html: Removed. 12 1 13 2013-01-11 Rafael Weinstein <rafaelw@chromium.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r139502 r139503 1 2013-01-11 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r139044. 4 http://trac.webkit.org/changeset/139044 5 https://bugs.webkit.org/show_bug.cgi?id=106702 6 7 Caused various scrolling anomolies on Mac with drag and drop 8 (Requested by smfr on #webkit). 9 10 * page/AutoscrollController.cpp: 11 (WebCore::AutoscrollController::AutoscrollController): 12 (WebCore::AutoscrollController::autoscrollTimerFired): 13 * page/AutoscrollController.h: 14 (WebCore): 15 (AutoscrollController): 16 * page/EventHandler.cpp: 17 (WebCore::EventHandler::updateDragAndDrop): 18 * rendering/RenderBox.cpp: 19 (WebCore): 20 (WebCore::RenderBox::autoscroll): 21 * rendering/RenderBox.h: 22 (RenderBox): 23 * rendering/RenderLayer.cpp: 24 (WebCore::RenderLayer::autoscroll): 25 * rendering/RenderLayer.h: 26 (RenderLayer): 27 * rendering/RenderListBox.cpp: 28 (WebCore::RenderListBox::autoscroll): 29 * rendering/RenderListBox.h: 30 (RenderListBox): 31 * rendering/RenderTextControlSingleLine.cpp: 32 (WebCore::RenderTextControlSingleLine::autoscroll): 33 * rendering/RenderTextControlSingleLine.h: 34 (RenderTextControlSingleLine): 35 1 36 2013-01-11 Rafael Weinstein <rafaelw@chromium.org> 2 37 -
trunk/Source/WebCore/page/AutoscrollController.cpp
r139044 r139503 36 36 #include "RenderBox.h" 37 37 #include "ScrollView.h" 38 #include <wtf/CurrentTime.h>39 38 40 39 namespace WebCore { 41 42 // Delay time in second for start autoscroll if pointer is in border edge of scrollable element.43 static double autoscrollDelay = 0.2;44 40 45 41 // When the autoscroll or the panScroll is triggered when do the scroll every 0.05s to make it smooth … … 58 54 , m_autoscrollRenderer(0) 59 55 , m_autoscrollType(NoAutoscroll) 60 , m_dragAndDropAutoscrollStartTime(0)61 56 #if ENABLE(PAN_SCROLLING) 62 57 , m_panScrollButtonPressed(false) … … 150 145 } 151 146 152 void AutoscrollController::updateDragAndDrop(Node* dropTargetNode, const IntPoint& eventPosition, double eventTime)153 {154 if (!dropTargetNode) {155 stopAutoscrollTimer();156 return;157 }158 159 RenderBox* scrollable = RenderBox::findAutoscrollable(dropTargetNode->renderer());160 if (!scrollable) {161 stopAutoscrollTimer();162 return;163 }164 165 IntSize offset = scrollable->calculateAutoscrollDirection(eventPosition);166 if (offset.isZero()) {167 stopAutoscrollTimer();168 return;169 }170 171 m_dragAndDropAutoscrollReferencePosition = eventPosition + offset;172 173 if (m_autoscrollType == NoAutoscroll) {174 m_autoscrollType = AutoscrollForDragAndDrop;175 m_autoscrollRenderer = scrollable;176 m_dragAndDropAutoscrollStartTime = eventTime;177 startAutoscrollTimer();178 } else if (m_autoscrollRenderer != scrollable) {179 m_dragAndDropAutoscrollStartTime = eventTime;180 m_autoscrollRenderer = scrollable;181 }182 }183 184 147 #if ENABLE(PAN_SCROLLING) 185 148 void AutoscrollController::didPanScrollStart() … … 238 201 Frame* frame = m_autoscrollRenderer->frame(); 239 202 switch (m_autoscrollType) { 240 case AutoscrollForDragAndDrop: 241 if (WTF::currentTime() - m_dragAndDropAutoscrollStartTime > autoscrollDelay) 242 m_autoscrollRenderer->autoscroll(m_dragAndDropAutoscrollReferencePosition); 243 break; 244 case AutoscrollForSelection: { 245 EventHandler* eventHandler = frame->eventHandler(); 246 if (!eventHandler->mousePressed()) { 203 case AutoscrollForSelection: 204 if (!frame->eventHandler()->mousePressed()) { 247 205 stopAutoscrollTimer(); 248 206 return; 249 207 } 250 eventHandler->updateSelectionForMouseDrag(); 251 m_autoscrollRenderer->autoscroll(eventHandler->lastKnownMousePosition()); 208 m_autoscrollRenderer->autoscroll(); 252 209 break; 253 }254 210 case NoAutoscroll: 255 211 break; -
trunk/Source/WebCore/page/AutoscrollController.h
r139044 r139503 35 35 class Frame; 36 36 class FrameView; 37 class Node;38 37 class PlatformMouseEvent; 39 38 class RenderBox; … … 42 41 enum AutoscrollType { 43 42 NoAutoscroll, 44 AutoscrollForDragAndDrop,45 43 AutoscrollForSelection, 46 44 #if ENABLE(PAN_SCROLLING) … … 59 57 void stopAutoscrollTimer(bool rendererIsBeingDestroyed = false); 60 58 void updateAutoscrollRenderer(); 61 void updateDragAndDrop(Node* targetNode, const IntPoint& eventPosition, double eventTime);62 59 #if ENABLE(PAN_SCROLLING) 63 60 void didPanScrollStart(); … … 78 75 RenderBox* m_autoscrollRenderer; 79 76 AutoscrollType m_autoscrollType; 80 IntPoint m_dragAndDropAutoscrollReferencePosition;81 double m_dragAndDropAutoscrollStartTime;82 77 #if ENABLE(PAN_SCROLLING) 83 78 IntPoint m_panScrollStartPos; -
trunk/Source/WebCore/page/EventHandler.cpp
r139419 r139503 1958 1958 newTarget = newTarget->parentNode(); 1959 1959 1960 m_autoscrollController->updateDragAndDrop(newTarget.get(), event.position(), event.timestamp());1961 1962 1960 if (m_dragTarget != newTarget) { 1963 1961 // FIXME: this ordering was explicitly chosen to match WinIE. However, -
trunk/Source/WebCore/rendering/RenderBox.cpp
r139353 r139503 82 82 static OverrideSizeMap* gOverrideContainingBlockLogicalWidthMap = 0; 83 83 84 85 // Size of border belt for autoscroll. When mouse pointer in border belt,86 // autoscroll is started.87 static const int autoscrollBeltSize = 20;88 89 84 bool RenderBox::s_hadOverflowClip = false; 90 85 … … 704 699 } 705 700 706 void RenderBox::autoscroll( const IntPoint& position)701 void RenderBox::autoscroll() 707 702 { 708 703 if (layer()) 709 layer()->autoscroll( position);704 layer()->autoscroll(); 710 705 } 711 706 … … 729 724 Page* page = frame->page(); 730 725 return page && page->mainFrame() == frame; 731 }732 733 // If specified point is in border belt, returned offset denotes direction of734 // scrolling.735 IntSize RenderBox::calculateAutoscrollDirection(const IntPoint& windowPoint) const736 {737 if (!frame())738 return IntSize();739 740 FrameView* frameView = frame()->view();741 if (!frameView)742 return IntSize();743 744 IntSize offset;745 IntPoint point = frameView->windowToContents(windowPoint);746 IntRect box(absoluteBoundingBoxRect());747 748 if (point.x() < box.x() + autoscrollBeltSize)749 point.move(-autoscrollBeltSize, 0);750 else if (point.x() > box.maxX() - autoscrollBeltSize)751 point.move(autoscrollBeltSize, 0);752 753 if (point.y() < box.y() + autoscrollBeltSize)754 point.move(0, -autoscrollBeltSize);755 else if (point.y() > box.maxY() - autoscrollBeltSize)756 point.move(0, autoscrollBeltSize);757 return frameView->contentsToWindow(point) - windowPoint;758 726 } 759 727 -
trunk/Source/WebCore/rendering/RenderBox.h
r139351 r139503 448 448 bool canBeScrolledAndHasScrollableArea() const; 449 449 virtual bool canBeProgramaticallyScrolled() const; 450 virtual void autoscroll( const IntPoint&);450 virtual void autoscroll(); 451 451 bool canAutoscroll() const; 452 IntSize calculateAutoscrollDirection(const IntPoint& windowPoint) const;453 452 static RenderBox* findAutoscrollable(RenderObject*); 454 453 virtual void stopAutoscroll() { } -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r139461 r139503 2294 2294 } 2295 2295 2296 void RenderLayer::autoscroll( const IntPoint& position)2296 void RenderLayer::autoscroll() 2297 2297 { 2298 2298 Frame* frame = renderer()->frame(); … … 2304 2304 return; 2305 2305 2306 IntPoint currentDocumentPosition = frameView->windowToContents(position); 2306 #if ENABLE(DRAG_SUPPORT) 2307 frame->eventHandler()->updateSelectionForMouseDrag(); 2308 #endif 2309 2310 IntPoint currentDocumentPosition = frameView->windowToContents(frame->eventHandler()->lastKnownMousePosition()); 2307 2311 scrollRectToVisible(LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded); 2308 2312 } -
trunk/Source/WebCore/rendering/RenderLayer.h
r139461 r139503 374 374 375 375 bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1); 376 void autoscroll( const IntPoint&);376 void autoscroll(); 377 377 378 378 void resize(const PlatformMouseEvent&, const LayoutSize&); -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r139216 r139503 555 555 } 556 556 557 void RenderListBox::autoscroll( const IntPoint&)557 void RenderListBox::autoscroll() 558 558 { 559 559 IntPoint pos = frame()->view()->windowToContents(frame()->eventHandler()->lastKnownMousePosition()); -
trunk/Source/WebCore/rendering/RenderListBox.h
r139044 r139503 85 85 86 86 virtual bool canBeProgramaticallyScrolled() const { return true; } 87 virtual void autoscroll( const IntPoint&);87 virtual void autoscroll(); 88 88 virtual void stopAutoscroll(); 89 89 -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp
r139044 r139503 382 382 } 383 383 384 void RenderTextControlSingleLine::autoscroll( const IntPoint& position)384 void RenderTextControlSingleLine::autoscroll() 385 385 { 386 386 RenderLayer* layer = innerTextElement()->renderBox()->layer(); 387 387 if (layer) 388 layer->autoscroll( position);388 layer->autoscroll(); 389 389 } 390 390 -
trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h
r139044 r139503 59 59 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE; 60 60 61 virtual void autoscroll( const IntPoint&);61 virtual void autoscroll(); 62 62 63 63 // Subclassed to forward to our inner div. -
trunk/Source/WebKit/chromium/ChangeLog
r139494 r139503 1 2013-01-11 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r139044. 4 http://trac.webkit.org/changeset/139044 5 https://bugs.webkit.org/show_bug.cgi?id=106702 6 7 Caused various scrolling anomolies on Mac with drag and drop 8 (Requested by smfr on #webkit). 9 10 * src/WebViewImpl.cpp: 11 (WebKit::WebViewImpl::WebViewImpl): 12 (WebKit::WebViewImpl::dragSourceEndedAt): 13 (WebKit::WebViewImpl::dragSourceMovedTo): 14 (WebKit::WebViewImpl::dragTargetDrop): 15 (WebKit::WebViewImpl::dragTargetDragEnterOrOver): 16 * src/WebViewImpl.h: 17 (WebKit): 18 1 19 2013-01-11 Tony Chang <tony@chromium.org> 2 20 -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r139252 r139503 54 54 #include "DragController.h" 55 55 #include "DragData.h" 56 #include "DragScrollTimer.h" 56 57 #include "DragSession.h" 57 58 #include "Editor.h" … … 414 415 , m_isTransparent(false) 415 416 , m_tabsToLinks(false) 417 , m_dragScrollTimer(adoptPtr(new DragScrollTimer)) 416 418 , m_isCancelingFullScreen(false) 417 419 , m_benchmarkSupport(this) … … 3237 3239 m_page->mainFrame()->eventHandler()->dragSourceEndedAt(pme, 3238 3240 static_cast<DragOperation>(operation)); 3241 m_dragScrollTimer->stop(); 3239 3242 } 3240 3243 … … 3244 3247 WebDragOperation operation) 3245 3248 { 3249 m_dragScrollTimer->triggerScroll(mainFrameImpl()->frameView(), clientPoint); 3246 3250 } 3247 3251 … … 3329 3333 m_dragOperation = WebDragOperationNone; 3330 3334 m_currentDragData = 0; 3335 3336 m_dragScrollTimer->stop(); 3331 3337 } 3332 3338 … … 3355 3361 3356 3362 m_dragOperation = static_cast<WebDragOperation>(dropEffect); 3363 3364 if (dragAction == DragOver) 3365 m_dragScrollTimer->triggerScroll(mainFrameImpl()->frameView(), clientPoint); 3366 else 3367 m_dragScrollTimer->stop(); 3357 3368 3358 3369 return m_dragOperation; -
trunk/Source/WebKit/chromium/src/WebViewImpl.h
r139252 r139503 92 92 class ContextMenuClientImpl; 93 93 class DeviceOrientationClientProxy; 94 class DragScrollTimer; 94 95 class GeolocationClientProxy; 95 96 class LinkHighlight; … … 817 818 typedef HashMap<WTF::String, WTF::String> SettingsMap; 818 819 OwnPtr<SettingsMap> m_inspectorSettingsMap; 820 OwnPtr<DragScrollTimer> m_dragScrollTimer; 819 821 820 822 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
Note: See TracChangeset
for help on using the changeset viewer.