ladybird/Userland/Libraries/LibWeb/DOM/CharacterData.cpp
Lenny Maiorani c37820b898 Libraries: Use default constructors/destructors in LibWeb
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules

"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
2022-03-17 17:23:49 +00:00

29 lines
585 B
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/DOM/CharacterData.h>
#include <LibWeb/DOM/Document.h>
namespace Web::DOM {
CharacterData::CharacterData(Document& document, NodeType type, const String& data)
: Node(document, type)
, m_data(data)
{
}
void CharacterData::set_data(String data)
{
if (m_data == data)
return;
m_data = move(data);
if (parent())
parent()->children_changed();
set_needs_style_update(true);
document().set_needs_layout();
}
}