mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-08 18:11:52 +00:00
LibWeb: Implement "plaintext-only" state for contenteditable
This commit is contained in:
parent
7e406ac668
commit
217567981a
Notes:
github-actions[bot]
2024-12-02 23:21:14 +00:00
Author: https://github.com/gmta
Commit: 217567981a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2697
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/tcl3
5 changed files with 104 additions and 14 deletions
|
@ -816,11 +816,10 @@ bool is_editing_host(GC::Ref<DOM::Node> node)
|
|||
// An editing host is either an HTML element with its contenteditable attribute in the true
|
||||
// state or plaintext-only state, or a child HTML element of a Document whose design mode
|
||||
// enabled is true.
|
||||
// FIXME: check contenteditable "plaintext-only"
|
||||
if (!is<HTML::HTMLElement>(*node))
|
||||
return false;
|
||||
auto const& html_element = static_cast<HTML::HTMLElement&>(*node);
|
||||
return html_element.content_editable() == "true"sv || node->document().design_mode_enabled_state();
|
||||
return html_element.content_editable().is_one_of("true"sv, "plaintext-only"sv) || 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