mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-06 09:01:53 +00:00
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:
parent
14d5c638eb
commit
1a055fcb24
Notes:
github-actions[bot]
2025-05-19 11:59:00 +00:00
Author: https://github.com/awesomekling
Commit: 1a055fcb24
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4814
5 changed files with 42 additions and 0 deletions
|
@ -193,6 +193,8 @@ void HTMLCanvasElement::attribute_changed(FlyString const& local_name, Optional<
|
|||
if (local_name.equals_ignoring_ascii_case(HTML::AttributeNames::width) || local_name.equals_ignoring_ascii_case(HTML::AttributeNames::height)) {
|
||||
notify_context_about_canvas_size_change();
|
||||
reset_context_to_default_state();
|
||||
if (auto layout_node = this->layout_node())
|
||||
layout_node->set_needs_layout_update(DOM::SetNeedsLayoutReason::HTMLCanvasElementWidthOrHeightChange);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue