mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 17:58:49 +00:00
LibWeb: Implement the form associated element clear algorithm
This is a method defined in the WebDriver spec, but requires access to a bunch of private fields in these classes, so this is implemented in the same manner as the reset algorithm.
This commit is contained in:
parent
fadb14d31d
commit
516f5f7008
Notes:
github-actions[bot]
2024-10-12 13:02:37 +00:00
Author: https://github.com/trflynn89
Commit: 516f5f7008
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1727
Reviewed-by: https://github.com/gmta
8 changed files with 75 additions and 1 deletions
|
@ -119,6 +119,20 @@ void HTMLTextAreaElement::reset_algorithm()
|
|||
}
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webdriver/#dfn-clear-algorithm
|
||||
void HTMLTextAreaElement::clear_algorithm()
|
||||
{
|
||||
// The clear algorithm for textarea elements is to set the dirty value flag back to false,
|
||||
m_dirty_value = false;
|
||||
|
||||
// and set the raw value of element to an empty string.
|
||||
set_raw_value(child_text_content());
|
||||
|
||||
// Unlike their associated reset algorithms, changes made to form controls as part of these algorithms do count as
|
||||
// changes caused by the user (and thus, e.g. do cause input events to fire).
|
||||
queue_firing_input_event();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/forms.html#the-textarea-element:concept-node-clone-ext
|
||||
WebIDL::ExceptionOr<void> HTMLTextAreaElement::cloned(DOM::Node& copy, bool)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue