LibWeb: Enable EXPLICIT_SYMBOL_EXPORT

This commit is contained in:
ayeteadoe 2025-07-19 19:35:33 -07:00 committed by Andrew Kaster
parent 94a3a7d9a1
commit 3df8e00d91
Notes: github-actions[bot] 2025-08-23 22:05:58 +00:00
256 changed files with 728 additions and 512 deletions

View file

@ -15,6 +15,7 @@
#include <LibJS/Runtime/FunctionObject.h>
#include <LibJS/Runtime/TypedArray.h>
#include <LibJS/Runtime/ValueInlines.h>
#include <LibWeb/Export.h>
#include <LibWeb/HTML/Scripting/Environments.h>
#include <LibWeb/HTML/WindowOrWorkerGlobalScope.h>
#include <LibWeb/WebIDL/AbstractOperations.h>
@ -538,14 +539,14 @@ JS::ThrowCompletionOr<T> convert_to_int(JS::VM& vm, JS::Value value, EnforceRang
return x;
}
template JS::ThrowCompletionOr<Byte> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
template JS::ThrowCompletionOr<Octet> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
template JS::ThrowCompletionOr<Short> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
template JS::ThrowCompletionOr<UnsignedShort> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
template JS::ThrowCompletionOr<Long> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
template JS::ThrowCompletionOr<UnsignedLong> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
template JS::ThrowCompletionOr<LongLong> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
template JS::ThrowCompletionOr<UnsignedLongLong> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
template WEB_API JS::ThrowCompletionOr<Byte> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
template WEB_API JS::ThrowCompletionOr<Octet> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
template WEB_API JS::ThrowCompletionOr<Short> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
template WEB_API JS::ThrowCompletionOr<UnsignedShort> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
template WEB_API JS::ThrowCompletionOr<Long> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
template WEB_API JS::ThrowCompletionOr<UnsignedLong> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
template WEB_API JS::ThrowCompletionOr<LongLong> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
template WEB_API JS::ThrowCompletionOr<UnsignedLongLong> convert_to_int(JS::VM& vm, JS::Value, EnforceRange, Clamp);
// AD-HOC: For same-object caching purposes, this can be used to compare a cached JS array of DOM::Elements with another
// list. Either list can be null, in which case they are considered the same only if they are both null.

View file

