Merge pull request #1660 from lightpanda-io/fix_css_parse_overflow

Fix possible overflow when parsing floats without an integer
This commit is contained in:
Karl Seguin
2026-02-27 17:27:56 +08:00
committed by GitHub
2 changed files with 9 additions and 1 deletions

View File

@@ -583,7 +583,7 @@ fn consumeNumeric(self: *Tokenizer) Token {
}; };
self.advance(2); self.advance(2);
} else if (self.hasAtLeast(1) and std.ascii.isDigit(self.byteAt(2))) { } else if (self.hasAtLeast(2) and std.ascii.isDigit(self.byteAt(2))) {
self.advance(1); self.advance(1);
} else { } else {
break :blk; break :blk;

View File

@@ -154,3 +154,11 @@
testing.expectEqual(true, typeof div.style.getPropertyPriority === 'function'); testing.expectEqual(true, typeof div.style.getPropertyPriority === 'function');
} }
</script> </script>
<div id=crash1 style="background-position: 5% .1em"></div>
<script id="crash_case_1">
{
testing.expectEqual('5% .1em', $('#crash1').style.backgroundPosition);
}
</script>