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

@ -381,18 +381,18 @@ bool is_element_obscured(ReadonlySpan<GC::Ref<Web::DOM::Element>> paint_tree, We
}
// https://w3c.github.io/webdriver/#dfn-pointer-interactable-paint-tree
GC::MarkedVector<GC::Ref<Web::DOM::Element>> pointer_interactable_tree(Web::HTML::BrowsingContext& browsing_context, Web::DOM::Element& element)
GC::RootVector<GC::Ref<Web::DOM::Element>> pointer_interactable_tree(Web::HTML::BrowsingContext& browsing_context, Web::DOM::Element& element)
{
// 1. If element is not in the same tree as session's current browsing context's active document, return an empty sequence.
if (!browsing_context.active_document()->contains(element))
return GC::MarkedVector<GC::Ref<Web::DOM::Element>>(browsing_context.heap());
return GC::RootVector<GC::Ref<Web::DOM::Element>>(browsing_context.heap());
// 2. Let rectangles be the DOMRect sequence returned by calling getClientRects().
auto rectangles = element.get_client_rects();
// 3. If rectangles has the length of 0, return an empty sequence.
if (rectangles->length() == 0)
return GC::MarkedVector<GC::Ref<Web::DOM::Element>>(browsing_context.heap());
return GC::RootVector<GC::Ref<Web::DOM::Element>>(browsing_context.heap());
// 4. Let center point be the in-view center point of the first indexed element in rectangles.
auto viewport = browsing_context.page().top_level_traversable()->viewport_rect();

View file

@ -44,7 +44,7 @@ bool is_element_non_typeable_form_control(Web::DOM::Element const&);
bool is_element_in_view(ReadonlySpan<GC::Ref<Web::DOM::Element>> paint_tree, Web::DOM::Element&);
bool is_element_obscured(ReadonlySpan<GC::Ref<Web::DOM::Element>> paint_tree, Web::DOM::Element&);
GC::MarkedVector<GC::Ref<Web::DOM::Element>> pointer_interactable_tree(Web::HTML::BrowsingContext&, Web::DOM::Element&);
GC::RootVector<GC::Ref<Web::DOM::Element>> pointer_interactable_tree(Web::HTML::BrowsingContext&, Web::DOM::Element&);
ByteString get_or_create_a_shadow_root_reference(HTML::BrowsingContext const&, Web::DOM::ShadowRoot const&);
JsonObject shadow_root_reference_object(HTML::BrowsingContext const&, Web::DOM::ShadowRoot const&);

View file

@ -84,7 +84,7 @@ static JS::ThrowCompletionOr<JS::Value> execute_a_function_body(HTML::BrowsingCo
return completion;
}
void execute_script(HTML::BrowsingContext const& browsing_context, ByteString body, GC::MarkedVector<JS::Value> arguments, Optional<u64> const& timeout_ms, GC::Ref<OnScriptComplete> on_complete)
void execute_script(HTML::BrowsingContext const& browsing_context, ByteString body, GC::RootVector<JS::Value> arguments, Optional<u64> const& timeout_ms, GC::Ref<OnScriptComplete> on_complete)
{
auto const* document = browsing_context.active_document();
auto& realm = document->realm();
@ -142,7 +142,7 @@ void execute_script(HTML::BrowsingContext const& browsing_context, ByteString bo
}
// https://w3c.github.io/webdriver/#execute-async-script
void execute_async_script(HTML::BrowsingContext const& browsing_context, ByteString body, GC::MarkedVector<JS::Value> arguments, Optional<u64> const& timeout_ms, GC::Ref<OnScriptComplete> on_complete)
void execute_async_script(HTML::BrowsingContext const& browsing_context, ByteString body, GC::RootVector<JS::Value> arguments, Optional<u64> const& timeout_ms, GC::Ref<OnScriptComplete> on_complete)
{
auto const* document = browsing_context.active_document();
auto& realm = document->realm();

View file

@ -23,7 +23,7 @@ struct ExecutionResult {
using OnScriptComplete = GC::Function<void(ExecutionResult)>;
void execute_script(HTML::BrowsingContext const&, ByteString body, GC::MarkedVector<JS::Value> arguments, Optional<u64> const& timeout_ms, GC::Ref<OnScriptComplete> on_complete);
void execute_async_script(HTML::BrowsingContext const&, ByteString body, GC::MarkedVector<JS::Value> arguments, Optional<u64> const& timeout_ms, GC::Ref<OnScriptComplete> on_complete);
void execute_script(HTML::BrowsingContext const&, ByteString body, GC::RootVector<JS::Value> arguments, Optional<u64> const& timeout_ms, GC::Ref<OnScriptComplete> on_complete);
void execute_async_script(HTML::BrowsingContext const&, ByteString body, GC::RootVector<JS::Value> arguments, Optional<u64> const& timeout_ms, GC::Ref<OnScriptComplete> on_complete);
}

View file

@ -253,7 +253,7 @@ static Response internal_json_clone(HTML::BrowsingContext const& browsing_contex
// -> has an own property named "toJSON" that is a Function
if (auto to_json = object.get_without_side_effects(vm.names.toJSON); to_json.is_function()) {
// Return success with the value returned by Function.[[Call]](toJSON) with value as the this value.
auto to_json_result = TRY_OR_JS_ERROR(to_json.as_function().internal_call(value, GC::MarkedVector<JS::Value> { vm.heap() }));
auto to_json_result = TRY_OR_JS_ERROR(to_json.as_function().internal_call(value, GC::RootVector<JS::Value> { vm.heap() }));
if (!to_json_result.is_string())
return WebDriver::Error::from_code(ErrorCode::JavascriptError, "toJSON did not return a String"sv);