LibWeb: Mark canvas element for relayout when width or height changes

While width and height are presentational hints on canvas, they actually
map to the CSS aspect-ratio attribute, not to CSS width and height.
For this reason, we actually need to manually mark for relayout here.

Also import a WPT test that was flaky before this change.
This commit is contained in:
Andreas Kling 2025-05-19 11:04:13 +02:00 committed by Andreas Kling
commit 1a055fcb24
Notes: github-actions[bot] 2025-05-19 11:59:00 +00:00
5 changed files with 42 additions and 0 deletions

View file

@ -93,6 +93,7 @@ enum class StyleInvalidationReason {
#define ENUMERATE_SET_NEEDS_LAYOUT_REASONS(X) \
X(CharacterDataReplaceData) \
X(FinalizeACrossDocumentNavigation) \
X(HTMLCanvasElementWidthOrHeightChange) \
X(HTMLImageElementReactToChangesInTheEnvironment) \
X(HTMLImageElementUpdateTheImageData) \
X(HTMLVideoElementSetVideoTrack) \