mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-18 07:22:22 +00:00
LibWeb: Only require NodeWithStyle for gradient size resolution
None of the code here actually needs a NodeWithStyleAndBoxModelMetrics, and we'll need to be able to resolve images from inside NodeWithStyle::apply_style().
This commit is contained in:
parent
a0cd6dd607
commit
9cbd8a82c7
Notes:
github-actions[bot]
2025-02-28 12:51:49 +00:00
Author: https://github.com/AtkinsSJ
Commit: 9cbd8a82c7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3644
9 changed files with 14 additions and 14 deletions
|
@ -33,7 +33,7 @@ public:
|
|||
}
|
||||
|
||||
virtual void load_any_resources(DOM::Document&) { }
|
||||
virtual void resolve_for_size(Layout::NodeWithStyleAndBoxModelMetrics const&, CSSPixelSize) const { }
|
||||
virtual void resolve_for_size(Layout::NodeWithStyle const&, CSSPixelSize) const { }
|
||||
|
||||
virtual bool is_paintable() const = 0;
|
||||
virtual void paint(PaintContext& context, DevicePixelRect const& dest_rect, ImageRendering) const = 0;
|
||||
|
|
|
@ -36,7 +36,7 @@ String ConicGradientStyleValue::to_string(SerializationMode mode) const
|
|||
return MUST(builder.to_string());
|
||||
}
|
||||
|
||||
void ConicGradientStyleValue::resolve_for_size(Layout::NodeWithStyleAndBoxModelMetrics const& node, CSSPixelSize size) const
|
||||
void ConicGradientStyleValue::resolve_for_size(Layout::NodeWithStyle const& node, CSSPixelSize size) const
|
||||
{
|
||||
ResolvedDataCacheKey cache_key {
|
||||
.length_resolution_context = Length::ResolutionContext::for_layout_node(node),
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
|
||||
bool is_paintable() const override { return true; }
|
||||
|
||||
void resolve_for_size(Layout::NodeWithStyleAndBoxModelMetrics const&, CSSPixelSize) const override;
|
||||
void resolve_for_size(Layout::NodeWithStyle const&, CSSPixelSize) const override;
|
||||
|
||||
virtual ~ConicGradientStyleValue() override = default;
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ float LinearGradientStyleValue::angle_degrees(CSSPixelSize gradient_size) const
|
|||
});
|
||||
}
|
||||
|
||||
void LinearGradientStyleValue::resolve_for_size(Layout::NodeWithStyleAndBoxModelMetrics const& node, CSSPixelSize size) const
|
||||
void LinearGradientStyleValue::resolve_for_size(Layout::NodeWithStyle const& node, CSSPixelSize size) const
|
||||
{
|
||||
ResolvedDataCacheKey cache_key {
|
||||
.length_resolution_context = Length::ResolutionContext::for_layout_node(node),
|
||||
|
|
|
@ -57,7 +57,7 @@ public:
|
|||
|
||||
float angle_degrees(CSSPixelSize gradient_size) const;
|
||||
|
||||
void resolve_for_size(Layout::NodeWithStyleAndBoxModelMetrics const&, CSSPixelSize) const override;
|
||||
void resolve_for_size(Layout::NodeWithStyle const&, CSSPixelSize) const override;
|
||||
|
||||
bool is_paintable() const override { return true; }
|
||||
void paint(PaintContext& context, DevicePixelRect const& dest_rect, CSS::ImageRendering image_rendering) const override;
|
||||
|
|
|
@ -201,7 +201,7 @@ CSSPixelSize RadialGradientStyleValue::resolve_size(Layout::Node const& node, CS
|
|||
return resolved_size;
|
||||
}
|
||||
|
||||
void RadialGradientStyleValue::resolve_for_size(Layout::NodeWithStyleAndBoxModelMetrics const& node, CSSPixelSize paint_size) const
|
||||
void RadialGradientStyleValue::resolve_for_size(Layout::NodeWithStyle const& node, CSSPixelSize paint_size) const
|
||||
{
|
||||
CSSPixelRect gradient_box { { 0, 0 }, paint_size };
|
||||
auto center = m_properties.position->resolved(node, gradient_box);
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
|
||||
bool is_paintable() const override { return true; }
|
||||
|
||||
void resolve_for_size(Layout::NodeWithStyleAndBoxModelMetrics const&, CSSPixelSize) const override;
|
||||
void resolve_for_size(Layout::NodeWithStyle const&, CSSPixelSize) const override;
|
||||
|
||||
CSSPixelSize resolve_size(Layout::Node const&, CSSPixelPoint, CSSPixelRect const&) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue