diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-10-05 22:07:45 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-10-05 23:29:01 +0200 |
commit | 09dccb32245485e626048edfec484c52de145007 (patch) | |
tree | 780f134b4b620977e7e48d84dd472e88de1fdb96 /Libraries/LibHTML/DOM | |
parent | 7162347563ded87d57066080d481222505eca6df (diff) | |
download | serenity-09dccb32245485e626048edfec484c52de145007.zip |
LibHTML: Flesh out <img> element with LayoutImage and LayoutReplaced
This patch adds parsing of <img> into HTMLImageElement objects.
It also adds LayoutImage and its parent class LayoutReplaced, which is
going to represent CSS "replaced elements."
Diffstat (limited to 'Libraries/LibHTML/DOM')
-rw-r--r-- | Libraries/LibHTML/DOM/HTMLImageElement.cpp | 10 | ||||
-rw-r--r-- | Libraries/LibHTML/DOM/HTMLImageElement.h | 12 |
2 files changed, 22 insertions, 0 deletions
diff --git a/Libraries/LibHTML/DOM/HTMLImageElement.cpp b/Libraries/LibHTML/DOM/HTMLImageElement.cpp new file mode 100644 index 0000000000..864cc2b91e --- /dev/null +++ b/Libraries/LibHTML/DOM/HTMLImageElement.cpp @@ -0,0 +1,10 @@ +#include <LibHTML/DOM/HTMLImageElement.h> + +HTMLImageElement::HTMLImageElement(Document& document, const String& tag_name) + : HTMLElement(document, tag_name) +{ +} + +HTMLImageElement::~HTMLImageElement() +{ +} diff --git a/Libraries/LibHTML/DOM/HTMLImageElement.h b/Libraries/LibHTML/DOM/HTMLImageElement.h new file mode 100644 index 0000000000..0bb37bd2ed --- /dev/null +++ b/Libraries/LibHTML/DOM/HTMLImageElement.h @@ -0,0 +1,12 @@ +#pragma once + +#include <LibHTML/DOM/HTMLElement.h> + +class HTMLImageElement : public HTMLElement { +public: + HTMLImageElement(Document&, const String& tag_name); + virtual ~HTMLImageElement() override; + + String alt() const { return attribute("alt"); } + String src() const { return attribute("src"); } +}; |