Closed varumugam123 closed 5 months ago
As an information, I tried two things, 1) Removed the renderer() check in Element::focus() as below, this change fixes the issue
@@ -2985,7 +2975,10 @@ void Element::focus(bool restorePreviousSelection, FocusDirection direction)
} RefPtr<Element> newTarget = this;
-
- // If we don't have renderer yet, isFocusable will compute it without style update.
- // FIXME: Expand it to avoid style update in all cases.
- if (renderer() && document->haveStylesheetsLoaded())
+ if (document->haveStylesheetsLoaded())
document->updateStyleIfNeeded();
if (&newTarget->document() != document.ptr())
@@ -3290,7 +3283,7 @@ const RenderStyle* Element::renderOrDisplayContentsStyle() const
return nullptr;
}
2) Defer handling of UI element (by the time the handler is invoked renderer is created & attached to the element). WebKitAccessible is created with a renderer.
@@ -1366,9 +1381,9 @@ void AXObjectCache::handleRowCountChanged(AXCoreObject* axObject, Document* docu void AXObjectCache::deferFocusedUIElementChangeIfNeeded(Node* oldNode, Node* newNode)
{
- if (nodeAndRendererAreValid(newNode) && rendererNeedsDeferredUpdate(*newNode->renderer())) {
+ if (!newNode->renderer() || (nodeAndRendererAreValid(newNode) && rendererNeedsDeferredUpdate(*newNode->renderer()))) {
m_deferredFocusedNodeChange.append({ oldNode, newNode });
- if (!newNode->renderer()->needsLayout() && !m_performCacheUpdateTimer.isActive())
+ if ((newNode->renderer() ? !newNode->renderer()->needsLayout() : true) && !m_performCacheUpdateTimer.isActive())
m_performCacheUpdateTimer.startOneShot(0_s);
} else
handleFocusedUIElementChanged(oldNode, newNode);
Since the issue is actually in WebKit & AXObjectCache irrespective of whether one uses atspi / atk implementation this issue should be observable
@varumugam123 : can you check does commit : https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/0b154529033960d5dc69d702af0b164ec008460a solve your problem?
@varumugam123 : did you have a chance to verify the commit which I provided?
@varumugam123 @emutavchi , do we have any feedback for this proposal?
Hi @modeveci , @pgorszkowski-igalia Thanks for checking this issue, I haven't had a chance to try the commit mentioned yet.
Let me try that tomorrow and update.
@modeveci , @pgorszkowski-igalia I tried the commit, but the issue remains.
The fix is in upstream and waiting for review: https://github.com/WebKit/WebKit/pull/25479. After merge I will backport it to 2.38
@varumugam123 , @emutavchi : the PR from upstream is merged. I backported that PR to 2.38: https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/e02059bbd17bcea2b1001cfc5c72038d6d57fdcb Please verify does it solve your problem and then we can merge it with wpe-2.38 branch. Thanks
Hi @pgorszkowski-igalia, I tried the commit mentioned in the previous comment, the functionality works fine. The change fixes the issue.
@varumugam123 : many thanks for your verification, I will merge it in wpe-2.38.
It is merged also to 2.42: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/1306
Version : wpe-2.38 (39d3d180b219aba9fb12e289c0cadfcbf8c6ef7f) Problem : We use our custom Assistive Technology implementation that relies on WebCore/accessibility/atk implementation and installs hooks like this to get notified on focus change event
With this we observe that atk_object_get_name returns an empty string. This behavior is observed with wpe-2.38 only. With wpe-2.28 the same API (and Assistive Technology implementation), valid values are returned.
Sample app that reproduces the issue : issue-with-focus-change.html.txt
Analysis:
Some logs that outline the issue