mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
LibWeb: Expose Node::accessible_name via window.internals
This adds window.internals.getComputedLabel, for exposing Node::accessible_name (for accessibility-testing purposes).
This commit is contained in:
parent
65bda00274
commit
1b4e609eb2
Notes:
github-actions[bot]
2024-10-31 01:17:47 +00:00
Author: https://github.com/sideshowbarker Commit: https://github.com/LadybirdBrowser/ladybird/commit/1b4e609eb29 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2033 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/tcl3 ✅
3 changed files with 10 additions and 0 deletions
|
@ -193,4 +193,10 @@ void Internals::expire_cookies_with_time_offset(WebIDL::LongLong seconds)
|
|||
internals_page().client().page_did_expire_cookies_with_time_offset(AK::Duration::from_seconds(seconds));
|
||||
}
|
||||
|
||||
String Internals::get_computed_label(DOM::Element& element)
|
||||
{
|
||||
auto& active_document = internals_window().associated_document();
|
||||
return MUST(element.accessible_name(active_document));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,6 +47,8 @@ public:
|
|||
void enable_cookies_on_file_domains();
|
||||
void expire_cookies_with_time_offset(WebIDL::LongLong seconds);
|
||||
|
||||
String get_computed_label(DOM::Element& element);
|
||||
|
||||
private:
|
||||
explicit Internals(JS::Realm&);
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
|
|
@ -36,4 +36,6 @@ interface Internals {
|
|||
|
||||
undefined enableCookiesOnFileDomains();
|
||||
undefined expireCookiesWithTimeOffset(long long seconds);
|
||||
|
||||
DOMString getComputedLabel(Element element);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue