1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00

LibWeb: Rename PageView => InProcessWebView

This commit is contained in:
Andreas Kling 2020-08-17 15:58:29 +02:00
parent ba856c7ebe
commit 56c3748dcc
31 changed files with 88 additions and 88 deletions

View file

@ -29,7 +29,7 @@
#include <LibGUI/Widget.h> #include <LibGUI/Widget.h>
#include <LibJS/Console.h> #include <LibJS/Console.h>
#include <LibJS/Forward.h> #include <LibJS/Forward.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
namespace Browser { namespace Browser {

View file

@ -57,7 +57,7 @@ ConsoleWidget::ConsoleWidget()
html_element->append_child(body_element); html_element->append_child(body_element);
m_output_container = body_element; m_output_container = body_element;
m_output_view = add<Web::PageView>(); m_output_view = add<Web::InProcessWebView>();
m_output_view->set_document(base_document); m_output_view->set_document(base_document);
auto& bottom_container = add<GUI::Widget>(); auto& bottom_container = add<GUI::Widget>();

View file

@ -30,7 +30,7 @@
#include "History.h" #include "History.h"
#include <LibGUI/Widget.h> #include <LibGUI/Widget.h>
#include <LibJS/Forward.h> #include <LibJS/Forward.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
namespace Browser { namespace Browser {
@ -51,7 +51,7 @@ private:
virtual void focusin_event(GUI::FocusEvent&) override; virtual void focusin_event(GUI::FocusEvent&) override;
RefPtr<GUI::TextBox> m_input; RefPtr<GUI::TextBox> m_input;
RefPtr<Web::PageView> m_output_view; RefPtr<Web::InProcessWebView> m_output_view;
RefPtr<Web::DOM::Element> m_output_container; RefPtr<Web::DOM::Element> m_output_container;
WeakPtr<JS::Interpreter> m_interpreter; WeakPtr<JS::Interpreter> m_interpreter;
OwnPtr<BrowserConsoleClient> m_console_client; OwnPtr<BrowserConsoleClient> m_console_client;

View file

@ -56,7 +56,7 @@
#include <LibWeb/Layout/LayoutNode.h> #include <LibWeb/Layout/LayoutNode.h>
#include <LibWeb/Loader/ResourceLoader.h> #include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/Page/Frame.h> #include <LibWeb/Page/Frame.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
#include <LibWeb/WebContentView.h> #include <LibWeb/WebContentView.h>
namespace Browser { namespace Browser {
@ -83,7 +83,7 @@ Tab::Tab(Type type)
auto& toolbar = m_toolbar_container->add<GUI::ToolBar>(); auto& toolbar = m_toolbar_container->add<GUI::ToolBar>();
if (m_type == Type::InProcessWebView) if (m_type == Type::InProcessWebView)
m_page_view = widget.add<Web::PageView>(); m_page_view = widget.add<Web::InProcessWebView>();
else else
m_web_content_view = widget.add<WebContentView>(); m_web_content_view = widget.add<WebContentView>();

View file

@ -87,7 +87,7 @@ private:
History m_history; History m_history;
RefPtr<Web::PageView> m_page_view; RefPtr<Web::InProcessWebView> m_page_view;
RefPtr<WebContentView> m_web_content_view; RefPtr<WebContentView> m_web_content_view;
RefPtr<GUI::Action> m_go_back_action; RefPtr<GUI::Action> m_go_back_action;

View file

@ -48,7 +48,7 @@
#include <LibGUI/Window.h> #include <LibGUI/Window.h>
#include <LibMarkdown/Document.h> #include <LibMarkdown/Document.h>
#include <LibWeb/Layout/LayoutNode.h> #include <LibWeb/Layout/LayoutNode.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
#include <libgen.h> #include <libgen.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -150,7 +150,7 @@ int main(int argc, char* argv[])
left_tab_bar.set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill); left_tab_bar.set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
left_tab_bar.set_preferred_size(200, 500); left_tab_bar.set_preferred_size(200, 500);
auto& page_view = splitter.add<Web::PageView>(); auto& page_view = splitter.add<Web::InProcessWebView>();
History history; History history;

View file

@ -39,7 +39,7 @@
#include <LibGUI/TextBox.h> #include <LibGUI/TextBox.h>
#include <LibGUI/TextEditor.h> #include <LibGUI/TextEditor.h>
#include <LibGUI/Window.h> #include <LibGUI/Window.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
IRCWindow::IRCWindow(IRCClient& client, void* owner, Type type, const String& name) IRCWindow::IRCWindow(IRCClient& client, void* owner, Type type, const String& name)
: m_client(client) : m_client(client)
@ -52,7 +52,7 @@ IRCWindow::IRCWindow(IRCClient& client, void* owner, Type type, const String& na
// Make a container for the log buffer view + (optional) member list. // Make a container for the log buffer view + (optional) member list.
auto& container = add<GUI::HorizontalSplitter>(); auto& container = add<GUI::HorizontalSplitter>();
m_page_view = container.add<Web::PageView>(); m_page_view = container.add<Web::InProcessWebView>();
if (m_type == Channel) { if (m_type == Channel) {
auto& member_view = container.add<GUI::TableView>(); auto& member_view = container.add<GUI::TableView>();

View file

@ -74,7 +74,7 @@ private:
void* m_owner { nullptr }; void* m_owner { nullptr };
Type m_type; Type m_type;
String m_name; String m_name;
RefPtr<Web::PageView> m_page_view; RefPtr<Web::InProcessWebView> m_page_view;
RefPtr<GUI::TextBox> m_text_box; RefPtr<GUI::TextBox> m_text_box;
RefPtr<IRCLogBuffer> m_log_buffer; RefPtr<IRCLogBuffer> m_log_buffer;
RefPtr<GUI::Menu> m_context_menu; RefPtr<GUI::Menu> m_context_menu;

View file

@ -52,7 +52,7 @@
#include <LibGUI/ToolBarContainer.h> #include <LibGUI/ToolBarContainer.h>
#include <LibGfx/Font.h> #include <LibGfx/Font.h>
#include <LibMarkdown/Document.h> #include <LibMarkdown/Document.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
#include <string.h> #include <string.h>
TextEditorWidget::TextEditorWidget() TextEditorWidget::TextEditorWidget()
@ -92,7 +92,7 @@ TextEditorWidget::TextEditorWidget()
m_statusbar->set_text(builder.to_string()); m_statusbar->set_text(builder.to_string());
}; };
m_page_view = splitter.add<Web::PageView>(); m_page_view = splitter.add<Web::InProcessWebView>();
m_page_view->set_visible(false); m_page_view->set_visible(false);
m_page_view->on_link_hover = [this, update_statusbar_cursor_position = move(update_statusbar_cursor_position)](auto& url) { m_page_view->on_link_hover = [this, update_statusbar_cursor_position = move(update_statusbar_cursor_position)](auto& url) {
if (url.is_valid()) if (url.is_valid())

View file

@ -104,7 +104,7 @@ private:
RefPtr<GUI::Action> m_js_highlight; RefPtr<GUI::Action> m_js_highlight;
RefPtr<GUI::Action> m_ini_highlight; RefPtr<GUI::Action> m_ini_highlight;
RefPtr<Web::PageView> m_page_view; RefPtr<Web::InProcessWebView> m_page_view;
GUI::ActionGroup font_actions; GUI::ActionGroup font_actions;

View file

@ -40,7 +40,7 @@
#include <LibWeb/DOM/ElementFactory.h> #include <LibWeb/DOM/ElementFactory.h>
#include <LibWeb/DOM/Text.h> #include <LibWeb/DOM/Text.h>
#include <LibWeb/HTML/HTMLHeadElement.h> #include <LibWeb/HTML/HTMLHeadElement.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
// #define EDITOR_DEBUG // #define EDITOR_DEBUG
@ -51,7 +51,7 @@ Editor::Editor()
m_documentation_tooltip_window = GUI::Window::construct(); m_documentation_tooltip_window = GUI::Window::construct();
m_documentation_tooltip_window->set_rect(0, 0, 500, 400); m_documentation_tooltip_window->set_rect(0, 0, 500, 400);
m_documentation_tooltip_window->set_window_type(GUI::WindowType::Tooltip); m_documentation_tooltip_window->set_window_type(GUI::WindowType::Tooltip);
m_documentation_page_view = m_documentation_tooltip_window->set_main_widget<Web::PageView>(); m_documentation_page_view = m_documentation_tooltip_window->set_main_widget<Web::InProcessWebView>();
} }
Editor::~Editor() Editor::~Editor()

View file

@ -81,7 +81,7 @@ private:
explicit Editor(); explicit Editor();
RefPtr<GUI::Window> m_documentation_tooltip_window; RefPtr<GUI::Window> m_documentation_tooltip_window;
RefPtr<Web::PageView> m_documentation_page_view; RefPtr<Web::InProcessWebView> m_documentation_page_view;
String m_last_parsed_token; String m_last_parsed_token;
GUI::TextPosition m_previous_text_position { 0, 0 }; GUI::TextPosition m_previous_text_position { 0, 0 };
bool m_hovering_editor { false }; bool m_hovering_editor { false };

View file

@ -124,6 +124,7 @@ set(SOURCES
HTML/Parser/HTMLTokenizer.cpp HTML/Parser/HTMLTokenizer.cpp
HTML/Parser/ListOfActiveFormattingElements.cpp HTML/Parser/ListOfActiveFormattingElements.cpp
HTML/Parser/StackOfOpenElements.cpp HTML/Parser/StackOfOpenElements.cpp
InProcessWebView.cpp
Layout/BoxModelMetrics.cpp Layout/BoxModelMetrics.cpp
Layout/LayoutBlock.cpp Layout/LayoutBlock.cpp
Layout/LayoutBox.cpp Layout/LayoutBox.cpp
@ -157,7 +158,6 @@ set(SOURCES
Page/EventHandler.cpp Page/EventHandler.cpp
Page/Frame.cpp Page/Frame.cpp
Page/Page.cpp Page/Page.cpp
PageView.cpp
Painting/StackingContext.cpp Painting/StackingContext.cpp
SVG/SVGElement.cpp SVG/SVGElement.cpp
SVG/SVGGeometryElement.cpp SVG/SVGGeometryElement.cpp

View file

@ -32,7 +32,7 @@
#include <LibWeb/Loader/LoadRequest.h> #include <LibWeb/Loader/LoadRequest.h>
#include <LibWeb/Loader/ResourceLoader.h> #include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/Page/Frame.h> #include <LibWeb/Page/Frame.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
namespace Web::CSS { namespace Web::CSS {

View file

@ -55,7 +55,7 @@
#include <LibWeb/Layout/LayoutTreeBuilder.h> #include <LibWeb/Layout/LayoutTreeBuilder.h>
#include <LibWeb/Origin.h> #include <LibWeb/Origin.h>
#include <LibWeb/Page/Frame.h> #include <LibWeb/Page/Frame.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
#include <LibWeb/SVG/TagNames.h> #include <LibWeb/SVG/TagNames.h>
#include <stdio.h> #include <stdio.h>

View file

@ -33,7 +33,7 @@
#include <LibWeb/DOM/Timer.h> #include <LibWeb/DOM/Timer.h>
#include <LibWeb/DOM/Window.h> #include <LibWeb/DOM/Window.h>
#include <LibWeb/Page/Frame.h> #include <LibWeb/Page/Frame.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
namespace Web::DOM { namespace Web::DOM {

View file

@ -143,7 +143,7 @@ class LoadRequest;
class Origin; class Origin;
class Page; class Page;
class PageClient; class PageClient;
class PageView; class InProcessWebView;
class PaintContext; class PaintContext;
class Resource; class Resource;
class ResourceLoader; class ResourceLoader;

View file

@ -28,7 +28,7 @@
#include <LibWeb/HTML/HTMLFormElement.h> #include <LibWeb/HTML/HTMLFormElement.h>
#include <LibWeb/HTML/HTMLInputElement.h> #include <LibWeb/HTML/HTMLInputElement.h>
#include <LibWeb/Page/Frame.h> #include <LibWeb/Page/Frame.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
#include <LibWeb/URLEncoder.h> #include <LibWeb/URLEncoder.h>
namespace Web::HTML { namespace Web::HTML {

View file

@ -37,7 +37,7 @@
#include <LibWeb/Layout/LayoutWidget.h> #include <LibWeb/Layout/LayoutWidget.h>
#include <LibWeb/Loader/ResourceLoader.h> #include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/Page/Frame.h> #include <LibWeb/Page/Frame.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
namespace Web::HTML { namespace Web::HTML {

View file

@ -33,7 +33,7 @@
#include <LibWeb/HTML/HTMLInputElement.h> #include <LibWeb/HTML/HTMLInputElement.h>
#include <LibWeb/Layout/LayoutWidget.h> #include <LibWeb/Layout/LayoutWidget.h>
#include <LibWeb/Page/Frame.h> #include <LibWeb/Page/Frame.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
namespace Web::HTML { namespace Web::HTML {
@ -50,7 +50,7 @@ RefPtr<LayoutNode> HTMLInputElement::create_layout_node(const CSS::StyleProperti
{ {
ASSERT(document().frame()); ASSERT(document().frame());
auto& frame = *document().frame(); auto& frame = *document().frame();
auto& page_view = const_cast<PageView&>(static_cast<const PageView&>(frame.page().client())); auto& page_view = const_cast<InProcessWebView&>(static_cast<const InProcessWebView&>(frame.page().client()));
if (type() == "hidden") if (type() == "hidden")
return nullptr; return nullptr;

View file

@ -50,7 +50,7 @@
#include <LibWeb/Loader/ResourceLoader.h> #include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/Page/EventHandler.h> #include <LibWeb/Page/EventHandler.h>
#include <LibWeb/Page/Frame.h> #include <LibWeb/Page/Frame.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
#include <LibWeb/Painting/PaintContext.h> #include <LibWeb/Painting/PaintContext.h>
#include <LibWeb/UIEvents/MouseEvent.h> #include <LibWeb/UIEvents/MouseEvent.h>
#include <stdio.h> #include <stdio.h>
@ -59,7 +59,7 @@
namespace Web { namespace Web {
PageView::PageView() InProcessWebView::InProcessWebView()
: m_page(make<Page>(*this)) : m_page(make<Page>(*this))
{ {
set_should_hide_unnecessary_scrollbars(true); set_should_hide_unnecessary_scrollbars(true);
@ -74,11 +74,11 @@ PageView::PageView()
}); });
} }
PageView::~PageView() InProcessWebView::~InProcessWebView()
{ {
} }
void PageView::select_all() void InProcessWebView::select_all()
{ {
auto* layout_root = this->layout_root(); auto* layout_root = this->layout_root();
if (!layout_root) if (!layout_root)
@ -113,25 +113,25 @@ void PageView::select_all()
update(); update();
} }
String PageView::selected_text() const String InProcessWebView::selected_text() const
{ {
// FIXME: Use focused frame // FIXME: Use focused frame
return page().main_frame().selected_text(); return page().main_frame().selected_text();
} }
void PageView::page_did_layout() void InProcessWebView::page_did_layout()
{ {
ASSERT(layout_root()); ASSERT(layout_root());
set_content_size(layout_root()->size().to_type<int>()); set_content_size(layout_root()->size().to_type<int>());
} }
void PageView::page_did_change_title(const String& title) void InProcessWebView::page_did_change_title(const String& title)
{ {
if (on_title_change) if (on_title_change)
on_title_change(title); on_title_change(title);
} }
void PageView::page_did_set_document_in_main_frame(DOM::Document* document) void InProcessWebView::page_did_set_document_in_main_frame(DOM::Document* document)
{ {
if (on_set_document) if (on_set_document)
on_set_document(document); on_set_document(document);
@ -140,81 +140,81 @@ void PageView::page_did_set_document_in_main_frame(DOM::Document* document)
update(); update();
} }
void PageView::page_did_start_loading(const URL& url) void InProcessWebView::page_did_start_loading(const URL& url)
{ {
if (on_load_start) if (on_load_start)
on_load_start(url); on_load_start(url);
} }
void PageView::page_did_change_selection() void InProcessWebView::page_did_change_selection()
{ {
update(); update();
} }
void PageView::page_did_request_cursor_change(GUI::StandardCursor cursor) void InProcessWebView::page_did_request_cursor_change(GUI::StandardCursor cursor)
{ {
if (window()) if (window())
window()->set_override_cursor(cursor); window()->set_override_cursor(cursor);
} }
void PageView::page_did_request_context_menu(const Gfx::IntPoint& content_position) void InProcessWebView::page_did_request_context_menu(const Gfx::IntPoint& content_position)
{ {
if (on_context_menu_request) if (on_context_menu_request)
on_context_menu_request(screen_relative_rect().location().translated(to_widget_position(content_position))); on_context_menu_request(screen_relative_rect().location().translated(to_widget_position(content_position)));
} }
void PageView::page_did_request_link_context_menu(const Gfx::IntPoint& content_position, const URL& url, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers) void InProcessWebView::page_did_request_link_context_menu(const Gfx::IntPoint& content_position, const URL& url, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers)
{ {
if (on_link_context_menu_request) if (on_link_context_menu_request)
on_link_context_menu_request(url, screen_relative_rect().location().translated(to_widget_position(content_position))); on_link_context_menu_request(url, screen_relative_rect().location().translated(to_widget_position(content_position)));
} }
void PageView::page_did_click_link(const URL& url, const String& target, unsigned modifiers) void InProcessWebView::page_did_click_link(const URL& url, const String& target, unsigned modifiers)
{ {
if (on_link_click) if (on_link_click)
on_link_click(url, target, modifiers); on_link_click(url, target, modifiers);
} }
void PageView::page_did_middle_click_link(const URL& url, const String& target, unsigned modifiers) void InProcessWebView::page_did_middle_click_link(const URL& url, const String& target, unsigned modifiers)
{ {
if (on_link_middle_click) if (on_link_middle_click)
on_link_middle_click(url, target, modifiers); on_link_middle_click(url, target, modifiers);
} }
void PageView::page_did_enter_tooltip_area(const Gfx::IntPoint& content_position, const String& title) void InProcessWebView::page_did_enter_tooltip_area(const Gfx::IntPoint& content_position, const String& title)
{ {
GUI::Application::the()->show_tooltip(title, screen_relative_rect().location().translated(to_widget_position(content_position)), nullptr); GUI::Application::the()->show_tooltip(title, screen_relative_rect().location().translated(to_widget_position(content_position)), nullptr);
} }
void PageView::page_did_leave_tooltip_area() void InProcessWebView::page_did_leave_tooltip_area()
{ {
GUI::Application::the()->hide_tooltip(); GUI::Application::the()->hide_tooltip();
} }
void PageView::page_did_hover_link(const URL& url) void InProcessWebView::page_did_hover_link(const URL& url)
{ {
if (on_link_hover) if (on_link_hover)
on_link_hover(url); on_link_hover(url);
} }
void PageView::page_did_unhover_link() void InProcessWebView::page_did_unhover_link()
{ {
if (on_link_hover) if (on_link_hover)
on_link_hover({}); on_link_hover({});
} }
void PageView::page_did_invalidate(const Gfx::IntRect&) void InProcessWebView::page_did_invalidate(const Gfx::IntRect&)
{ {
update(); update();
} }
void PageView::page_did_change_favicon(const Gfx::Bitmap& bitmap) void InProcessWebView::page_did_change_favicon(const Gfx::Bitmap& bitmap)
{ {
if (on_favicon_change) if (on_favicon_change)
on_favicon_change(bitmap); on_favicon_change(bitmap);
} }
void PageView::layout_and_sync_size() void InProcessWebView::layout_and_sync_size()
{ {
if (!document()) if (!document())
return; return;
@ -242,13 +242,13 @@ void PageView::layout_and_sync_size()
#endif #endif
} }
void PageView::resize_event(GUI::ResizeEvent& event) void InProcessWebView::resize_event(GUI::ResizeEvent& event)
{ {
GUI::ScrollableWidget::resize_event(event); GUI::ScrollableWidget::resize_event(event);
layout_and_sync_size(); layout_and_sync_size();
} }
void PageView::paint_event(GUI::PaintEvent& event) void InProcessWebView::paint_event(GUI::PaintEvent& event)
{ {
GUI::Frame::paint_event(event); GUI::Frame::paint_event(event);
@ -277,25 +277,25 @@ void PageView::paint_event(GUI::PaintEvent& event)
layout_root()->paint_all_phases(context); layout_root()->paint_all_phases(context);
} }
void PageView::mousemove_event(GUI::MouseEvent& event) void InProcessWebView::mousemove_event(GUI::MouseEvent& event)
{ {
page().handle_mousemove(to_content_position(event.position()), event.buttons(), event.modifiers()); page().handle_mousemove(to_content_position(event.position()), event.buttons(), event.modifiers());
GUI::ScrollableWidget::mousemove_event(event); GUI::ScrollableWidget::mousemove_event(event);
} }
void PageView::mousedown_event(GUI::MouseEvent& event) void InProcessWebView::mousedown_event(GUI::MouseEvent& event)
{ {
page().handle_mousedown(to_content_position(event.position()), event.button(), event.modifiers()); page().handle_mousedown(to_content_position(event.position()), event.button(), event.modifiers());
GUI::ScrollableWidget::mousedown_event(event); GUI::ScrollableWidget::mousedown_event(event);
} }
void PageView::mouseup_event(GUI::MouseEvent& event) void InProcessWebView::mouseup_event(GUI::MouseEvent& event)
{ {
page().handle_mouseup(to_content_position(event.position()), event.button(), event.modifiers()); page().handle_mouseup(to_content_position(event.position()), event.button(), event.modifiers());
GUI::ScrollableWidget::mouseup_event(event); GUI::ScrollableWidget::mouseup_event(event);
} }
void PageView::keydown_event(GUI::KeyEvent& event) void InProcessWebView::keydown_event(GUI::KeyEvent& event)
{ {
bool page_accepted_event = page().handle_keydown(event.key(), event.modifiers(), event.code_point()); bool page_accepted_event = page().handle_keydown(event.key(), event.modifiers(), event.code_point());
@ -337,26 +337,26 @@ void PageView::keydown_event(GUI::KeyEvent& event)
event.accept(); event.accept();
} }
URL PageView::url() const URL InProcessWebView::url() const
{ {
if (!page().main_frame().document()) if (!page().main_frame().document())
return {}; return {};
return page().main_frame().document()->url(); return page().main_frame().document()->url();
} }
void PageView::reload() void InProcessWebView::reload()
{ {
load(url()); load(url());
} }
void PageView::load_html(const StringView& html, const URL& url) void InProcessWebView::load_html(const StringView& html, const URL& url)
{ {
HTML::HTMLDocumentParser parser(html, "utf-8"); HTML::HTMLDocumentParser parser(html, "utf-8");
parser.run(url); parser.run(url);
set_document(&parser.document()); set_document(&parser.document());
} }
bool PageView::load(const URL& url) bool InProcessWebView::load(const URL& url)
{ {
if (window()) if (window())
window()->set_override_cursor(GUI::StandardCursor::None); window()->set_override_cursor(GUI::StandardCursor::None);
@ -364,51 +364,51 @@ bool PageView::load(const URL& url)
return page().main_frame().loader().load(url, FrameLoader::Type::Navigation); return page().main_frame().loader().load(url, FrameLoader::Type::Navigation);
} }
const LayoutDocument* PageView::layout_root() const const LayoutDocument* InProcessWebView::layout_root() const
{ {
return document() ? document()->layout_node() : nullptr; return document() ? document()->layout_node() : nullptr;
} }
LayoutDocument* PageView::layout_root() LayoutDocument* InProcessWebView::layout_root()
{ {
if (!document()) if (!document())
return nullptr; return nullptr;
return const_cast<LayoutDocument*>(document()->layout_node()); return const_cast<LayoutDocument*>(document()->layout_node());
} }
void PageView::page_did_request_scroll_into_view(const Gfx::IntRect& rect) void InProcessWebView::page_did_request_scroll_into_view(const Gfx::IntRect& rect)
{ {
scroll_into_view(rect, true, true); scroll_into_view(rect, true, true);
window()->set_override_cursor(GUI::StandardCursor::None); window()->set_override_cursor(GUI::StandardCursor::None);
} }
void PageView::load_empty_document() void InProcessWebView::load_empty_document()
{ {
page().main_frame().set_document(nullptr); page().main_frame().set_document(nullptr);
} }
DOM::Document* PageView::document() DOM::Document* InProcessWebView::document()
{ {
return page().main_frame().document(); return page().main_frame().document();
} }
const DOM::Document* PageView::document() const const DOM::Document* InProcessWebView::document() const
{ {
return page().main_frame().document(); return page().main_frame().document();
} }
void PageView::set_document(DOM::Document* document) void InProcessWebView::set_document(DOM::Document* document)
{ {
page().main_frame().set_document(document); page().main_frame().set_document(document);
} }
void PageView::did_scroll() void InProcessWebView::did_scroll()
{ {
page().main_frame().set_viewport_rect(viewport_rect_in_content_coordinates()); page().main_frame().set_viewport_rect(viewport_rect_in_content_coordinates());
page().main_frame().did_scroll({}); page().main_frame().did_scroll({});
} }
void PageView::drop_event(GUI::DropEvent& event) void InProcessWebView::drop_event(GUI::DropEvent& event)
{ {
if (event.mime_data().has_urls()) { if (event.mime_data().has_urls()) {
if (on_url_drop) { if (on_url_drop) {

View file

@ -34,14 +34,14 @@
namespace Web { namespace Web {
class PageView final class InProcessWebView final
: public GUI::ScrollableWidget : public GUI::ScrollableWidget
, public WebViewHooks , public WebViewHooks
, public PageClient { , public PageClient {
C_OBJECT(PageView); C_OBJECT(InProcessWebView);
public: public:
virtual ~PageView() override; virtual ~InProcessWebView() override;
void load_html(const StringView&, const URL&); void load_html(const StringView&, const URL&);
void load_empty_document(); void load_empty_document();
@ -70,7 +70,7 @@ public:
void select_all(); void select_all();
private: private:
PageView(); InProcessWebView();
Page& page() { return *m_page; } Page& page() { return *m_page; }
const Page& page() const { return *m_page; } const Page& page() const { return *m_page; }

View file

@ -33,7 +33,7 @@
#include <LibWeb/Layout/LayoutDocument.h> #include <LibWeb/Layout/LayoutDocument.h>
#include <LibWeb/Layout/LayoutFrame.h> #include <LibWeb/Layout/LayoutFrame.h>
#include <LibWeb/Page/Frame.h> #include <LibWeb/Page/Frame.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
//#define DEBUG_HIGHLIGHT_FOCUSED_FRAME //#define DEBUG_HIGHLIGHT_FOCUSED_FRAME

View file

@ -32,7 +32,7 @@
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/Layout/LayoutWidget.h> #include <LibWeb/Layout/LayoutWidget.h>
#include <LibWeb/Page/Frame.h> #include <LibWeb/Page/Frame.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
namespace Web { namespace Web {
@ -60,7 +60,7 @@ void LayoutWidget::did_set_rect()
void LayoutWidget::update_widget() void LayoutWidget::update_widget()
{ {
auto adjusted_widget_position = absolute_rect().location().to_type<int>(); auto adjusted_widget_position = absolute_rect().location().to_type<int>();
auto& page_view = static_cast<const PageView&>(frame().page().client()); auto& page_view = static_cast<const InProcessWebView&>(frame().page().client());
adjusted_widget_position.move_by(-page_view.horizontal_scrollbar().value(), -page_view.vertical_scrollbar().value()); adjusted_widget_position.move_by(-page_view.horizontal_scrollbar().value(), -page_view.vertical_scrollbar().value());
widget().move_to(adjusted_widget_position); widget().move_to(adjusted_widget_position);
} }

View file

@ -34,7 +34,7 @@
#include <LibWeb/Layout/LayoutDocument.h> #include <LibWeb/Layout/LayoutDocument.h>
#include <LibWeb/Page/EventHandler.h> #include <LibWeb/Page/EventHandler.h>
#include <LibWeb/Page/Frame.h> #include <LibWeb/Page/Frame.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
#include <LibWeb/UIEvents/MouseEvent.h> #include <LibWeb/UIEvents/MouseEvent.h>
namespace Web { namespace Web {
@ -196,7 +196,7 @@ bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned butt
hovered_link_element = node->enclosing_link_element(); hovered_link_element = node->enclosing_link_element();
if (hovered_link_element) { if (hovered_link_element) {
#ifdef HTML_DEBUG #ifdef HTML_DEBUG
dbg() << "PageView: hovering over a link to " << hovered_link_element->href(); dbg() << "InProcessWebView: hovering over a link to " << hovered_link_element->href();
#endif #endif
is_hovering_link = true; is_hovering_link = true;
} }

View file

@ -31,7 +31,7 @@
#include <LibWeb/Layout/LayoutText.h> #include <LibWeb/Layout/LayoutText.h>
#include <LibWeb/Layout/LayoutWidget.h> #include <LibWeb/Layout/LayoutWidget.h>
#include <LibWeb/Page/Frame.h> #include <LibWeb/Page/Frame.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
namespace Web { namespace Web {
@ -124,7 +124,7 @@ void Frame::set_needs_display(const Gfx::IntRect& rect)
host_element()->layout_node()->set_needs_display(); host_element()->layout_node()->set_needs_display();
} }
void Frame::did_scroll(Badge<PageView>) void Frame::did_scroll(Badge<InProcessWebView>)
{ {
if (!m_document) if (!m_document)
return; return;

View file

@ -66,7 +66,7 @@ public:
void set_viewport_rect(const Gfx::IntRect&); void set_viewport_rect(const Gfx::IntRect&);
Gfx::IntRect viewport_rect() const { return m_viewport_rect; } Gfx::IntRect viewport_rect() const { return m_viewport_rect; }
void did_scroll(Badge<PageView>); void did_scroll(Badge<InProcessWebView>);
FrameLoader& loader() { return m_loader; } FrameLoader& loader() { return m_loader; }
const FrameLoader& loader() const { return m_loader; } const FrameLoader& loader() const { return m_loader; }

View file

@ -26,7 +26,7 @@
#include <LibWeb/Page/Frame.h> #include <LibWeb/Page/Frame.h>
#include <LibWeb/Page/Page.h> #include <LibWeb/Page/Page.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
namespace Web { namespace Web {

View file

@ -19,7 +19,7 @@ WebContent::ClientConnection <---> WebContentClient
Single process model: Single process model:
===================== =====================
Web::PageView (this is a GUI::Widget, and also a Web::PageClient) Web::InProcessWebView (this is a GUI::Widget, and also a Web::PageClient)
Web::Page Web::Page
Web::Frame Web::Frame
Web::Document Web::Document

View file

@ -32,7 +32,7 @@
#include <LibGUI/Menu.h> #include <LibGUI/Menu.h>
#include <LibGUI/MenuBar.h> #include <LibGUI/MenuBar.h>
#include <LibGUI/Window.h> #include <LibGUI/Window.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
#include <stdio.h> #include <stdio.h>
int main(int argc, char** argv) int main(int argc, char** argv)
@ -55,7 +55,7 @@ int main(int argc, char** argv)
auto html = f->read_all(); auto html = f->read_all();
auto window = GUI::Window::construct(); auto window = GUI::Window::construct();
auto& widget = window->set_main_widget<Web::PageView>(); auto& widget = window->set_main_widget<Web::InProcessWebView>();
widget.load_html(html, URL()); widget.load_html(html, URL());
if (!widget.document()->title().is_null()) if (!widget.document()->title().is_null())
window->set_title(String::format("%s - HTML", widget.document()->title().characters())); window->set_title(String::format("%s - HTML", widget.document()->title().characters()));

View file

@ -44,7 +44,7 @@
#include <LibJS/Runtime/MarkedValueList.h> #include <LibJS/Runtime/MarkedValueList.h>
#include <LibWeb/HTML/Parser/HTMLDocumentParser.h> #include <LibWeb/HTML/Parser/HTMLDocumentParser.h>
#include <LibWeb/Loader/ResourceLoader.h> #include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/PageView.h> #include <LibWeb/InProcessWebView.h>
#include <sys/time.h> #include <sys/time.h>
#define TOP_LEVEL_TEST_NAME "__$$TOP_LEVEL$$__" #define TOP_LEVEL_TEST_NAME "__$$TOP_LEVEL$$__"
@ -136,7 +136,7 @@ JS_DEFINE_NATIVE_FUNCTION(TestRunnerObject::change_page)
class TestRunner { class TestRunner {
public: public:
TestRunner(String web_test_root, String js_test_root, Web::PageView& page_view, bool print_times) TestRunner(String web_test_root, String js_test_root, Web::InProcessWebView& page_view, bool print_times)
: m_web_test_root(move(web_test_root)) : m_web_test_root(move(web_test_root))
, m_js_test_root(move(js_test_root)) , m_js_test_root(move(js_test_root))
, m_print_times(print_times) , m_print_times(print_times)
@ -158,7 +158,7 @@ private:
double m_total_elapsed_time_in_ms { 0 }; double m_total_elapsed_time_in_ms { 0 };
JSTestRunnerCounts m_counts; JSTestRunnerCounts m_counts;
RefPtr<Web::PageView> m_page_view; RefPtr<Web::InProcessWebView> m_page_view;
RefPtr<JS::Program> m_js_test_common; RefPtr<JS::Program> m_js_test_common;
RefPtr<JS::Program> m_web_test_common; RefPtr<JS::Program> m_web_test_common;
@ -643,7 +643,7 @@ int main(int argc, char** argv)
auto& main_widget = window->set_main_widget<GUI::Widget>(); auto& main_widget = window->set_main_widget<GUI::Widget>();
main_widget.set_fill_with_background_color(true); main_widget.set_fill_with_background_color(true);
main_widget.set_layout<GUI::VerticalBoxLayout>(); main_widget.set_layout<GUI::VerticalBoxLayout>();
auto& view = main_widget.add<Web::PageView>(); auto& view = main_widget.add<Web::InProcessWebView>();
view.set_document(adopt(*new Web::DOM::Document)); view.set_document(adopt(*new Web::DOM::Document));