mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
Everywhere: Run clang-format
This commit is contained in:
parent
0376c127f6
commit
086969277e
1665 changed files with 8479 additions and 8479 deletions
|
@ -32,8 +32,8 @@ public:
|
|||
|
||||
bool has_import_result() const { return !m_style_sheet.is_null(); }
|
||||
RefPtr<CSSStyleSheet> loaded_style_sheet() { return m_style_sheet; }
|
||||
const RefPtr<CSSStyleSheet> loaded_style_sheet() const { return m_style_sheet; }
|
||||
void set_style_sheet(const RefPtr<CSSStyleSheet>& style_sheet) { m_style_sheet = style_sheet; }
|
||||
RefPtr<CSSStyleSheet> const loaded_style_sheet() const { return m_style_sheet; }
|
||||
void set_style_sheet(RefPtr<CSSStyleSheet> const& style_sheet) { m_style_sheet = style_sheet; }
|
||||
|
||||
virtual StringView class_name() const override { return "CSSImportRule"; };
|
||||
virtual Type type() const override { return Type::Import; };
|
||||
|
|
|
@ -69,9 +69,9 @@ public:
|
|||
virtual Optional<StyleProperty> property(PropertyID) const override;
|
||||
virtual bool set_property(PropertyID, StringView css_text) override;
|
||||
|
||||
const Vector<StyleProperty>& properties() const { return m_properties; }
|
||||
const HashMap<String, StyleProperty>& custom_properties() const { return m_custom_properties; }
|
||||
Optional<StyleProperty> custom_property(const String& custom_property_name) const { return m_custom_properties.get(custom_property_name); }
|
||||
Vector<StyleProperty> const& properties() const { return m_properties; }
|
||||
HashMap<String, StyleProperty> const& custom_properties() const { return m_custom_properties; }
|
||||
Optional<StyleProperty> custom_property(String const& custom_property_name) const { return m_custom_properties.get(custom_property_name); }
|
||||
size_t custom_property_count() const { return m_custom_properties.size(); }
|
||||
|
||||
virtual String serialized() const final override;
|
||||
|
|
|
@ -29,8 +29,8 @@ public:
|
|||
|
||||
virtual ~CSSStyleRule() override = default;
|
||||
|
||||
const NonnullRefPtrVector<Selector>& selectors() const { return m_selectors; }
|
||||
const CSSStyleDeclaration& declaration() const { return m_declaration; }
|
||||
NonnullRefPtrVector<Selector> const& selectors() const { return m_selectors; }
|
||||
CSSStyleDeclaration const& declaration() const { return m_declaration; }
|
||||
|
||||
virtual StringView class_name() const override { return "CSSStyleRule"; };
|
||||
virtual Type type() const override { return Type::Style; };
|
||||
|
|
|
@ -152,10 +152,10 @@ public:
|
|||
const CSS::LengthBox& margin() const { return m_noninherited.margin; }
|
||||
const CSS::LengthBox& padding() const { return m_noninherited.padding; }
|
||||
|
||||
const BorderData& border_left() const { return m_noninherited.border_left; }
|
||||
const BorderData& border_top() const { return m_noninherited.border_top; }
|
||||
const BorderData& border_right() const { return m_noninherited.border_right; }
|
||||
const BorderData& border_bottom() const { return m_noninherited.border_bottom; }
|
||||
BorderData const& border_left() const { return m_noninherited.border_left; }
|
||||
BorderData const& border_top() const { return m_noninherited.border_top; }
|
||||
BorderData const& border_right() const { return m_noninherited.border_right; }
|
||||
BorderData const& border_bottom() const { return m_noninherited.border_bottom; }
|
||||
|
||||
const CSS::LengthPercentage& border_bottom_left_radius() const { return m_noninherited.border_bottom_left_radius; }
|
||||
const CSS::LengthPercentage& border_bottom_right_radius() const { return m_noninherited.border_bottom_right_radius; }
|
||||
|
@ -267,12 +267,12 @@ public:
|
|||
void set_font_size(float font_size) { m_inherited.font_size = font_size; }
|
||||
void set_font_weight(int font_weight) { m_inherited.font_weight = font_weight; }
|
||||
void set_font_variant(CSS::FontVariant font_variant) { m_inherited.font_variant = font_variant; }
|
||||
void set_color(const Color& color) { m_inherited.color = color; }
|
||||
void set_color(Color const& color) { m_inherited.color = color; }
|
||||
void set_content(ContentData const& content) { m_noninherited.content = content; }
|
||||
void set_cursor(CSS::Cursor cursor) { m_inherited.cursor = cursor; }
|
||||
void set_image_rendering(CSS::ImageRendering value) { m_inherited.image_rendering = 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(Color const& color) { m_noninherited.background_color = color; }
|
||||
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; }
|
||||
|
|
|
@ -118,7 +118,7 @@ String Length::to_string() const
|
|||
return String::formatted("{}{}", m_value, unit_name());
|
||||
}
|
||||
|
||||
const char* Length::unit_name() const
|
||||
char const* Length::unit_name() const
|
||||
{
|
||||
switch (m_type) {
|
||||
case Type::Cm:
|
||||
|
|
|
@ -116,14 +116,14 @@ public:
|
|||
|
||||
String to_string() const;
|
||||
|
||||
bool operator==(const Length& other) const
|
||||
bool operator==(Length const& other) const
|
||||
{
|
||||
if (is_calculated())
|
||||
return m_calculated_style == other.m_calculated_style;
|
||||
return m_type == other.m_type && m_value == other.m_value;
|
||||
}
|
||||
|
||||
bool operator!=(const Length& other) const
|
||||
bool operator!=(Length const& other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ public:
|
|||
float relative_length_to_px(Gfx::IntRect const& viewport_rect, Gfx::FontPixelMetrics const& font_metrics, float font_size, float root_font_size) const;
|
||||
|
||||
private:
|
||||
const char* unit_name() const;
|
||||
char const* unit_name() const;
|
||||
|
||||
Type m_type;
|
||||
float m_value { 0 };
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/Dump.h>
|
||||
|
||||
static void log_parse_error(const SourceLocation& location = SourceLocation::current())
|
||||
static void log_parse_error(SourceLocation const& location = SourceLocation::current())
|
||||
{
|
||||
dbgln_if(CSS_PARSER_DEBUG, "Parse error (CSS) {}", location);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#define REPLACEMENT_CHARACTER 0xFFFD
|
||||
static constexpr u32 TOKENIZER_EOF = 0xFFFFFFFF;
|
||||
|
||||
static inline void log_parse_error(const SourceLocation& location = SourceLocation::current())
|
||||
static inline void log_parse_error(SourceLocation const& location = SourceLocation::current())
|
||||
{
|
||||
dbgln_if(CSS_TOKENIZER_DEBUG, "Parse error (css tokenization) {} ", location);
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ static inline bool is_E(u32 code_point)
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
Tokenizer::Tokenizer(StringView input, const String& encoding)
|
||||
Tokenizer::Tokenizer(StringView input, String const& encoding)
|
||||
{
|
||||
auto* decoder = TextCodec::decoder_for(encoding);
|
||||
VERIFY(decoder);
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
class Tokenizer {
|
||||
|
||||
public:
|
||||
explicit Tokenizer(StringView input, const String& encoding);
|
||||
explicit Tokenizer(StringView input, String const& encoding);
|
||||
|
||||
[[nodiscard]] Vector<Token> parse();
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ String Ratio::to_string() const
|
|||
return String::formatted("{} / {}", m_first_value, m_second_value);
|
||||
}
|
||||
|
||||
auto Ratio::operator<=>(const Ratio& other) const
|
||||
auto Ratio::operator<=>(Ratio const& other) const
|
||||
{
|
||||
return value() - other.value();
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ static inline bool matches_attribute(CSS::Selector::SimpleSelector::Attribute co
|
|||
return !attribute.value.is_empty()
|
||||
&& element.attribute(attribute.name).contains(attribute.value, case_sensitivity);
|
||||
case CSS::Selector::SimpleSelector::Attribute::MatchType::StartsWithSegment: {
|
||||
const auto element_attr_value = element.attribute(attribute.name);
|
||||
auto const element_attr_value = element.attribute(attribute.name);
|
||||
if (element_attr_value.is_empty()) {
|
||||
// If the attribute value on element is empty, the selector is true
|
||||
// if the match value is also empty and false otherwise.
|
||||
|
|
|
@ -862,7 +862,7 @@ void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* ele
|
|||
float font_size_in_px = 10;
|
||||
|
||||
if (font_size->is_identifier()) {
|
||||
switch (static_cast<const IdentifierStyleValue&>(*font_size).id()) {
|
||||
switch (static_cast<IdentifierStyleValue const&>(*font_size).id()) {
|
||||
case CSS::ValueID::XxSmall:
|
||||
case CSS::ValueID::XSmall:
|
||||
case CSS::ValueID::Small:
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
StyleProperties::StyleProperties(const StyleProperties& other)
|
||||
StyleProperties::StyleProperties(StyleProperties const& other)
|
||||
: m_property_values(other.m_property_values)
|
||||
{
|
||||
if (other.m_font) {
|
||||
|
@ -412,7 +412,7 @@ Optional<CSS::Position> StyleProperties::position() const
|
|||
}
|
||||
}
|
||||
|
||||
bool StyleProperties::operator==(const StyleProperties& other) const
|
||||
bool StyleProperties::operator==(StyleProperties const& other) const
|
||||
{
|
||||
if (m_property_values.size() != other.m_property_values.size())
|
||||
return false;
|
||||
|
|
|
@ -20,7 +20,7 @@ class StyleProperties : public RefCounted<StyleProperties> {
|
|||
public:
|
||||
StyleProperties() = default;
|
||||
|
||||
explicit StyleProperties(const StyleProperties&);
|
||||
explicit StyleProperties(StyleProperties const&);
|
||||
|
||||
static NonnullRefPtr<StyleProperties> create() { return adopt_ref(*new StyleProperties); }
|
||||
|
||||
|
@ -92,10 +92,10 @@ public:
|
|||
m_font = move(font);
|
||||
}
|
||||
|
||||
float line_height(const Layout::Node&) const;
|
||||
float line_height(Layout::Node const&) const;
|
||||
|
||||
bool operator==(const StyleProperties&) const;
|
||||
bool operator!=(const StyleProperties& other) const { return !(*this == other); }
|
||||
bool operator==(StyleProperties const&) const;
|
||||
bool operator!=(StyleProperties const& other) const { return !(*this == other); }
|
||||
|
||||
Optional<CSS::Position> position() const;
|
||||
Optional<int> z_index() const;
|
||||
|
|
|
@ -941,7 +941,7 @@ public:
|
|||
{
|
||||
if (type() != other.type())
|
||||
return false;
|
||||
return m_color == static_cast<const ColorStyleValue&>(other).m_color;
|
||||
return m_color == static_cast<ColorStyleValue const&>(other).m_color;
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -1151,7 +1151,7 @@ public:
|
|||
{
|
||||
if (type() != other.type())
|
||||
return false;
|
||||
return m_id == static_cast<const IdentifierStyleValue&>(other).m_id;
|
||||
return m_id == static_cast<IdentifierStyleValue const&>(other).m_id;
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue