mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00

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.
13 lines
348 B
HTML
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>
|