1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 10:18:15 +09:00
ladybird/Tests/LibWeb/Text/input/css/getComputedStyle-url-var-serialization.html
Luke Wilde d3057a9c79 LibWeb: Preserve opening quotation in string token original source text
Used by chess.com, where it stores URLs to assets in CSS URL variables.
It then receives the value of them with getComputedStyle() and then
getPropertyValue(). With this, it trims off the url('') wrapper with a
simple slice(5, -2). Since we didn't preserve the opening quotation, it
would slice off the `h` in `https` instead of the quotation.
2025-02-05 16:02:09 +00:00

13 lines
348 B
HTML

<!DOCTYPE html>
<style>
:root {
--test-url: url('https://ladybird.org/');
}
</style>
<script src="../include.js"></script>
<script>
test(() => {
const style = getComputedStyle(document.documentElement);
println(`style.getPropertyValue("--test-url") = ${style.getPropertyValue("--test-url")}`);
});
</script>