WebKit Bugzilla
Attachment 361381 Details for
Bug 194005
: AX: Audit tab should have built-in accessibility tests.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
patch (text/plain), 134.85 KB, created by
chris fleizach
on 2019-02-06 23:59:07 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
chris fleizach
Created:
2019-02-06 23:59:07 PST
Size:
134.85 KB
patch
obsolete
>Index: Source/JavaScriptCore/DerivedSources-input.xcfilelist >=================================================================== >--- Source/JavaScriptCore/DerivedSources-input.xcfilelist (revision 240552) >+++ Source/JavaScriptCore/DerivedSources-input.xcfilelist (working copy) >@@ -121,6 +121,7 @@ > $(PROJECT_DIR)/parser/Keywords.table > $(PROJECT_DIR)/runtime/ArrayConstructor.cpp > $(PROJECT_DIR)/runtime/ArrayIteratorPrototype.cpp >+$(PROJECT_DIR)/runtime/AsyncFromSyncIteratorPrototype.cpp > $(PROJECT_DIR)/runtime/AsyncGeneratorPrototype.cpp > $(PROJECT_DIR)/runtime/BigIntConstructor.cpp > $(PROJECT_DIR)/runtime/BigIntPrototype.cpp >@@ -136,6 +137,7 @@ > $(PROJECT_DIR)/runtime/IntlDateTimeFormatPrototype.cpp > $(PROJECT_DIR)/runtime/IntlNumberFormatConstructor.cpp > $(PROJECT_DIR)/runtime/IntlNumberFormatPrototype.cpp >+$(PROJECT_DIR)/runtime/IntlObject.cpp > $(PROJECT_DIR)/runtime/IntlPluralRulesConstructor.cpp > $(PROJECT_DIR)/runtime/IntlPluralRulesPrototype.cpp > $(PROJECT_DIR)/runtime/JSDataViewPrototype.cpp >Index: Source/JavaScriptCore/DerivedSources-output.xcfilelist >=================================================================== >--- Source/JavaScriptCore/DerivedSources-output.xcfilelist (revision 240552) >+++ Source/JavaScriptCore/DerivedSources-output.xcfilelist (working copy) >@@ -4,6 +4,7 @@ > $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/AirOpcodeUtils.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/ArrayConstructor.lut.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/ArrayIteratorPrototype.lut.h >+$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/AsyncFromSyncIteratorPrototype.lut.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/AsyncGeneratorPrototype.lut.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/BigIntConstructor.lut.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/BigIntPrototype.lut.h >@@ -27,6 +28,7 @@ > $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/IntlDateTimeFormatPrototype.lut.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/IntlNumberFormatConstructor.lut.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/IntlNumberFormatPrototype.lut.h >+$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/IntlObject.lut.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/IntlPluralRulesConstructor.lut.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/IntlPluralRulesPrototype.lut.h > $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/JSCBuiltins.h >Index: Source/JavaScriptCore/UnifiedSources-input.xcfilelist >=================================================================== >--- Source/JavaScriptCore/UnifiedSources-input.xcfilelist (revision 240552) >+++ Source/JavaScriptCore/UnifiedSources-input.xcfilelist (working copy) >@@ -23,6 +23,7 @@ > $(SRCROOT)/API/JSRemoteInspector.cpp > $(SRCROOT)/API/JSScript.mm > $(SRCROOT)/API/JSScriptRef.cpp >+$(SRCROOT)/API/JSScriptSourceProvider.mm > $(SRCROOT)/API/JSStringRef.cpp > $(SRCROOT)/API/JSStringRefCF.cpp > $(SRCROOT)/API/JSTypedArray.cpp >@@ -682,6 +683,7 @@ > $(SRCROOT)/runtime/BooleanConstructor.cpp > $(SRCROOT)/runtime/BooleanObject.cpp > $(SRCROOT)/runtime/BooleanPrototype.cpp >+$(SRCROOT)/runtime/CachedTypes.cpp > $(SRCROOT)/runtime/CallData.cpp > $(SRCROOT)/runtime/CatchScope.cpp > $(SRCROOT)/runtime/ClassInfo.cpp >@@ -716,6 +718,7 @@ > $(SRCROOT)/runtime/ErrorHandlingScope.cpp > $(SRCROOT)/runtime/ErrorInstance.cpp > $(SRCROOT)/runtime/ErrorPrototype.cpp >+$(SRCROOT)/runtime/ErrorType.cpp > $(SRCROOT)/runtime/EvalExecutable.cpp > $(SRCROOT)/runtime/Exception.cpp > $(SRCROOT)/runtime/ExceptionEventLocation.cpp >@@ -869,6 +872,7 @@ > $(SRCROOT)/runtime/RegExpCache.cpp > $(SRCROOT)/runtime/RegExpCachedResult.cpp > $(SRCROOT)/runtime/RegExpConstructor.cpp >+$(SRCROOT)/runtime/RegExpGlobalData.cpp > $(SRCROOT)/runtime/RegExpMatchesArray.cpp > $(SRCROOT)/runtime/RegExpObject.cpp > $(SRCROOT)/runtime/RegExpPrototype.cpp >@@ -932,6 +936,7 @@ > $(SRCROOT)/tools/JSDollarVM.cpp > $(SRCROOT)/tools/SigillCrashAnalyzer.cpp > $(SRCROOT)/tools/VMInspector.cpp >+$(SRCROOT)/wasm/WasmAirIRGenerator.cpp > $(SRCROOT)/wasm/WasmB3IRGenerator.cpp > $(SRCROOT)/wasm/WasmBBQPlan.cpp > $(SRCROOT)/wasm/WasmBinding.cpp >Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 240558) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,145 @@ >+2019-01-29 Chris Fleizach <cfleizach@apple.com> >+ >+ AX: IsolatedTree: Implement more attributes >+ https://bugs.webkit.org/show_bug.cgi?id=193911 >+ <rdar://problem/47599217> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Make use of new HIServices SPI to use a secondary AX thread. >+ Store root node/focused node status in IsolatedTree rather than on the element. >+ Implement the following attributes: children, parent, isIgnored, isTree, isTreeItem, relativeFrame, speechHint, title, description. >+ Implement hit-testing using relative-frames. >+ Ensure that WKAccessibilityWebPageObject queries happen on main thread when they need to. >+ >+ * SourcesCocoa.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * accessibility/AXObjectCache.cpp: >+ (WebCore::AXObjectCache::generateIsolatedAccessibilityTree): >+ * accessibility/AXObjectCache.h: >+ (WebCore::AXObjectCache::focusedUIElementForPage): >+ * accessibility/AccessibilityAttachment.cpp: >+ (WebCore::AccessibilityAttachment::accessibilityText const): >+ (WebCore::AccessibilityAttachment::accessibilityText): Deleted. >+ * accessibility/AccessibilityAttachment.h: >+ * accessibility/AccessibilityImageMapLink.cpp: >+ (WebCore::AccessibilityImageMapLink::accessibilityText const): >+ (WebCore::AccessibilityImageMapLink::accessibilityText): Deleted. >+ * accessibility/AccessibilityImageMapLink.h: >+ * accessibility/AccessibilityMediaControls.cpp: >+ (WebCore::AccessibilityMediaControl::accessibilityText const): >+ (WebCore::AccessibilityMediaControl::accessibilityText): Deleted. >+ * accessibility/AccessibilityMediaControls.h: >+ * accessibility/AccessibilityNodeObject.cpp: >+ (WebCore::AccessibilityNodeObject::accessibilityText const): >+ (WebCore::AccessibilityNodeObject::accessibilityText): Deleted. >+ * accessibility/AccessibilityNodeObject.h: >+ * accessibility/AccessibilityObject.cpp: >+ (WebCore::AccessibilityObject::convertFrameToSpace const): >+ (WebCore::AccessibilityObject::relativeFrame const): >+ (WebCore::AccessibilityObject::elementAccessibilityHitTest const): >+ (WebCore::AccessibilityObject::focusedUIElement const): >+ * accessibility/AccessibilityObject.h: >+ (WebCore::AccessibilityObject::accessibilityText const): >+ (WebCore::AccessibilityObject::isLink const): Deleted. >+ (WebCore::AccessibilityObject::isImage const): Deleted. >+ (WebCore::AccessibilityObject::isAttachment const): Deleted. >+ (WebCore::AccessibilityObject::isFileUploadButton const): Deleted. >+ (WebCore::AccessibilityObject::isImageMapLink const): Deleted. >+ (WebCore::AccessibilityObject::isMediaControlLabel const): Deleted. >+ (WebCore::AccessibilityObject::isTree const): Deleted. >+ (WebCore::AccessibilityObject::isTreeItem const): Deleted. >+ (WebCore::AccessibilityObject::isScrollbar const): Deleted. >+ (WebCore::AccessibilityObject::accessibilityHitTest const): Deleted. >+ (WebCore::AccessibilityObject::accessibilityText): Deleted. >+ (WebCore::AccessibilityObject::roleValue const): Deleted. >+ (WebCore::AccessibilityObject::wrapper const): Deleted. >+ * accessibility/AccessibilityObjectInterface.h: Replaced. >+ * accessibility/AccessibilityRenderObject.cpp: >+ (WebCore::AccessibilityRenderObject::isTabItemSelected const): >+ (WebCore::AccessibilityRenderObject::remoteSVGElementHitTest const): >+ (WebCore::AccessibilityRenderObject::elementAccessibilityHitTest const): >+ (WebCore::AccessibilityRenderObject::accessibilityHitTest const): >+ (WebCore::AccessibilityRenderObject::selectedChildren): >+ * accessibility/AccessibilityRenderObject.h: >+ * accessibility/AccessibilitySVGElement.cpp: >+ (WebCore::AccessibilitySVGElement::accessibilityText const): >+ (WebCore::AccessibilitySVGElement::accessibilityText): Deleted. >+ * accessibility/AccessibilitySVGElement.h: >+ * accessibility/AccessibilityScrollView.cpp: >+ (WebCore::AccessibilityScrollView::accessibilityHitTest const): >+ * accessibility/AccessibilityScrollView.h: >+ * accessibility/ios/AccessibilityObjectIOS.mm: >+ (WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const): >+ * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: >+ (-[WebAccessibilityObjectWrapper fileUploadButtonReturnsValueInTitle]): Deleted. >+ * accessibility/isolatedtree: Replaced. >+ * accessibility/isolatedtree/AXIsolatedTree.cpp: Added. >+ (WebCore::AXIsolatedTree::treePageCache): >+ (WebCore::AXIsolatedTree::AXIsolatedTree): >+ (WebCore::AXIsolatedTree::nodeInTreeForID): >+ (WebCore::AXIsolatedTree::nodeForID const): >+ (WebCore::AXIsolatedTree::focusedUIElement): >+ (WebCore::AXIsolatedTree::setRootNodeID): >+ (WebCore::AXIsolatedTree::setFocusedNodeID): >+ (WebCore::AXIsolatedTree::setInitialRequestInProgress): >+ (WebCore::AXIsolatedTree::applyPendingChanges): >+ * accessibility/isolatedtree/AXIsolatedTree.h: Added. >+ * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added. >+ (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode): >+ (WebCore::AXIsolatedTreeNode::~AXIsolatedTreeNode): >+ (WebCore::AXIsolatedTreeNode::initializeAttributeData): >+ (WebCore::AXIsolatedTreeNode::setProperty): >+ (WebCore::AXIsolatedTreeNode::setParent): >+ (WebCore::AXIsolatedTreeNode::setTreeIdentifier): >+ (WebCore::AXIsolatedTreeNode::focusedUIElement const): >+ (WebCore::AXIsolatedTreeNode::parentObjectInterfaceUnignored const): >+ (WebCore::AXIsolatedTreeNode::accessibilityHitTest const): >+ (WebCore::AXIsolatedTreeNode::tree const): >+ (WebCore::AXIsolatedTreeNode::rectAttributeValue const): >+ (WebCore::AXIsolatedTreeNode::stringAttributeValue const): >+ * accessibility/isolatedtree/AXIsolatedTreeNode.h: Added. >+ * accessibility/mac/AXObjectCacheMac.mm: >+ (WebCore::AXObjectCache::associateIsolatedTreeNode): >+ * accessibility/mac/AccessibilityObjectBase.mm: Added. >+ (WebCore::AccessibilityObject::speechHintAttributeValue const): >+ (WebCore::AccessibilityObject::descriptionAttributeValue const): >+ (WebCore::AccessibilityObject::titleAttributeValue const): >+ (WebCore::AccessibilityObject::helpTextAttributeValue const): >+ * accessibility/mac/AccessibilityObjectMac.mm: >+ (WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const): >+ * accessibility/mac/WebAccessibilityObjectWrapperBase.h: >+ * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: >+ (addChildToArray): >+ (convertToNSArray): >+ (-[WebAccessibilityObjectWrapperBase isolatedTreeNode]): >+ (-[WebAccessibilityObjectWrapperBase detach]): >+ (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]): >+ (-[WebAccessibilityObjectWrapperBase accessibilityObject]): >+ (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]): >+ (-[WebAccessibilityObjectWrapperBase axBackingObject]): >+ (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]): >+ (-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]): >+ (-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]): >+ (convertPathToScreenSpaceFunction): >+ (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]): >+ (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]): >+ (-[WebAccessibilityObjectWrapperBase titleTagShouldBeUsedInDescriptionField]): Deleted. >+ (-[WebAccessibilityObjectWrapperBase fileUploadButtonReturnsValueInTitle]): Deleted. >+ * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: >+ (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]): >+ (-[WebAccessibilityObjectWrapper childrenVectorSize]): >+ (-[WebAccessibilityObjectWrapper childrenVectorArray]): >+ (-[WebAccessibilityObjectWrapper position]): >+ (-[WebAccessibilityObjectWrapper subrole]): >+ (-[WebAccessibilityObjectWrapper roleDescription]): >+ (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): >+ (-[WebAccessibilityObjectWrapper accessibilityFocusedUIElement]): >+ (-[WebAccessibilityObjectWrapper accessibilityHitTest:]): >+ (-[WebAccessibilityObjectWrapper accessibilityIndexOfChild:]): >+ (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeCount:]): >+ (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]): >+ > 2019-01-27 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed, fix WPE/GTK debug builds after r240557 >Index: Source/WebCore/PAL/ChangeLog >=================================================================== >--- Source/WebCore/PAL/ChangeLog (revision 240671) >+++ Source/WebCore/PAL/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2019-01-29 Chris Fleizach <cfleizach@apple.com> >+ >+ AX: IsolatedTree: Implement more attributes >+ https://bugs.webkit.org/show_bug.cgi?id=193911 >+ <rdar://problem/47599217> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * pal/spi/mac/HIServicesSPI.h: >+ > 2019-01-28 Andy Estes <aestes@apple.com> > > [watchOS] Enable Parental Controls content filtering >Index: Source/WebCore/PAL/pal/spi/mac/HIServicesSPI.h >=================================================================== >--- Source/WebCore/PAL/pal/spi/mac/HIServicesSPI.h (revision 240552) >+++ Source/WebCore/PAL/pal/spi/mac/HIServicesSPI.h (working copy) >@@ -123,6 +123,7 @@ > CoreDragRef CoreDragGetCurrentDrag(); > OSStatus CoreDragSetImage(CoreDragRef, CGPoint imageOffset, CoreDragImageSpec*, CGSRegionObj imageShape, float overallAlpha); > const UInt8* AXTextMarkerGetBytePtr(AXTextMarkerRef); >+bool _AXUIElementRequestServicedBySecondaryAXThread(void); > OSStatus SetApplicationIsDaemon(Boolean); > > WTF_EXTERN_C_END >Index: Source/WebCore/SourcesCocoa.txt >=================================================================== >--- Source/WebCore/SourcesCocoa.txt (revision 240552) >+++ Source/WebCore/SourcesCocoa.txt (working copy) >@@ -32,6 +32,7 @@ > accessibility/ios/WebAccessibilityObjectWrapperIOS.mm > > accessibility/mac/AXObjectCacheMac.mm >+accessibility/mac/AccessibilityObjectBase.mm > accessibility/mac/AccessibilityObjectMac.mm > accessibility/mac/WebAccessibilityObjectWrapperMac.mm @no-unify > accessibility/mac/WebAccessibilityObjectWrapperBase.mm @no-unify >Index: Source/WebCore/WebCore.xcodeproj/project.pbxproj >=================================================================== >--- Source/WebCore/WebCore.xcodeproj/project.pbxproj (revision 240558) >+++ Source/WebCore/WebCore.xcodeproj/project.pbxproj (working copy) >@@ -6602,6 +6602,7 @@ > 293EAE1E1356B2FE0067ACF9 /* RuntimeApplicationChecks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeApplicationChecks.h; sourceTree = "<group>"; }; > 29489FC512C00F0300D83F0F /* AccessibilityScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityScrollView.h; sourceTree = "<group>"; }; > 29498681195341940072D2BD /* TextUndoInsertionMarkupMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextUndoInsertionMarkupMac.mm; sourceTree = "<group>"; }; >+ 294BDAE621FF582A0051077B /* AccessibilityObjectBase.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityObjectBase.mm; sourceTree = "<group>"; }; > 297BE3D916C043D8003316BD /* PlatformSpeechSynthesizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformSpeechSynthesizer.cpp; sourceTree = "<group>"; }; > 2981ABC4131822EC00D12F2A /* AccessibilityMathMLElement.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityMathMLElement.cpp; sourceTree = "<group>"; }; > 2981CA9D131822EC00D12F2A /* AccessibilityARIAGrid.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityARIAGrid.cpp; sourceTree = "<group>"; }; >@@ -17358,6 +17359,7 @@ > 29A812050FBB9B5200510293 /* mac */ = { > isa = PBXGroup; > children = ( >+ 294BDAE621FF582A0051077B /* AccessibilityObjectBase.mm */, > 29A812440FBB9CA900510293 /* AccessibilityObjectMac.mm */, > 29A812470FBB9CA900510293 /* AXObjectCacheMac.mm */, > 29A812450FBB9CA900510293 /* WebAccessibilityObjectWrapperBase.h */, >Index: Source/WebCore/accessibility/AXObjectCache.cpp >=================================================================== >--- Source/WebCore/accessibility/AXObjectCache.cpp (revision 240558) >+++ Source/WebCore/accessibility/AXObjectCache.cpp (working copy) >@@ -2942,7 +2942,7 @@ > > Vector<Ref<AXIsolatedTreeNode>> nodeChanges; > auto root = createIsolatedAccessibilityTreeHierarchy(*rootObject(), InvalidAXID, *tree, nodeChanges); >- root->setIsRootNode(true); >+ tree->setRootNodeID(root->identifier()); > tree->appendNodeChanges(nodeChanges); > > return makeRef(*tree); >Index: Source/WebCore/accessibility/AXObjectCache.h >=================================================================== >--- Source/WebCore/accessibility/AXObjectCache.h (revision 240558) >+++ Source/WebCore/accessibility/AXObjectCache.h (working copy) >@@ -496,7 +496,7 @@ > inline void AXComputedObjectAttributeCache::setIgnored(AXID, AccessibilityObjectInclusion) { } > inline AXObjectCache::AXObjectCache(Document& document) : m_document(document), m_notificationPostTimer(*this, &AXObjectCache::notificationPostTimerFired), m_passwordNotificationPostTimer(*this, &AXObjectCache::passwordNotificationPostTimerFired), m_liveRegionChangedPostTimer(*this, &AXObjectCache::liveRegionChangedNotificationPostTimerFired), m_focusModalNodeTimer(*this, &AXObjectCache::focusModalNodeTimerFired), m_performCacheUpdateTimer(*this, &AXObjectCache::performCacheUpdateTimerFired) { } > inline AXObjectCache::~AXObjectCache() { } >-inline AccessibilityObject* AXObjectCache::focusedUIElementForPage(const Page*) { return nullptr; } >+inline AccessibilityObjectInterface* AXObjectCache::focusedUIElementForPage(const Page*) { return nullptr; } > inline AccessibilityObject* AXObjectCache::get(RenderObject*) { return nullptr; } > inline AccessibilityObject* AXObjectCache::get(Node*) { return nullptr; } > inline AccessibilityObject* AXObjectCache::get(Widget*) { return nullptr; } >Index: Source/WebCore/accessibility/AccessibilityAttachment.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilityAttachment.cpp (revision 240558) >+++ Source/WebCore/accessibility/AccessibilityAttachment.cpp (working copy) >@@ -84,7 +84,7 @@ > return false; > } > >-void AccessibilityAttachment::accessibilityText(Vector<AccessibilityText>& textOrder) >+void AccessibilityAttachment::accessibilityText(Vector<AccessibilityText>& textOrder) const > { > HTMLAttachmentElement* attachmentElement = this->attachmentElement(); > if (!attachmentElement) >Index: Source/WebCore/accessibility/AccessibilityAttachment.h >=================================================================== >--- Source/WebCore/accessibility/AccessibilityAttachment.h (revision 240558) >+++ Source/WebCore/accessibility/AccessibilityAttachment.h (working copy) >@@ -48,7 +48,7 @@ > String roleDescription() const override; > float valueForRange() const override; > bool computeAccessibilityIsIgnored() const override; >- void accessibilityText(Vector<AccessibilityText>&) override; >+ void accessibilityText(Vector<AccessibilityText>&) const override; > explicit AccessibilityAttachment(RenderAttachment*); > }; > >Index: Source/WebCore/accessibility/AccessibilityImageMapLink.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilityImageMapLink.cpp (revision 240558) >+++ Source/WebCore/accessibility/AccessibilityImageMapLink.cpp (working copy) >@@ -93,7 +93,7 @@ > return m_areaElement->href(); > } > >-void AccessibilityImageMapLink::accessibilityText(Vector<AccessibilityText>& textOrder) >+void AccessibilityImageMapLink::accessibilityText(Vector<AccessibilityText>& textOrder) const > { > String description = accessibilityDescription(); > if (!description.isEmpty()) >Index: Source/WebCore/accessibility/AccessibilityImageMapLink.h >=================================================================== >--- Source/WebCore/accessibility/AccessibilityImageMapLink.h (revision 240558) >+++ Source/WebCore/accessibility/AccessibilityImageMapLink.h (working copy) >@@ -70,7 +70,7 @@ > void detachFromParent() override; > Path elementPath() const override; > RenderElement* imageMapLinkRenderer() const; >- void accessibilityText(Vector<AccessibilityText>&) override; >+ void accessibilityText(Vector<AccessibilityText>&) const override; > bool isImageMapLink() const override { return true; } > bool supportsPath() const override { return true; } > >Index: Source/WebCore/accessibility/AccessibilityMediaControls.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilityMediaControls.cpp (revision 240558) >+++ Source/WebCore/accessibility/AccessibilityMediaControls.cpp (working copy) >@@ -138,7 +138,7 @@ > return nullAtom(); > } > >-void AccessibilityMediaControl::accessibilityText(Vector<AccessibilityText>& textOrder) >+void AccessibilityMediaControl::accessibilityText(Vector<AccessibilityText>& textOrder) const > { > String description = accessibilityDescription(); > if (!description.isEmpty()) >Index: Source/WebCore/accessibility/AccessibilityMediaControls.h >=================================================================== >--- Source/WebCore/accessibility/AccessibilityMediaControls.h (revision 240558) >+++ Source/WebCore/accessibility/AccessibilityMediaControls.h (working copy) >@@ -53,7 +53,7 @@ > bool computeAccessibilityIsIgnored() const override; > > private: >- void accessibilityText(Vector<AccessibilityText>&) override; >+ void accessibilityText(Vector<AccessibilityText>&) const override; > }; > > >Index: Source/WebCore/accessibility/AccessibilityNodeObject.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilityNodeObject.cpp (revision 240558) >+++ Source/WebCore/accessibility/AccessibilityNodeObject.cpp (working copy) >@@ -1469,7 +1469,7 @@ > } > } > >-void AccessibilityNodeObject::accessibilityText(Vector<AccessibilityText>& textOrder) >+void AccessibilityNodeObject::accessibilityText(Vector<AccessibilityText>& textOrder) const > { > titleElementText(textOrder); > alternativeText(textOrder); >Index: Source/WebCore/accessibility/AccessibilityNodeObject.h >=================================================================== >--- Source/WebCore/accessibility/AccessibilityNodeObject.h (revision 240558) >+++ Source/WebCore/accessibility/AccessibilityNodeObject.h (working copy) >@@ -180,7 +180,7 @@ > > private: > bool isAccessibilityNodeObject() const final { return true; } >- void accessibilityText(Vector<AccessibilityText>&) override; >+ void accessibilityText(Vector<AccessibilityText>&) const override; > virtual void titleElementText(Vector<AccessibilityText>&) const; > void alternativeText(Vector<AccessibilityText>&) const; > void visibleText(Vector<AccessibilityText>&) const; >Index: Source/WebCore/accessibility/AccessibilityObject.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilityObject.cpp (revision 240558) >+++ Source/WebCore/accessibility/AccessibilityObject.cpp (working copy) >@@ -34,6 +34,8 @@ > #include "AccessibilityScrollView.h" > #include "AccessibilityTable.h" > #include "AccessibleSetValueEvent.h" >+#include "Chrome.h" >+#include "ChromeClient.h" > #include "DOMTokenList.h" > #include "Editing.h" > #include "Editor.h" >@@ -481,7 +483,40 @@ > } > return previous; > } >+ >+FloatRect AccessibilityObject::convertFrameToSpace(const FloatRect& frameRect, AccessibilityConversionSpace conversionSpace) const >+{ >+ ASSERT(isMainThread()); >+ >+ // Find the appropriate scroll view to use to convert the contents to the window. >+ const auto parentAccessibilityScrollView = ancestorAccessibilityScrollView(false /* includeSelf */); >+ auto* parentScrollView = parentAccessibilityScrollView ? parentAccessibilityScrollView->scrollView() : nullptr; > >+ auto snappedFrameRect = snappedIntRect(IntRect(frameRect)); >+ if (parentScrollView) >+ snappedFrameRect = parentScrollView->contentsToRootView(snappedFrameRect); >+ >+ if (conversionSpace == AccessibilityConversionSpace::Screen) { >+ auto page = this->page(); >+ if (!page) >+ return snappedFrameRect; >+ >+ // If we have an empty chrome client (like SVG) then we should use the page >+ // of the scroll view parent to help us get to the screen rect. >+ if (parentAccessibilityScrollView && page->chrome().client().isEmptyChromeClient()) >+ page = parentAccessibilityScrollView->page(); >+ >+ snappedFrameRect = page->chrome().rootViewToAccessibilityScreen(snappedFrameRect); >+ } >+ >+ return snappedFrameRect; >+} >+ >+FloatRect AccessibilityObject::relativeFrame() const >+{ >+ return convertFrameToSpace(elementRect(), AccessibilityConversionSpace::Page); >+} >+ > AccessibilityObject* AccessibilityObject::nextSiblingUnignored(int limit) const > { > AccessibilityObject* next; >@@ -1789,13 +1824,18 @@ > updateChildrenIfNecessary(); > } > #endif >- >+ >+const AccessibilityScrollView* AccessibilityObject::ancestorAccessibilityScrollView(bool includeSelf) const >+{ >+ return downcast<AccessibilityScrollView>(AccessibilityObject::matchedParent(*this, includeSelf, [] (const auto& object) { >+ return is<AccessibilityScrollView>(object); >+ })); >+} >+ > ScrollView* AccessibilityObject::scrollViewAncestor() const > { >- if (const AccessibilityObject* scrollParent = AccessibilityObject::matchedParent(*this, true, [] (const AccessibilityObject& object) { >- return is<AccessibilityScrollView>(object); >- })) >- return downcast<AccessibilityScrollView>(*scrollParent).scrollView(); >+ if (auto parentScrollView = ancestorAccessibilityScrollView(true/* includeSelf */)) >+ return parentScrollView->scrollView(); > > return nullptr; > } >@@ -2639,7 +2679,7 @@ > return excludeIfOff ? liveRegionStatusIsEnabled(liveRegionStatusValue) : !liveRegionStatusValue.isEmpty(); > } > >-AccessibilityObject* AccessibilityObject::elementAccessibilityHitTest(const IntPoint& point) const >+AccessibilityObjectInterface* AccessibilityObject::elementAccessibilityHitTest(const IntPoint& point) const > { > // Send the hit test back into the sub-frame if necessary. > if (isAttachment()) { >@@ -2668,13 +2708,13 @@ > return nullptr; > } > >-AccessibilityObject* AccessibilityObject::focusedUIElement() const >+AccessibilityObjectInterface* AccessibilityObject::focusedUIElement() const > { >- Document* doc = document(); >- if (!doc) >+ Document* document = this->document(); >+ if (!document) > return nullptr; > >- Page* page = doc->page(); >+ Page* page = document->page(); > if (!page) > return nullptr; > >Index: Source/WebCore/accessibility/AccessibilityObject.h >=================================================================== >--- Source/WebCore/accessibility/AccessibilityObject.h (revision 240558) >+++ Source/WebCore/accessibility/AccessibilityObject.h (working copy) >@@ -45,9 +45,6 @@ > > #if PLATFORM(COCOA) > #include <wtf/RetainPtr.h> >-#elif PLATFORM(WIN) >-#include "AccessibilityObjectWrapperWin.h" >-#include "COMPtr.h" > #endif > > #if PLATFORM(COCOA) >@@ -61,22 +58,13 @@ > OBJC_CLASS NSString; > OBJC_CLASS NSValue; > OBJC_CLASS NSView; >-OBJC_CLASS WebAccessibilityObjectWrapper; > >-typedef WebAccessibilityObjectWrapper AccessibilityObjectWrapper; >- >-#elif PLATFORM(GTK) >-typedef struct _AtkObject AtkObject; >-typedef struct _AtkObject AccessibilityObjectWrapper; >-#elif PLATFORM(WPE) >-class AccessibilityObjectWrapper : public RefCounted<AccessibilityObjectWrapper> { }; >-#else >-class AccessibilityObjectWrapper; > #endif > > namespace WebCore { > > class AccessibilityObject; >+class AccessibilityScrollView; > class AXObjectCache; > class Element; > class Frame; >@@ -338,7 +326,8 @@ > enum class AccessibilityMathMultiscriptObjectType { PreSubscript, PreSuperscript, PostSubscript, PostSuperscript }; > > enum class AccessibilityCurrentState { False, True, Page, Step, Location, Date, Time }; >- >+enum class AccessibilityConversionSpace { Screen, Page }; >+ > bool nodeHasPresentationRole(Node*); > > class AccessibilityObject : public RefCounted<AccessibilityObject>, public AccessibilityObjectInterface { >@@ -372,8 +361,8 @@ > > virtual bool isAttachmentElement() const { return false; } > virtual bool isHeading() const { return false; } >- virtual bool isLink() const { return false; } >- virtual bool isImage() const { return false; } >+ bool isLink() const override { return false; } >+ bool isImage() const override { return false; } > virtual bool isImageMap() const { return roleValue() == AccessibilityRole::ImageMap; } > virtual bool isNativeImage() const { return false; } > virtual bool isImageButton() const { return false; } >@@ -388,7 +377,7 @@ > virtual bool isNativeListBox() const { return false; } > bool isListBox() const { return roleValue() == AccessibilityRole::ListBox; } > virtual bool isListBoxOption() const { return false; } >- virtual bool isAttachment() const { return false; } >+ bool isAttachment() const override { return false; } > virtual bool isMediaTimeline() const { return false; } > virtual bool isMenuRelated() const { return false; } > virtual bool isMenu() const { return false; } >@@ -395,7 +384,7 @@ > virtual bool isMenuBar() const { return false; } > virtual bool isMenuButton() const { return false; } > virtual bool isMenuItem() const { return false; } >- virtual bool isFileUploadButton() const { return false; } >+ bool isFileUploadButton() const override { return false; } > virtual bool isInputImage() const { return false; } > virtual bool isProgressIndicator() const { return false; } > virtual bool isSlider() const { return false; } >@@ -412,7 +401,7 @@ > virtual bool isFieldset() const { return false; } > virtual bool isGroup() const { return false; } > virtual bool isARIATreeGridRow() const { return false; } >- virtual bool isImageMapLink() const { return false; } >+ bool isImageMapLink() const override { return false; } > virtual bool isMenuList() const { return false; } > virtual bool isMenuListPopup() const { return false; } > virtual bool isMenuListOption() const { return false; } >@@ -420,7 +409,7 @@ > virtual bool isNativeSpinButton() const { return false; } > virtual bool isSpinButtonPart() const { return false; } > virtual bool isMockObject() const { return false; } >- virtual bool isMediaControlLabel() const { return false; } >+ bool isMediaControlLabel() const override { return false; } > virtual bool isMediaObject() const { return false; } > bool isSwitch() const { return roleValue() == AccessibilityRole::Switch; } > bool isToggleButton() const { return roleValue() == AccessibilityRole::ToggleButton; } >@@ -431,10 +420,10 @@ > bool isTabItem() const { return roleValue() == AccessibilityRole::Tab; } > bool isRadioGroup() const { return roleValue() == AccessibilityRole::RadioGroup; } > bool isComboBox() const { return roleValue() == AccessibilityRole::ComboBox; } >- bool isTree() const { return roleValue() == AccessibilityRole::Tree; } >+ bool isTree() const override { return roleValue() == AccessibilityRole::Tree; } > bool isTreeGrid() const { return roleValue() == AccessibilityRole::TreeGrid; } >- bool isTreeItem() const { return roleValue() == AccessibilityRole::TreeItem; } >- bool isScrollbar() const { return roleValue() == AccessibilityRole::ScrollBar; } >+ bool isTreeItem() const override { return roleValue() == AccessibilityRole::TreeItem; } >+ bool isScrollbar() const override { return roleValue() == AccessibilityRole::ScrollBar; } > bool isButton() const; > bool isListItem() const { return roleValue() == AccessibilityRole::ListItem; } > bool isCheckboxOrRadio() const { return isCheckbox() || isRadioButton(); } >@@ -474,6 +463,8 @@ > virtual bool isVisible() const { return true; } > virtual bool isCollapsed() const { return false; } > virtual void setIsExpanded(bool) { } >+ FloatRect relativeFrame() const override; >+ FloatRect convertFrameToSpace(const FloatRect&, AccessibilityConversionSpace) const; > > // In a multi-select list, many items can be selected but only one is active at a time. > virtual bool isSelectedOptionActive() const { return false; } >@@ -503,7 +494,7 @@ > virtual Element* element() const; > virtual Node* node() const { return nullptr; } > virtual RenderObject* renderer() const { return nullptr; } >- virtual bool accessibilityIsIgnored() const; >+ bool accessibilityIsIgnored() const override; > virtual AccessibilityObjectInclusion defaultObjectInclusion() const; > bool accessibilityIsIgnoredByDefault() const; > >@@ -584,11 +575,11 @@ > virtual Vector<String> determineARIADropEffects() { return { }; } > > // Called on the root AX object to return the deepest available element. >- virtual AccessibilityObject* accessibilityHitTest(const IntPoint&) const { return nullptr; } >+ AccessibilityObjectInterface* accessibilityHitTest(const IntPoint&) const override { return nullptr; } > // Called on the AX object after the render tree determines which is the right AccessibilityRenderObject. >- virtual AccessibilityObject* elementAccessibilityHitTest(const IntPoint&) const; >+ virtual AccessibilityObjectInterface* elementAccessibilityHitTest(const IntPoint&) const; > >- virtual AccessibilityObject* focusedUIElement() const; >+ AccessibilityObjectInterface* focusedUIElement() const override; > > virtual AccessibilityObject* firstChild() const { return nullptr; } > virtual AccessibilityObject* lastChild() const { return nullptr; } >@@ -598,6 +589,7 @@ > virtual AccessibilityObject* previousSiblingUnignored(int limit) const; > virtual AccessibilityObject* parentObject() const = 0; > virtual AccessibilityObject* parentObjectUnignored() const; >+ AccessibilityObjectInterface* parentObjectInterfaceUnignored() const override { return parentObjectUnignored(); } > virtual AccessibilityObject* parentObjectIfExists() const { return nullptr; } > static AccessibilityObject* firstAccessibleObjectFromNode(const Node*); > void findMatchingObjects(AccessibilitySearchCriteria*, AccessibilityChildrenVector&); >@@ -624,7 +616,7 @@ > virtual bool inheritsPresentationalRole() const { return false; } > > // Accessibility Text >- virtual void accessibilityText(Vector<AccessibilityText>&) { }; >+ virtual void accessibilityText(Vector<AccessibilityText>&) const { }; > // A single method for getting a computed label for an AXObject. It condenses the nuances of accessibilityText. Used by Inspector. > String computedLabel(); > >@@ -657,7 +649,7 @@ > // Only if isColorWell() > virtual void colorValue(int& r, int& g, int& b) const { r = 0; g = 0; b = 0; } > >- virtual AccessibilityRole roleValue() const { return m_role; } >+ AccessibilityRole roleValue() const override { return m_role; } > > virtual AXObjectCache* axObjectCache() const; > AXID axObjectID() const { return m_id; } >@@ -727,7 +719,7 @@ > > virtual bool canHaveChildren() const { return true; } > virtual bool hasChildren() const { return m_haveChildren; } >- virtual void updateChildrenIfNecessary(); >+ void updateChildrenIfNecessary() override; > virtual void setNeedsToUpdateChildren() { } > virtual void setNeedsToUpdateSubtree() { } > virtual void clearChildren(); >@@ -946,7 +938,7 @@ > AccessibilityObjectWrapper* wrapper() const; > void setWrapper(AccessibilityObjectWrapper*); > #else >- AccessibilityObjectWrapper* wrapper() const { return m_wrapper.get(); } >+ AccessibilityObjectWrapper* wrapper() const override { return m_wrapper.get(); } > void setWrapper(AccessibilityObjectWrapper* wrapper) > { > m_wrapper = wrapper; >@@ -984,6 +976,11 @@ > #if PLATFORM(COCOA) > bool preventKeyboardDOMEventDispatch() const; > void setPreventKeyboardDOMEventDispatch(bool); >+ bool fileUploadButtonReturnsValueInTitle() const; >+ String speechHintAttributeValue() const override; >+ String descriptionAttributeValue() const override; >+ String helpTextAttributeValue() const override; >+ String titleAttributeValue() const override; > #endif > > #if PLATFORM(COCOA) && !PLATFORM(IOS_FAMILY) >@@ -994,7 +991,8 @@ > AccessibilityObject* focusableAncestor(); > AccessibilityObject* editableAncestor(); > AccessibilityObject* highestEditableAncestor(); >- >+ >+ const AccessibilityScrollView* ancestorAccessibilityScrollView(bool includeSelf) const; > static const AccessibilityObject* matchedParent(const AccessibilityObject&, bool includeSelf, const WTF::Function<bool(const AccessibilityObject&)>&); > > void clearIsIgnoredFromParentData() { m_isIgnoredFromParentData = AccessibilityIsIgnoredFromParentData(); } >@@ -1016,7 +1014,8 @@ > void setIsIgnoredFromParentData(AccessibilityIsIgnoredFromParentData& data) { m_isIgnoredFromParentData = data; } > > virtual bool computeAccessibilityIsIgnored() const { return true; } >- >+ bool isAccessibilityObject() const override { return true; } >+ > // If this object itself scrolls, return its ScrollableArea. > virtual ScrollableArea* getScrollableAreaIfScrollable() const { return nullptr; } > virtual void scrollTo(const IntPoint&) const { } >@@ -1068,3 +1067,7 @@ > SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \ > static bool isType(const WebCore::AccessibilityObject& object) { return object.predicate; } \ > SPECIALIZE_TYPE_TRAITS_END() >+ >+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::AccessibilityObject) >+static bool isType(const WebCore::AccessibilityObjectInterface& context) { return context.isAccessibilityObject(); } >+SPECIALIZE_TYPE_TRAITS_END() >Index: Source/WebCore/accessibility/AccessibilityObjectInterface.h >=================================================================== >--- Source/WebCore/accessibility/AccessibilityObjectInterface.h (revision 240558) >+++ Source/WebCore/accessibility/AccessibilityObjectInterface.h (working copy) >@@ -25,10 +25,31 @@ > > #pragma once > >+#include "LayoutRect.h" >+#include <wtf/RefCounted.h> >+ >+#if PLATFORM(WIN) >+#include "AccessibilityObjectWrapperWin.h" >+#include "COMPtr.h" >+#endif >+ >+#if PLATFORM(COCOA) >+OBJC_CLASS WebAccessibilityObjectWrapper; >+typedef WebAccessibilityObjectWrapper AccessibilityObjectWrapper; >+#elif PLATFORM(GTK) >+typedef struct _AtkObject AtkObject; >+typedef struct _AtkObject AccessibilityObjectWrapper; >+#elif PLATFORM(WPE) >+class AccessibilityObjectWrapper : public RefCounted<AccessibilityObjectWrapper> { }; >+#else >+class AccessibilityObjectWrapper; >+#endif >+ > namespace WebCore { > > typedef unsigned AXID; > extern const AXID InvalidAXID; >+typedef unsigned AXIsolatedTreeID; > > enum class AccessibilityRole { > Annotation = 1, >@@ -186,6 +207,29 @@ > virtual bool isMediaControlLabel() const = 0; > virtual AccessibilityRole roleValue() const = 0; > virtual bool isAttachment() const = 0; >+ virtual bool isLink() const = 0; >+ virtual bool isImageMapLink() const = 0; >+ virtual bool isImage() const = 0; >+ virtual bool isFileUploadButton() const = 0; >+ virtual bool isTree() const = 0; >+ virtual bool isTreeItem() const = 0; >+ virtual bool isScrollbar() const = 0; >+ virtual bool accessibilityIsIgnored() const = 0; >+ virtual FloatRect relativeFrame() const = 0; >+ virtual AccessibilityObjectInterface* parentObjectInterfaceUnignored() const = 0; >+ virtual AccessibilityObjectInterface* focusedUIElement() const = 0; >+ virtual bool isAccessibilityObject() const { return false; } >+ >+#if PLATFORM(COCOA) >+ virtual String speechHintAttributeValue() const = 0; >+ virtual String descriptionAttributeValue() const = 0; >+ virtual String helpTextAttributeValue() const = 0; >+ virtual String titleAttributeValue() const = 0; >+#endif >+ >+ virtual AccessibilityObjectWrapper* wrapper() const = 0; >+ virtual AccessibilityObjectInterface* accessibilityHitTest(const IntPoint&) const = 0; >+ virtual void updateChildrenIfNecessary() = 0; > }; > >-} >+} // namespace WebCore >Index: Source/WebCore/accessibility/AccessibilityRenderObject.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilityRenderObject.cpp (revision 240558) >+++ Source/WebCore/accessibility/AccessibilityRenderObject.cpp (working copy) >@@ -1660,7 +1660,7 @@ > // The ARIA spec says a tab item can also be selected if it is aria-labeled by a tabpanel > // that has keyboard focus inside of it, or if a tabpanel in its aria-controls list has KB > // focus inside of it. >- AccessibilityObject* focusedElement = focusedUIElement(); >+ AccessibilityObject* focusedElement = static_cast<AccessibilityObject*>(focusedUIElement()); > if (!focusedElement) > return false; > >@@ -2335,7 +2335,7 @@ > return nullptr; > } > >-AccessibilityObject* AccessibilityRenderObject::remoteSVGElementHitTest(const IntPoint& point) const >+AccessibilityObjectInterface* AccessibilityRenderObject::remoteSVGElementHitTest(const IntPoint& point) const > { > AccessibilityObject* remote = remoteSVGRootElement(Create); > if (!remote) >@@ -2345,7 +2345,7 @@ > return remote->accessibilityHitTest(IntPoint(offset)); > } > >-AccessibilityObject* AccessibilityRenderObject::elementAccessibilityHitTest(const IntPoint& point) const >+AccessibilityObjectInterface* AccessibilityRenderObject::elementAccessibilityHitTest(const IntPoint& point) const > { > if (isSVGImage()) > return remoteSVGElementHitTest(point); >@@ -2359,7 +2359,7 @@ > return shadowHost && !shadowHost->hasTagName(videoTag); > } > >-AccessibilityObject* AccessibilityRenderObject::accessibilityHitTest(const IntPoint& point) const >+AccessibilityObjectInterface* AccessibilityRenderObject::accessibilityHitTest(const IntPoint& point) const > { > if (!m_renderer || !m_renderer->hasLayer()) > return nullptr; >@@ -2393,7 +2393,7 @@ > result->updateChildrenIfNecessary(); > > // Allow the element to perform any hit-testing it might need to do to reach non-render children. >- result = result->elementAccessibilityHitTest(point); >+ result = static_cast<AccessibilityObject*>(result->elementAccessibilityHitTest(point)); > > if (result && result->accessibilityIsIgnored()) { > // If this element is the label of a control, a hit test should return the control. >@@ -3444,7 +3444,7 @@ > result.append(descendant); > return; > } >- if (AccessibilityObject* focusedElement = focusedUIElement()) { >+ if (AccessibilityObject* focusedElement = static_cast<AccessibilityObject*>(focusedUIElement())) { > result.append(focusedElement); > return; > } >Index: Source/WebCore/accessibility/AccessibilityRenderObject.h >=================================================================== >--- Source/WebCore/accessibility/AccessibilityRenderObject.h (revision 240558) >+++ Source/WebCore/accessibility/AccessibilityRenderObject.h (working copy) >@@ -106,7 +106,7 @@ > bool ariaRoleHasPresentationalChildren() const override; > > // Should be called on the root accessibility object to kick off a hit test. >- AccessibilityObject* accessibilityHitTest(const IntPoint&) const override; >+ AccessibilityObjectInterface* accessibilityHitTest(const IntPoint&) const override; > > Element* anchorElement() const override; > >@@ -239,7 +239,7 @@ > AccessibilityObject* internalLinkElement() const; > AccessibilityObject* accessibilityImageMapHitTest(HTMLAreaElement*, const IntPoint&) const; > AccessibilityObject* accessibilityParentForImageMap(HTMLMapElement*) const; >- AccessibilityObject* elementAccessibilityHitTest(const IntPoint&) const override; >+ AccessibilityObjectInterface* elementAccessibilityHitTest(const IntPoint&) const override; > > bool renderObjectIsObservable(RenderObject&) const; > RenderObject* renderParentObject() const; >@@ -249,7 +249,7 @@ > void detachRemoteSVGRoot(); > enum CreationChoice { Create, Retrieve }; > AccessibilitySVGRoot* remoteSVGRootElement(CreationChoice createIfNecessary) const; >- AccessibilityObject* remoteSVGElementHitTest(const IntPoint&) const; >+ AccessibilityObjectInterface* remoteSVGElementHitTest(const IntPoint&) const; > void offsetBoundingBoxForRemoteSVGElement(LayoutRect&) const; > bool supportsPath() const override; > >Index: Source/WebCore/accessibility/AccessibilitySVGElement.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilitySVGElement.cpp (revision 240558) >+++ Source/WebCore/accessibility/AccessibilitySVGElement.cpp (working copy) >@@ -106,7 +106,7 @@ > return fallback; > } > >-void AccessibilitySVGElement::accessibilityText(Vector<AccessibilityText>& textOrder) >+void AccessibilitySVGElement::accessibilityText(Vector<AccessibilityText>& textOrder) const > { > String description = accessibilityDescription(); > if (!description.isEmpty()) >Index: Source/WebCore/accessibility/AccessibilitySVGElement.h >=================================================================== >--- Source/WebCore/accessibility/AccessibilitySVGElement.h (revision 240558) >+++ Source/WebCore/accessibility/AccessibilitySVGElement.h (working copy) >@@ -44,7 +44,7 @@ > explicit AccessibilitySVGElement(RenderObject*); > > private: >- void accessibilityText(Vector<AccessibilityText>&) final; >+ void accessibilityText(Vector<AccessibilityText>&) const final; > AccessibilityRole determineAccessibilityRole() final; > AccessibilityRole determineAriaRoleAttribute() const final; > bool inheritsPresentationalRole() const final; >Index: Source/WebCore/accessibility/AccessibilityScrollView.cpp >=================================================================== >--- Source/WebCore/accessibility/AccessibilityScrollView.cpp (revision 240558) >+++ Source/WebCore/accessibility/AccessibilityScrollView.cpp (working copy) >@@ -199,7 +199,7 @@ > return nullptr; > } > >-AccessibilityObject* AccessibilityScrollView::accessibilityHitTest(const IntPoint& point) const >+AccessibilityObjectInterface* AccessibilityScrollView::accessibilityHitTest(const IntPoint& point) const > { > AccessibilityObject* webArea = webAreaObject(); > if (!webArea) >Index: Source/WebCore/accessibility/AccessibilityScrollView.h >=================================================================== >--- Source/WebCore/accessibility/AccessibilityScrollView.h (revision 240558) >+++ Source/WebCore/accessibility/AccessibilityScrollView.h (working copy) >@@ -59,7 +59,7 @@ > AccessibilityObject* scrollBar(AccessibilityOrientation) override; > void addChildren() override; > void clearChildren() override; >- AccessibilityObject* accessibilityHitTest(const IntPoint&) const override; >+ AccessibilityObjectInterface* accessibilityHitTest(const IntPoint&) const override; > void updateChildrenIfNecessary() override; > void setNeedsToUpdateChildren() override { m_childrenDirty = true; } > void updateScrollbars(); >Index: Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceComponent.cpp >=================================================================== >--- Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceComponent.cpp (revision 240558) >+++ Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceComponent.cpp (working copy) >@@ -77,7 +77,7 @@ > > IntPoint pos = atkToContents(core(component), coordType, x, y); > >- AccessibilityObject* target = core(component)->accessibilityHitTest(pos); >+ AccessibilityObject* target = downcast<AccessibilityObject>(core(component)->accessibilityHitTest(pos)); > if (!target) > return 0; > g_object_ref(target->wrapper()); >Index: Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm >=================================================================== >--- Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm (revision 240558) >+++ Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm (working copy) >@@ -41,6 +41,12 @@ > { > } > >+// On iOS, we don't have to return the value in the title. We can return the actual title, given the API. >+bool AccessibilityObject::fileUploadButtonReturnsValueInTitle() const >+{ >+ return false; >+} >+ > void AccessibilityObject::overrideAttachmentParent(AccessibilityObject*) > { > } >Index: Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm >=================================================================== >--- Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (revision 240558) >+++ Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (working copy) >@@ -387,7 +387,7 @@ > return nil; > > // Try a fuzzy hit test first to find an accessible element. >- RefPtr<AccessibilityObject> axObject; >+ AccessibilityObjectInterface *axObject = nullptr; > { > AXAttributeCacheEnabler enableCache(m_object->axObjectCache()); > axObject = m_object->accessibilityHitTest(IntPoint(point)); >@@ -1055,11 +1055,6 @@ > return YES; > } > >-- (BOOL)fileUploadButtonReturnsValueInTitle >-{ >- return NO; >-} >- > static void appendStringToResult(NSMutableString *result, NSString *string) > { > ASSERT(result); >@@ -1499,7 +1494,7 @@ > > auto floatPoint = FloatPoint(point); > auto floatRect = FloatRect(floatPoint, FloatSize()); >- return [self convertRectToSpace:floatRect space:ScreenSpace].origin; >+ return [self convertRectToSpace:floatRect space:AccessibilityConversionSpace::Screen].origin; > } > > - (BOOL)accessibilityPerformEscape >@@ -1563,7 +1558,7 @@ > - (CGRect)_accessibilityRelativeFrame > { > auto rect = FloatRect(snappedIntRect(m_object->elementRect())); >- return [self convertRectToSpace:rect space:PageSpace]; >+ return [self convertRectToSpace:rect space:AccessibilityConversionSpace::Page]; > } > > // Used by UIKit accessibility bundle to help determine distance during a hit-test. >@@ -1585,7 +1580,7 @@ > if (!document || !document->view()) > return CGRectZero; > auto rect = FloatRect(snappedIntRect(document->view()->unobscuredContentRect())); >- return [self convertRectToSpace:rect space:ScreenSpace]; >+ return [self convertRectToSpace:rect space:AccessibilityConversionSpace::Screen]; > } > > // The "center point" is where VoiceOver will "press" an object. This may not be the actual >@@ -1596,7 +1591,7 @@ > return CGPointZero; > > auto rect = FloatRect(snappedIntRect(m_object->boundingBoxRect())); >- CGRect cgRect = [self convertRectToSpace:rect space:ScreenSpace]; >+ CGRect cgRect = [self convertRectToSpace:rect space:AccessibilityConversionSpace::Screen]; > return CGPointMake(CGRectGetMidX(cgRect), CGRectGetMidY(cgRect)); > } > >@@ -1606,7 +1601,7 @@ > return CGRectZero; > > auto rect = FloatRect(snappedIntRect(m_object->elementRect())); >- return [self convertRectToSpace:rect space:ScreenSpace]; >+ return [self convertRectToSpace:rect space:AccessibilityConversionSpace::Screen]; > } > > // Checks whether a link contains only static text and images (and has been divided unnaturally by <spans> and other nefarious mechanisms). >@@ -1669,7 +1664,7 @@ > if (![self _prepareAccessibilityCall]) > return nil; > >- AccessibilityObject* focusedObj = m_object->focusedUIElement(); >+ AccessibilityObject* focusedObj = downcast<AccessibilityObject>(m_object->focusedUIElement()); > > if (!focusedObj) > return nil; >@@ -2651,7 +2646,7 @@ > return CGRectZero; > > auto rect = FloatRect(m_object->boundsForRange(range)); >- return [self convertRectToSpace:rect space:ScreenSpace]; >+ return [self convertRectToSpace:rect space:AccessibilityConversionSpace::Screen]; > } > > - (RefPtr<Range>)rangeFromMarkers:(NSArray *)markers withText:(NSString *)text >@@ -2697,7 +2692,7 @@ > for (unsigned i = 0; i < size; i++) { > const WebCore::SelectionRect& coreRect = selectionRects[i]; > auto selectionRect = FloatRect(coreRect.rect()); >- CGRect rect = [self convertRectToSpace:selectionRect space:ScreenSpace]; >+ CGRect rect = [self convertRectToSpace:selectionRect space:AccessibilityConversionSpace::Screen]; > [rects addObject:[NSValue valueWithRect:rect]]; > } > >Index: Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp >=================================================================== >--- Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp (revision 240558) >+++ Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp (working copy) >@@ -42,9 +42,9 @@ > return ++s_currentTreeID; > } > >-HashMap<AXIsolatedTreeID, Ref<AXIsolatedTree>>& AXIsolatedTree::treePageCache() >+HashMap<uint64_t, Ref<AXIsolatedTree>>& AXIsolatedTree::treePageCache() > { >- static NeverDestroyed<HashMap<AXIsolatedTreeID, Ref<AXIsolatedTree>>> map; >+ static NeverDestroyed<HashMap<uint64_t, Ref<AXIsolatedTree>>> map; > return map; > } > >@@ -67,6 +67,22 @@ > return adoptRef(*new AXIsolatedTree()); > } > >+Ref<AXIsolatedTree> AXIsolatedTree::initializePageTreeForID(uint64_t pageID, AXObjectCache& cache) >+{ >+ RELEASE_ASSERT(isMainThread()); >+ auto tree = cache->generateIsolatedAccessibilityTree(); >+ tree->setInitialRequestInProgress(true); >+ tree->applyPendingChanges(); >+ tree->setInitialRequestInProgress(false); >+ return tree; >+} >+ >+ >+RefPtr<AXIsolatedTreeNode> AXIsolatedTree::nodeInTreeForID(AXIsolatedTreeID treeID, AXID axID) >+{ >+ return treeForID(treeID)->nodeForID(axID); >+} >+ > RefPtr<AXIsolatedTree> AXIsolatedTree::treeForID(AXIsolatedTreeID treeID) > { > return treeIDCache().get(treeID); >@@ -92,19 +108,43 @@ > return nullptr; > } > >+static inline assertThreadCorrectness(BOOL initialRequest) >+{ >+ bool mainThread = isMainThread(); >+ RELEASE_ASSERT((mainThread && initialRequest) || !mainThread); >+} >+ > RefPtr<AXIsolatedTreeNode> AXIsolatedTree::nodeForID(AXID axID) const > { >- ASSERT(!isMainThread()); >+ assertThreadCorrectness(m_initialRequestInProgress); >+ > if (!axID) > return nullptr; > return m_readerThreadNodeMap.get(axID); > } > >+RefPtr<AXIsolatedTreeNode> AXIsolatedTree::focusedUIElement() >+{ >+ return nodeForID(m_focusedNodeID); >+} >+ > RefPtr<AXIsolatedTreeNode> AXIsolatedTree::rootNode() > { > return nodeForID(m_rootNodeID); > } > >+void AXIsolatedTree::setRootNodeID(AXID axID) >+{ >+ LockHolder locker(m_changeLogLock); >+ m_pendingRootNodeID = axID; >+} >+ >+void AXIsolatedTree::setFocusedNodeID(AXID axID) >+{ >+ LockHolder locker(m_changeLogLock); >+ m_pendingFocusedNodeID = axID; >+} >+ > void AXIsolatedTree::removeNode(AXID axID) > { > LockHolder locker(m_changeLogLock); >@@ -118,9 +158,14 @@ > m_pendingAppends.append(node.copyRef()); > } > >+void AXIsolatedTree::setInitialRequestInProgress(bool initialRequest) >+{ >+ m_initialRequestInProgress = initialRequest; >+} >+ > void AXIsolatedTree::applyPendingChanges() > { >- RELEASE_ASSERT(!isMainThread()); >+ assertThreadCorrectness(m_initialRequestInProgress); > > LockHolder locker(m_changeLogLock); > Vector<Ref<AXIsolatedTreeNode>> appendCopy; >@@ -128,10 +173,14 @@ > Vector<AXID> removeCopy({ WTFMove(m_pendingRemovals) }); > locker.unlockEarly(); > >+ // We don't clear the pending IDs so that if the next round of updates does not modify these, then they stay the same >+ // value without extra bookkeeping >+ m_rootNodeID = m_pendingRootNodeID; >+ m_focusedNodeID = m_pendingFocusedNodeID; >+ > for (auto& item : appendCopy) { >- m_readerThreadNodeMap.add(item->identifier(), item.copyRef()); >- if (item->isRootNode()) >- m_rootNodeID = item->identifier(); >+ item->setTreeIdentifier(m_treeID); >+ m_readerThreadNodeMap.add(item->identifier(), WTFMove(item)); > } > > for (auto item : removeCopy) >Index: Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h >=================================================================== >--- Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h (revision 240558) >+++ Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h (working copy) >@@ -36,9 +36,7 @@ > > class Page; > >-typedef unsigned AXIsolatedTreeID; >- >-class AXIsolatedTree : public ThreadSafeRefCounted<AXIsolatedTree> { >+class AXIsolatedTree : public ThreadSafeRefCounted<AXIsolatedTree>, public CanMakeWeakPtr<AXIsolatedTree> { > WTF_MAKE_NONCOPYABLE(AXIsolatedTree); WTF_MAKE_FAST_ALLOCATED; > > public: >@@ -45,21 +43,27 @@ > static Ref<AXIsolatedTree> create(); > virtual ~AXIsolatedTree(); > >- // Creation must happen on main thread. > static Ref<AXIsolatedTree> createTreeForPageID(uint64_t pageID); >+ WEBCORE_EXPORT static Ref<AXIsolatedTree> initializePageTreeForID(uint64_t pageID, AXObjectCache&); > WEBCORE_EXPORT static RefPtr<AXIsolatedTree> treeForPageID(uint64_t pageID); > WEBCORE_EXPORT static RefPtr<AXIsolatedTree> treeForID(AXIsolatedTreeID); > > WEBCORE_EXPORT RefPtr<AXIsolatedTreeNode> rootNode(); >+ WEBCORE_EXPORT RefPtr<AXIsolatedTreeNode> focusedUIElement(); > RefPtr<AXIsolatedTreeNode> nodeForID(AXID) const; >+ static RefPtr<AXIsolatedTreeNode> nodeInTreeForID(AXIsolatedTreeID, AXID); > > // Call on main thread > void appendNodeChanges(Vector<Ref<AXIsolatedTreeNode>>&); > void removeNode(AXID); > >+ void setRootNodeID(AXID); >+ void setFocusedNodeID(AXID); >+ > // Call on AX thread > WEBCORE_EXPORT void applyPendingChanges(); > >+ WEBCORE_EXPORT void setInitialRequestInProgress(bool); > AXIsolatedTreeID treeIdentifier() const { return m_treeID; } > > private: >@@ -66,8 +70,8 @@ > AXIsolatedTree(); > > static HashMap<AXIsolatedTreeID, Ref<AXIsolatedTree>>& treeIDCache(); >- static HashMap<AXIsolatedTreeID, Ref<AXIsolatedTree>>& treePageCache(); >- >+ static HashMap<uint64_t, Ref<AXIsolatedTree>>& treePageCache(); >+ > // Only access on AX thread requesting data. > HashMap<AXID, Ref<AXIsolatedTreeNode>> m_readerThreadNodeMap; > >@@ -74,10 +78,14 @@ > // Written to by main thread under lock, accessed and applied by AX thread. > Vector<Ref<AXIsolatedTreeNode>> m_pendingAppends; > Vector<AXID> m_pendingRemovals; >+ AXID m_pendingFocusedNodeID; >+ AXID m_pendingRootNodeID; > Lock m_changeLogLock; > > AXIsolatedTreeID m_treeID; >- AXID m_rootNodeID; >+ AXID m_rootNodeID = InvalidAXID; >+ AXID m_focusedNodeID = InvalidAXID; >+ bool m_initialRequestInProgress; > }; > > } // namespace WebCore >Index: Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp >=================================================================== >--- Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp (revision 240558) >+++ Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.cpp (working copy) >@@ -35,6 +35,7 @@ > AXIsolatedTreeNode::AXIsolatedTreeNode(const AccessibilityObject& object) > : m_identifier(object.axObjectID()) > , m_initialized(false) >+ , m_wrapper(nullptr) > { > ASSERT(isMainThread()); > initializeAttributeData(object); >@@ -55,6 +56,18 @@ > setProperty(AXPropertyName::RoleValue, static_cast<int>(object.roleValue())); > setProperty(AXPropertyName::IsAttachment, object.isAttachment()); > setProperty(AXPropertyName::IsMediaControlLabel, object.isMediaControlLabel()); >+ setProperty(AXPropertyName::IsLink, object.isLink()); >+ setProperty(AXPropertyName::IsImageMapLink, object.isImageMapLink()); >+ setProperty(AXPropertyName::IsImage, object.isImage()); >+ setProperty(AXPropertyName::IsFileUploadButton, object.isFileUploadButton()); >+ setProperty(AXPropertyName::IsAccessibilityIgnored, object.accessibilityIsIgnored()); >+ setProperty(AXPropertyName::IsTree, object.isTree()); >+ setProperty(AXPropertyName::IsScrollbar, object.isScrollbar()); >+ setProperty(AXPropertyName::RelativeFrame, object.relativeFrame()); >+ setProperty(AXPropertyName::SpeechHint, object.speechHintAttributeValue().isolatedCopy()); >+ setProperty(AXPropertyName::Title, object.titleAttributeValue().isolatedCopy()); >+ setProperty(AXPropertyName::Description, object.descriptionAttributeValue().isolatedCopy()); >+ setProperty(AXPropertyName::HelpText, object.helpTextAttributeValue().isolatedCopy()); > } > > void AXIsolatedTreeNode::setProperty(AXPropertyName propertyName, AttributeValueVariant&& value, bool shouldRemove) >@@ -74,6 +87,64 @@ > m_children.append(axID); > } > >+void AXIsolatedTreeNode::setParent(AXID parent) >+{ >+ ASSERT(isMainThread()); >+ m_parent = parent; >+} >+ >+void AXIsolatedTreeNode::setTreeIdentifier(AXIsolatedTreeID treeIdentifier) >+{ >+ m_treeIdentifier = treeIdentifier; >+ >+ if (auto tree = AXIsolatedTree::treeForID(m_treeIdentifier)) >+ m_cachedTree = makeWeakPtr(tree.get()); >+} >+ >+AccessibilityObjectInterface* AXIsolatedTreeNode::focusedUIElement() const >+{ >+ if (auto focusedElement = tree()->focusedUIElement()) >+ return focusedElement.get(); >+ return nullptr; >+} >+ >+AccessibilityObjectInterface* AXIsolatedTreeNode::parentObjectInterfaceUnignored() const >+{ >+ return tree()->nodeForID(parent()).get(); >+} >+ >+AccessibilityObjectInterface* AXIsolatedTreeNode::accessibilityHitTest(const IntPoint& pt) const >+{ >+ if (!relativeFrame().contains(pt)) >+ return nullptr; >+ >+ for (auto childID : children()) { >+ auto child = tree()->nodeForID(childID); >+ if (child && child->relativeFrame().contains(pt)) >+ return child->accessibilityHitTest(pt); >+ } >+ >+ return const_cast<AXIsolatedTreeNode*>(this); >+} >+ >+AXIsolatedTree* AXIsolatedTreeNode::tree() const >+{ >+ return m_cachedTree.get(); >+} >+ >+FloatRect AXIsolatedTreeNode::rectAttributeValue(AXPropertyName propertyName) const >+{ >+ FloatRect zeroRect; >+ auto value = m_attributeMap.get(propertyName); >+ return WTF::switchOn(value, [&zeroRect] (Optional<FloatRect> typedValue) { >+ if (!typedValue) >+ return zeroRect; >+ return typedValue.value(); >+ }, [&] (auto&) { >+ return zeroRect; >+ }); >+} >+ > double AXIsolatedTreeNode::doubleAttributeValue(AXPropertyName propertyName) const > { > auto value = m_attributeMap.get(propertyName); >@@ -104,13 +175,13 @@ > }); > } > >-const String& AXIsolatedTreeNode::stringAttributeValue(AXPropertyName propertyName) const >+const String AXIsolatedTreeNode::stringAttributeValue(AXPropertyName propertyName) const > { > auto value = m_attributeMap.get(propertyName); > return WTF::switchOn(value, [&] (String& typedValue) { > return typedValue; > }, [&] (auto&) { >- return nullAtom(); >+ return emptyString(); > }); > } > >@@ -123,7 +194,7 @@ > return 0; > }); > } >- >+ > } // namespace WebCore > > #endif // ENABLE((ACCESSIBILITY_ISOLATED_TREE) >Index: Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.h >=================================================================== >--- Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.h (revision 240558) >+++ Source/WebCore/accessibility/isolatedtree/AXIsolatedTreeNode.h (working copy) >@@ -27,7 +27,10 @@ > > #if ENABLE(ACCESSIBILITY_ISOLATED_TREE) > >+#include "AXIsolatedTree.h" > #include "AccessibilityObjectInterface.h" >+#include "FloatRect.h" >+#include "IntPoint.h" > #include <wtf/Forward.h> > #include <wtf/HashMap.h> > #include <wtf/RefPtr.h> >@@ -37,12 +40,9 @@ > #include <wtf/Vector.h> > #include <wtf/WeakPtr.h> > >-#if PLATFORM(COCOA) >-OBJC_CLASS WebAccessibilityObjectWrapper; >-#endif >- > namespace WebCore { > >+class AXIsolatedTree; > class AccessibilityObject; > > class AXIsolatedTreeNode final : public AccessibilityObjectInterface, public ThreadSafeRefCounted<AXIsolatedTreeNode>, public CanMakeWeakPtr<AXIsolatedTreeNode> { >@@ -50,9 +50,22 @@ > public: > enum class AXPropertyName : uint8_t { > None = 0, >- RoleValue = 1, >+ HelpText, >+ IsAccessibilityIgnored, > IsAttachment, >+ IsFileUploadButton, >+ IsImage, >+ IsImageMapLink, >+ IsLink, > IsMediaControlLabel, >+ IsScrollbar, >+ IsTree, >+ IsTreeItem, >+ Description, >+ RelativeFrame, >+ RoleValue, >+ SpeechHint, >+ Title, > }; > > static Ref<AXIsolatedTreeNode> create(const AccessibilityObject&); >@@ -59,27 +72,20 @@ > virtual ~AXIsolatedTreeNode(); > > AXID identifier() const { return m_identifier; } >- >- bool isRootNode() const { return m_isRootNode; } >- void setIsRootNode(bool value) >- { >- ASSERT(isMainThread()); >- m_isRootNode = value; >- } >- >- void setParent(AXID parent) >- { >- ASSERT(isMainThread()); >- m_parent = parent; >- } >+ >+ void setParent(AXID); > AXID parent() const { return m_parent; } > > void appendChild(AXID); > const Vector<AXID>& children() const { return m_children; }; > >+ AXIsolatedTree* tree() const; >+ AXIsolatedTreeID treeIdentifier() const { return m_treeIdentifier; } >+ void setTreeIdentifier(AXIsolatedTreeID); >+ > #if PLATFORM(COCOA) >- WebAccessibilityObjectWrapper* wrapper() const { return m_wrapper.get(); } >- void setWrapper(WebAccessibilityObjectWrapper* wrapper) { m_wrapper = wrapper; } >+ AccessibilityObjectWrapper* wrapper() const override { return m_wrapper.get(); } >+ void setWrapper(AccessibilityObjectWrapper* wrapper) { m_wrapper = wrapper; } > #endif > > protected: >@@ -89,23 +95,43 @@ > AXIsolatedTreeNode(const AccessibilityObject&); > void initializeAttributeData(const AccessibilityObject&); > >+ AccessibilityObjectInterface* accessibilityHitTest(const IntPoint&) const override; >+ void updateChildrenIfNecessary() override { } >+ > bool isMediaControlLabel() const override { return boolAttributeValue(AXPropertyName::IsMediaControlLabel); } > bool isAttachment() const override { return boolAttributeValue(AXPropertyName::IsAttachment); } > AccessibilityRole roleValue() const override { return static_cast<AccessibilityRole>(intAttributeValue(AXPropertyName::RoleValue)); } >+ bool isLink() const override { return boolAttributeValue(AXPropertyName::IsLink); } >+ bool isImageMapLink() const override { return boolAttributeValue(AXPropertyName::IsImageMapLink); } >+ bool isImage() const override { return boolAttributeValue(AXPropertyName::IsImage); } >+ bool isFileUploadButton() const override { return boolAttributeValue(AXPropertyName::IsFileUploadButton); } >+ bool accessibilityIsIgnored() const override { return boolAttributeValue(AXPropertyName::IsAccessibilityIgnored); } >+ AccessibilityObjectInterface* parentObjectInterfaceUnignored() const override; >+ bool isTree() const override { return boolAttributeValue(AXPropertyName::IsTree); } >+ bool isTreeItem() const override { return boolAttributeValue(AXPropertyName::IsTreeItem); } >+ bool isScrollbar() const override { return boolAttributeValue(AXPropertyName::IsScrollbar); } >+ FloatRect relativeFrame() const override { return rectAttributeValue(AXPropertyName::RelativeFrame); } >+ String speechHintAttributeValue() const override { return stringAttributeValue(AXPropertyName::SpeechHint); } >+ String descriptionAttributeValue() const override { return stringAttributeValue(AXPropertyName::Description); } >+ String helpTextAttributeValue() const override { return stringAttributeValue(AXPropertyName::HelpText); } >+ String titleAttributeValue() const override { return stringAttributeValue(AXPropertyName::Title); } >+ AccessibilityObjectInterface* focusedUIElement() const override; > >- using AttributeValueVariant = Variant<std::nullptr_t, String, bool, int, unsigned, double>; >+ using AttributeValueVariant = Variant<std::nullptr_t, String, bool, int, unsigned, double, Optional<FloatRect>>; > void setProperty(AXPropertyName, AttributeValueVariant&&, bool shouldRemove = false); > > bool boolAttributeValue(AXPropertyName) const; >- const String& stringAttributeValue(AXPropertyName) const; >+ const String stringAttributeValue(AXPropertyName) const; > int intAttributeValue(AXPropertyName) const; > unsigned unsignedAttributeValue(AXPropertyName) const; > double doubleAttributeValue(AXPropertyName) const; >+ FloatRect rectAttributeValue(AXPropertyName) const; > > AXID m_parent; > AXID m_identifier; >- bool m_isRootNode; > bool m_initialized; >+ AXIsolatedTreeID m_treeIdentifier; >+ WeakPtr<AXIsolatedTree> m_cachedTree; > Vector<AXID> m_children; > > #if PLATFORM(COCOA) >Index: Source/WebCore/accessibility/mac/AXObjectCacheMac.mm >=================================================================== >--- Source/WebCore/accessibility/mac/AXObjectCacheMac.mm (revision 240558) >+++ Source/WebCore/accessibility/mac/AXObjectCacheMac.mm (working copy) >@@ -241,8 +241,11 @@ > #if ENABLE(ACCESSIBILITY_ISOLATED_TREE) > void AXObjectCache::associateIsolatedTreeNode(AccessibilityObject& object, AXIsolatedTreeNode& node, AXIsolatedTreeID treeID) > { >- object.wrapper().isolatedTreeIdentifier = treeID; >- node.setWrapper(object.wrapper()); >+ auto wrapper = object.wrapper(); >+ ASSERT(wrapper); >+ >+ wrapper.isolatedTreeIdentifier = treeID; >+ node.setWrapper(wrapper); > } > #endif > >Index: Source/WebCore/accessibility/mac/AccessibilityObjectBase.mm >=================================================================== >--- Source/WebCore/accessibility/mac/AccessibilityObjectBase.mm (nonexistent) >+++ Source/WebCore/accessibility/mac/AccessibilityObjectBase.mm (working copy) >@@ -0,0 +1,168 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+#import "AccessibilityObject.h" >+ >+#if HAVE(ACCESSIBILITY) && PLATFORM(COCOA) >+ >+#import "WebAccessibilityObjectWrapperBase.h" >+ >+namespace WebCore { >+ >+String AccessibilityObject::speechHintAttributeValue() const >+{ >+ auto speak = speakAsProperty(); >+ NSMutableArray<NSString *> *hints = [NSMutableArray array]; >+ if (speak & SpeakAs::SpellOut) >+ [hints addObject:@"spell-out"]; >+ else >+ [hints addObject:@"normal"]; >+ >+ if (speak & SpeakAs::Digits) >+ [hints addObject:@"digits"]; >+ if (speak & SpeakAs::LiteralPunctuation) >+ [hints addObject:@"literal-punctuation"]; >+ if (speak & SpeakAs::NoPunctuation) >+ [hints addObject:@"no-punctuation"]; >+ >+ return [hints componentsJoinedByString:@" "]; >+} >+ >+String AccessibilityObject::descriptionAttributeValue() const >+{ >+ // Static text objects should not have a description. Its content is communicated in its AXValue. >+ // One exception is the media control labels that have a value and a description. Those are set programatically. >+ if (roleValue() == AccessibilityRole::StaticText && !isMediaControlLabel()) >+ return emptyString(); >+ >+ Vector<AccessibilityText> textOrder; >+ accessibilityText(textOrder); >+ >+ NSMutableString *returnText = [NSMutableString string]; >+ bool visibleTextAvailable = false; >+ for (const auto& text : textOrder) { >+ if (text.textSource == AccessibilityTextSource::Alternative) { >+ [returnText appendString:text.text]; >+ break; >+ } >+ >+ switch (text.textSource) { >+ // These are sub-components of one element (Attachment) that are re-combined in OSX and iOS. >+ case AccessibilityTextSource::Title: >+ case AccessibilityTextSource::Subtitle: >+ case AccessibilityTextSource::Action: { >+ if (!text.text.length()) >+ break; >+ if ([returnText length]) >+ [returnText appendString:@", "]; >+ [returnText appendString:text.text]; >+ break; >+ } >+ case AccessibilityTextSource::Visible: >+ case AccessibilityTextSource::Children: >+ case AccessibilityTextSource::LabelByElement: >+ visibleTextAvailable = true; >+ break; >+ default: >+ break; >+ } >+ >+ if (text.textSource == AccessibilityTextSource::TitleTag && !visibleTextAvailable) { >+ [returnText appendString:text.text]; >+ break; >+ } >+ } >+ >+ return returnText; >+} >+ >+String AccessibilityObject::titleAttributeValue() const >+{ >+ // Static text objects should not have a title. Its content is communicated in its AXValue. >+ if (roleValue() == AccessibilityRole::StaticText) >+ return String(); >+ >+ // A file upload button presents a challenge because it has button text and a value, but the >+ // API doesn't support this paradigm. >+ // The compromise is to return the button type in the role description and the value of the file path in the title >+ if (isFileUploadButton() && fileUploadButtonReturnsValueInTitle()) >+ return stringValue(); >+ >+ Vector<AccessibilityText> textOrder; >+ accessibilityText(textOrder); >+ >+ for (const auto& text : textOrder) { >+ // If we have alternative text, then we should not expose a title. >+ if (text.textSource == AccessibilityTextSource::Alternative) >+ break; >+ >+ // Once we encounter visible text, or the text from our children that should be used foremost. >+ if (text.textSource == AccessibilityTextSource::Visible || text.textSource == AccessibilityTextSource::Children) >+ return text.text; >+ >+ // If there's an element that labels this object and it's not exposed, then we should use >+ // that text as our title. >+ if (text.textSource == AccessibilityTextSource::LabelByElement && !exposesTitleUIElement()) >+ return text.text; >+ } >+ >+ return String(); >+} >+ >+String AccessibilityObject::helpTextAttributeValue() const >+{ >+ Vector<AccessibilityText> textOrder; >+ accessibilityText(textOrder); >+ >+ bool descriptiveTextAvailable = false; >+ for (const auto& text : textOrder) { >+ if (text.textSource == AccessibilityTextSource::Help || text.textSource == AccessibilityTextSource::Summary) >+ return text.text; >+ >+ // If an element does NOT have other descriptive text the title tag should be used as its descriptive text. >+ // But, if those ARE available, then the title tag should be used for help text instead. >+ switch (text.textSource) { >+ case AccessibilityTextSource::Alternative: >+ case AccessibilityTextSource::Visible: >+ case AccessibilityTextSource::Children: >+ case AccessibilityTextSource::LabelByElement: >+ descriptiveTextAvailable = true; >+ break; >+ default: >+ break; >+ } >+ >+ if (text.textSource == AccessibilityTextSource::TitleTag && descriptiveTextAvailable) >+ return text.text; >+ } >+ >+ return String(); >+} >+ >+ >+}; // namespace WebCore >+ >+#endif // HAVE(ACCESSIBILITY) && PLATFORM(COCOA) >Index: Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm >=================================================================== >--- Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm (revision 240558) >+++ Source/WebCore/accessibility/mac/AccessibilityObjectMac.mm (working copy) >@@ -59,7 +59,13 @@ > [[wrapper() attachmentView] accessibilitySetOverrideValue:parentWrapper forAttribute:NSAccessibilityParentAttribute]; > ALLOW_DEPRECATED_DECLARATIONS_END > } >- >+ >+// On iOS, we don't have to return the value in the title. We can return the actual title, given the API. >+bool AccessibilityObject::fileUploadButtonReturnsValueInTitle() const >+{ >+ return true; >+} >+ > bool AccessibilityObject::accessibilityIgnoreAttachment() const > { > // FrameView attachments are now handled by AccessibilityScrollView, >Index: Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h >=================================================================== >--- Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h (revision 240558) >+++ Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.h (working copy) >@@ -30,6 +30,7 @@ > #define WebAccessibilityObjectWrapperBase_h > > #include "AXIsolatedTree.h" >+#include "AXIsolatedTreeNode.h" > #include "AccessibilityObject.h" > #include <CoreGraphics/CoreGraphics.h> > #include <wtf/RefPtr.h> >@@ -52,6 +53,9 @@ > @interface WebAccessibilityObjectWrapperBase : NSObject { > WebCore::AccessibilityObject* m_object; > WebCore::AXID _identifier; >+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE) >+ RefPtr<WebCore::AXIsolatedTreeNode> m_isolatedTreeNode; >+#endif > } > > - (id)initWithAccessibilityObject:(WebCore::AccessibilityObject*)axObject; >@@ -86,8 +90,7 @@ > > - (CGPathRef)convertPathToScreenSpace:(WebCore::Path &)path; > >-enum ConversionSpace { ScreenSpace, PageSpace }; >-- (CGRect)convertRectToSpace:(WebCore::FloatRect &)rect space:(ConversionSpace)space; >+- (CGRect)convertRectToSpace:(WebCore::FloatRect &)rect space:(WebCore::AccessibilityConversionSpace)space; > > // Math related functions > - (NSArray *)accessibilityMathPostscriptPairs; >@@ -94,6 +97,10 @@ > - (NSArray *)accessibilityMathPrescriptPairs; > > extern WebCore::AccessibilitySearchCriteria accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute(const NSDictionary *); >+ >+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE) >+extern NSArray *convertToNSArray(const Vector<RefPtr<WebCore::AXIsolatedTreeNode>>&); >+#endif > extern NSArray *convertToNSArray(const WebCore::AccessibilityObject::AccessibilityChildrenVector&); > > #if PLATFORM(IOS_FAMILY) >Index: Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm >=================================================================== >--- Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm (revision 240558) >+++ Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm (working copy) >@@ -69,6 +69,7 @@ > #import "WAKView.h" > #import "WAKWindow.h" > #import "WebCoreFrameView.h" >+#import <pal/spi/mac/HIServicesSPI.h> > > using namespace WebCore; > using namespace HTMLNames; >@@ -239,6 +240,8 @@ > #define NSAccessibilityImmediateDescendantsOnly @"AXImmediateDescendantsOnly" > #endif > >+#define _axBackingObject self.axBackingObject >+ > static NSArray *convertMathPairsToNSArray(const AccessibilityObject::AccessibilityMathMultiscriptPairs& pairs, NSString *subscriptKey, NSString *superscriptKey) > { > NSMutableArray *array = [NSMutableArray arrayWithCapacity:pairs.size()]; >@@ -253,24 +256,37 @@ > return array; > } > >-NSArray *convertToNSArray(const AccessibilityObject::AccessibilityChildrenVector& vector) >+static void addChildToArray(AccessibilityObjectInterface& child, NSMutableArray *array) > { >+ WebAccessibilityObjectWrapper *wrapper = child.wrapper(); >+ ASSERT(wrapper); >+ >+ // We want to return the attachment view instead of the object representing the attachment, >+ // otherwise, we get palindrome errors in the AX hierarchy. >+ if (child.isAttachment() && [wrapper attachmentView]) >+ [array addObject:[wrapper attachmentView]]; >+ else if (wrapper) >+ [array addObject:wrapper]; >+} >+ >+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE) >+NSArray *convertToNSArray(const Vector<RefPtr<WebCore::AXIsolatedTreeNode>>& vector) >+{ > NSMutableArray *array = [NSMutableArray arrayWithCapacity:vector.size()]; >- for (const auto& child : vector) { >- auto wrapper = (WebAccessibilityObjectWrapperBase *)child->wrapper(); >- ASSERT(wrapper); >- if (wrapper) { >- // We want to return the attachment view instead of the object representing the attachment, >- // otherwise, we get palindrome errors in the AX hierarchy. >- if (child->isAttachment() && [wrapper attachmentView]) >- [array addObject:[wrapper attachmentView]]; >- else >- [array addObject:wrapper]; >- } >- } >+ for (auto child : vector) >+ addChildToArray(*child.get(), array); > return [[array copy] autorelease]; > } >+#endif > >+NSArray *convertToNSArray(const WebCore::AccessibilityObject::AccessibilityChildrenVector& vector) >+{ >+ NSMutableArray *array = [NSMutableArray arrayWithCapacity:vector.size()]; >+ for (auto child : vector) >+ addChildToArray(*child.get(), array); >+ return [[array copy] autorelease]; >+} >+ > @implementation WebAccessibilityObjectWrapperBase > > @synthesize identifier=_identifier; >@@ -293,7 +309,15 @@ > - (RefPtr<WebCore::AXIsolatedTreeNode>)isolatedTreeNode > { > RELEASE_ASSERT(!isMainThread()); >- return AXIsolatedTree::treeForID(_isolatedTreeIdentifier)->nodeForID(_identifier); >+ >+ if (!_identifier) >+ return nullptr; >+ >+ if (m_isolatedTreeNode) >+ return m_isolatedTreeNode; >+ >+ m_isolatedTreeNode = AXIsolatedTree::nodeInTreeForID(_isolatedTreeIdentifier, _identifier); >+ return m_isolatedTreeNode; > } > #endif > >@@ -303,6 +327,7 @@ > _identifier = 0; > > #if ENABLE(ACCESSIBILITY_ISOLATED_TREE) >+ m_isolatedTreeNode = nullptr; > _isolatedTreeIdentifier = 0; > #endif > } >@@ -310,10 +335,16 @@ > - (BOOL)updateObjectBackingStore > { > #if ENABLE(ACCESSIBILITY_ISOLATED_TREE) >- RELEASE_ASSERT(!isMainThread()); >- AXIsolatedTree::treeForID(self.isolatedTreeIdentifier)->applyPendingChanges(); >- return _identifier; >-#else >+ if (_AXUIElementRequestServicedBySecondaryAXThread()) { >+ RELEASE_ASSERT(!isMainThread()); >+ if (auto treeNode = self.isolatedTreeNode) { >+ if (auto tree = treeNode->tree()) >+ tree->applyPendingChanges(); >+ } >+ return _identifier; >+ } >+#endif >+ > // Calling updateBackingStore() can invalidate this element so self must be retained. > // If it does become invalidated, m_object will be nil. > CFRetain((__bridge CFTypeRef)self); >@@ -327,7 +358,6 @@ > return NO; > > return YES; >-#endif > } > > - (id)attachmentView >@@ -337,163 +367,42 @@ > > - (AccessibilityObject*)accessibilityObject > { >+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE) >+ if (_AXUIElementRequestServicedBySecondaryAXThread()) >+ ASSERT_NOT_REACHED(); >+#endif > return m_object; > } > >-// FIXME: Different kinds of elements are putting the title tag to use in different >-// AX fields. This should be rectified, but in the initial patch I want to achieve >-// parity with existing behavior. >-- (BOOL)titleTagShouldBeUsedInDescriptionField >-{ >- return (m_object->isLink() && !m_object->isImageMapLink()) || m_object->isImage(); >-} >- >-// On iOS, we don't have to return the value in the title. We can return the actual title, given the API. >-- (BOOL)fileUploadButtonReturnsValueInTitle >-{ >- return YES; >-} >- > // This should be the "visible" text that's actually on the screen if possible. > // If there's alternative text, that can override the title. > - (NSString *)baseAccessibilityTitle > { >- // Static text objects should not have a title. Its content is communicated in its AXValue. >- if (m_object->roleValue() == AccessibilityRole::StaticText) >- return [NSString string]; >- >- // A file upload button presents a challenge because it has button text and a value, but the >- // API doesn't support this paradigm. >- // The compromise is to return the button type in the role description and the value of the file path in the title >- if (m_object->isFileUploadButton() && [self fileUploadButtonReturnsValueInTitle]) >- return m_object->stringValue(); >- >- Vector<AccessibilityText> textOrder; >- m_object->accessibilityText(textOrder); >- >- for (const auto& text : textOrder) { >- // If we have alternative text, then we should not expose a title. >- if (text.textSource == AccessibilityTextSource::Alternative) >- break; >- >- // Once we encounter visible text, or the text from our children that should be used foremost. >- if (text.textSource == AccessibilityTextSource::Visible || text.textSource == AccessibilityTextSource::Children) >- return text.text; >- >- // If there's an element that labels this object and it's not exposed, then we should use >- // that text as our title. >- if (text.textSource == AccessibilityTextSource::LabelByElement && !m_object->exposesTitleUIElement()) >- return text.text; >- } >- >- return [NSString string]; >+ return _axBackingObject->titleAttributeValue(); > } > >-#define _axBackingObject self.axBackingObject > - (WebCore::AccessibilityObjectInterface*)axBackingObject > { > #if ENABLE(ACCESSIBILITY_ISOLATED_TREE) >- return self.isolatedTreeNode.get(); >-#else >+ if (_AXUIElementRequestServicedBySecondaryAXThread()) >+ return self.isolatedTreeNode.get(); >+#endif > return m_object; >-#endif > } > > - (NSString *)baseAccessibilityDescription > { >- // Static text objects should not have a description. Its content is communicated in its AXValue. >- // One exception is the media control labels that have a value and a description. Those are set programatically. >- if (_axBackingObject->roleValue() == AccessibilityRole::StaticText && !_axBackingObject->isMediaControlLabel()) >- return [NSString string]; >- >- Vector<AccessibilityText> textOrder; >- m_object->accessibilityText(textOrder); >- >- NSMutableString *returnText = [NSMutableString string]; >- bool visibleTextAvailable = false; >- for (const auto& text : textOrder) { >- if (text.textSource == AccessibilityTextSource::Alternative) { >- [returnText appendString:text.text]; >- break; >- } >- >- switch (text.textSource) { >- // These are sub-components of one element (Attachment) that are re-combined in OSX and iOS. >- case AccessibilityTextSource::Title: >- case AccessibilityTextSource::Subtitle: >- case AccessibilityTextSource::Action: { >- if (!text.text.length()) >- break; >- if ([returnText length]) >- [returnText appendString:@", "]; >- [returnText appendString:text.text]; >- break; >- } >- case AccessibilityTextSource::Visible: >- case AccessibilityTextSource::Children: >- case AccessibilityTextSource::LabelByElement: >- visibleTextAvailable = true; >- break; >- default: >- break; >- } >- >- if (text.textSource == AccessibilityTextSource::TitleTag && !visibleTextAvailable) { >- [returnText appendString:text.text]; >- break; >- } >- } >- >- return returnText; >+ return _axBackingObject->descriptionAttributeValue(); > } > > - (NSArray<NSString *> *)baseAccessibilitySpeechHint > { >- auto speak = m_object->speakAsProperty(); >- NSMutableArray<NSString *> *hints = [NSMutableArray array]; >- if (speak & SpeakAs::SpellOut) >- [hints addObject:@"spell-out"]; >- else >- [hints addObject:@"normal"]; >- >- if (speak & SpeakAs::Digits) >- [hints addObject:@"digits"]; >- if (speak & SpeakAs::LiteralPunctuation) >- [hints addObject:@"literal-punctuation"]; >- if (speak & SpeakAs::NoPunctuation) >- [hints addObject:@"no-punctuation"]; >- >- return hints; >+ return [(NSString *)_axBackingObject->speechHintAttributeValue() componentsSeparatedByString:@" "]; > } > > - (NSString *)baseAccessibilityHelpText > { >- Vector<AccessibilityText> textOrder; >- m_object->accessibilityText(textOrder); >- >- bool descriptiveTextAvailable = false; >- for (const auto& text : textOrder) { >- if (text.textSource == AccessibilityTextSource::Help || text.textSource == AccessibilityTextSource::Summary) >- return text.text; >- >- // If an element does NOT have other descriptive text the title tag should be used as its descriptive text. >- // But, if those ARE available, then the title tag should be used for help text instead. >- switch (text.textSource) { >- case AccessibilityTextSource::Alternative: >- case AccessibilityTextSource::Visible: >- case AccessibilityTextSource::Children: >- case AccessibilityTextSource::LabelByElement: >- descriptiveTextAvailable = true; >- break; >- default: >- break; >- } >- >- if (text.textSource == AccessibilityTextSource::TitleTag && descriptiveTextAvailable) >- return text.text; >- } >- >- return [NSString string]; >+ return _axBackingObject->helpTextAttributeValue(); > } > > struct PathConversionInfo { >@@ -510,7 +419,7 @@ > case PathElementMoveToPoint: > { > rect = FloatRect(element.points[0], FloatSize()); >- CGPoint newPoint = [wrapper convertRectToSpace:rect space:ScreenSpace].origin; >+ CGPoint newPoint = [wrapper convertRectToSpace:rect space:AccessibilityConversionSpace::Screen].origin; > CGPathMoveToPoint(newPath, nil, newPoint.x, newPoint.y); > break; > } >@@ -517,7 +426,7 @@ > case PathElementAddLineToPoint: > { > rect = FloatRect(element.points[0], FloatSize()); >- CGPoint newPoint = [wrapper convertRectToSpace:rect space:ScreenSpace].origin; >+ CGPoint newPoint = [wrapper convertRectToSpace:rect space:AccessibilityConversionSpace::Screen].origin; > CGPathAddLineToPoint(newPath, nil, newPoint.x, newPoint.y); > break; > } >@@ -524,10 +433,10 @@ > case PathElementAddQuadCurveToPoint: > { > rect = FloatRect(element.points[0], FloatSize()); >- CGPoint newPoint1 = [wrapper convertRectToSpace:rect space:ScreenSpace].origin; >+ CGPoint newPoint1 = [wrapper convertRectToSpace:rect space:AccessibilityConversionSpace::Screen].origin; > > rect = FloatRect(element.points[1], FloatSize()); >- CGPoint newPoint2 = [wrapper convertRectToSpace:rect space:ScreenSpace].origin; >+ CGPoint newPoint2 = [wrapper convertRectToSpace:rect space:AccessibilityConversionSpace::Screen].origin; > CGPathAddQuadCurveToPoint(newPath, nil, newPoint1.x, newPoint1.y, newPoint2.x, newPoint2.y); > break; > } >@@ -534,13 +443,13 @@ > case PathElementAddCurveToPoint: > { > rect = FloatRect(element.points[0], FloatSize()); >- CGPoint newPoint1 = [wrapper convertRectToSpace:rect space:ScreenSpace].origin; >+ CGPoint newPoint1 = [wrapper convertRectToSpace:rect space:AccessibilityConversionSpace::Screen].origin; > > rect = FloatRect(element.points[1], FloatSize()); >- CGPoint newPoint2 = [wrapper convertRectToSpace:rect space:ScreenSpace].origin; >+ CGPoint newPoint2 = [wrapper convertRectToSpace:rect space:AccessibilityConversionSpace::Screen].origin; > > rect = FloatRect(element.points[2], FloatSize()); >- CGPoint newPoint3 = [wrapper convertRectToSpace:rect space:ScreenSpace].origin; >+ CGPoint newPoint3 = [wrapper convertRectToSpace:rect space:AccessibilityConversionSpace::Screen].origin; > CGPathAddCurveToPoint(newPath, nil, newPoint1.x, newPoint1.y, newPoint2.x, newPoint2.y, newPoint3.x, newPoint3.y); > break; > } >@@ -569,7 +478,7 @@ > return nil; > } > >-- (CGRect)convertRectToSpace:(WebCore::FloatRect &)rect space:(ConversionSpace)space >+- (CGRect)convertRectToSpace:(WebCore::FloatRect &)rect space:(AccessibilityConversionSpace)space > { > if (!m_object) > return CGRectZero; >@@ -602,38 +511,8 @@ > cgRect = NSRectToCGRect(nsRect); > } > #endif >- else { >- // Find the appropriate scroll view to use to convert the contents to the window. >- ScrollView* scrollView = nullptr; >- const AccessibilityObject* parent = AccessibilityObject::matchedParent(*m_object, false, [] (const AccessibilityObject& object) { >- return is<AccessibilityScrollView>(object); >- }); >- if (parent) >- scrollView = downcast<AccessibilityScrollView>(*parent).scrollView(); >- >- auto intRect = snappedIntRect(IntRect(cgRect)); >- if (scrollView) >- intRect = scrollView->contentsToRootView(intRect); >- >- if (space == ScreenSpace) { >- auto page = m_object->page(); >- >- // If we have an empty chrome client (like SVG) then we should use the page >- // of the scroll view parent to help us get to the screen rect. >- if (parent && page && page->chrome().client().isEmptyChromeClient()) >- page = parent->page(); >- >- if (page) { >-#if PLATFORM(IOS_FAMILY) >- intRect = page->chrome().rootViewToAccessibilityScreen(intRect); >-#else >- intRect = page->chrome().rootViewToScreen(intRect); >-#endif >- } >- } >- >- cgRect = (CGRect)intRect; >- } >+ else >+ cgRect = (CGRect)m_object->convertFrameToSpace(rect, space); > > return cgRect; > } >@@ -640,7 +519,7 @@ > > - (NSString *)ariaLandmarkRoleDescription > { >- switch (m_object->roleValue()) { >+ switch (_axBackingObject->roleValue()) { > case AccessibilityRole::LandmarkBanner: > return AXARIAContentGroupText(@"ARIALandmarkBanner"); > case AccessibilityRole::LandmarkComplementary: >Index: Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm >=================================================================== >--- Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (revision 240558) >+++ Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (working copy) >@@ -1604,7 +1604,7 @@ > else if (m_object->isTextControl()) > objectAttributes = textAttrs; > >- else if (m_object->isLink() || m_object->isImage()) >+ else if (_axBackingObject->isLink() || _axBackingObject->isImage()) > objectAttributes = anchorAttrs; > > else if (is<AccessibilityTable>(*m_object) && downcast<AccessibilityTable>(*m_object).isExposableThroughAccessibility()) >@@ -1797,8 +1797,40 @@ > return [NSNumber numberWithFloat:screenRect.height()]; > } > >+- (size_t)childrenVectorSize >+{ >+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE) >+ if (_AXUIElementRequestServicedBySecondaryAXThread()) >+ return self.isolatedTreeNode->children().size(); >+#endif >+ >+ return m_object->children().size(); >+} >+ >+- (NSArray<WebAccessibilityObjectWrapper *> *)childrenVectorArray >+{ >+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE) >+ if (_AXUIElementRequestServicedBySecondaryAXThread()) { >+ auto treeNode = self.isolatedTreeNode; >+ auto nodeChildren = treeNode->children(); >+ Vector<RefPtr<AXIsolatedTreeNode>> children; >+ children.reserveInitialCapacity(nodeChildren.size()); >+ auto tree = treeNode->tree(); >+ for (auto child : nodeChildren) >+ children.uncheckedAppend(tree->nodeForID(child)); >+ return convertToNSArray(children); >+ } >+#endif >+ return convertToNSArray(m_object->children()); >+} >+ > - (NSValue *)position > { >+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE) >+ if (_AXUIElementRequestServicedBySecondaryAXThread()) >+ return [NSValue valueWithPoint:(NSPoint)_axBackingObject->relativeFrame().location()]; >+#endif >+ > auto rect = snappedIntRect(m_object->elementRect()); > > // The Cocoa accessibility API wants the lower-left corner. >@@ -1805,7 +1837,7 @@ > auto floatPoint = FloatPoint(rect.x(), rect.maxY()); > > auto floatRect = FloatRect(floatPoint, FloatSize()); >- CGPoint cgPoint = [self convertRectToSpace:floatRect space:ScreenSpace].origin; >+ CGPoint cgPoint = [self convertRectToSpace:floatRect space:AccessibilityConversionSpace::Screen].origin; > return [NSValue valueWithPoint:NSPointFromCGPoint(cgPoint)]; > } > >@@ -2024,7 +2056,7 @@ > return NSAccessibilityDecrementArrowSubrole; > } > >- if (m_object->isFileUploadButton()) >+ if (_axBackingObject->isFileUploadButton()) > return @"AXFileUploadButton"; > > if (m_object->isTreeItem()) >@@ -2304,7 +2336,7 @@ > } > } > >- if (m_object->isFileUploadButton()) >+ if (_axBackingObject->isFileUploadButton()) > return AXFileUploadButtonText(); > > // Only returning for DL (not UL or OL) because description changed with HTML5 from 'definition list' to >@@ -2424,16 +2456,16 @@ > return scrollViewParent; > > // Tree item (changed to AXRows) can only report the tree (AXOutline) as its parent. >- if (m_object->isTreeItem()) { >- AccessibilityObject* parent = m_object->parentObjectUnignored(); >+ if (_axBackingObject->isTreeItem()) { >+ auto parent = _axBackingObject->parentObjectInterfaceUnignored(); > while (parent) { > if (parent->isTree()) > return parent->wrapper(); >- parent = parent->parentObjectUnignored(); >+ parent = parent->parentObjectInterfaceUnignored(); > } > } > >- AccessibilityObject* parent = m_object->parentObjectUnignored(); >+ auto parent = _axBackingObject->parentObjectInterfaceUnignored(); > if (!parent) > return nil; > >@@ -2446,7 +2478,7 @@ > } > > if ([attributeName isEqualToString: NSAccessibilityChildrenAttribute]) { >- if (m_object->children().isEmpty()) { >+ if (!self.childrenVectorSize) { > NSArray* children = [self renderWidgetChildren]; > if (children != nil) > return children; >@@ -2464,7 +2496,7 @@ > return convertToNSArray(contentCopy); > } > >- return convertToNSArray(m_object->children()); >+ return self.childrenVectorArray; > } > > if ([attributeName isEqualToString: NSAccessibilitySelectedChildrenAttribute]) { >@@ -2538,7 +2570,7 @@ > if (m_object->isPasswordField() || m_object->selectionEnd() > 0) > return nil; > >- AccessibilityObject* focusedObject = m_object->focusedUIElement(); >+ auto focusedObject = downcast<AccessibilityObject>(m_object->focusedUIElement()); > if (focusedObject != m_object) > return nil; > >@@ -2718,25 +2750,29 @@ > if ([attributeName isEqualToString:NSAccessibilityContentsAttribute]) { > // The contents of a tab list are all the children except the tabs. > if (m_object->isTabList()) { >- const auto& children = m_object->children(); >- AccessibilityObject::AccessibilityChildrenVector tabsChildren; >- m_object->tabChildren(tabsChildren); >- >- AccessibilityObject::AccessibilityChildrenVector contents; >- unsigned childrenSize = children.size(); >- for (unsigned k = 0; k < childrenSize; ++k) { >- if (tabsChildren.find(children[k]) == WTF::notFound) >- contents.append(children[k]); >+ auto children = self.childrenVectorArray; >+ AccessibilityObject::AccessibilityChildrenVector tabs; >+ m_object->tabChildren(tabs); >+ auto tabsChildren = convertToNSArray(tabs); >+ >+ NSMutableArray *contents = [NSMutableArray array]; >+ for (id childWrapper in children) { >+ if ([tabsChildren containsObject:childWrapper]) >+ [contents addObject:childWrapper]; > } >- return convertToNSArray(contents); >+ return contents; > } else if (m_object->isScrollView()) { > // A scrollView's contents are everything except the scroll bars. >- AccessibilityObject::AccessibilityChildrenVector contents; >- for (const auto& child : m_object->children()) { >- if (!child->isScrollbar()) >- contents.append(child); >+ auto children = self.childrenVectorArray; >+ NSMutableArray *contents = [NSMutableArray array]; >+ >+ for (WebAccessibilityObjectWrapper *childWrapper in children) { >+ if (auto backingObject = [childWrapper axBackingObject]) { >+ if (!backingObject->isScrollbar()) >+ [contents addObject:childWrapper]; >+ } > } >- return convertToNSArray(contents); >+ return contents; > } > } > >@@ -3187,8 +3223,8 @@ > } > > if ([attributeName isEqualToString:NSAccessibilityRelativeFrameAttribute]) { >- auto rect = FloatRect(snappedIntRect(m_object->elementRect())); >- return [NSValue valueWithRect:NSRectFromCGRect([self convertRectToSpace:rect space:PageSpace])]; >+ auto rect = (CGRect)_axBackingObject->relativeFrame(); >+ return [NSValue valueWithRect:NSRectFromCGRect(rect)]; > } > > if ([attributeName isEqualToString:@"AXErrorMessageElements"]) { >@@ -3254,7 +3290,7 @@ > if (![self updateObjectBackingStore]) > return nil; > >- RefPtr<AccessibilityObject> focusedObj = m_object->focusedUIElement(); >+ auto focusedObj = _axBackingObject->focusedUIElement(); > > if (!focusedObj) > return nil; >@@ -3267,8 +3303,8 @@ > if (![self updateObjectBackingStore]) > return nil; > >- m_object->updateChildrenIfNecessary(); >- RefPtr<AccessibilityObject> axObject = m_object->accessibilityHitTest(IntPoint(point)); >+ _axBackingObject->updateChildrenIfNecessary(); >+ AccessibilityObjectInterface* axObject = _axBackingObject->accessibilityHitTest(IntPoint(point)); > if (axObject) { > if (axObject->isAttachment() && [axObject->wrapper() attachmentView]) > return [axObject->wrapper() attachmentView]; >@@ -3339,9 +3375,9 @@ > if (![self updateObjectBackingStore]) > return YES; > >- if (m_object->isAttachment()) >+ if (_axBackingObject->isAttachment()) > return [[self attachmentView] accessibilityIsIgnored]; >- return m_object->accessibilityIsIgnored(); >+ return _axBackingObject->accessibilityIsIgnored(); > } > > IGNORE_WARNINGS_BEGIN("deprecated-implementations") >@@ -4312,16 +4348,19 @@ > if (m_object->isTree()) > return [super accessibilityIndexOfChild:child]; > >- const auto& children = m_object->children(); >- >- if (children.isEmpty()) >+ NSArray *children = self.childrenVectorArray; >+ if (!children.count) > return [[self renderWidgetChildren] indexOfObject:child]; > >- unsigned count = children.size(); >- for (unsigned k = 0; k < count; ++k) { >- WebAccessibilityObjectWrapper* wrapper = children[k]->wrapper(); >- if (wrapper == child || (children[k]->isAttachment() && [wrapper attachmentView] == child)) >- return k; >+ NSUInteger count = [children count]; >+ for (NSUInteger i = 0; i < count; ++i) { >+ WebAccessibilityObjectWrapper *wrapper = children[i]; >+ auto backingObject = [wrapper axBackingObject]; >+ if (!backingObject) >+ continue; >+ >+ if (wrapper == child || (backingObject->isAttachment() && [wrapper attachmentView] == child)) >+ return i; > } > > return NSNotFound; >@@ -4339,11 +4378,11 @@ > if (m_object->isTree() || m_object->isTreeItem()) > return [[self accessibilityAttributeValue:NSAccessibilityChildrenAttribute] count]; > >- const auto& children = m_object->children(); >- if (children.isEmpty()) >+ auto childrenSize = self.childrenVectorSize; >+ if (!childrenSize) > return [[self renderWidgetChildren] count]; > >- return children.size(); >+ return childrenSize; > } > > return [super accessibilityArrayAttributeCount:attribute]; >@@ -4356,7 +4395,7 @@ > return nil; > > if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) { >- if (m_object->children().isEmpty()) { >+ if (!self.childrenVectorSize) { > NSArray *children = [self renderWidgetChildren]; > if (!children) > return nil; >@@ -4367,14 +4406,16 @@ > > NSUInteger arrayLength = std::min(childCount - index, maxCount); > return [children subarrayWithRange:NSMakeRange(index, arrayLength)]; >- } else if (m_object->isTree() || m_object->isTreeItem()) { >+ } >+ >+ if (_axBackingObject->isTree() || _axBackingObject->isTreeItem()) { > // Tree objects return their rows as their children & tree items return their contents sans rows. > // We can use the original method in this case. > return [super accessibilityArrayAttributeValues:attribute index:index maxCount:maxCount]; > } > >- const auto& children = m_object->children(); >- unsigned childCount = children.size(); >+ auto children = self.childrenVectorArray; >+ unsigned childCount = [children count]; > if (index >= childCount) > return nil; > >@@ -4382,14 +4423,10 @@ > > NSMutableArray *subarray = [NSMutableArray arrayWithCapacity:available]; > for (unsigned added = 0; added < available; ++index, ++added) { >- WebAccessibilityObjectWrapper* wrapper = children[index]->wrapper(); >- if (wrapper) { >- // The attachment view should be returned, otherwise AX palindrome errors occur. >- if (children[index]->isAttachment() && [wrapper attachmentView]) >- [subarray addObject:[wrapper attachmentView]]; >- else >- [subarray addObject:wrapper]; >- } >+ WebAccessibilityObjectWrapper* wrapper = children[index]; >+ // The attachment view should be returned, otherwise AX palindrome errors occur. >+ BOOL isAttachment = [wrapper isKindOfClass:[WebAccessibilityObjectWrapper class]] && wrapper.axBackingObject->isAttachment() && [wrapper attachmentView]; >+ [subarray addObject:isAttachment ? [wrapper attachmentView] : wrapper]; > } > > return subarray; >Index: Source/WebCore/loader/EmptyClients.h >=================================================================== >--- Source/WebCore/loader/EmptyClients.h (revision 240552) >+++ Source/WebCore/loader/EmptyClients.h (working copy) >@@ -109,7 +109,7 @@ > IntPoint screenToRootView(const IntPoint& p) const final { return p; } > IntRect rootViewToScreen(const IntRect& r) const final { return r; } > >-#if PLATFORM(IOS_FAMILY) >+#if PLATFORM(COCOA) > IntPoint accessibilityScreenToRootView(const IntPoint& p) const final { return p; }; > IntRect rootViewToAccessibilityScreen(const IntRect& r) const final { return r; }; > #endif >Index: Source/WebCore/page/Chrome.cpp >=================================================================== >--- Source/WebCore/page/Chrome.cpp (revision 240552) >+++ Source/WebCore/page/Chrome.cpp (working copy) >@@ -111,7 +111,7 @@ > return m_client.rootViewToScreen(rect); > } > >-#if PLATFORM(IOS_FAMILY) >+#if PLATFORM(COCOA) > > IntPoint Chrome::accessibilityScreenToRootView(const IntPoint& point) const > { >Index: Source/WebCore/page/Chrome.h >=================================================================== >--- Source/WebCore/page/Chrome.h (revision 240552) >+++ Source/WebCore/page/Chrome.h (working copy) >@@ -77,7 +77,7 @@ > void scroll(const IntSize&, const IntRect&, const IntRect&) override; > IntPoint screenToRootView(const IntPoint&) const override; > IntRect rootViewToScreen(const IntRect&) const override; >-#if PLATFORM(IOS_FAMILY) >+#if PLATFORM(COCOA) > IntPoint accessibilityScreenToRootView(const IntPoint&) const override; > IntRect rootViewToAccessibilityScreen(const IntRect&) const override; > #endif >Index: Source/WebCore/page/ChromeClient.h >=================================================================== >--- Source/WebCore/page/ChromeClient.h (revision 240552) >+++ Source/WebCore/page/ChromeClient.h (working copy) >@@ -175,7 +175,7 @@ > virtual IntPoint screenToRootView(const IntPoint&) const = 0; > virtual IntRect rootViewToScreen(const IntRect&) const = 0; > >-#if PLATFORM(IOS_FAMILY) >+#if PLATFORM(COCOA) > virtual IntPoint accessibilityScreenToRootView(const IntPoint&) const = 0; > virtual IntRect rootViewToAccessibilityScreen(const IntRect&) const = 0; > #endif >Index: Source/WebCore/platform/HostWindow.h >=================================================================== >--- Source/WebCore/platform/HostWindow.h (revision 240552) >+++ Source/WebCore/platform/HostWindow.h (working copy) >@@ -53,7 +53,7 @@ > // Methods for doing coordinate conversions to and from screen coordinates. > virtual IntPoint screenToRootView(const IntPoint&) const = 0; > virtual IntRect rootViewToScreen(const IntRect&) const = 0; >-#if PLATFORM(IOS_FAMILY) >+#if PLATFORM(COCOA) > virtual IntPoint accessibilityScreenToRootView(const IntPoint&) const = 0; > virtual IntRect rootViewToAccessibilityScreen(const IntRect&) const = 0; > #endif >Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 240552) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,28 @@ >+2019-01-29 Chris Fleizach <cfleizach@apple.com> >+ >+ AX: IsolatedTree: Implement more attributes >+ https://bugs.webkit.org/show_bug.cgi?id=193911 >+ <rdar://problem/47599217> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Platform/spi/mac/AccessibilityPrivSPI.h: Added. >+ * WebKit.xcodeproj/project.pbxproj: >+ * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h: >+ * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm: >+ (-[WKAccessibilityWebPageObjectBase clientSupportsIsolatedTree]): >+ (-[WKAccessibilityWebPageObjectBase isolatedTreeRootObject]): >+ (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]): >+ * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm: >+ (-[WKAccessibilityWebPageObject IGNORE_WARNINGS_END]): >+ (-[WKAccessibilityWebPageObject convertScreenPointToRootView:]): >+ (-[WKAccessibilityWebPageObject accessibilityAttributeValue:]): >+ (-[WKAccessibilityWebPageObject accessibilityAttributeSizeValue]): >+ (-[WKAccessibilityWebPageObject accessibilityAttributePositionValue]): >+ (-[WKAccessibilityWebPageObject accessibilityDataDetectorValue:point:]): >+ (-[WKAccessibilityWebPageObject accessibilityAttributeValue:forParameter:]): >+ (-[WKAccessibilityWebPageObject accessibilityHitTest:]): >+ > 2019-01-27 Chris Fleizach <cfleizach@apple.com> > > AX: Introduce a static accessibility tree >Index: Source/WebKit/Platform/spi/mac/AccessibilityPrivSPI.h >=================================================================== >--- Source/WebKit/Platform/spi/mac/AccessibilityPrivSPI.h (nonexistent) >+++ Source/WebKit/Platform/spi/mac/AccessibilityPrivSPI.h (working copy) >@@ -0,0 +1,54 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if USE(APPLE_INTERNAL_SDK) >+ >+#pragma clang diagnostic push >+#pragma clang diagnostic ignored "-Wundef" >+#include <HIServices/AccessibilityPriv.h> >+#pragma clang diagnostic pop >+ >+#else >+ >+typedef CF_ENUM(int32_t, AXClientType) >+{ >+ kAXClientTypeNoActiveRequestFound = 0, >+ kAXClientTypeUnknown, >+ kAXClientTypeRaft, >+ kAXClientTypeXCUITest, >+ kAXClientTypeXCTest, >+ kAXClientTypeScripter2, >+ kAXClientTypeSystemEvents, >+ kAXClientTypeVoiceOver, >+ kAXClientTypeAssistiveControl, >+ kAXClientTypeFullKeyboardAccess, >+ kAXClientTypeDictation, >+}; >+ >+extern AXClientType _AXGetClientForCurrentRequestUntrusted(void); >+ >+#endif // PLATFORM(APPLE_INTERNAL_SDK) >Index: Source/WebKit/UIProcess/PageClient.h >=================================================================== >--- Source/WebKit/UIProcess/PageClient.h (revision 240552) >+++ Source/WebKit/UIProcess/PageClient.h (working copy) >@@ -274,9 +274,11 @@ > #if PLATFORM(MAC) > virtual WebCore::IntRect rootViewToWindow(const WebCore::IntRect&) = 0; > #endif >-#if PLATFORM(IOS_FAMILY) >+#if PLATFORM(COCOA) > virtual WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&) = 0; > virtual WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&) = 0; >+#endif >+#if PLATFORM(IOS_FAMILY) > virtual void didNotHandleTapAsClick(const WebCore::IntPoint&) = 0; > virtual void didCompleteSyntheticClick() = 0; > #endif >Index: Source/WebKit/UIProcess/WebPageProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebPageProxy.cpp (revision 240552) >+++ Source/WebKit/UIProcess/WebPageProxy.cpp (working copy) >@@ -5017,7 +5017,7 @@ > return pageClient().rootViewToScreen(viewRect); > } > >-#if PLATFORM(IOS_FAMILY) >+#if PLATFORM(COCOA) > void WebPageProxy::accessibilityScreenToRootView(const IntPoint& screenPoint, IntPoint& windowPoint) > { > windowPoint = pageClient().accessibilityScreenToRootView(screenPoint); >Index: Source/WebKit/UIProcess/WebPageProxy.h >=================================================================== >--- Source/WebKit/UIProcess/WebPageProxy.h (revision 240552) >+++ Source/WebKit/UIProcess/WebPageProxy.h (working copy) >@@ -1563,7 +1563,7 @@ > void setIsResizable(bool isResizable); > void screenToRootView(const WebCore::IntPoint& screenPoint, Messages::WebPageProxy::ScreenToRootView::DelayedReply&&); > void rootViewToScreen(const WebCore::IntRect& viewRect, Messages::WebPageProxy::RootViewToScreen::DelayedReply&&); >-#if PLATFORM(IOS_FAMILY) >+#if PLATFORM(COCOA) > void accessibilityScreenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint); > void rootViewToAccessibilityScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result); > #endif >Index: Source/WebKit/UIProcess/WebPageProxy.messages.in >=================================================================== >--- Source/WebKit/UIProcess/WebPageProxy.messages.in (revision 240552) >+++ Source/WebKit/UIProcess/WebPageProxy.messages.in (working copy) >@@ -65,9 +65,6 @@ > #if PLATFORM(COCOA) > ShowValidationMessage(WebCore::IntRect anchorRect, String message) > HideValidationMessage() >-#endif >- >-#if PLATFORM(IOS_FAMILY) > AccessibilityScreenToRootView(WebCore::IntPoint screenPoint) -> (WebCore::IntPoint windowPoint) LegacySync > RootViewToAccessibilityScreen(WebCore::IntRect rect) -> (WebCore::IntRect screenFrame) LegacySync > #endif >Index: Source/WebKit/UIProcess/mac/PageClientImplMac.h >=================================================================== >--- Source/WebKit/UIProcess/mac/PageClientImplMac.h (revision 240552) >+++ Source/WebKit/UIProcess/mac/PageClientImplMac.h (working copy) >@@ -120,10 +120,8 @@ > #if PLATFORM(MAC) > WebCore::IntRect rootViewToWindow(const WebCore::IntRect&) override; > #endif >-#if PLATFORM(IOS_FAMILY) >- virtual WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&) = 0; >- virtual WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&) = 0; >-#endif >+ WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&) override; >+ WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&) override; > > void pinnedStateWillChange() final; > void pinnedStateDidChange() final; >Index: Source/WebKit/UIProcess/mac/PageClientImplMac.mm >=================================================================== >--- Source/WebKit/UIProcess/mac/PageClientImplMac.mm (revision 240552) >+++ Source/WebKit/UIProcess/mac/PageClientImplMac.mm (working copy) >@@ -453,6 +453,16 @@ > return enclosingIntRect(tempRect); > } > >+IntPoint PageClientImpl::accessibilityScreenToRootView(const IntPoint& point) >+{ >+ return screenToRootView(point); >+} >+ >+IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect& rect) >+{ >+ return rootViewToScreen(rect); >+} >+ > void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool eventWasHandled) > { > m_impl->doneWithKeyEvent(event.nativeEvent(), eventWasHandled); >Index: Source/WebKit/WebKit.xcodeproj/project.pbxproj >=================================================================== >--- Source/WebKit/WebKit.xcodeproj/project.pbxproj (revision 240552) >+++ Source/WebKit/WebKit.xcodeproj/project.pbxproj (working copy) >@@ -2456,6 +2456,7 @@ > 29AD3097164B4E210072DEA9 /* LegacyCustomProtocolManagerProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LegacyCustomProtocolManagerProxy.messages.in; path = CustomProtocols/LegacyCustomProtocolManagerProxy.messages.in; sourceTree = "<group>"; }; > 29CD55A8128E294F00133C85 /* WKAccessibilityWebPageObjectBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKAccessibilityWebPageObjectBase.h; sourceTree = "<group>"; }; > 29CD55A9128E294F00133C85 /* WKAccessibilityWebPageObjectBase.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKAccessibilityWebPageObjectBase.mm; sourceTree = "<group>"; }; >+ 29D04E2821F7C73D0076741D /* AccessibilityPrivSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccessibilityPrivSPI.h; sourceTree = "<group>"; }; > 2D0035221BC7414800DA8716 /* PDFPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PDFPlugin.h; path = PDF/PDFPlugin.h; sourceTree = "<group>"; }; > 2D0035231BC7414800DA8716 /* PDFPlugin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PDFPlugin.mm; path = PDF/PDFPlugin.mm; sourceTree = "<group>"; }; > 2D10875E1D2C573E00B85F82 /* LoadParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoadParameters.cpp; sourceTree = "<group>"; }; >@@ -7089,6 +7090,7 @@ > children = ( > F48D2A8421583A0200C6752B /* AppKitSPI.h */, > A1E6886F1F6E2BAB007006A6 /* QuarantineSPI.h */, >+ 29D04E2821F7C73D0076741D /* AccessibilityPrivSPI.h */, > ); > path = mac; > sourceTree = "<group>"; >Index: Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >=================================================================== >--- Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (revision 240552) >+++ Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (working copy) >@@ -570,7 +570,7 @@ > return m_page.rootViewToScreen(rect); > } > >-#if PLATFORM(IOS_FAMILY) >+#if PLATFORM(COCOA) > IntPoint WebChromeClient::accessibilityScreenToRootView(const IntPoint& point) const > { > return m_page.accessibilityScreenToRootView(point); >Index: Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h >=================================================================== >--- Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (revision 240552) >+++ Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (working copy) >@@ -112,7 +112,7 @@ > WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) const final; > WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) const final; > >-#if PLATFORM(IOS_FAMILY) >+#if PLATFORM(COCOA) > WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&) const final; > WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&) const final; > #endif >Index: Source/WebKit/WebProcess/WebPage/WebPage.cpp >=================================================================== >--- Source/WebKit/WebProcess/WebPage/WebPage.cpp (revision 240552) >+++ Source/WebKit/WebProcess/WebPage/WebPage.cpp (working copy) >@@ -3169,7 +3169,7 @@ > return screenRect; > } > >-#if PLATFORM(IOS_FAMILY) >+#if PLATFORM(COCOA) > IntPoint WebPage::accessibilityScreenToRootView(const IntPoint& point) > { > IntPoint windowPoint; >Index: Source/WebKit/WebProcess/WebPage/WebPage.h >=================================================================== >--- Source/WebKit/WebProcess/WebPage/WebPage.h (revision 240552) >+++ Source/WebKit/WebProcess/WebPage/WebPage.h (working copy) >@@ -559,7 +559,7 @@ > WebCore::IntPoint screenToRootView(const WebCore::IntPoint&); > WebCore::IntRect rootViewToScreen(const WebCore::IntRect&); > >-#if PLATFORM(IOS_FAMILY) >+#if PLATFORM(COCOA) > WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&); > WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&); > #endif >Index: Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h >=================================================================== >--- Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h (revision 240552) >+++ Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.h (working copy) >@@ -43,6 +43,10 @@ > - (id)accessibilityRootObjectWrapper; > - (id)accessibilityFocusedUIElement; > >+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE) >+- (BOOL)clientSupportsIsolatedTree; >+#endif >+ > @end > > #endif // WKAccessibilityWebPageObjectBase_h >Index: Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm >=================================================================== >--- Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm (revision 240552) >+++ Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm (working copy) >@@ -82,6 +82,36 @@ > return retrieveBlock(); > } > >+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE) >+- (BOOL)clientSupportsIsolatedTree >+{ >+ AXClientType type = _AXGetClientForCurrentRequestUntrusted(); >+ // FIXME: Remove unknown client before enabling ACCESSIBILITY_ISOLATED_TREE. >+ return type == kAXClientTypeVoiceOver || type == kAXClientTypeUnknown; >+} >+ >+- (id)isolatedTreeRootObject >+{ >+ if (isMainThread()) { >+ if (auto cache = [self axObjectCache]) { >+ auto tree = AXIsolatedTree::initializeTreeForPageId(m_pageID, *cache); >+ >+ // Now that we have created our tree, initialize the secondary thread so future requests come in on the other thread. >+ _AXUIElementUseSecondaryAXThread(true); >+ if (auto rootNode = tree->rootNode()) >+ return rootNode->wrapper(); >+ } >+ } else { >+ auto tree = AXIsolatedTree::treeForPageID(m_pageID); >+ tree->applyPendingChanges(); >+ if (auto rootNode = tree->rootNode()) >+ return rootNode->wrapper(); >+ } >+ >+ return nil; >+} >+#endif >+ > - (id)accessibilityRootObjectWrapper > { > if (!WebCore::AXObjectCache::accessibilityEnabled()) >@@ -91,36 +121,17 @@ > return self.accessibilityPluginObject; > > #if ENABLE(ACCESSIBILITY_ISOLATED_TREE) >- auto generateBlock = [&] { >- auto dispatchBlock = [&self] { >- if (auto cache = [self axObjectCache]) >- cache->generateIsolatedAccessibilityTree(); >- }; >+ // If VoiceOver is on, ensure subsequent requests are now handled on the secondary AX thread. >+ bool clientSupportsIsolatedTree = [self clientSupportsIsolatedTree]; >+ if (clientSupportsIsolatedTree) >+ return [self isolatedTreeRootObject]; >+#endif > >- if (isMainThread()) >- dispatchBlock(); >- else { >- callOnMainThreadAndWait([&dispatchBlock] { >- dispatchBlock(); >- }); >- } >- }; >- >- auto tree = AXIsolatedTree::treeForPageID(m_pageID); >- if (!tree) >- generateBlock(); >- >- if ((tree = AXIsolatedTree::treeForPageID(m_pageID))) { >- ASSERT(!isMainThread()); >- tree->applyPendingChanges(); >- return tree->rootNode()->wrapper(); >- } >-#else > if (AXObjectCache* cache = [self axObjectCache]) { > if (WebCore::AccessibilityObject* root = cache->rootObject()) > return root->wrapper(); > } >-#endif >+ > return nil; > } > >Index: Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm >=================================================================== >--- Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm (revision 240552) >+++ Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm (working copy) >@@ -78,19 +78,29 @@ > return m_attributeNames.get(); > } > >+template<typename T, typename U> inline T retrieveAccessibilityValueFromMainThread(U&& lambda) >+{ >+ if (isMainThread()) >+ return lambda(); >+ >+ T value; >+ callOnMainThreadAndWait([&value, &lambda] { >+ value = lambda(); >+ }); >+ return value; >+} >+ > IGNORE_WARNINGS_BEGIN("deprecated-implementations") > - (NSArray *)accessibilityParameterizedAttributeNames > IGNORE_WARNINGS_END > { >- Vector<String> result = m_page->corePage()->pageOverlayController().copyAccessibilityAttributesNames(true); >- if (result.isEmpty()) >- return nil; >- >- NSMutableArray *names = [NSMutableArray array]; >- for (auto& name : result) >- [names addObject:(NSString *)name]; >- >- return names; >+ return retrieveAccessibilityValueFromMainThread<id>([&self]() -> id { >+ NSMutableArray *names = [NSMutableArray array]; >+ auto result = m_page->corePage()->pageOverlayController().copyAccessibilityAttributesNames(true); >+ for (auto& name : result) >+ [names addObject:(NSString *)name]; >+ return names; >+ }); > } > > IGNORE_WARNINGS_BEGIN("deprecated-implementations") >@@ -108,7 +118,9 @@ > > - (NSPoint)convertScreenPointToRootView:(NSPoint)point > { >- return m_page->screenToRootView(IntPoint(point.x, point.y)); >+ return retrieveAccessibilityValueFromMainThread<NSPoint>([&self, &point]() -> NSPoint { >+ return m_page->screenToRootView(IntPoint(point.x, point.y)); >+ }); > } > > IGNORE_WARNINGS_BEGIN("deprecated-implementations") >@@ -152,21 +164,17 @@ > if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) > return @NO; > >- if (!m_page) >+ if (!m_pageID) > return nil; > >- if ([attribute isEqualToString:NSAccessibilityPositionAttribute]) { >- const WebCore::FloatPoint& point = m_page->accessibilityPosition(); >- return [NSValue valueWithPoint:NSMakePoint(point.x(), point.y())]; >- } >+ if ([attribute isEqualToString:NSAccessibilityPositionAttribute]) >+ return [self accessibilityAttributePositionValue]; > > if ([attribute isEqualToString:NSAccessibilityPrimaryScreenHeightAttribute]) > return [[self accessibilityRootObjectWrapper] accessibilityAttributeValue:attribute]; > >- if ([attribute isEqualToString:NSAccessibilitySizeAttribute]) { >- const IntSize& s = m_page->size(); >- return [NSValue valueWithSize:NSMakeSize(s.width(), s.height())]; >- } >+ if ([attribute isEqualToString:NSAccessibilitySizeAttribute]) >+ return [self accessibilityAttributeSizeValue]; > > if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) > return [self accessibilityChildren]; >@@ -174,6 +182,38 @@ > return nil; > } > >+- (NSValue *)accessibilityAttributeSizeValue >+{ >+ return retrieveAccessibilityValueFromMainThread<id>([&self] () -> id { >+ return [NSValue valueWithSize:(NSSize)m_page->size()]; >+ }); >+} >+ >+- (NSValue *)accessibilityAttributePositionValue >+{ >+ return retrieveAccessibilityValueFromMainThread<id>([&self] () -> id { >+ return [NSValue valueWithPoint:(NSPoint)m_page->accessibilityPosition()]; >+ }); >+} >+ >+- (id)accessibilityDataDetectorValue:(NSString *)attribute point:(WebCore::FloatPoint&)point >+{ >+ return retrieveAccessibilityValueFromMainThread<id>([&self, &attribute, &point]() -> id { >+ id value = nil; >+ if ([attribute isEqualToString:@"AXDataDetectorExistsAtPoint"] || [attribute isEqualToString:@"AXDidShowDataDetectorMenuAtPoint"]) { >+ bool boolValue; >+ if (m_page->corePage()->pageOverlayController().copyAccessibilityAttributeBoolValueForPoint(attribute, point, boolValue)) >+ value = [NSNumber numberWithBool:boolValue]; >+ } >+ if ([attribute isEqualToString:@"AXDataDetectorTypeAtPoint"]) { >+ String stringValue; >+ if (m_page->corePage()->pageOverlayController().copyAccessibilityAttributeStringValueForPoint(attribute, point, stringValue)) >+ value = [NSString stringWithString:stringValue]; >+ } >+ return value; >+ }); >+} >+ > IGNORE_WARNINGS_BEGIN("deprecated-implementations") > - (id)accessibilityAttributeValue:(NSString *)attribute forParameter:(id)parameter > IGNORE_WARNINGS_END >@@ -184,20 +224,9 @@ > else > return nil; > >- if ([attribute isEqualToString:@"AXDataDetectorExistsAtPoint"] || [attribute isEqualToString:@"AXDidShowDataDetectorMenuAtPoint"]) { >- bool value; >- if (!m_page->corePage()->pageOverlayController().copyAccessibilityAttributeBoolValueForPoint(attribute, pageOverlayPoint, value)) >- return nil; >- return [NSNumber numberWithBool:value]; >- } >+ if ([attribute isEqualToString:@"AXDataDetectorExistsAtPoint"] || [attribute isEqualToString:@"AXDidShowDataDetectorMenuAtPoint"] || [attribute isEqualToString:@"AXDataDetectorTypeAtPoint"]) >+ return [self accessibilityDataDetectorValue:attribute point:pageOverlayPoint]; > >- if ([attribute isEqualToString:@"AXDataDetectorTypeAtPoint"]) { >- String value; >- if (!m_page->corePage()->pageOverlayController().copyAccessibilityAttributeStringValueForPoint(attribute, pageOverlayPoint, value)) >- return nil; >- return [NSString stringWithString:value]; >- } >- > return nil; > } > >@@ -209,23 +238,33 @@ > ALLOW_DEPRECATED_DECLARATIONS_BEGIN > - (id)accessibilityHitTest:(NSPoint)point > { >- if (!m_page) >- return nil; >+ auto convertedPoint = retrieveAccessibilityValueFromMainThread<IntPoint>([&self, &point]() -> IntPoint { >+ if (!m_page) >+ return IntPoint(point); >+ >+ auto convertedPoint = m_page->screenToRootView(IntPoint(point)); >+ >+ // Some plugins may be able to figure out the scroll position and inset on their own. >+ bool applyContentOffset = true; > >- IntPoint convertedPoint = m_page->screenToRootView(IntPoint(point)); >- >- // Some plugins may be able to figure out the scroll position and inset on their own. >- bool applyContentOffset = true; >- if (auto pluginView = WebKit::WebPage::pluginViewForFrame(m_page->mainFrame())) >- applyContentOffset = !pluginView->plugin()->pluginHandlesContentOffsetForAccessibilityHitTest(); >+ // Isolated tree frames have the offset encoded into them so we don't need to undo here. >+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE) >+ bool queryingIsolatedTree = [self clientSupportsIsolatedTree] && _AXUIElementRequestServicedBySecondaryAXThread(); >+ applyContentOffset = !queryingIsolatedTree; >+#endif >+ if (auto pluginView = WebKit::WebPage::pluginViewForFrame(m_page->mainFrame())) >+ applyContentOffset = !pluginView->plugin()->pluginHandlesContentOffsetForAccessibilityHitTest(); >+ >+ if (!applyContentOffset) >+ return convertedPoint; > >- if (applyContentOffset) { > if (WebCore::FrameView* frameView = m_page->mainFrameView()) > convertedPoint.moveBy(frameView->scrollPosition()); > if (WebCore::Page* page = m_page->corePage()) > convertedPoint.move(0, -page->topContentInset()); >- } >- >+ return convertedPoint; >+ }); >+ > return [[self accessibilityRootObjectWrapper] accessibilityHitTest:convertedPoint]; > } > ALLOW_DEPRECATED_DECLARATIONS_END >Index: Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h >=================================================================== >--- Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h (revision 240552) >+++ Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.h (working copy) >@@ -99,10 +99,8 @@ > WebCore::IntPoint screenToRootView(const WebCore::IntPoint&) const final; > WebCore::IntRect rootViewToScreen(const WebCore::IntRect&) const final; > >-#if PLATFORM(IOS_FAMILY) > WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&) const final; > WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&) const final; >-#endif > > PlatformPageClient platformPageClient() const final; > void contentsSizeChanged(WebCore::Frame&, const WebCore::IntSize&) const final; >Index: Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm >=================================================================== >--- Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm (revision 240552) >+++ Source/WebKitLegacy/mac/WebCoreSupport/WebChromeClient.mm (working copy) >@@ -596,17 +596,15 @@ > return r; > } > >-#if PLATFORM(IOS_FAMILY) > IntPoint WebChromeClient::accessibilityScreenToRootView(const IntPoint& p) const > { >- return p; >+ return screenToRootView(p); > } > > IntRect WebChromeClient::rootViewToAccessibilityScreen(const IntRect& r) const > { >- return r; >+ return rootViewToScreen(r); > } >-#endif > > PlatformPageClient WebChromeClient::platformPageClient() const > { >Index: Source/WebKitLegacy/win/AccessibleBase.cpp >=================================================================== >--- Source/WebKitLegacy/win/AccessibleBase.cpp (revision 240552) >+++ Source/WebKitLegacy/win/AccessibleBase.cpp (working copy) >@@ -684,7 +684,7 @@ > if (!m_object) > return E_FAIL; > >- AccessibilityObject* focusedObj = m_object->focusedUIElement(); >+ auto focusedObj = downcast<AccessibilityObject>(m_object->focusedUIElement()); > if (!focusedObj) > return S_FALSE; > >@@ -810,7 +810,7 @@ > return E_FAIL; > > IntPoint point = m_object->documentFrameView()->screenToContents(IntPoint(x, y)); >- AccessibilityObject* childObj = m_object->accessibilityHitTest(point); >+ auto childObj = downcast<AccessibilityObject>(m_object->accessibilityHitTest(point)); > > if (!childObj) { > // If we did not hit any child objects, test whether the point hit us, and
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194005
:
360553
|
360601
|
360681
|
360703
|
360713
|
360714
|
360750
|
361376
|
361381
|
361426
|
361442
|
362155