1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 22:27:42 +00:00

LibWeb: Remove background-repeat/image fields and getters

These aren't needed now that we render using background_layers instead.
The one casualty is the resolved style for background-repeat, but that
was incorrect anyway.
This commit is contained in:
Sam Atkins 2021-11-12 13:00:03 +00:00 committed by Andreas Kling
parent e8b7946732
commit a214036509
5 changed files with 0 additions and 57 deletions

View file

@ -25,7 +25,6 @@ public:
static CSS::Display display() { return CSS::Display { CSS::Display::Outside::Inline, CSS::Display::Inside::Flow }; }
static Color color() { return Color::Black; }
static Color background_color() { return Color::Transparent; }
static CSS::Repeat background_repeat() { return CSS::Repeat::Repeat; }
static CSS::ListStyleType list_style_type() { return CSS::ListStyleType::Disc; }
static CSS::FlexDirection flex_direction() { return CSS::FlexDirection::Row; }
static CSS::FlexWrap flex_wrap() { return CSS::FlexWrap::Nowrap; }
@ -126,7 +125,6 @@ public:
Color color() const { return m_inherited.color; }
Color background_color() const { return m_noninherited.background_color; }
Vector<BackgroundLayerData> const& background_layers() const { return m_noninherited.background_layers; }
BackgroundRepeatData background_repeat() const { return m_noninherited.background_repeat; }
CSS::ListStyleType list_style_type() const { return m_inherited.list_style_type; }
@ -184,7 +182,6 @@ protected:
Length border_top_right_radius;
Color background_color { InitialValues::background_color() };
Vector<BackgroundLayerData> background_layers;
BackgroundRepeatData background_repeat { InitialValues::background_repeat(), InitialValues::background_repeat() };
CSS::FlexDirection flex_direction { InitialValues::flex_direction() };
CSS::FlexWrap flex_wrap { InitialValues::flex_wrap() };
CSS::FlexBasisData flex_basis {};
@ -210,7 +207,6 @@ public:
void set_cursor(CSS::Cursor cursor) { m_inherited.cursor = cursor; }
void set_pointer_events(CSS::PointerEvents value) { m_inherited.pointer_events = value; }
void set_background_color(const Color& color) { m_noninherited.background_color = color; }
void set_background_repeat(BackgroundRepeatData repeat) { m_noninherited.background_repeat = repeat; }
void set_background_layers(Vector<BackgroundLayerData>&& layers) { m_noninherited.background_layers = move(layers); }
void set_float(CSS::Float value) { m_noninherited.float_ = value; }
void set_clear(CSS::Clear value) { m_noninherited.clear = value; }

View file

@ -645,10 +645,6 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
return ColorStyleValue::create(layout_node.computed_values().color());
case PropertyID::BackgroundColor:
return ColorStyleValue::create(layout_node.computed_values().background_color());
case CSS::PropertyID::BackgroundRepeat:
return BackgroundRepeatStyleValue::create(
layout_node.computed_values().background_repeat().repeat_x,
layout_node.computed_values().background_repeat().repeat_y);
case CSS::PropertyID::Background: {
auto maybe_background_color = property(CSS::PropertyID::BackgroundColor);
auto maybe_background_image = property(CSS::PropertyID::BackgroundImage);

View file

@ -366,48 +366,6 @@ Vector<CSS::BackgroundLayerData> const* Document::background_layers() const
return &body_layout_node->background_layers();
}
RefPtr<Gfx::Bitmap> Document::background_image() const
{
auto* body_element = body();
if (!body_element)
return {};
auto* body_layout_node = body_element->layout_node();
if (!body_layout_node)
return {};
auto background_image = body_layout_node->background_image();
if (!background_image)
return {};
return background_image->bitmap();
}
CSS::Repeat Document::background_repeat_x() const
{
auto* body_element = body();
if (!body_element)
return CSS::Repeat::Repeat;
auto* body_layout_node = body_element->layout_node();
if (!body_layout_node)
return CSS::Repeat::Repeat;
return body_layout_node->computed_values().background_repeat().repeat_x;
}
CSS::Repeat Document::background_repeat_y() const
{
auto* body_element = body();
if (!body_element)
return CSS::Repeat::Repeat;
auto* body_layout_node = body_element->layout_node();
if (!body_layout_node)
return CSS::Repeat::Repeat;
return body_layout_node->computed_values().background_repeat().repeat_y;
}
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#parse-a-url
AK::URL Document::parse_url(String const& url) const
{

View file

@ -131,9 +131,6 @@ public:
Color background_color(const Gfx::Palette&) const;
Vector<CSS::BackgroundLayerData> const* background_layers() const;
RefPtr<Gfx::Bitmap> background_image() const;
CSS::Repeat background_repeat_x() const;
CSS::Repeat background_repeat_y() const;
Color link_color() const;
void set_link_color(Color);

View file

@ -300,10 +300,6 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& specified_style)
if (border_top_right_radius.has_value())
computed_values.set_border_top_right_radius(border_top_right_radius.value()->to_length());
auto background_repeat = specified_style.background_repeat();
if (background_repeat.has_value())
computed_values.set_background_repeat(background_repeat.value());
computed_values.set_display(specified_style.display());
auto flex_direction = specified_style.flex_direction();