Title: [220084] trunk/Source/WebCore
Revision
220084
Author
n_w...@apple.com
Date
2017-07-31 17:18:00 -0700 (Mon, 31 Jul 2017)

Log Message

AX: CFEqual is failing on text markers with exact same data
https://bugs.webkit.org/show_bug.cgi?id=175002
<rdar://problem/33636985>

Reviewed by Chris Fleizach.

We should zero the memory of the TextMarkerData instance so that it
can be tested for byte-equivalence.

Made sure this change won't break any of the existing tests.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
(WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (220083 => 220084)


--- trunk/Source/WebCore/ChangeLog	2017-07-31 23:55:03 UTC (rev 220083)
+++ trunk/Source/WebCore/ChangeLog	2017-08-01 00:18:00 UTC (rev 220084)
@@ -1,3 +1,20 @@
+2017-07-31  Nan Wang  <n_w...@apple.com>
+
+        AX: CFEqual is failing on text markers with exact same data
+        https://bugs.webkit.org/show_bug.cgi?id=175002
+        <rdar://problem/33636985>
+
+        Reviewed by Chris Fleizach.
+
+        We should zero the memory of the TextMarkerData instance so that it
+        can be tested for byte-equivalence.
+
+        Made sure this change won't break any of the existing tests.
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
+        (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
+
 2017-07-28  Matt Rajca  <mra...@apple.com>
 
         Propagate user gesture tokens when script elements are loaded.

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (220083 => 220084)


--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2017-07-31 23:55:03 UTC (rev 220083)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2017-08-01 00:18:00 UTC (rev 220084)
@@ -2160,7 +2160,10 @@
     AXObjectCache* cache = domNode->document().axObjectCache();
     RefPtr<AccessibilityObject> obj = cache->getOrCreate(domNode);
 
+    // This memory must be zero'd so instances of TextMarkerData can be tested for byte-equivalence.
     TextMarkerData textMarkerData;
+    memset(&textMarkerData, 0, sizeof(TextMarkerData));
+    
     textMarkerData.axID = obj.get()->axObjectID();
     textMarkerData.node = domNode;
     textMarkerData.offset = deepPos.deprecatedEditingOffset();
@@ -2185,7 +2188,10 @@
     if (!obj)
         return std::nullopt;
 
+    // This memory must be zero'd so instances of TextMarkerData can be tested for byte-equivalence.
     TextMarkerData textMarkerData;
+    memset(&textMarkerData, 0, sizeof(TextMarkerData));
+    
     textMarkerData.axID = obj.get()->axObjectID();
     textMarkerData.node = &textControl;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to