Changeset 55575 in webkit
- Timestamp:
- Mar 5, 2010 2:09:11 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r55573 r55575 1 2010-03-05 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: Do not show link helper in popovers and/or for external resources. 6 7 https://bugs.webkit.org/show_bug.cgi?id=35785 8 9 * English.lproj/localizedStrings.js: 10 * inspector/front-end/ResourcesPanel.js: 11 (WebInspector.ResourcesPanel.prototype.canShowSourceLine): 12 * inspector/front-end/ScriptsPanel.js: 13 (WebInspector.ScriptsPanel.prototype._scriptOrResourceForURLAndLine): 14 * inspector/front-end/TimelinePanel.js: 15 (WebInspector.TimelinePanel.prototype.hide): 16 * inspector/front-end/inspector.js: 17 (WebInspector.documentMouseOver): 18 (WebInspector.documentClick.followLink): 19 (WebInspector.documentClick): 20 (WebInspector.addMainEventListeners): 21 1 22 2010-03-05 Fumitoshi Ukai <ukai@chromium.org> 2 23 -
trunk/WebCore/inspector/front-end/ResourcesPanel.js
r55536 r55575 468 468 canShowSourceLine: function(url, line) 469 469 { 470 return !!WebInspector.resourceForURL(url) && InspectorBackend.resourceTrackingEnabled();470 return this._resourceTrackingEnabled && !!WebInspector.resourceForURL(url); 471 471 }, 472 472 -
trunk/WebCore/inspector/front-end/ScriptsPanel.js
r55537 r55575 518 518 _scriptOrResourceForURLAndLine: function(url, line) 519 519 { 520 var scriptWithMatchingUrl = null; 520 521 for (var sourceID in this._sourceIDMap) { 521 522 var scriptOrResource = this._sourceIDMap[sourceID]; 522 523 if (scriptOrResource instanceof WebInspector.Script) { 523 var script = scriptOrResource; 524 if (script.startingLine <= line && script.startingLine + script.linesCount > line) 525 return script; 524 if (scriptOrResource.sourceURL !== url) 525 continue; 526 scriptWithMatchingUrl = scriptOrResource; 527 if (scriptWithMatchingUrl.startingLine <= line && scriptWithMatchingUrl.startingLine + scriptWithMatchingUrl.linesCount > line) 528 return scriptWithMatchingUrl; 526 529 } else { 527 530 var resource = scriptOrResource; … … 530 533 } 531 534 } 532 return null;535 return scriptWithMatchingUrl; 533 536 }, 534 537 … … 691 694 option.url = displayName; 692 695 option.startingLine = script.startingLine; 693 option.text = script.resource ? displayName : String.sprintf("%s:%d", displayName, script.startingLine);696 option.text = script.resource || script.startingLine === 1 ? displayName : String.sprintf("%s:%d", displayName, script.startingLine); 694 697 695 698 function optionCompare(a, b) -
trunk/WebCore/inspector/front-end/TimelinePanel.js
r55530 r55575 240 240 }, 241 241 242 hide: function() 243 { 244 WebInspector.Panel.prototype.hide.call(this); 245 this._closeRecordDetails(); 246 }, 247 242 248 _onScroll: function(event) 243 249 { -
trunk/WebCore/inspector/front-end/inspector.js
r55537 r55575 618 618 619 619 const anchor = event.target; 620 if (!anchor.hasStyleClass("webkit-html-external-link") && !anchor.hasStyleClass("webkit-html-resource-link")) 621 return; 622 623 if (WebInspector.canShowSourceLine(anchor.href, anchor.lineNumber, anchor.preferredPanel) || WebInspector.ProfileType.URLRegExp.exec(anchor.href)) 624 return; 625 626 WebInspector._showPopupTimer = setTimeout(WebInspector.showBadLinkPopup.bind(WebInspector, anchor), 250); 627 } 628 629 WebInspector.documentMouseOut = function(event) 630 { 631 if (event.target.tagName !== "A") 632 return; 633 634 if (WebInspector._showPopupTimer) { 635 clearTimeout(WebInspector._showPopupTimer); 636 delete WebInspector._showPopupTimer; 637 } else if (WebInspector._badLinkPopup && !this._mouseOverPopup) 638 WebInspector._hidePopupTimer = setTimeout(WebInspector.hideBadLinkPopupIfNecessary.bind(WebInspector), 750); 639 } 640 641 WebInspector.hideBadLinkPopupIfNecessary = function() 642 { 643 if (!this._badLinkPopup) 644 return; 645 this._badLinkPopup.hide(); 646 delete this._badLinkPopup; 647 if (this._hidePopupTimer) { 648 clearTimeout(this._hidePopupTimer); 649 delete this._hidePopupTimer; 650 } 620 if (!anchor.hasStyleClass("webkit-html-resource-link")) 621 return; 622 if (WebInspector.canShowSourceLine(anchor.href, anchor.lineNumber, anchor.preferredPanel) || WebInspector.ProfileType.URLRegExp.exec(anchor.href)) { 623 if (event.target.originalTitle) 624 event.target.title = event.target.originalTitle; 625 return; 626 } 627 628 if (!event.target.originalTitle) 629 event.target.originalTitle = event.target.title; 630 event.target.title = WebInspector.UIString("Cannot open this link. Make sure that resource tracking is enabled in the Resources panel."); 651 631 } 652 632 … … 688 668 return; 689 669 } 690 691 WebInspector.showBadLinkPopup(anchor);692 670 } 693 671 … … 704 682 705 683 followLink(); 706 }707 708 WebInspector.showBadLinkPopup = function(anchor)709 {710 this.hideBadLinkPopupIfNecessary();711 712 // Show an info popup for a link that cannot be opened right away.713 var popupContentElement = document.createElement("span");714 popupContentElement.className = "monospace";715 716 var message = WebInspector.UIString(717 "Cannot open this link. Make sure that resource tracking is enabled in the %s panel.");718 var anchorIndex = message.indexOf("%s");719 if (anchorIndex < 0) {720 var leftPart = message;721 var rightPart = "";722 } else {723 var leftPart = message.substring(0, anchorIndex);724 var panelAnchorElement = document.createElement("a");725 panelAnchorElement.href = "webkit-link-action://show-panel/resources";726 panelAnchorElement.textContent = WebInspector.UIString("Resources");727 var rightPart = message.substring(anchorIndex + 2);728 }729 popupContentElement.appendChild(document.createTextNode(leftPart));730 if (panelAnchorElement)731 popupContentElement.appendChild(panelAnchorElement);732 popupContentElement.appendChild(document.createTextNode(rightPart));733 var popup = new WebInspector.Popover(popupContentElement);734 735 if (panelAnchorElement)736 panelAnchorElement.addEventListener("click", this.hideBadLinkPopupIfNecessary.bind(this));737 738 function popupOverOut(event)739 {740 if (event.type === "mouseover") {741 if (this._mouseOverPopup)742 return; // Entered from child.743 clearTimeout(this._hidePopupTimer);744 delete this._hidePopupTimer;745 this._mouseOverPopup = true;746 } else {747 const relTarget = event.relatedTarget;748 if (relTarget && relTarget.enclosingNodeOrSelfWithClass("popover"))749 return; // Leaving to child.750 delete this._mouseOverPopup;751 this.hideBadLinkPopupIfNecessary();752 }753 }754 const boundHandler = popupOverOut.bind(this);755 popupContentElement.addEventListener("mouseover", boundHandler, true);756 popupContentElement.addEventListener("mouseout", boundHandler, true);757 758 popup.show(anchor);759 this._badLinkPopup = popup;760 delete this._showPopupTimer;761 684 } 762 685 … … 1722 1645 doc.addEventListener("click", this.documentClick.bind(this), true); 1723 1646 doc.addEventListener("mouseover", this.documentMouseOver.bind(this), true); 1724 doc.addEventListener("mouseout", this.documentMouseOut.bind(this), true);1725 1647 } 1726 1648 -
trunk/WebKit/chromium/ChangeLog
r55572 r55575 1 2010-03-05 Ilya Tikhonovsky <loislo@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: Do not show link helper in popovers and/or for external resources. 6 7 https://bugs.webkit.org/show_bug.cgi?id=35785 8 9 * src/js/DebuggerAgent.js: 10 (devtools.DebuggerAgent.prototype.initUI): 11 (devtools.DebuggerAgent.prototype.addScriptInfo_): 12 1 13 2010-03-04 Garret Kelly <gdk@chromium.org> 2 14 -
trunk/WebKit/chromium/src/js/DebuggerAgent.js
r55077 r55575 182 182 for (var scriptId in this.parsedScripts_) { 183 183 var script = this.parsedScripts_[scriptId]; 184 WebInspector.parsedScriptSource(scriptId, script.getUrl(), undefined /* script source */, script.getLineOffset() );184 WebInspector.parsedScriptSource(scriptId, script.getUrl(), undefined /* script source */, script.getLineOffset() + 1); 185 185 } 186 186 return; … … 927 927 if (this.scriptsPanelInitialized_) { 928 928 // Only report script as parsed after scripts panel has been shown. 929 WebInspector.parsedScriptSource(script.id, script.name, script.source, script.lineOffset );929 WebInspector.parsedScriptSource(script.id, script.name, script.source, script.lineOffset + 1); 930 930 } 931 931 };
Note: See TracChangeset
for help on using the changeset viewer.