HTML: Put HTMLTextAreaElement selection helpers in FormAssociatedElement

This will allow us to more closely follow the spec and share these
functions with HTMLInputElement.
This commit is contained in:
Shannon Booth 2024-07-28 15:55:09 +12:00 committed by Andreas Kling
commit 62bf428a7f
Notes: github-actions[bot] 2024-08-01 10:17:57 +00:00
4 changed files with 64 additions and 63 deletions

View file

@ -9,6 +9,7 @@
#include <AK/String.h>
#include <AK/WeakPtr.h>
#include <LibWeb/Forward.h>
#include <LibWeb/WebIDL/Types.h>
namespace Web::HTML {
@ -88,6 +89,12 @@ public:
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-form-reset-control
virtual void reset_algorithm() {};
WebIDL::UnsignedLong selection_start() const;
WebIDL::ExceptionOr<void> set_selection_start(WebIDL::UnsignedLong);
WebIDL::UnsignedLong selection_end() const;
WebIDL::ExceptionOr<void> set_selection_end(WebIDL::UnsignedLong);
protected:
FormAssociatedElement() = default;
virtual ~FormAssociatedElement() = default;