OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 26 matching lines...) Expand all Loading... |
37 : m_scrollbar(scrollbar) | 37 : m_scrollbar(scrollbar) |
38 { | 38 { |
39 ASSERT(scrollbar); | 39 ASSERT(scrollbar); |
40 } | 40 } |
41 | 41 |
42 PassRefPtr<AccessibilityScrollbar> AccessibilityScrollbar::create(Scrollbar* scr
ollbar) | 42 PassRefPtr<AccessibilityScrollbar> AccessibilityScrollbar::create(Scrollbar* scr
ollbar) |
43 { | 43 { |
44 return adoptRef(new AccessibilityScrollbar(scrollbar)); | 44 return adoptRef(new AccessibilityScrollbar(scrollbar)); |
45 } | 45 } |
46 | 46 |
47 LayoutRect AccessibilityScrollbar::elementRect() const | 47 LayoutRect AccessibilityScrollbar::elementRect() |
48 { | 48 { |
49 if (!m_scrollbar) | 49 if (!m_scrollbar) |
50 return LayoutRect(); | 50 return LayoutRect(); |
51 | 51 |
52 return m_scrollbar->frameRect(); | 52 return m_scrollbar->frameRect(); |
53 } | 53 } |
54 | 54 |
55 Document* AccessibilityScrollbar::document() const | 55 Document* AccessibilityScrollbar::document() const |
56 { | 56 { |
57 AccessibilityObject* parent = parentObject(); | 57 AccessibilityObject* parent = parentObject(); |
58 if (!parent) | 58 if (!parent) |
59 return 0; | 59 return 0; |
60 return parent->document(); | 60 return parent->document(); |
61 } | 61 } |
62 | 62 |
63 AccessibilityOrientation AccessibilityScrollbar::orientation() const | 63 AccessibilityOrientation AccessibilityScrollbar::orientation() |
64 { | 64 { |
65 if (!m_scrollbar) | 65 if (!m_scrollbar) |
66 return AccessibilityOrientationHorizontal; | 66 return AccessibilityOrientationHorizontal; |
67 | 67 |
68 if (m_scrollbar->orientation() == HorizontalScrollbar) | 68 if (m_scrollbar->orientation() == HorizontalScrollbar) |
69 return AccessibilityOrientationHorizontal; | 69 return AccessibilityOrientationHorizontal; |
70 if (m_scrollbar->orientation() == VerticalScrollbar) | 70 if (m_scrollbar->orientation() == VerticalScrollbar) |
71 return AccessibilityOrientationVertical; | 71 return AccessibilityOrientationVertical; |
72 | 72 |
73 return AccessibilityOrientationHorizontal; | 73 return AccessibilityOrientationHorizontal; |
(...skipping 20 matching lines...) Expand all Loading... |
94 return; | 94 return; |
95 | 95 |
96 if (!m_scrollbar->scrollableArea()) | 96 if (!m_scrollbar->scrollableArea()) |
97 return; | 97 return; |
98 | 98 |
99 float newValue = value * m_scrollbar->maximum(); | 99 float newValue = value * m_scrollbar->maximum(); |
100 m_scrollbar->scrollableArea()->scrollToOffsetWithoutAnimation(m_scrollbar->o
rientation(), newValue); | 100 m_scrollbar->scrollableArea()->scrollToOffsetWithoutAnimation(m_scrollbar->o
rientation(), newValue); |
101 } | 101 } |
102 | 102 |
103 } // namespace WebCore | 103 } // namespace WebCore |
OLD | NEW |