<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[285991] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/285991">285991</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2021-11-18 01:51:41 -0800 (Thu, 18 Nov 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: Use ObjectIdentifier for AXID
https://bugs.webkit.org/show_bug.cgi?id=233248
<rdar://problem/85497145>

Reviewed by Andres Gonzalez.

Source/WebCore:

* accessibility/AXLogger.cpp:
(WebCore::operator<<):
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::setIsolatedTreeFocusedObject):
(WebCore::AXObjectCache::get):
(WebCore::AXObjectCache::cacheAndInitializeWrapper):
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::platformGenerateAXID const):
(WebCore::AXObjectCache::objectsForIDs const):
(WebCore::AXObjectCache::updateIsolatedTree):
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h:
(WebCore::AXCoreObject::detach):
* accessibility/atspi/AccessibilityObjectAtspi.cpp:
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::AXIsolatedObject):
(WebCore::AXIsolatedObject::associatedAXObject const):
(WebCore::AXIsolatedObject::detachFromParent):
(WebCore::AXIsolatedObject::isDetachedFromParent):
(WebCore::AXIsolatedObject::cellForColumnAndRow):
(WebCore::AXIsolatedObject::accessibilityHitTest const):
(WebCore::AXIsolatedObject::objectAttributeValue const):
* accessibility/isolatedtree/AXIsolatedObject.h:
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::nodeForID const):
(WebCore::AXIsolatedTree::idsForObjects const):
(WebCore::AXIsolatedTree::updateChildrenIDs):
(WebCore::AXIsolatedTree::generateSubtree):
(WebCore::AXIsolatedTree::createSubtree):
(WebCore::AXIsolatedTree::updateNode):
(WebCore::AXIsolatedTree::updateChildren):
(WebCore::AXIsolatedTree::focusedNode):
(WebCore::AXIsolatedTree::setFocusedNodeID):
(WebCore::AXIsolatedTree::removeNode):
(WebCore::AXIsolatedTree::removeSubtree):
(WebCore::AXIsolatedTree::applyPendingChanges):
* accessibility/isolatedtree/AXIsolatedTree.h:
(WebCore::AXIsolatedTree::WTF_GUARDED_BY_LOCK): Deleted.
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase attachAXObject:]):
(-[WebAccessibilityObjectWrapperBase attachIsolatedObject:]):
(-[WebAccessibilityObjectWrapperBase detach]):
(-[WebAccessibilityObjectWrapperBase detachIsolatedObject:]):
* accessibility/win/AXObjectCacheWin.cpp:
(WebCore::AXObjectCache::postPlatformNotification):
(WebCore::AXObjectCache::platformGenerateAXID const):

Source/WebKitLegacy/win:

