mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibWeb: Treat a CSS declaration with a "--" property name as invalid
This commit is contained in:
parent
bf37f3400e
commit
7a6e4f5ec8
Notes:
github-actions[bot]
2025-06-25 16:10:39 +00:00
Author: https://github.com/tcl3
Commit: 7a6e4f5ec8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5210
Reviewed-by: https://github.com/AtkinsSJ ✅
3 changed files with 31 additions and 0 deletions
|
@ -1125,6 +1125,8 @@ Optional<Declaration> Parser::consume_a_declaration(TokenStream<T>& input, Neste
|
|||
|
||||
// 8. If decl’s name is a custom property name string, then set decl’s original text to the segment
|
||||
// of the original source text string corresponding to the tokens of decl’s value.
|
||||
if (is_invalid_custom_property_name_string(declaration.name))
|
||||
return {};
|
||||
if (is_a_custom_property_name_string(declaration.name)) {
|
||||
// TODO: If we could reach inside the source string that the TokenStream uses, we could grab this as
|
||||
// a single substring instead of having to reconstruct it.
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<title>CSS Reftest Reference</title>
|
||||
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
|
||||
<style>
|
||||
p {
|
||||
color: green;
|
||||
}
|
||||
</style>
|
||||
<p>This text must be green.</p>
|
|
@ -0,0 +1,16 @@
|
|||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
<title>CSS Test: Test a property declaration in an @supports rule with property name "--".</title>
|
||||
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
|
||||
<link rel="help" href="http://www.w3.org/TR/css-variables-1/#defining-variables">
|
||||
<link rel="match" href="../../../../expected/wpt-import/css/css-variables/support/color-green-ref.html">
|
||||
<style>
|
||||
body { color: green; }
|
||||
@supports (--: a) {
|
||||
p { color: red; }
|
||||
}
|
||||
</style>
|
||||
<p>This text must be green.</p>
|
Loading…
Add table
Add a link
Reference in a new issue