Changeset 132231 in webkit


Ignore:
Timestamp:
Oct 23, 2012 9:09:41 AM (11 years ago)
Author:
mkwst@chromium.org
Message:

Source/WebCore: Web Inspector: 'data:' URLs should be properly trimmed for readability.
https://bugs.webkit.org/show_bug.cgi?id=100083

Reviewed by Pavel Feldman.

We recently landed a patch to trim the middle out of long URLs in
console messages in order to improve readability. That patch didn't
effect 'data:' URLs, as they didn't match the regex in the linkifier.
This patch ensures that 'data:' URLs are properly trimmed down to
size.

This problem came to light while resolving a different, smaller issue:
'image/jpg' wasn't whitelisted as an image MIME type. That trivial fix
is included in this patch.

Test: http/tests/inspector/network/image-as-text-loading-data-url.html

  • inspector/front-end/NetworkManager.js:

(WebInspector.NetworkManager):

Adds 'image/jpg' as a valid image type.

  • inspector/front-end/ResourceUtils.js:

(WebInspector.linkifyStringAsFragmentWithCustomLinkifier):

Supports 'data:' URLs in the linkifier's regex.

LayoutTests: Web Inspector: MIME type errors should truncate long URLs.
https://bugs.webkit.org/show_bug.cgi?id=100083

Reviewed by Pavel Feldman.

  • http/tests/inspector/network/image-as-text-loading-data-url-expected.txt: Added.
  • http/tests/inspector/network/image-as-text-loading-data-url.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r132229 r132231  
     12012-10-23  Mike West  <mkwst@chromium.org>
     2
     3        Web Inspector: MIME type errors should truncate long URLs.
     4        https://bugs.webkit.org/show_bug.cgi?id=100083
     5
     6        Reviewed by Pavel Feldman.
     7
     8        * http/tests/inspector/network/image-as-text-loading-data-url-expected.txt: Added.
     9        * http/tests/inspector/network/image-as-text-loading-data-url.html: Added.
     10
    1112012-10-23  Alexander Pavlov  <apavlov@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r132230 r132231  
     12012-10-23  Mike West  <mkwst@chromium.org>
     2
     3        Web Inspector: 'data:' URLs should be properly trimmed for readability.
     4        https://bugs.webkit.org/show_bug.cgi?id=100083
     5
     6        Reviewed by Pavel Feldman.
     7
     8        We recently landed a patch to trim the middle out of long URLs in
     9        console messages in order to improve readability. That patch didn't
     10        effect 'data:' URLs, as they didn't match the regex in the linkifier.
     11        This patch ensures that 'data:' URLs are properly trimmed down to
     12        size.
     13
     14        This problem came to light while resolving a different, smaller issue:
     15        'image/jpg' wasn't whitelisted as an image MIME type. That trivial fix
     16        is included in this patch.
     17
     18        Test: http/tests/inspector/network/image-as-text-loading-data-url.html
     19
     20        * inspector/front-end/NetworkManager.js:
     21        (WebInspector.NetworkManager):
     22            Adds 'image/jpg' as a valid image type.
     23        * inspector/front-end/ResourceUtils.js:
     24        (WebInspector.linkifyStringAsFragmentWithCustomLinkifier):
     25            Supports 'data:' URLs in the linkifier's regex.
     26
    1272012-10-23  Mike West  <mkwst@chromium.org>
    228
  • trunk/Source/WebCore/inspector/front-end/NetworkManager.js

    r132130 r132231  
    6363    "text/css":                    {"stylesheet": true},
    6464    "text/xsl":                    {"stylesheet": true},
     65    "image/jpg":                   {"image": true},
    6566    "image/jpeg":                  {"image": true},
    6667    "image/pjpeg":                 {"image": true},
  • trunk/Source/WebCore/inspector/front-end/ResourceUtils.js

    r132197 r132231  
    8686{
    8787    var container = document.createDocumentFragment();
    88     var linkStringRegEx = /(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\/\/|www\.)[\w$\-_+*'=\|\/\\(){}[\]%@&#~,:;.!?]{2,}[\w$\-_+*=\|\/\\({%@&#~]/;
     88    var linkStringRegEx = /(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\/\/|data:|www\.)[\w$\-_+*'=\|\/\\(){}[\]%@&#~,:;.!?]{2,}[\w$\-_+*=\|\/\\({%@&#~]/;
    8989    var lineColumnRegEx = /:(\d+)(:(\d+))?$/;
    9090
Note: See TracChangeset for help on using the changeset viewer.