Bug 35574 - Web Inspector: Nothing happens on navigation to resource via a link if resource tracking is disabled
Summary: Web Inspector: Nothing happens on navigation to resource via a link if resour...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexander Pavlov (apavlov)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-02 03:37 PST by Alexander Pavlov (apavlov)
Modified: 2010-03-04 04:23 PST (History)
7 users (show)

See Also:


Attachments
[PATCH] Suggested solution (6.88 KB, patch)
2010-03-02 07:01 PST, Alexander Pavlov (apavlov)
pfeldman: review-
Details | Formatted Diff | Diff
[PATCH] Comments addressed (8.66 KB, patch)
2010-03-02 10:13 PST, Alexander Pavlov (apavlov)
no flags Details | Formatted Diff | Diff
[IMAGE] (Windows) Popup shown for a link when resource tracking is off (18.03 KB, image/png)
2010-03-02 12:57 PST, Alexander Pavlov (apavlov)
no flags Details
[PATCH] Typo fixed (8.56 KB, patch)
2010-03-02 14:10 PST, Alexander Pavlov (apavlov)
pfeldman: review-
Details | Formatted Diff | Diff
[PATCH] Handle links in the entire WebInspector (8.56 KB, patch)
2010-03-03 05:02 PST, Alexander Pavlov (apavlov)
pfeldman: review-
Details | Formatted Diff | Diff
[PATCH] Handle link clicks uniformly (8.59 KB, patch)
2010-03-03 06:37 PST, Alexander Pavlov (apavlov)
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pavlov (apavlov) 2010-03-02 03:37:39 PST
Click a link to a loaded resource in the Console view with the resource tracking disabled.
Nothing happens, and the user gets no feedback about why no navigation occurs.

Upstreaming http://code.google.com/p/chromium/issues/detail?id=35757
Comment 1 Alexander Pavlov (apavlov) 2010-03-02 07:01:21 PST
Created attachment 49803 [details]
[PATCH] Suggested solution
Comment 2 Pavel Feldman 2010-03-02 07:33:42 PST
Comment on attachment 49803 [details]
[PATCH] Suggested solution

> +        var message = WebInspector.UIString(
> +            "Cannot open this link. Make sure the resource tracking is enabled in the %s panel.");
> +        var anchorIndex = message.indexOf("%s");
> +        if (anchorIndex < 0) {
> +            var leftPart = message;
> +            var rightPart = "";
>          } else {
> -            var profileString = WebInspector.ProfileType.URLRegExp.exec(anchor.href);
> -            if (profileString)
> -                WebInspector.showProfile(anchor.href, anchor.lineNumber);
> +            var leftPart = message.substring(0, anchorIndex);
> +            var panelAnchorElement = document.createElement("a");
> +            panelAnchorElement.href = "#";
> +            panelAnchorElement.hasCustomHandler = true;
> +            panelAnchorElement.textContent = WebInspector.UIString("Resources");
> +            var rightPart = message.substring(anchorIndex + 2);
>          }
> +        popupContentElement.appendChild(document.createTextNode(leftPart));
> +        if (panelAnchorElement)
> +            popupContentElement.appendChild(panelAnchorElement);
> +        popupContentElement.appendChild(document.createTextNode(rightPart));
> +        var popup = new WebInspector.Popover(popupContentElement);
> +
> +        function dismissAndShowResourcesPanel(popup)
> +        {
> +            popup.hide();
> +            WebInspector.showResourcesPanel();
> +        }
> +        panelAnchorElement.addEventListener("click", dismissAndShowResourcesPanel.bind(this, popup));
> +
> +        popup.show(anchor);
> +        popup.hideWhenClickedOutside();

Could you extract method?

> +    background-color: rgba(255, 255, 255, 0.5);

I don't like the fact that popover blurs the background and blocks user input outside the bubble. Could we make link non-clickable and show popover on hover instead? Or even better, as in Eclipse, display a little 'hint lamp' near the link. Popover would become visible when you hover over the lamp / click it.

> +    z-index: 99;
> +}
> +
>  .popover.top-left-arrow .arrow {
>      /* The default is top-left, no styles needed. */
>  }
Comment 3 Alexander Pavlov (apavlov) 2010-03-02 10:13:11 PST
Created attachment 49813 [details]
[PATCH] Comments addressed
Comment 4 Timothy Hatcher 2010-03-02 10:20:57 PST
Can you attach a screenshot?
Comment 5 Alexander Pavlov (apavlov) 2010-03-02 12:57:40 PST
Created attachment 49833 [details]
[IMAGE] (Windows) Popup shown for a link when resource tracking is off
Comment 6 Timothy Hatcher 2010-03-02 13:02:17 PST
"make sure the resource tracking" shoud be "make sure that resource tracking"
Comment 7 Alexander Pavlov (apavlov) 2010-03-02 14:10:15 PST
Created attachment 49846 [details]
[PATCH] Typo fixed
Comment 8 Pavel Feldman 2010-03-03 03:21:09 PST
Comment on attachment 49846 [details]
[PATCH] Typo fixed

> +WebInspector.consoleMouseOver = function(event)
> +{


> +
> +WebInspector.consoleMouseOut = function(event)
> +{


Why are these registered on console only? Things like profiler and timeline could also have links to resources.
Comment 9 Alexander Pavlov (apavlov) 2010-03-03 03:51:40 PST
(In reply to comment #8)
> (From update of attachment 49846 [details])
> > +WebInspector.consoleMouseOver = function(event)
> > +{
> 
> 
> > +
> > +WebInspector.consoleMouseOut = function(event)
> > +{
> 
> 
> Why are these registered on console only? Things like profiler and timeline
> could also have links to resources.

Because the bug has been reported for the console only. I will broaden the scope.
Comment 10 Alexander Pavlov (apavlov) 2010-03-03 05:02:45 PST
Created attachment 49899 [details]
[PATCH] Handle links in the entire WebInspector
Comment 11 Pavel Feldman 2010-03-03 05:47:36 PST
Comment on attachment 49899 [details]
[PATCH] Handle links in the entire WebInspector

>  
> +    if (anchor.hasCustomHandler)
> +        return;

As we discussed offline, please handle "Profile" and "Resource" panel links same way.

Also, please move isTransparentRight parameter from calculator to the Graph representation object.
Comment 12 Alexander Pavlov (apavlov) 2010-03-03 06:37:05 PST
Created attachment 49900 [details]
[PATCH] Handle link clicks uniformly
Comment 13 Alexander Pavlov (apavlov) 2010-03-03 06:37:33 PST
(In reply to comment #11)
> (From update of attachment 49899 [details])
> >  
> > +    if (anchor.hasCustomHandler)
> > +        return;
> 
> As we discussed offline, please handle "Profile" and "Resource" panel links
> same way.
Done.

> Also, please move isTransparentRight parameter from calculator to the Graph
> representation object.
Wrong bug.
Comment 14 Alexander Pavlov (apavlov) 2010-03-04 04:23:38 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ...
        M       WebCore/ChangeLog
        M       WebCore/English.lproj/localizedStrings.js
        M       WebCore/inspector/front-end/ResourcesPanel.js
        M       WebCore/inspector/front-end/inspector.js
Committed r55517