Title: [102877] trunk
Revision
102877
Author
[email protected]
Date
2011-12-14 20:40:50 -0800 (Wed, 14 Dec 2011)

Log Message

Seeing crash in DRT after loading-iframe-sends-notification.html land
https://bugs.webkit.org/show_bug.cgi?id=72624

Source/WebCore:

When an iframe finishes loading, send an accessibility notification
on the renderer, rather than on a parent node. The only reason it was
being posted on a parent before was because there was no way to detect
that in a test. This is simpler and now covered by the test.

Reviewed by Chris Fleizach.

Updates existing test:
accessibility/loading-iframe-sends-notification.html

* dom/Document.cpp:
(WebCore::Document::implicitClose):

LayoutTests:

Rewrite test to use a global addNotificationListener, which makes it
more robust and cross-platform.

Reviewed by Chris Fleizach.

* accessibility/loading-iframe-sends-notification-expected.txt: Added.
* accessibility/loading-iframe-sends-notification.html:
* platform/chromium/accessibility/loading-iframe-sends-notification-expected.txt: Removed.
* platform/chromium/test_expectations.txt:
* platform/gtk/Skipped:
* platform/gtk/accessibility/loading-iframe-sends-notification-expected.txt: Removed.
* platform/mac/Skipped:
* platform/win/Skipped:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (102876 => 102877)


--- trunk/LayoutTests/ChangeLog	2011-12-15 04:37:54 UTC (rev 102876)
+++ trunk/LayoutTests/ChangeLog	2011-12-15 04:40:50 UTC (rev 102877)
@@ -1,3 +1,22 @@
+2011-12-14  Dominic Mazzoni  <[email protected]>
+
+        Seeing crash in DRT after loading-iframe-sends-notification.html land
+        https://bugs.webkit.org/show_bug.cgi?id=72624
+
+        Rewrite test to use a global addNotificationListener, which makes it
+        more robust and cross-platform.
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/loading-iframe-sends-notification-expected.txt: Added.
+        * accessibility/loading-iframe-sends-notification.html:
+        * platform/chromium/accessibility/loading-iframe-sends-notification-expected.txt: Removed.
+        * platform/chromium/test_expectations.txt:
+        * platform/gtk/Skipped:
+        * platform/gtk/accessibility/loading-iframe-sends-notification-expected.txt: Removed.
+        * platform/mac/Skipped:
+        * platform/win/Skipped:
+
 2011-12-14  Ken Buchanan  <[email protected]>
 
         Crash due to incorrect parsing of isolates

Added: trunk/LayoutTests/accessibility/loading-iframe-sends-notification-expected.txt (0 => 102877)


--- trunk/LayoutTests/accessibility/loading-iframe-sends-notification-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/loading-iframe-sends-notification-expected.txt	2011-12-15 04:40:50 UTC (rev 102877)
@@ -0,0 +1,20 @@
+Before
+
+
+After
+
+End of test
+
+This tests that when an iframe finishes loading, it sends a notification.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS findByAccessibleTitleSubstring(root, 'InnerButton') != null is false
+Got notification on iframe.
+PASS findByAccessibleTitleSubstring(root, 'InnerButton') != null is true
+PASS gotIframeNotification is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: trunk/LayoutTests/accessibility/loading-iframe-sends-notification.html (102876 => 102877)


--- trunk/LayoutTests/accessibility/loading-iframe-sends-notification.html	2011-12-15 04:37:54 UTC (rev 102876)
+++ trunk/LayoutTests/accessibility/loading-iframe-sends-notification.html	2011-12-15 04:40:50 UTC (rev 102877)
@@ -1,69 +1,94 @@
 <html>
 <head>
+<link rel="stylesheet" href=""
 <script src=""
+</head>
+<body>
 
-  <script>
+<p>Before</p>
+
+<iframe id="iframe" title="InnerFrame"></iframe>
+
+<p>After</p>
+
+<p>End of test</p>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+    description("This tests that when an iframe finishes loading, it sends a notification.");
+
     if (window.layoutTestController)
         layoutTestController.waitUntilDone();
 
