1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 19:45:08 +00:00

LibWeb: Begin SVG element support

This commit starts adding a basic SVG element. Currently, svg elements
have support for the width and height properties, as well as the stroke,
stroke-width, and fill properties. The only child element supported
is the path element, as most other graphical elements are just shorthand
for paths.
This commit is contained in:
Matthew Olsson 2020-07-19 23:01:53 -07:00 committed by Andreas Kling
parent bbcdab2baa
commit 22f0953fe2
11 changed files with 1013 additions and 2 deletions

View file

@ -41,8 +41,10 @@
#include <LibWeb/DOM/HTMLInputElement.h>
#include <LibWeb/DOM/HTMLLinkElement.h>
#include <LibWeb/DOM/HTMLObjectElement.h>
#include <LibWeb/DOM/HTMLPathElement.h>
#include <LibWeb/DOM/HTMLScriptElement.h>
#include <LibWeb/DOM/HTMLStyleElement.h>
#include <LibWeb/DOM/HTMLSvgElement.h>
#include <LibWeb/DOM/HTMLTableCellElement.h>
#include <LibWeb/DOM/HTMLTableElement.h>
#include <LibWeb/DOM/HTMLTableRowElement.h>
@ -97,6 +99,10 @@ NonnullRefPtr<Element> create_element(Document& document, const FlyString& tag_n
return adopt(*new HTMLCanvasElement(document, lowercase_tag_name));
if (lowercase_tag_name == HTML::TagNames::object)
return adopt(*new HTMLObjectElement(document, lowercase_tag_name));
if (lowercase_tag_name == HTML::TagNames::svg)
return adopt(*new HTMLSvgElement(document, lowercase_tag_name));
if (lowercase_tag_name == HTML::TagNames::path)
return adopt(*new HTMLPathElement(document, lowercase_tag_name));
return adopt(*new Element(document, lowercase_tag_name));
}