[GTK] REGRESSION(r243860): Many tests failing
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Apr 2019 08:46:57 +0000 (08:46 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Apr 2019 08:46:57 +0000 (08:46 +0000)
commitc70ae6d7438f3be79763d6d3e76fcc8d547bf62b
tree6a5aa3f63f4a4cae2d1ddb16e251b6589d4e385f
parent715c6489d5d4915179444d0b7a4efcbadf26f998
[GTK] REGRESSION(r243860): Many tests failing
https://bugs.webkit.org/show_bug.cgi?id=196791

Reviewed by Joanmarie Diggs.

Source/WebKit:

Calling updateAccessibilityTree() on document loaded was causing a re-layout because of the backing store update
that confused all those tests. We shouldn't need to update the accessibility tree on document load, it should
happen automatically when root object is attached/detached. This patch emits children-changed::add when the root
object wrapper is attached and children-changed::remove when the root object is detached. That way ATs are
notified of the changes in the accessibility tree.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad): Remove call to WebPage::updateAccessibilityTree().
* WebProcess/WebPage/WebPage.h: Remove updateAccessibilityTree().
* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp:
(coreRootObjectWrapperDetachedCallback): Emit children-changed::remove.
(rootWebAreaWrapper): Helper to get the root WebArea wrapper.
(accessibilityRootObjectWrapper): Set the parent here when root object is created and emit children-changed::add.
(webkitWebPageAccessibilityObjectRefChild): Dot no set the parent here, it's now set when the root object is created.
* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h: Remove webkitWebPageAccessibilityObjectRefresh().
* WebProcess/WebPage/gtk/WebPageGtk.cpp:

Tools:

Rework the accessibility unit test to use DBus for the communication with the server. This way we can load
multiple documents and check that accessibility hierarchy is updated after a navigation.

* TestWebKitAPI/Tests/WebKitGtk/AccessibilityTestServer.cpp:
(loadChangedCallback):
* TestWebKitAPI/Tests/WebKitGtk/TestWebKitAccessibility.cpp:
(AccessibilityTest::AccessibilityTest):
(AccessibilityTest::~AccessibilityTest):
(AccessibilityTest::loadHTMLAndWaitUntilFinished):
(AccessibilityTest::findTestServerApplication):
(AccessibilityTest::findDocumentWeb):
(AccessibilityTest::findRootObject):
(AccessibilityTest::waitUntilChildrenRemoved):
(AccessibilityTest::ensureProxy):
(testAtspiBasicHierarchy):
(beforeAll):
(afterAll):

LayoutTests:

Remove expectations for tests that pass now.

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/gtk/TestExpectations
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp
Source/WebKit/WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h
Source/WebKit/WebProcess/WebPage/gtk/WebPageGtk.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitGtk/AccessibilityTestServer.cpp
Tools/TestWebKitAPI/Tests/WebKitGtk/TestWebKitAccessibility.cpp