Web Inspector: Console message's anchor element should be trimmed for readability.
authormkwst@chromium.org <mkwst@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2012 07:28:02 +0000 (07:28 +0000)
committermkwst@chromium.org <mkwst@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2012 07:28:02 +0000 (07:28 +0000)
commitb9b3c53452bdd8012df1821920a4255d6a2a8847
tree1fa623270c0556286d5c271faa25a83d5009af24
parente179ca18e78236becf615e0870d79f07342e8964
Web Inspector: Console message's anchor element should be trimmed for readability.
https://bugs.webkit.org/show_bug.cgi?id=100095

Reviewed by Pavel Feldman.

Source/WebCore:

We're currently trimming URLs that go through
'WebInspector.linkifyURLAsNode' down to 150 characters total. Not all
URLs go that path, however. We were missing a few cases that dropped
back to the default Linkifier (which especially showed up for "Live"
anchor elements).

This patch ensures that anything using WebInspector.Linkifier is also
trimmed by default. It adds a new constant to do so in order to avoid
magic numbers in the code.

Test: http/tests/inspector/network/script-as-text-loading-long-url.html

* inspector/front-end/Linkifier.js:
(WebInspector.Linkifier):
    Pass the max length into the default formatter that's created and
    stored when creating a 'WebInspector.Linkifier' object.
* inspector/front-end/ResourceUtils.js:
(WebInspector.linkifyURLAsNode):
    Use the new maxlength constant rather than hard-coding 150.

LayoutTests:

* http/tests/inspector/network/resources/script-as-text-with-a-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-url.php: Added.
* http/tests/inspector/network/script-as-text-loading-long-url-expected.txt: Added.
* http/tests/inspector/network/script-as-text-loading-long-url.html: Added.
* platform/chromium/http/tests/inspector/network/script-as-text-loading-long-url-expected.txt: Added.
    JSC vs V8.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/network/resources/script-as-text-with-a-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-very-long-url.php [new file with mode: 0644]
LayoutTests/http/tests/inspector/network/script-as-text-loading-long-url-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/inspector/network/script-as-text-loading-long-url.html [new file with mode: 0644]
LayoutTests/platform/chromium/http/tests/inspector/network/script-as-text-loading-long-url-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/Linkifier.js
Source/WebCore/inspector/front-end/ResourceUtils.js
Source/WebCore/inspector/front-end/inspector.css