Age | Commit message (Collapse) | Author |
|
While right now this doesn't save much complexity, it will do once we
care about multiple background layers per node. Then, having a single
repeat value per layer will simplify things.
It also means we can remove the pseudo-property concept entirely! :^)
|
|
Including as part of the `background` shorthand. :^)
|
|
Previously, `box-shadow: none` would fail to parse, meaning that in this
example:
```css
p {
box-shadow: 20px 10px 5px magenta;
}
p.foo {
box-shadow: none;
}
```
... a `<p class="foo">` would still have a box-shadow, when it should
not have one. Now, we handle the `none` value. :^)
|
|
|
|
For `number` and `integer` types, you can add a range afterwards to add
a range check, using similar syntax to that used in the CSS specs. For
example:
```json
"font-weight": {
...
"valid-types": [
"number [1,1000]"
],
...
}
```
This limits any numbers to the range `1 <= n <= 1000`.
|
|
|
|
This patch adds parsing support as well as all the needed stuctures all
over LibWeb to pass Transformations around.
|
|
- The `text-decoration-foo` values now match the spec.
- Added values for `border-foo` since those are needed soon.
- Make `color`'s initial value be `-libweb-palette-base-text`.
|
|
It's technically case-insensitive, but the spec always defines it as
"currentcolor" so it feels wrong to capitalise it differently there.
|
|
In the spec, `fill` and `stroke` are supposed to be a shorthands for
various properties. But since the spec is still a working draft, and
neither Firefox or Chrome support the `fill-color` or `stroke-color`
properties, we'll stick with `fill` and `stroke` as simple colors for
now.
Also, note that SVG expects things in "user units", and we are assuming
that 1px = 1 user unit for now.
|
|
This is just to make the CSS parser stop whining when it encounters some
very common properties and identifiers. More work will be required to
actually support these things. :^)
|
|
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. :^)
|
|
The initial value for these is auto, not 0.
|
|
This is in preparation for parsing these into StyleValues automatically.
Having them all be Strings makes the generation code simpler.
|
|
We already include the inheritance for each property in Properties.json,
so made sense to use that instead of a list in StyleResolver.
Added `inherited: true` to a couple of properties to match the previous
code's behavior. One of those had a FIXME which I've moved to the JSON
file, which is hacky, but it works.
|
|
`flex-basis` and `flex-shrink` had different default values than are
dictated in the spec.
|
|
|
|
|
|
|
|
|
|
They get parsed and are available to the programmer of Layouts :^)
|
|
Flex-basis accepts either 'content' or a Length.
|
|
|
|
|
|
And resolve the shorthands.
|
|
|
|
The background-repeat value may be specified as either one- or two-value
identifiers (to be interpreted as horizontal and vertical repeat). This
adds two pseudo-properties, background-repeat-x and background-repeat-y,
to handle this. One-value identifiers are mapped to two-value in
accordance with the spec.
|
|
We don't actually do anything with the values yet, but now they are
available for layout nodes once we are ready to implement them.
|
|
|
|
|