mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 08:48:49 +00:00
LibWeb: Allow non-HTMLInputElements to have did_edit_text_node() called
HTMLTextAreaElement also needs to be told when its contained text node has been edited, so let's make this functionality work for anyone who extends the new EditableTextNodeOwner interface class.
This commit is contained in:
parent
ce556c9566
commit
4897643ffb
Notes:
sideshowbarker
2024-07-17 05:18:58 +09:00
Author: https://github.com/AtkinsSJ
Commit: 4897643ffb
Pull-request: https://github.com/SerenityOS/serenity/pull/20853
Reviewed-by: https://github.com/awesomekling
5 changed files with 22 additions and 18 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/DOM/Text.h>
|
||||
#include <LibWeb/FileAPI/FileList.h>
|
||||
#include <LibWeb/HTML/FormAssociatedElement.h>
|
||||
#include <LibWeb/HTML/HTMLElement.h>
|
||||
|
@ -41,7 +42,8 @@ namespace Web::HTML {
|
|||
|
||||
class HTMLInputElement final
|
||||
: public HTMLElement
|
||||
, public FormAssociatedElement {
|
||||
, public FormAssociatedElement
|
||||
, public DOM::EditableTextNodeOwner {
|
||||
WEB_PLATFORM_OBJECT(HTMLInputElement, HTMLElement);
|
||||
FORM_ASSOCIATED_ELEMENT(HTMLElement, HTMLInputElement)
|
||||
|
||||
|
@ -83,8 +85,6 @@ public:
|
|||
|
||||
bool is_mutable() const { return m_is_mutable; }
|
||||
|
||||
void did_edit_text_node(Badge<BrowsingContext>);
|
||||
|
||||
JS::GCPtr<FileAPI::FileList> files();
|
||||
void set_files(JS::GCPtr<FileAPI::FileList>);
|
||||
|
||||
|
@ -101,6 +101,9 @@ public:
|
|||
|
||||
WebIDL::ExceptionOr<void> show_picker();
|
||||
|
||||
// ^DOM::EditableTextNodeOwner
|
||||
virtual void did_edit_text_node(Badge<BrowsingContext>) override;
|
||||
|
||||
// ^EventTarget
|
||||
// https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute:the-input-element
|
||||
virtual bool is_focusable() const override { return m_type != TypeAttributeState::Hidden; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue