Age | Commit message (Collapse) | Author |
|
|
|
`border-style: none` and `border-style: hidden` remove the border
entirely during layout, causing boxes to shift around.
|
|
Including the legacy grid-gap, grid-column-gap and grid-row-gap
properties.
|
|
|
|
|
|
Note: The parsing and style value completely ignores the SVG filters
part of the spec for now... That's a yak for another day :^)
|
|
|
|
Parse grid-column-start, end, and the equivalent for rows.
|
|
Add functionality to begin parsing grid-template-columns and
grid-template-rows. There are still things to be added, like parsing
functions, but I would say a couple of the major points are already
adressed like length, percentage, and flexible-length.
|
|
|
|
Add ability to parse a rect when it is used as the value of a style
property.
|
|
This includes the "compat" values even though they are not strictly
necessary.
|
|
|
|
|
|
|
|
This has the nice benefit of removing a lot of duplicated lists of
values from Properties.json. :^)
|
|
Adds support for the flex order property and a test page for it
on the browser welcome page.
|
|
I believe this is all of them, but I may have missed some.
Several properties technically do not allow negative numbers but the
description says to accept these as valid, and then clamp them
afterwards to the desired range. As such, we don't reject them during
parsing.
|
|
|
|
This is a change to CSS-TEXT-4, listed here:
https://www.w3.org/TR/2022/WD-css-text-4-20220318/#changes
We don't actually support these properties yet, but it doesn't hurt to
keep them up to date for when they get implemented in the future. :^)
|
|
This is almost a PositionStyleValue, but it's serialized differently,
so let's use a StyleValueList with 2 length-percentage values.
|
|
I came across some websites that change an elements CSS "opacity" in
their :hover selectors. That caused us to relayout on hover, which we'd
like to avoid.
With this patch, we now check if a property only affects the stacking
context tree, and if nothing layout-affecting has changed, we only
invalidate the stacking context tree, causing it to be rebuilt on next
paint or hit test.
This makes :hover { opacity: ... } rules much faster. :^)
|
|
- background properties
- box-shadow
- cursor
- SVG fill/stroke properties
- image-rendering
- outline properties
- pointer-events
- user-select
This should be basically all of them. I skipped `opacity` and
`transform` since establishing a stacking context feels like a
layout-affecting thing, but I could be very wrong on that!
|
|
border*-width and border-collapse affect layout, but all the color,
style and radius ones will only need a repaint if changed. :^)
|
|
|
|
This patch adds CSS::property_affects_layout(PropertyID) which tells us
whether a CSS property would affect layout if it were changed.
This will be used to avoid unnecessary relayout work when something
changes that really only requires us to repaint the page.
To mark a property as not affecting layout, set "affects-layout" to
false in the corresponding Properties.json entry. Note that all
properties affect layout by default.
|
|
This commit adds the text-justify property as defined in:
https://drafts.csswg.org/css-text/#propdef-text-justify
|
|
This patch adds support for "crisp-edges", "high-quality" and "smooth"
for the CSS image-rendering property.
"crisp-edges" maps to nearest-neighbor scaling for <canvas> and <img>
elements, while "high-quality" and "smooth" both use bilinear blending.
|
|
For now, we only understand `none`, `normal`, `<image>` and `<string>`.
The various other functions and identifiers can be added later.
We can *almost* use a StyleValueList for this, except it's divided into
two parts - the content, and the optional "alt text". So, I've added a
new StyleValue for it.
|
|
Currently only "auto" and "pixelated" values are supported.
|
|
This was already handled in the CSS machinery, we just never parsed it.
|
|
This is basically the same as `auto` in the spec, so let's just treat
them as identical for now. Gets rid of some Discord CSS parser
spam. :^)
|
|
|
|
Both of these have "auto" as their initial value, so the only reason
they work currently is that "auto" is implicitly a Length.
|
|
It's a little verbose to repeat these in cases like the borders, but if
everything has an initial value, we can guarantee that
`property_initial_value()` will return something! :^)
|
|
There is no specified initial value, but `transparent` is equivalent to
setting all the background properties to their defaults.
|
|
- `align-items`: `normal` is the initial value in the CSS-ALIGN spec,
but `stretch` is in CSS-FLEXBOX. The FLEXBOX spec is the one we've
actually implemented elsewhere, and ALIGN adds new values with special
syntax, so it's not trivial to add it here.
- `border-spacing`: `0` is equivalent to `0px 0px` and we don't yet
parse the double-value syntax.
- `text-decoration-thickness`: Had the wrong value.
|
|
|
|
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. :^)
|