mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibWeb: Expose HTMLElement's content editable state
This commit is contained in:
parent
c9a6bac57f
commit
6a85677f70
Notes:
github-actions[bot]
2024-12-02 23:20:55 +00:00
Author: https://github.com/gmta
Commit: 6a85677f70
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2697
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/tcl3
3 changed files with 13 additions and 8 deletions
|
@ -20,6 +20,14 @@ namespace Web::HTML {
|
|||
__ENUMERATE_HTML_ELEMENT_DIR_ATTRIBUTE(rtl) \
|
||||
__ENUMERATE_HTML_ELEMENT_DIR_ATTRIBUTE(auto)
|
||||
|
||||
// https://html.spec.whatwg.org/#attr-contenteditable
|
||||
enum class ContentEditableState {
|
||||
True,
|
||||
False,
|
||||
PlaintextOnly,
|
||||
Inherit,
|
||||
};
|
||||
|
||||
class HTMLElement
|
||||
: public DOM::Element
|
||||
, public HTML::GlobalEventHandlers
|
||||
|
@ -39,6 +47,7 @@ public:
|
|||
virtual bool is_focusable() const override;
|
||||
bool is_content_editable() const;
|
||||
StringView content_editable() const;
|
||||
ContentEditableState content_editable_state() const { return m_content_editable_state; }
|
||||
WebIDL::ExceptionOr<void> set_content_editable(StringView);
|
||||
|
||||
String inner_text();
|
||||
|
@ -106,12 +115,6 @@ private:
|
|||
GC::Ptr<ElementInternals> m_attached_internals;
|
||||
|
||||
// https://html.spec.whatwg.org/#attr-contenteditable
|
||||
enum class ContentEditableState {
|
||||
True,
|
||||
False,
|
||||
PlaintextOnly,
|
||||
Inherit,
|
||||
};
|
||||
ContentEditableState m_content_editable_state { ContentEditableState::Inherit };
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/interaction.html#click-in-progress-flag
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue