RESOLVED FIXED 255051
AX: Fix for crash in AXIsolatedObject::textMarkerRange()
https://bugs.webkit.org/show_bug.cgi?id=255051
Summary AX: Fix for crash in AXIsolatedObject::textMarkerRange()
Andres Gonzalez
Reported 2023-04-05 14:07:37 PDT
(lldb) bt * thread #14, name = 'WKTR: AccessibilityController', stop reason = EXC_BAD_ACCESS (code=1, address=0xbbadbeef) * frame #0: 0x00000001339cbdc0 JavaScriptCore`::WTFCrash() at Assertions.cpp:327:35 frame #1: 0x0000000149fb23a4 WebCore`WTFCrashWithInfo((null)=536, (null)="/Users/ag/s/web/OpenSource/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h", (null)="auto WebCore::AXIsolatedObject::propertyValue(WebCore::AXPropertyName)::(anonymous class)::operator()(auto &) const [auto:1 = std::nullptr_t]", (null)=1046) at Assertions.h:758:5 frame #2: 0x0000000149eaf958 WebCore`auto WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(this=0x00000002a01a48df, (null)=0x00000002a01a4950) const::'lambda'(WTF::RetainPtr<NSAttributedString>&)::operator()<std::nullptr_t>(WTF::RetainPtr<NSAttributedString>&) const at AXIsolatedObject.h:536:22 frame #3: 0x0000000149eaf8e8 WebCore`decltype(__f=0x00000002a01a48df, __args=0x00000002a01a4950)(std::declval<std::nullptr_t&>())) std::__1::__invoke[abi:v160000]<WTF::Visitor<WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&), WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&)>, std::nullptr_t&>(WTF::RetainPtr<NSAttributedString>&&, std::nullptr_t&) at invoke.h:394:23 frame #4: 0x0000000149eaf8ac WebCore`decltype(this=0x00000002a01a4870, __alts=0x00000002a01a4950) std::__1::__variant_detail::__visitation::__variant::__value_visitor<WTF::Visitor<WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&), WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&)> >::operator()[abi:v160000]<std::__1::__variant_detail::__alt<0ul, std::nullptr_t>&>(std::__1::__variant_detail::__alt<0ul, std::nullptr_t>&) const at variant:689:14 frame #5: 0x0000000149eaf860 WebCore`decltype(__f=0x00000002a01a4870, __args=0x00000002a01a4950)(std::declval<std::__1::__variant_detail::__alt<0ul, std::nullptr_t>&>())) std::__1::__invoke[abi:v160000]<std::__1::__variant_detail::__visitation::__variant::__value_visitor<WTF::Visitor<WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&), WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&)> >, std::__1::__variant_detail::__alt<0ul, std::nullptr_t>&>(WTF::RetainPtr<NSAttributedString>&&, std::__1::__variant_detail::__alt<0ul, std::nullptr_t>&) at invoke.h:394:23 frame #6: 0x0000000149eaf120 WebCore`decltype(__f=0x00000002a01a4870, __vs=0x00000002a01a4950) std::__1::__variant_detail::__visitation::__base::__dispatcher<0ul>::__dispatch[abi:v160000]<std::__1::__variant_detail::__visitation::__variant::__value_visitor<WTF::Visitor<WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&), WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&)> >&&, std::__1::__variant_detail::__base<(std::__1::__variant_detail::_Trait)1, std::nullptr_t, WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::String, bool, int, unsigned int, double, float, unsigned long long, WebCore::AccessibilityButtonState, WebCore::Color, WTF::URL, WebCore::LayoutRect, WebCore::FloatRect, PAL::SessionID, WebCore::IntPoint, std::__1::pair<unsigned int, unsigned int>, WTF::Vector<WebCore::AccessibilityText, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::ObjectIdentifier<WebCore::AXIDType>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<std::__1::pair<WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::ObjectIdentifier<WebCore::AXIDType> >, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::String, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WebCore::Path, WTF::OptionSet<WebCore::AXAncestorFlag>, WTF::RetainPtr<NSAttributedString> >&>(WTF::RetainPtr<NSAttributedString>, std::__1::__variant_detail::__base<(std::__1::__variant_detail::_Trait)1, std::nullptr_t, WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::String, bool, int, unsigned int, double, float, unsigned long long, WebCore::AccessibilityButtonState, WebCore::Color, WTF::URL, WebCore::LayoutRect, WebCore::FloatRect, PAL::SessionID, WebCore::IntPoint, std::__1::pair<unsigned int, unsigned int>, WTF::Vector<WebCore::AccessibilityText, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::ObjectIdentifier<WebCore::AXIDType>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<std::__1::pair<WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::ObjectIdentifier<WebCore::AXIDType> >, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::String, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WebCore::Path, WTF::OptionSet<WebCore::AXAncestorFlag>, WTF::RetainPtr<NSAttributedString> >&) at variant:569:16 frame #7: 0x0000000149eaf0d0 WebCore`decltype(__visitor=0x00000002a01a4870, __vs=0x00000002a01a4950) std::__1::__variant_detail::__visitation::__base::__visit_alt[abi:v160000]<std::__1::__variant_detail::__visitation::__variant::__value_visitor<WTF::Visitor<WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&), WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&)> >, std::__1::__variant_detail::__impl<std::nullptr_t, WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::String, bool, int, unsigned int, double, float, unsigned long long, WebCore::AccessibilityButtonState, WebCore::Color, WTF::URL, WebCore::LayoutRect, WebCore::FloatRect, PAL::SessionID, WebCore::IntPoint, std::__1::pair<unsigned int, unsigned int>, WTF::Vector<WebCore::AccessibilityText, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::ObjectIdentifier<WebCore::AXIDType>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<std::__1::pair<WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::ObjectIdentifier<WebCore::AXIDType> >, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::String, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WebCore::Path, WTF::OptionSet<WebCore::AXAncestorFlag>, WTF::RetainPtr<NSAttributedString> >&>(WTF::RetainPtr<NSAttributedString>&&, std::__1::__variant_detail::__impl<std::nullptr_t, WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::String, bool, int, unsigned int, double, float, unsigned long long, WebCore::AccessibilityButtonState, WebCore::Color, WTF::URL, WebCore::LayoutRect, WebCore::FloatRect, PAL::SessionID, WebCore::IntPoint, std::__1::pair<unsigned int, unsigned int>, WTF::Vector<WebCore::AccessibilityText, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::ObjectIdentifier<WebCore::AXIDType>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<std::__1::pair<WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::ObjectIdentifier<WebCore::AXIDType> >, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::String, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WebCore::Path, WTF::OptionSet<WebCore::AXAncestorFlag>, WTF::RetainPtr<NSAttributedString> >&) at variant:532:12 frame #8: 0x0000000149eaf02c WebCore`decltype(__visitor=0x00000002a01a4870, __vs=0x00000002a01a4950) std::__1::__variant_detail::__visitation::__variant::__visit_alt[abi:v160000]<std::__1::__variant_detail::__visitation::__variant::__value_visitor<WTF::Visitor<WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&), WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&)> >, std::__1::variant<std::nullptr_t, WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::String, bool, int, unsigned int, double, float, unsigned long long, WebCore::AccessibilityButtonState, WebCore::Color, WTF::URL, WebCore::LayoutRect, WebCore::FloatRect, PAL::SessionID, WebCore::IntPoint, std::__1::pair<unsigned int, unsigned int>, WTF::Vector<WebCore::AccessibilityText, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::ObjectIdentifier<WebCore::AXIDType>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<std::__1::pair<WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::ObjectIdentifier<WebCore::AXIDType> >, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::String, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WebCore::Path, WTF::OptionSet<WebCore::AXAncestorFlag>, WTF::RetainPtr<NSAttributedString> >&>(WTF::RetainPtr<NSAttributedString>&&, std::__1::variant<std::nullptr_t, WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::String, bool, int, unsigned int, double, float, unsigned long long, WebCore::AccessibilityButtonState, WebCore::Color, WTF::URL, WebCore::LayoutRect, WebCore::FloatRect, PAL::SessionID, WebCore::IntPoint, std::__1::pair<unsigned int, unsigned int>, WTF::Vector<WebCore::AccessibilityText, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::ObjectIdentifier<WebCore::AXIDType>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<std::__1::pair<WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::ObjectIdentifier<WebCore::AXIDType> >, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::String, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WebCore::Path, WTF::OptionSet<WebCore::AXAncestorFlag>, WTF::RetainPtr<NSAttributedString> >&) at variant:639:12 frame #9: 0x0000000149eaefa0 WebCore`decltype(__visitor=0x00000002a01a48df, __vs=0x00000002a01a4950) std::__1::__variant_detail::__visitation::__variant::__visit_value[abi:v160000]<WTF::Visitor<WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&), WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&)>, std::__1::variant<std::nullptr_t, WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::String, bool, int, unsigned int, double, float, unsigned long long, WebCore::AccessibilityButtonState, WebCore::Color, WTF::URL, WebCore::LayoutRect, WebCore::FloatRect, PAL::SessionID, WebCore::IntPoint, std::__1::pair<unsigned int, unsigned int>, WTF::Vector<WebCore::AccessibilityText, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::ObjectIdentifier<WebCore::AXIDType>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<std::__1::pair<WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::ObjectIdentifier<WebCore::AXIDType> >, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::String, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WebCore::Path, WTF::OptionSet<WebCore::AXAncestorFlag>, WTF::RetainPtr<NSAttributedString> >&>(WTF::RetainPtr<NSAttributedString>&&, std::__1::variant<std::nullptr_t, WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::String, bool, int, unsigned int, double, float, unsigned long long, WebCore::AccessibilityButtonState, WebCore::Color, WTF::URL, WebCore::LayoutRect, WebCore::FloatRect, PAL::SessionID, WebCore::IntPoint, std::__1::pair<unsigned int, unsigned int>, WTF::Vector<WebCore::AccessibilityText, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::ObjectIdentifier<WebCore::AXIDType>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<std::__1::pair<WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::ObjectIdentifier<WebCore::AXIDType> >, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::String, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WebCore::Path, WTF::OptionSet<WebCore::AXAncestorFlag>, WTF::RetainPtr<NSAttributedString> >&) at variant:658:12 frame #10: 0x0000000149eaeee8 WebCore`decltype(__visitor=0x00000002a01a48df, __vs=0x00000002a01a4950) std::__1::visit[abi:v160000]<WTF::Visitor<WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&), WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&)>, std::__1::variant<std::nullptr_t, WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::String, bool, int, unsigned int, double, float, unsigned long long, WebCore::AccessibilityButtonState, WebCore::Color, WTF::URL, WebCore::LayoutRect, WebCore::FloatRect, PAL::SessionID, WebCore::IntPoint, std::__1::pair<unsigned int, unsigned int>, WTF::Vector<WebCore::AccessibilityText, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::ObjectIdentifier<WebCore::AXIDType>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<std::__1::pair<WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::ObjectIdentifier<WebCore::AXIDType> >, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::String, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WebCore::Path, WTF::OptionSet<WebCore::AXAncestorFlag>, WTF::RetainPtr<NSAttributedString> >&, void>(WTF::RetainPtr<NSAttributedString>&&, std::__1::variant<std::nullptr_t, WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::String, bool, int, unsigned int, double, float, unsigned long long, WebCore::AccessibilityButtonState, WebCore::Color, WTF::URL, WebCore::LayoutRect, WebCore::FloatRect, PAL::SessionID, WebCore::IntPoint, std::__1::pair<unsigned int, unsigned int>, WTF::Vector<WebCore::AccessibilityText, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::ObjectIdentifier<WebCore::AXIDType>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<std::__1::pair<WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::ObjectIdentifier<WebCore::AXIDType> >, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::String, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WebCore::Path, WTF::OptionSet<WebCore::AXAncestorFlag>, WTF::RetainPtr<NSAttributedString> >&) at variant:1756:10 frame #11: 0x0000000149ea2b00 WebCore`decltype(v=0x00000002a01a4950, f=0x00000002a01a493d, f=0x00000002a01a493c) const::'lambda'(WTF::RetainPtr<NSAttributedString>&)>(fp0), std::forward<WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&)>(fp0)), std::forward<WTF::RetainPtr<NSAttributedString> >(fp))) WTF::switchOn<std::__1::variant<std::nullptr_t, WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::String, bool, int, unsigned int, double, float, unsigned long long, WebCore::AccessibilityButtonState, WebCore::Color, WTF::URL, WebCore::LayoutRect, WebCore::FloatRect, PAL::SessionID, WebCore::IntPoint, std::__1::pair<unsigned int, unsigned int>, WTF::Vector<WebCore::AccessibilityText, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::ObjectIdentifier<WebCore::AXIDType>, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<std::__1::pair<WTF::ObjectIdentifier<WebCore::AXIDType>, WTF::ObjectIdentifier<WebCore::AXIDType> >, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WTF::Vector<WTF::String, 0ul, WTF::CrashOnOverflow, 16ul, WTF::FastMalloc>, WebCore::Path, WTF::OptionSet<WebCore::AXAncestorFlag>, WTF::RetainPtr<NSAttributedString> >&, WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&), WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&)>(WTF::RetainPtr<NSAttributedString>&&, WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&)&&, WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(WebCore::AXPropertyName) const::'lambda'(WTF::RetainPtr<NSAttributedString>&)&&) at StdLibExtras.h:420:12 frame #12: 0x0000000149e8c764 WebCore`WTF::RetainPtr<NSAttributedString> WebCore::AXIsolatedObject::propertyValue<WTF::RetainPtr<NSAttributedString> >(this=0x00000001117e3000, propertyName=AttributedText) const at AXIsolatedObject.h:534:12 frame #13: 0x0000000149e8c440 WebCore`WebCore::AXIsolatedObject::textMarkerRange(this=0x00000001117e3000) const at AXIsolatedObjectMac.mm:108:31 ...
Attachments
Patch (2.74 KB, patch)
2023-04-05 14:17 PDT, Andres Gonzalez
no flags
Patch (2.82 KB, patch)
2023-04-05 17:36 PDT, Andres Gonzalez
no flags
Radar WebKit Bug Importer
Comment 1 2023-04-05 14:07:49 PDT
Andres Gonzalez
Comment 2 2023-04-05 14:17:30 PDT
Tyler Wilcock
Comment 3 2023-04-05 14:38:43 PDT
Comment on attachment 465785 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=465785&action=review There are several other places we use propertyValue without checking for the existence of the property (e.g. AXIsolatedObject::textLength(), AXIsolatedObject::platformStringValue(), more). Do we have to worry about those? > Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:114 > + if (m_propertyMap.contains(AXPropertyName::AttributedText)) { > + if (auto attributedText = propertyValue<RetainPtr<NSAttributedString>>(AXPropertyName::AttributedText)) { This patch adds a call to m_propertyMap.contains, and propertyValue does m_propertyMap.get, which is less efficient than a call to m_propertyMap.find which would give you both pieces of information in one single hashmap lookup. Is there any way to use find here? Maybe `propertyValue` could use `find` internally and return a std::optional<T>?
Andres Gonzalez
Comment 4 2023-04-05 17:36:03 PDT
Andres Gonzalez
Comment 5 2023-04-05 17:37:48 PDT
(In reply to Tyler Wilcock from comment #3) > Comment on attachment 465785 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=465785&action=review > > There are several other places we use propertyValue without checking for the > existence of the property (e.g. AXIsolatedObject::textLength(), > AXIsolatedObject::platformStringValue(), more). Do we have to worry about > those? > > > Source/WebCore/accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:114 > > + if (m_propertyMap.contains(AXPropertyName::AttributedText)) { > > + if (auto attributedText = propertyValue<RetainPtr<NSAttributedString>>(AXPropertyName::AttributedText)) { > > This patch adds a call to m_propertyMap.contains, and propertyValue does > m_propertyMap.get, which is less efficient than a call to m_propertyMap.find > which would give you both pieces of information in one single hashmap > lookup. Is there any way to use find here? Maybe `propertyValue` could use > `find` internally and return a std::optional<T>? Done, thanks.
EWS
Comment 6 2023-04-06 06:31:08 PDT
Committed 262662@main (8d8fa5f787b1): <https://commits.webkit.org/262662@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 465789 [details].
Note You need to log in before you can comment on or make changes to this bug.