WebContent: Enable in Windows CI

This commit is contained in:
ayeteadoe 2025-06-28 03:32:38 -07:00 committed by Andrew Kaster
commit 0a699132f3
Notes: github-actions[bot] 2025-08-23 22:07:16 +00:00
9 changed files with 70 additions and 31 deletions

View file

@ -148,4 +148,9 @@ Completion throw_completion(Value value)
return { Completion::Type::Throw, value }; return { Completion::Type::Throw, value };
} }
void set_log_all_js_exceptions(bool const enabled)
{
g_log_all_js_exceptions = enabled;
}
} }

View file

@ -348,4 +348,6 @@ inline Completion normal_completion(Value value)
// 6.2.4.2 ThrowCompletion ( value ), https://tc39.es/ecma262/#sec-throwcompletion // 6.2.4.2 ThrowCompletion ( value ), https://tc39.es/ecma262/#sec-throwcompletion
JS_API Completion throw_completion(Value); JS_API Completion throw_completion(Value);
JS_API void set_log_all_js_exceptions(bool enabled);
} }

View file

@ -66,7 +66,7 @@
namespace Web::Fetch::Fetching { namespace Web::Fetch::Fetching {
bool g_http_cache_enabled; bool g_http_cache_enabled = false;
#define TRY_OR_IGNORE(expression) \ #define TRY_OR_IGNORE(expression) \
({ \ ({ \
@ -2841,4 +2841,9 @@ void append_fetch_metadata_headers_for_request(Infrastructure::Request& request)
set_sec_fetch_user_header(request); set_sec_fetch_user_header(request);
} }
void set_http_cache_enabled(bool const enabled)
{
g_http_cache_enabled = enabled;
}
} }

View file

@ -54,4 +54,6 @@ void set_sec_fetch_site_header(Infrastructure::Request&);
void set_sec_fetch_user_header(Infrastructure::Request&); void set_sec_fetch_user_header(Infrastructure::Request&);
void append_fetch_metadata_headers_for_request(Infrastructure::Request&); void append_fetch_metadata_headers_for_request(Infrastructure::Request&);
void set_http_cache_enabled(bool enabled);
} }

View file

@ -13,6 +13,7 @@ namespace Web::WebIDL {
bool g_enable_idl_tracing = false; bool g_enable_idl_tracing = false;
static void log_trace_impl(JS::VM&, char const*);
void log_trace_impl(JS::VM& vm, char const* function) void log_trace_impl(JS::VM& vm, char const* function)
{ {
if (!g_enable_idl_tracing) if (!g_enable_idl_tracing)
@ -39,4 +40,15 @@ void log_trace_impl(JS::VM& vm, char const* function)
dbgln("{}({})", function, builder.string_view()); dbgln("{}({})", function, builder.string_view());
} }
void log_trace(JS::VM& vm, char const* function)
{
if (g_enable_idl_tracing)
log_trace_impl(vm, function);
}
void set_enable_idl_tracing(bool const enabled)
{
g_enable_idl_tracing = enabled;
}
} }

View file

@ -10,14 +10,8 @@
namespace Web::WebIDL { namespace Web::WebIDL {
extern bool g_enable_idl_tracing; void log_trace(JS::VM& vm, char const* function);
void log_trace_impl(JS::VM&, char const*); void set_enable_idl_tracing(bool enabled);
inline void log_trace(JS::VM& vm, char const* function)
{
if (g_enable_idl_tracing)
log_trace_impl(vm, function);
}
} }

View file

