Title: [285558] branches/safari-612-branch
Revision
285558
Author
alanc...@apple.com
Date
2021-11-09 19:29:06 -0800 (Tue, 09 Nov 2021)

Log Message

Cherry-pick r285389. rdar://problem/84380291

    Integrator's note: excluded changes to Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm.

    AX: WebKit1 PluginViewBase objects with an associated widget()->platformWidget() should be considered attachments
    https://bugs.webkit.org/show_bug.cgi?id=232759

    Patch by Tyler Wilcock <tyle...@apple.com> on 2021-11-06
    Reviewed by Chris Fleizach.

    Source/WebCore:

    In https://bugs.webkit.org/show_bug.cgi?id=229556 (AX: Make PDFs
    loaded via <embed> accessible), we changed AccessibilityRenderObject::isAttachment
    to return false if the underlying object represented a PluginViewBase
    under the assumption that if a PluginViewBase existed, the object must
    be a WebKit2 plugin. That assumption is wrong, because in certain
    scenarios an object can be a WebKit1 PluginViewBase (e.g. attachments
    inserted by WebKit1 webviews).

    This patch changes isAttachment to only return false if the
    PluginViewBase doesn't also have an associated platformWidget, which
    should be present in WebKit1 only.

    This patch also fixes a bug in the Mac -[WebAccessibilityObjectWrapper
    subrole]. For objects with a role of group and no children, we
    returned a subrole of AXEmptyGroup. However, we didn't check for the
    presence of renderWidgetChildren that a group may have.

    * accessibility/AccessibilityRenderObject.cpp:
    (WebCore::AccessibilityRenderObject::isAttachment const):
    Consider PluginViewBase objects with an associated platformWidget to
    be attachments.
    * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
    (-[WebAccessibilityObjectWrapper subrole]):
    Don't return AXEmptyGroup subrole for objects with
    renderWidgetChildren.

    LayoutTests:

    This patch changes the Mac WebAccessibilityObjectWrapper to not return
    an AXEmptyGroup subrole for objects with renderWidgetChildren.

    * accessibility/mac/basic-embed-pdf-accessibility-expected.txt:
    * accessibility/mac/basic-embed-pdf-accessibility.html:
    Add expectation that the embed container doesn't have an AXEmptyGroup
    subrole.

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

Modified Paths

Diff

Modified: branches/safari-612-branch/LayoutTests/ChangeLog (285557 => 285558)


--- branches/safari-612-branch/LayoutTests/ChangeLog	2021-11-10 03:29:02 UTC (rev 285557)
+++ branches/safari-612-branch/LayoutTests/ChangeLog	2021-11-10 03:29:06 UTC (rev 285558)
@@ -1,5 +1,72 @@
 2021-11-09  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r285389. rdar://problem/84380291
+
+    Integrator's note: excluded changes to Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm.
+    
+    AX: WebKit1 PluginViewBase objects with an associated widget()->platformWidget() should be considered attachments
+    https://bugs.webkit.org/show_bug.cgi?id=232759
+    
+    Patch by Tyler Wilcock <tyle...@apple.com> on 2021-11-06
+    Reviewed by Chris Fleizach.
+    
+    Source/WebCore:
+    
+    In https://bugs.webkit.org/show_bug.cgi?id=229556 (AX: Make PDFs
+    loaded via <embed> accessible), we changed AccessibilityRenderObject::isAttachment
+    to return false if the underlying object represented a PluginViewBase
+    under the assumption that if a PluginViewBase existed, the object must
+    be a WebKit2 plugin. That assumption is wrong, because in certain
+    scenarios an object can be a WebKit1 PluginViewBase (e.g. attachments
+    inserted by WebKit1 webviews).
+    
+    This patch changes isAttachment to only return false if the
+    PluginViewBase doesn't also have an associated platformWidget, which
+    should be present in WebKit1 only.
+    
+    This patch also fixes a bug in the Mac -[WebAccessibilityObjectWrapper
+    subrole]. For objects with a role of group and no children, we
+    returned a subrole of AXEmptyGroup. However, we didn't check for the
+    presence of renderWidgetChildren that a group may have.
+    
+    * accessibility/AccessibilityRenderObject.cpp:
+    (WebCore::AccessibilityRenderObject::isAttachment const):
+    Consider PluginViewBase objects with an associated platformWidget to
+    be attachments.
+    * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+    (-[WebAccessibilityObjectWrapper subrole]):
+    Don't return AXEmptyGroup subrole for objects with
+    renderWidgetChildren.
+    
+    LayoutTests:
+    
+    This patch changes the Mac WebAccessibilityObjectWrapper to not return
+    an AXEmptyGroup subrole for objects with renderWidgetChildren.
+    
+    * accessibility/mac/basic-embed-pdf-accessibility-expected.txt:
+    * accessibility/mac/basic-embed-pdf-accessibility.html:
+    Add expectation that the embed container doesn't have an AXEmptyGroup
+    subrole.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-11-06  Tyler Wilcock  <tyle...@apple.com>
+
+            AX: WebKit1 PluginViewBase objects with an associated widget()->platformWidget() should be considered attachments
+            https://bugs.webkit.org/show_bug.cgi?id=232759
+
+            Reviewed by Chris Fleizach.
+
+            This patch changes the Mac WebAccessibilityObjectWrapper to not return
+            an AXEmptyGroup subrole for objects with renderWidgetChildren.
+
+            * accessibility/mac/basic-embed-pdf-accessibility-expected.txt:
+            * accessibility/mac/basic-embed-pdf-accessibility.html:
+            Add expectation that the embed container doesn't have an AXEmptyGroup
+            subrole.
+
+2021-11-09  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r285169. rdar://problem/83950623
 
     AX: WebKit needs to include NSAccessibilityChildrenInNavigationOrderAttribute in accessibilityAttributeNames

