Title: [137962] trunk
Revision
137962
Author
[email protected]
Date
2012-12-17 17:21:55 -0800 (Mon, 17 Dec 2012)

Log Message

Seamless iframe should not announce a new browsing context
https://bugs.webkit.org/show_bug.cgi?id=86317

Reviewed by Eric Seidel.

Source/WebCore: 

Introduce a new role for seamless frames so that the platforms can decide what to do
with this kind of object. For the mac, it's exposed as a group.

Test: platform/mac/accessibility/seamless-iframe.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore):
* accessibility/AccessibilityNodeObject.h:
(AccessibilityNodeObject):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isWebArea):
(WebCore::AccessibilityObject::isSeamlessWebArea):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::parentObjectIfExists):
(WebCore::AccessibilityRenderObject::parentObject):
(WebCore::AccessibilityRenderObject::boundingBoxRect):
(WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/mac/WebAccessibilityObjectWrapper.mm:
(createAccessibilityRoleMap):

Source/WebKit/chromium: 

* public/WebAccessibilityRole.h:
* src/AssertMatchingEnums.cpp:

LayoutTests: 

* platform/mac/accessibility/seamless-iframe-expected.txt: Added.
* platform/mac/accessibility/seamless-iframe.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (137961 => 137962)


--- trunk/LayoutTests/ChangeLog	2012-12-18 01:03:54 UTC (rev 137961)
+++ trunk/LayoutTests/ChangeLog	2012-12-18 01:21:55 UTC (rev 137962)
@@ -1,3 +1,13 @@
+2012-12-17  Chris Fleizach  <[email protected]>
+
+        Seamless iframe should not announce a new browsing context
+        https://bugs.webkit.org/show_bug.cgi?id=86317
+
+        Reviewed by Eric Seidel.
+
+        * platform/mac/accessibility/seamless-iframe-expected.txt: Added.
+        * platform/mac/accessibility/seamless-iframe.html: Added.
+
 2012-12-17  KyungTae Kim  <[email protected]>
 
         Percentage width replaced element incorrectly rendered when intrinsic size changed

Added: trunk/LayoutTests/platform/mac/accessibility/seamless-iframe-expected.txt (0 => 137962)


--- trunk/LayoutTests/platform/mac/accessibility/seamless-iframe-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/seamless-iframe-expected.txt	2012-12-18 01:21:55 UTC (rev 137962)
@@ -0,0 +1,13 @@
+
+This tests that seamless iframes do not appear as web areas to accessibility clients
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+PASS group1.childAtIndex(0).role is 'AXRole: AXScrollArea'
+PASS group1.childAtIndex(0).childAtIndex(0).role is 'AXRole: AXGroup'
+PASS group1.childAtIndex(0).childAtIndex(0).childAtIndex(0).role is 'AXRole: AXButton'
+

Added: trunk/LayoutTests/platform/mac/accessibility/seamless-iframe.html (0 => 137962)


--- trunk/LayoutTests/platform/mac/accessibility/seamless-iframe.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/seamless-iframe.html	2012-12-18 01:21:55 UTC (rev 137962)
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+<script>
+    var group1;
+    function runTest() {
+        if (window.accessibilityController) {
+             group1 = accessibilityController.accessibleElementById("group1");
+             shouldBe("group1.childAtIndex(0).role", "'AXRole: AXScrollArea'");
+             shouldBe("group1.childAtIndex(0).childAtIndex(0).role", "'AXRole: AXGroup'");
+             shouldBe("group1.childAtIndex(0).childAtIndex(0).childAtIndex(0).role", "'AXRole: AXButton'");
+        }
+        testRunner.notifyDone();
+    }
+</script>
+</head>
+<body id="body">
+
+<div id="group1" tabindex="0">
+<iframe _onload_="setTimeout('runTest()', 20);" seamless width=100 height=100 srcdoc="<div role='button'>button</div><p>test<p>test2<p>test3<p>test4"></iframe>
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that seamless iframes do not appear as web areas to accessibility clients");
+
+    testRunner.waitUntilDone();
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (137961 => 137962)


--- trunk/Source/WebCore/ChangeLog	2012-12-18 01:03:54 UTC (rev 137961)
+++ trunk/Source/WebCore/ChangeLog	2012-12-18 01:21:55 UTC (rev 137962)
@@ -1,3 +1,31 @@
+2012-12-17  Chris Fleizach  <[email protected]>
+
+        Seamless iframe should not announce a new browsing context
+        https://bugs.webkit.org/show_bug.cgi?id=86317
+
+        Reviewed by Eric Seidel.
+
+        Introduce a new role for seamless frames so that the platforms can decide what to do
+        with this kind of object. For the mac, it's exposed as a group.
+
+        Test: platform/mac/accessibility/seamless-iframe.html
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore):
+        * accessibility/AccessibilityNodeObject.h:
+        (AccessibilityNodeObject):
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::isWebArea):
+        (WebCore::AccessibilityObject::isSeamlessWebArea):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::parentObjectIfExists):
+        (WebCore::AccessibilityRenderObject::parentObject):
+        (WebCore::AccessibilityRenderObject::boundingBoxRect):
+        (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
+        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+        * accessibility/mac/WebAccessibilityObjectWrapper.mm:
+        (createAccessibilityRoleMap):
+
 2012-12-17  KyungTae Kim  <[email protected]>
 
         Percentage width replaced element incorrectly rendered when intrinsic size changed

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (137961 => 137962)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2012-12-18 01:03:54 UTC (rev 137961)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2012-12-18 01:21:55 UTC (rev 137962)
@@ -403,11 +403,6 @@
     return false;
 }
 
