[ATK] Test accessibility/insert-children-assert.html is crashing since added in r216980
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Apr 2019 07:59:14 +0000 (07:59 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Apr 2019 07:59:14 +0000 (07:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=172281
<rdar://problem/37030990>

Reviewed by Joanmarie Diggs.

Source/WebCore:

The crash happens because at some point the test tries to get the anonymous block text, getting the RenderText as
first child and RenderFullScreen as last child and the latter doesn't have a node. This is because in atk we do
things differently, we don't include the static text elements individually, but parent element uses
textUnderElement() to get all the pieces together. We can just turn the asserts into actual nullptr checks.

Fixes: accessibility/insert-children-assert.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textUnderElement const):

LayoutTests:

Update the test to expect the whole content text on atk and remove the test expectations.

* accessibility/insert-children-assert.html:
* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244105 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/accessibility/insert-children-assert.html
LayoutTests/platform/gtk/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityRenderObject.cpp

index 2d5c8ae..dbac7b6 100644 (file)
@@ -1,3 +1,16 @@
+2019-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [ATK] Test accessibility/insert-children-assert.html is crashing since added in r216980
+        https://bugs.webkit.org/show_bug.cgi?id=172281
+        <rdar://problem/37030990>
+
+        Reviewed by Joanmarie Diggs.
+
+        Update the test to expect the whole content text on atk and remove the test expectations.
+
+        * accessibility/insert-children-assert.html:
+        * platform/gtk/TestExpectations:
+
 2019-04-09  John Wilander  <wilander@apple.com>
 
         Add Resource Load Statistics test case for Ping
index f9623d2..9220bc3 100644 (file)
@@ -27,7 +27,11 @@ body {
 
     if ("webkitRequestFullScreen" in Element.prototype) {
         var content = accessibilityController.accessibleElementById("content");
-        var value = "AXValue: d";
+        var value;
+        if (accessibilityController.platformName == "atk")
+            value = "AXValue: ab<\\n>c<\\n>de<\\n>";
+        else
+            value = "AXValue: d";
         document.body.offsetTop;
         var span = document.getElementsByTagName('span')[0];
 
index 7fae409..1332fad 100644 (file)
@@ -1287,8 +1287,6 @@ webkit.org/b/131546 media/track/track-in-band.html [ Crash Timeout Failure ]
 
 webkit.org/b/163782 media/video-played-ranges-1.html [ Crash Pass Failure ]
 
-webkit.org/b/172281 accessibility/insert-children-assert.html [ Crash ]
-
 webkit.org/b/172955 media/video-preload.html [ Crash Pass ]
 
 webkit.org/b/175575 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/ready-states/autoplay-with-slow-text-tracks.html [ Crash Pass ]
index 42806aa..04c00d3 100644 (file)
@@ -1,3 +1,21 @@
+2019-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [ATK] Test accessibility/insert-children-assert.html is crashing since added in r216980
+        https://bugs.webkit.org/show_bug.cgi?id=172281
+        <rdar://problem/37030990>
+
+        Reviewed by Joanmarie Diggs.
+
+        The crash happens because at some point the test tries to get the anonymous block text, getting the RenderText as
+        first child and RenderFullScreen as last child and the latter doesn't have a node. This is because in atk we do
+        things differently, we don't include the static text elements individually, but parent element uses
+        textUnderElement() to get all the pieces together. We can just turn the asserts into actual nullptr checks.
+
+        Fixes: accessibility/insert-children-assert.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::textUnderElement const):
+
 2019-04-09  Keith Rollin  <krollin@apple.com>
 
         Unreviewed build maintenance -- update .xcfilelists.
index 5be6c85..84ef86f 100644 (file)
@@ -640,10 +640,7 @@ String AccessibilityRenderObject::textUnderElement(AccessibilityTextUnderElement
             // defining one based in the two external positions defining the boundaries of the subtree.
             RenderObject* firstChildRenderer = m_renderer->firstChildSlow();
             RenderObject* lastChildRenderer = m_renderer->lastChildSlow();
-            if (firstChildRenderer && lastChildRenderer) {
-                ASSERT(firstChildRenderer->node());
-                ASSERT(lastChildRenderer->node());
-
+            if (firstChildRenderer && firstChildRenderer->node() && lastChildRenderer && lastChildRenderer->node()) {
                 // We define the start and end positions for the range as the ones right before and after
                 // the first and the last nodes in the DOM tree that is wrapped inside the anonymous block.
                 Node* firstNodeInBlock = firstChildRenderer->node();