haikuwebkit/Source/WebCore/accessibility/AXLogger.cpp

541 lines
17 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.
* 3. Neither the name of Apple Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
*/
#include "config.h"
#if !LOG_DISABLED
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
#include "AXLogger.h"
AXIsolatedTree::updateChildren should not call nodeForID. https://bugs.webkit.org/show_bug.cgi?id=212794 Reviewed by Chris Fleizach. AXIsolatedTree::updateChildren is executed on the main thread and therfore should not call nodeForID. Since it requires the children IDs for the isolated object whose children are being updated, we need to store those children IDs outside the isolated object. For this reason we added the m_nodeMap member variable which will maintain a map between object ID and its children IDs. In addition, since retrieving the root node happens very often and required also a call to nodeForID, we now store a pointer to the root node instead of its ID, so there is no need to look it up in the reading map. * accessibility/AXLogger.cpp: (WebCore::operator<<): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::setChildrenIDs): (WebCore::AXIsolatedObject::appendChild): Renamed setChildrenIDs. * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::clear): (WebCore::AXIsolatedTree::create): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::applyPendingChanges): (WebCore::AXIsolatedTree::nodeInTreeForID): Deleted, not used. (WebCore::AXIsolatedTree::setRootNodeID): Renamed setRootNode. * accessibility/isolatedtree/AXIsolatedTree.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase attachIsolatedObject:]): Canonical link: https://commits.webkit.org/225632@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-05 17:15:47 +00:00
#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
#include "AXIsolatedObject.h"
#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
#include "AXObjectCache.h"
Remove Simple Line Layout https://bugs.webkit.org/show_bug.cgi?id=216914 Reviewed by Sam Weinig. It is already fully covered by LFC and so unused. Remove the code. * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXLogger.cpp: * accessibility/AccessibilityObjectInterface.h: * editing/TextIterator.cpp: * layout/Verification.cpp: (WebCore::Layout::verifyAndOutputSubtree): (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded): Deleted. * layout/integration/LayoutIntegrationLineLayout.cpp: * layout/integration/LayoutIntegrationPagination.cpp: * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::layoutLineBoxes): (WebCore::ComplexLineLayout::addOverflowFromInlineChildren): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutInlineChildren): (WebCore::RenderBlockFlow::styleDidChange): (WebCore::RenderBlockFlow::hitTestInlineChildren): (WebCore::RenderBlockFlow::addOverflowFromInlineChildren): (WebCore::RenderBlockFlow::markLinesDirtyInBlockRange): (WebCore::RenderBlockFlow::firstLineBaseline const): (WebCore::RenderBlockFlow::inlineBlockBaseline const): (WebCore::RenderBlockFlow::inlineSelectionGaps): (WebCore::RenderBlockFlow::lineCount const): (WebCore::RenderBlockFlow::positionForPoint): (WebCore::RenderBlockFlow::paintInlineChildren): (WebCore::RenderBlockFlow::hasLines const): (WebCore::RenderBlockFlow::invalidateLineLayoutPath): (WebCore::RenderBlockFlow::ensureLineBoxes): (WebCore::RenderBlockFlow::outputLineTreeAndMark const): (WebCore::RenderBlockFlow::layoutSimpleLines): Deleted. * rendering/RenderBlockFlow.h: (WebCore::RenderBlockFlow::hasSimpleLineLayout const): Deleted. (WebCore::RenderBlockFlow::simpleLineLayout const): Deleted. (WebCore::RenderBlockFlow::simpleLineLayout): Deleted. * rendering/RenderFragmentedFlow.cpp: (WebCore::RenderFragmentedFlow::removeLineFragmentInfo): * rendering/RenderText.cpp: (WebCore::RenderText::absoluteQuadsForRange const): (WebCore::RenderText::positionForPoint): (WebCore::RenderText::setTextWithOffset): (WebCore::RenderText::usesComplexLineLayoutPath const): (WebCore::RenderText::linesVisualOverflowBoundingBox const): (WebCore::RenderText::collectSelectionRectsForLineBoxes): (WebCore::RenderText::simpleLineLayout const): Deleted. * rendering/RenderText.h: * rendering/SimpleLineLayout.cpp: Removed. * rendering/SimpleLineLayout.h: Removed. * rendering/SimpleLineLayoutCoverage.cpp: Removed. * rendering/SimpleLineLayoutCoverage.h: Removed. * rendering/SimpleLineLayoutFlowContents.cpp: Removed. * rendering/SimpleLineLayoutFlowContents.h: Removed. * rendering/SimpleLineLayoutFunctions.cpp: Removed. * rendering/SimpleLineLayoutFunctions.h: Removed. * rendering/SimpleLineLayoutPagination.cpp: Removed. * rendering/SimpleLineLayoutPagination.h: Removed. * rendering/SimpleLineLayoutResolver.cpp: Removed. * rendering/SimpleLineLayoutResolver.h: Removed. * rendering/SimpleLineLayoutTextFragmentIterator.cpp: Removed. * rendering/SimpleLineLayoutTextFragmentIterator.h: Removed. * rendering/TextPainter.cpp: (WebCore::TextPainter::clearGlyphDisplayLists): * rendering/line/LineLayoutTraversal.cpp: (WebCore::LineLayoutTraversal::firstTextBoxFor): (WebCore::LineLayoutTraversal::elementBoxFor): * rendering/line/LineLayoutTraversal.h: * rendering/line/LineLayoutTraversalSimplePath.h: Removed. Canonical link: https://commits.webkit.org/229744@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267565 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-25 13:16:23 +00:00
#include "FrameView.h"
Deduplicate logging channel algorithms https://bugs.webkit.org/show_bug.cgi?id=228809 Reviewed by Fujii Hironori. Source/WebCore: No new tests because there is no behavior change. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXLogger.cpp: * inspector/agents/page/PageConsoleAgent.cpp: * page/Page.cpp: * platform/LogInitialization.cpp: Copied from Source/WebCore/platform/LogInitialization.h. (WebCore::logChannels): (WebCore::getLogChannel): * platform/LogInitialization.h: * platform/Logging.cpp: (WebCore::isLogChannelEnabled): Deleted. (WebCore::setLogChannelToAccumulate): Deleted. (WebCore::clearAllLogChannelsToAccumulate): Deleted. (WebCore::initializeLogChannelsIfNecessary): Deleted. (WebCore::getLogChannel): Deleted. * platform/Logging.h: * testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::setLogChannelToAccumulate): (WebCoreTestSupport::clearAllLogChannelsToAccumulate): (WebCoreTestSupport::initializeLogChannelsIfNecessary): Source/WebKit: * GPUProcess/GPUConnectionToWebProcess.cpp: * GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::initializeGPUProcess): * Platform/LogInitialization.cpp: Copied from Source/WebKit/Shared/WebKit2Initialize.cpp. (WebKit::logChannels): (WebKit::getLogChannel): * Platform/LogInitialization.h: * Platform/Logging.cpp: (WebKit::initializeLogChannelsIfNecessary): Deleted. (WebKit::getLogChannel): Deleted. * Platform/Logging.h: * Shared/AuxiliaryProcess.cpp: (WebKit::AuxiliaryProcess::initialize): * Shared/WebKit2Initialize.cpp: (WebKit::InitializeWebKit2): * Sources.txt: * UIProcess/WebPageProxy.cpp: * UIProcess/WebProcessPool.cpp: * WebKit.xcodeproj/project.pbxproj: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess): Source/WebKitLegacy: * WebKitLegacy.xcodeproj/project.pbxproj: Source/WebKitLegacy/mac: * Misc/WebKitLogInitialization.h: Copied from Source/WebKit/Platform/LogInitialization.h. * Misc/WebKitLogInitialization.mm: Copied from Source/WebKitLegacy/mac/Misc/WebKitLogging.m. (WebKit::logChannels): (ReportDiscardedDelegateException): * Misc/WebKitLogging.h: * Misc/WebKitLogging.m: (ReportDiscardedDelegateException): Deleted. * WebCoreSupport/WebDragClient.mm: * WebView/WebDelegateImplementationCaching.mm: * WebView/WebView.mm: (-[WebView _commonInitializationWithFrameName:groupName:]): Source/WTF: The current infrastructure (before this patch) had the following duplicated for each framework: - A .cpp file declared the list of logging channels for that framework - The .cpp file also had algorithms to search, modify, and initialize these logging channels Each framework's .cpp file had duplicate algorithms. (The initialization algorithm was even duplicated 3 times!) Because the algorithms directly name their specific list of logging channels, a naive deduplication would have had to add new parameters to these algorithms to pass in the appropriate framework's list. That's fine, but this is exactly the sort of thing classes were designed for - classes are an association of algorithms and data. The algorithms are shared but the data isn't, which really just means we should have 3 instances of a shared class - one for the 3 sets of data. So, this patch creates the LogChannels class which contains the deduplicated algorithms, and each framework has a NeverDestroyed singleton instance of that class. There is a single virtual method in the class, so the appropriate "default write" variable can be queried for each framework. The instances cannot be declared in the Logging.h files in the frameworks, because certain WebKit2 files want to initialize all 3 instances of LogChannels, but you can't #include multiple Logging.h files at the same time because their LOG_CHANNEL_PREFIX #defines will collide with each other. Luckily, LogInitialization.h files exist exactly to solve this purpose, so that's where the LogChannels instances are declared in. After this change, the Logging.h files are just for the declarations of the logging channels themselves, and the LogInitialization.h files are for the LogChannels instances which contain the searching/modifying/initializing algorithms on the list of logging channels. If you just want to LOG(...) something, #include the relevant Logging.h file, and if you want to search/modify/initialize across the entire list of channels, then #include the relevant LogInitialization.h file. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/LogChannels.cpp: Copied from Source/WebCore/platform/Logging.cpp. (WTF::LogChannels::isLogChannelEnabled): (WTF::LogChannels::setLogChannelToAccumulate): (WTF::LogChannels::clearAllLogChannelsToAccumulate): (WTF::LogChannels::initializeLogChannelsIfNecessary): (WTF::LogChannels::getLogChannel): * wtf/LogChannels.h: Copied from Source/WebCore/platform/LogInitialization.h. Canonical link: https://commits.webkit.org/240343@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280758 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-07 18:50:12 +00:00
#include "LogInitialization.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
#include "Logging.h"
#include <wtf/text/TextStream.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 {
AXLogger::AXLogger(const String& methodName)
: m_methodName(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
{
if (auto* channel = getLogChannel("Accessibility"))
channel->level = WTFLogLevel::Debug;
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
if (!m_methodName.isEmpty())
LOG_WITH_STREAM(Accessibility, stream << m_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::~AXLogger()
{
if (!m_methodName.isEmpty())
LOG_WITH_STREAM(Accessibility, stream << "} " << m_methodName);
}
void AXLogger::log(const String& message)
{
LOG(Accessibility, "%s", message.utf8().data());
}
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
void AXLogger::log(RefPtr<AXCoreObject> object)
{
TextStream stream(TextStream::LineMode::MultipleLine);
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
if (object)
stream << *object;
else
stream << "null";
LOG(Accessibility, "%s", stream.release().utf8().data());
}
void AXLogger::log(const Vector<RefPtr<AXCoreObject>>& objects)
{
TextStream stream(TextStream::LineMode::MultipleLine);
stream << "[";
for (auto object : objects) {
if (object)
stream << *object;
else
stream << "null";
}
stream << "]";
LOG(Accessibility, "%s", stream.release().utf8().data());
}
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
void AXLogger::add(TextStream& stream, const RefPtr<AXCoreObject>& object, bool recursive)
{
if (!object)
return;
stream.increaseIndent();
stream << *object;
if (recursive) {
for (auto& child : object->children())
add(stream, child, true);
}
stream.decreaseIndent();
}
void AXLogger::log(const std::pair<RefPtr<AXCoreObject>, AXObjectCache::AXNotification>& notification)
{
TextStream stream(TextStream::LineMode::MultipleLine);
stream << "Notification " << notification.second << " for object ";
if (notification.first)
stream << *notification.first;
else
stream << "null";
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
LOG(Accessibility, "%s", stream.release().utf8().data());
}
void AXLogger::log(const AccessibilitySearchCriteria& criteria)
{
TextStream stream(TextStream::LineMode::MultipleLine);
stream << criteria;
LOG(Accessibility, "%s", stream.release().utf8().data());
}
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
void AXLogger::log(AccessibilityObjectInclusion inclusion)
{
TextStream stream(TextStream::LineMode::SingleLine);
stream.dumpProperty("ObjectInclusion", inclusion);
LOG(Accessibility, "%s", stream.release().utf8().data());
}
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)
void AXLogger::log(AXIsolatedTree& tree)
{
TextStream stream(TextStream::LineMode::MultipleLine);
stream << tree;
LOG(Accessibility, "%s", stream.release().utf8().data());
}
#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
void AXLogger::log(AXObjectCache& axObjectCache)
{
TextStream stream(TextStream::LineMode::MultipleLine);
stream << axObjectCache;
LOG(Accessibility, "%s", stream.release().utf8().data());
}
TextStream& operator<<(TextStream& stream, AccessibilityRole role)
{
stream << accessibilityRoleToString(role);
return stream;
}
TextStream& operator<<(TextStream& stream, AccessibilitySearchDirection direction)
{
switch (direction) {
case AccessibilitySearchDirection::Next:
stream << "Next";
break;
case AccessibilitySearchDirection::Previous:
stream << "Previous";
break;
};
return stream;
}
TextStream& operator<<(TextStream& stream, AccessibilitySearchKey searchKey)
{
switch (searchKey) {
case AccessibilitySearchKey::AnyType:
stream << "AnyType";
break;
case AccessibilitySearchKey::Article:
stream << "Article";
break;
case AccessibilitySearchKey::BlockquoteSameLevel:
stream << "BlockquoteSameLevel";
break;
case AccessibilitySearchKey::Blockquote:
stream << "Blockquote";
break;
case AccessibilitySearchKey::BoldFont:
stream << "BoldFont";
break;
case AccessibilitySearchKey::Button:
stream << "Button";
break;
case AccessibilitySearchKey::CheckBox:
stream << "CheckBox";
break;
case AccessibilitySearchKey::Control:
stream << "Control";
break;
case AccessibilitySearchKey::DifferentType:
stream << "DifferentType";
break;
case AccessibilitySearchKey::FontChange:
stream << "FontChange";
break;
case AccessibilitySearchKey::FontColorChange:
stream << "FontColorChange";
break;
case AccessibilitySearchKey::Frame:
stream << "Frame";
break;
case AccessibilitySearchKey::Graphic:
stream << "Graphic";
break;
case AccessibilitySearchKey::HeadingLevel1:
stream << "HeadingLevel1";
break;
case AccessibilitySearchKey::HeadingLevel2:
stream << "HeadingLevel2";
break;
case AccessibilitySearchKey::HeadingLevel3:
stream << "HeadingLevel3";
break;
case AccessibilitySearchKey::HeadingLevel4:
stream << "HeadingLevel4";
break;
case AccessibilitySearchKey::HeadingLevel5:
stream << "HeadingLevel5";
break;
case AccessibilitySearchKey::HeadingLevel6:
stream << "HeadingLevel6";
break;
case AccessibilitySearchKey::HeadingSameLevel:
stream << "HeadingSameLevel";
break;
case AccessibilitySearchKey::Heading:
stream << "Heading";
break;
case AccessibilitySearchKey::Highlighted:
stream << "Highlighted";
break;
case AccessibilitySearchKey::ItalicFont:
stream << "ItalicFont";
break;
case AccessibilitySearchKey::KeyboardFocusable:
stream << "KeyboardFocusable";
break;
case AccessibilitySearchKey::Landmark:
stream << "Landmark";
break;
case AccessibilitySearchKey::Link:
stream << "Link";
break;
case AccessibilitySearchKey::List:
stream << "List";
break;
case AccessibilitySearchKey::LiveRegion:
stream << "LiveRegion";
break;
case AccessibilitySearchKey::MisspelledWord:
stream << "MisspelledWord";
break;
case AccessibilitySearchKey::Outline:
stream << "Outline";
break;
case AccessibilitySearchKey::PlainText:
stream << "PlainText";
break;
case AccessibilitySearchKey::RadioGroup:
stream << "RadioGroup";
break;
case AccessibilitySearchKey::SameType:
stream << "SameType";
break;
case AccessibilitySearchKey::StaticText:
stream << "StaticText";
break;
case AccessibilitySearchKey::StyleChange:
stream << "StyleChange";
break;
case AccessibilitySearchKey::TableSameLevel:
stream << "TableSameLevel";
break;
case AccessibilitySearchKey::Table:
stream << "Table";
break;
case AccessibilitySearchKey::TextField:
stream << "TextField";
break;
case AccessibilitySearchKey::Underline:
stream << "Underline";
break;
case AccessibilitySearchKey::UnvisitedLink:
stream << "UnvisitedLink";
break;
case AccessibilitySearchKey::VisitedLink:
stream << "VisitedLink";
break;
};
return stream;
}
TextStream& operator<<(TextStream& stream, const AccessibilitySearchCriteria& criteria)
{
TextStream::GroupScope groupScope(stream);
stream << "SearchCriteria " << &criteria;
stream.dumpProperty("anchorObject", criteria.anchorObject);
stream.dumpProperty("startObject", criteria.startObject);
stream.dumpProperty("searchDirection", criteria.searchDirection);
stream.nextLine();
stream << "(searchKeys [";
for (auto searchKey : criteria.searchKeys)
stream << searchKey << ", ";
stream << "])";
stream.dumpProperty("searchText", criteria.searchText);
stream.dumpProperty("resultsLimit", criteria.resultsLimit);
stream.dumpProperty("visibleOnly", criteria.visibleOnly);
stream.dumpProperty("immediateDescendantsOnly", criteria.immediateDescendantsOnly);
return stream;
}
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
TextStream& operator<<(TextStream& stream, AccessibilityObjectInclusion inclusion)
{
switch (inclusion) {
case AccessibilityObjectInclusion::IncludeObject:
stream << "IncludeObject";
break;
case AccessibilityObjectInclusion::IgnoreObject:
stream << "IgnoreObject";
break;
case AccessibilityObjectInclusion::DefaultBehavior:
stream << "DefaultBehavior";
break;
}
return stream;
}
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
TextStream& operator<<(TextStream& stream, AXObjectCache::AXNotification notification)
{
switch (notification) {
case AXObjectCache::AXNotification::AXActiveDescendantChanged:
stream << "AXActiveDescendantChanged";
break;
Fix for LayoutTests/accessibility/canvas-fallback-content.html in isolated tree mode. https://bugs.webkit.org/show_bug.cgi?id=220644 Reviewed by Chris Fleizach. Source/WebCore: Tests: accessibility/canvas-fallback-content.html accessibility/canvas-fallback-content-2.html - Updates the accessibility isolated tree when the ARIA role attribute changes for a DOM element. - Modified tests to use Promises and retrieve accessible elements by IDs so that they work in both isolated tree mode on and off. * accessibility/AXLogger.cpp: (WebCore::operator<<): Added new value to the AXNotification enum. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleAriaRoleChanged): Updates the isolated tree when an ARIA role attribute changes. (WebCore::AXObjectCache::updateIsolatedTree): Handles the AXAriaRoleChanged notification. * accessibility/AXObjectCache.h: LayoutTests: * accessibility/canvas-fallback-content-2-expected.txt: Removed the checks for the document.activeElement since the goal here is not to test this method. * accessibility/canvas-fallback-content-2.html: Retrieved the accessibility Objects by ID directly from the accessibilityController. This simplifies the code since it is not necessary to set focus to the object via the document, to then retrieve the focused accessibility element. This works for isolated tree mode on and off. * accessibility/canvas-fallback-content.html: Kept the focus manipulations but used Promises to make it work in both isolated mode on and off. * platform/win/accessibility/canvas-fallback-content-expected.txt: Deleted. * platform/win/TestExpectations: Skip since this test was already failing in win. Canonical link: https://commits.webkit.org/233123@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-18 23:54:57 +00:00
case AXObjectCache::AXNotification::AXAriaAttributeChanged:
stream << "AXAriaAttributeChanged";
break;
case AXObjectCache::AXNotification::AXAriaRoleChanged:
stream << "AXAriaRoleChanged";
break;
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
case AXObjectCache::AXNotification::AXAutocorrectionOccured:
stream << "AXAutocorrectionOccured";
break;
case AXObjectCache::AXNotification::AXCheckedStateChanged:
stream << "AXCheckedStateChanged";
break;
case AXObjectCache::AXNotification::AXChildrenChanged:
stream << "AXChildrenChanged";
break;
Support for aria-current state changed notifications. https://bugs.webkit.org/show_bug.cgi?id=221074 Reviewed by Chris Fleizach. Source/WebCore: Test: accessibility/aria-current-state-changed-notification.html Added handling of the AXCurrentStateChanged notification for Mac and iOS ports. This notification is fired when the aria-current attribute changes. Handling of this notification is required to properly update the accessibility properties of the target object and convey them to assistive technology clients. * accessibility/AXLogger.cpp: (WebCore::operator<<): Renamed notification anumerand. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleAttributeChange): * accessibility/AXObjectCache.h: * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/ios/AXObjectCacheIOS.mm: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/ios/WebAccessibilityObjectWrapperIOS.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityDOMIdentifier]): (-[WebAccessibilityObjectWrapper postCurrentStateChangedNotification]): (-[WebAccessibilityObjectWrapper accessibilityCurrentState]): (-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]): Renamed to accessibilityCurrentState. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postPlatformNotification): Tools: Added AccessibilityUIElement::domIdentifier and currentStateValue used in LayoutTests/accessibility/aria-current-state-changed-notification.html. * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: (WTR::AccessibilityUIElement::domIdentifier const): Non-Cocoa implementation. (WTR::AccessibilityUIElement::currentStateValue const): Non-Cocoa implementation. * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: (WTR::AccessibilityUIElement::domIdentifier const): (WTR::AccessibilityUIElement::stringAttributeValue): (WTR::AccessibilityUIElement::currentStateValue const): * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: (WTR::AccessibilityUIElement::domIdentifier const): (WTR::AccessibilityUIElement::currentStateValue const): LayoutTests: * accessibility/aria-current-state-changed-notification-expected.txt: Added. * accessibility/aria-current-state-changed-notification.html: Added. * accessibility/aria-current.html: Use AccessibilityUIElement::currentStateValue for consistency and to match closely how actual clients will invoke this functionality. * platform/gtk/TestExpectations: * platform/ios-wk1/TestExpectations: * platform/ios/TestExpectations: * platform/mac-wk1/TestExpectations: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/233486@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-01-29 19:07:57 +00:00
case AXObjectCache::AXNotification::AXCurrentStateChanged:
stream << "AXCurrentStateChanged";
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
break;
case AXObjectCache::AXNotification::AXDisabledStateChanged:
stream << "AXDisabledStateChanged";
break;
case AXObjectCache::AXNotification::AXFocusedUIElementChanged:
stream << "AXFocusedUIElementChanged";
break;
case AXObjectCache::AXNotification::AXFrameLoadComplete:
stream << "AXFrameLoadComplete";
break;
case AXObjectCache::AXNotification::AXIdAttributeChanged:
stream << "AXIdAttributeChanged";
break;
Accessibility support for image text recognition. https://bugs.webkit.org/show_bug.cgi?id=224280 rdar://76348740 Reviewed by Chris Fleizach. Source/WebCore: Test: accessibility/ios-simulator/image-overlay-elements.html Exposes to accessibility clients the elements created by WebPage::requestTextRecognition for static images. This allows clients to present the recognized text in images to assistive technology users. - Added a new AXObject subclass, AXImage, to encapsulate this functionality. This class can be expanded to offload some of the image specific code contained in AccessibilityRenderObject, AccessibilityNodeObject, AccessibilityObject and others. - Since requestTextRecognition is an async call, added an AXNotification to notify clients when the image overlay elements are available for consumption. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * accessibility/AXImage.cpp: Added. (WebCore::AXImage::AXImage): (WebCore::AXImage::create): (WebCore::AXImage::roleValue const): (WebCore::AXImage::imageOverlayElements): * accessibility/AXImage.h: Added. * accessibility/AXLogger.cpp: (WebCore::operator<<): * accessibility/AXObjectCache.cpp: (WebCore::isSimpleImage): Determines whether a given element is a static image. (WebCore::createFromRenderer): Instantiate an AXImage object when appropriate. * accessibility/AXObjectCache.h: * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::canHaveChildren const): Images can have children. * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/ios/AXObjectCacheIOS.mm: (WebCore::AXObjectCache::notificationPlatformName): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityElements]): (-[WebAccessibilityObjectWrapper accessibilityImageOverlayElements]): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::isAXImageInstance const): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Tools: * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: (WTR::AccessibilityUIElement::children const): * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: (WTR::AccessibilityUIElement::children const): (WTR::AccessibilityUIElement::imageOverlayElements const): * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: (WTR::AccessibilityUIElement::children const): (WTR::AccessibilityUIElement::imageOverlayElements const): LayoutTests: * accessibility/image-link-expected.txt: * accessibility/ios-simulator/image-overlay-elements-expected.txt: Added. * accessibility/ios-simulator/image-overlay-elements.html: Added. * accessibility/resources/green-400x400.png: Added. Canonical link: https://commits.webkit.org/239068@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279171 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-23 16:59:34 +00:00
case AXObjectCache::AXNotification::AXImageOverlayChanged:
stream << "AXImageOverlayChanged";
break;
case AXObjectCache::AXNotification::AXLanguageChanged:
stream << "AXLanguageChanged";
break;
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
case AXObjectCache::AXNotification::AXLayoutComplete:
stream << "AXLayoutComplete";
break;
case AXObjectCache::AXNotification::AXLoadComplete:
stream << "AXLoadComplete";
break;
case AXObjectCache::AXNotification::AXNewDocumentLoadComplete:
stream << "AXNewDocumentLoadComplete";
break;
Replace the multiple WebAccessibilityObjectWrapperIOS postXXXNotification methods with a single postNotification method. https://bugs.webkit.org/show_bug.cgi?id=221707 Reviewed by Chris Fleizach. Source/WebCore: Instead of having a postXXXNotification method per notification in the iOS WebAccessibilitObjectWrapper implementation, we now have a single method that takes the name of the notification. This cleans up the existing notification posting code and simplifies adding new notifications. * accessibility/AXLogger.cpp: (WebCore::operator<<): Added a new notification constant AXPageScrolled. * accessibility/AXObjectCache.h: * accessibility/ios/AXObjectCacheIOS.mm: (WebCore::AXObjectCache::notificationPlatformName): Handles all notifications used on iOS. (WebCore::AXObjectCache::postPlatformNotification): * accessibility/ios/WebAccessibilityObjectWrapperIOS.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityScroll:]): Uses the helper AXObjectCache::notificationPlatformName to get page scrolled notification name. (-[WebAccessibilityObjectWrapper postFocusChangeNotification]): Deleted. (-[WebAccessibilityObjectWrapper postSelectedTextChangeNotification]): Deleted. (-[WebAccessibilityObjectWrapper postLayoutChangeNotification]): Deleted. (-[WebAccessibilityObjectWrapper postLiveRegionChangeNotification]): Deleted. (-[WebAccessibilityObjectWrapper postLiveRegionCreatedNotification]): Deleted. (-[WebAccessibilityObjectWrapper postLoadCompleteNotification]): Deleted. (-[WebAccessibilityObjectWrapper postChildrenChangedNotification]): Deleted. (-[WebAccessibilityObjectWrapper postInvalidStatusChangedNotification]): Deleted. (-[WebAccessibilityObjectWrapper postValueChangedNotification]): Deleted. (-[WebAccessibilityObjectWrapper postExpandedChangedNotification]): Deleted. (-[WebAccessibilityObjectWrapper postScrollStatusChangeNotification]): Deleted. (-[WebAccessibilityObjectWrapper postCurrentStateChangedNotification]): Deleted. LayoutTests: The name of the notification is now "AXPageScrolled". Adjusted the script and the expected output accordingly. * accessibility/ios-simulator/scroll-in-overflow-div-expected.txt: * accessibility/ios-simulator/scroll-in-overflow-div.html: Canonical link: https://commits.webkit.org/234830@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273869 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-04 02:31:17 +00:00
case AXObjectCache::AXNotification::AXPageScrolled:
stream << "AXPageScrolled";
break;
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
case AXObjectCache::AXNotification::AXSelectedChildrenChanged:
stream << "AXSelectedChildrenChanged";
break;
case AXObjectCache::AXNotification::AXSelectedStateChanged:
stream << "AXSelectedStateChanged";
break;
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
case AXObjectCache::AXNotification::AXSelectedTextChanged:
stream << "AXSelectedTextChanged";
break;
case AXObjectCache::AXNotification::AXValueChanged:
stream << "AXValueChanged";
break;
case AXObjectCache::AXNotification::AXScrolledToAnchor:
stream << "AXScrolledToAnchor";
break;
case AXObjectCache::AXNotification::AXLiveRegionCreated:
stream << "AXLiveRegionCreated";
break;
case AXObjectCache::AXNotification::AXLiveRegionChanged:
stream << "AXLiveRegionChanged";
break;
case AXObjectCache::AXNotification::AXMenuListItemSelected:
stream << "AXMenuListItemSelected";
break;
case AXObjectCache::AXNotification::AXMenuListValueChanged:
stream << "AXMenuListValueChanged";
break;
case AXObjectCache::AXNotification::AXMenuClosed:
stream << "AXMenuClosed";
break;
case AXObjectCache::AXNotification::AXMenuOpened:
stream << "AXMenuOpened";
break;
case AXObjectCache::AXNotification::AXRowCountChanged:
stream << "AXRowCountChanged";
break;
case AXObjectCache::AXNotification::AXRowCollapsed:
stream << "AXRowCollapsed";
break;
case AXObjectCache::AXNotification::AXRowExpanded:
stream << "AXRowExpanded";
break;
case AXObjectCache::AXNotification::AXExpandedChanged:
stream << "AXExpandedChanged";
break;
case AXObjectCache::AXNotification::AXInvalidStatusChanged:
stream << "AXInvalidStatusChanged";
break;
case AXObjectCache::AXNotification::AXPressDidSucceed:
stream << "AXPressDidSucceed";
break;
case AXObjectCache::AXNotification::AXPressDidFail:
stream << "AXPressDidFail";
break;
case AXObjectCache::AXNotification::AXPressedStateChanged:
stream << "AXPressedStateChanged";
break;
case AXObjectCache::AXNotification::AXReadOnlyStatusChanged:
stream << "AXReadOnlyStatusChanged";
break;
case AXObjectCache::AXNotification::AXRequiredStatusChanged:
stream << "AXRequiredStatusChanged";
break;
Add support for aria-sort change notifications. https://bugs.webkit.org/show_bug.cgi?id=221495 Reviewed by Chris Fleizach. Source/WebCore: Test: accessibility/aria-sort-changed-notification.html This patch adds support for aria-sort changes. Some code cleanup by using the notificationPlatformName helper function. * accessibility/AXLogger.cpp: (WebCore::operator<<): Logging of the new notification. * accessibility/AXObjectCache.cpp: Handles the aria-sort change notification. Updates the isolated tree. (WebCore::AXObjectCache::handleAttributeChange): (WebCore::AXObjectCache::updateIsolatedTree): * accessibility/AXObjectCache.h: * accessibility/ios/AXObjectCacheIOS.mm: (WebCore::AXObjectCache::notificationPlatformName): Helper to map AXCore notifications to platform notifications. (WebCore::AXObjectCache::postPlatformNotification): Handles the AXSortDirectionChanged notification. Some code cleanup using the notificationPlatformName helper. * accessibility/ios/WebAccessibilityObjectWrapperIOS.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper postNotification:]): To be overridden by system AX bundles. (-[WebAccessibilityObjectWrapper accessibilitySortDirection]): Only ascending and descending sort directions are relevant for clients. * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateNodeProperty): Updates the SortDirection property. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postPlatformNotification): Handles the AXSortDirectionChanged notification. Tools: * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: (WTR::AccessibilityUIElement::sortDirection const): * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: (WTR::AccessibilityUIElement::sortDirection const): * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: (WTR::AccessibilityUIElement::currentStateValue const): (WTR::AccessibilityUIElement::sortDirection const): LayoutTests: * accessibility/aria-sort-changed-notification-expected.txt: Added. * accessibility/aria-sort-changed-notification.html: Added. * accessibility/aria-sort-expected.txt: * accessibility/aria-sort.html: Calls sortDirection property on the JS accessible element instead of retrieving the aria-sort attribute. This matches more accurately what an actual client would do. Changed the expected file accordingly. * accessibility/ios-simulator/aria-sort-ios-expected.txt: * accessibility/ios-simulator/aria-sort-ios.html: Same as in the Mac test above. * platform/ios/TestExpectations: Added the new test to be run on the ios-simulator. Canonical link: https://commits.webkit.org/233804@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-02-08 15:40:52 +00:00
case AXObjectCache::AXNotification::AXSortDirectionChanged:
stream << "AXSortDirectionChanged";
break;
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
case AXObjectCache::AXNotification::AXTextChanged:
stream << "AXTextChanged";
break;
case AXObjectCache::AXNotification::AXElementBusyChanged:
stream << "AXElementBusyChanged";
break;
case AXObjectCache::AXNotification::AXDraggingStarted:
stream << "AXDraggingStarted";
break;
case AXObjectCache::AXNotification::AXDraggingEnded:
stream << "AXDraggingEnded";
break;
case AXObjectCache::AXNotification::AXDraggingEnteredDropZone:
stream << "AXDraggingEnteredDropZone";
break;
case AXObjectCache::AXNotification::AXDraggingDropped:
stream << "AXDraggingDropped";
break;
case AXObjectCache::AXNotification::AXDraggingExitedDropZone:
stream << "AXDraggingExitedDropZone";
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
break;
}
return stream;
}
TextStream& operator<<(TextStream& stream, const AXCoreObject& object)
{
TextStream::GroupScope groupScope(stream);
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
stream << "objectID " << object.objectID();
stream.dumpProperty("identifierAttribute", object.identifierAttribute());
auto role = object.roleValue();
stream.dumpProperty("roleValue", role);
auto* objectWithInterestingHTML = role == AccessibilityRole::Button ? // Add here other roles of interest.
&object : nullptr;
auto* parent = object.parentObject();
if (role == AccessibilityRole::StaticText && parent)
objectWithInterestingHTML = parent;
if (objectWithInterestingHTML)
stream.dumpProperty("outerHTML", objectWithInterestingHTML->outerHTML());
stream.dumpProperty("address", &object);
stream.dumpProperty("wrapper", object.wrapper());
stream.dumpProperty("parentObject", parent ? parent->objectID() : 0);
#if PLATFORM(COCOA)
stream.dumpProperty("remoteParentObject", object.remoteParentObject());
#endif
return stream;
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
}
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)
TextStream& operator<<(TextStream& stream, AXIsolatedTree& tree)
{
TextStream::GroupScope groupScope(stream);
stream << "treeID " << tree.treeID();
AXIsolatedTree::updateChildren should not call nodeForID. https://bugs.webkit.org/show_bug.cgi?id=212794 Reviewed by Chris Fleizach. AXIsolatedTree::updateChildren is executed on the main thread and therfore should not call nodeForID. Since it requires the children IDs for the isolated object whose children are being updated, we need to store those children IDs outside the isolated object. For this reason we added the m_nodeMap member variable which will maintain a map between object ID and its children IDs. In addition, since retrieving the root node happens very often and required also a call to nodeForID, we now store a pointer to the root node instead of its ID, so there is no need to look it up in the reading map. * accessibility/AXLogger.cpp: (WebCore::operator<<): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::setChildrenIDs): (WebCore::AXIsolatedObject::appendChild): Renamed setChildrenIDs. * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::clear): (WebCore::AXIsolatedTree::create): (WebCore::AXIsolatedTree::removeTreeForPageID): (WebCore::AXIsolatedTree::nodeForID const): (WebCore::AXIsolatedTree::generateSubtree): (WebCore::AXIsolatedTree::createSubtree): (WebCore::AXIsolatedTree::updateChildren): (WebCore::AXIsolatedTree::rootNode): (WebCore::AXIsolatedTree::setRootNode): (WebCore::AXIsolatedTree::removeSubtree): (WebCore::AXIsolatedTree::applyPendingChanges): (WebCore::AXIsolatedTree::nodeInTreeForID): Deleted, not used. (WebCore::AXIsolatedTree::setRootNodeID): Renamed setRootNode. * accessibility/isolatedtree/AXIsolatedTree.h: * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (-[WebAccessibilityObjectWrapperBase attachIsolatedObject:]): Canonical link: https://commits.webkit.org/225632@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-05 17:15:47 +00:00
stream.dumpProperty("rootNodeID", tree.rootNode()->objectID());
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
stream.dumpProperty("focusedNodeID", tree.m_focusedNodeID);
AXLogger::add(stream, tree.rootNode(), true);
return stream;
}
#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
TextStream& operator<<(TextStream& stream, AXObjectCache& axObjectCache)
{
TextStream::GroupScope groupScope(stream);
stream << "AXObjectCache " << &axObjectCache;
if (auto* root = axObjectCache.get(axObjectCache.document().view()))
AXLogger::add(stream, root, true);
else
stream << "No root!";
return stream;
}
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
#endif // !LOG_DISABLED