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 15 matching lines...) Expand all Loading... |
26 #include "config.h" | 26 #include "config.h" |
27 #include "core/platform/Scrollbar.h" | 27 #include "core/platform/Scrollbar.h" |
28 | 28 |
29 #include <algorithm> | 29 #include <algorithm> |
30 #include "core/platform/ScrollAnimator.h" | 30 #include "core/platform/ScrollAnimator.h" |
31 #include "core/platform/ScrollableArea.h" | 31 #include "core/platform/ScrollableArea.h" |
32 #include "core/platform/ScrollbarTheme.h" | 32 #include "core/platform/ScrollbarTheme.h" |
33 #include "core/platform/graphics/GraphicsContext.h" | 33 #include "core/platform/graphics/GraphicsContext.h" |
34 | 34 |
35 // FIXME: The following #includes are a layering violation and should be removed
. | 35 // FIXME: The following #includes are a layering violation and should be removed
. |
36 #include "core/accessibility/AXObjectCache.h" | |
37 #include "core/page/EventHandler.h" | 36 #include "core/page/EventHandler.h" |
38 #include "core/frame/Frame.h" | 37 #include "core/frame/Frame.h" |
39 #include "core/frame/FrameView.h" | 38 #include "core/frame/FrameView.h" |
40 | 39 |
41 #include "platform/PlatformGestureEvent.h" | 40 #include "platform/PlatformGestureEvent.h" |
42 #include "platform/PlatformMouseEvent.h" | 41 #include "platform/PlatformMouseEvent.h" |
43 | 42 |
44 using namespace std; | 43 using namespace std; |
45 | 44 |
46 #if OS(POSIX) && !OS(MACOSX) | 45 #if OS(POSIX) && !OS(MACOSX) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // scrollbar thickness and use it when sizing scrollbars (rather than leavin
g one dimension of the scrollbar | 85 // scrollbar thickness and use it when sizing scrollbars (rather than leavin
g one dimension of the scrollbar |
87 // alone when sizing). | 86 // alone when sizing). |
88 int thickness = m_theme->scrollbarThickness(controlSize); | 87 int thickness = m_theme->scrollbarThickness(controlSize); |
89 Widget::setFrameRect(IntRect(0, 0, thickness, thickness)); | 88 Widget::setFrameRect(IntRect(0, 0, thickness, thickness)); |
90 | 89 |
91 m_currentPos = scrollableAreaCurrentPos(); | 90 m_currentPos = scrollableAreaCurrentPos(); |
92 } | 91 } |
93 | 92 |
94 Scrollbar::~Scrollbar() | 93 Scrollbar::~Scrollbar() |
95 { | 94 { |
96 if (AXObjectCache* cache = existingAXObjectCache()) | |
97 cache->remove(this); | |
98 | |
99 stopTimerIfNeeded(); | 95 stopTimerIfNeeded(); |
100 | 96 |
101 m_theme->unregisterScrollbar(this); | 97 m_theme->unregisterScrollbar(this); |
102 } | 98 } |
103 | 99 |
104 void Scrollbar::removeFromParent() | 100 void Scrollbar::removeFromParent() |
105 { | 101 { |
106 if (parent()) | 102 if (parent()) |
107 toScrollView(parent())->removeChild(this); | 103 toScrollView(parent())->removeChild(this); |
108 } | 104 } |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 if (!isOverlayScrollbar()) | 547 if (!isOverlayScrollbar()) |
552 return true; | 548 return true; |
553 return m_scrollableArea->scrollAnimator()->shouldScrollbarParticipateInHitTe
sting(this); | 549 return m_scrollableArea->scrollAnimator()->shouldScrollbarParticipateInHitTe
sting(this); |
554 } | 550 } |
555 | 551 |
556 bool Scrollbar::isWindowActive() const | 552 bool Scrollbar::isWindowActive() const |
557 { | 553 { |
558 return m_scrollableArea && m_scrollableArea->isActive(); | 554 return m_scrollableArea && m_scrollableArea->isActive(); |
559 } | 555 } |
560 | 556 |
561 AXObjectCache* Scrollbar::existingAXObjectCache() const | |
562 { | |
563 if (!parentScrollView()) | |
564 return 0; | |
565 | |
566 return parentScrollView()->axObjectCache(); | |
567 } | |
568 | |
569 void Scrollbar::invalidateRect(const IntRect& rect) | 557 void Scrollbar::invalidateRect(const IntRect& rect) |
570 { | 558 { |
571 if (suppressInvalidation()) | 559 if (suppressInvalidation()) |
572 return; | 560 return; |
573 | 561 |
574 if (m_scrollableArea) | 562 if (m_scrollableArea) |
575 m_scrollableArea->invalidateScrollbar(this, rect); | 563 m_scrollableArea->invalidateScrollbar(this, rect); |
576 } | 564 } |
577 | 565 |
578 IntRect Scrollbar::convertToContainingView(const IntRect& localRect) const | 566 IntRect Scrollbar::convertToContainingView(const IntRect& localRect) const |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 if (!m_scrollableArea) | 600 if (!m_scrollableArea) |
613 return 0; | 601 return 0; |
614 | 602 |
615 if (m_orientation == HorizontalScrollbar) | 603 if (m_orientation == HorizontalScrollbar) |
616 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu
mScrollPosition().x(); | 604 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu
mScrollPosition().x(); |
617 | 605 |
618 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr
ollPosition().y(); | 606 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr
ollPosition().y(); |
619 } | 607 } |
620 | 608 |
621 } // namespace WebCore | 609 } // namespace WebCore |
OLD | NEW |