mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 10:20:22 +00:00
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.
27 lines
616 B
C++
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);
|
|
}
|
|
};
|
|
|
|
}
|