Changeset 260448 in webkit
- Timestamp:
- Apr 21, 2020 1:21:04 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r260445 r260448 1 2020-04-21 Andres Gonzalez <andresg_22@apple.com> 2 3 Fix for remoteParentObject and platformWidget not being stored properly in the AXIsolatedObject attributes variant. 4 https://bugs.webkit.org/show_bug.cgi?id=210809 5 6 Reviewed by Chris Fleizach. 7 8 Adding these properties to the AXIsolatedObject attributes variant as 9 WeakPtr<void*> fails. So they are now cached as member variables. 10 11 * accessibility/isolatedtree/AXIsolatedObject.cpp: 12 (WebCore::AXIsolatedObject::initializeAttributeData): 13 (WebCore::AXIsolatedObject::platformWidget const): 14 * accessibility/isolatedtree/AXIsolatedObject.h: 15 (WebCore::AXIsolatedObject::propertyValue const): Deleted. 16 * accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm: 17 (WebCore::AXIsolatedObject::initializePlatformProperties): 18 (WebCore::AXIsolatedObject::remoteParentObject const): 19 1 20 2020-04-20 Simon Fraser <simon.fraser@apple.com> 2 21 -
trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
r259288 r260448 375 375 } 376 376 377 if (object.isScrollView()) {378 #if PLATFORM(COCOA)379 setProperty(AXPropertyName::PlatformWidget, object.platformWidget());380 setProperty(AXPropertyName::RemoteParentObject, object.remoteParentObject());381 #else382 setProperty(AXPropertyName::PlatformWidget, object.platformWidget());383 #endif384 }385 386 377 if (isRoot) { 387 378 setObjectProperty(AXPropertyName::WebArea, object.webAreaObject()); … … 392 383 setObjectVectorProperty(AXPropertyName::DocumentLinks, object.documentLinks()); 393 384 } 385 386 initializePlatformProperties(object); 394 387 } 395 388 … … 1572 1565 } 1573 1566 1567 PlatformWidget AXIsolatedObject::platformWidget() const 1568 { 1569 #if PLATFORM(COCOA) 1570 return m_platformWidget.get(); 1571 #else 1572 return m_platformWidget; 1573 #endif 1574 } 1575 1574 1576 Widget* AXIsolatedObject::widgetForAttachmentView() const 1575 1577 { -
trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h
r259288 r260448 74 74 bool isAXIsolatedObjectInstance() const override { return true; } 75 75 void initializeAttributeData(AXCoreObject&, bool isRoot); 76 void initializePlatformProperties(const AXCoreObject&); 76 77 AXCoreObject* associatedAXObject() const 77 78 { … … 277 278 Orientation, 278 279 PlaceholderValue, 279 PlatformWidget,280 280 PressedIsPresent, 281 281 PopupValue, … … 283 283 PreventKeyboardDOMEventDispatch, 284 284 ReadOnlyValue, 285 #if PLATFORM(COCOA)286 RemoteParentObject,287 #endif288 285 RoleValue, 289 286 RolePlatformString, … … 342 339 }; 343 340 344 using AttributeValueVariant = Variant<std::nullptr_t, String, bool, int, unsigned, double, float, uint64_t, Color, URL, LayoutRect, FloatRect, AXID, IntPoint, OptionSet<SpeakAs>, std::pair<unsigned, unsigned>, Vector<AccessibilityIsolatedTreeText>, Vector<AXID>, Vector<AccessibilityIsolatedTreeMathMultiscriptPair>, Vector<String>, 345 #if PLATFORM(COCOA) 346 WeakPtr<void*> // To hold an ObjectiveC object, e.g., NSView* or id. 347 #else 348 PlatformWidget 349 #endif 350 >; 341 using AttributeValueVariant = Variant<std::nullptr_t, String, bool, int, unsigned, double, float, uint64_t, Color, URL, LayoutRect, FloatRect, AXID, IntPoint, OptionSet<SpeakAs>, std::pair<unsigned, unsigned>, Vector<AccessibilityIsolatedTreeText>, Vector<AXID>, Vector<AccessibilityIsolatedTreeMathMultiscriptPair>, Vector<String>>; 351 342 void setProperty(AXPropertyName, AttributeValueVariant&&, bool shouldRemove = false); 352 343 void setObjectProperty(AXPropertyName, AXCoreObject*); … … 832 823 TextIteratorBehavior textIteratorBehaviorForTextRange() const override; 833 824 Widget* widget() const override; 834 PlatformWidget platformWidget() const override { return propertyValue<PlatformWidget>(AXPropertyName::PlatformWidget); }825 PlatformWidget platformWidget() const override; 835 826 #if PLATFORM(COCOA) 836 827 RemoteAXObjectRef remoteParentObject() const override; … … 911 902 912 903 HashMap<AXPropertyName, AttributeValueVariant, WTF::IntHash<AXPropertyName>, WTF::StrongEnumHashTraits<AXPropertyName>> m_attributeMap; 904 #if PLATFORM(COCOA) 905 RetainPtr<NSView> m_platformWidget; 906 RetainPtr<RemoteAXObjectRef> m_remoteParent; 907 #else 908 PlatformWidget m_platformWidget; 909 #endif 913 910 }; 914 911 915 template<typename T>916 inline T AXIsolatedObject::propertyValue(AXPropertyName propertyName) const917 {918 auto value = m_attributeMap.get(propertyName);919 return WTF::switchOn(value,920 [] (WeakPtr<T>& typedValue) { return typedValue; },921 [] (auto&) { return nullptr; }922 );923 }924 925 912 } // namespace WebCore 926 913 -
trunk/Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm
r259220 r260448 33 33 namespace WebCore { 34 34 35 void AXIsolatedObject::initializePlatformProperties(const AXCoreObject& object) 36 { 37 if (object.isScrollView()) { 38 m_platformWidget = object.platformWidget(); 39 m_remoteParent = object.remoteParentObject(); 40 } 41 } 42 35 43 RemoteAXObjectRef AXIsolatedObject::remoteParentObject() const 36 44 { … … 38 46 return object.isScrollView(); 39 47 }); 40 return is<AXIsolatedObject>(scrollView) ? downcast<AXIsolatedObject>(scrollView)-> propertyValue<RemoteAXObjectRef>(AXPropertyName::RemoteParentObject) : nil;48 return is<AXIsolatedObject>(scrollView) ? downcast<AXIsolatedObject>(scrollView)->m_remoteParent.get() : nil; 41 49 } 42 50
Note: See TracChangeset
for help on using the changeset viewer.