Changeset 243928 in webkit
- Timestamp:
- Apr 5, 2019 12:35:24 AM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r243926 r243928 1 2019-04-05 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [ATK] Use a smart pointer for AccessibilityObject wrapper and remove GTK specific code 4 https://bugs.webkit.org/show_bug.cgi?id=196593 5 <rdar://problem/49599153> 6 7 Reviewed by Michael Catanzaro. 8 9 We have specific code for GTK to get/set the wrapper only because we don't use smart pointers. Also use 10 WebKitAccessible as AccessibilityObjectWrapper instead of generic AtkObject, to enforce wrappers to be 11 WebKitAccessible instances. This requires a few casts to AtkObject. 12 13 * accessibility/AccessibilityObject.h: 14 (WebCore::AccessibilityObject::setWrapper): 15 * accessibility/AccessibilityObjectInterface.h: 16 * accessibility/atk/AXObjectCacheAtk.cpp: 17 (WebCore::AXObjectCache::detachWrapper): 18 (WebCore::AXObjectCache::attachWrapper): 19 (WebCore::notifyChildrenSelectionChange): 20 (WebCore::AXObjectCache::postPlatformNotification): 21 (WebCore::AXObjectCache::nodeTextChangePlatformNotification): 22 (WebCore::AXObjectCache::frameLoadingEventPlatformNotification): 23 (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged): 24 * accessibility/atk/AccessibilityObjectAtk.cpp: 25 * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp: 26 (webkitAccessibleComponentRefAccessibleAtPoint): 27 * accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp: 28 (webkitAccessibleHypertextGetLink): 29 (webkitAccessibleHypertextGetNLinks): 30 * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp: 31 (webkitAccessibleSelectionRefSelection): 32 * accessibility/atk/WebKitAccessibleInterfaceTable.cpp: 33 (webkitAccessibleTableRefAt): 34 (webkitAccessibleTableGetColumnHeader): 35 (webkitAccessibleTableGetRowHeader): 36 (webkitAccessibleTableGetCaption): 37 * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp: 38 (convertToGPtrArray): 39 (webkitAccessibleTableCellGetTable): 40 * accessibility/atk/WebKitAccessibleInterfaceText.cpp: 41 (accessibilityObjectLength): 42 * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: 43 (setAtkRelationSetFromCoreObject): 44 (atkParentOfRootObject): 45 (webkitAccessibleGetParent): 46 (webkitAccessibleRefChild): 47 (isTextWithCaret): 48 * editing/atk/FrameSelectionAtk.cpp: 49 (WebCore::emitTextSelectionChange): 50 (WebCore::maybeEmitTextFocusChange): 51 1 52 2019-04-04 Simon Fraser <simon.fraser@apple.com> 2 53 -
trunk/Source/WebCore/accessibility/AccessibilityObject.h
r243603 r243928 46 46 #if PLATFORM(COCOA) 47 47 #include <wtf/RetainPtr.h> 48 #endif 49 50 #if PLATFORM(GTK) 51 #include <wtf/glib/GRefPtr.h> 48 52 #endif 49 53 … … 935 939 bool isDOMHidden() const; 936 940 bool isHidden() const { return isAXHidden() || isDOMHidden(); } 937 941 938 942 #if HAVE(ACCESSIBILITY) 939 #if PLATFORM(GTK)940 AccessibilityObjectWrapper* wrapper() const override;941 void setWrapper(AccessibilityObjectWrapper*);942 #else943 943 AccessibilityObjectWrapper* wrapper() const override { return m_wrapper.get(); } 944 void setWrapper(AccessibilityObjectWrapper* wrapper) 945 { 946 m_wrapper = wrapper; 947 } 948 #endif 949 #endif 950 944 void setWrapper(AccessibilityObjectWrapper* wrapper) { m_wrapper = wrapper; } 945 #endif 946 951 947 #if PLATFORM(COCOA) 952 948 void overrideAttachmentParent(AccessibilityObject* parent); … … 1051 1047 COMPtr<AccessibilityObjectWrapper> m_wrapper; 1052 1048 #elif PLATFORM(GTK) 1053 AtkObject* m_wrapper { nullptr };1049 GRefPtr<WebKitAccessible> m_wrapper; 1054 1050 #elif PLATFORM(WPE) 1055 1051 RefPtr<AccessibilityObjectWrapper> m_wrapper; -
trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h
r241989 r243928 38 38 typedef WebAccessibilityObjectWrapper AccessibilityObjectWrapper; 39 39 #elif PLATFORM(GTK) 40 typedef struct _ AtkObject AtkObject;41 typedef struct _ AtkObjectAccessibilityObjectWrapper;40 typedef struct _WebKitAccessible WebKitAccessible; 41 typedef struct _WebKitAccessible AccessibilityObjectWrapper; 42 42 #elif PLATFORM(WPE) 43 43 class AccessibilityObjectWrapper : public RefCounted<AccessibilityObjectWrapper> { }; -
trunk/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp
r243864 r243928 39 39 void AXObjectCache::detachWrapper(AccessibilityObject* obj, AccessibilityDetachmentType detachmentType) 40 40 { 41 AtkObject* wrapper = obj->wrapper();41 auto* wrapper = obj->wrapper(); 42 42 ASSERT(wrapper); 43 43 … … 67 67 void AXObjectCache::attachWrapper(AccessibilityObject* obj) 68 68 { 69 AtkObject* atkObj = ATK_OBJECT(webkitAccessibleNew(obj)); 70 obj->setWrapper(atkObj); 71 g_object_unref(atkObj); 69 GRefPtr<WebKitAccessible> wrapper = adoptGRef(webkitAccessibleNew(obj)); 70 obj->setWrapper(wrapper.get()); 72 71 73 72 // If an object is being attached and we are not in the middle of a layout update, then … … 95 94 96 95 // Look for the right object to emit the signal from. 97 AtkObject* atkParent = coreParent->wrapper();96 auto* atkParent = coreParent->wrapper(); 98 97 if (!atkParent) 99 98 return; 100 99 101 100 size_t index = coreParent->children(false).find(obj); 102 g_signal_emit_by_name(atkParent, "children-changed::add", index != notFound ? index : -1, atkObj);101 g_signal_emit_by_name(atkParent, "children-changed::add", index != notFound ? index : -1, wrapper.get()); 103 102 } 104 103 … … 169 168 oldFocusedObject.get() = nullptr; 170 169 171 AtkObject* axItem = item ? item->wrapper() : nullptr;172 AtkObject* axOldFocusedObject = oldFocusedObject.get() ? oldFocusedObject.get()->wrapper() : nullptr;170 WebKitAccessible* axItem = item ? item->wrapper() : nullptr; 171 WebKitAccessible* axOldFocusedObject = oldFocusedObject.get() ? oldFocusedObject.get()->wrapper() : nullptr; 173 172 174 173 // Old focused object just lost focus, so emit the events. 175 174 if (axOldFocusedObject && axItem != axOldFocusedObject) { 176 175 g_signal_emit_by_name(axOldFocusedObject, "focus-event", false); 177 atk_object_notify_state_change( axOldFocusedObject, ATK_STATE_FOCUSED, false);176 atk_object_notify_state_change(ATK_OBJECT(axOldFocusedObject), ATK_STATE_FOCUSED, false); 178 177 } 179 178 … … 181 180 if (axItem) { 182 181 bool isSelected = item->isSelected(); 183 atk_object_notify_state_change( axItem, ATK_STATE_SELECTED, isSelected);182 atk_object_notify_state_change(ATK_OBJECT(axItem), ATK_STATE_SELECTED, isSelected); 184 183 // When the selection changes in a collapsed widget such as a combo box 185 184 // whose child menu is not showing, that collapsed widget retains focus. 186 185 if (!object->isCollapsed()) { 187 186 g_signal_emit_by_name(axItem, "focus-event", isSelected); 188 atk_object_notify_state_change( axItem, ATK_STATE_FOCUSED, isSelected);187 atk_object_notify_state_change(ATK_OBJECT(axItem), ATK_STATE_FOCUSED, isSelected); 189 188 } 190 189 } … … 197 196 void AXObjectCache::postPlatformNotification(AccessibilityObject* coreObject, AXNotification notification) 198 197 { 199 AtkObject* axObject = coreObject->wrapper();198 auto* axObject = ATK_OBJECT(coreObject->wrapper()); 200 199 if (!axObject) 201 200 return; … … 232 231 #endif 233 232 234 g_signal_emit_by_name( ATK_OBJECT(axObject), "property-change::accessible-value", &propertyValues, NULL);233 g_signal_emit_by_name(axObject, "property-change::accessible-value", &propertyValues, NULL); 235 234 } 236 235 break; … … 300 299 return; 301 300 302 AtkObject* wrapper = parentObject->wrapper();301 auto* wrapper = parentObject->wrapper(); 303 302 if (!wrapper || !ATK_IS_TEXT(wrapper)) 304 303 return; … … 350 349 return; 351 350 352 AtkObject* axObject = object->wrapper();351 auto* axObject = ATK_OBJECT(object->wrapper()); 353 352 if (!axObject || !ATK_IS_DOCUMENT(axObject)) 354 353 return; … … 377 376 RefPtr<AccessibilityObject> oldObject = getOrCreate(oldFocusedNode); 378 377 if (oldObject) { 379 g_signal_emit_by_name(oldObject->wrapper(), "focus-event", false); 380 atk_object_notify_state_change(oldObject->wrapper(), ATK_STATE_FOCUSED, false); 378 auto* axObject = oldObject->wrapper(); 379 g_signal_emit_by_name(axObject, "focus-event", false); 380 atk_object_notify_state_change(ATK_OBJECT(axObject), ATK_STATE_FOCUSED, false); 381 381 } 382 382 RefPtr<AccessibilityObject> newObject = getOrCreate(newFocusedNode); 383 383 if (newObject) { 384 g_signal_emit_by_name(newObject->wrapper(), "focus-event", true); 385 atk_object_notify_state_change(newObject->wrapper(), ATK_STATE_FOCUSED, true); 384 auto* axObject = newObject->wrapper(); 385 g_signal_emit_by_name(axObject, "focus-event", true); 386 atk_object_notify_state_change(ATK_OBJECT(axObject), ATK_STATE_FOCUSED, true); 386 387 } 387 388 } -
trunk/Source/WebCore/accessibility/atk/AccessibilityObjectAtk.cpp
r225117 r243928 157 157 } 158 158 159 AccessibilityObjectWrapper* AccessibilityObject::wrapper() const160 {161 return m_wrapper;162 }163 164 void AccessibilityObject::setWrapper(AccessibilityObjectWrapper* wrapper)165 {166 if (wrapper == m_wrapper)167 return;168 169 if (m_wrapper)170 g_object_unref(m_wrapper);171 172 m_wrapper = wrapper;173 174 if (m_wrapper)175 g_object_ref(m_wrapper);176 }177 178 159 bool AccessibilityObject::allowsTextRanges() const 179 160 { -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceComponent.cpp
r241321 r243928 82 82 return 0; 83 83 g_object_ref(target->wrapper()); 84 return target->wrapper();84 return ATK_OBJECT(target->wrapper()); 85 85 } 86 86 -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp
r164428 r243928 50 50 AccessibilityObject* coreChild = child.get(); 51 51 if (!coreChild->accessibilityIsIgnored()) { 52 AtkObject* axObject = coreChild->wrapper();52 auto* axObject = coreChild->wrapper(); 53 53 if (!axObject || !ATK_IS_HYPERLINK_IMPL(axObject)) 54 54 continue; … … 75 75 AccessibilityObject* coreChild = child.get(); 76 76 if (!coreChild->accessibilityIsIgnored()) { 77 AtkObject* axObject = coreChild->wrapper();77 auto* axObject = coreChild->wrapper(); 78 78 if (axObject && ATK_IS_HYPERLINK_IMPL(axObject)) 79 79 linksFound++; -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceSelection.cpp
r208929 r243928 159 159 AccessibilityObject* option = optionFromSelection(selection, index); 160 160 if (option) { 161 AtkObject* child = option->wrapper();161 auto* child = option->wrapper(); 162 162 g_object_ref(child); 163 return child;163 return ATK_OBJECT(child); 164 164 } 165 165 -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTable.cpp
r225030 r243928 97 97 return 0; 98 98 99 AtkObject* cell = axCell->wrapper();99 auto* cell = axCell->wrapper(); 100 100 if (!cell) 101 101 return 0; … … 216 216 downcast<AccessibilityTableCell>(*columnHeader).columnIndexRange(columnRange); 217 217 if (columnRange.first <= static_cast<unsigned>(column) && static_cast<unsigned>(column) < columnRange.first + columnRange.second) 218 return columnHeader->wrapper();218 return ATK_OBJECT(columnHeader->wrapper()); 219 219 } 220 220 } … … 236 236 downcast<AccessibilityTableCell>(*rowHeader).rowIndexRange(rowRange); 237 237 if (rowRange.first <= static_cast<unsigned>(row) && static_cast<unsigned>(row) < rowRange.first + rowRange.second) 238 return rowHeader->wrapper();238 return ATK_OBJECT(rowHeader->wrapper()); 239 239 } 240 240 } … … 253 253 auto caption = downcast<HTMLTableElement>(*node).caption(); 254 254 if (caption) 255 return A ccessibilityObject::firstAccessibleObjectFromNode(caption->renderer()->element())->wrapper();255 return ATK_OBJECT(AccessibilityObject::firstAccessibleObjectFromNode(caption->renderer()->element())->wrapper()); 256 256 } 257 257 } -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp
r225030 r243928 35 35 GPtrArray* array = g_ptr_array_new(); 36 36 for (const auto& child : children) { 37 if ( AtkObject* atkObject = child->wrapper())37 if (auto* atkObject = child->wrapper()) 38 38 g_ptr_array_add(array, atkObject); 39 39 } … … 150 150 return nullptr; 151 151 152 AtkObject* table = atk_object_get_parent(axObject->wrapper());152 auto* table = atk_object_get_parent(ATK_OBJECT(axObject->wrapper())); 153 153 if (!table || !ATK_IS_TABLE(table)) 154 154 return nullptr; -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceText.cpp
r239535 r243928 232 232 // For those objects implementing the AtkText interface we use the 233 233 // well known API to always get the text in a consistent way 234 AtkObject* atkObj = ATK_OBJECT(object->wrapper());234 auto* atkObj = ATK_OBJECT(object->wrapper()); 235 235 if (ATK_IS_TEXT(atkObj)) { 236 236 GUniquePtr<gchar> text(webkitAccessibleTextGetText(ATK_TEXT(atkObj), 0, -1)); -
trunk/Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp
r243198 r243928 182 182 if (coreObject->isControl()) { 183 183 if (AccessibilityObject* label = coreObject->correspondingLabelForControlElement()) 184 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABELLED_BY, label->wrapper());184 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABELLED_BY, ATK_OBJECT(label->wrapper())); 185 185 } else if (coreObject->isFieldset()) { 186 186 if (AccessibilityObject* label = coreObject->titleUIElement()) 187 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABELLED_BY, label->wrapper());187 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABELLED_BY, ATK_OBJECT(label->wrapper())); 188 188 } else if (coreObject->roleValue() == AccessibilityRole::Legend) { 189 189 if (RenderBlock* renderFieldset = ancestorsOfType<RenderBlock>(*coreObject->renderer()).first()) { 190 190 if (renderFieldset->isFieldset()) { 191 191 AccessibilityObject* fieldset = coreObject->axObjectCache()->getOrCreate(renderFieldset); 192 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABEL_FOR, fieldset->wrapper());192 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABEL_FOR, ATK_OBJECT(fieldset->wrapper())); 193 193 } 194 194 } 195 195 } else if (AccessibilityObject* control = coreObject->correspondingControlForLabelElement()) { 196 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABEL_FOR, control->wrapper());196 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABEL_FOR, ATK_OBJECT(control->wrapper())); 197 197 } else { 198 198 AccessibilityObject::AccessibilityChildrenVector ariaLabelledByElements; 199 199 coreObject->ariaLabelledByElements(ariaLabelledByElements); 200 200 for (const auto& accessibilityObject : ariaLabelledByElements) 201 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABELLED_BY, accessibilityObject->wrapper());201 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABELLED_BY, ATK_OBJECT(accessibilityObject->wrapper())); 202 202 } 203 203 … … 206 206 coreObject->ariaLabelledByReferencingElements(labels); 207 207 for (const auto& accessibilityObject : labels) 208 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABEL_FOR, accessibilityObject->wrapper());208 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_LABEL_FOR, ATK_OBJECT(accessibilityObject->wrapper())); 209 209 210 210 // Elements with aria-flowto should have the flows-to relation as per the ARIA AAM spec. … … 213 213 coreObject->ariaFlowToElements(ariaFlowToElements); 214 214 for (const auto& accessibilityObject : ariaFlowToElements) 215 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_FLOWS_TO, accessibilityObject->wrapper());215 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_FLOWS_TO, ATK_OBJECT(accessibilityObject->wrapper())); 216 216 217 217 // Elements referenced by aria-flowto should have the flows-from relation as per the ARIA AAM spec. … … 220 220 coreObject->ariaFlowToReferencingElements(flowFrom); 221 221 for (const auto& accessibilityObject : flowFrom) 222 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_FLOWS_FROM, accessibilityObject->wrapper());222 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_FLOWS_FROM, ATK_OBJECT(accessibilityObject->wrapper())); 223 223 224 224 // Elements with aria-describedby should have the described-by relation as per the ARIA AAM spec. … … 227 227 coreObject->ariaDescribedByElements(ariaDescribedByElements); 228 228 for (const auto& accessibilityObject : ariaDescribedByElements) 229 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_DESCRIBED_BY, accessibilityObject->wrapper());229 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_DESCRIBED_BY, ATK_OBJECT(accessibilityObject->wrapper())); 230 230 231 231 // Elements referenced by aria-describedby should have the description-for relation as per the ARIA AAM spec. … … 234 234 coreObject->ariaDescribedByReferencingElements(describers); 235 235 for (const auto& accessibilityObject : describers) 236 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_DESCRIPTION_FOR, accessibilityObject->wrapper());236 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_DESCRIPTION_FOR, ATK_OBJECT(accessibilityObject->wrapper())); 237 237 238 238 // Elements with aria-controls should have the controller-for relation as per the ARIA AAM spec. … … 241 241 coreObject->ariaControlsElements(ariaControls); 242 242 for (const auto& accessibilityObject : ariaControls) 243 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_CONTROLLER_FOR, accessibilityObject->wrapper());243 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_CONTROLLER_FOR, ATK_OBJECT(accessibilityObject->wrapper())); 244 244 245 245 // Elements referenced by aria-controls should have the controlled-by relation as per the ARIA AAM spec. … … 248 248 coreObject->ariaControlsReferencingElements(controllers); 249 249 for (const auto& accessibilityObject : controllers) 250 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_CONTROLLED_BY, accessibilityObject->wrapper());250 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_CONTROLLED_BY, ATK_OBJECT(accessibilityObject->wrapper())); 251 251 252 252 // Elements with aria-owns should have the node-parent-of relation as per the ARIA AAM spec. … … 255 255 coreObject->ariaOwnsElements(ariaOwns); 256 256 for (const auto& accessibilityObject : ariaOwns) 257 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_NODE_PARENT_OF, accessibilityObject->wrapper());257 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_NODE_PARENT_OF, ATK_OBJECT(accessibilityObject->wrapper())); 258 258 259 259 // Elements referenced by aria-owns should have the node-child-of relation as per the ARIA AAM spec. … … 262 262 coreObject->ariaOwnsReferencingElements(owners); 263 263 for (const auto& accessibilityObject : owners) 264 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_NODE_CHILD_OF, accessibilityObject->wrapper());264 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_NODE_CHILD_OF, ATK_OBJECT(accessibilityObject->wrapper())); 265 265 266 266 #if ATK_CHECK_VERSION(2, 25, 2) … … 270 270 coreObject->ariaDetailsElements(ariaDetails); 271 271 for (const auto& accessibilityObject : ariaDetails) 272 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_DETAILS, accessibilityObject->wrapper());272 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_DETAILS, ATK_OBJECT(accessibilityObject->wrapper())); 273 273 274 274 // Elements referenced by aria-details should have the details-for relation as per the ARIA AAM spec. … … 277 277 coreObject->ariaDetailsReferencingElements(details); 278 278 for (const auto& accessibilityObject : details) 279 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_DETAILS_FOR, accessibilityObject->wrapper());279 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_DETAILS_FOR, ATK_OBJECT(accessibilityObject->wrapper())); 280 280 281 281 // Elements with aria-errormessage should have the error-message relation as per the ARIA AAM spec. … … 284 284 coreObject->ariaErrorMessageElements(ariaErrorMessage); 285 285 for (const auto& accessibilityObject : ariaErrorMessage) 286 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_ERROR_MESSAGE, accessibilityObject->wrapper());286 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_ERROR_MESSAGE, ATK_OBJECT(accessibilityObject->wrapper())); 287 287 288 288 // Elements referenced by aria-errormessage should have the error-for relation as per the ARIA AAM spec. … … 291 291 coreObject->ariaErrorMessageReferencingElements(errors); 292 292 for (const auto& accessibilityObject : errors) 293 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_ERROR_FOR, accessibilityObject->wrapper());293 atk_relation_set_add_relation_by_type(relationSet, ATK_RELATION_ERROR_FOR, ATK_OBJECT(accessibilityObject->wrapper())); 294 294 #endif 295 295 } … … 325 325 } 326 326 327 if (!coreParent) 328 return 0; 329 330 return coreParent->wrapper(); 327 return coreParent ? ATK_OBJECT(coreParent->wrapper()) : nullptr; 331 328 } 332 329 … … 351 348 return atkParentOfRootObject(object); 352 349 353 if (!coreParent) 354 return 0; 355 356 return coreParent->wrapper(); 350 return coreParent ? ATK_OBJECT(coreParent->wrapper()) : nullptr; 357 351 } 358 352 … … 386 380 return 0; 387 381 388 AtkObject* child = coreChild->wrapper();382 auto* child = ATK_OBJECT(coreChild->wrapper()); 389 383 atk_object_set_parent(child, object); 390 384 g_object_ref(child); … … 915 909 916 910 // Check text objects and paragraphs only. 917 AtkObject* axObject = coreObject->wrapper();918 AtkRole role = axObject ? atk_object_get_role( axObject) : ATK_ROLE_INVALID;911 auto* axObject = coreObject->wrapper(); 912 AtkRole role = axObject ? atk_object_get_role(ATK_OBJECT(axObject)) : ATK_ROLE_INVALID; 919 913 if (role != ATK_ROLE_TEXT && role != ATK_ROLE_PARAGRAPH) 920 914 return false; -
trunk/Source/WebCore/editing/atk/FrameSelectionAtk.cpp
r234808 r243928 36 36 static void emitTextSelectionChange(AccessibilityObject* object, VisibleSelection selection, int offset) 37 37 { 38 AtkObject* axObject = object->wrapper();38 auto* axObject = object->wrapper(); 39 39 if (!axObject || !ATK_IS_TEXT(axObject)) 40 40 return; … … 66 66 oldObject.get() = nullptr; 67 67 68 AtkObject* axObject = object ? object->wrapper() : 0;69 AtkObject* oldAxObject = oldObject.get() ? oldObject.get()->wrapper() : nullptr;68 auto* axObject = object ? object->wrapper() : nullptr; 69 auto* oldAxObject = oldObject.get() ? oldObject.get()->wrapper() : nullptr; 70 70 71 71 if (axObject != oldAxObject) { 72 72 if (oldAxObject && ATK_IS_TEXT(oldAxObject)) { 73 g_signal_emit_by_name(oldAxObject, "focus-event", false);74 atk_object_notify_state_change( oldAxObject, ATK_STATE_FOCUSED, false);73 g_signal_emit_by_name(oldAxObject, "focus-event", FALSE); 74 atk_object_notify_state_change(ATK_OBJECT(oldAxObject), ATK_STATE_FOCUSED, FALSE); 75 75 } 76 76 if (axObject && ATK_IS_TEXT(axObject)) { 77 g_signal_emit_by_name(axObject, "focus-event", true);78 atk_object_notify_state_change( axObject, ATK_STATE_FOCUSED, true);77 g_signal_emit_by_name(axObject, "focus-event", TRUE); 78 atk_object_notify_state_change(ATK_OBJECT(axObject), ATK_STATE_FOCUSED, TRUE); 79 79 } 80 80 } -
trunk/Source/WebKit/ChangeLog
r243927 r243928 1 2019-04-05 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [ATK] Use a smart pointer for AccessibilityObject wrapper and remove GTK specific code 4 https://bugs.webkit.org/show_bug.cgi?id=196593 5 <rdar://problem/49599153> 6 7 Reviewed by Michael Catanzaro. 8 9 * WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp: 10 (accessibilityRootObjectWrapper): Cast wrapper() as AtkObject. 11 1 12 2019-04-04 Simon Fraser <simon.fraser@apple.com> 2 13 -
trunk/Source/WebKit/WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp
r243863 r243928 70 70 return nullptr; 71 71 72 AtkObject* rootObject = coreRootObject->wrapper(); 73 if (!rootObject || !ATK_IS_OBJECT(rootObject)) 74 return nullptr; 75 76 return rootObject; 72 return ATK_OBJECT(coreRootObject->wrapper()); 77 73 } 78 74
Note: See TracChangeset
for help on using the changeset viewer.