Various CSS fixing and stability stuff (#16889)

This commit is contained in:
Zack Radisic
2025-01-31 03:47:49 -08:00
committed by GitHub
parent b59b793a32
commit f6ec0da125
40 changed files with 5687 additions and 1481 deletions

View File

@@ -4642,11 +4642,10 @@ pub fn trimLeadingChar(slice: []const u8, char: u8) []const u8 {
/// e.g.
/// `trimLeadingPattern2("abcdef", 'a', 'b') == "cdef"`
pub fn trimLeadingPattern2(slice_: []const u8, comptime byte1: u8, comptime byte2: u8) []const u8 {
const pattern: u16 = comptime @as(u16, byte2) << 8 | @as(u16, byte1);
// const pattern: u16 = comptime @as(u16, byte2) << 8 | @as(u16, byte1);
var slice = slice_;
while (slice.len >= 2) {
const sliceu16: [*]const u16 = @ptrCast(@alignCast(slice.ptr));
if (sliceu16[0] == pattern) {
if (slice[0] == byte1 and slice[1] == byte2) {
slice = slice[2..];
} else {
break;