* AccessibleBase.cpp:
(AccessibleBase::get_uniqueID):
(AccessibleBase::getAccessibilityObjectForChild const):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXLoggercpp">trunk/Source/WebCore/accessibility/AXLogger.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXObjectCachecpp">trunk/Source/WebCore/accessibility/AXObjectCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAXObjectCacheh">trunk/Source/WebCore/accessibility/AXObjectCache.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjecth">trunk/Source/WebCore/accessibility/AccessibilityObject.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjectInterfaceh">trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityatspiAccessibilityObjectAtspicpp">trunk/Source/WebCore/accessibility/atspi/AccessibilityObjectAtspi.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityisolatedtreeAXIsolatedObjectcpp">trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityisolatedtreeAXIsolatedObjecth">trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityisolatedtreeAXIsolatedTreecpp">trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityisolatedtreeAXIsolatedTreeh">trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h</a></li>
<li><a href="#trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperBasemm">trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm</a></li>
<li><a href="#trunkSourceWebCoreaccessibilitywinAXObjectCacheWincpp">trunk/Source/WebCore/accessibility/win/AXObjectCacheWin.cpp</a></li>
<li><a href="#trunkSourceWebKitLegacywinAccessibleBasecpp">trunk/Source/WebKitLegacy/win/AccessibleBase.cpp</a></li>
<li><a href="#trunkSourceWebKitLegacywinChangeLog">trunk/Source/WebKitLegacy/win/ChangeLog</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (285990 => 285991)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-11-18 09:49:45 UTC (rev 285990)
+++ trunk/Source/WebCore/ChangeLog      2021-11-18 09:51:41 UTC (rev 285991)
</span><span class="lines">@@ -1,3 +1,59 @@
</span><ins>+2021-11-18  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        AX: Use ObjectIdentifier for AXID
+        https://bugs.webkit.org/show_bug.cgi?id=233248
+        <rdar://problem/85497145>
+
+        Reviewed by Andres Gonzalez.
+
+        * accessibility/AXLogger.cpp:
+        (WebCore::operator<<):
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::setIsolatedTreeFocusedObject):
+        (WebCore::AXObjectCache::get):
+        (WebCore::AXObjectCache::cacheAndInitializeWrapper):
+        (WebCore::AXObjectCache::remove):
+        (WebCore::AXObjectCache::platformGenerateAXID const):
+        (WebCore::AXObjectCache::objectsForIDs const):
+        (WebCore::AXObjectCache::updateIsolatedTree):
+        * accessibility/AXObjectCache.h:
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityObjectInterface.h:
+        (WebCore::AXCoreObject::detach):
+        * accessibility/atspi/AccessibilityObjectAtspi.cpp:
+        * accessibility/isolatedtree/AXIsolatedObject.cpp:
+        (WebCore::AXIsolatedObject::AXIsolatedObject):
+        (WebCore::AXIsolatedObject::associatedAXObject const):
+        (WebCore::AXIsolatedObject::detachFromParent):
+        (WebCore::AXIsolatedObject::isDetachedFromParent):
+        (WebCore::AXIsolatedObject::cellForColumnAndRow):
+        (WebCore::AXIsolatedObject::accessibilityHitTest const):
+        (WebCore::AXIsolatedObject::objectAttributeValue const):
+        * accessibility/isolatedtree/AXIsolatedObject.h:
+        * accessibility/isolatedtree/AXIsolatedTree.cpp:
+        (WebCore::AXIsolatedTree::nodeForID const):
+        (WebCore::AXIsolatedTree::idsForObjects const):
+        (WebCore::AXIsolatedTree::updateChildrenIDs):
+        (WebCore::AXIsolatedTree::generateSubtree):
+        (WebCore::AXIsolatedTree::createSubtree):
+        (WebCore::AXIsolatedTree::updateNode):
+        (WebCore::AXIsolatedTree::updateChildren):
+        (WebCore::AXIsolatedTree::focusedNode):
+        (WebCore::AXIsolatedTree::setFocusedNodeID):
+        (WebCore::AXIsolatedTree::removeNode):
+        (WebCore::AXIsolatedTree::removeSubtree):
+        (WebCore::AXIsolatedTree::applyPendingChanges):
+        * accessibility/isolatedtree/AXIsolatedTree.h:
+        (WebCore::AXIsolatedTree::WTF_GUARDED_BY_LOCK): Deleted.
+        * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
+        (-[WebAccessibilityObjectWrapperBase attachAXObject:]):
+        (-[WebAccessibilityObjectWrapperBase attachIsolatedObject:]):
+        (-[WebAccessibilityObjectWrapperBase detach]):
+        (-[WebAccessibilityObjectWrapperBase detachIsolatedObject:]):
+        * accessibility/win/AXObjectCacheWin.cpp:
+        (WebCore::AXObjectCache::postPlatformNotification):
+        (WebCore::AXObjectCache::platformGenerateAXID const):
+
</ins><span class="cx"> 2021-11-18  Kimmo Kinnunen  <kkinnunen@apple.com>
</span><span class="cx"> 
</span><span class="cx">         RemoteGraphicsContextGLProxyBase should not have platform-specific implementations
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXLoggercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXLogger.cpp (285990 => 285991)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXLogger.cpp  2021-11-18 09:49:45 UTC (rev 285990)
+++ trunk/Source/WebCore/accessibility/AXLogger.cpp     2021-11-18 09:51:41 UTC (rev 285991)
</span><span class="lines">@@ -502,7 +502,7 @@
</span><span class="cx">     stream.dumpProperty("address", &object);
</span><span class="cx">     stream.dumpProperty("wrapper", object.wrapper());
</span><span class="cx"> 
</span><del>-    stream.dumpProperty("parentObject", parent ? parent->objectID() : 0);
</del><ins>+    stream.dumpProperty("parentObject", parent ? parent->objectID() : AXID());
</ins><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     stream.dumpProperty("remoteParentObject", object.remoteParentObject());
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXObjectCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (285990 => 285991)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp     2021-11-18 09:49:45 UTC (rev 285990)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp        2021-11-18 09:51:41 UTC (rev 285991)
</span><span class="lines">@@ -124,8 +124,6 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><span class="cx"> 
</span><del>-const AXID InvalidAXID = 0;
-
</del><span class="cx"> // Post value change notifications for password fields or elements contained in password fields at a 40hz interval to thwart analysis of typing cadence
</span><span class="cx"> static const Seconds accessibilityPasswordValueChangeNotificationInterval { 25_ms };
</span><span class="cx"> static const Seconds accessibilityLiveRegionChangedNotificationInterval { 20_ms };
</span><span class="lines">@@ -418,7 +416,7 @@
</span><span class="cx">     auto* focus = getOrCreate(focusedNode);
</span><span class="cx"> 
</span><span class="cx">     if (auto tree = AXIsolatedTree::treeForPageID(*m_pageID))
</span><del>-        tree->setFocusedNodeID(focus ? focus->objectID() : InvalidAXID);
</del><ins>+        tree->setFocusedNodeID(focus ? focus->objectID() : AXID());
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -428,7 +426,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">         
</span><span class="cx">     AXID axID = m_widgetObjectMapping.get(widget);
</span><del>-    ASSERT(!HashTraits<AXID>::isDeletedValue(axID));
</del><ins>+    ASSERT(!axID.isHashTableDeletedValue());
</ins><span class="cx">     if (!axID)
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><span class="lines">@@ -441,7 +439,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><span class="cx">     AXID axID = m_renderObjectMapping.get(renderer);
</span><del>-    ASSERT(!HashTraits<AXID>::isDeletedValue(axID));
</del><ins>+    ASSERT(!axID.isHashTableDeletedValue());
</ins><span class="cx">     if (!axID)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -453,11 +451,11 @@
</span><span class="cx">     if (!node)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    AXID renderID = node->renderer() ? m_renderObjectMapping.get(node->renderer()) : 0;
-    ASSERT(!HashTraits<AXID>::isDeletedValue(renderID));
</del><ins>+    AXID renderID = node->renderer() ? m_renderObjectMapping.get(node->renderer()) : AXID();
+    ASSERT(!renderID.isHashTableDeletedValue());
</ins><span class="cx"> 
</span><span class="cx">     AXID nodeID = m_nodeObjectMapping.get(node);
</span><del>-    ASSERT(!HashTraits<AXID>::isDeletedValue(nodeID));
</del><ins>+    ASSERT(!nodeID.isHashTableDeletedValue());
</ins><span class="cx"> 
</span><span class="cx">     if (node->renderer() && nodeID && !renderID) {
</span><span class="cx">         // This can happen if an AccessibilityNodeObject is created for a node that's not
</span><span class="lines">@@ -611,7 +609,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(newObject);
</span><span class="cx">     AXID axID = getAXID(newObject);
</span><del>-    ASSERT(axID != InvalidAXID);
</del><ins>+    ASSERT(axID.isValid());
</ins><span class="cx"> 
</span><span class="cx">     WTF::switchOn(domObject,
</span><span class="cx">         [&axID, this] (RenderObject* typedValue) { m_renderObjectMapping.set(typedValue, axID); },
</span><span class="lines">@@ -830,7 +828,7 @@
</span><span class="cx"> void AXObjectCache::remove(AXID axID)
</span><span class="cx"> {
</span><span class="cx">     AXTRACE("AXObjectCache::remove");
</span><del>-    AXLOG(makeString("AXID ", axID));
</del><ins>+    AXLOG(makeString("AXID ", axID.loggingString()));
</ins><span class="cx"> 
</span><span class="cx">     if (!axID)
</span><span class="cx">         return;
</span><span class="lines">@@ -895,16 +893,10 @@
</span><span class="cx"> #if !PLATFORM(WIN)
</span><span class="cx"> AXID AXObjectCache::platformGenerateAXID() const
</span><span class="cx"> {
</span><del>-    static AXID lastUsedID = 0;
-
-    // Generate a new ID.
-    AXID objID = lastUsedID;
</del><ins>+    AXID objID;
</ins><span class="cx">     do {
</span><del>-        ++objID;
-    } while (!objID || HashTraits<AXID>::isDeletedValue(objID) || m_idsInUse.contains(objID));
-
-    lastUsedID = objID;
-
</del><ins>+        objID = AXID::generate();
+    } while (!objID.isValid() || m_idsInUse.contains(objID));
</ins><span class="cx">     return objID;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -914,7 +906,7 @@
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx"> 
</span><span class="cx">     return axIDs.map([this] (AXID axID) -> RefPtr<AXCoreObject> {
</span><del>-        ASSERT(axID != InvalidAXID);
</del><ins>+        ASSERT(axID.isValid());
</ins><span class="cx">         return objectFromAXID(axID);
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="lines">@@ -3272,7 +3264,7 @@
</span><span class="cx">     AXLOG(std::make_pair(&object, notification));
</span><span class="cx">     AXLOG(*this);
</span><span class="cx"> 
</span><del>-    if (!m_pageID || object.objectID() == InvalidAXID) {
</del><ins>+    if (!m_pageID || !object.objectID().isValid()) {
</ins><span class="cx">         AXLOG("No pageID or objectID");
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -3352,7 +3344,7 @@
</span><span class="cx">     Vector<std::pair<RefPtr<AXCoreObject>, AXNotification>> filteredNotifications;
</span><span class="cx">     for (const auto& notification : notifications) {
</span><span class="cx">         AXLOG(notification);
</span><del>-        if (!notification.first || notification.first->objectID() == InvalidAXID)
</del><ins>+        if (!notification.first || !notification.first->objectID().isValid())
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         switch (notification.second) {
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAXObjectCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AXObjectCache.h (285990 => 285991)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AXObjectCache.h       2021-11-18 09:49:45 UTC (rev 285990)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.h  2021-11-18 09:51:41 UTC (rev 285991)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> class Widget;
</span><span class="cx"> 
</span><span class="cx"> struct TextMarkerData {
</span><del>-    AXID axID { 0 };
</del><ins>+    AXID axID;
</ins><span class="cx"> 
</span><span class="cx">     Node* node { nullptr };
</span><span class="cx">     unsigned offset { 0 };
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (285990 => 285991)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.h 2021-11-18 09:49:45 UTC (rev 285990)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h    2021-11-18 09:51:41 UTC (rev 285991)
</span><span class="lines">@@ -828,7 +828,7 @@
</span><span class="cx">     mutable bool m_childrenInitialized { false };
</span><span class="cx">     AccessibilityRole m_role { AccessibilityRole::Unknown };
</span><span class="cx"> private:
</span><del>-    AXID m_id { 0 };
</del><ins>+    AXID m_id;
</ins><span class="cx">     OptionSet<AXAncestorFlag> m_ancestorFlags;
</span><span class="cx">     AccessibilityObjectInclusion m_lastKnownIsIgnoredValue { AccessibilityObjectInclusion::DefaultBehavior };
</span><span class="cx"> protected: // FIXME: Make the data members private.
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h (285990 => 285991)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h        2021-11-18 09:49:45 UTC (rev 285990)
+++ trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h   2021-11-18 09:51:41 UTC (rev 285991)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include "Widget.h"
</span><span class="cx"> #include <variant>
</span><span class="cx"> #include <wtf/HashSet.h>
</span><ins>+#include <wtf/ObjectIdentifier.h>
</ins><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="lines">@@ -93,8 +94,8 @@
</span><span class="cx"> struct AccessibilityText;
</span><span class="cx"> struct ScrollRectToVisibleOptions;
</span><span class="cx"> 
</span><del>-using AXID = size_t;
-extern const AXID InvalidAXID;
</del><ins>+enum AXIDType { };
+using AXID = ObjectIdentifier<AXIDType>;
</ins><span class="cx"> 
</span><span class="cx"> enum class AXAncestorFlag : uint8_t {
</span><span class="cx">     // When the flags aren't initialized, it means the object hasn't been inserted into the tree,
</span><span class="lines">@@ -1582,7 +1583,7 @@
</span><span class="cx"> {
</span><span class="cx">     detachWrapper(detachmentType);
</span><span class="cx">     detachRemoteParts(detachmentType);
</span><del>-    setObjectID(InvalidAXID);
</del><ins>+    setObjectID({ });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ACCESSIBILITY)
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityatspiAccessibilityObjectAtspicpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/atspi/AccessibilityObjectAtspi.cpp (285990 => 285991)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/atspi/AccessibilityObjectAtspi.cpp    2021-11-18 09:49:45 UTC (rev 285990)
+++ trunk/Source/WebCore/accessibility/atspi/AccessibilityObjectAtspi.cpp       2021-11-18 09:51:41 UTC (rev 285991)
</span><span class="lines">@@ -439,7 +439,7 @@
</span><span class="cx">         if (!g_strcmp0(propertyName, "Locale"))
</span><span class="cx">             return g_variant_new_string(setlocale(LC_MESSAGES, nullptr));
</span><span class="cx">         if (!g_strcmp0(propertyName, "AccessibleId"))
</span><del>-            return g_variant_new_string(atspiObject->m_axObject ? String::number(atspiObject->m_axObject->objectID()).utf8().data() : "");
</del><ins>+            return g_variant_new_string(atspiObject->m_axObject ? String::number(atspiObject->m_axObject->objectID().toUInt64()).utf8().data() : "");
</ins><span class="cx">         if (!g_strcmp0(propertyName, "Parent"))
</span><span class="cx">             return atspiObject->parentReference();
</span><span class="cx">         if (!g_strcmp0(propertyName, "ChildCount"))
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityisolatedtreeAXIsolatedObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp (285990 => 285991)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp     2021-11-18 09:49:45 UTC (rev 285990)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp        2021-11-18 09:51:41 UTC (rev 285991)
</span><span class="lines">@@ -44,8 +44,8 @@
</span><span class="cx">     , m_id(object.objectID())
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><del>-    if (m_id != InvalidAXID)
-        initializeAttributeData(object, parentID == InvalidAXID);
</del><ins>+    if (m_id.isValid())
+        initializeAttributeData(object, !parentID.isValid());
</ins><span class="cx">     else {
</span><span class="cx">         // Should never happen under normal circumstances.
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="lines">@@ -438,7 +438,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx"> 
</span><del>-    if (m_id == InvalidAXID)
</del><ins>+    if (!m_id.isValid())
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     if (auto* axObjectCache = this->axObjectCache()) {
</span><span class="lines">@@ -529,7 +529,7 @@
</span><span class="cx"> 
</span><span class="cx"> void AXIsolatedObject::detachFromParent()
</span><span class="cx"> {
</span><del>-    m_parentID = InvalidAXID;
</del><ins>+    m_parentID = { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const AXCoreObject::AccessibilityChildrenVector& AXIsolatedObject::children(bool)
</span><span class="lines">@@ -587,7 +587,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool AXIsolatedObject::isDetachedFromParent()
</span><span class="cx"> {
</span><del>-    if (parent() != InvalidAXID)
</del><ins>+    if (parent().isValid())
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // Check whether this is the root node, in which case we should return false.
</span><span class="lines">@@ -603,7 +603,7 @@
</span><span class="cx">             if (auto cell = object->cellForColumnAndRow(columnIndex, rowIndex))
</span><span class="cx">                 return cell->objectID();
</span><span class="cx">         }
</span><del>-        return InvalidAXID;
</del><ins>+        return { };
</ins><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     return tree()->nodeForID(cellID).get();
</span><span class="lines">@@ -810,7 +810,7 @@
</span><span class="cx">                 return axObject->objectID();
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        return InvalidAXID;
</del><ins>+        return { };
</ins><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     return tree()->nodeForID(axID).get();
</span><span class="lines">@@ -830,7 +830,7 @@
</span><span class="cx">     auto value = m_propertyMap.get(propertyName);
</span><span class="cx">     AXID nodeID = WTF::switchOn(value,
</span><span class="cx">         [] (AXID& typedValue) -> AXID { return typedValue; },
</span><del>-        [] (auto&) { return InvalidAXID; }
</del><ins>+        [] (auto&) { return AXID(); }
</ins><span class="cx">     );
</span><span class="cx"> 
</span><span class="cx">     return tree()->nodeForID(nodeID).get();
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityisolatedtreeAXIsolatedObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h (285990 => 285991)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h       2021-11-18 09:49:45 UTC (rev 285990)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h  2021-11-18 09:51:41 UTC (rev 285991)
</span><span class="lines">@@ -667,8 +667,8 @@
</span><span class="cx">     String outerHTML() const override;
</span><span class="cx"> 
</span><span class="cx">     RefPtr<AXIsolatedTree> m_cachedTree;
</span><del>-    AXID m_parentID { InvalidAXID };
-    AXID m_id { InvalidAXID };
</del><ins>+    AXID m_parentID;
+    AXID m_id;
</ins><span class="cx">     Vector<AXID> m_childrenIDs;
</span><span class="cx">     Vector<RefPtr<AXCoreObject>> m_children;
</span><span class="cx">     AXPropertyMap m_propertyMap;
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityisolatedtreeAXIsolatedTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp (285990 => 285991)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp       2021-11-18 09:49:45 UTC (rev 285990)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp  2021-11-18 09:51:41 UTC (rev 285991)
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx">     if (m_usedOnAXThread && isMainThread())
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    return axID != InvalidAXID ? m_readerThreadNodeMap.get(axID) : nullptr;
</del><ins>+    return axID.isValid() ? m_readerThreadNodeMap.get(axID) : nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Vector<RefPtr<AXCoreObject>> AXIsolatedTree::objectsForIDs(const Vector<AXID>& axIDs) const
</span><span class="lines">@@ -166,7 +166,7 @@
</span><span class="cx"> Vector<AXID> AXIsolatedTree::idsForObjects(const Vector<RefPtr<AXCoreObject>>& objects) const
</span><span class="cx"> {
</span><span class="cx">     return objects.map([] (const RefPtr<AXCoreObject>& object) -> AXID {
</span><del>-        return object ? object->objectID() : InvalidAXID;
</del><ins>+        return object ? object->objectID() : AXID();
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx">     ASSERT(m_changeLogLock.isLocked());
</span><span class="cx"> 
</span><del>-    if (axID != InvalidAXID) {
</del><ins>+    if (axID.isValid()) {
</ins><span class="cx">         m_nodeMap.set(axID, childrenIDs);
</span><span class="cx">         m_pendingChildrenUpdates.append(std::make_pair(axID, WTFMove(childrenIDs)));
</span><span class="cx">     }
</span><span class="lines">@@ -186,14 +186,14 @@
</span><span class="cx">     AXTRACE("AXIsolatedTree::generateSubtree");
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx"> 
</span><del>-    if (axObject.objectID() == InvalidAXID)
</del><ins>+    if (!axObject.objectID().isValid())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    auto object = createSubtree(axObject, axParent ? axParent->objectID() : InvalidAXID, attachWrapper);
</del><ins>+    auto object = createSubtree(axObject, axParent ? axParent->objectID() : AXID(), attachWrapper);
</ins><span class="cx">     Locker locker { m_changeLogLock };
</span><span class="cx">     if (!axParent)
</span><span class="cx">         setRootNode(object.ptr());
</span><del>-    else if (axParent->objectID() != InvalidAXID) // Need to check for the objectID of axParent again because it may have been detached while traversing the tree.
</del><ins>+    else if (axParent->objectID().isValid()) // Need to check for the objectID of axParent again because it may have been detached while traversing the tree.
</ins><span class="cx">         updateChildrenIDs(axParent->objectID(), axParent->childrenIDs());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -203,7 +203,7 @@
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx"> 
</span><span class="cx">     auto object = AXIsolatedObject::create(axObject, this, parentID);
</span><del>-    if (object->objectID() == InvalidAXID) {
</del><ins>+    if (!object->objectID().isValid()) {
</ins><span class="cx">         // Either the axObject has an invalid ID or something else went terribly wrong. Don't bother doing anything else.
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">         return object;
</span><span class="lines">@@ -242,7 +242,7 @@
</span><span class="cx"> 
</span><span class="cx">     AXID axID = axObject.objectID();
</span><span class="cx">     auto* axParent = axObject.parentObject();
</span><del>-    AXID parentID = axParent ? axParent->objectID() : InvalidAXID;
</del><ins>+    AXID parentID = axParent ? axParent->objectID() : AXID();
</ins><span class="cx"> 
</span><span class="cx">     auto newObject = AXIsolatedObject::create(axObject, this, parentID);
</span><span class="cx">     newObject->m_childrenIDs = axObject.childrenIDs();
</span><span class="lines">@@ -316,7 +316,7 @@
</span><span class="cx">         }
</span><span class="cx">         return false;
</span><span class="cx">     });
</span><del>-    if (!axAncestor || axAncestor->objectID() == InvalidAXID || iterator == m_nodeMap.end()) {
</del><ins>+    if (!axAncestor || !axAncestor->objectID().isValid() || iterator == m_nodeMap.end()) {
</ins><span class="cx">         // This update triggered before the isolated tree has been repopulated.
</span><span class="cx">         // Return here since there is nothing to update.
</span><span class="cx">         return;
</span><span class="lines">@@ -365,7 +365,7 @@
</span><span class="cx">     // Apply pending changes in case focus has changed and hasn't been updated.
</span><span class="cx">     applyPendingChanges();
</span><span class="cx">     Locker locker { m_changeLogLock };
</span><del>-    AXLOG(makeString("focusedNodeID ", m_focusedNodeID));
</del><ins>+    AXLOG(makeString("focusedNodeID ", m_focusedNodeID.loggingString()));
</ins><span class="cx">     AXLOG("focused node:");
</span><span class="cx">     AXLOG(nodeForID(m_focusedNodeID));
</span><span class="cx">     return nodeForID(m_focusedNodeID);
</span><span class="lines">@@ -392,7 +392,7 @@
</span><span class="cx"> void AXIsolatedTree::setFocusedNodeID(AXID axID)
</span><span class="cx"> {
</span><span class="cx">     AXTRACE("AXIsolatedTree::setFocusedNodeID");
</span><del>-    AXLOG(makeString("axID ", axID));
</del><ins>+    AXLOG(makeString("axID ", axID.loggingString()));
</ins><span class="cx">     ASSERT(isMainThread());
</span><span class="cx"> 
</span><span class="cx">     Locker locker { m_changeLogLock };
</span><span class="lines">@@ -406,7 +406,7 @@
</span><span class="cx"> void AXIsolatedTree::removeNode(AXID axID)
</span><span class="cx"> {
</span><span class="cx">     AXTRACE("AXIsolatedTree::removeNode");
</span><del>-    AXLOG(makeString("AXID ", axID));
</del><ins>+    AXLOG(makeString("AXID ", axID.loggingString()));
</ins><span class="cx">     ASSERT(isMainThread());
</span><span class="cx"> 
</span><span class="cx">     m_nodeMap.remove(axID);
</span><span class="lines">@@ -417,13 +417,13 @@
</span><span class="cx"> void AXIsolatedTree::removeSubtree(AXID axID)
</span><span class="cx"> {
</span><span class="cx">     AXTRACE("AXIsolatedTree::removeSubtree");
</span><del>-    AXLOG(makeString("Removing subtree for axID ", axID));
</del><ins>+    AXLOG(makeString("Removing subtree for axID ", axID.loggingString()));
</ins><span class="cx">     ASSERT(isMainThread());
</span><span class="cx"> 
</span><span class="cx">     Vector<AXID> removals = { axID };
</span><span class="cx">     while (removals.size()) {
</span><span class="cx">         AXID axID = removals.takeLast();
</span><del>-        if (axID == InvalidAXID)
</del><ins>+        if (!axID.isValid())
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         auto it = m_nodeMap.find(axID);
</span><span class="lines">@@ -449,9 +449,9 @@
</span><span class="cx">     Locker locker { m_changeLogLock };
</span><span class="cx"> 
</span><span class="cx">     if (m_pendingFocusedNodeID != m_focusedNodeID) {
</span><del>-        AXLOG(makeString("focusedNodeID ", m_focusedNodeID, " pendingFocusedNodeID ", m_pendingFocusedNodeID));
</del><ins>+        AXLOG(makeString("focusedNodeID ", m_focusedNodeID.loggingString(), " pendingFocusedNodeID ", m_pendingFocusedNodeID.loggingString()));
</ins><span class="cx"> 
</span><del>-        if (m_focusedNodeID != InvalidAXID) {
</del><ins>+        if (m_focusedNodeID.isValid()) {
</ins><span class="cx">             // Set the old focused object's IsFocused property to false.
</span><span class="cx">             AXPropertyMap propertyMap;
</span><span class="cx">             propertyMap.set(AXPropertyName::IsFocused, false);
</span><span class="lines">@@ -462,7 +462,7 @@
</span><span class="cx"> 
</span><span class="cx">     while (m_pendingNodeRemovals.size()) {
</span><span class="cx">         auto axID = m_pendingNodeRemovals.takeLast();
</span><del>-        AXLOG(makeString("removing axID ", axID));
</del><ins>+        AXLOG(makeString("removing axID ", axID.loggingString()));
</ins><span class="cx">         if (auto object = nodeForID(axID)) {
</span><span class="cx">             object->detach(AccessibilityDetachmentType::ElementDestroyed);
</span><span class="cx">             m_readerThreadNodeMap.remove(axID);
</span><span class="lines">@@ -471,7 +471,7 @@
</span><span class="cx"> 
</span><span class="cx">     while (m_pendingSubtreeRemovals.size()) {
</span><span class="cx">         auto axID = m_pendingSubtreeRemovals.takeLast();
</span><del>-        AXLOG(makeString("removing subtree axID ", axID));
</del><ins>+        AXLOG(makeString("removing subtree axID ", axID.loggingString()));
</ins><span class="cx">         if (auto object = nodeForID(axID)) {
</span><span class="cx">             object->detach(AccessibilityDetachmentType::ElementDestroyed);
</span><span class="cx">             m_pendingSubtreeRemovals.appendVector(object->m_childrenIDs);
</span><span class="lines">@@ -481,8 +481,8 @@
</span><span class="cx"> 
</span><span class="cx">     for (const auto& item : m_pendingAppends) {
</span><span class="cx">         AXID axID = item.isolatedObject->objectID();
</span><del>-        AXLOG(makeString("appending axID ", axID));
-        if (axID == InvalidAXID)
</del><ins>+        AXLOG(makeString("appending axID ", axID.loggingString()));
+        if (!axID.isValid())
</ins><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="cx">         auto& wrapper = item.wrapper ? item.wrapper : item.isolatedObject->wrapper();
</span><span class="lines">@@ -518,7 +518,7 @@
</span><span class="cx">     m_pendingAppends.clear();
</span><span class="cx"> 
</span><span class="cx">     for (auto& update : m_pendingChildrenUpdates) {
</span><del>-        AXLOG(makeString("updating children for axID ", update.first));
</del><ins>+        AXLOG(makeString("updating children for axID ", update.first.loggingString()));
</ins><span class="cx">         if (auto object = nodeForID(update.first))
</span><span class="cx">             object->m_childrenIDs = WTFMove(update.second);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityisolatedtreeAXIsolatedTreeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h (285990 => 285991)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h 2021-11-18 09:49:45 UTC (rev 285990)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h    2021-11-18 09:51:41 UTC (rev 285991)
</span><span class="lines">@@ -323,7 +323,7 @@
</span><span class="cx"> using AXPropertyMap = HashMap<AXPropertyName, AXPropertyValueVariant, IntHash<AXPropertyName>, WTF::StrongEnumHashTraits<AXPropertyName>>;
</span><span class="cx"> 
</span><span class="cx"> struct AXPropertyChange {
</span><del>-    AXID axID { InvalidAXID }; // ID of the object whose properties changed.
</del><ins>+    AXID axID; // ID of the object whose properties changed.
</ins><span class="cx">     AXPropertyMap properties; // Changed properties.
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="lines">@@ -407,8 +407,8 @@
</span><span class="cx">     Vector<AXID> m_pendingNodeRemovals WTF_GUARDED_BY_LOCK(m_changeLogLock); // Nodes to be removed from the tree.
</span><span class="cx">     Vector<AXID> m_pendingSubtreeRemovals WTF_GUARDED_BY_LOCK(m_changeLogLock); // Nodes whose subtrees are to be removed from the tree.
</span><span class="cx">     Vector<std::pair<AXID, Vector<AXID>>> m_pendingChildrenUpdates WTF_GUARDED_BY_LOCK(m_changeLogLock);
</span><del>-    AXID m_pendingFocusedNodeID WTF_GUARDED_BY_LOCK(m_changeLogLock) { InvalidAXID };
-    AXID m_focusedNodeID { InvalidAXID };
</del><ins>+    AXID m_pendingFocusedNodeID WTF_GUARDED_BY_LOCK(m_changeLogLock);
+    AXID m_focusedNodeID;
</ins><span class="cx">     Lock m_changeLogLock;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitymacWebAccessibilityObjectWrapperBasemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm (285990 => 285991)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm      2021-11-18 09:49:45 UTC (rev 285990)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm 2021-11-18 09:51:41 UTC (rev 285991)
</span><span class="lines">@@ -290,9 +290,9 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)attachAXObject:(AXCoreObject*)axObject
</span><span class="cx"> {
</span><del>-    ASSERT(axObject && (_identifier == InvalidAXID || _identifier == axObject->objectID()));
</del><ins>+    ASSERT(axObject && (!_identifier.isValid() || _identifier == axObject->objectID()));
</ins><span class="cx">     m_axObject = axObject;
</span><del>-    if (_identifier == InvalidAXID)
</del><ins>+    if (!_identifier.isValid())
</ins><span class="cx">         _identifier = m_axObject->objectID();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -299,9 +299,9 @@
</span><span class="cx"> #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
</span><span class="cx"> - (void)attachIsolatedObject:(AXCoreObject*)isolatedObject
</span><span class="cx"> {
</span><del>-    ASSERT(isolatedObject && (_identifier == InvalidAXID || _identifier == isolatedObject->objectID()));
</del><ins>+    ASSERT(isolatedObject && (!_identifier.isValid() || _identifier == isolatedObject->objectID()));
</ins><span class="cx">     m_isolatedObject = isolatedObject;
</span><del>-    if (_identifier == InvalidAXID)
</del><ins>+    if (!_identifier.isValid())
</ins><span class="cx">         _identifier = m_isolatedObject->objectID();
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -309,7 +309,7 @@
</span><span class="cx"> - (void)detach
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><del>-    _identifier = InvalidAXID;
</del><ins>+    _identifier = { };
</ins><span class="cx">     m_axObject = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -316,7 +316,7 @@
</span><span class="cx"> #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
</span><span class="cx"> - (void)detachIsolatedObject:(AccessibilityDetachmentType)detachmentType
</span><span class="cx"> {
</span><del>-    ASSERT_UNUSED(detachmentType, detachmentType == AccessibilityDetachmentType::ElementChanged ? _identifier != InvalidAXID && m_axObject : true);
</del><ins>+    ASSERT_UNUSED(detachmentType, detachmentType == AccessibilityDetachmentType::ElementChanged ? _identifier.isValid() && m_axObject : true);
</ins><span class="cx">     m_isolatedObject = nullptr;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilitywinAXObjectCacheWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/win/AXObjectCacheWin.cpp (285990 => 285991)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/win/AXObjectCacheWin.cpp      2021-11-18 09:49:45 UTC (rev 285990)
+++ trunk/Source/WebCore/accessibility/win/AXObjectCacheWin.cpp 2021-11-18 09:51:41 UTC (rev 285991)
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">     ASSERT(obj->objectID() >= 1);
</span><span class="cx">     ASSERT(obj->objectID() <= std::numeric_limits<LONG>::max());
</span><span class="cx"> 
</span><del>-    NotifyWinEvent(msaaEvent, page->chrome().platformPageClient(), OBJID_CLIENT, -static_cast<LONG>(obj->objectID()));
</del><ins>+    NotifyWinEvent(msaaEvent, page->chrome().platformPageClient(), OBJID_CLIENT, -static_cast<LONG>(obj->objectID().toUInt64()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AXObjectCache::nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned, const String&)
</span><span class="lines">@@ -148,19 +148,19 @@
</span><span class="cx"> 
</span><span class="cx"> AXID AXObjectCache::platformGenerateAXID() const
</span><span class="cx"> {
</span><del>-    static AXID lastUsedID = 0;
</del><ins>+    static LONG lastUsedID = 0;
</ins><span class="cx"> 
</span><span class="cx">     // Generate a new ID. Windows accessibility relies on a positive AXID,
</span><span class="cx">     // ranging from 1 to LONG_MAX.
</span><del>-    AXID objID = lastUsedID;
</del><ins>+    LONG currentID = lastUsedID;
+    AXID objID;
</ins><span class="cx">     do {
</span><del>-        ++objID;
-        objID %= std::numeric_limits<LONG>::max();
-    } while (objID == 0 || HashTraits<AXID>::isDeletedValue(objID) || m_idsInUse.contains(objID));
</del><ins>+        objID = makeObjectIdentifier<AXIDType>(++currentID);
+    } while (!objID.isValid() || m_idsInUse.contains(objID));
</ins><span class="cx"> 
</span><del>-    ASSERT(objID >= 1 && objID <= std::numeric_limits<LONG>::max());
</del><ins>+    ASSERT(objID.isValid() && objID.toUInt64() <= std::numeric_limits<LONG>::max());
</ins><span class="cx"> 
</span><del>-    lastUsedID = objID;
</del><ins>+    lastUsedID = currentID;
</ins><span class="cx"> 
</span><span class="cx">     return objID;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitLegacywinAccessibleBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/win/AccessibleBase.cpp (285990 => 285991)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/win/AccessibleBase.cpp 2021-11-18 09:49:45 UTC (rev 285990)
+++ trunk/Source/WebKitLegacy/win/AccessibleBase.cpp    2021-11-18 09:51:41 UTC (rev 285991)
</span><span class="lines">@@ -303,7 +303,7 @@
</span><span class="cx">     if (!m_object)
</span><span class="cx">         return E_FAIL;
</span><span class="cx"> 
</span><del>-    *uniqueID = static_cast<long>(m_object->objectID());
</del><ins>+    *uniqueID = static_cast<long>(m_object->objectID().toUInt64());
</ins><span class="cx">     return S_OK;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1039,7 +1039,7 @@
</span><span class="cx">         if (!document)
</span><span class="cx">             return E_FAIL;
</span><span class="cx"> 
</span><del>-        childObj = document->axObjectCache()->objectFromAXID(-vChild.lVal);
</del><ins>+        childObj = document->axObjectCache()->objectFromAXID(makeObjectIdentifier<AXIDType>(-vChild.lVal));
</ins><span class="cx">     } else {
</span><span class="cx">         size_t childIndex = static_cast<size_t>(vChild.lVal - 1);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitLegacywinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/win/ChangeLog (285990 => 285991)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/win/ChangeLog  2021-11-18 09:49:45 UTC (rev 285990)
+++ trunk/Source/WebKitLegacy/win/ChangeLog     2021-11-18 09:51:41 UTC (rev 285991)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2021-11-18  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        AX: Use ObjectIdentifier for AXID
+        https://bugs.webkit.org/show_bug.cgi?id=233248
+        <rdar://problem/85497145>
+
+        Reviewed by Andres Gonzalez.
+
+        * AccessibleBase.cpp:
+        (AccessibleBase::get_uniqueID):
+        (AccessibleBase::getAccessibilityObjectForChild const):
+
</ins><span class="cx"> 2021-11-11  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Make scroll granularity an enum class
</span></span></pre>
</div>
</div>

</body>
</html>