
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
38 lines
830 B
C++
38 lines
830 B
C++
/*
|
|
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/CSS/CSSStyleDeclaration.h>
|
|
#include <LibWeb/DOM/Element.h>
|
|
|
|
namespace Web::CSS {
|
|
|
|
CSSStyleDeclaration::CSSStyleDeclaration(Vector<StyleProperty>&& properties)
|
|
: m_properties(move(properties))
|
|
{
|
|
}
|
|
|
|
CSSStyleDeclaration::~CSSStyleDeclaration()
|
|
{
|
|
}
|
|
|
|
String CSSStyleDeclaration::item(size_t index) const
|
|
{
|
|
if (index >= m_properties.size())
|
|
return {};
|
|
return CSS::string_from_property_id(m_properties[index].property_id);
|
|
}
|
|
|
|
ElementInlineCSSStyleDeclaration::ElementInlineCSSStyleDeclaration(DOM::Element& element)
|
|
: CSSStyleDeclaration({})
|
|
, m_element(element.make_weak_ptr<DOM::Element>())
|
|
{
|
|
}
|
|
|
|
ElementInlineCSSStyleDeclaration::~ElementInlineCSSStyleDeclaration()
|
|
{
|
|
}
|
|
|
|
}
|