ladybird/Libraries/LibWeb/CSS/StyleValues/ComputationContext.h
Callum Law f1e7743989 LibWeb: Add generic method to get computation context for property
The computation context used is the main thing distinguishing the
computation of font/non-font properties so having a generic method to
handle this will allow us to consolidate logic between the two.
2026-02-13 21:54:06 +01:00

27 lines
616 B
C++

/*
* Copyright (c) 2025, Callum Law <callumlaw1709@outlook.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/CSS/Length.h>
#include <LibWeb/CSS/PreferredColorScheme.h>
#include <LibWeb/DOM/AbstractElement.h>
namespace Web::CSS {
struct ComputationContext {
Length::ResolutionContext length_resolution_context;
Optional<DOM::AbstractElement> abstract_element {};
Optional<PreferredColorScheme> color_scheme {};
void visit_edges(GC::Cell::Visitor& visitor)
{
if (abstract_element.has_value())
abstract_element->visit(visitor);
}
};
}