mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-31 23:22:03 +03:00
LibWeb: Add HTMLElement::did_receive_focus()
This commit is contained in:
parent
6b17ab77f3
commit
5d76fa72e9
Notes:
sideshowbarker
2024-07-16 19:42:24 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/5d76fa72e9 Pull-request: https://github.com/SerenityOS/serenity/pull/23326 Reviewed-by: https://github.com/awesomekling
@ -547,4 +547,14 @@ TokenizedFeature::NoOpener HTMLElement::get_an_elements_noopener(StringView targ
|
||||
return TokenizedFeature::NoOpener::No;
|
||||
}
|
||||
|
||||
void HTMLElement::did_receive_focus()
|
||||
{
|
||||
if (m_content_editable_state != ContentEditableState::True)
|
||||
return;
|
||||
auto* browsing_context = document().browsing_context();
|
||||
if (!browsing_context)
|
||||
return;
|
||||
browsing_context->set_cursor_position(DOM::Position::create(realm(), *this, 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -82,6 +82,7 @@ private:
|
||||
|
||||
// ^HTML::GlobalEventHandlers
|
||||
virtual DOM::EventTarget& global_event_handlers_to_event_target(FlyString const&) override { return *this; }
|
||||
virtual void did_receive_focus() override;
|
||||
|
||||
JS::GCPtr<DOMStringMap> m_dataset;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user