1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:17:34 +00:00

LibWeb: Add CSS quirks information to Properties.json

Two CSS quirks are specced to only apply to specific properties:

- The hashless hex color quirk
  https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk
- The unitless length quirk
  https://quirks.spec.whatwg.org/#the-unitless-length-quirk

These are now represented in `Properties.json` like so:
```json
"property-name-here": {
    "quirks": [
        "hashless-hex-color",
        "unitless-length"
    ]
}
```

Every property that either of those two quirks applies to is included in
`Properties.json` and now has their quirks listed. :^)
This commit is contained in:
Sam Atkins 2021-09-10 21:43:03 +01:00 committed by Andreas Kling
parent c0709c4447
commit 9c873fc4dc

View file

@ -6,7 +6,10 @@
}, },
"background-color": { "background-color": {
"inherited": false, "inherited": false,
"initial": "transparent" "initial": "transparent",
"quirks": [
"hashless-hex-color"
]
}, },
"background-image": { "background-image": {
"inherited": false, "inherited": false,
@ -14,7 +17,10 @@
}, },
"background-position": { "background-position": {
"inherited": false, "inherited": false,
"initial": "0% 0%" "initial": "0% 0%",
"quirks": [
"unitless-length"
]
}, },
"background-repeat": { "background-repeat": {
"longhands": [ "longhands": [
@ -69,7 +75,10 @@
}, },
"border-bottom-color": { "border-bottom-color": {
"initial": "currentColor", "initial": "currentColor",
"inherited": false "inherited": false,
"quirks": [
"hashless-hex-color"
]
}, },
"border-bottom-left-radius": { "border-bottom-left-radius": {
"initial": "0", "initial": "0",
@ -85,7 +94,10 @@
}, },
"border-bottom-width": { "border-bottom-width": {
"initial": "medium", "initial": "medium",
"inherited": false "inherited": false,
"quirks": [
"unitless-length"
]
}, },
"border-color": { "border-color": {
"longhands": [ "longhands": [
@ -93,6 +105,9 @@
"border-right-color", "border-right-color",
"border-bottom-color", "border-bottom-color",
"border-left-color" "border-left-color"
],
"quirks": [
"hashless-hex-color"
] ]
}, },
"border-collapse": { "border-collapse": {
@ -101,7 +116,10 @@
}, },
"border-left-color": { "border-left-color": {
"initial": "currentColor", "initial": "currentColor",
"inherited": false "inherited": false,
"quirks": [
"hashless-hex-color"
]
}, },
"border-left-style": { "border-left-style": {
"initial": "none", "initial": "none",
@ -109,7 +127,10 @@
}, },
"border-left-width": { "border-left-width": {
"initial": "medium", "initial": "medium",
"inherited": false "inherited": false,
"quirks": [
"unitless-length"
]
}, },
"border-radius": { "border-radius": {
"longhands": [ "longhands": [
@ -121,7 +142,10 @@
}, },
"border-right-color": { "border-right-color": {
"initial": "currentColor", "initial": "currentColor",
"inherited": false "inherited": false,
"quirks": [
"hashless-hex-color"
]
}, },
"border-right-style": { "border-right-style": {
"initial": "none", "initial": "none",
@ -129,11 +153,17 @@
}, },
"border-right-width": { "border-right-width": {
"initial": "medium", "initial": "medium",
"inherited": false "inherited": false,
"quirks": [
"unitless-length"
]
}, },
"border-spacing": { "border-spacing": {
"inherited": true, "inherited": true,
"initial": "0" "initial": "0",
"quirks": [
"unitless-length"
]
}, },
"border-style": { "border-style": {
"longhands": [ "longhands": [
@ -145,7 +175,10 @@
}, },
"border-top-color": { "border-top-color": {
"initial": "currentColor", "initial": "currentColor",
"inherited": false "inherited": false,
"quirks": [
"hashless-hex-color"
]
}, },
"border-top-left-radius": { "border-top-left-radius": {
"initial": "0", "initial": "0",
@ -161,7 +194,10 @@
}, },
"border-top-width": { "border-top-width": {
"initial": "medium", "initial": "medium",
"inherited": false "inherited": false,
"quirks": [
"unitless-length"
]
}, },
"border-width": { "border-width": {
"longhands": [ "longhands": [
@ -169,11 +205,17 @@
"border-right-width", "border-right-width",
"border-bottom-width", "border-bottom-width",
"border-left-width" "border-left-width"
],
"quirks": [
"unitless-length"
] ]
}, },
"bottom": { "bottom": {
"inherited": false, "inherited": false,
"initial": "auto" "initial": "auto",
"quirks": [
"unitless-length"
]
}, },
"box-shadow":{ "box-shadow":{
"inherited": false, "inherited": false,
@ -189,11 +231,17 @@
}, },
"clip": { "clip": {
"inherited": true, "inherited": true,
"initial": "auto" "initial": "auto",
"quirks": [
"unitless-length"
]
}, },
"color": { "color": {
"inherited": true, "inherited": true,
"initial": "" "initial": "",
"quirks": [
"hashless-hex-color"
]
}, },
"cursor": { "cursor": {
"inherited": true, "inherited": true,
@ -258,7 +306,10 @@
}, },
"font-size": { "font-size": {
"inherited": true, "inherited": true,
"initial": "medium" "initial": "medium",
"quirks": [
"unitless-length"
]
}, },
"font-style": { "font-style": {
"inherited": true, "inherited": true,
@ -274,7 +325,10 @@
}, },
"height": { "height": {
"inherited": false, "inherited": false,
"initial": "auto" "initial": "auto",
"quirks": [
"unitless-length"
]
}, },
"justify-content": { "justify-content": {
"inherited": false, "inherited": false,
@ -282,11 +336,17 @@
}, },
"left": { "left": {
"inherited": false, "inherited": false,
"initial": "auto" "initial": "auto",
"quirks": [
"unitless-length"
]
}, },
"letter-spacing": { "letter-spacing": {
"inherited": true, "inherited": true,
"initial": "normal" "initial": "normal",
"quirks": [
"unitless-length"
]
}, },
"line-height": { "line-height": {
"inherited": true, "inherited": true,
@ -318,39 +378,66 @@
"margin-right", "margin-right",
"margin-bottom", "margin-bottom",
"margin-left" "margin-left"
],
"quirks": [
"unitless-length"
] ]
}, },
"margin-bottom": { "margin-bottom": {
"inherited": false, "inherited": false,
"initial": "0" "initial": "0",
"quirks": [
"unitless-length"
]
}, },
"margin-left": { "margin-left": {
"inherited": false, "inherited": false,
"initial": "0" "initial": "0",
"quirks": [
"unitless-length"
]
}, },
"margin-right": { "margin-right": {
"inherited": false, "inherited": false,
"initial": "0" "initial": "0",
"quirks": [
"unitless-length"
]
}, },
"margin-top": { "margin-top": {
"inherited": false, "inherited": false,
"initial": "0" "initial": "0",
"quirks": [
"unitless-length"
]
}, },
"max-height": { "max-height": {
"inherited": false, "inherited": false,
"initial": "none" "initial": "none",
"quirks": [
"unitless-length"
]
}, },
"max-width": { "max-width": {
"inherited": false, "inherited": false,
"initial": "none" "initial": "none",
"quirks": [
"unitless-length"
]
}, },
"min-height": { "min-height": {
"inherited": false, "inherited": false,
"initial": "auto" "initial": "auto",
"quirks": [
"unitless-length"
]
}, },
"min-width": { "min-width": {
"inherited": false, "inherited": false,
"initial": "auto" "initial": "auto",
"quirks": [
"unitless-length"
]
}, },
"opacity": { "opacity": {
"inherited": false, "inherited": false,
@ -378,23 +465,38 @@
"padding-right", "padding-right",
"padding-bottom", "padding-bottom",
"padding-left" "padding-left"
],
"quirks": [
"unitless-length"
] ]
}, },
"padding-bottom": { "padding-bottom": {
"inherited": false, "inherited": false,
"initial": "0" "initial": "0",
"quirks": [
"unitless-length"
]
}, },
"padding-left": { "padding-left": {
"inherited": false, "inherited": false,
"initial": "0" "initial": "0",
"quirks": [
"unitless-length"
]
}, },
"padding-right": { "padding-right": {
"inherited": false, "inherited": false,
"initial": "0" "initial": "0",
"quirks": [
"unitless-length"
]
}, },
"padding-top": { "padding-top": {
"inherited": false, "inherited": false,
"initial": "0" "initial": "0",
"quirks": [
"unitless-length"
]
}, },
"position": { "position": {
"inherited": false, "inherited": false,
@ -402,7 +504,10 @@
}, },
"right": { "right": {
"inherited": false, "inherited": false,
"initial": "auto" "initial": "auto",
"quirks": [
"unitless-length"
]
}, },
"text-align": { "text-align": {
"inherited": true, "inherited": true,
@ -437,7 +542,10 @@
}, },
"text-indent": { "text-indent": {
"inherited": true, "inherited": true,
"initial": "0" "initial": "0",
"quirks": [
"unitless-length"
]
}, },
"text-transform": { "text-transform": {
"inherited": true, "inherited": true,
@ -445,11 +553,17 @@
}, },
"top": { "top": {
"inherited": false, "inherited": false,
"initial": "auto" "initial": "auto",
"quirks": [
"unitless-length"
]
}, },
"vertical-align": { "vertical-align": {
"inherited": false, "inherited": false,
"initial": "baseline" "initial": "baseline",
"quirks": [
"unitless-length"
]
}, },
"visibility": { "visibility": {
"inherited": true, "inherited": true,
@ -457,7 +571,10 @@
}, },
"width": { "width": {
"inherited": false, "inherited": false,
"initial": "auto" "initial": "auto",
"quirks": [
"unitless-length"
]
}, },
"white-space": { "white-space": {
"inherited": true, "inherited": true,
@ -465,7 +582,10 @@
}, },
"word-spacing": { "word-spacing": {
"inherited": true, "inherited": true,
"initial": "normal" "initial": "normal",
"quirks": [
"unitless-length"
]
}, },
"z-index": { "z-index": {
"inherited": false, "inherited": false,