-bool AccessibilityNodeObject::isWebArea() const
-{
-    return roleValue() == WebAreaRole;
-}
-
 bool AccessibilityNodeObject::isImageButton() const
 {
     return isNativeImage() && isButton();

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h (137961 => 137962)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h	2012-12-18 01:03:54 UTC (rev 137961)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h	2012-12-18 01:21:55 UTC (rev 137962)
@@ -91,7 +91,6 @@
     virtual bool isProgressIndicator() const;
     virtual bool isSearchField() const;
     virtual bool isSlider() const;
-    virtual bool isWebArea() const;
 
     virtual bool isChecked() const;
     virtual bool isEnabled() const;

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (137961 => 137962)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.h	2012-12-18 01:03:54 UTC (rev 137961)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h	2012-12-18 01:21:55 UTC (rev 137962)
@@ -172,6 +172,7 @@
     RulerMarkerRole,
     ScrollAreaRole,
     ScrollBarRole,
+    SeamlessWebAreaRole,
     SheetRole,
     SliderRole,
     SliderThumbRole,
@@ -377,7 +378,8 @@
     virtual bool isPasswordField() const { return false; }
     virtual bool isNativeTextControl() const { return false; }
     virtual bool isSearchField() const { return false; }
-    virtual bool isWebArea() const { return false; }
+    bool isWebArea() const { return roleValue() == WebAreaRole; }
+    bool isSeamlessWebArea() const { return roleValue() == SeamlessWebAreaRole; }
     virtual bool isCheckbox() const { return roleValue() == CheckBoxRole; }
     virtual bool isRadioButton() const { return roleValue() == RadioButtonRole; }
     virtual bool isListBox() const { return roleValue() == ListBoxRole; }

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (137961 => 137962)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2012-12-18 01:03:54 UTC (rev 137961)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2012-12-18 01:21:55 UTC (rev 137962)
@@ -467,7 +467,7 @@
 AccessibilityObject* AccessibilityRenderObject::parentObjectIfExists() const
 {
     // WebArea's parent should be the scroll view containing it.
-    if (isWebArea())
+    if (isWebArea() || isSeamlessWebArea())
         return axObjectCache()->get(m_renderer->frame()->view());
 
     return axObjectCache()->get(renderParentObject());
@@ -493,7 +493,7 @@
         return axObjectCache()->getOrCreate(parentObj);
     
     // WebArea's parent should be the scroll view containing it.
-    if (isWebArea())
+    if (isWebArea() || isSeamlessWebArea())
         return axObjectCache()->getOrCreate(m_renderer->frame()->view());
     
     return 0;
@@ -786,7 +786,7 @@
     Vector<FloatQuad> quads;
     if (obj->isText())
         toRenderText(obj)->absoluteQuads(quads, 0, RenderText::ClipToEllipsis);
-    else if (isWebArea())
+    else if (isWebArea() || isSeamlessWebArea())
         obj->absoluteQuads(quads);
     else
         obj->absoluteFocusRingQuads(quads);
@@ -800,7 +800,7 @@
 #endif
     
     // The size of the web area should be the content size, not the clipped size.
-    if (isWebArea() && obj->frame()->view())
+    if ((isWebArea() || isSeamlessWebArea()) && obj->frame()->view())
         result.setSize(obj->frame()->view()->contentsSize());
     
     return result;
@@ -1272,7 +1272,7 @@
         // Otherwise fall through; use presence of help text, title, or description to decide.
     }
 
-    if (isWebArea() || m_renderer->isListMarker())
+    if (isWebArea() || isSeamlessWebArea() || m_renderer->isListMarker())
         return false;
     
     // Using the help text, title or accessibility description (so we
@@ -2427,8 +2427,12 @@
     if (node && node->hasTagName(canvasTag))
         return CanvasRole;
 
-    if (cssBox && cssBox->isRenderView())
+    if (cssBox && cssBox->isRenderView()) {
+        // If the iframe is seamless, it should not be announced as a web area to AT clients.
+        if (document() && document()->shouldDisplaySeamlesslyWithParent())
+            return SeamlessWebAreaRole;
         return WebAreaRole;
+    }
     
     if (cssBox && cssBox->isTextField())
         return TextFieldRole;

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm (137961 => 137962)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm	2012-12-18 01:03:54 UTC (rev 137961)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapper.mm	2012-12-18 01:21:55 UTC (rev 137962)
@@ -1585,6 +1585,7 @@
         { ImageMapRole, @"AXImageMap" },
         { ListMarkerRole, @"AXListMarker" },
         { WebAreaRole, @"AXWebArea" },
+        { SeamlessWebAreaRole, NSAccessibilityGroupRole },
         { HeadingRole, @"AXHeading" },
         { ListBoxRole, NSAccessibilityListRole },
         { ListBoxOptionRole, NSAccessibilityStaticTextRole },

Modified: trunk/Source/WebKit/chromium/ChangeLog (137961 => 137962)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-12-18 01:03:54 UTC (rev 137961)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-12-18 01:21:55 UTC (rev 137962)
@@ -1,3 +1,13 @@
+2012-12-17  Chris Fleizach  <[email protected]>
+
+        Seamless iframe should not announce a new browsing context
+        https://bugs.webkit.org/show_bug.cgi?id=86317
+
+        Reviewed by Eric Seidel.
+
+        * public/WebAccessibilityRole.h:
+        * src/AssertMatchingEnums.cpp:
+
 2012-12-17  Levi Weintraub  <[email protected]>
 
         Add support for tracking hit test rectangles to enable fast event rejection in the compositor

Modified: trunk/Source/WebKit/chromium/public/WebAccessibilityRole.h (137961 => 137962)


--- trunk/Source/WebKit/chromium/public/WebAccessibilityRole.h	2012-12-18 01:03:54 UTC (rev 137961)
+++ trunk/Source/WebKit/chromium/public/WebAccessibilityRole.h	2012-12-18 01:21:55 UTC (rev 137962)
@@ -117,6 +117,7 @@
     WebAccessibilityRoleRulerMarker,
     WebAccessibilityRoleScrollArea,
     WebAccessibilityRoleScrollBar,
+    WebAccessibilityRoleSeamlessWebArea,
     WebAccessibilityRoleSheet,
     WebAccessibilityRoleSlider,
     WebAccessibilityRoleSliderThumb,

Modified: trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp (137961 => 137962)


--- trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp	2012-12-18 01:03:54 UTC (rev 137961)
+++ trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp	2012-12-18 01:21:55 UTC (rev 137962)
@@ -212,6 +212,7 @@
 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleListMarker, ListMarkerRole);
 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleMathElement, MathElementRole);
 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleWebArea, WebAreaRole);
+COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleSeamlessWebArea, SeamlessWebAreaRole);
 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleHeading, HeadingRole);
 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleListBox, ListBoxRole);
 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleListBoxOption, ListBoxOptionRole);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to