| Summary: | AX: Stop unnecessarily caching AXPropertyName::{LayoutCount, PressedIsPresent, DropEffects, ClickPoint, ClassList} | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Tyler Wilcock <tyler_w> | ||||||
| Component: | Accessibility | Assignee: | Tyler Wilcock <tyler_w> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Tyler Wilcock
2022-09-02 18:30:18 PDT
Created attachment 462108 [details]
Patch
Comment on attachment 462108 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=462108&action=review > Source/WebCore/accessibility/AccessibilityObject.cpp:3150 > + for (unsigned k = 0; k < domClassList.length(); k++) Can we put length outside the loop to reduce number of times it is called > Source/WebCore/accessibility/AccessibilityObject.cpp:3151 > + classList.append(domClassList.item(k).string()); Is there some existing map function that does this? Created attachment 462111 [details]
Patch
(In reply to chris fleizach from comment #3) > Comment on attachment 462108 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=462108&action=review > > > Source/WebCore/accessibility/AccessibilityObject.cpp:3150 > > + for (unsigned k = 0; k < domClassList.length(); k++) > > Can we put length outside the loop to reduce number of times it is called Fixed. > > Source/WebCore/accessibility/AccessibilityObject.cpp:3151 > > + classList.append(domClassList.item(k).string()); > > Is there some existing map function that does this? Unfortunately no. This is a DOMTokenList class rather than a Vector, and it doesn't have a map function. Committed 254130@main (1ee82a09fde8): <https://commits.webkit.org/254130@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 462111 [details]. |