[webkit-reviews] review granted: [Bug 270854] AX: AccessibilityNodeObject::determineAccessibilityRoleFromNode makes many unnecessary dynamicDowncasts. : [Attachment 470321] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 12 10:00:00 PDT 2024


Tyler Wilcock <tyler_w at apple.com> has granted Andres Gonzalez
<andresg_22 at apple.com>'s request for review:
Bug 270854: AX: AccessibilityNodeObject::determineAccessibilityRoleFromNode
makes many unnecessary dynamicDowncasts.
https://bugs.webkit.org/show_bug.cgi?id=270854

Attachment 470321: Patch

https://bugs.webkit.org/attachment.cgi?id=470321&action=review




--- Comment #3 from Tyler Wilcock <tyler_w at apple.com> ---
Comment on attachment 470321
  --> https://bugs.webkit.org/attachment.cgi?id=470321
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=470321&action=review

r+ with passing EWS!

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:411
> +    if (is<HTMLLabelElement>(element.get()))

I think dereferencing *element here would save a nullcheck.

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:461
> +    if (RefPtr summaryElement =
dynamicDowncast<HTMLSummaryElement>(element.get()); summaryElement &&
summaryElement->isActiveSummary())

I think dereferencing *element here would save a null check.

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:477
> +    if (is<HTMLVideoElement>(element.get()))
>	   return AccessibilityRole::Video;
> -    if (is<HTMLAudioElement>(node.get()))
> +    if (is<HTMLAudioElement>(element.get()))

I think dereferencing *element here would save a null check.


More information about the webkit-reviews mailing list