@ -51,6 +51,40 @@ endif()
target_link_libraries(WebContent PRIVATE webcontentservice LibURL) target_link_libraries(WebContent PRIVATE webcontentservice LibURL)
if(WIN32)
# FIXME: This is a hack to get around lld-link error undefined symbols in various libraries
target_link_libraries(WebContent PRIVATE
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,AbortSignal>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,AttributeNames>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,Buffers>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,CallbackType>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,DocumentObserver>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,EventNames>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,Fetching>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,HeapTimer>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,MutationType>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,Namespace>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,NavigationObserver>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,PaintableBox>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,Policy>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,PolicyContainer>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,PullIntoDescriptor>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,ReadableByteStreamController>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,ReadableStream>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,ShadowRoot>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,TagNames>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,Text>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,Tracing>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,TransformStream>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,WebUI>
$<FILTER:$<TARGET_OBJECTS:LibWeb>,INCLUDE,WritableStream>
$<FILTER:$<TARGET_OBJECTS:LibWebView>,INCLUDE,Utilities>
)
find_package(unofficial-angle REQUIRED CONFIG)
target_link_libraries(WebContent PRIVATE LibTextCodec unofficial::angle::libGLESv2)
endif()
target_sources(webcontentservice PUBLIC FILE_SET server TYPE HEADERS target_sources(webcontentservice PUBLIC FILE_SET server TYPE HEADERS
BASE_DIRS ${LADYBIRD_SOURCE_DIR}/Services BASE_DIRS ${LADYBIRD_SOURCE_DIR}/Services
FILES ConnectionFromClient.h FILES ConnectionFromClient.h

View file

@ -74,7 +74,7 @@ void ConnectionFromClient::die()
Messages::WebContentServer::InitTransportResponse ConnectionFromClient::init_transport([[maybe_unused]] int peer_pid) Messages::WebContentServer::InitTransportResponse ConnectionFromClient::init_transport([[maybe_unused]] int peer_pid)
{ {
#ifdef AK_OS_WINDOWS #ifdef AK_OS_WINDOWS
m_transport.set_peer_pid(peer_pid); m_transport->set_peer_pid(peer_pid);
return Core::System::getpid(); return Core::System::getpid();
#endif #endif
VERIFY_NOT_REACHED(); VERIFY_NOT_REACHED();

View file

@ -19,6 +19,7 @@
#include <LibMedia/Audio/Loader.h> #include <LibMedia/Audio/Loader.h>
#include <LibRequests/RequestClient.h> #include <LibRequests/RequestClient.h>
#include <LibWeb/Bindings/MainThreadVM.h> #include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/Fetch/Fetching/Fetching.h>
#include <LibWeb/HTML/Window.h> #include <LibWeb/HTML/Window.h>
#include <LibWeb/Internals/Internals.h> #include <LibWeb/Internals/Internals.h>
#include <LibWeb/Loader/ContentFilter.h> #include <LibWeb/Loader/ContentFilter.h>
@ -28,6 +29,7 @@
#include <LibWeb/Painting/PaintableBox.h> #include <LibWeb/Painting/PaintableBox.h>
#include <LibWeb/Platform/AudioCodecPluginAgnostic.h> #include <LibWeb/Platform/AudioCodecPluginAgnostic.h>
#include <LibWeb/Platform/EventLoopPluginSerenity.h> #include <LibWeb/Platform/EventLoopPluginSerenity.h>
#include <LibWeb/WebIDL/Tracing.h>
#include <LibWebView/Plugins/FontPlugin.h> #include <LibWebView/Plugins/FontPlugin.h>
#include <LibWebView/Plugins/ImageCodecPlugin.h> #include <LibWebView/Plugins/ImageCodecPlugin.h>
#include <LibWebView/SiteIsolation.h> #include <LibWebView/SiteIsolation.h>
@ -54,24 +56,6 @@ static ErrorOr<void> reinitialize_resource_loader(IPC::File const& image_decoder
static ErrorOr<void> initialize_image_decoder(int image_decoder_socket); static ErrorOr<void> initialize_image_decoder(int image_decoder_socket);
static ErrorOr<void> reinitialize_image_decoder(IPC::File const& image_decoder_socket); static ErrorOr<void> reinitialize_image_decoder(IPC::File const& image_decoder_socket);
namespace JS {
extern bool g_log_all_js_exceptions;
}
namespace Web::WebIDL {
extern bool g_enable_idl_tracing;
}
namespace Web::Fetch::Fetching {
extern bool g_http_cache_enabled;
}
ErrorOr<int> ladybird_main(Main::Arguments arguments) ErrorOr<int> ladybird_main(Main::Arguments arguments)
{ {
AK::set_rich_debug_enabled(true); AK::set_rich_debug_enabled(true);
@ -168,7 +152,8 @@ ErrorOr<int> ladybird_main(Main::Arguments arguments)
WebView::disable_site_isolation(); WebView::disable_site_isolation();
if (enable_http_cache) { if (enable_http_cache) {
Web::Fetch::Fetching::g_http_cache_enabled = true;
Web::Fetch::Fetching::set_http_cache_enabled(true);
} }
Web::Painting::g_paint_viewport_scrollbars = !disable_scrollbar_painting; Web::Painting::g_paint_viewport_scrollbars = !disable_scrollbar_painting;
@ -206,11 +191,11 @@ ErrorOr<int> ladybird_main(Main::Arguments arguments)
TRY(initialize_resource_loader(Web::Bindings::main_thread_vm().heap(), request_server_socket)); TRY(initialize_resource_loader(Web::Bindings::main_thread_vm().heap(), request_server_socket));
if (log_all_js_exceptions) { if (log_all_js_exceptions) {
JS::g_log_all_js_exceptions = true; JS::set_log_all_js_exceptions(true);
} }
if (enable_idl_tracing) { if (enable_idl_tracing) {
Web::WebIDL::g_enable_idl_tracing = true; Web::WebIDL::set_enable_idl_tracing(true);
} }
auto maybe_content_filter_error = load_content_filters(config_path); auto maybe_content_filter_error = load_content_filters(config_path);