Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: Source/platform/scroll/Scrollbar.cpp

Issue 302603009: Fix scrollbar thumb drag cancellation in RTL mode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add test comment Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/platform/mac/fast/overflow/rtl-scrollbar-drag-origin-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 // By default, we assume that gestures don't deselect the scrollbar. 385 // By default, we assume that gestures don't deselect the scrollbar.
386 return true; 386 return true;
387 } 387 }
388 } 388 }
389 389
390 void Scrollbar::mouseMoved(const PlatformMouseEvent& evt) 390 void Scrollbar::mouseMoved(const PlatformMouseEvent& evt)
391 { 391 {
392 if (m_pressedPart == ThumbPart) { 392 if (m_pressedPart == ThumbPart) {
393 if (theme()->shouldSnapBackToDragOrigin(this, evt)) { 393 if (theme()->shouldSnapBackToDragOrigin(this, evt)) {
394 if (m_scrollableArea) 394 if (m_scrollableArea)
395 m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation, m_dragOrigin); 395 m_scrollableArea->scrollToOffsetWithoutAnimation(m_orientation, m_dragOrigin + m_scrollableArea->minimumScrollPosition(m_orientation));
396 } else { 396 } else {
397 moveThumb(m_orientation == HorizontalScrollbar ? 397 moveThumb(m_orientation == HorizontalScrollbar ?
398 convertFromContainingWindow(evt.position()).x() : 398 convertFromContainingWindow(evt.position()).x() :
399 convertFromContainingWindow(evt.position()).y(), theme()-> shouldDragDocumentInsteadOfThumb(this, evt)); 399 convertFromContainingWindow(evt.position()).y(), theme()-> shouldDragDocumentInsteadOfThumb(this, evt));
400 } 400 }
401 return; 401 return;
402 } 402 }
403 403
404 if (m_pressedPart != NoPart) 404 if (m_pressedPart != NoPart)
405 m_pressedPos = orientation() == HorizontalScrollbar ? convertFromContain ingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y(); 405 m_pressedPos = orientation() == HorizontalScrollbar ? convertFromContain ingWindow(evt.position()).x() : convertFromContainingWindow(evt.position()).y();
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 if (!m_scrollableArea) 597 if (!m_scrollableArea)
598 return 0; 598 return 0;
599 599
600 if (m_orientation == HorizontalScrollbar) 600 if (m_orientation == HorizontalScrollbar)
601 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu mScrollPosition().x(); 601 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu mScrollPosition().x();
602 602
603 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr ollPosition().y(); 603 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr ollPosition().y();
604 } 604 }
605 605
606 } // namespace WebCore 606 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/platform/mac/fast/overflow/rtl-scrollbar-drag-origin-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698