diff --git a/Libraries/LibWeb/CSS/CSSStyleProperties.cpp b/Libraries/LibWeb/CSS/CSSStyleProperties.cpp index 697861744d7..cc6b2e836a8 100644 --- a/Libraries/LibWeb/CSS/CSSStyleProperties.cpp +++ b/Libraries/LibWeb/CSS/CSSStyleProperties.cpp @@ -156,7 +156,7 @@ String CSSStyleProperties::item(size_t index) const return CSS::string_from_property_id(m_properties[index - custom_properties_count].property_id).to_string(); } -Optional CSSStyleProperties::property(PropertyID property_id) const +Optional CSSStyleProperties::get_property(PropertyID property_id) const { if (is_computed()) { if (!owner_node().has_value()) @@ -430,7 +430,7 @@ StringView CSSStyleProperties::get_property_priority(FlyString const& property_n return {}; return maybe_custom_property.value().important == Important::Yes ? "important"sv : ""sv; } - auto maybe_property = property(property_id.value()); + auto maybe_property = get_property(property_id.value()); if (!maybe_property.has_value()) return {}; return maybe_property->important == Important::Yes ? "important"sv : ""sv; @@ -494,7 +494,7 @@ Optional CSSStyleProperties::get_property_internal(PropertyID pro // NOTE: This is handled by the loop. } - return property(property_id); + return get_property(property_id); } static RefPtr resolve_color_style_value(StyleValue const& style_value, Color computed_color) diff --git a/Libraries/LibWeb/CSS/CSSStyleProperties.h b/Libraries/LibWeb/CSS/CSSStyleProperties.h index b7a491c81d5..699aeeba0e7 100644 --- a/Libraries/LibWeb/CSS/CSSStyleProperties.h +++ b/Libraries/LibWeb/CSS/CSSStyleProperties.h @@ -33,7 +33,7 @@ public: virtual size_t length() const override; virtual String item(size_t index) const override; - Optional property(PropertyID) const; + Optional get_property(PropertyID) const; Optional custom_property(FlyString const& custom_property_name) const; WebIDL::ExceptionOr set_property(PropertyID, StringView css_text, StringView priority = ""sv); diff --git a/Libraries/LibWeb/Editing/Internal/Algorithms.cpp b/Libraries/LibWeb/Editing/Internal/Algorithms.cpp index 3108bb41738..964db1b740b 100644 --- a/Libraries/LibWeb/Editing/Internal/Algorithms.cpp +++ b/Libraries/LibWeb/Editing/Internal/Algorithms.cpp @@ -615,7 +615,7 @@ Vector> clear_the_value(FlyString const& command, GC::Refproperty(CSS::PropertyID::TextDecoration); + auto style_property = inline_style->get_property(CSS::PropertyID::TextDecoration); if (!style_property.has_value()) return; @@ -2470,20 +2470,20 @@ bool is_simple_modifiable_element(GC::Ref node) // * It is a b or strong element with exactly one attribute, which is style, and the style attribute sets exactly // one CSS property (including invalid or unrecognized properties), which is "font-weight". if (html_element.local_name().is_one_of(HTML::TagNames::b, HTML::TagNames::strong) - && inline_style->property(CSS::PropertyID::FontWeight).has_value()) + && inline_style->get_property(CSS::PropertyID::FontWeight).has_value()) return true; // * It is an i or em element with exactly one attribute, which is style, and the style attribute sets exactly one // CSS property (including invalid or unrecognized properties), which is "font-style". if (html_element.local_name().is_one_of(HTML::TagNames::i, HTML::TagNames::em) - && inline_style->property(CSS::PropertyID::FontStyle).has_value()) + && inline_style->get_property(CSS::PropertyID::FontStyle).has_value()) return true; // * It is an a, font, or span element with exactly one attribute, which is style, and the style attribute sets // exactly one CSS property (including invalid or unrecognized properties), and that property is not // "text-decoration". if (html_element.local_name().is_one_of(HTML::TagNames::a, HTML::TagNames::font, HTML::TagNames::span) - && !inline_style->property(CSS::PropertyID::TextDecoration).has_value()) + && !inline_style->get_property(CSS::PropertyID::TextDecoration).has_value()) return true; // * It is an a, font, s, span, strike, or u element with exactly one attribute, which is style, and the style @@ -2491,7 +2491,7 @@ bool is_simple_modifiable_element(GC::Ref node) // "text-decoration", which is set to "line-through" or "underline" or "overline" or "none". if (html_element.local_name().is_one_of(HTML::TagNames::a, HTML::TagNames::font, HTML::TagNames::s, HTML::TagNames::span, HTML::TagNames::strike, HTML::TagNames::u) - && inline_style->property(CSS::PropertyID::TextDecoration).has_value()) { + && inline_style->get_property(CSS::PropertyID::TextDecoration).has_value()) { auto text_decoration = inline_style->text_decoration(); if (first_is_one_of(text_decoration, string_from_keyword(CSS::Keyword::LineThrough), @@ -2713,7 +2713,7 @@ void justify_the_selection(DOM::Document& document, JustifyAlignment alignment) ++number_of_matching_attributes; if (element->has_attribute(HTML::AttributeNames::style) && element->inline_style() && element->inline_style()->length() == 1) { - auto text_align = element->inline_style()->property(CSS::PropertyID::TextAlign); + auto text_align = element->inline_style()->get_property(CSS::PropertyID::TextAlign); if (text_align.has_value()) { auto align_value = text_align.value().value->to_string(CSS::SerializationMode::Normal); if (align_value.equals_ignoring_ascii_case(alignment_keyword)) @@ -4692,7 +4692,7 @@ Optional> property_in_style_attribute(GC::R return {}; // FIXME: This doesn't support shorthand properties. - auto style_property = inline_style->property(property_id); + auto style_property = inline_style->get_property(property_id); if (!style_property.has_value()) return {}; @@ -4726,7 +4726,7 @@ Optional> resolved_value(GC::Ref // Retrieve resolved style value auto resolved_css_style_declaration = CSS::CSSStyleProperties::create_resolved_style(element->realm(), DOM::AbstractElement { static_cast(*element) }); - auto optional_style_property = resolved_css_style_declaration->property(property_id); + auto optional_style_property = resolved_css_style_declaration->get_property(property_id); if (!optional_style_property.has_value()) return {}; return optional_style_property.value().value;