Bump WebKit (#18784)

Co-authored-by: Ben Grant <ben@bun.sh>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
This commit is contained in:
Jarred Sumner
2025-04-04 21:14:36 -07:00
committed by GitHub
parent c86097aeb0
commit a1e1f720ed
3 changed files with 29 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ option(WEBKIT_VERSION "The version of WebKit to use")
option(WEBKIT_LOCAL "If a local version of WebKit should be used instead of downloading")
if(NOT WEBKIT_VERSION)
set(WEBKIT_VERSION 76e7e4177b87b24361a8ed8c08777b2bba7a891a)
set(WEBKIT_VERSION 12d2dfab74b34a50c8544c59f8a9454ce2e06e06)
endif()
string(SUBSTRING ${WEBKIT_VERSION} 0 16 WEBKIT_VERSION_PREFIX)

View File

@@ -352,9 +352,7 @@ pub const JunitReporter = struct {
try this.contents.appendSlice(bun.default_allocator, "\"");
const elapsed_seconds = elapsed_ms / std.time.ms_per_s;
var time_buf: [32]u8 = undefined;
const time_str = try std.fmt.bufPrint(&time_buf, " time=\"{d}\"", .{elapsed_seconds});
try this.contents.appendSlice(bun.default_allocator, time_str);
try this.contents.writer(bun.default_allocator).print(" time=\"{}\"", .{bun.fmt.trimmedPrecision(elapsed_seconds, 6)});
try this.contents.appendSlice(bun.default_allocator, " file=\"");
try escapeXml(file, this.contents.writer(bun.default_allocator));

View File

@@ -1575,6 +1575,33 @@ pub fn hexIntUpper(value: anytype) HexIntFormatter(@TypeOf(value), false) {
return Formatter{ .value = value };
}
/// Equivalent to `{d:.<precision>}` but trims trailing zeros
/// if decimal part is less than `precision` digits.
fn TrimmedPrecisionFormatter(comptime precision: usize) type {
return struct {
num: f64,
precision: usize,
pub fn format(self: @This(), comptime _: []const u8, _: std.fmt.FormatOptions, writer: anytype) !void {
const whole = @trunc(self.num);
try writer.print("{d}", .{whole});
const rem = self.num - whole;
if (rem != 0) {
var buf: [2 + precision]u8 = undefined;
var formatted = std.fmt.bufPrint(&buf, "{d:." ++ std.fmt.comptimePrint("{d}", .{precision}) ++ "}", .{rem}) catch unreachable;
formatted = formatted[2..];
const trimmed = std.mem.trimRight(u8, formatted, "0");
try writer.print(".{s}", .{trimmed});
}
}
};
}
pub fn trimmedPrecision(value: f64, comptime precision: usize) TrimmedPrecisionFormatter(precision) {
const Formatter = TrimmedPrecisionFormatter(precision);
return Formatter{ .num = value, .precision = precision };
}
const FormatDurationData = struct {
ns: u64,
negative: bool = false,