mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 07:22:21 +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
|
@ -819,7 +819,9 @@ bool is_editing_host(GC::Ref<DOM::Node> node)
|
|||
if (!is<HTML::HTMLElement>(*node))
|
||||
return false;
|
||||
auto const& html_element = static_cast<HTML::HTMLElement&>(*node);
|
||||
return html_element.content_editable().is_one_of("true"sv, "plaintext-only"sv) || node->document().design_mode_enabled_state();
|
||||
return html_element.content_editable_state() == HTML::ContentEditableState::True
|
||||
|| html_element.content_editable_state() == HTML::ContentEditableState::PlaintextOnly
|
||||
|| node->document().design_mode_enabled_state();
|
||||
}
|
||||
|
||||
// https://w3c.github.io/editing/docs/execCommand/#element-with-inline-contents
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue