⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 287872 in webkit


Ignore:
Timestamp:
Jan 11, 2022, 12:53:55 AM (5 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK][a11y] WTR: do not immediately process main thread events while waiting for ax thread task
https://bugs.webkit.org/show_bug.cgi?id=234950

Reviewed by Adrian Perez de Castro.

Source/WebCore:

Run a layout before creating the isolated tree to ensure we get an updated tree after ignored is computed.

  • accessibility/isolatedtree/AXIsolatedTree.cpp:

(WebCore::AXIsolatedTree::create):

Tools:

We want to process the main thread events while waiting for ax thread to avoid blocking in case the ax thread
needs to get any value from the main thread. This might have side effects causing things to happen earlier than
expected. This patch only process main thread events after 125 milliseconds waiting for the ax thread, because
that probably means the ax thread is waiting for the main thread. This made most of the test to pass in isolated
tree mode with ATSPI.

  • WebKitTestRunner/InjectedBundle/atspi/AccessibilityControllerAtspi.cpp:

(WTR::AccessibilityController::executeOnAXThreadAndWait):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r287871 r287872  
     12022-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][a11y] WTR: do not immediately process main thread events while waiting for ax thread task
     4        https://bugs.webkit.org/show_bug.cgi?id=234950
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        Run a layout before creating the isolated tree to ensure we get an updated tree after ignored is computed.
     9
     10        * accessibility/isolatedtree/AXIsolatedTree.cpp:
     11        (WebCore::AXIsolatedTree::create):
     12
    1132022-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
    214
  • trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp

    r287533 r287872  
    9898    auto tree = adoptRef(*new AXIsolatedTree(axObjectCache));
    9999
     100    auto& document = axObjectCache->document();
     101    if (!document.view()->layoutContext().isInRenderTreeLayout() && !document.inRenderTreeUpdate() && !document.inStyleRecalc())
     102        document.updateLayoutIgnorePendingStylesheets();
     103
    100104    // Generate the nodes of the tree and set its root and focused objects.
    101105    // For this, we need the root and focused objects of the AXObject tree.
  • trunk/Tools/ChangeLog

    r287871 r287872  
     12022-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][a11y] WTR: do not immediately process main thread events while waiting for ax thread task
     4        https://bugs.webkit.org/show_bug.cgi?id=234950
     5
     6        Reviewed by Adrian Perez de Castro.
     7
     8        We want to process the main thread events while waiting for ax thread to avoid blocking in case the ax thread
     9        needs to get any value from the main thread. This might have side effects causing things to happen earlier than
     10        expected. This patch only process main thread events after 125 milliseconds waiting for the ax thread, because
     11        that probably means the ax thread is waiting for the main thread. This made most of the test to pass in isolated
     12        tree mode with ATSPI.
     13
     14        * WebKitTestRunner/InjectedBundle/atspi/AccessibilityControllerAtspi.cpp:
     15        (WTR::AccessibilityController::executeOnAXThreadAndWait):
     16
    1172022-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
    218
  • trunk/Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityControllerAtspi.cpp

    r287389 r287872  
    153153        done.store(true);
    154154    });
    155     while (!done.load())
    156         g_main_context_iteration(nullptr, FALSE);
     155    auto now = MonotonicTime::now();
     156    while (!done.load()) {
     157        if (MonotonicTime::now() - now >= 125_ms)
     158            g_main_context_iteration(nullptr, FALSE);
     159    }
    157160}
    158161
Note: See TracChangeset for help on using the changeset viewer.