Title: [126035] releases/WebKitGTK/webkit-1.8/Source/WebCore
Revision
126035
Author
[email protected]
Date
2012-08-20 09:18:24 -0700 (Mon, 20 Aug 2012)

Log Message

Merge 124997 - REGRESSION(r65062): out of bound access in TextIterator (5 editing tests) on GTK
https://bugs.webkit.org/show_bug.cgi?id=63611

Patch by Mario Sanchez Prada <[email protected]> on 2012-08-08
Reviewed by Ryosuke Niwa.

Ensure document's layout is up-to-date before using TextIterator
to properly calculate the offset for a text change when emitting
accessibility related signals in GTK.

* accessibility/gtk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::nodeTextChangePlatformNotification): Call
to document->updateLayout() before using TextIterator.

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog (126034 => 126035)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog	2012-08-20 16:18:18 UTC (rev 126034)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog	2012-08-20 16:18:24 UTC (rev 126035)
@@ -1,3 +1,18 @@
+2012-08-08  Mario Sanchez Prada  <[email protected]>
+
+        REGRESSION(r65062): out of bound access in TextIterator (5 editing tests) on GTK
+        https://bugs.webkit.org/show_bug.cgi?id=63611
+
+        Reviewed by Ryosuke Niwa.
+
+        Ensure document's layout is up-to-date before using TextIterator
+        to properly calculate the offset for a text change when emitting
+        accessibility related signals in GTK.
+
+        * accessibility/gtk/AXObjectCacheAtk.cpp:
+        (WebCore::AXObjectCache::nodeTextChangePlatformNotification): Call
+        to document->updateLayout() before using TextIterator.
+
 2012-06-21  Kalev Lember  <[email protected]>
 
         [GTK] Fix NPAPI plugins on Windows

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp (126034 => 126035)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp	2012-08-20 16:18:18 UTC (rev 126034)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp	2012-08-20 16:18:24 UTC (rev 126035)
@@ -185,7 +185,14 @@
         return;
 
     Node* node = object->node();
-    RefPtr<Range> range = Range::create(node->document(), node->parentNode(), 0, node, 0);
+    if (!node)
+        return;
+
+    // Ensure document's layout is up-to-date before using TextIterator.
+    Document* document = node->document();
+    document->updateLayout();
+
+    RefPtr<Range> range = Range::create(document, node->parentNode(), 0, node, 0);
     emitTextChanged(object, textChange, offset + TextIterator::rangeLength(range.get()), text);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to