Modified: branches/safari-612-branch/LayoutTests/accessibility/mac/basic-embed-pdf-accessibility-expected.txt (285557 => 285558)


--- branches/safari-612-branch/LayoutTests/accessibility/mac/basic-embed-pdf-accessibility-expected.txt	2021-11-10 03:29:02 UTC (rev 285557)
+++ branches/safari-612-branch/LayoutTests/accessibility/mac/basic-embed-pdf-accessibility-expected.txt	2021-11-10 03:29:06 UTC (rev 285558)
@@ -5,6 +5,7 @@
 
 PASS pdfEmbedElement.domIdentifier is 'pdfEmbed'
 PASS pdfEmbedElement.role is 'AXRole: AXGroup'
+PASS pdfEmbedElement.subrole is 'AXSubrole: '
 PASS pdfEmbedElement.childrenCount is 1
 PASS pdfAxObject.stringAttributeValue('AXSubrole') is 'AXPDFPluginSubrole'
 PASS pdfAxObject.childrenCount is 1

Modified: branches/safari-612-branch/LayoutTests/accessibility/mac/basic-embed-pdf-accessibility.html (285557 => 285558)


--- branches/safari-612-branch/LayoutTests/accessibility/mac/basic-embed-pdf-accessibility.html	2021-11-10 03:29:02 UTC (rev 285557)
+++ branches/safari-612-branch/LayoutTests/accessibility/mac/basic-embed-pdf-accessibility.html	2021-11-10 03:29:06 UTC (rev 285558)
@@ -51,6 +51,8 @@
 
             shouldBe("pdfEmbedElement.domIdentifier", "'pdfEmbed'");
             shouldBe("pdfEmbedElement.role", "'AXRole: AXGroup'");
+            // Verify the group that contains the PDF AX object isn't considered empty via an AXEmptyGroup subrole.
+            shouldBe("pdfEmbedElement.subrole", "'AXSubrole: '");
             shouldBe("pdfEmbedElement.childrenCount", "1");
 
             shouldBe("pdfAxObject.stringAttributeValue('AXSubrole')", "'AXPDFPluginSubrole'");

Modified: branches/safari-612-branch/Source/WebCore/ChangeLog (285557 => 285558)


--- branches/safari-612-branch/Source/WebCore/ChangeLog	2021-11-10 03:29:02 UTC (rev 285557)
+++ branches/safari-612-branch/Source/WebCore/ChangeLog	2021-11-10 03:29:06 UTC (rev 285558)
@@ -1,5 +1,90 @@
 2021-11-09  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r285389. rdar://problem/84380291
+
+    Integrator's note: excluded changes to Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm.
+    
+    AX: WebKit1 PluginViewBase objects with an associated widget()->platformWidget() should be considered attachments
+    https://bugs.webkit.org/show_bug.cgi?id=232759
+    
+    Patch by Tyler Wilcock <tyle...@apple.com> on 2021-11-06
+    Reviewed by Chris Fleizach.
+    
+    Source/WebCore:
+    
+    In https://bugs.webkit.org/show_bug.cgi?id=229556 (AX: Make PDFs
+    loaded via <embed> accessible), we changed AccessibilityRenderObject::isAttachment
+    to return false if the underlying object represented a PluginViewBase
+    under the assumption that if a PluginViewBase existed, the object must
+    be a WebKit2 plugin. That assumption is wrong, because in certain
+    scenarios an object can be a WebKit1 PluginViewBase (e.g. attachments
+    inserted by WebKit1 webviews).
+    
+    This patch changes isAttachment to only return false if the
+    PluginViewBase doesn't also have an associated platformWidget, which
+    should be present in WebKit1 only.
+    
+    This patch also fixes a bug in the Mac -[WebAccessibilityObjectWrapper
+    subrole]. For objects with a role of group and no children, we
+    returned a subrole of AXEmptyGroup. However, we didn't check for the
+    presence of renderWidgetChildren that a group may have.
+    
+    * accessibility/AccessibilityRenderObject.cpp:
+    (WebCore::AccessibilityRenderObject::isAttachment const):
+    Consider PluginViewBase objects with an associated platformWidget to
+    be attachments.
+    * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+    (-[WebAccessibilityObjectWrapper subrole]):
+    Don't return AXEmptyGroup subrole for objects with
+    renderWidgetChildren.
+    
+    LayoutTests:
+    
+    This patch changes the Mac WebAccessibilityObjectWrapper to not return
+    an AXEmptyGroup subrole for objects with renderWidgetChildren.
+    
+    * accessibility/mac/basic-embed-pdf-accessibility-expected.txt:
+    * accessibility/mac/basic-embed-pdf-accessibility.html:
+    Add expectation that the embed container doesn't have an AXEmptyGroup
+    subrole.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-11-06  Tyler Wilcock  <tyle...@apple.com>
+
+            AX: WebKit1 PluginViewBase objects with an associated widget()->platformWidget() should be considered attachments
+            https://bugs.webkit.org/show_bug.cgi?id=232759
+
+            Reviewed by Chris Fleizach.
+
+            In https://bugs.webkit.org/show_bug.cgi?id=229556 (AX: Make PDFs
+            loaded via <embed> accessible), we changed AccessibilityRenderObject::isAttachment
+            to return false if the underlying object represented a PluginViewBase
+            under the assumption that if a PluginViewBase existed, the object must
+            be a WebKit2 plugin. That assumption is wrong, because in certain
+            scenarios an object can be a WebKit1 PluginViewBase (e.g. attachments
+            inserted by WebKit1 webviews).
+
+            This patch changes isAttachment to only return false if the
+            PluginViewBase doesn't also have an associated platformWidget, which
+            should be present in WebKit1 only.
+
+            This patch also fixes a bug in the Mac -[WebAccessibilityObjectWrapper
+            subrole]. For objects with a role of group and no children, we
+            returned a subrole of AXEmptyGroup. However, we didn't check for the
+            presence of renderWidgetChildren that a group may have.
+
+            * accessibility/AccessibilityRenderObject.cpp:
+            (WebCore::AccessibilityRenderObject::isAttachment const):
+            Consider PluginViewBase objects with an associated platformWidget to
+            be attachments.
+            * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+            (-[WebAccessibilityObjectWrapper subrole]):
+            Don't return AXEmptyGroup subrole for objects with
+            renderWidgetChildren.
+
+2021-11-09  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r285318. rdar://problem/85168068
 
     [Cocoa] Migrate from CTFontCopyVariationAxes() to CTFontCopyVariationAxesInternal() if possible

Modified: branches/safari-612-branch/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (285557 => 285558)


--- branches/safari-612-branch/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2021-11-10 03:29:02 UTC (rev 285557)
+++ branches/safari-612-branch/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2021-11-10 03:29:06 UTC (rev 285558)
@@ -533,8 +533,9 @@
     if (!renderer)
         return false;
 
-    // Although plugins are also a type of widget, we need to treat them differently than attachments.
-    if (is<PluginViewBase>(widget()))
+    // WebKit2 plugins need to be treated differently than attachments, so return false here.
+    // Only WebKit1 plugins have an associated platformWidget.
+    if (is<PluginViewBase>(widget()) && !widget()->platformWidget())
         return false;
 
     // Widgets are the replaced elements that we represent to AX as attachments
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to