diff options
Diffstat (limited to 'Userland/Libraries/LibWeb')
19 files changed, 64 insertions, 64 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp index a36e637a79..c886048f6c 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.cpp @@ -12,12 +12,12 @@ namespace Web::CSS { -WebIDL::ExceptionOr<JS::NonnullGCPtr<CSSStyleRule>> CSSStyleRule::create(JS::Realm& realm, NonnullRefPtrVector<Web::CSS::Selector>&& selectors, CSSStyleDeclaration& declaration) +WebIDL::ExceptionOr<JS::NonnullGCPtr<CSSStyleRule>> CSSStyleRule::create(JS::Realm& realm, Vector<NonnullRefPtr<Web::CSS::Selector>>&& selectors, CSSStyleDeclaration& declaration) { return MUST_OR_THROW_OOM(realm.heap().allocate<CSSStyleRule>(realm, realm, move(selectors), declaration)); } -CSSStyleRule::CSSStyleRule(JS::Realm& realm, NonnullRefPtrVector<Selector>&& selectors, CSSStyleDeclaration& declaration) +CSSStyleRule::CSSStyleRule(JS::Realm& realm, Vector<NonnullRefPtr<Selector>>&& selectors, CSSStyleDeclaration& declaration) : CSSRule(realm) , m_selectors(move(selectors)) , m_declaration(declaration) diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h index 1a9b15466a..a5ebb302e0 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleRule.h @@ -19,11 +19,11 @@ class CSSStyleRule final : public CSSRule { WEB_PLATFORM_OBJECT(CSSStyleRule, CSSRule); public: - static WebIDL::ExceptionOr<JS::NonnullGCPtr<CSSStyleRule>> create(JS::Realm&, NonnullRefPtrVector<Selector>&&, CSSStyleDeclaration&); + static WebIDL::ExceptionOr<JS::NonnullGCPtr<CSSStyleRule>> create(JS::Realm&, Vector<NonnullRefPtr<Selector>>&&, CSSStyleDeclaration&); virtual ~CSSStyleRule() override = default; - NonnullRefPtrVector<Selector> const& selectors() const { return m_selectors; } + Vector<NonnullRefPtr<Selector>> const& selectors() const { return m_selectors; } CSSStyleDeclaration const& declaration() const { return m_declaration; } virtual Type type() const override { return Type::Style; }; @@ -34,13 +34,13 @@ public: CSSStyleDeclaration* style(); private: - CSSStyleRule(JS::Realm&, NonnullRefPtrVector<Selector>&&, CSSStyleDeclaration&); + CSSStyleRule(JS::Realm&, Vector<NonnullRefPtr<Selector>>&&, CSSStyleDeclaration&); virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; virtual DeprecatedString serialized() const override; - NonnullRefPtrVector<Selector> m_selectors; + Vector<NonnullRefPtr<Selector>> m_selectors; CSSStyleDeclaration& m_declaration; }; diff --git a/Userland/Libraries/LibWeb/CSS/MediaList.cpp b/Userland/Libraries/LibWeb/CSS/MediaList.cpp index fc97206bc5..c3abe4c2f0 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaList.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaList.cpp @@ -13,12 +13,12 @@ namespace Web::CSS { -WebIDL::ExceptionOr<JS::NonnullGCPtr<MediaList>> MediaList::create(JS::Realm& realm, NonnullRefPtrVector<MediaQuery>&& media) +WebIDL::ExceptionOr<JS::NonnullGCPtr<MediaList>> MediaList::create(JS::Realm& realm, Vector<NonnullRefPtr<MediaQuery>>&& media) { return MUST_OR_THROW_OOM(realm.heap().allocate<MediaList>(realm, realm, move(media))); } -MediaList::MediaList(JS::Realm& realm, NonnullRefPtrVector<MediaQuery>&& media) +MediaList::MediaList(JS::Realm& realm, Vector<NonnullRefPtr<MediaQuery>>&& media) : Bindings::LegacyPlatformObject(realm) , m_media(move(media)) { @@ -58,7 +58,7 @@ DeprecatedString MediaList::item(u32 index) const if (!is_supported_property_index(index)) return {}; - return m_media[index].to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string(); + return m_media[index]->to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string(); } // https://www.w3.org/TR/cssom-1/#dom-medialist-appendmedium @@ -74,7 +74,7 @@ void MediaList::append_medium(DeprecatedString medium) // 3. If comparing m with any of the media queries in the collection of media queries returns true, then return. auto serialized = m->to_string().release_value_but_fixme_should_propagate_errors(); for (auto& existing_medium : m_media) { - if (existing_medium.to_string().release_value_but_fixme_should_propagate_errors() == serialized) + if (existing_medium->to_string().release_value_but_fixme_should_propagate_errors() == serialized) return; } @@ -97,7 +97,7 @@ void MediaList::delete_medium(DeprecatedString medium) bool MediaList::evaluate(HTML::Window const& window) { for (auto& media : m_media) - media.evaluate(window); + media->evaluate(window); return matches(); } @@ -109,7 +109,7 @@ bool MediaList::matches() const } for (auto& media : m_media) { - if (media.matches()) + if (media->matches()) return true; } return false; @@ -119,7 +119,7 @@ WebIDL::ExceptionOr<JS::Value> MediaList::item_value(size_t index) const { if (index >= m_media.size()) return JS::js_undefined(); - return JS::PrimitiveString::create(vm(), m_media[index].to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string()); + return JS::PrimitiveString::create(vm(), m_media[index]->to_string().release_value_but_fixme_should_propagate_errors().to_deprecated_string()); } } diff --git a/Userland/Libraries/LibWeb/CSS/MediaList.h b/Userland/Libraries/LibWeb/CSS/MediaList.h index 182e9ace2b..52b0bb6252 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaList.h +++ b/Userland/Libraries/LibWeb/CSS/MediaList.h @@ -21,7 +21,7 @@ class MediaList final : public Bindings::LegacyPlatformObject { WEB_PLATFORM_OBJECT(MediaList, Bindings::LegacyPlatformObject); public: - static WebIDL::ExceptionOr<JS::NonnullGCPtr<MediaList>> create(JS::Realm&, NonnullRefPtrVector<MediaQuery>&& media); + static WebIDL::ExceptionOr<JS::NonnullGCPtr<MediaList>> create(JS::Realm&, Vector<NonnullRefPtr<MediaQuery>>&& media); ~MediaList() = default; DeprecatedString media_text() const; @@ -38,7 +38,7 @@ public: bool matches() const; private: - MediaList(JS::Realm&, NonnullRefPtrVector<MediaQuery>&&); + MediaList(JS::Realm&, Vector<NonnullRefPtr<MediaQuery>>&&); virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override; @@ -55,7 +55,7 @@ private: virtual bool named_property_setter_has_identifier() const override { return false; } virtual bool named_property_deleter_has_identifier() const override { return false; } - NonnullRefPtrVector<MediaQuery> m_media; + Vector<NonnullRefPtr<MediaQuery>> m_media; }; } diff --git a/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp b/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp index b7e328122c..1ddd7bcdb9 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp @@ -379,7 +379,7 @@ bool MediaQuery::evaluate(HTML::Window const& window) } // https://www.w3.org/TR/cssom-1/#serialize-a-media-query-list -ErrorOr<String> serialize_a_media_query_list(NonnullRefPtrVector<MediaQuery> const& media_queries) +ErrorOr<String> serialize_a_media_query_list(Vector<NonnullRefPtr<MediaQuery>> const& media_queries) { // 1. If the media query list is empty, then return the empty string. if (media_queries.is_empty()) diff --git a/Userland/Libraries/LibWeb/CSS/MediaQuery.h b/Userland/Libraries/LibWeb/CSS/MediaQuery.h index 050c95cb8b..88115a1547 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQuery.h +++ b/Userland/Libraries/LibWeb/CSS/MediaQuery.h @@ -254,7 +254,7 @@ private: bool m_matches { false }; }; -ErrorOr<String> serialize_a_media_query_list(NonnullRefPtrVector<MediaQuery> const&); +ErrorOr<String> serialize_a_media_query_list(Vector<NonnullRefPtr<MediaQuery>> const&); bool is_media_feature_name(StringView name); diff --git a/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp b/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp index 9e6b1d9dbd..eaa1c51281 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaQueryList.cpp @@ -15,12 +15,12 @@ namespace Web::CSS { -WebIDL::ExceptionOr<JS::NonnullGCPtr<MediaQueryList>> MediaQueryList::create(DOM::Document& document, NonnullRefPtrVector<MediaQuery>&& media) +WebIDL::ExceptionOr<JS::NonnullGCPtr<MediaQueryList>> MediaQueryList::create(DOM::Document& document, Vector<NonnullRefPtr<MediaQuery>>&& media) { return MUST_OR_THROW_OOM(document.heap().allocate<MediaQueryList>(document.realm(), document, move(media))); } -MediaQueryList::MediaQueryList(DOM::Document& document, NonnullRefPtrVector<MediaQuery>&& media) +MediaQueryList::MediaQueryList(DOM::Document& document, Vector<NonnullRefPtr<MediaQuery>>&& media) : DOM::EventTarget(document.realm()) , m_document(document) , m_media(move(media)) @@ -52,7 +52,7 @@ DeprecatedString MediaQueryList::media() const bool MediaQueryList::matches() const { for (auto& media : m_media) { - if (media.matches()) + if (media->matches()) return true; } return false; @@ -62,7 +62,7 @@ bool MediaQueryList::evaluate() { bool now_matches = false; for (auto& media : m_media) { - now_matches = now_matches || media.evaluate(m_document->window()); + now_matches = now_matches || media->evaluate(m_document->window()); } return now_matches; diff --git a/Userland/Libraries/LibWeb/CSS/MediaQueryList.h b/Userland/Libraries/LibWeb/CSS/MediaQueryList.h index d53b607309..276c84c14f 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQueryList.h +++ b/Userland/Libraries/LibWeb/CSS/MediaQueryList.h @@ -17,7 +17,7 @@ class MediaQueryList final : public DOM::EventTarget { WEB_PLATFORM_OBJECT(MediaQueryList, DOM::EventTarget); public: - static WebIDL::ExceptionOr<JS::NonnullGCPtr<MediaQueryList>> create(DOM::Document&, NonnullRefPtrVector<MediaQuery>&&); + static WebIDL::ExceptionOr<JS::NonnullGCPtr<MediaQueryList>> create(DOM::Document&, Vector<NonnullRefPtr<MediaQuery>>&&); virtual ~MediaQueryList() override = default; @@ -32,13 +32,13 @@ public: WebIDL::CallbackType* onchange(); private: - MediaQueryList(DOM::Document&, NonnullRefPtrVector<MediaQuery>&&); + MediaQueryList(DOM::Document&, Vector<NonnullRefPtr<MediaQuery>>&&); virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; JS::NonnullGCPtr<DOM::Document> m_document; - NonnullRefPtrVector<MediaQuery> m_media; + Vector<NonnullRefPtr<MediaQuery>> m_media; }; } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index c2fefa1638..c8d4ac46e7 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -156,7 +156,7 @@ Parser::ParseErrorOr<SelectorList> Parser::parse_a_selector_list(TokenStream<T>& { auto comma_separated_lists = parse_a_comma_separated_list_of_component_values(tokens); - NonnullRefPtrVector<Selector> selectors; + Vector<NonnullRefPtr<Selector>> selectors; for (auto& selector_parts : comma_separated_lists) { auto stream = TokenStream(selector_parts); auto selector = parse_complex_selector(stream, mode); @@ -662,19 +662,19 @@ Parser::ParseErrorOr<Optional<Selector::SimpleSelector>> Parser::parse_simple_se return ParseError::SyntaxError; } -NonnullRefPtrVector<MediaQuery> Parser::parse_as_media_query_list() +Vector<NonnullRefPtr<MediaQuery>> Parser::parse_as_media_query_list() { return parse_a_media_query_list(m_token_stream); } template<typename T> -NonnullRefPtrVector<MediaQuery> Parser::parse_a_media_query_list(TokenStream<T>& tokens) +Vector<NonnullRefPtr<MediaQuery>> Parser::parse_a_media_query_list(TokenStream<T>& tokens) { // https://www.w3.org/TR/mediaqueries-4/#mq-list auto comma_separated_lists = parse_a_comma_separated_list_of_component_values(tokens); - AK::NonnullRefPtrVector<MediaQuery> media_queries; + AK::Vector<NonnullRefPtr<MediaQuery>> media_queries; for (auto& media_query_parts : comma_separated_lists) { auto stream = TokenStream(media_query_parts); media_queries.append(parse_media_query(stream)); @@ -1443,12 +1443,12 @@ Optional<GeneralEnclosed> Parser::parse_general_enclosed(TokenStream<ComponentVa // 5.4.1. Consume a list of rules // https://www.w3.org/TR/css-syntax-3/#consume-list-of-rules template<typename T> -NonnullRefPtrVector<Rule> Parser::consume_a_list_of_rules(TokenStream<T>& tokens, TopLevel top_level) +Vector<NonnullRefPtr<Rule>> Parser::consume_a_list_of_rules(TokenStream<T>& tokens, TopLevel top_level) { // To consume a list of rules, given a top-level flag: // Create an initially empty list of rules. - NonnullRefPtrVector<Rule> rules; + Vector<NonnullRefPtr<Rule>> rules; // Repeatedly consume the next input token: for (;;) { @@ -2075,7 +2075,7 @@ RefPtr<Rule> Parser::parse_a_rule(TokenStream<T>& tokens) // 5.3.4. Parse a list of rules // https://www.w3.org/TR/css-syntax-3/#parse-list-of-rules template<typename T> -NonnullRefPtrVector<Rule> Parser::parse_a_list_of_rules(TokenStream<T>& tokens) +Vector<NonnullRefPtr<Rule>> Parser::parse_a_list_of_rules(TokenStream<T>& tokens) { // To parse a list of rules from input: @@ -7443,7 +7443,7 @@ RefPtr<CSS::MediaQuery> parse_media_query(CSS::Parser::ParsingContext const& con return parser.parse_as_media_query(); } -NonnullRefPtrVector<CSS::MediaQuery> parse_media_query_list(CSS::Parser::ParsingContext const& context, StringView string) +Vector<NonnullRefPtr<CSS::MediaQuery>> parse_media_query_list(CSS::Parser::ParsingContext const& context, StringView string) { CSS::Parser::Parser parser(context, string); return parser.parse_as_media_query_list(); diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.h b/Userland/Libraries/LibWeb/CSS/Parser/Parser.h index eabad979e6..561c490504 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.h @@ -78,7 +78,7 @@ public: Optional<SelectorList> parse_as_selector(SelectorParsingMode = SelectorParsingMode::Standard); Optional<SelectorList> parse_as_relative_selector(SelectorParsingMode = SelectorParsingMode::Standard); - NonnullRefPtrVector<MediaQuery> parse_as_media_query_list(); + Vector<NonnullRefPtr<MediaQuery>> parse_as_media_query_list(); RefPtr<MediaQuery> parse_as_media_query(); RefPtr<Supports> parse_as_supports(); @@ -99,14 +99,14 @@ private: // "Parse a stylesheet" is intended to be the normal parser entry point, for parsing stylesheets. struct ParsedStyleSheet { Optional<AK::URL> location; - NonnullRefPtrVector<Rule> rules; + Vector<NonnullRefPtr<Rule>> rules; }; template<typename T> ParsedStyleSheet parse_a_stylesheet(TokenStream<T>&, Optional<AK::URL> location); // "Parse a list of rules" is intended for the content of at-rules such as @media. It differs from "Parse a stylesheet" in the handling of <CDO-token> and <CDC-token>. template<typename T> - NonnullRefPtrVector<Rule> parse_a_list_of_rules(TokenStream<T>&); + Vector<NonnullRefPtr<Rule>> parse_a_list_of_rules(TokenStream<T>&); // "Parse a rule" is intended for use by the CSSStyleSheet#insertRule method, and similar functions which might exist, which parse text into a single rule. template<typename T> @@ -142,7 +142,7 @@ private: ParseErrorOr<SelectorList> parse_a_selector_list(TokenStream<T>&, SelectorType, SelectorParsingMode = SelectorParsingMode::Standard); template<typename T> - NonnullRefPtrVector<MediaQuery> parse_a_media_query_list(TokenStream<T>&); + Vector<NonnullRefPtr<MediaQuery>> parse_a_media_query_list(TokenStream<T>&); template<typename T> RefPtr<Supports> parse_a_supports(TokenStream<T>&); @@ -153,7 +153,7 @@ private: Yes }; template<typename T> - [[nodiscard]] NonnullRefPtrVector<Rule> consume_a_list_of_rules(TokenStream<T>&, TopLevel); + [[nodiscard]] Vector<NonnullRefPtr<Rule>> consume_a_list_of_rules(TokenStream<T>&, TopLevel); template<typename T> [[nodiscard]] NonnullRefPtr<Rule> consume_an_at_rule(TokenStream<T>&); template<typename T> @@ -377,7 +377,7 @@ RefPtr<CSS::StyleValue> parse_css_value(CSS::Parser::ParsingContext const&, Stri Optional<CSS::SelectorList> parse_selector(CSS::Parser::ParsingContext const&, StringView); CSS::CSSRule* parse_css_rule(CSS::Parser::ParsingContext const&, StringView); RefPtr<CSS::MediaQuery> parse_media_query(CSS::Parser::ParsingContext const&, StringView); -NonnullRefPtrVector<CSS::MediaQuery> parse_media_query_list(CSS::Parser::ParsingContext const&, StringView); +Vector<NonnullRefPtr<CSS::MediaQuery>> parse_media_query_list(CSS::Parser::ParsingContext const&, StringView); RefPtr<CSS::Supports> parse_css_supports(CSS::Parser::ParsingContext const&, StringView); } diff --git a/Userland/Libraries/LibWeb/CSS/Selector.cpp b/Userland/Libraries/LibWeb/CSS/Selector.cpp index a43e1b4ccf..d0f21139b5 100644 --- a/Userland/Libraries/LibWeb/CSS/Selector.cpp +++ b/Userland/Libraries/LibWeb/CSS/Selector.cpp @@ -45,7 +45,7 @@ u32 Selector::specificity() const auto count_specificity_of_most_complex_selector = [&](auto& selector_list) { u32 max_selector_list_argument_specificity = 0; for (auto const& complex_selector : selector_list) { - max_selector_list_argument_specificity = max(max_selector_list_argument_specificity, complex_selector.specificity()); + max_selector_list_argument_specificity = max(max_selector_list_argument_specificity, complex_selector->specificity()); } u32 child_ids = (max_selector_list_argument_specificity & ids_mask) >> ids_shift; @@ -337,7 +337,7 @@ ErrorOr<String> Selector::serialize() const } // https://www.w3.org/TR/cssom/#serialize-a-group-of-selectors -ErrorOr<String> serialize_a_group_of_selectors(NonnullRefPtrVector<Selector> const& selectors) +ErrorOr<String> serialize_a_group_of_selectors(Vector<NonnullRefPtr<Selector>> const& selectors) { // To serialize a group of selectors serialize each selector in the group of selectors and then serialize a comma-separated list of these serializations. return String::join(", "sv, selectors); diff --git a/Userland/Libraries/LibWeb/CSS/Selector.h b/Userland/Libraries/LibWeb/CSS/Selector.h index fb9e0976d2..94bc0051fd 100644 --- a/Userland/Libraries/LibWeb/CSS/Selector.h +++ b/Userland/Libraries/LibWeb/CSS/Selector.h @@ -15,7 +15,7 @@ namespace Web::CSS { -using SelectorList = NonnullRefPtrVector<class Selector>; +using SelectorList = Vector<NonnullRefPtr<class Selector>>; // This is a <complex-selector> in the spec. https://www.w3.org/TR/selectors-4/#complex class Selector : public RefCounted<Selector> { @@ -294,7 +294,7 @@ constexpr StringView pseudo_class_name(Selector::SimpleSelector::PseudoClass::Ty VERIFY_NOT_REACHED(); } -ErrorOr<String> serialize_a_group_of_selectors(NonnullRefPtrVector<Selector> const& selectors); +ErrorOr<String> serialize_a_group_of_selectors(Vector<NonnullRefPtr<Selector>> const& selectors); } diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index f76ef83c44..e3664e337d 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -184,8 +184,8 @@ Vector<MatchingRule> StyleComputer::collect_matching_rules(DOM::Element const& e sheet.for_each_effective_style_rule([&](auto const& rule) { size_t selector_index = 0; for (auto& selector : rule.selectors()) { - if (SelectorEngine::matches(selector, element, pseudo_element)) { - matching_rules.append({ &rule, style_sheet_index, rule_index, selector_index, selector.specificity() }); + if (SelectorEngine::matches(*selector, element, pseudo_element)) { + matching_rules.append({ &rule, style_sheet_index, rule_index, selector_index, selector->specificity() }); break; } ++selector_index; @@ -203,9 +203,9 @@ static void sort_matching_rules(Vector<MatchingRule>& matching_rules) quick_sort(matching_rules, [&](MatchingRule& a, MatchingRule& b) { auto const& a_selector = a.rule->selectors()[a.selector_index]; auto const& b_selector = b.rule->selectors()[b.selector_index]; - auto a_specificity = a_selector.specificity(); - auto b_specificity = b_selector.specificity(); - if (a_selector.specificity() == b_selector.specificity()) { + auto a_specificity = a_selector->specificity(); + auto b_specificity = b_selector->specificity(); + if (a_selector->specificity() == b_selector->specificity()) { if (a.style_sheet_index == b.style_sheet_index) return a.rule_index < b.rule_index; return a.style_sheet_index < b.style_sheet_index; @@ -1406,7 +1406,7 @@ PropertyDependencyNode::PropertyDependencyNode(String name) void PropertyDependencyNode::add_child(NonnullRefPtr<PropertyDependencyNode> new_child) { for (auto const& child : m_children) { - if (child.m_name == new_child->m_name) + if (child->m_name == new_child->m_name) return; } @@ -1422,7 +1422,7 @@ bool PropertyDependencyNode::has_cycles() TemporaryChange change { m_marked, true }; for (auto& child : m_children) { - if (child.has_cycles()) + if (child->has_cycles()) return true; } return false; diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.h b/Userland/Libraries/LibWeb/CSS/StyleComputer.h index dce9551cf3..5c02fb7338 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.h +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.h @@ -43,7 +43,7 @@ private: explicit PropertyDependencyNode(String name); String m_name; - NonnullRefPtrVector<PropertyDependencyNode> m_children; + Vector<NonnullRefPtr<PropertyDependencyNode>> m_children; bool m_marked { false }; }; diff --git a/Userland/Libraries/LibWeb/HTML/Path2D.cpp b/Userland/Libraries/LibWeb/HTML/Path2D.cpp index aa0708c939..b99a262c62 100644 --- a/Userland/Libraries/LibWeb/HTML/Path2D.cpp +++ b/Userland/Libraries/LibWeb/HTML/Path2D.cpp @@ -42,7 +42,7 @@ Path2D::Path2D(JS::Realm& realm, Optional<Variant<JS::Handle<Path2D>, Deprecated if (!svg_path.segments().is_empty()) { // 5. Let (x, y) be the last point in svgPath. - auto xy = svg_path.segments().last().point(); + auto xy = svg_path.segments().last()->point(); // 6. Add all the subpaths, if any, from svgPath to output. this->path() = move(svg_path); @@ -85,7 +85,7 @@ WebIDL::ExceptionOr<void> Path2D::add_path(JS::NonnullGCPtr<Path2D> path, Geomet auto copy = path->path().copy_transformed(Gfx::AffineTransform { static_cast<float>(matrix->m11()), static_cast<float>(matrix->m12()), static_cast<float>(matrix->m21()), static_cast<float>(matrix->m22()), static_cast<float>(matrix->m41()), static_cast<float>(matrix->m42()) }); // 6. Let (x, y) be the last point in the last subpath of c. - auto xy = copy.segments().last().point(); + auto xy = copy.segments().last()->point(); // 7. Add all the subpaths in c to a. // FIXME: Is this correct? diff --git a/Userland/Libraries/LibWeb/HTML/Window.h b/Userland/Libraries/LibWeb/HTML/Window.h index a78a6a009f..5238414e36 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.h +++ b/Userland/Libraries/LibWeb/HTML/Window.h @@ -183,9 +183,9 @@ private: AnimationFrameCallbackDriver m_animation_frame_callback_driver; // https://w3c.github.io/requestidlecallback/#dfn-list-of-idle-request-callbacks - NonnullRefPtrVector<IdleCallback> m_idle_request_callbacks; + Vector<NonnullRefPtr<IdleCallback>> m_idle_request_callbacks; // https://w3c.github.io/requestidlecallback/#dfn-list-of-runnable-idle-callbacks - NonnullRefPtrVector<IdleCallback> m_runnable_idle_callbacks; + Vector<NonnullRefPtr<IdleCallback>> m_runnable_idle_callbacks; // https://w3c.github.io/requestidlecallback/#dfn-idle-callback-identifier u32 m_idle_callback_identifier = 0; diff --git a/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp b/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp index 384ef38ac3..2333aec577 100644 --- a/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp @@ -64,27 +64,27 @@ void SVGGeometryPaintable::paint(PaintContext& context, PaintPhase phase) const }; for (auto& segment : path.segments()) { - switch (segment.type()) { + switch (segment->type()) { case Gfx::Segment::Type::Invalid: break; case Gfx::Segment::Type::MoveTo: - new_path.move_to(transform_point(segment.point())); + new_path.move_to(transform_point(segment->point())); break; case Gfx::Segment::Type::LineTo: - new_path.line_to(transform_point(segment.point())); + new_path.line_to(transform_point(segment->point())); break; case Gfx::Segment::Type::QuadraticBezierCurveTo: { - auto& quadratic_bezier_segment = static_cast<Gfx::QuadraticBezierCurveSegment const&>(segment); + auto& quadratic_bezier_segment = static_cast<Gfx::QuadraticBezierCurveSegment const&>(*segment); new_path.quadratic_bezier_curve_to(transform_point(quadratic_bezier_segment.through()), transform_point(quadratic_bezier_segment.point())); break; } case Gfx::Segment::Type::CubicBezierCurveTo: { - auto& cubic_bezier_segment = static_cast<Gfx::CubicBezierCurveSegment const&>(segment); + auto& cubic_bezier_segment = static_cast<Gfx::CubicBezierCurveSegment const&>(*segment); new_path.cubic_bezier_curve_to(transform_point(cubic_bezier_segment.through_0()), transform_point(cubic_bezier_segment.through_1()), transform_point(cubic_bezier_segment.point())); break; } case Gfx::Segment::Type::EllipticalArcTo: { - auto& elliptical_arc_segment = static_cast<Gfx::EllipticalArcSegment const&>(segment); + auto& elliptical_arc_segment = static_cast<Gfx::EllipticalArcSegment const&>(*segment); new_path.elliptical_arc_to(transform_point(elliptical_arc_segment.point()), elliptical_arc_segment.radii().scaled_by(scaling, scaling), elliptical_arc_segment.x_axis_rotation(), elliptical_arc_segment.large_arc(), elliptical_arc_segment.sweep()); break; } diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp index d516f8486d..a9c66f9e37 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp @@ -115,7 +115,7 @@ Gfx::Path path_from_path_instructions(ReadonlySpan<PathInstruction> instructions for (auto& instruction : instructions) { // If the first path element uses relative coordinates, we treat them as absolute by making them relative to (0, 0). - auto last_point = path.segments().is_empty() ? Gfx::FloatPoint { 0, 0 } : path.segments().last().point(); + auto last_point = path.segments().is_empty() ? Gfx::FloatPoint { 0, 0 } : path.segments().last()->point(); auto& absolute = instruction.absolute; auto& data = instruction.data; diff --git a/Userland/Libraries/LibWeb/WebIDL/OverloadResolution.cpp b/Userland/Libraries/LibWeb/WebIDL/OverloadResolution.cpp index d827d846de..9538796d7d 100644 --- a/Userland/Libraries/LibWeb/WebIDL/OverloadResolution.cpp +++ b/Userland/Libraries/LibWeb/WebIDL/OverloadResolution.cpp @@ -139,7 +139,7 @@ JS::ThrowCompletionOr<ResolvedOverload> resolve_overload(JS::VM& vm, IDL::Effect if (type.is_union()) { auto flattened_members = type.as_union().flattened_member_types(); for (auto const& member : flattened_members) { - if (member.is_nullable()) + if (member->is_nullable()) return true; // FIXME: - a dictionary type // FIXME: - an annotated type whose inner type is one of the above types @@ -351,7 +351,7 @@ JS::ThrowCompletionOr<ResolvedOverload> resolve_overload(JS::VM& vm, IDL::Effect } // 18. Otherwise: if there is an entry in S that has any at position i of its type list, then remove from S all other entries. - else if (overloads.has_overload_with_matching_argument_at_index(i, [](auto const& type, auto) { return type.is_any(); })) { + else if (overloads.has_overload_with_matching_argument_at_index(i, [](auto const& type, auto) { return type->is_any(); })) { overloads.remove_all_other_entries(); } |