summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/InProcessWebView.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/InProcessWebView.cpp')
-rw-r--r--Userland/Libraries/LibWeb/InProcessWebView.cpp31
1 files changed, 1 insertions, 30 deletions
diff --git a/Userland/Libraries/LibWeb/InProcessWebView.cpp b/Userland/Libraries/LibWeb/InProcessWebView.cpp
index 0379e50dfb..8e0f8fd8ce 100644
--- a/Userland/Libraries/LibWeb/InProcessWebView.cpp
+++ b/Userland/Libraries/LibWeb/InProcessWebView.cpp
@@ -54,36 +54,7 @@ InProcessWebView::~InProcessWebView()
void InProcessWebView::select_all()
{
- auto* layout_root = this->layout_root();
- if (!layout_root)
- return;
-
- const Layout::Node* first_layout_node = layout_root;
-
- for (;;) {
- auto* next = first_layout_node->next_in_pre_order();
- if (!next)
- break;
- first_layout_node = next;
- if (is<Layout::TextNode>(*first_layout_node))
- break;
- }
-
- const Layout::Node* last_layout_node = first_layout_node;
-
- for (const Layout::Node* layout_node = first_layout_node; layout_node; layout_node = layout_node->next_in_pre_order()) {
- if (is<Layout::TextNode>(*layout_node))
- last_layout_node = layout_node;
- }
-
- VERIFY(first_layout_node);
- VERIFY(last_layout_node);
-
- int last_layout_node_index_in_node = 0;
- if (is<Layout::TextNode>(*last_layout_node))
- last_layout_node_index_in_node = verify_cast<Layout::TextNode>(*last_layout_node).text_for_rendering().length() - 1;
-
- layout_root->set_selection({ { first_layout_node, 0 }, { last_layout_node, last_layout_node_index_in_node } });
+ page().focused_context().select_all();
update();
}