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"
|
2020-11-17 22:14:20 +00:00
|
|
|
|
|
|
|
#if !LOG_DISABLED
|
2020-04-16 02:19:13 +00:00
|
|
|
#include "AXLogger.h"
|
|
|
|
|
2020-06-05 17:15:47 +00:00
|
|
|
#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
|
|
|
|
#include "AXIsolatedObject.h"
|
|
|
|
#endif
|
2020-05-14 15:35:45 +00:00
|
|
|
#include "AXObjectCache.h"
|
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"
|
2020-04-16 02:19:13 +00:00
|
|
|
#include "Logging.h"
|
2020-04-23 01:22:36 +00:00
|
|
|
#include <wtf/text/TextStream.h>
|
2020-04-16 02:19:13 +00:00
|
|
|
|
|
|
|
namespace WebCore {
|
|
|
|
|
2020-04-23 01:22:36 +00:00
|
|
|
AXLogger::AXLogger(const String& methodName)
|
|
|
|
: m_methodName(methodName)
|
2020-04-16 02:19:13 +00:00
|
|
|
{
|
2020-04-23 01:22:36 +00:00
|
|
|
if (auto* channel = getLogChannel("Accessibility"))
|
|
|
|
channel->level = WTFLogLevel::Debug;
|
2020-04-16 02:19:13 +00:00
|
|
|
|
|
|
|
if (!m_methodName.isEmpty())
|
2020-04-23 01:22:36 +00:00
|
|
|
LOG_WITH_STREAM(Accessibility, stream << m_methodName << " {");
|
2020-04-16 02:19:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AXLogger::~AXLogger()
|
|
|
|
{
|
|
|
|
if (!m_methodName.isEmpty())
|
2020-04-23 01:22:36 +00:00
|
|
|
LOG_WITH_STREAM(Accessibility, stream << "} " << m_methodName);
|
|
|
|
}
|
|
|
|
|
|
|
|
void AXLogger::log(const String& message)
|
|
|
|
{
|
|
|
|
LOG(Accessibility, "%s", message.utf8().data());
|
|
|
|
}
|
|
|
|
|
2020-05-27 23:41:22 +00:00
|
|
|
void AXLogger::log(RefPtr<AXCoreObject> object)
|
2020-04-23 01:22:36 +00:00
|
|
|
{
|
|
|
|
TextStream stream(TextStream::LineMode::MultipleLine);
|
2020-05-14 15:35:45 +00:00
|
|
|
|
|
|
|
if (object)
|
|
|
|
stream << *object;
|
|
|
|
else
|
|
|
|
stream << "null";
|
|
|
|
|
2020-04-23 01:22:36 +00:00
|
|
|
LOG(Accessibility, "%s", stream.release().utf8().data());
|
|
|
|
}
|
|
|
|
|
2020-12-15 13:44:48 +00:00
|
|
|
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());
|
|
|
|
}
|
|
|
|
|
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);
|
2020-04-30 16:48:20 +00:00
|
|
|
stream << "Notification " << notification.second << " for object ";
|
|
|
|
if (notification.first)
|
|
|
|
stream << *notification.first;
|
|
|
|
else
|
|
|
|
stream << "null";
|
2020-04-30 12:57:00 +00:00
|
|
|
LOG(Accessibility, "%s", stream.release().utf8().data());
|
|
|
|
}
|
|
|
|
|
2020-12-15 13:44:48 +00:00
|
|
|
void AXLogger::log(const AccessibilitySearchCriteria& criteria)
|
|
|
|
{
|
|
|
|
TextStream stream(TextStream::LineMode::MultipleLine);
|
|
|
|
stream << criteria;
|
|
|
|
LOG(Accessibility, "%s", stream.release().utf8().data());
|
|
|
|
}
|
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
|
2020-04-23 01:22:36 +00:00
|
|
|
TextStream& operator<<(TextStream& stream, AccessibilityRole role)
|
|
|
|
{
|
2020-08-05 07:22:07 +00:00
|
|
|
stream << accessibilityRoleToString(role);
|
2020-04-23 01:22:36 +00:00
|
|
|
return stream;
|
|
|
|
}
|
|
|
|
|
2020-12-15 13:44:48 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-04-30 12:57:00 +00:00
|
|
|
TextStream& operator<<(TextStream& stream, AXObjectCache::AXNotification notification)
|
|
|
|
{
|
|
|
|
switch (notification) {
|
|
|
|
case AXObjectCache::AXNotification::AXActiveDescendantChanged:
|
|
|
|
stream << "AXActiveDescendantChanged";
|
|
|
|
break;
|
2021-01-18 23:54:57 +00:00
|
|
|
case AXObjectCache::AXNotification::AXAriaAttributeChanged:
|
|
|
|
stream << "AXAriaAttributeChanged";
|
|
|
|
break;
|
|
|
|
case AXObjectCache::AXNotification::AXAriaRoleChanged:
|
|
|
|
stream << "AXAriaRoleChanged";
|
|
|
|
break;
|
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;
|
2021-01-29 19:07:57 +00:00
|
|
|
case AXObjectCache::AXNotification::AXCurrentStateChanged:
|
|
|
|
stream << "AXCurrentStateChanged";
|
2020-04-30 12:57:00 +00:00
|
|
|
break;
|
|
|
|
case AXObjectCache::AXNotification::AXDisabledStateChanged:
|
|
|
|
stream << "AXDisabledStateChanged";
|
|
|
|
break;
|
|
|
|
case AXObjectCache::AXNotification::AXFocusedUIElementChanged:
|
|
|
|
stream << "AXFocusedUIElementChanged";
|
|
|
|
break;
|
2020-12-15 13:44:48 +00:00
|
|
|
case AXObjectCache::AXNotification::AXFrameLoadComplete:
|
|
|
|
stream << "AXFrameLoadComplete";
|
|
|
|
break;
|
|
|
|
case AXObjectCache::AXNotification::AXIdAttributeChanged:
|
|
|
|
stream << "AXIdAttributeChanged";
|
|
|
|
break;
|
2021-06-23 16:59:34 +00:00
|
|
|
case AXObjectCache::AXNotification::AXImageOverlayChanged:
|
|
|
|
stream << "AXImageOverlayChanged";
|
|
|
|
break;
|
2020-12-15 13:44:48 +00:00
|
|
|
case AXObjectCache::AXNotification::AXLanguageChanged:
|
|
|
|
stream << "AXLanguageChanged";
|
|
|
|
break;
|
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;
|
2021-03-04 02:31:17 +00:00
|
|
|
case AXObjectCache::AXNotification::AXPageScrolled:
|
|
|
|
stream << "AXPageScrolled";
|
|
|
|
break;
|
2020-04-30 12:57:00 +00:00
|
|
|
case AXObjectCache::AXNotification::AXSelectedChildrenChanged:
|
|
|
|
stream << "AXSelectedChildrenChanged";
|
|
|
|
break;
|
2021-08-04 14:04:38 +00:00
|
|
|
case AXObjectCache::AXNotification::AXSelectedStateChanged:
|
|
|
|
stream << "AXSelectedStateChanged";
|
|
|
|
break;
|
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;
|
2021-02-08 15:40:52 +00:00
|
|
|
case AXObjectCache::AXNotification::AXSortDirectionChanged:
|
|
|
|
stream << "AXSortDirectionChanged";
|
|
|
|
break;
|
2020-04-30 12:57:00 +00:00
|
|
|
case AXObjectCache::AXNotification::AXTextChanged:
|
|
|
|
stream << "AXTextChanged";
|
|
|
|
break;
|
|
|
|
case AXObjectCache::AXNotification::AXElementBusyChanged:
|
|
|
|
stream << "AXElementBusyChanged";
|
|
|
|
break;
|
2020-12-15 13:44:48 +00:00
|
|
|
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";
|
2020-04-30 12:57:00 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return stream;
|
|
|
|
}
|
|
|
|
|
2020-04-23 01:22:36 +00:00
|
|
|
TextStream& operator<<(TextStream& stream, const AXCoreObject& object)
|
|
|
|
{
|
|
|
|
TextStream::GroupScope groupScope(stream);
|
2020-04-30 12:57:00 +00:00
|
|
|
stream << "objectID " << object.objectID();
|
|
|
|
stream.dumpProperty("identifierAttribute", object.identifierAttribute());
|
2020-11-16 18:12:17 +00:00
|
|
|
auto role = object.roleValue();
|
|
|
|
stream.dumpProperty("roleValue", role);
|
2020-04-23 01:22:36 +00:00
|
|
|
|
2020-11-16 18:12:17 +00:00
|
|
|
auto* objectWithInterestingHTML = role == AccessibilityRole::Button ? // Add here other roles of interest.
|
|
|
|
&object : nullptr;
|
2020-04-23 01:22:36 +00:00
|
|
|
auto* parent = object.parentObject();
|
2020-11-16 18:12:17 +00:00
|
|
|
if (role == AccessibilityRole::StaticText && parent)
|
|
|
|
objectWithInterestingHTML = parent;
|
2020-11-17 22:14:20 +00:00
|
|
|
if (objectWithInterestingHTML)
|
|
|
|
stream.dumpProperty("outerHTML", objectWithInterestingHTML->outerHTML());
|
2020-11-16 18:12:17 +00:00
|
|
|
|
|
|
|
stream.dumpProperty("address", &object);
|
|
|
|
stream.dumpProperty("wrapper", object.wrapper());
|
|
|
|
|
2020-04-23 01:22:36 +00:00
|
|
|
stream.dumpProperty("parentObject", parent ? parent->objectID() : 0);
|
|
|
|
#if PLATFORM(COCOA)
|
|
|
|
stream.dumpProperty("remoteParentObject", object.remoteParentObject());
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return stream;
|
2020-04-16 02:19:13 +00:00
|
|
|
}
|
|
|
|
|
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();
|
2020-06-05 17:15:47 +00:00
|
|
|
stream.dumpProperty("rootNodeID", tree.rootNode()->objectID());
|
2020-04-30 12:57:00 +00:00
|
|
|
stream.dumpProperty("focusedNodeID", tree.m_focusedNodeID);
|
|
|
|
AXLogger::add(stream, tree.rootNode(), true);
|
|
|
|
return stream;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-04-16 02:19:13 +00:00
|
|
|
} // namespace WebCore
|
2020-11-17 22:14:20 +00:00
|
|
|
|
|
|
|
#endif // !LOG_DISABLED
|