|
@@ -305,8 +305,11 @@ void BrowsingContext::select_all()
|
|
|
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;
|
|
|
+ if (is<Layout::TextNode>(*last_layout_node)) {
|
|
|
+ auto const& text_for_rendering = verify_cast<Layout::TextNode>(*last_layout_node).text_for_rendering();
|
|
|
+ if (!text_for_rendering.is_empty())
|
|
|
+ last_layout_node_index_in_node = text_for_rendering.length() - 1;
|
|
|
+ }
|
|
|
|
|
|
layout_root->set_selection({ { first_layout_node, 0 }, { last_layout_node, last_layout_node_index_in_node } });
|
|
|
}
|