2019-10-05 23:20:35 +02:00
|
|
|
#include <LibHTML/CSS/StyleResolver.h>
|
2019-10-05 22:07:45 +02:00
|
|
|
#include <LibHTML/DOM/HTMLImageElement.h>
|
2019-10-05 23:20:35 +02:00
|
|
|
#include <LibHTML/Layout/LayoutImage.h>
|
2019-10-05 22:07:45 +02:00
|
|
|
|
|
|
|
HTMLImageElement::HTMLImageElement(Document& document, const String& tag_name)
|
|
|
|
: HTMLElement(document, tag_name)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
HTMLImageElement::~HTMLImageElement()
|
|
|
|
{
|
|
|
|
}
|
2019-10-05 23:20:35 +02:00
|
|
|
|
|
|
|
RefPtr<LayoutNode> HTMLImageElement::create_layout_node(const StyleResolver& resolver, const StyleProperties* parent_style) const
|
|
|
|
{
|
|
|
|
auto style = resolver.resolve_style(*this, parent_style);
|
|
|
|
|
|
|
|
auto display_property = style->property("display");
|
|
|
|
String display = display_property.has_value() ? display_property.release_value()->to_string() : "inline";
|
|
|
|
|
|
|
|
if (display == "none")
|
|
|
|
return nullptr;
|
|
|
|
return adopt(*new LayoutImage(*this, move(style)));
|
|
|
|
}
|