mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +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: https://github.com/SerenityOS/serenity/commit/8743ea31498
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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
virtual ~CharacterData() override;
|
||||
|
||||
const String& data() const { return m_data; }
|
||||
void set_data(const String& data) { m_data = data; }
|
||||
void set_data(String);
|
||||
|
||||
unsigned length() const { return m_data.length(); }
|
||||
|
||||
|
|
Loading…
Reference in a new issue