mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-04 23:29:52 +00:00
LibWeb: Update to_color
to take ColorResolutionContext
Using a generic context argument will allow us to resolve colors in places where we have all the required information but not in the form of a layout node as was expected previously.
This commit is contained in:
parent
b0508fb39a
commit
46153910ec
Notes:
github-actions[bot]
2025-08-04 10:30:51 +00:00
Author: https://github.com/Calme1709
Commit: 46153910ec
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5517
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/gmta
31 changed files with 129 additions and 127 deletions
|
@ -71,9 +71,20 @@
|
|||
#include <LibWeb/CSS/StyleValues/URLStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/UnicodeRangeStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/UnresolvedStyleValue.h>
|
||||
#include <LibWeb/Layout/Node.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
ColorResolutionContext ColorResolutionContext::for_layout_node_with_style(Layout::NodeWithStyle const& layout_node)
|
||||
{
|
||||
return {
|
||||
.color_scheme = layout_node.computed_values().color_scheme(),
|
||||
.current_color = layout_node.computed_values().color(),
|
||||
.document = layout_node.document(),
|
||||
.calculation_resolution_context = { .length_resolution_context = Length::ResolutionContext::for_layout_node(layout_node) },
|
||||
};
|
||||
}
|
||||
|
||||
CSSStyleValue::CSSStyleValue(Type type)
|
||||
: m_type(type)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue