1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 05:27:45 +00:00

LibWeb: Replace GlobalObject with VM in remaining AOs [Part 4/4]

This commit is contained in:
Linus Groh 2022-08-21 21:29:06 +01:00
parent 2d69a3b266
commit 7b990c27a1
9 changed files with 62 additions and 66 deletions

View file

@ -10,10 +10,8 @@
namespace Web::WebGL {
JS::ThrowCompletionOr<WebGLContextAttributes> convert_value_to_context_attributes_dictionary(JS::GlobalObject& global_object, JS::Value value)
JS::ThrowCompletionOr<WebGLContextAttributes> convert_value_to_context_attributes_dictionary(JS::VM& vm, JS::Value value)
{
auto& vm = global_object.vm();
// NOTE: This code was generated by the IDL code generator and then cleaned up.
if (!value.is_nullish() && !value.is_object())
return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAnObjectOfType, "WebGLContextAttributes");

View file

@ -29,6 +29,6 @@ struct WebGLContextAttributes {
bool desynchronized { false };
};
JS::ThrowCompletionOr<WebGLContextAttributes> convert_value_to_context_attributes_dictionary(JS::GlobalObject& global_object, JS::Value value);
JS::ThrowCompletionOr<WebGLContextAttributes> convert_value_to_context_attributes_dictionary(JS::VM&, JS::Value value);
}

View file

@ -33,7 +33,7 @@ JS::ThrowCompletionOr<RefPtr<WebGLRenderingContext>> WebGLRenderingContext::crea
{
// We should be coming here from getContext being called on a wrapped <canvas> element.
VERIFY(canvas_element.wrapper());
auto context_attributes = TRY(convert_value_to_context_attributes_dictionary(canvas_element.wrapper()->global_object(), options));
auto context_attributes = TRY(convert_value_to_context_attributes_dictionary(canvas_element.wrapper()->vm(), options));
bool created_bitmap = canvas_element.create_bitmap(/* minimum_width= */ 1, /* minimum_height= */ 1);
if (!created_bitmap) {