LibWeb: Propagate iframe element margin attribute changes into content

This commit is contained in:
Andreas Kling 2025-02-22 14:55:07 +01:00 committed by Andreas Kling
parent 2725142db9
commit a34a45bf64
Notes: github-actions[bot] 2025-02-22 19:03:27 +00:00

View file

@ -65,6 +65,13 @@ void HTMLIFrameElement::attribute_changed(FlyString const& name, Optional<String
// FIXME: This should only invalidate the layout, not the style.
invalidate_style(DOM::StyleInvalidationReason::HTMLIFrameElementGeometryChange);
}
if (name == HTML::AttributeNames::marginwidth || name == HTML::AttributeNames::marginheight) {
if (auto* document = this->content_document_without_origin_check()) {
if (auto* body_element = document->body())
const_cast<HTMLElement*>(body_element)->set_needs_style_update(true);
}
}
}
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-iframe-element:html-element-post-connection-steps