haikuwebkit/Source/WebCore/accessibility/AXLogger.h

66 lines
2.3 KiB
C
Raw Permalink Normal View History

Add logging to core accessibility. https://bugs.webkit.org/show_bug.cgi?id=210564 Reviewed by Chris Fleizach. Added AXLogger class and AXTRACE macro. Used them in AXIsolatedTree. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXLogger.cpp: Added. (WebCore::AXLogger::AXLogger): (WebCore::AXLogger::~AXLogger): * accessibility/AXLogger.h: Added. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::AXIsolatedTree): (WebCore::AXIsolatedTree::~AXIsolatedTree): (WebCore::AXIsolatedTree::create): (WebCore::AXIsolatedTree::nodeInTreeForID): (WebCore::AXIsolatedTree::treeForID): (WebCore::AXIsolatedTree::createTreeForPageID): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::treeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::objectsForIDs const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::updateSubtree): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::focusedUIElement): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNode): (WebCore::AXIsolatedTree::setFocusedNode): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::removeNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::appendNodeChanges): (WebCore::AXIsolatedTree::applyPendingChanges): * platform/Logging.h: Canonical link: https://commits.webkit.org/223454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-16 02:19:13 +00:00
/*
* Copyright (C) 2020 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 !LOG_DISABLED
Add logging of AXIsolatedTree and AXNotifications. https://bugs.webkit.org/show_bug.cgi?id=211214 Reviewed by Chris Fleizach. - Added operator<< implementations for AXIsolatedTree and AX notifications. - Added corresponding AXLogger::log overloads for the above types. - To set the root node and the focused node we are now always using setRootNodeID and setFocusedNodeID respectively. Therefore, before returning the root or the focused nodes, it is necessary to applyPendingChanges. * accessibility/AXLogger.cpp: (WebCore::AXLogger::add): Used for recursive logging of the hierarchy. (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AXLogger.h: * accessibility/AXObjectCache.cpp: Added logging of the isolated tree when it's generated and before and after updates. (WebCore::AXObjectCache::isolatedTreeFocusedObject): (WebCore::AXObjectCache::generateIsolatedTree): (WebCore::AXObjectCache::updateIsolatedTree): * accessibility/AXObjectCache.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::focusedUIElement const): * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::createTreeForPageID): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::focusedNode): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNodeID): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::applyPendingChanges): (WebCore::AXIsolatedTree::focusedUIElement): Renamed focusedNode for naming consistency. (WebCore::AXIsolatedTree::setRootNode): Deleted. Using setRootNodeID instead, (WebCore::AXIsolatedTree::setFocusedNode): Deleted. Use setFocusedNodeID instead. * accessibility/isolatedtree/AXIsolatedTree.h: (WebCore::AXIsolatedTree::treeID const): (WebCore::AXIsolatedTree::treeIdentifier const): renamed treeID for naming consistency. Canonical link: https://commits.webkit.org/224131@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-30 12:57:00 +00:00
#include "AXObjectCache.h"
#include "AccessibilityObjectInterface.h"
Add logging to core accessibility. https://bugs.webkit.org/show_bug.cgi?id=210564 Reviewed by Chris Fleizach. Added AXLogger class and AXTRACE macro. Used them in AXIsolatedTree. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXLogger.cpp: Added. (WebCore::AXLogger::AXLogger): (WebCore::AXLogger::~AXLogger): * accessibility/AXLogger.h: Added. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::AXIsolatedTree): (WebCore::AXIsolatedTree::~AXIsolatedTree): (WebCore::AXIsolatedTree::create): (WebCore::AXIsolatedTree::nodeInTreeForID): (WebCore::AXIsolatedTree::treeForID): (WebCore::AXIsolatedTree::createTreeForPageID): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::treeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::objectsForIDs const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::updateSubtree): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::focusedUIElement): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNode): (WebCore::AXIsolatedTree::setFocusedNode): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::removeNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::appendNodeChanges): (WebCore::AXIsolatedTree::applyPendingChanges): * platform/Logging.h: Canonical link: https://commits.webkit.org/223454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-16 02:19:13 +00:00
namespace WebCore {
class AXLogger {
public:
AXLogger() = default;
AXLogger(const String& methodName);
Add logging to core accessibility. https://bugs.webkit.org/show_bug.cgi?id=210564 Reviewed by Chris Fleizach. Added AXLogger class and AXTRACE macro. Used them in AXIsolatedTree. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXLogger.cpp: Added. (WebCore::AXLogger::AXLogger): (WebCore::AXLogger::~AXLogger): * accessibility/AXLogger.h: Added. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::AXIsolatedTree): (WebCore::AXIsolatedTree::~AXIsolatedTree): (WebCore::AXIsolatedTree::create): (WebCore::AXIsolatedTree::nodeInTreeForID): (WebCore::AXIsolatedTree::treeForID): (WebCore::AXIsolatedTree::createTreeForPageID): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::treeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::objectsForIDs const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::updateSubtree): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::focusedUIElement): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNode): (WebCore::AXIsolatedTree::setFocusedNode): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::removeNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::appendNodeChanges): (WebCore::AXIsolatedTree::applyPendingChanges): * platform/Logging.h: Canonical link: https://commits.webkit.org/223454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-16 02:19:13 +00:00
~AXLogger();
Add logging of AXIsolatedTree and AXNotifications. https://bugs.webkit.org/show_bug.cgi?id=211214 Reviewed by Chris Fleizach. - Added operator<< implementations for AXIsolatedTree and AX notifications. - Added corresponding AXLogger::log overloads for the above types. - To set the root node and the focused node we are now always using setRootNodeID and setFocusedNodeID respectively. Therefore, before returning the root or the focused nodes, it is necessary to applyPendingChanges. * accessibility/AXLogger.cpp: (WebCore::AXLogger::add): Used for recursive logging of the hierarchy. (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AXLogger.h: * accessibility/AXObjectCache.cpp: Added logging of the isolated tree when it's generated and before and after updates. (WebCore::AXObjectCache::isolatedTreeFocusedObject): (WebCore::AXObjectCache::generateIsolatedTree): (WebCore::AXObjectCache::updateIsolatedTree): * accessibility/AXObjectCache.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::focusedUIElement const): * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::createTreeForPageID): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::focusedNode): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNodeID): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::applyPendingChanges): (WebCore::AXIsolatedTree::focusedUIElement): Renamed focusedNode for naming consistency. (WebCore::AXIsolatedTree::setRootNode): Deleted. Using setRootNodeID instead, (WebCore::AXIsolatedTree::setFocusedNode): Deleted. Use setFocusedNodeID instead. * accessibility/isolatedtree/AXIsolatedTree.h: (WebCore::AXIsolatedTree::treeID const): (WebCore::AXIsolatedTree::treeIdentifier const): renamed treeID for naming consistency. Canonical link: https://commits.webkit.org/224131@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-30 12:57:00 +00:00
static void log(const String&);
Empty alt attribute does not ignore the image for accessibility clients in Safari. https://bugs.webkit.org/show_bug.cgi?id=212432 Source/WebCore: Reviewed by Chris Fleizach. Test: accessibility/img-alt-attribute-unassigned-empty.html - AccessibilityRenderObject::computeAccessibilityIsIgnored was handling the case of images too late, after checking for ariaRoleAttribute(). So if an image had a role attribute, it was exposed regardless whether its alt attribute was an empty string. This change moves the handling of images above the check for ariaroleAttribute and hence honors the empty alt attribute rule. - Also images that have an aria-label attribute are now exposed. - Added logging of AccessibilityObjectInclusion. - Changed signature of log(RefPtr<AXCoreObject>) as pointed out by Darin Adler in a separate review. * accessibility/AXLogger.cpp: (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AXLogger.h: * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::determineAccessibilityRole): (WebCore::AccessibilityNodeObject::isImage const): Moved to base class. * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: (WebCore::AXCoreObject::isImage const): * accessibility/AccessibilityRenderObject.cpp: (WebCore::objectInclusionFromAltText): (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const): (WebCore::AccessibilityRenderObject::determineAccessibilityRole): (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): * accessibility/isolatedtree/AXIsolatedObject.h: LayoutTests: <rdar://problem/60597768> Reviewed by Chris Fleizach. * accessibility/img-alt-attribute-unassigned-empty-expected.txt: Renamed from LayoutTests/accessibility/img-alt-attribute-unassigned-value-expected.txt. * accessibility/img-alt-attribute-unassigned-empty.html: Renamed from LayoutTests/accessibility/img-alt-attribute-unassigned-value.html. Added the test case for alt="" in addition to unassigned alt. * accessibility/self-referencing-aria-labelledby.html: Removed unnecessary alt="" since now that causes the image element not to be exposed. Canonical link: https://commits.webkit.org/225283@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262224 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-27 23:41:22 +00:00
static void log(RefPtr<AXCoreObject>);
static void log(const Vector<RefPtr<AXCoreObject>>&);
Add logging of AXIsolatedTree and AXNotifications. https://bugs.webkit.org/show_bug.cgi?id=211214 Reviewed by Chris Fleizach. - Added operator<< implementations for AXIsolatedTree and AX notifications. - Added corresponding AXLogger::log overloads for the above types. - To set the root node and the focused node we are now always using setRootNodeID and setFocusedNodeID respectively. Therefore, before returning the root or the focused nodes, it is necessary to applyPendingChanges. * accessibility/AXLogger.cpp: (WebCore::AXLogger::add): Used for recursive logging of the hierarchy. (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AXLogger.h: * accessibility/AXObjectCache.cpp: Added logging of the isolated tree when it's generated and before and after updates. (WebCore::AXObjectCache::isolatedTreeFocusedObject): (WebCore::AXObjectCache::generateIsolatedTree): (WebCore::AXObjectCache::updateIsolatedTree): * accessibility/AXObjectCache.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::focusedUIElement const): * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::createTreeForPageID): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::focusedNode): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNodeID): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::applyPendingChanges): (WebCore::AXIsolatedTree::focusedUIElement): Renamed focusedNode for naming consistency. (WebCore::AXIsolatedTree::setRootNode): Deleted. Using setRootNodeID instead, (WebCore::AXIsolatedTree::setFocusedNode): Deleted. Use setFocusedNodeID instead. * accessibility/isolatedtree/AXIsolatedTree.h: (WebCore::AXIsolatedTree::treeID const): (WebCore::AXIsolatedTree::treeIdentifier const): renamed treeID for naming consistency. Canonical link: https://commits.webkit.org/224131@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-30 12:57:00 +00:00
static void log(const std::pair<RefPtr<AXCoreObject>, AXObjectCache::AXNotification>&);
static void log(const AccessibilitySearchCriteria&);
Empty alt attribute does not ignore the image for accessibility clients in Safari. https://bugs.webkit.org/show_bug.cgi?id=212432 Source/WebCore: Reviewed by Chris Fleizach. Test: accessibility/img-alt-attribute-unassigned-empty.html - AccessibilityRenderObject::computeAccessibilityIsIgnored was handling the case of images too late, after checking for ariaRoleAttribute(). So if an image had a role attribute, it was exposed regardless whether its alt attribute was an empty string. This change moves the handling of images above the check for ariaroleAttribute and hence honors the empty alt attribute rule. - Also images that have an aria-label attribute are now exposed. - Added logging of AccessibilityObjectInclusion. - Changed signature of log(RefPtr<AXCoreObject>) as pointed out by Darin Adler in a separate review. * accessibility/AXLogger.cpp: (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AXLogger.h: * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::determineAccessibilityRole): (WebCore::AccessibilityNodeObject::isImage const): Moved to base class. * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: (WebCore::AXCoreObject::isImage const): * accessibility/AccessibilityRenderObject.cpp: (WebCore::objectInclusionFromAltText): (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const): (WebCore::AccessibilityRenderObject::determineAccessibilityRole): (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): * accessibility/isolatedtree/AXIsolatedObject.h: LayoutTests: <rdar://problem/60597768> Reviewed by Chris Fleizach. * accessibility/img-alt-attribute-unassigned-empty-expected.txt: Renamed from LayoutTests/accessibility/img-alt-attribute-unassigned-value-expected.txt. * accessibility/img-alt-attribute-unassigned-empty.html: Renamed from LayoutTests/accessibility/img-alt-attribute-unassigned-value.html. Added the test case for alt="" in addition to unassigned alt. * accessibility/self-referencing-aria-labelledby.html: Removed unnecessary alt="" since now that causes the image element not to be exposed. Canonical link: https://commits.webkit.org/225283@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262224 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-27 23:41:22 +00:00
static void log(AccessibilityObjectInclusion);
Add logging of AXIsolatedTree and AXNotifications. https://bugs.webkit.org/show_bug.cgi?id=211214 Reviewed by Chris Fleizach. - Added operator<< implementations for AXIsolatedTree and AX notifications. - Added corresponding AXLogger::log overloads for the above types. - To set the root node and the focused node we are now always using setRootNodeID and setFocusedNodeID respectively. Therefore, before returning the root or the focused nodes, it is necessary to applyPendingChanges. * accessibility/AXLogger.cpp: (WebCore::AXLogger::add): Used for recursive logging of the hierarchy. (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AXLogger.h: * accessibility/AXObjectCache.cpp: Added logging of the isolated tree when it's generated and before and after updates. (WebCore::AXObjectCache::isolatedTreeFocusedObject): (WebCore::AXObjectCache::generateIsolatedTree): (WebCore::AXObjectCache::updateIsolatedTree): * accessibility/AXObjectCache.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::focusedUIElement const): * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::createTreeForPageID): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::focusedNode): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNodeID): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::applyPendingChanges): (WebCore::AXIsolatedTree::focusedUIElement): Renamed focusedNode for naming consistency. (WebCore::AXIsolatedTree::setRootNode): Deleted. Using setRootNodeID instead, (WebCore::AXIsolatedTree::setFocusedNode): Deleted. Use setFocusedNodeID instead. * accessibility/isolatedtree/AXIsolatedTree.h: (WebCore::AXIsolatedTree::treeID const): (WebCore::AXIsolatedTree::treeIdentifier const): renamed treeID for naming consistency. Canonical link: https://commits.webkit.org/224131@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-30 12:57:00 +00:00
#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
static void log(AXIsolatedTree&);
#endif
AXIsolatedTree::updateChildren needs to apply pending changes before updating the given node. https://bugs.webkit.org/show_bug.cgi?id=211790 Reviewed by Chris Fleizach. Covered by multiple tests. AXIsolatedTree::updateChildren may be fired for an isolated object that is still in the pending changes list, and thus nodeForID would fail, causing the isolated tree to not be updated. This patch calls applyPendingChanges before updating the given node's children. Additional logging was added including the logging of the AXObjectCache object hierarchy. * accessibility/AXLogger.cpp: (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AXLogger.h: * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::remove): (WebCore::AXObjectCache::postNotification): (WebCore::AXObjectCache::performDeferredCacheUpdate): (WebCore::AXObjectCache::updateIsolatedTree): * accessibility/AXObjectCache.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::updateSubtree): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::focusedNode): (WebCore::AXIsolatedTree::removeNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::applyPendingChanges): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Canonical link: https://commits.webkit.org/224791@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261694 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-05-14 15:35:45 +00:00
static void log(AXObjectCache&);
Add logging of AXIsolatedTree and AXNotifications. https://bugs.webkit.org/show_bug.cgi?id=211214 Reviewed by Chris Fleizach. - Added operator<< implementations for AXIsolatedTree and AX notifications. - Added corresponding AXLogger::log overloads for the above types. - To set the root node and the focused node we are now always using setRootNodeID and setFocusedNodeID respectively. Therefore, before returning the root or the focused nodes, it is necessary to applyPendingChanges. * accessibility/AXLogger.cpp: (WebCore::AXLogger::add): Used for recursive logging of the hierarchy. (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AXLogger.h: * accessibility/AXObjectCache.cpp: Added logging of the isolated tree when it's generated and before and after updates. (WebCore::AXObjectCache::isolatedTreeFocusedObject): (WebCore::AXObjectCache::generateIsolatedTree): (WebCore::AXObjectCache::updateIsolatedTree): * accessibility/AXObjectCache.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::focusedUIElement const): * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::createTreeForPageID): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::focusedNode): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNodeID): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::applyPendingChanges): (WebCore::AXIsolatedTree::focusedUIElement): Renamed focusedNode for naming consistency. (WebCore::AXIsolatedTree::setRootNode): Deleted. Using setRootNodeID instead, (WebCore::AXIsolatedTree::setFocusedNode): Deleted. Use setFocusedNodeID instead. * accessibility/isolatedtree/AXIsolatedTree.h: (WebCore::AXIsolatedTree::treeID const): (WebCore::AXIsolatedTree::treeIdentifier const): renamed treeID for naming consistency. Canonical link: https://commits.webkit.org/224131@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-30 12:57:00 +00:00
static void add(TextStream&, const RefPtr<AXCoreObject>&, bool recursive = false);
Add logging to core accessibility. https://bugs.webkit.org/show_bug.cgi?id=210564 Reviewed by Chris Fleizach. Added AXLogger class and AXTRACE macro. Used them in AXIsolatedTree. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXLogger.cpp: Added. (WebCore::AXLogger::AXLogger): (WebCore::AXLogger::~AXLogger): * accessibility/AXLogger.h: Added. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::AXIsolatedTree): (WebCore::AXIsolatedTree::~AXIsolatedTree): (WebCore::AXIsolatedTree::create): (WebCore::AXIsolatedTree::nodeInTreeForID): (WebCore::AXIsolatedTree::treeForID): (WebCore::AXIsolatedTree::createTreeForPageID): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::treeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::objectsForIDs const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::updateSubtree): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::focusedUIElement): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNode): (WebCore::AXIsolatedTree::setFocusedNode): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::removeNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::appendNodeChanges): (WebCore::AXIsolatedTree::applyPendingChanges): * platform/Logging.h: Canonical link: https://commits.webkit.org/223454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-16 02:19:13 +00:00
private:
String m_methodName;
};
#define AXTRACE(methodName) AXLogger axLogger(methodName)
Add logging of AXIsolatedTree and AXNotifications. https://bugs.webkit.org/show_bug.cgi?id=211214 Reviewed by Chris Fleizach. - Added operator<< implementations for AXIsolatedTree and AX notifications. - Added corresponding AXLogger::log overloads for the above types. - To set the root node and the focused node we are now always using setRootNodeID and setFocusedNodeID respectively. Therefore, before returning the root or the focused nodes, it is necessary to applyPendingChanges. * accessibility/AXLogger.cpp: (WebCore::AXLogger::add): Used for recursive logging of the hierarchy. (WebCore::AXLogger::log): (WebCore::operator<<): * accessibility/AXLogger.h: * accessibility/AXObjectCache.cpp: Added logging of the isolated tree when it's generated and before and after updates. (WebCore::AXObjectCache::isolatedTreeFocusedObject): (WebCore::AXObjectCache::generateIsolatedTree): (WebCore::AXObjectCache::updateIsolatedTree): * accessibility/AXObjectCache.h: * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::focusedUIElement const): * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::createTreeForPageID): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::focusedNode): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNodeID): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::applyPendingChanges): (WebCore::AXIsolatedTree::focusedUIElement): Renamed focusedNode for naming consistency. (WebCore::AXIsolatedTree::setRootNode): Deleted. Using setRootNodeID instead, (WebCore::AXIsolatedTree::setFocusedNode): Deleted. Use setFocusedNodeID instead. * accessibility/isolatedtree/AXIsolatedTree.h: (WebCore::AXIsolatedTree::treeID const): (WebCore::AXIsolatedTree::treeIdentifier const): renamed treeID for naming consistency. Canonical link: https://commits.webkit.org/224131@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-30 12:57:00 +00:00
#define AXLOG(x) AXLogger::log(x)
Add logging to core accessibility. https://bugs.webkit.org/show_bug.cgi?id=210564 Reviewed by Chris Fleizach. Added AXLogger class and AXTRACE macro. Used them in AXIsolatedTree. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXLogger.cpp: Added. (WebCore::AXLogger::AXLogger): (WebCore::AXLogger::~AXLogger): * accessibility/AXLogger.h: Added. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::AXIsolatedTree): (WebCore::AXIsolatedTree::~AXIsolatedTree): (WebCore::AXIsolatedTree::create): (WebCore::AXIsolatedTree::nodeInTreeForID): (WebCore::AXIsolatedTree::treeForID): (WebCore::AXIsolatedTree::createTreeForPageID): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::treeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::objectsForIDs const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateNode): (WebCore::AXIsolatedTree::updateSubtree): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::focusedUIElement): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNode): (WebCore::AXIsolatedTree::setFocusedNode): (WebCore::AXIsolatedTree::setFocusedNodeID): (WebCore::AXIsolatedTree::removeNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::appendNodeChanges): (WebCore::AXIsolatedTree::applyPendingChanges): * platform/Logging.h: Canonical link: https://commits.webkit.org/223454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-16 02:19:13 +00:00
} // namespace WebCore
#else
#define AXTRACE(methodName) (void)0
#define AXLOG(x) (void)0
#endif // !LOG_DISABLED