mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Relayout document on CharacterData data change
This can definitely be optimized to avoid full relayouts in many situations, but for now let's just go for correctness.
This commit is contained in:
parent
29a2aac89a
commit
8743ea3149
Notes:
sideshowbarker
2024-07-18 22:26:40 +09:00
Author: https://github.com/awesomekling
Commit: 8743ea3149
2 changed files with 11 additions and 1 deletions
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
#include <LibWeb/DOM/CharacterData.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
||||
|
@ -38,4 +39,13 @@ CharacterData::~CharacterData()
|
|||
{
|
||||
}
|
||||
|
||||
void CharacterData::set_data(String data)
|
||||
{
|
||||
if (m_data == data)
|
||||
return;
|
||||
m_data = move(data);
|
||||
// FIXME: This is definitely too aggressive.
|
||||
document().schedule_forced_layout();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue