LibGC: Rename MarkedVector => RootVector

Let's try to make it a bit more clear that this is a Vector of GC roots.
This commit is contained in:
Andreas Kling 2024-12-26 14:32:52 +01:00 committed by Andreas Kling
commit 3bfb0534be
Notes: github-actions[bot] 2024-12-26 18:11:36 +00:00
117 changed files with 281 additions and 281 deletions

View file

@ -21,7 +21,7 @@ namespace Web::CSS {
GC_DEFINE_ALLOCATOR(CSSRuleList);
GC::Ref<CSSRuleList> CSSRuleList::create(JS::Realm& realm, GC::MarkedVector<CSSRule*> const& rules)
GC::Ref<CSSRuleList> CSSRuleList::create(JS::Realm& realm, GC::RootVector<CSSRule*> const& rules)
{
auto rule_list = realm.create<CSSRuleList>(realm);
for (auto* rule : rules)

View file

@ -25,7 +25,7 @@ class CSSRuleList : public Bindings::PlatformObject {
GC_DECLARE_ALLOCATOR(CSSRuleList);
public:
[[nodiscard]] static GC::Ref<CSSRuleList> create(JS::Realm&, GC::MarkedVector<CSSRule*> const&);
[[nodiscard]] static GC::Ref<CSSRuleList> create(JS::Realm&, GC::RootVector<CSSRule*> const&);
[[nodiscard]] static GC::Ref<CSSRuleList> create_empty(JS::Realm&);
~CSSRuleList() = default;

View file

@ -218,7 +218,7 @@ GC::Ref<WebIDL::Promise> CSSStyleSheet::replace(String text)
auto& rules = parsed_stylesheet->rules();
// 2. If rules contains one or more @import rules, remove those rules from rules.
GC::MarkedVector<GC::Ref<CSSRule>> rules_without_import(realm.heap());
GC::RootVector<GC::Ref<CSSRule>> rules_without_import(realm.heap());
for (auto rule : rules) {
if (rule->type() != CSSRule::Type::Import)
rules_without_import.append(rule);
@ -252,7 +252,7 @@ WebIDL::ExceptionOr<void> CSSStyleSheet::replace_sync(StringView text)
auto& rules = parsed_stylesheet->rules();
// 3. If rules contains one or more @import rules, remove those rules from rules.
GC::MarkedVector<GC::Ref<CSSRule>> rules_without_import(realm().heap());
GC::RootVector<GC::Ref<CSSRule>> rules_without_import(realm().heap());
for (auto rule : rules) {
if (rule->type() != CSSRule::Type::Import)
rules_without_import.append(rule);

View file

@ -249,7 +249,7 @@ JS::ThrowCompletionOr<GC::Ref<WebIDL::Promise>> FontFaceSet::load(String const&
// 4. Queue a task to run the following steps synchronously:
HTML::queue_a_task(HTML::Task::Source::FontLoading, nullptr, nullptr, GC::create_function(realm.heap(), [&realm, promise, matched_font_faces] {
GC::MarkedVector<GC::Ref<WebIDL::Promise>> promises(realm.heap());
GC::RootVector<GC::Ref<WebIDL::Promise>> promises(realm.heap());
// 1. For all of the font faces in the font face list, call their load() method.
for (auto font_face_value : *matched_font_faces) {

View file

@ -624,7 +624,7 @@ GC::Ptr<CSSMediaRule> Parser::convert_to_media_rule(AtRule const& rule, Nested n
auto media_query_list = parse_a_media_query_list(media_query_tokens);
auto media_list = MediaList::create(m_context.realm(), move(media_query_list));
GC::MarkedVector<CSSRule*> child_rules { m_context.realm().heap() };
GC::RootVector<CSSRule*> child_rules { m_context.realm().heap() };
for (auto const& child : rule.child_rules_and_lists_of_declarations) {
child.visit(
[&](Rule const& rule) {

View file

@ -158,7 +158,7 @@ CSSStyleSheet* Parser::parse_as_css_stylesheet(Optional<URL::URL> location)
auto const& style_sheet = parse_a_stylesheet(m_token_stream, {});
// Interpret all of the resulting top-level qualified rules as style rules, defined below.
GC::MarkedVector<CSSRule*> rules(m_context.realm().heap());
GC::RootVector<CSSRule*> rules(m_context.realm().heap());
for (auto const& raw_rule : style_sheet.rules) {
auto rule = convert_to_rule(raw_rule, Nested::No);
// If any style rule is invalid, or any at-rule is not recognized or is invalid according to its grammar or context, its a parse error.

View file

@ -107,7 +107,7 @@ GC::Ptr<CSSStyleRule> Parser::convert_to_style_rule(QualifiedRule const& qualifi
return {};
}
GC::MarkedVector<CSSRule*> child_rules { m_context.realm().heap() };
GC::RootVector<CSSRule*> child_rules { m_context.realm().heap() };
for (auto& child : qualified_rule.child_rules) {
child.visit(
[&](Rule const& rule) {
@ -246,7 +246,7 @@ GC::Ptr<CSSRule> Parser::convert_to_layer_rule(AtRule const& rule, Nested nested
}
// Then the rules
GC::MarkedVector<CSSRule*> child_rules { m_context.realm().heap() };
GC::RootVector<CSSRule*> child_rules { m_context.realm().heap() };
for (auto const& child : rule.child_rules_and_lists_of_declarations) {
child.visit(
[&](Rule const& rule) {
@ -341,7 +341,7 @@ GC::Ptr<CSSKeyframesRule> Parser::convert_to_keyframes_rule(AtRule const& rule)
auto name = name_token.to_string();
GC::MarkedVector<CSSRule*> keyframes(m_context.realm().heap());
GC::RootVector<CSSRule*> keyframes(m_context.realm().heap());
rule.for_each_as_qualified_rule_list([&](auto& qualified_rule) {
if (!qualified_rule.child_rules.is_empty()) {
dbgln_if(CSS_PARSER_DEBUG, "CSSParser: @keyframes keyframe rule contains at-rules; discarding them.");
@ -468,7 +468,7 @@ GC::Ptr<CSSSupportsRule> Parser::convert_to_supports_rule(AtRule const& rule, Ne
return {};
}
GC::MarkedVector<CSSRule*> child_rules { m_context.realm().heap() };
GC::RootVector<CSSRule*> child_rules { m_context.realm().heap() };
for (auto const& child : rule.child_rules_and_lists_of_declarations) {
child.visit(
[&](Rule const& rule) {