mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
LibWeb/CSS: Add alternative src() syntax for URLs
url() has some limitations because of allowing unquoted URLs as its contents. For example, it can't use `var()`. To get around this, there's an alternative `src()` function which behaves the same as `url()` except that it is parsed as a regular function, which makes `var()` and friends work properly. There's no WPT test for this as far as I can tell, so I added our own.
This commit is contained in:
parent
ea0bfda1b9
commit
00f76ccbf4
Notes:
github-actions[bot]
2025-06-11 14:27:18 +00:00
Author: https://github.com/AtkinsSJ
Commit: 00f76ccbf4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5041
5 changed files with 63 additions and 8 deletions
5
Tests/LibWeb/Text/expected/css/src-function.txt
Normal file
5
Tests/LibWeb/Text/expected/css/src-function.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
Before: none
|
||||
Using url('cool.png'): url("cool.png")
|
||||
Using url(var(--some-url)): none
|
||||
Using src('cool.png'): src("cool.png")
|
||||
Using src(var(--some-url)): src("awesome.png")
|
Loading…
Add table
Add a link
Reference in a new issue