+    window.jsTestIsAsync = true;
+
+    // Recursively search the entire accessibility tree starting at the given
+    // AccessibilityUIElement (inclusive) and return the element whose title
+    // contains the given string. This makes it possible to find a node even
+    // when there are platform differences in the tree, i.e. due to different
+    // nodes being ignored.
+    function findByAccessibleTitleSubstring(startElement, titleSubstring)
+    {
+        if (startElement.title.indexOf(titleSubstring) >= 0)
+            return startElement;
+
+        for (var i = 0; i < startElement.childrenCount; i++) {
+            var found = findByAccessibleTitleSubstring(startElement.childAtIndex(i), titleSubstring);
+            if (found)
+                return found;
+        }
+
+        return null;
+    }
+
     function runTest()
     {
-        description("This tests that when an iframe finishes loading, it sends a layout complete notification.");
+        window.gotIframeNotification = false;
 
         if (window.accessibilityController) {
-            // Initially, the iframe's webarea is empty.
             window.root = accessibilityController.rootElement;
-            window.body = root.childAtIndex(0);
-            window.iframe = body.childAtIndex(1).childAtIndex(0);
-            window.scrollarea = iframe.childAtIndex(0);
-            window.subwebarea = scrollarea.childAtIndex(0);
-            shouldBeFalse("subwebarea.childrenCount > 0");
 
-            iframe.addNotificationListener(function (notification) {
-                // Make sure that we get a LayoutComplete notification and that
-                // immediately after the notification is received, the iframe's
-                // webarea has content.
-                debug('Got notification on iframe: ' + notification);
-                window.newScrollarea = iframe.childAtIndex(0);
-                window.newSubwebarea = newScrollarea.childAtIndex(0);
-                shouldBeTrue("newSubwebarea.childrenCount > 0");
+            // Initially, the iframe should not be loaded, so we shouldn't be able to find this button.
+            shouldBeFalse("findByAccessibleTitleSubstring(root, 'InnerButton') != null");
+
+            window.accessibilityController.addNotificationListener(function (target, notification) {
+                // Ignore this notification if it's not on the iframe.
+                if (target.description.indexOf("InnerFrame") == -1)
+                    return;
+
+                debug("Got notification on iframe.");
+                gotIframeNotification = true;
+
+                // Check that the button within the iframe is now reachable from the root.
+                shouldBeTrue("findByAccessibleTitleSubstring(root, 'InnerButton') != null");
             });
         }
 
         window.iframeElement = document.getElementById("iframe");
         iframeElement.addEventListener("load", function() {
             window.setTimeout(function() {
-                debug('<br /><span class="pass">TEST COMPLETE</span>');
-                if (window.layoutTestController)
-                    layoutTestController.notifyDone();
+                shouldBeTrue("gotIframeNotification");
+                if (window.accessibilityController)
+                    accessibilityController.removeNotificationListener();
+
+                finishJSTest();
             }, 10);
         }, false);
 
         // Load content into the iframe. This will trigger the event
         // handler above, which will check that the accessibility tree
         // was updated with new content.
-        window.iframeElement.src = "" me</button></body>";
-
+        window.iframeElement.src = ""
     }
 
     window.addEventListener('load', function() {
         setTimeout(runTest, 10);
     }, false);
 
-  </script>
-</head>
-<body>
+</script>
 
-<p>Before</p>
-
-<iframe id="iframe"></iframe>
-
-<p>After</p>
-
-<p>End of test</p>
-
-<p id="description"></p>
-<div id="console"></div>
-
+<script src=""
 </body>
 </html>

Deleted: trunk/LayoutTests/platform/chromium/accessibility/loading-iframe-sends-notification-expected.txt (102876 => 102877)


--- trunk/LayoutTests/platform/chromium/accessibility/loading-iframe-sends-notification-expected.txt	2011-12-15 04:37:54 UTC (rev 102876)
+++ trunk/LayoutTests/platform/chromium/accessibility/loading-iframe-sends-notification-expected.txt	2011-12-15 04:40:50 UTC (rev 102877)
@@ -1,18 +0,0 @@
-Before
-
-
-After
-
-End of test
-
-This tests that when an iframe finishes loading, it sends a layout complete notification.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS subwebarea.childrenCount > 0 is false
-Got notification on iframe: LayoutComplete
-PASS newSubwebarea.childrenCount > 0 is true
-
-TEST COMPLETE
-

Modified: trunk/LayoutTests/platform/chromium/test_expectations.txt (102876 => 102877)


--- trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-12-15 04:37:54 UTC (rev 102876)
+++ trunk/LayoutTests/platform/chromium/test_expectations.txt	2011-12-15 04:40:50 UTC (rev 102877)
@@ -3927,7 +3927,6 @@
 BUGWK72728 LEOPARD CPU-CG : canvas/philip/tests/2d.imageData.put.unchanged.html = TEXT
 BUGWK72728 LEOPARD CPU-CG : fast/canvas/canvas-alphaImageData-behavior.html = TEXT
 
-BUGWK72747 WIN : accessibility/loading-iframe-sends-notification.html = PASS TIMEOUT
 BUGWK72990 WIN : accessibility/loading-iframe-updates-axtree.html = PASS TIMEOUT
 BUGWK72761 : accessibility/anonymous-render-block-in-continuation-causes-crash.html = PASS TIMEOUT
 

Modified: trunk/LayoutTests/platform/gtk/Skipped (102876 => 102877)


--- trunk/LayoutTests/platform/gtk/Skipped	2011-12-15 04:37:54 UTC (rev 102876)
+++ trunk/LayoutTests/platform/gtk/Skipped	2011-12-15 04:40:50 UTC (rev 102877)
@@ -422,6 +422,7 @@
 accessibility/language-attribute.html
 accessibility/legend.html
 accessibility/lists.html
+accessibility/loading-iframe-sends-notification.html
 accessibility/loading-iframe-updates-axtree.html
 accessibility/notification-listeners.html
 accessibility/onclick-handlers.html

Deleted: trunk/LayoutTests/platform/gtk/accessibility/loading-iframe-sends-notification-expected.txt (102876 => 102877)


--- trunk/LayoutTests/platform/gtk/accessibility/loading-iframe-sends-notification-expected.txt	2011-12-15 04:37:54 UTC (rev 102876)
+++ trunk/LayoutTests/platform/gtk/accessibility/loading-iframe-sends-notification-expected.txt	2011-12-15 04:40:50 UTC (rev 102877)
@@ -1,16 +0,0 @@
-Before
-
-
-After
-
-End of test
-
-This tests that when an iframe finishes loading, it sends a layout complete notification.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS subwebarea.childrenCount > 0 is false
-
-TEST COMPLETE
-

Modified: trunk/LayoutTests/platform/mac/Skipped (102876 => 102877)


--- trunk/LayoutTests/platform/mac/Skipped	2011-12-15 04:37:54 UTC (rev 102876)
+++ trunk/LayoutTests/platform/mac/Skipped	2011-12-15 04:40:50 UTC (rev 102877)
@@ -93,9 +93,6 @@
 # Skipped until https://bugs.webkit.org/show_bug.cgi?id=33923 is resolved.
 platform/mac/accessibility/change-notification-on-scroll.html
 
-# Skipped until https://bugs.webkit.org/show_bug.cgi?id=72624 is resolved.
-accessibility/loading-iframe-sends-notification.html
-
 # Fails on Mac for some reason; being investigates.
 # See https://bugs.webkit.org/show_bug.cgi?id=34287
 http/tests/media/video-cookie.html

Modified: trunk/LayoutTests/platform/win/Skipped (102876 => 102877)


--- trunk/LayoutTests/platform/win/Skipped	2011-12-15 04:37:54 UTC (rev 102876)
+++ trunk/LayoutTests/platform/win/Skipped	2011-12-15 04:40:50 UTC (rev 102877)
@@ -609,6 +609,9 @@
 accessibility/transformed-element.html
 accessibility/visible-elements.html
 
+# Need to implement global addNotificationListener in Windows DRT
+accessibility/loading-iframe-sends-notification.html
+
 # No support for print-to-pdf in Windows DRT
 printing/compositing-layer-printing.html
 printing/media-queries-print.html

Modified: trunk/Source/WebCore/ChangeLog (102876 => 102877)


--- trunk/Source/WebCore/ChangeLog	2011-12-15 04:37:54 UTC (rev 102876)
+++ trunk/Source/WebCore/ChangeLog	2011-12-15 04:40:50 UTC (rev 102877)
@@ -1,3 +1,21 @@
+2011-12-14  Dominic Mazzoni  <[email protected]>
+
+        Seeing crash in DRT after loading-iframe-sends-notification.html land
+        https://bugs.webkit.org/show_bug.cgi?id=72624
+
+        When an iframe finishes loading, send an accessibility notification
+        on the renderer, rather than on a parent node. The only reason it was
+        being posted on a parent before was because there was no way to detect
+        that in a test. This is simpler and now covered by the test.
+
+        Reviewed by Chris Fleizach.
+
+        Updates existing test:
+        accessibility/loading-iframe-sends-notification.html
+
+        * dom/Document.cpp:
+        (WebCore::Document::implicitClose):
+
 2011-12-14  Nat Duca  <[email protected]>
 
         [chromium] Add inhibitDraw to CCScheduler and drop root impl to prevent background flash on tab restore

Modified: trunk/Source/WebCore/dom/Document.cpp (102876 => 102877)


--- trunk/Source/WebCore/dom/Document.cpp	2011-12-15 04:37:54 UTC (rev 102876)
+++ trunk/Source/WebCore/dom/Document.cpp	2011-12-15 04:40:50 UTC (rev 102877)
@@ -2280,16 +2280,8 @@
             axObjectCache()->postNotification(renderObject, AXObjectCache::AXLoadComplete, true);
         else {
             // AXLoadComplete can only be posted on the top document, so if it's a document
-            // in an iframe that just finished loading, post a notification on the iframe
-            // element instead.
-            ScrollView* scrollView = frame()->view();
-            if (scrollView && scrollView->isFrameView()) {
-                HTMLFrameOwnerElement* owner = static_cast<FrameView*>(scrollView)->frame()->ownerElement();
-                if (owner && owner->renderer()) {
-                    AccessibilityObject* axIFrame = axObjectCache()->getOrCreate(owner->renderer());
-                    axObjectCache()->postNotification(axIFrame, axIFrame->document(), AXObjectCache::AXLayoutComplete, true);
-                }
-            }
+            // in an iframe that just finished loading, post AXLayoutComplete instead.
+            axObjectCache()->postNotification(renderObject, AXObjectCache::AXLayoutComplete, true);
         }
     }
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to