mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 14:35:07 +00:00
LibWeb: Fire the change
event synchronously when committing changes
The spec does not say to do this asynchronously on a task queue.
This commit is contained in:
parent
b749167506
commit
301d58e2d9
2 changed files with 3 additions and 6 deletions
|
@ -1,12 +1,11 @@
|
||||||
<input id=input type=text>
|
<input id=input type=text>
|
||||||
<script src="include.js"></script>
|
<script src="include.js"></script>
|
||||||
<script>
|
<script>
|
||||||
asyncTest((done) => {
|
test(() => {
|
||||||
let input = document.getElementById("input");
|
let input = document.getElementById("input");
|
||||||
|
|
||||||
input.addEventListener("change", () => {
|
input.addEventListener("change", () => {
|
||||||
println(input.value);
|
println(input.value);
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
internals.sendText(input, "wfh :^)");
|
internals.sendText(input, "wfh :^)");
|
||||||
|
|
|
@ -433,10 +433,8 @@ void HTMLInputElement::commit_pending_changes()
|
||||||
|
|
||||||
m_has_uncommitted_changes = false;
|
m_has_uncommitted_changes = false;
|
||||||
|
|
||||||
queue_an_element_task(HTML::Task::Source::UserInteraction, [this] {
|
auto change_event = DOM::Event::create(realm(), HTML::EventNames::change, { .bubbles = true });
|
||||||
auto change_event = DOM::Event::create(realm(), HTML::EventNames::change, { .bubbles = true });
|
dispatch_event(change_event);
|
||||||
dispatch_event(change_event);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HTMLInputElement::update_placeholder_visibility()
|
void HTMLInputElement::update_placeholder_visibility()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue