This method builds a JSON object representing the full state of the DOM tree. The JSON that is built will be used for building the DOM Inspector widget for the OutOfProcessWebView.