@ -12,19 +12,20 @@
#include <LibGC/Ptr.h>
#include <LibGC/RootVector.h>
#include <LibJS/Forward.h>
#include <LibWeb/Export.h>
#include <LibWeb/Forward.h>
namespace Web::WebIDL {
bool is_buffer_source_type(JS::Value);
GC::Ptr<JS::ArrayBuffer> underlying_buffer_source(JS::Object& buffer_source);
ErrorOr<ByteBuffer> get_buffer_source_copy(JS::Object const& buffer_source);
WEB_API ErrorOr<ByteBuffer> get_buffer_source_copy(JS::Object const& buffer_source);
JS::Completion call_user_object_operation(CallbackType& callback, Utf16FlyString const& operation_name, Optional<JS::Value> this_argument, ReadonlySpan<JS::Value> args);
JS::ThrowCompletionOr<String> to_string(JS::VM&, JS::Value);
JS::ThrowCompletionOr<Utf16String> to_utf16_string(JS::VM&, JS::Value);
JS::ThrowCompletionOr<String> to_usv_string(JS::VM&, JS::Value);
WEB_API JS::ThrowCompletionOr<String> to_string(JS::VM&, JS::Value);
WEB_API JS::ThrowCompletionOr<Utf16String> to_utf16_string(JS::VM&, JS::Value);
WEB_API JS::ThrowCompletionOr<String> to_usv_string(JS::VM&, JS::Value);
JS::ThrowCompletionOr<Utf16String> to_utf16_usv_string(JS::VM&, JS::Value);
JS::ThrowCompletionOr<String> to_byte_string(JS::VM&, JS::Value);
@ -33,10 +34,10 @@ enum class ExceptionBehavior {
Report,
Rethrow,
};
JS::Completion invoke_callback(CallbackType& callback, Optional<JS::Value> this_argument, ExceptionBehavior exception_behavior, ReadonlySpan<JS::Value> args);
JS::Completion invoke_callback(CallbackType& callback, Optional<JS::Value> this_argument, ReadonlySpan<JS::Value> args);
WEB_API JS::Completion invoke_callback(CallbackType& callback, Optional<JS::Value> this_argument, ExceptionBehavior exception_behavior, ReadonlySpan<JS::Value> args);
WEB_API JS::Completion invoke_callback(CallbackType& callback, Optional<JS::Value> this_argument, ReadonlySpan<JS::Value> args);
GC::Ref<Promise> invoke_promise_callback(CallbackType& callback, Optional<JS::Value> this_argument, ReadonlySpan<JS::Value> args);
WEB_API GC::Ref<Promise> invoke_promise_callback(CallbackType& callback, Optional<JS::Value> this_argument, ReadonlySpan<JS::Value> args);
JS::Completion construct(CallbackType& callable, ReadonlySpan<JS::Value> args);

View file

@ -11,11 +11,12 @@
#include <LibJS/Runtime/PromiseCapability.h>
#include <LibJS/Runtime/Realm.h>
#include <LibJS/Runtime/VM.h>
#include <LibWeb/Export.h>
#include <LibWeb/WebIDL/Promise.h>
namespace Web::WebIDL {
class AsyncIterator : public Bindings::PlatformObject {
class WEB_API AsyncIterator : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(AsyncIterator, Bindings::PlatformObject);
GC_DECLARE_ALLOCATOR(AsyncIterator);

View file

@ -10,6 +10,7 @@
#include <AK/Utf16String.h>
#include <LibWeb/Bindings/PlatformObject.h>
#include <LibWeb/Bindings/Serializable.h>
#include <LibWeb/Export.h>
#include <LibWeb/Forward.h>
#include <LibWeb/HTML/Scripting/Environments.h>
@ -91,7 +92,7 @@ static u16 get_legacy_code_for_name(FlyString const& name)
}
// https://webidl.spec.whatwg.org/#idl-DOMException
class DOMException final
class WEB_API DOMException final
: public Bindings::PlatformObject
, public Bindings::Serializable {
WEB_PLATFORM_OBJECT(DOMException, Bindings::PlatformObject);

View file

@ -7,12 +7,13 @@
#pragma once
#include <LibJS/Runtime/Array.h>
#include <LibWeb/Export.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::WebIDL {
// https://webidl.spec.whatwg.org/#idl-observable-array
class ObservableArray final : public JS::Array {
class WEB_API ObservableArray final : public JS::Array {
JS_OBJECT(ObservableArray, JS::Array);
GC_DECLARE_ALLOCATOR(ObservableArray);

View file

@ -11,6 +11,7 @@
#include <AK/Vector.h>
#include <LibIDL/Types.h>
#include <LibJS/Runtime/VM.h>
#include <LibWeb/Export.h>
namespace Web::WebIDL {
@ -24,6 +25,6 @@ struct ResolvedOverload {
};
// https://webidl.spec.whatwg.org/#es-overloads
JS::ThrowCompletionOr<ResolvedOverload> resolve_overload(JS::VM&, IDL::EffectiveOverloadSet&, ReadonlySpan<StringView> interface_dictionaries);
WEB_API JS::ThrowCompletionOr<ResolvedOverload> resolve_overload(JS::VM&, IDL::EffectiveOverloadSet&, ReadonlySpan<StringView> interface_dictionaries);
}

View file

@ -10,6 +10,7 @@
#include <LibJS/Forward.h>
#include <LibJS/Runtime/PromiseCapability.h>
#include <LibJS/Runtime/Value.h>
#include <LibWeb/Export.h>
#include <LibWeb/Forward.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
@ -20,20 +21,20 @@ using ReactionSteps = GC::Function<WebIDL::ExceptionOr<JS::Value>(JS::Value)>;
// https://webidl.spec.whatwg.org/#es-promise
using Promise = JS::PromiseCapability;
GC::Ref<Promise> create_promise(JS::Realm&);
GC::Ref<Promise> create_resolved_promise(JS::Realm&, JS::Value);
GC::Ref<Promise> create_rejected_promise(JS::Realm&, JS::Value);
void resolve_promise(JS::Realm&, Promise const&, JS::Value = JS::js_undefined());
void reject_promise(JS::Realm&, Promise const&, JS::Value);
GC::Ref<Promise> react_to_promise(Promise const&, GC::Ptr<ReactionSteps> on_fulfilled_callback, GC::Ptr<ReactionSteps> on_rejected_callback);
GC::Ref<Promise> upon_fulfillment(Promise const&, GC::Ref<ReactionSteps>);
GC::Ref<Promise> upon_rejection(Promise const&, GC::Ref<ReactionSteps>);
void mark_promise_as_handled(Promise const&);
bool is_promise_fulfilled(Promise const&);
void wait_for_all(JS::Realm&, Vector<GC::Ref<Promise>> const& promises, Function<void(Vector<JS::Value> const&)> success_steps, Function<void(JS::Value)> failure_steps);
GC::Ref<Promise> get_promise_for_wait_for_all(JS::Realm&, Vector<GC::Ref<Promise>> const& promises);
WEB_API GC::Ref<Promise> create_promise(JS::Realm&);
WEB_API GC::Ref<Promise> create_resolved_promise(JS::Realm&, JS::Value);
WEB_API GC::Ref<Promise> create_rejected_promise(JS::Realm&, JS::Value);
WEB_API void resolve_promise(JS::Realm&, Promise const&, JS::Value = JS::js_undefined());
WEB_API void reject_promise(JS::Realm&, Promise const&, JS::Value);
WEB_API GC::Ref<Promise> react_to_promise(Promise const&, GC::Ptr<ReactionSteps> on_fulfilled_callback, GC::Ptr<ReactionSteps> on_rejected_callback);
WEB_API GC::Ref<Promise> upon_fulfillment(Promise const&, GC::Ref<ReactionSteps>);
WEB_API GC::Ref<Promise> upon_rejection(Promise const&, GC::Ref<ReactionSteps>);
WEB_API void mark_promise_as_handled(Promise const&);
WEB_API bool is_promise_fulfilled(Promise const&);
WEB_API void wait_for_all(JS::Realm&, Vector<GC::Ref<Promise>> const& promises, Function<void(Vector<JS::Value> const&)> success_steps, Function<void(JS::Value)> failure_steps);
WEB_API GC::Ref<Promise> get_promise_for_wait_for_all(JS::Realm&, Vector<GC::Ref<Promise>> const& promises);
// Non-spec, convenience method.
GC::Ref<Promise> create_rejected_promise_from_exception(JS::Realm&, Exception);
WEB_API GC::Ref<Promise> create_rejected_promise_from_exception(JS::Realm&, Exception);
}

View file

@ -7,11 +7,12 @@
#pragma once
#include <LibJS/Forward.h>
#include <LibWeb/Export.h>
namespace Web::WebIDL {
void log_trace(JS::VM& vm, char const* function);
void set_enable_idl_tracing(bool enabled);
WEB_API void set_enable_idl_tracing(bool enabled);
}