mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:07:46 +00:00
LibWeb: Make SVG <svg> elements behave as CSS replaced elements
This makes SVG-in-HTML behave quite a bit better by following general replaced layout rules. It also turns <svg> elements into inline-level boxes instead of block-level boxes.
This commit is contained in:
parent
48abbefb99
commit
28b771560a
10 changed files with 21 additions and 14 deletions
|
@ -6,17 +6,17 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/Layout/SVGGraphicsBox.h>
|
||||
#include <LibWeb/Layout/ReplacedBox.h>
|
||||
#include <LibWeb/SVG/SVGSVGElement.h>
|
||||
|
||||
namespace Web::Layout {
|
||||
|
||||
class SVGSVGBox final : public SVGGraphicsBox {
|
||||
class SVGSVGBox final : public ReplacedBox {
|
||||
public:
|
||||
SVGSVGBox(DOM::Document&, SVG::SVGSVGElement&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
virtual ~SVGSVGBox() override = default;
|
||||
|
||||
SVG::SVGSVGElement& dom_node() { return verify_cast<SVG::SVGSVGElement>(SVGGraphicsBox::dom_node()); }
|
||||
SVG::SVGSVGElement& dom_node() { return verify_cast<SVG::SVGSVGElement>(ReplacedBox::dom_node()); }
|
||||
|
||||
virtual bool can_have_children() const override { return true; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue