Skip to content

Commit

Permalink
Fix issue where iframe content wasn't included in the accessibility tree
Browse files Browse the repository at this point in the history
Fix issue where iframe content wasn't included in the accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=117456

Reviewed by Chris Fleizach.

Merge - https://chromium.googlesource.com/chromium/blink/+/af4e73e2bfb32fce56854ef0dab33077c7fa6bff

Have RenderWidget notify the accessibility object when its widget changes, otherwise the
AccessibilityRenderObject for the iframe might have a stale reference to the previous widget. (This
would not crash, it would just result in an empty subtree until some other event triggered it to
update.)

This allows us to re-enable this test, that was previously failing flakily or being skipped because
of this bug: loading-iframe-updates-axtree.html

* Source/WebCore/rendering/RenderWidget.cpp:
(WebCore::RenderWidget::setWidget): Update to add stale condition
* LayoutTests/platform/win/TestExpectations: Remove Skipped Test "loading-iframe-updates-axtree.html"
* LayoutTests/platform/wincairo-wk1/TestExpectations: Remove Skipped Test "loading-iframe-updates-axtree.html"
* LayoutTests/platform/wk2/TestExpectations: Remove Skipped Test "loading-iframe-updates-axtree.html"
* LayoutTests/platform/mac/accessibility/loading-iframe-updates-axtree-expected.txt: Add Platform Specific Test Expectations
* LayoutTests/accessibility/loading-iframe-updates-axtree-expected.txt: Update Test Expectations

Canonical link: https://commits.webkit.org/255407@main
  • Loading branch information
Ahmad-S792 authored and Ahmad Saleem committed Oct 11, 2022
1 parent fc01491 commit 0efc0bf
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
Expand Up @@ -11,9 +11,10 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE


iframe.isEqual(newIframe): true
scrollarea.isEqual(newScrollarea): false
scrollarea.isEqual(newScrollarea): true
subwebarea.isEqual(newSubwebarea): false
PASS newSubwebarea.childrenCount > 0 is true
PASS successfullyParsed is true

TEST COMPLETE

@@ -0,0 +1,20 @@
Before


After

End of test

This tests that if an iframe loads new content after its accessibility object has already been accessed, the iframe accessibility object's descendants are the new scroll area and web area, not the old deleted ones.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


iframe.isEqual(newIframe): true
scrollarea.isEqual(newScrollarea): false
subwebarea.isEqual(newSubwebarea): false
PASS newSubwebarea.childrenCount > 0 is true
PASS successfullyParsed is true

TEST COMPLETE

1 change: 0 additions & 1 deletion LayoutTests/platform/win/TestExpectations
Expand Up @@ -1805,7 +1805,6 @@ webkit.org/b/193371 accessibility/set-selected-editable.html [ Skip ]
webkit.org/b/140798 accessibility/aria-expanded-supported-roles.html [ Skip ]

# The following timeouts are caused by the same problem: [ Failure ]
webkit.org/b/126066 accessibility/loading-iframe-updates-axtree.html [ Skip ]
webkit.org/b/140798 accessibility/aria-hidden-false-works-in-subtrees.html [ Skip ]

# The following fail because of missing numerical output support.
Expand Down
2 changes: 0 additions & 2 deletions LayoutTests/platform/wincairo-wk1/TestExpectations
Expand Up @@ -98,8 +98,6 @@ webkit.org/b/140798 accessibility/textarea-insertion-point-line-number.html [ Fa
webkit.org/b/140798 accessibility/th-as-title-ui.html [ Failure ]
webkit.org/b/140798 accessibility/title-ui-element-correctness.html [ Failure ]

webkit.org/b/126066 accessibility/loading-iframe-updates-axtree.html [ Failure ]

webkit.org/b/140798 [ Debug ] accessibility/aria-hidden-false-works-in-subtrees.html [ Skip ]

# The following fail because of missing numerical output support.
Expand Down
3 changes: 0 additions & 3 deletions LayoutTests/platform/wk2/TestExpectations
Expand Up @@ -45,9 +45,6 @@
webkit.org/b/156612 http/tests/security/contentSecurityPolicy/embed-redirect-blocked3.html [ Failure ]
webkit.org/b/156612 http/tests/security/contentSecurityPolicy/object-redirect-blocked3.html [ Failure ]

# AX tests that require hit testing do not work in WK2.
webkit.org/b/71298 accessibility/loading-iframe-updates-axtree.html

# This test has been skipped for a long time. Temporarily marking as flaky to see what bots think.
webkit.org/b/48354 compositing/iframes/iframe-src-change.html [ Pass Failure ]

Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/rendering/RenderWidget.cpp
Expand Up @@ -207,6 +207,9 @@ void RenderWidget::setWidget(RefPtr<Widget>&& widget)
}
moveWidgetToParentSoon(*m_widget, &view().frameView());
}

if (auto* cache = document().existingAXObjectCache())
cache->childrenChanged(this);
}

void RenderWidget::layout()
Expand Down

0 comments on commit 0efc0bf

Please sign in to comment.