LibWeb: Subclass FormAssociatedElement text selection methods

These are only relevant to HTMLInputElement and HTMLTextArea elements.
This commit is contained in:
Tim Ledbetter 2024-08-30 17:22:58 +01:00 committed by Andreas Kling
commit 206262cd55
Notes: github-actions[bot] 2024-08-31 09:50:53 +00:00
5 changed files with 47 additions and 47 deletions

View file

@ -1159,7 +1159,7 @@ void EventHandler::update_selection_range_for_input_or_textarea()
// FIXME: support selection directions other than ::Forward
auto direction = HTML::SelectionDirection::Forward;
Optional<HTML::FormAssociatedElement&> target {};
Optional<HTML::FormAssociatedTextControlElement&> target {};
if (is<HTML::HTMLInputElement>(shadow_host))
target = static_cast<HTML::HTMLInputElement&>(shadow_host);
else if (is<HTML::HTMLTextAreaElement>(shadow_host))