mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:57:35 +00:00
Everywhere: Stop using NonnullRefPtrVector
This class had slightly confusing semantics and the added weirdness doesn't seem worth it just so we can say "." instead of "->" when iterating over a vector of NNRPs. This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
This commit is contained in:
parent
104be6c8ac
commit
8a48246ed1
168 changed files with 1280 additions and 1280 deletions
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue