[webkit-changes] [WebKit/WebKit] 8c357c: AX: AccessibilityNodeObject::determineAccessibilit...

AndresGonzalezApple noreply at github.com
Tue Mar 12 14:56:25 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 8c357cd24a0e0e181d09dadd6f08fbb8fc93aa86
      https://github.com/WebKit/WebKit/commit/8c357cd24a0e0e181d09dadd6f08fbb8fc93aa86
  Author: Andres Gonzalez <andresg_22 at apple.com>
  Date:   2024-03-12 (Tue, 12 Mar 2024)

  Changed paths:
    M Source/WebCore/accessibility/AccessibilityNodeObject.cpp

  Log Message:
  -----------
  AX: AccessibilityNodeObject::determineAccessibilityRoleFromNode makes many unnecessary dynamicDowncasts.
https://bugs.webkit.org/show_bug.cgi?id=270854
<rdar://problem/124455559>

Reviewed by Tyler Wilcock.

This is a hot method in ITM that calls many times Node::hasTagName(const HTMLQualifiedName&), which in turn dynamicDowncasts the Node to an HTMLElement. This patch reduces the number of dynamicDowncasts significantly by downcasting to an HTMLElement upfront and calling HTMLElement::hasTagName directly instead. In a run of LayoutTests/accessibility, the number of downcasts drops by 1978248 or 13% of the original number.

* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::determineAccessibilityRoleFromNode const):

Canonical link: https://commits.webkit.org/276000@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list