OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 void AXScrollView::updateScrollbars() | 97 void AXScrollView::updateScrollbars() |
98 { | 98 { |
99 if (!m_scrollView) | 99 if (!m_scrollView) |
100 return; | 100 return; |
101 | 101 |
102 if (m_scrollView->horizontalScrollbar() && !m_horizontalScrollbar) { | 102 if (m_scrollView->horizontalScrollbar() && !m_horizontalScrollbar) { |
103 m_horizontalScrollbar = addChildScrollbar(m_scrollView->horizontalScroll
bar()); | 103 m_horizontalScrollbar = addChildScrollbar(m_scrollView->horizontalScroll
bar()); |
104 } else if (!m_scrollView->horizontalScrollbar() && m_horizontalScrollbar) { | 104 } else if (!m_scrollView->horizontalScrollbar() && m_horizontalScrollbar) { |
105 removeChildScrollbar(m_horizontalScrollbar.get()); | 105 removeChildScrollbar(m_horizontalScrollbar.get()); |
106 m_horizontalScrollbar = 0; | 106 m_horizontalScrollbar = nullptr; |
107 } | 107 } |
108 | 108 |
109 if (m_scrollView->verticalScrollbar() && !m_verticalScrollbar) { | 109 if (m_scrollView->verticalScrollbar() && !m_verticalScrollbar) { |
110 m_verticalScrollbar = addChildScrollbar(m_scrollView->verticalScrollbar(
)); | 110 m_verticalScrollbar = addChildScrollbar(m_scrollView->verticalScrollbar(
)); |
111 } else if (!m_scrollView->verticalScrollbar() && m_verticalScrollbar) { | 111 } else if (!m_scrollView->verticalScrollbar() && m_verticalScrollbar) { |
112 removeChildScrollbar(m_verticalScrollbar.get()); | 112 removeChildScrollbar(m_verticalScrollbar.get()); |
113 m_verticalScrollbar = 0; | 113 m_verticalScrollbar = nullptr; |
114 } | 114 } |
115 } | 115 } |
116 | 116 |
117 void AXScrollView::removeChildScrollbar(AXObject* scrollbar) | 117 void AXScrollView::removeChildScrollbar(AXObject* scrollbar) |
118 { | 118 { |
119 size_t pos = m_children.find(scrollbar); | 119 size_t pos = m_children.find(scrollbar); |
120 if (pos != kNotFound) { | 120 if (pos != kNotFound) { |
121 m_children[pos]->detachFromParent(); | 121 m_children[pos]->detachFromParent(); |
122 m_children.remove(pos); | 122 m_children.remove(pos); |
123 } | 123 } |
124 } | 124 } |
125 | 125 |
126 AXScrollbar* AXScrollView::addChildScrollbar(Scrollbar* scrollbar) | 126 AXScrollbar* AXScrollView::addChildScrollbar(Scrollbar* scrollbar) |
127 { | 127 { |
128 if (!scrollbar) | 128 if (!scrollbar) |
129 return 0; | 129 return 0; |
130 | 130 |
131 AXScrollbar* scrollBarObject = toAXScrollbar(axObjectCache()->getOrCreate(sc
rollbar)); | 131 AXScrollbar* scrollBarObject = toAXScrollbar(axObjectCache()->getOrCreate(sc
rollbar)); |
132 scrollBarObject->setParent(this); | 132 scrollBarObject->setParent(this); |
133 m_children.append(scrollBarObject); | 133 m_children.append(scrollBarObject); |
134 return scrollBarObject; | 134 return scrollBarObject; |
135 } | 135 } |
136 | 136 |
137 void AXScrollView::clearChildren() | 137 void AXScrollView::clearChildren() |
138 { | 138 { |
139 AXObject::clearChildren(); | 139 AXObject::clearChildren(); |
140 m_verticalScrollbar = 0; | 140 m_verticalScrollbar = nullptr; |
141 m_horizontalScrollbar = 0; | 141 m_horizontalScrollbar = nullptr; |
142 } | 142 } |
143 | 143 |
144 bool AXScrollView::computeAccessibilityIsIgnored() const | 144 bool AXScrollView::computeAccessibilityIsIgnored() const |
145 { | 145 { |
146 AXObject* webArea = webAreaObject(); | 146 AXObject* webArea = webAreaObject(); |
147 if (!webArea) | 147 if (!webArea) |
148 return true; | 148 return true; |
149 | 149 |
150 return webArea->accessibilityIsIgnored(); | 150 return webArea->accessibilityIsIgnored(); |
151 } | 151 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 return m_scrollView; | 233 return m_scrollView; |
234 } | 234 } |
235 | 235 |
236 void AXScrollView::scrollTo(const IntPoint& point) const | 236 void AXScrollView::scrollTo(const IntPoint& point) const |
237 { | 237 { |
238 if (m_scrollView) | 238 if (m_scrollView) |
239 m_scrollView->setScrollPosition(point); | 239 m_scrollView->setScrollPosition(point); |
240 } | 240 } |
241 | 241 |
242 } // namespace WebCore | 242 } // namespace WebCore |
OLD | NEW |