mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 11:57:34 +00:00
LibWeb: Split AbstractImageStyleValue out of StyleValue.{h,cpp}
This commit is contained in:
parent
0f04fa2e6e
commit
e61a5ad180
13 changed files with 89 additions and 131 deletions
|
@ -63,28 +63,6 @@ enum class FlexBasis {
|
|||
Auto,
|
||||
};
|
||||
|
||||
template<typename TPosition>
|
||||
struct ColorStopListElement {
|
||||
using PositionType = TPosition;
|
||||
struct ColorHint {
|
||||
TPosition value;
|
||||
inline bool operator==(ColorHint const&) const = default;
|
||||
};
|
||||
|
||||
Optional<ColorHint> transition_hint;
|
||||
struct ColorStop {
|
||||
Color color;
|
||||
Optional<TPosition> position;
|
||||
Optional<TPosition> second_position = {};
|
||||
inline bool operator==(ColorStop const&) const = default;
|
||||
} color_stop;
|
||||
|
||||
inline bool operator==(ColorStopListElement const&) const = default;
|
||||
};
|
||||
|
||||
using LinearColorStopListElement = ColorStopListElement<LengthPercentage>;
|
||||
using AngularColorStopListElement = ColorStopListElement<AnglePercentage>;
|
||||
|
||||
// FIXME: Named PositionValue to avoid conflicts with enums, but this represents a <position>
|
||||
struct PositionValue {
|
||||
enum class HorizontalPreset {
|
||||
|
@ -649,25 +627,6 @@ private:
|
|||
NonnullOwnPtr<CalcSum> m_expression;
|
||||
};
|
||||
|
||||
class AbstractImageStyleValue : public StyleValue {
|
||||
public:
|
||||
using StyleValue::StyleValue;
|
||||
|
||||
virtual Optional<CSSPixels> natural_width() const { return {}; }
|
||||
virtual Optional<CSSPixels> natural_height() const { return {}; }
|
||||
|
||||
virtual void load_any_resources(DOM::Document&) {};
|
||||
virtual void resolve_for_size(Layout::Node const&, CSSPixelSize) const {};
|
||||
|
||||
virtual bool is_paintable() const = 0;
|
||||
virtual void paint(PaintContext& context, DevicePixelRect const& dest_rect, CSS::ImageRendering image_rendering) const = 0;
|
||||
};
|
||||
|
||||
enum class GradientRepeating {
|
||||
Yes,
|
||||
No
|
||||
};
|
||||
|
||||
class InheritStyleValue final : public StyleValueWithDefaultOperators<InheritStyleValue> {
|
||||
public:
|
||||
static ValueComparingNonnullRefPtr<InheritStyleValue> the()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue