mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-08 09:35:15 +00:00
LibWeb: Add namespace to Element
This commit is contained in:
@@ -49,11 +49,11 @@ ConsoleWidget::ConsoleWidget()
|
||||
|
||||
auto base_document = adopt(*new Web::DOM::Document);
|
||||
base_document->append_child(adopt(*new Web::DOM::DocumentType(base_document)));
|
||||
auto html_element = Web::DOM::create_element(base_document, "html");
|
||||
auto html_element = base_document->create_element("html");
|
||||
base_document->append_child(html_element);
|
||||
auto head_element = Web::DOM::create_element(base_document, "head");
|
||||
auto head_element = base_document->create_element("head");
|
||||
html_element->append_child(head_element);
|
||||
auto body_element = Web::DOM::create_element(base_document, "body");
|
||||
auto body_element = base_document->create_element("body");
|
||||
html_element->append_child(body_element);
|
||||
m_output_container = body_element;
|
||||
|
||||
@@ -149,7 +149,7 @@ void ConsoleWidget::print_source_line(const StringView& source)
|
||||
|
||||
void ConsoleWidget::print_html(const StringView& line)
|
||||
{
|
||||
auto paragraph = create_element(m_output_container->document(), "p");
|
||||
auto paragraph = m_output_container->document().create_element("p");
|
||||
paragraph->set_inner_html(line);
|
||||
|
||||
m_output_container->append_child(paragraph);
|
||||
|
||||
@@ -42,14 +42,14 @@ IRCLogBuffer::IRCLogBuffer()
|
||||
{
|
||||
m_document = adopt(*new Web::DOM::Document);
|
||||
m_document->append_child(adopt(*new Web::DOM::DocumentType(document())));
|
||||
auto html_element = create_element(document(), "html");
|
||||
auto html_element = m_document->create_element("html");
|
||||
m_document->append_child(html_element);
|
||||
auto head_element = create_element(document(), "head");
|
||||
auto head_element = m_document->create_element("head");
|
||||
html_element->append_child(head_element);
|
||||
auto style_element = create_element(document(), "style");
|
||||
auto style_element = m_document->create_element("style");
|
||||
style_element->append_child(adopt(*new Web::DOM::Text(document(), "div { font-family: Csilla; font-weight: lighter; }")));
|
||||
head_element->append_child(style_element);
|
||||
auto body_element = create_element(document(), "body");
|
||||
auto body_element = m_document->create_element("body");
|
||||
html_element->append_child(body_element);
|
||||
m_container_element = body_element;
|
||||
}
|
||||
@@ -76,7 +76,7 @@ void IRCLogBuffer::add_message(char prefix, const String& name, const String& te
|
||||
escape_html_entities(nick_string),
|
||||
escape_html_entities(text));
|
||||
|
||||
auto wrapper = Web::DOM::create_element(*m_document, Web::HTML::TagNames::div);
|
||||
auto wrapper = m_document->create_element(Web::HTML::TagNames::div);
|
||||
wrapper->set_attribute(Web::HTML::AttributeNames::style, String::formatted("color: {}", color.to_string()));
|
||||
wrapper->set_inner_html(html);
|
||||
m_container_element->append_child(wrapper);
|
||||
@@ -90,7 +90,7 @@ void IRCLogBuffer::add_message(const String& text, Color color)
|
||||
"<span>{}</span>",
|
||||
timestamp_string(),
|
||||
escape_html_entities(text));
|
||||
auto wrapper = Web::DOM::create_element(*m_document, Web::HTML::TagNames::div);
|
||||
auto wrapper = m_document->create_element(Web::HTML::TagNames::div);
|
||||
wrapper->set_attribute(Web::HTML::AttributeNames::style, String::formatted("color: {}", color.to_string()));
|
||||
wrapper->set_inner_html(html);
|
||||
m_container_element->append_child(wrapper);
|
||||
|
||||
Reference in New Issue
Block a user