mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
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.
This commit is contained in:
Notes:
github-actions[bot]
2025-02-05 16:03:08 +00:00
Author: https://github.com/Lubrsi Commit: https://github.com/LadybirdBrowser/ladybird/commit/d3057a9c796 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3466 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -0,0 +1,13 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user