mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 02:40: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:
committed by
Andreas Kling
parent
fadb14d31d
commit
516f5f7008
@@ -100,4 +100,14 @@ void HTMLOutputElement::reset_algorithm()
|
||||
m_default_value_override = {};
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webdriver/#dfn-clear-algorithm
|
||||
void HTMLOutputElement::clear_algorithm()
|
||||
{
|
||||
// The clear algorithm for output elements is set the element's value mode flag to default
|
||||
m_default_value_override = default_value();
|
||||
|
||||
// and then to set the element's textContent IDL attribute to an empty string (thus clearing the element's child nodes).
|
||||
string_replace_all({});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user