Changeset 102062 in webkit
- Timestamp:
- Dec 5, 2011 4:10:55 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r102059 r102062 1 2011-12-05 Mario Sanchez Prada <msanchez@igalia.com> 2 3 [GTK] Move emissions of AtkDocument signals down to WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=73750 5 6 Reviewed by Chris Fleizach. 7 8 Implement the needed infrastructure to allow notifying 9 accessibility, in a cross-platform way, when a event related to 10 the load of a document happens. Added a generic method, which will 11 be called from the FrameLoader, and platform specific versions of 12 it so every port has a chance to decide what to do with those 13 notifications. 14 15 This patch doesn't include a new test because the one testing this 16 functionality is the GTK-specific unit test added along with patch 17 for bug 73746: testWebkitAtkDocumentLoadingEvents. 18 19 * accessibility/AXObjectCache.h: 20 (WebCore::AXObjectCache::frameLoadingEventNotification): New, called 21 from the FrameLoader to notify accessibility when an event happens. 22 (WebCore::AXObjectCache::frameLoadingEventPlatformNotification): New, 23 platform specific function to let ports decide what to do. 24 * accessibility/AXObjectCache.cpp: 25 (WebCore::AXObjectCache::frameLoadingEventNotification): New. 26 * accessibility/chromium/AXObjectCacheChromium.cpp: 27 (WebCore::AXObjectCache::frameLoadingEventPlatformNotification): Dummy 28 implementation of the platform specific function for chromium. 29 * accessibility/gtk/AXObjectCacheAtk.cpp: 30 (WebCore::AXObjectCache::frameLoadingEventPlatformNotification): 31 * accessibility/mac/AXObjectCacheMac.mm: 32 (WebCore::AXObjectCache::frameLoadingEventPlatformNotification): Dummy 33 implementation of the platform specific function for the Mac. 34 * accessibility/win/AXObjectCacheWin.cpp: 35 (WebCore::AXObjectCache::frameLoadingEventPlatformNotification): Dummy 36 implementation of the platform specific function for Windows. 37 38 * loader/FrameLoader.cpp: 39 (WebCore::FrameLoader::prepareForLoadStart): Notify accessibility 40 by calling the new frameLoadingEventNotification() function. 41 (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Ditto. 42 1 43 2011-12-05 Benjamin Poulain <benjamin@webkit.org> 2 44 -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r101855 r102062 545 545 nodeTextChangePlatformNotification(obj, textChange, offset, text); 546 546 } 547 548 void AXObjectCache::frameLoadingEventNotification(Frame* frame, AXLoadingEvent loadingEvent) 549 { 550 if (!frame) 551 return; 552 553 // Delegate on the right platform 554 RenderView* contentRenderer = frame->contentRenderer(); 555 if (!contentRenderer) 556 return; 557 558 AccessibilityObject* obj = getOrCreate(contentRenderer); 559 frameLoadingEventPlatformNotification(obj, loadingEvent); 560 } 547 561 #endif 548 562 -
trunk/Source/WebCore/accessibility/AXObjectCache.h
r101855 r102062 150 150 void nodeTextChangeNotification(RenderObject*, AXTextChange, unsigned offset, const String&); 151 151 152 enum AXLoadingEvent { 153 AXLoadingStarted, 154 AXLoadingReloaded, 155 AXLoadingFailed, 156 AXLoadingFinished 157 }; 158 159 void frameLoadingEventNotification(Frame*, AXLoadingEvent); 160 152 161 bool nodeHasRole(Node*, const AtomicString& role); 153 162 … … 155 164 void postPlatformNotification(AccessibilityObject*, AXNotification); 156 165 void nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned offset, const String&); 166 void frameLoadingEventPlatformNotification(AccessibilityObject*, AXLoadingEvent); 157 167 158 168 private: … … 190 200 inline void AXObjectCache::nodeTextChangeNotification(RenderObject*, AXTextChange, unsigned, const String&) { } 191 201 inline void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, const String&) { } 202 inline void AXObjectCache::frameLoadingEventNotification(Frame*, AXLoadingEvent) { } 203 inline void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject*, AXLoadingEvent) { } 192 204 inline void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject*) { } 193 205 inline void AXObjectCache::handleScrolledToAnchor(const Node*) { } -
trunk/Source/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
r101349 r102062 108 108 } 109 109 110 void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject*, AXLoadingEvent) 111 { 112 } 113 110 114 void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject* newFocusedRenderer) 111 115 { -
trunk/Source/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp
r101349 r102062 182 182 void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject* object, AXTextChange textChange, unsigned offset, const String& text) 183 183 { 184 // Sanity check185 184 if (!object || !object->isAccessibilityRenderObject() || text.isEmpty()) 186 185 return; … … 189 188 RefPtr<Range> range = Range::create(node->document(), node->parentNode(), 0, node, 0); 190 189 emitTextChanged(object, textChange, offset + TextIterator::rangeLength(range.get()), text); 190 } 191 192 void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject* object, AXLoadingEvent loadingEvent) 193 { 194 if (!object) 195 return; 196 197 AtkObject* axObject = object->wrapper(); 198 if (!axObject || !ATK_IS_DOCUMENT(axObject)) 199 return; 200 201 switch (loadingEvent) { 202 case AXObjectCache::AXLoadingStarted: 203 g_signal_emit_by_name(axObject, "state-change", "busy", true); 204 break; 205 case AXObjectCache::AXLoadingReloaded: 206 g_signal_emit_by_name(axObject, "state-change", "busy", true); 207 g_signal_emit_by_name(axObject, "reload"); 208 break; 209 case AXObjectCache::AXLoadingFailed: 210 g_signal_emit_by_name(axObject, "load-stopped"); 211 g_signal_emit_by_name(axObject, "state-change", "busy", false); 212 break; 213 case AXObjectCache::AXLoadingFinished: 214 g_signal_emit_by_name(axObject, "load-complete"); 215 g_signal_emit_by_name(axObject, "state-change", "busy", false); 216 break; 217 } 191 218 } 192 219 -
trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
r101349 r102062 133 133 } 134 134 135 void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject*, AXLoadingEvent) 136 { 137 } 138 135 139 void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject*) 136 140 { -
trunk/Source/WebCore/accessibility/win/AXObjectCacheWin.cpp
r101349 r102062 112 112 } 113 113 114 void AXObjectCache::frameLoadingEventPlatformNotification(AccessibilityObject*, AXLoadingEvent) 115 { 116 } 117 114 118 AXID AXObjectCache::platformGenerateAXID() const 115 119 { -
trunk/Source/WebCore/loader/FrameLoader.cpp
r101486 r102062 36 36 #include "FrameLoader.h" 37 37 38 #include "AXObjectCache.h" 38 39 #include "ApplicationCacheHost.h" 39 40 #include "BackForwardController.h" … … 1115 1116 page->progress()->progressStarted(m_frame); 1116 1117 m_client->dispatchDidStartProvisionalLoad(); 1118 1119 // Notify accessibility. 1120 if (AXObjectCache::accessibilityEnabled()) { 1121 AXObjectCache::AXLoadingEvent loadingEvent = loadType() == FrameLoadTypeReload ? AXObjectCache::AXLoadingReloaded : AXObjectCache::AXLoadingStarted; 1122 m_frame->document()->axObjectCache()->frameLoadingEventNotification(m_frame, loadingEvent); 1123 } 1117 1124 } 1118 1125 … … 2270 2277 2271 2278 const ResourceError& error = dl->mainDocumentError(); 2272 if (!error.isNull()) 2279 2280 AXObjectCache::AXLoadingEvent loadingEvent; 2281 if (!error.isNull()) { 2273 2282 m_client->dispatchDidFailLoad(error); 2274 else 2283 loadingEvent = AXObjectCache::AXLoadingFailed; 2284 } else { 2275 2285 m_client->dispatchDidFinishLoad(); 2286 loadingEvent = AXObjectCache::AXLoadingFinished; 2287 } 2288 2289 // Notify accessibility. 2290 if (AXObjectCache::accessibilityEnabled()) 2291 m_frame->document()->axObjectCache()->frameLoadingEventNotification(m_frame, loadingEvent); 2276 2292 2277 2293 return; -
trunk/Source/WebKit/gtk/ChangeLog
r101960 r102062 1 2011-12-05 Mario Sanchez Prada <msanchez@igalia.com> 2 3 [GTK] Move emissions of AtkDocument signals down to WebCore 4 https://bugs.webkit.org/show_bug.cgi?id=73750 5 6 Reviewed by Chris Fleizach. 7 8 Removed code for emission of AtkDocument signals. 9 10 * WebCoreSupport/FrameLoaderClientGtk.cpp: 11 (WebKit::notifyStatus): Removed no longer used code. 12 1 13 2011-12-04 Mario Sanchez Prada <msanchez@igalia.com> 2 14 -
trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
r101933 r102062 27 27 #include "FrameLoaderClientGtk.h" 28 28 29 #include "AXObjectCache.h"30 #include "AccessibilityObject.h"31 29 #include "ArchiveResource.h" 32 30 #include "CachedFrame.h" … … 125 123 } 126 124 127 static void notifyAccessibilityStatus(WebKitWebFrame* frame, WebKitLoadStatus loadStatus)128 {129 if (loadStatus != WEBKIT_LOAD_PROVISIONAL130 && loadStatus != WEBKIT_LOAD_FAILED131 && loadStatus != WEBKIT_LOAD_FINISHED)132 return;133 134 WebKitWebFramePrivate* priv = frame->priv;135 if (!priv->coreFrame || !priv->coreFrame->document())136 return;137 138 RenderView* contentRenderer = priv->coreFrame->contentRenderer();139 if (!contentRenderer)140 return;141 142 AXObjectCache* axObjectCache = priv->coreFrame->document()->axObjectCache();143 if (!axObjectCache)144 return;145 146 AccessibilityObject* coreAxObject = axObjectCache->getOrCreate(contentRenderer);147 if (!coreAxObject)148 return;149 150 AtkObject* axObject = coreAxObject->wrapper();151 if (!axObject || !ATK_IS_DOCUMENT(axObject))152 return;153 154 switch (loadStatus) {155 case WEBKIT_LOAD_PROVISIONAL:156 g_signal_emit_by_name(axObject, "state-change", "busy", true);157 if (core(frame)->loader()->loadType() == FrameLoadTypeReload)158 g_signal_emit_by_name(axObject, "reload");159 break;160 case WEBKIT_LOAD_FAILED:161 g_signal_emit_by_name(axObject, "load-stopped");162 g_signal_emit_by_name(axObject, "state-change", "busy", false);163 break;164 case WEBKIT_LOAD_FINISHED:165 g_signal_emit_by_name(axObject, "load-complete");166 g_signal_emit_by_name(axObject, "state-change", "busy", false);167 default:168 break;169 }170 }171 172 125 static void notifyStatus(WebKitWebFrame* frame, WebKitLoadStatus loadStatus) 173 126 { … … 179 132 webView->priv->loadStatus = loadStatus; 180 133 g_object_notify(G_OBJECT(webView), "load-status"); 181 182 if (AXObjectCache::accessibilityEnabled())183 notifyAccessibilityStatus(frame, loadStatus);184 134 } 185 135 }
Note: See TracChangeset
for help on using the changeset viewer.