diff --git a/Libraries/LibWeb/CSS/CSSStyleRule.cpp b/Libraries/LibWeb/CSS/CSSStyleRule.cpp index 010953d791c..3c42b5d1558 100644 --- a/Libraries/LibWeb/CSS/CSSStyleRule.cpp +++ b/Libraries/LibWeb/CSS/CSSStyleRule.cpp @@ -43,7 +43,7 @@ void CSSStyleRule::visit_edges(Cell::Visitor& visitor) } // https://drafts.csswg.org/cssom-1/#dom-cssstylerule-style -CSSStyleProperties* CSSStyleRule::style() +GC::Ref CSSStyleRule::style() { return m_declaration; } diff --git a/Libraries/LibWeb/CSS/CSSStyleRule.h b/Libraries/LibWeb/CSS/CSSStyleRule.h index 572be8bd494..d1f14185f2c 100644 --- a/Libraries/LibWeb/CSS/CSSStyleRule.h +++ b/Libraries/LibWeb/CSS/CSSStyleRule.h @@ -30,7 +30,7 @@ public: String selector_text() const; void set_selector_text(StringView); - CSSStyleProperties* style(); + GC::Ref style(); [[nodiscard]] FlyString const& qualified_layer_name() const { return parent_layer_internal_qualified_name(); } diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp index 07ed6c07b7e..d8a50e62e12 100644 --- a/Libraries/LibWeb/DOM/Element.cpp +++ b/Libraries/LibWeb/DOM/Element.cpp @@ -918,11 +918,11 @@ void Element::set_shadow_root(GC::Ptr shadow_root) invalidate_style(StyleInvalidationReason::ElementSetShadowRoot); } -CSS::CSSStyleProperties* Element::style_for_bindings() +GC::Ref Element::style_for_bindings() { if (!m_inline_style) m_inline_style = CSS::CSSStyleProperties::create_element_inline_style({ *this }, {}, {}); - return m_inline_style; + return *m_inline_style; } // https://dom.spec.whatwg.org/#element-html-uppercased-qualified-name diff --git a/Libraries/LibWeb/DOM/Element.h b/Libraries/LibWeb/DOM/Element.h index da314eda2e3..bab7dd93e25 100644 --- a/Libraries/LibWeb/DOM/Element.h +++ b/Libraries/LibWeb/DOM/Element.h @@ -214,7 +214,7 @@ public: GC::Ptr inline_style() { return m_inline_style; } GC::Ptr inline_style() const { return m_inline_style; } - CSS::CSSStyleProperties* style_for_bindings(); + GC::Ref style_for_bindings(); CSS::StyleSheetList& document_or_shadow_root_style_sheets(); diff --git a/Libraries/LibWeb/Editing/Internal/Algorithms.cpp b/Libraries/LibWeb/Editing/Internal/Algorithms.cpp index f5680fbb69c..0e039317991 100644 --- a/Libraries/LibWeb/Editing/Internal/Algorithms.cpp +++ b/Libraries/LibWeb/Editing/Internal/Algorithms.cpp @@ -2669,7 +2669,7 @@ void justify_the_selection(DOM::Document& document, JustifyAlignment alignment) element->remove_attribute_ns(Namespace::HTML, HTML::AttributeNames::align); // 2. Unset the CSS property "text-align" on element, if it's set by a style attribute. - auto* inline_style = element->style_for_bindings(); + auto inline_style = element->style_for_bindings(); MUST(inline_style->remove_property(CSS::PropertyID::TextAlign)); // 3. If element is a div or span or center with no attributes, remove it, preserving its descendants.