Commit graph

60 commits

Author SHA1 Message Date
Sam Atkins
f602249ae9 LibWeb: Convert background-size from Length to LengthPercentage
Checking these for `auto` is awkward, but separating that will come
later. :^)
2022-01-20 00:04:10 +01:00
Sam Atkins
92708746c8 LibWeb: Implement background-repeat: round :^) 2021-11-17 22:20:01 +01:00
Sam Atkins
493435c655 LibWeb: Implement background-repeat: space 2021-11-17 22:20:01 +01:00
Sam Atkins
3d1ee5b2de LibWeb: Implement background-size :^)
This is including the `cover` and `contain` modes.
2021-11-17 22:20:01 +01:00
Sam Atkins
80642b4f9d LibWeb: Implement background-position and background-origin :^) 2021-11-17 22:20:01 +01:00
Sam Atkins
7089681f68 LibWeb: Manually tile background images
This reimplements image tiling instead of using `Painter::blit_tiled()`,
so that we will be able to handle CSS's more complicated repetition
rules. (Like `background-repeat: space`) Otherwise this does the same as
before. :^)
2021-11-17 22:20:01 +01:00
Sam Atkins
6234e3fcb3 LibWeb: Implement background-clip :^)
We now pass in the Layout Node so that we can read the BoxModelMetrics.
Renamed a couple of variables too for clarity.
2021-11-17 22:20:01 +01:00
Sam Atkins
e8b7946732 LibWeb: Paint backgrounds with multiple layers :^) 2021-11-17 22:20:01 +01:00
Sam Atkins
64d805a027 LibWeb: Stop 'no-repeat' from expanding the background area
Previously, a `background-repeat` value of `no-repeat` in a direction
would cause the image to be drawn at exactly that size. This was fine if
the image was smaller than the element, but if it was larger, it would
draw outside its bounds. Now, it behaves itself. :^)
2021-11-17 22:20:01 +01:00
Sam Atkins
abc22b727c LibWeb: Move background painting from Box to its own file
This makes the code accessible to things that aren't a Box, such as
InlineNode.
2021-09-19 22:53:35 +02:00