mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:37:34 +00:00
LibWeb: Move everything into the Web namespace
This commit is contained in:
parent
6a3b12664a
commit
7a6c4a72d5
143 changed files with 593 additions and 45 deletions
|
@ -41,13 +41,13 @@ InspectorWidget::InspectorWidget()
|
|||
auto& splitter = add<GUI::VerticalSplitter>();
|
||||
m_dom_tree_view = splitter.add<GUI::TreeView>();
|
||||
m_dom_tree_view->on_selection = [this](auto& index) {
|
||||
auto* node = static_cast<Node*>(index.internal_data());
|
||||
auto* node = static_cast<Web::Node*>(index.internal_data());
|
||||
node->document().set_inspected_node(node);
|
||||
if (node->is_element()) {
|
||||
auto element = to<Element>(*node);
|
||||
auto element = Web::to<Web::Element>(*node);
|
||||
if (element.resolved_style()) {
|
||||
m_style_table_view->set_model(StylePropertiesModel::create(*element.resolved_style()));
|
||||
m_computed_style_table_view->set_model(StylePropertiesModel::create(*element.computed_style()));
|
||||
m_style_table_view->set_model(Web::StylePropertiesModel::create(*element.resolved_style()));
|
||||
m_computed_style_table_view->set_model(Web::StylePropertiesModel::create(*element.computed_style()));
|
||||
}
|
||||
} else {
|
||||
m_style_table_view->set_model(nullptr);
|
||||
|
@ -68,10 +68,10 @@ InspectorWidget::~InspectorWidget()
|
|||
{
|
||||
}
|
||||
|
||||
void InspectorWidget::set_document(Document* document)
|
||||
void InspectorWidget::set_document(Web::Document* document)
|
||||
{
|
||||
if (m_document == document)
|
||||
return;
|
||||
m_document = document;
|
||||
m_dom_tree_view->set_model(DOMTreeModel::create(*document));
|
||||
m_dom_tree_view->set_model(Web::DOMTreeModel::create(*document));
|
||||
}
|
||||
|
|
|
@ -25,15 +25,14 @@
|
|||
*/
|
||||
|
||||
#include <LibGUI/Widget.h>
|
||||
|
||||
class Document;
|
||||
#include <LibHTML/Forward.h>
|
||||
|
||||
class InspectorWidget final : public GUI::Widget {
|
||||
C_OBJECT(InspectorWidget)
|
||||
public:
|
||||
virtual ~InspectorWidget();
|
||||
|
||||
void set_document(Document*);
|
||||
void set_document(Web::Document*);
|
||||
|
||||
private:
|
||||
InspectorWidget();
|
||||
|
@ -41,5 +40,5 @@ private:
|
|||
RefPtr<GUI::TreeView> m_dom_tree_view;
|
||||
RefPtr<GUI::TableView> m_style_table_view;
|
||||
RefPtr<GUI::TableView> m_computed_style_table_view;
|
||||
RefPtr<Document> m_document;
|
||||
RefPtr<Web::Document> m_document;
|
||||
};
|
||||
|
|
|
@ -64,7 +64,7 @@ int main(int argc, char** argv)
|
|||
GUI::Application app(argc, argv);
|
||||
|
||||
// Connect to the ProtocolServer immediately so we can drop the "unix" pledge.
|
||||
ResourceLoader::the();
|
||||
Web::ResourceLoader::the();
|
||||
|
||||
if (pledge("stdio shared_buffer accept rpath", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
|
@ -81,7 +81,7 @@ int main(int argc, char** argv)
|
|||
widget.layout()->set_spacing(0);
|
||||
|
||||
auto& toolbar = widget.add<GUI::ToolBar>();
|
||||
auto& html_widget = widget.add<HtmlView>();
|
||||
auto& html_widget = widget.add<Web::HtmlView>();
|
||||
|
||||
History<URL> history;
|
||||
|
||||
|
@ -157,12 +157,12 @@ int main(int argc, char** argv)
|
|||
statusbar.set_text(href);
|
||||
};
|
||||
|
||||
ResourceLoader::the().on_load_counter_change = [&] {
|
||||
if (ResourceLoader::the().pending_loads() == 0) {
|
||||
Web::ResourceLoader::the().on_load_counter_change = [&] {
|
||||
if (Web::ResourceLoader::the().pending_loads() == 0) {
|
||||
statusbar.set_text("");
|
||||
return;
|
||||
}
|
||||
statusbar.set_text(String::format("Loading (%d pending resources...)", ResourceLoader::the().pending_loads()));
|
||||
statusbar.set_text(String::format("Loading (%d pending resources...)", Web::ResourceLoader::the().pending_loads()));
|
||||
};
|
||||
|
||||
auto menubar = make<GUI::MenuBar>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue