diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-26 19:37:56 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-26 20:05:15 +0200 |
commit | 11ff9d0f17bc0cd49a61b7c4cc66036584d6d30b (patch) | |
tree | ec880ff36492c94b7854e84226bf64c3611bb20a /Applications/IRCClient | |
parent | 96d13f75cf2659cba8392db5469fdef1c831ceec (diff) | |
download | serenity-11ff9d0f17bc0cd49a61b7c4cc66036584d6d30b.zip |
LibWeb: Move DOM classes into the Web::DOM namespace
LibWeb keeps growing and the Web namespace is filling up fast.
Let's put DOM stuff into Web::DOM, just like we already started doing
with SVG stuff in Web::SVG.
Diffstat (limited to 'Applications/IRCClient')
-rw-r--r-- | Applications/IRCClient/IRCLogBuffer.cpp | 10 | ||||
-rw-r--r-- | Applications/IRCClient/IRCLogBuffer.h | 8 | ||||
-rw-r--r-- | Applications/IRCClient/IRCWindow.cpp | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/Applications/IRCClient/IRCLogBuffer.cpp b/Applications/IRCClient/IRCLogBuffer.cpp index 730b4d3b4a..18297dc155 100644 --- a/Applications/IRCClient/IRCLogBuffer.cpp +++ b/Applications/IRCClient/IRCLogBuffer.cpp @@ -40,14 +40,14 @@ NonnullRefPtr<IRCLogBuffer> IRCLogBuffer::create() IRCLogBuffer::IRCLogBuffer() { - m_document = adopt(*new Web::Document); - m_document->append_child(adopt(*new Web::DocumentType(document()))); + m_document = adopt(*new Web::DOM::Document); + m_document->append_child(adopt(*new Web::DOM::DocumentType(document()))); auto html_element = create_element(document(), "html"); m_document->append_child(html_element); auto head_element = create_element(document(), "head"); html_element->append_child(head_element); auto style_element = create_element(document(), "style"); - style_element->append_child(adopt(*new Web::Text(document(), "div { font-family: Csilla; font-weight: lighter; }"))); + 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"); html_element->append_child(body_element); @@ -76,7 +76,7 @@ void IRCLogBuffer::add_message(char prefix, const String& name, const String& te escape_html_entities(nick_string).characters(), escape_html_entities(text).characters()); - auto wrapper = Web::create_element(*m_document, Web::HTML::TagNames::div); + auto wrapper = Web::DOM::create_element(*m_document, Web::HTML::TagNames::div); wrapper->set_attribute(Web::HTML::AttributeNames::style, String::format("color: %s", color.to_string().characters())); 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>%s</span>", timestamp_string().characters(), escape_html_entities(text).characters()); - auto wrapper = Web::create_element(*m_document, Web::HTML::TagNames::div); + auto wrapper = Web::DOM::create_element(*m_document, Web::HTML::TagNames::div); wrapper->set_attribute(Web::HTML::AttributeNames::style, String::format("color: %s", color.to_string().characters())); wrapper->set_inner_html(html); m_container_element->append_child(wrapper); diff --git a/Applications/IRCClient/IRCLogBuffer.h b/Applications/IRCClient/IRCLogBuffer.h index 183ee21b01..0f62757c3f 100644 --- a/Applications/IRCClient/IRCLogBuffer.h +++ b/Applications/IRCClient/IRCLogBuffer.h @@ -49,11 +49,11 @@ public: void add_message(const String& text, Color = Color::Black); void dump() const; - const Web::Document& document() const { return *m_document; } - Web::Document& document() { return *m_document; } + const Web::DOM::Document& document() const { return *m_document; } + Web::DOM::Document& document() { return *m_document; } private: IRCLogBuffer(); - RefPtr<Web::Document> m_document; - RefPtr<Web::Element> m_container_element; + RefPtr<Web::DOM::Document> m_document; + RefPtr<Web::DOM::Element> m_container_element; }; diff --git a/Applications/IRCClient/IRCWindow.cpp b/Applications/IRCClient/IRCWindow.cpp index 26f6c62936..4272dbbb71 100644 --- a/Applications/IRCClient/IRCWindow.cpp +++ b/Applications/IRCClient/IRCWindow.cpp @@ -214,7 +214,7 @@ IRCWindow::~IRCWindow() void IRCWindow::set_log_buffer(const IRCLogBuffer& log_buffer) { m_log_buffer = &log_buffer; - m_page_view->set_document(const_cast<Web::Document*>(&log_buffer.document())); + m_page_view->set_document(const_cast<Web::DOM::Document*>(&log_buffer.document())); } bool IRCWindow::is_active() const |