OLD | NEW |
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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 bool isCaptured = m_pressedPart == ThumbPart; | 465 bool isCaptured = m_pressedPart == ThumbPart; |
466 setPressedPart(NoPart); | 466 setPressedPart(NoPart); |
467 m_pressedPos = 0; | 467 m_pressedPos = 0; |
468 m_draggingDocument = false; | 468 m_draggingDocument = false; |
469 stopTimerIfNeeded(); | 469 stopTimerIfNeeded(); |
470 | 470 |
471 if (m_scrollableArea) { | 471 if (m_scrollableArea) { |
472 if (isCaptured) | 472 if (isCaptured) |
473 m_scrollableArea->mouseReleasedScrollbar(); | 473 m_scrollableArea->mouseReleasedScrollbar(); |
474 | 474 |
475 // m_hoveredPart won't be updated until the next mouseMoved or mouseDown, so | |
476 // we have to hit test to really know if the mouse has exited the scrollbar | |
477 // on a mouseUp. | |
478 ScrollbarPart part = theme().hitTest(*this, mouseEvent.position()); | 475 ScrollbarPart part = theme().hitTest(*this, mouseEvent.position()); |
479 if (part == NoPart) | 476 if (part == NoPart) { |
| 477 setHoveredPart(NoPart); |
480 m_scrollableArea->mouseExitedScrollbar(*this); | 478 m_scrollableArea->mouseExitedScrollbar(*this); |
| 479 } |
481 } | 480 } |
482 } | 481 } |
483 | 482 |
484 void Scrollbar::mouseDown(const PlatformMouseEvent& evt) { | 483 void Scrollbar::mouseDown(const PlatformMouseEvent& evt) { |
485 // Early exit for right click | 484 // Early exit for right click |
486 if (evt.pointerProperties().button == WebPointerProperties::Button::Right) | 485 if (evt.pointerProperties().button == WebPointerProperties::Button::Right) |
487 return; | 486 return; |
488 | 487 |
489 setPressedPart(theme().hitTest(*this, evt.position())); | 488 setPressedPart(theme().hitTest(*this, evt.position())); |
490 int pressedPos = orientation() == HorizontalScrollbar | 489 int pressedPos = orientation() == HorizontalScrollbar |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 invalidParts = AllParts; | 622 invalidParts = AllParts; |
624 if (invalidParts & ~ThumbPart) | 623 if (invalidParts & ~ThumbPart) |
625 m_trackNeedsRepaint = true; | 624 m_trackNeedsRepaint = true; |
626 if (invalidParts & ThumbPart) | 625 if (invalidParts & ThumbPart) |
627 m_thumbNeedsRepaint = true; | 626 m_thumbNeedsRepaint = true; |
628 if (m_scrollableArea) | 627 if (m_scrollableArea) |
629 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation()); | 628 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation()); |
630 } | 629 } |
631 | 630 |
632 } // namespace blink | 631 } // namespace blink |
OLD | NEW |