mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:17: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:
parent
e8b7946732
commit
a214036509
5 changed files with 0 additions and 57 deletions
|
@ -25,7 +25,6 @@ public:
|
||||||
static CSS::Display display() { return CSS::Display { CSS::Display::Outside::Inline, CSS::Display::Inside::Flow }; }
|
static CSS::Display display() { return CSS::Display { CSS::Display::Outside::Inline, CSS::Display::Inside::Flow }; }
|
||||||
static Color color() { return Color::Black; }
|
static Color color() { return Color::Black; }
|
||||||
static Color background_color() { return Color::Transparent; }
|
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::ListStyleType list_style_type() { return CSS::ListStyleType::Disc; }
|
||||||
static CSS::FlexDirection flex_direction() { return CSS::FlexDirection::Row; }
|
static CSS::FlexDirection flex_direction() { return CSS::FlexDirection::Row; }
|
||||||
static CSS::FlexWrap flex_wrap() { return CSS::FlexWrap::Nowrap; }
|
static CSS::FlexWrap flex_wrap() { return CSS::FlexWrap::Nowrap; }
|
||||||
|
@ -126,7 +125,6 @@ public:
|
||||||
Color color() const { return m_inherited.color; }
|
Color color() const { return m_inherited.color; }
|
||||||
Color background_color() const { return m_noninherited.background_color; }
|
Color background_color() const { return m_noninherited.background_color; }
|
||||||
Vector<BackgroundLayerData> const& background_layers() const { return m_noninherited.background_layers; }
|
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; }
|
CSS::ListStyleType list_style_type() const { return m_inherited.list_style_type; }
|
||||||
|
|
||||||
|
@ -184,7 +182,6 @@ protected:
|
||||||
Length border_top_right_radius;
|
Length border_top_right_radius;
|
||||||
Color background_color { InitialValues::background_color() };
|
Color background_color { InitialValues::background_color() };
|
||||||
Vector<BackgroundLayerData> background_layers;
|
Vector<BackgroundLayerData> background_layers;
|
||||||
BackgroundRepeatData background_repeat { InitialValues::background_repeat(), InitialValues::background_repeat() };
|
|
||||||
CSS::FlexDirection flex_direction { InitialValues::flex_direction() };
|
CSS::FlexDirection flex_direction { InitialValues::flex_direction() };
|
||||||
CSS::FlexWrap flex_wrap { InitialValues::flex_wrap() };
|
CSS::FlexWrap flex_wrap { InitialValues::flex_wrap() };
|
||||||
CSS::FlexBasisData flex_basis {};
|
CSS::FlexBasisData flex_basis {};
|
||||||
|
@ -210,7 +207,6 @@ public:
|
||||||
void set_cursor(CSS::Cursor cursor) { m_inherited.cursor = cursor; }
|
void set_cursor(CSS::Cursor cursor) { m_inherited.cursor = cursor; }
|
||||||
void set_pointer_events(CSS::PointerEvents value) { m_inherited.pointer_events = value; }
|
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_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_background_layers(Vector<BackgroundLayerData>&& layers) { m_noninherited.background_layers = move(layers); }
|
||||||
void set_float(CSS::Float value) { m_noninherited.float_ = value; }
|
void set_float(CSS::Float value) { m_noninherited.float_ = value; }
|
||||||
void set_clear(CSS::Clear value) { m_noninherited.clear = value; }
|
void set_clear(CSS::Clear value) { m_noninherited.clear = value; }
|
||||||
|
|
|
@ -645,10 +645,6 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
|
||||||
return ColorStyleValue::create(layout_node.computed_values().color());
|
return ColorStyleValue::create(layout_node.computed_values().color());
|
||||||
case PropertyID::BackgroundColor:
|
case PropertyID::BackgroundColor:
|
||||||
return ColorStyleValue::create(layout_node.computed_values().background_color());
|
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: {
|
case CSS::PropertyID::Background: {
|
||||||
auto maybe_background_color = property(CSS::PropertyID::BackgroundColor);
|
auto maybe_background_color = property(CSS::PropertyID::BackgroundColor);
|
||||||
auto maybe_background_image = property(CSS::PropertyID::BackgroundImage);
|
auto maybe_background_image = property(CSS::PropertyID::BackgroundImage);
|
||||||
|
|
|
@ -366,48 +366,6 @@ Vector<CSS::BackgroundLayerData> const* Document::background_layers() const
|
||||||
return &body_layout_node->background_layers();
|
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
|
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#parse-a-url
|
||||||
AK::URL Document::parse_url(String const& url) const
|
AK::URL Document::parse_url(String const& url) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -131,9 +131,6 @@ public:
|
||||||
|
|
||||||
Color background_color(const Gfx::Palette&) const;
|
Color background_color(const Gfx::Palette&) const;
|
||||||
Vector<CSS::BackgroundLayerData> const* background_layers() 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;
|
Color link_color() const;
|
||||||
void set_link_color(Color);
|
void set_link_color(Color);
|
||||||
|
|
|
@ -300,10 +300,6 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& specified_style)
|
||||||
if (border_top_right_radius.has_value())
|
if (border_top_right_radius.has_value())
|
||||||
computed_values.set_border_top_right_radius(border_top_right_radius.value()->to_length());
|
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());
|
computed_values.set_display(specified_style.display());
|
||||||
|
|
||||||
auto flex_direction = specified_style.flex_direction();
|
auto flex_direction = specified_style.flex_direction();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue