1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:48:12 +00:00

LibHTML: Replace StyleProperties::create(StyleProperties) with clone()

This commit is contained in:
Matrix89 2020-01-05 16:54:38 +01:00 committed by Andreas Kling
parent 2dd35916e5
commit c2e1dd67c9
3 changed files with 26 additions and 8 deletions

View file

@ -3,6 +3,25 @@
#include <LibHTML/FontCache.h>
#include <ctype.h>
StyleProperties::StyleProperties()
{
}
StyleProperties::StyleProperties(const StyleProperties& other)
: m_property_values(*new HashMap(other.m_property_values))
{
if (other.m_font) {
m_font = other.m_font->clone();
} else {
m_font = nullptr;
}
}
NonnullRefPtr<StyleProperties> StyleProperties::clone() const
{
return adopt(*new StyleProperties(*this));
}
void StyleProperties::set_property(CSS::PropertyID id, NonnullRefPtr<StyleValue> value)
{
m_property_values.set((unsigned)id, move(value));