1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:27:43 +00:00

LibWeb: Add naive layout for SVG foreign objects

We now layout foreign objects as if they form a nested block formatting
context. This probably isn't the most correct way to do this, but it's
a start.
This commit is contained in:
Andreas Kling 2022-11-10 13:54:57 +01:00
parent 0555684682
commit 4aeb1ffc12
2 changed files with 18 additions and 0 deletions

View file

@ -24,6 +24,7 @@
#include <LibWeb/Layout/TableRowBox.h>
#include <LibWeb/Layout/TextNode.h>
#include <LibWeb/Layout/TreeBuilder.h>
#include <LibWeb/SVG/SVGForeignObjectElement.h>
namespace Web::Layout {
@ -130,6 +131,8 @@ void TreeBuilder::insert_node_into_inline_or_block_ancestor(Layout::Node& node,
return ancestor;
if (!ancestor.display().is_flow_inside())
return ancestor;
if (ancestor.dom_node() && is<SVG::SVGForeignObjectElement>(*ancestor.dom_node()))
return ancestor;
}
VERIFY_NOT_REACHED();
}();