mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +00:00
LibWeb: Also invalidate placeholder style on focus change
This commit is contained in:
parent
a661daea71
commit
cca03e484b
Notes:
github-actions[bot]
2024-08-04 08:38:56 +00:00
Author: https://github.com/vpzomtrrfrt
Commit: cca03e484b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/949
2 changed files with 12 additions and 0 deletions
|
@ -1137,6 +1137,9 @@ void HTMLInputElement::did_receive_focus()
|
||||||
return;
|
return;
|
||||||
m_text_node->invalidate_style();
|
m_text_node->invalidate_style();
|
||||||
|
|
||||||
|
if (m_placeholder_text_node)
|
||||||
|
m_placeholder_text_node->invalidate_style();
|
||||||
|
|
||||||
document().set_cursor_position(DOM::Position::create(realm(), *m_text_node, 0));
|
document().set_cursor_position(DOM::Position::create(realm(), *m_text_node, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1145,6 +1148,9 @@ void HTMLInputElement::did_lose_focus()
|
||||||
if (m_text_node)
|
if (m_text_node)
|
||||||
m_text_node->invalidate_style();
|
m_text_node->invalidate_style();
|
||||||
|
|
||||||
|
if (m_placeholder_text_node)
|
||||||
|
m_placeholder_text_node->invalidate_style();
|
||||||
|
|
||||||
commit_pending_changes();
|
commit_pending_changes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,9 @@ void HTMLTextAreaElement::did_receive_focus()
|
||||||
return;
|
return;
|
||||||
m_text_node->invalidate_style();
|
m_text_node->invalidate_style();
|
||||||
|
|
||||||
|
if (m_placeholder_text_node)
|
||||||
|
m_placeholder_text_node->invalidate_style();
|
||||||
|
|
||||||
document().set_cursor_position(DOM::Position::create(realm(), *m_text_node, 0));
|
document().set_cursor_position(DOM::Position::create(realm(), *m_text_node, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,6 +83,9 @@ void HTMLTextAreaElement::did_lose_focus()
|
||||||
if (m_text_node)
|
if (m_text_node)
|
||||||
m_text_node->invalidate_style();
|
m_text_node->invalidate_style();
|
||||||
|
|
||||||
|
if (m_placeholder_text_node)
|
||||||
|
m_placeholder_text_node->invalidate_style();
|
||||||
|
|
||||||
// The change event fires when the value is committed, if that makes sense for the control,
|
// The change event fires when the value is committed, if that makes sense for the control,
|
||||||
// or else when the control loses focus
|
// or else when the control loses focus
|
||||||
queue_an_element_task(HTML::Task::Source::UserInteraction, [this] {
|
queue_an_element_task(HTML::Task::Source::UserInteraction, [this] {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue