Console: Fix copying content when selection reaches un-rendered items
Console: Fix copying content when selection reaches un-rendered items

In bug 1115011 I made a change to the console whereby when the user
tries to copy content, we check if one of the selected message is a
table.
Unfortunately, the way I did this was by iterating over the
_renderedItems array, using the text selection as start and end indices.
The problem is  the _renderedItems array only contains the subset of
items that are rendered, and the selection may span more than this
subset.

This is causing "Cannot read property 'consoleMessage' of undefined"
exceptions and preventing users from copying altogether.

In this change, I made use of the _providerElement function instead.

Bug: 1115011
Change-Id: I10f9d55a6d6cdb4a15d7810f9a48ec694256068c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2393463
Commit-Queue: Patrick Brosset <f0b1693d3ec18fb190dd6deddb896f34ba3fd693@microsoft.com>
Reviewed-by: Mathias Bynens <17a2cbc4e33156874a9862b0f530521117e66a3d@chromium.org>

ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend