/* * Copyright (c) 2018-2020, Andreas Kling * Copyright (c) 2021, Tobias Christiansen * Copyright (c) 2021-2023, Sam Atkins * Copyright (c) 2022-2023, MacDue * * SPDX-License-Identifier: BSD-2-Clause */ #include "ContentStyleValue.h" #include namespace Web::CSS { void ContentStyleValue::serialize(StringBuilder& builder, SerializationMode mode) const { m_properties.content->serialize(builder, mode); if (auto alt_text = m_properties.alt_text) { builder.append(" / "sv); alt_text->serialize(builder, mode); } } bool ContentStyleValue::is_computationally_independent() const { return m_properties.content->is_computationally_independent() && (!m_properties.alt_text || m_properties.alt_text->is_computationally_independent()); } void ContentStyleValue::set_style_sheet(GC::Ptr style_sheet) { Base::set_style_sheet(style_sheet); const_cast(*m_properties.content).set_style_sheet(style_sheet); if (m_properties.alt_text) const_cast(*m_properties.alt_text).set_style_sheet(style_sheet); } }