1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 08:28:11 +00:00
serenity/Userland/Libraries/LibWeb/Painting
Zac Brannelly 9165faca5e LibWeb: Support CSS property background-clip: text
From https://drafts.csswg.org/css-backgrounds-4/#background-clip
"The background is painted within (clipped to) the intersection of the
border box and the geometry of the text in the element and its in-flow
and floated descendants"

This change implements it in the following way:
1. Traverse the descendants of the element, collecting the Gfx::Path of
   glyphs into a vector.
2. The vector of collected paths is saved in the background painting
   command.
3. The painting commands executor uses the list of glyphs to paint a
   mask for background clipping.

Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
2024-03-03 15:33:12 +01:00
..
AudioPaintable.cpp LibWeb: Rename painter() to recording_painter() in PaintContext 2023-11-27 21:53:38 +01:00
AudioPaintable.h
BackgroundPainting.cpp LibWeb: Support CSS property background-clip: text 2024-03-03 15:33:12 +01:00
BackgroundPainting.h LibWeb: Support CSS property background-clip: text 2024-03-03 15:33:12 +01:00
BorderPainting.cpp LibWeb: Resolve border radius during layout and save it in paintables 2023-12-07 10:52:47 +01:00
BorderPainting.h LibWeb: Resolve border radius during layout and save it in paintables 2023-12-07 10:52:47 +01:00
BorderRadiiData.cpp LibWeb: Move clip rect calculation to happen before painting 2024-01-28 08:25:28 +01:00
BorderRadiiData.h LibWeb: Account for all clipped border radii in containing block chain 2024-02-11 08:12:31 +01:00
BorderRadiusCornerClipper.cpp LibWeb: Check if corners have radius after converting to device pixels 2024-01-15 15:21:17 +01:00
BorderRadiusCornerClipper.h LibWeb: Move border radius sampling config preparation into a function 2023-12-17 23:12:48 +01:00
BordersData.cpp LibWeb: Change paint_all_borders() to accept only device pixel values 2023-11-20 14:59:47 +01:00
BordersData.h LibWeb: Change paint_all_borders() to accept only device pixel values 2023-11-20 14:59:47 +01:00
ButtonPaintable.cpp LibWeb: Shift button paintable clip rectangle by scroll offset 2024-02-06 13:06:16 +01:00
ButtonPaintable.h
CanvasPaintable.cpp LibWeb: Rename painter() to recording_painter() in PaintContext 2023-11-27 21:53:38 +01:00
CanvasPaintable.h
CheckBoxPaintable.cpp LibWeb: Rename painter() to recording_painter() in PaintContext 2023-11-27 21:53:38 +01:00
CheckBoxPaintable.h
ClipFrame.h LibWeb: Clean previous border radii clips in refresh_clip_state() 2024-02-28 07:44:12 -05:00
Command.cpp LibWeb: Remove glyph run allocation in paint_text_fragment() 2024-03-02 09:09:10 +01:00
Command.h LibWeb: Support CSS property background-clip: text 2024-03-03 15:33:12 +01:00
CommandExecutorCPU.cpp LibWeb: Support CSS property background-clip: text 2024-03-03 15:33:12 +01:00
CommandExecutorCPU.h LibWeb: Support CSS property background-clip: text 2024-03-03 15:33:12 +01:00
CommandExecutorGPU.cpp LibWeb: Support CSS property background-clip: text 2024-03-03 15:33:12 +01:00
CommandExecutorGPU.h LibWeb: Support CSS property background-clip: text 2024-03-03 15:33:12 +01:00
CommandList.cpp LibWeb: Support CSS property background-clip: text 2024-03-03 15:33:12 +01:00
CommandList.h LibWeb: Support CSS property background-clip: text 2024-03-03 15:33:12 +01:00
FilterPainting.cpp LibWeb: Rename painter() to recording_painter() in PaintContext 2023-11-27 21:53:38 +01:00
FilterPainting.h LibWeb: Resolve backdrop filter length in apply_style() 2023-10-12 07:38:48 +02:00
GradientData.h LibWeb: Introduce RecordingPainter to serialize painting commands 2023-10-18 10:58:42 +02:00
GradientPainting.cpp LibWeb: Support CSS property background-clip: text 2024-03-03 15:33:12 +01:00
GradientPainting.h LibWeb: Support CSS property background-clip: text 2024-03-03 15:33:12 +01:00
ImagePaintable.cpp LibWeb: Add "object-position" CSS property into ComputedValues 2024-02-27 16:53:13 +01:00
ImagePaintable.h LibWeb: Save image provider in ImagePaintable 2024-02-27 16:53:13 +01:00
InlinePaintable.cpp LibWeb: Make Paintable::containing_block() return a PaintableBox* 2024-03-01 17:57:10 +01:00
InlinePaintable.h LibWeb: Add fast_is<T>() for InlinePaintable 2024-03-02 13:00:09 +01:00
InputColors.h
LabelablePaintable.cpp LibWeb: Use paintable to represent event tracking node 2024-01-15 09:00:35 +01:00
LabelablePaintable.h
LinearGradientData.h LibWeb: Introduce RecordingPainter to serialize painting commands 2023-10-18 10:58:42 +02:00
MarkerPaintable.cpp LibWeb: Don't pass StringView to RecordingPainter, to avoid copy 2023-12-27 11:41:15 +01:00
MarkerPaintable.h
MediaPaintable.cpp LibWeb: Use paintable to represent event tracking node 2024-01-15 09:00:35 +01:00
MediaPaintable.h LibWeb: Introduce RecordingPainter to serialize painting commands 2023-10-18 10:58:42 +02:00
NestedBrowsingContextPaintable.cpp LibWeb+WebContent: Move paint recording init into Navigable 2024-01-15 14:33:56 +01:00
NestedBrowsingContextPaintable.h
Paintable.cpp LibWeb: Copy various flags from layout node to paintable 2024-03-02 13:00:09 +01:00
Paintable.h LibWeb: Add fast_is<T>() for SVGPaintable 2024-03-02 13:00:09 +01:00
PaintableBox.cpp LibWeb: Support CSS property background-clip: text 2024-03-03 15:33:12 +01:00
PaintableBox.h LibWeb: Support CSS property background-clip: text 2024-03-03 15:33:12 +01:00
PaintableFragment.cpp LibWeb: Make Paintable::containing_block() return a PaintableBox* 2024-03-01 17:57:10 +01:00
PaintableFragment.h LibGfx+LibWeb: Use ref-counted object to store glyph run 2024-03-02 09:09:10 +01:00
PaintContext.cpp LibWeb: Rename painter() to recording_painter() in PaintContext 2023-11-27 21:53:38 +01:00
PaintContext.h LibWeb: Move clip rect calculation to happen before painting 2024-01-28 08:25:28 +01:00
PaintOuterBoxShadowParams.h LibWeb: Introduce RecordingPainter to serialize painting commands 2023-10-18 10:58:42 +02:00
RadioButtonPaintable.cpp LibWeb: Rename painter() to recording_painter() in PaintContext 2023-11-27 21:53:38 +01:00
RadioButtonPaintable.h
RecordingPainter.cpp LibWeb: Support CSS property background-clip: text 2024-03-03 15:33:12 +01:00
RecordingPainter.h LibWeb: Support CSS property background-clip: text 2024-03-03 15:33:12 +01:00
ShadowData.h LibWeb: Introduce RecordingPainter to serialize painting commands 2023-10-18 10:58:42 +02:00
ShadowPainting.cpp LibGfx+LibWeb: Use ref-counted object to store glyph run 2024-03-02 09:09:10 +01:00
ShadowPainting.h LibWeb: Use separate structure to represent fragments in paintable tree 2024-01-13 10:53:38 +01:00
StackingContext.cpp LibWeb: Use a precalculated list of positioned descendants for painting 2024-03-03 08:40:46 +01:00
StackingContext.h LibWeb: Reduce paintable tree traversals during hit-testing 2024-03-01 13:03:53 +01:00
SVGGraphicsPaintable.cpp LibWeb: Remove spammy dbgln about unsupported SVG mask content units 2024-02-25 11:11:25 +01:00
SVGGraphicsPaintable.h LibWeb: Layout SVG <text> elements during layout (not while painting) 2023-10-30 19:44:54 +01:00
SVGPaintable.cpp LibWeb: Make Paintable::containing_block() return a PaintableBox* 2024-03-01 17:57:10 +01:00
SVGPaintable.h LibWeb: Add fast_is<T>() for SVGPaintable 2024-03-02 13:00:09 +01:00
SVGPathPaintable.cpp LibWeb: Change StackingContext::hit_test() to accept callback 2024-02-14 06:56:22 +01:00
SVGPathPaintable.h LibWeb: Change StackingContext::hit_test() to accept callback 2024-02-14 06:56:22 +01:00
SVGSVGPaintable.cpp LibWeb: Shift SVG paintable clip rectangle by scroll offset 2024-02-06 13:06:16 +01:00
SVGSVGPaintable.h
TableBordersPainting.cpp LibWeb: Rename painter() to recording_painter() in PaintContext 2023-11-27 21:53:38 +01:00
TableBordersPainting.h LibWeb: Make StackingContext point to paint tree instead of layout tree 2023-08-20 05:02:59 +02:00
TextPaintable.cpp LibWeb: Use paintable to represent event tracking node 2024-01-15 09:00:35 +01:00
TextPaintable.h LibWeb: Resolve text-decoration-thickness during layout commit 2024-01-26 07:36:40 +01:00
VideoPaintable.cpp LibWeb: Rename painter() to recording_painter() in PaintContext 2023-11-27 21:53:38 +01:00
VideoPaintable.h
ViewportPaintable.cpp LibWeb: Avoid repeated layout lookups in resolve_paint_only_properties() 2024-03-02 13:00:09 +01:00
ViewportPaintable.h LibWeb: Optimize scroll offset and clip state recalculation 2024-02-09 16:45:44 +01:00