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