Console messages containing long URLs should cut at some reasonable length.
authormkwst <mkwst@chromium.org>
Mon, 15 Oct 2012 21:00:26 +0000 (21:00 +0000)
committermkwst <mkwst@chromium.org>
Mon, 15 Oct 2012 21:00:26 +0000 (21:00 +0000)
commit17e8d4ceb0b02ca29f93d540f1cbbcf102ec6d39
tree10f9454026395cc71c7bb1383433beb56c567c4d
parentbe7a0203fa9ae5263b0d796414f951f9445c66c6
Console messages containing long URLs should cut at some reasonable length.
https://bugs.webkit.org/show_bug.cgi?id=97980

Reviewed by Pavel Feldman.

Source/WebCore:

This patch lightly modifies the current styling of linkified URLs inside
console messages in order to cut them down to some reasonable size for
viewing. The middle of the URL is snipped out such that the whole
thing fits into 150 characters. This only effects the displayed text;
the link's href isn't changed; the link remains available via the
context menu, accessible via the title attribute, and clicking it still
takes the user directly to the resource in question.

Test: inspector/console/console-trim-long-urls.html

* inspector/front-end/ResourceUtils.js:
(WebInspector.linkifyURLAsNode):
    Trim the middle of the URL to bring the whole string down to  down
    to 150 characters, and set the link's title to the full URL.

LayoutTests:

* inspector/console/console-trim-long-urls-expected.txt: Added.
* inspector/console/console-trim-long-urls.html: Added.
* inspector/styles/inject-stylesheet-expected.txt:
* platform/chromium/inspector/styles/inject-stylesheet-expected.txt:
    Updating test expectations.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/console/console-trim-long-urls-expected.txt [new file with mode: 0644]
LayoutTests/inspector/console/console-trim-long-urls.html [new file with mode: 0644]
LayoutTests/inspector/styles/inject-stylesheet-expected.txt
LayoutTests/platform/chromium/inspector/styles/inject-stylesheet-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/ResourceUtils.js