2020-08-01 03:05:43 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, The SerenityOS developers.
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-08-01 03:05:43 +01:00
|
|
|
*/
|
|
|
|
|
2021-04-03 21:32:16 -04:00
|
|
|
#include <LibWeb/DOM/Document.h>
|
2020-08-01 03:05:43 +01:00
|
|
|
#include <LibWeb/HTML/HTMLLabelElement.h>
|
2021-04-03 21:32:16 -04:00
|
|
|
#include <LibWeb/Layout/Label.h>
|
2020-08-01 03:05:43 +01:00
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
2021-02-07 11:20:15 +01:00
|
|
|
HTMLLabelElement::HTMLLabelElement(DOM::Document& document, QualifiedName qualified_name)
|
|
|
|
: HTMLElement(document, move(qualified_name))
|
2020-08-01 03:05:43 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
HTMLLabelElement::~HTMLLabelElement()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-04-03 21:32:16 -04:00
|
|
|
RefPtr<Layout::Node> HTMLLabelElement::create_layout_node()
|
|
|
|
{
|
|
|
|
auto style = document().style_resolver().resolve_style(*this);
|
|
|
|
if (style->display() == CSS::Display::None)
|
|
|
|
return nullptr;
|
|
|
|
|
2021-04-23 16:46:57 +02:00
|
|
|
auto layout_node = adopt_ref(*new Layout::Label(document(), this, move(style)));
|
2021-04-03 21:32:16 -04:00
|
|
|
layout_node->set_inline(true);
|
|
|
|
return layout_node;
|
|
|
|
}
|
|
|
|
|
2020-08-01 03:05:43 +01:00
|
|
|
}
|