LibWeb: Restore flags to prevent formatting timestamps as local time

The flag to stringify these timestamps as UTC was errantly dropped in
6fb2be96bf. This was causing test-web to
fail in time zones other than GMT+0.
This commit is contained in:
Timothy Flynn 2025-06-25 16:32:24 -04:00 committed by Jelle Raaijmakers
commit 3171d57639
Notes: github-actions[bot] 2025-06-25 21:42:10 +00:00
7 changed files with 63 additions and 18 deletions

View file

@ -4,7 +4,9 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibJS/Runtime/Date.h>
#include <LibJS/Runtime/VM.h>
#include <LibUnicode/TimeZone.h>
#include <LibWeb/Bindings/InternalsPrototype.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/DOM/Document.h>
@ -53,6 +55,17 @@ void Internals::gc()
vm().heap().collect_garbage();
}
WebIDL::ExceptionOr<String> Internals::set_time_zone(StringView time_zone)
{
auto current_time_zone = Unicode::current_time_zone();
if (auto result = Unicode::set_current_time_zone(time_zone); result.is_error())
return vm().throw_completion<JS::InternalError>(MUST(String::formatted("Could not set time zone: {}", result.error())));
JS::clear_system_time_zone_cache();
return current_time_zone;
}
JS::Object* Internals::hit_test(double x, double y)
{
auto& active_document = window().associated_document();