Changeset 60695 in webkit
- Timestamp:
- Jun 4, 2010 12:13:41 PM (14 years ago)
- Location:
- trunk/WebKit/chromium
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/chromium/ChangeLog
r60692 r60695 1 2010-06-04 Jay Civelli <jcivelli@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 Accessibility focus change notifications are now sent from 6 ChromeClientImpl::focusedNodeChanged(). 7 https://bugs.webkit.org/show_bug.cgi?id=39792 8 9 * src/ChromeClientImpl.cpp: 10 (WebKit::ChromeClientImpl::focus): 11 (WebKit::ChromeClientImpl::focusedNodeChanged): 12 1 13 2010-06-04 Jay Civelli <jcivelli@chromium.org> 2 14 -
trunk/WebKit/chromium/src/ChromeClientImpl.cpp
r60044 r60695 160 160 void ChromeClientImpl::focus() 161 161 { 162 if (!m_webView->client()) 163 return; 164 165 m_webView->client()->didFocus(); 166 167 // If accessibility is enabled, we should notify assistive technology that 168 // the active AccessibilityObject changed. 169 const Frame* frame = m_webView->focusedWebCoreFrame(); 170 if (!frame) 171 return; 172 173 Document* doc = frame->document(); 174 175 if (doc && doc->axObjectCache()->accessibilityEnabled()) { 176 Node* focusedNode = m_webView->focusedWebCoreNode(); 177 178 if (!focusedNode) { 179 // Could not retrieve focused Node. 180 return; 181 } 182 183 // Retrieve the focused AccessibilityObject. 184 AccessibilityObject* focusedAccObj = 185 doc->axObjectCache()->getOrCreate(focusedNode->renderer()); 186 187 // Alert assistive technology that focus changed. 188 if (focusedAccObj) 189 m_webView->client()->focusAccessibilityObject(WebAccessibilityObject(focusedAccObj)); 190 } 162 if (m_webView->client()) 163 m_webView->client()->didFocus(); 191 164 } 192 165 … … 218 191 m_webView->client()->focusedNodeChanged(WebNode(node)); 219 192 220 WebURL focus _url;193 WebURL focusURL; 221 194 if (node && node->isLink()) { 222 195 // This HitTestResult hack is the easiest way to get a link URL out of a 223 196 // WebCore::Node. 224 HitTestResult hit _test(IntPoint(0, 0));197 HitTestResult hitTest(IntPoint(0, 0)); 225 198 // This cast must be valid because of the isLink() check. 226 hit_test.setURLElement(reinterpret_cast<Element*>(node)); 227 if (hit_test.isLiveLink()) 228 focus_url = hit_test.absoluteLinkURL(); 229 } 230 m_webView->client()->setKeyboardFocusURL(focus_url); 199 hitTest.setURLElement(static_cast<Element*>(node)); 200 if (hitTest.isLiveLink()) 201 focusURL = hitTest.absoluteLinkURL(); 202 } 203 m_webView->client()->setKeyboardFocusURL(focusURL); 204 205 if (!node) 206 return; 207 208 // If accessibility is enabled, we should notify assistive technology that 209 // the active AccessibilityObject changed. 210 Document* document = node->document(); 211 if (!document) { 212 ASSERT_NOT_REACHED(); 213 return; 214 } 215 if (document && document->axObjectCache()->accessibilityEnabled()) { 216 // Retrieve the focused AccessibilityObject. 217 AccessibilityObject* focusedAccObj = 218 document->axObjectCache()->getOrCreate(node->renderer()); 219 220 // Alert assistive technology that focus changed. 221 if (focusedAccObj) 222 m_webView->client()->focusAccessibilityObject(WebAccessibilityObject(focusedAccObj)); 223 } 231 224 } 232 225
Note: See TracChangeset
for help on using the changeset viewer.