Changeset 142871 in webkit


Ignore:
Timestamp:
Feb 14, 2013 5:01:50 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[Web Inspector] Fix initiator name issue in reload scenario for Network Panel.
https://bugs.webkit.org/show_bug.cgi?id=108746.

Patch by Pan Deng <pan.deng@intel.com> on 2013-02-14
Reviewed by Vsevolod Vlasov.

WebInspector.displayNameForURL() does not work as expected in the reload scenario,
for example, "http://www.yahoo.com/" was trimed to "/" at one time, but at another,
the full host name will be displayed.
This fix return host + "/" in the issue scenario, and keep with get displayName() in ParsedURL.

No new tests.

  • inspector/front-end/ParsedURL.js:

(WebInspector.ParsedURL.prototype.get displayName): append "/" in the display host scenario.

  • inspector/front-end/ResourceUtils.js:

(WebInspector.displayNameForURL): add host in the head if url trimed as a "/".

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r142870 r142871  
     12013-02-14  Pan Deng  <pan.deng@intel.com>
     2
     3        [Web Inspector] Fix initiator name issue in reload scenario for Network Panel.
     4        https://bugs.webkit.org/show_bug.cgi?id=108746.
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        WebInspector.displayNameForURL() does not work as expected in the reload scenario,
     9        for example, "http://www.yahoo.com/" was trimed to "/" at one time, but at another,
     10        the full host name will be displayed.
     11        This fix return host + "/" in the issue scenario, and keep with get displayName() in ParsedURL.
     12
     13        No new tests.
     14
     15        * inspector/front-end/ParsedURL.js:
     16        (WebInspector.ParsedURL.prototype.get displayName): append "/" in the display host scenario.
     17        * inspector/front-end/ResourceUtils.js:
     18        (WebInspector.displayNameForURL): add host in the head if url trimed as a "/".
     19
    1202013-02-14  Alexei Filippov  <alph@chromium.org>
    221
  • trunk/Source/WebCore/inspector/front-end/ParsedURL.js

    r140965 r142871  
    153153
    154154        this._displayName = this.lastPathComponent;
    155         if (!this._displayName)
    156             this._displayName = this.host;
     155        if (!this._displayName && this.host)
     156            this._displayName = this.host + "/";
    157157        if (!this._displayName && this.url)
    158158            this._displayName = this.url.trimURL(WebInspector.inspectedPageDomain ? WebInspector.inspectedPageDomain : "");
  • trunk/Source/WebCore/inspector/front-end/ResourceUtils.js

    r142145 r142871  
    7676    }
    7777
    78     return parsedURL ? url.trimURL(parsedURL.host) : url;
     78    if (!parsedURL)
     79        return url;
     80
     81    var displayName = url.trimURL(parsedURL.host);
     82    return displayName === "/" ? parsedURL.host + "/" : displayName;
    7983}
    8084
Note: See TracChangeset for help on using the changeset viewer.