[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
apavlov at chromium.org
apavlov at chromium.org
Wed Mar 17 18:15:43 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 1a7cb1f6b55cc115eaa51200852c2dfcfe483347
Author: apavlov at chromium.org <apavlov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Mar 4 12:21:10 2010 +0000
2010-03-04 Alexander Pavlov <apavlov at chromium.org>
Reviewed by Pavel Feldman.
Web Inspector: Nothing happens on navigation to resource via a link if resource tracking is disabled
https://bugs.webkit.org/show_bug.cgi?id=35574
* English.lproj/localizedStrings.js:
* inspector/front-end/ResourcesPanel.js:
(WebInspector.ResourcesPanel.prototype.canShowSourceLine):
(WebInspector.ResourcesPanel.prototype._toggleResourceTracking):
* inspector/front-end/inspector.js:
(WebInspector.documentMouseOver):
(WebInspector.documentMouseOut):
(WebInspector.hideBadLinkPopupIfNecessary):
(WebInspector.documentClick.followLink):
(WebInspector.documentClick):
(WebInspector.showBadLinkPopup.popupOverOut):
(WebInspector.showBadLinkPopup):
(WebInspector.addMainEventListeners):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index b7485e4..66a4f94 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-03-04 Alexander Pavlov <apavlov at chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Nothing happens on navigation to resource via a link if resource tracking is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=35574
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/ResourcesPanel.js:
+ (WebInspector.ResourcesPanel.prototype.canShowSourceLine):
+ (WebInspector.ResourcesPanel.prototype._toggleResourceTracking):
+ * inspector/front-end/inspector.js:
+ (WebInspector.documentMouseOver):
+ (WebInspector.documentMouseOut):
+ (WebInspector.hideBadLinkPopupIfNecessary):
+ (WebInspector.documentClick.followLink):
+ (WebInspector.documentClick):
+ (WebInspector.showBadLinkPopup.popupOverOut):
+ (WebInspector.showBadLinkPopup):
+ (WebInspector.addMainEventListeners):
+
2010-03-04 Vangelis Kokkevis <vangelis at chromium.org>
Reviewed by Oliver Hunt.
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index 59e6627..4a37659 100644
Binary files a/WebCore/English.lproj/localizedStrings.js and b/WebCore/English.lproj/localizedStrings.js differ
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index f2d1bd3..06e307f 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -459,7 +459,7 @@ WebInspector.ResourcesPanel.prototype = {
canShowSourceLine: function(url, line)
{
- return !!WebInspector.resourceForURL(url);
+ return !!WebInspector.resourceForURL(url) && InspectorBackend.resourceTrackingEnabled();
},
showSourceLine: function(url, line)
@@ -700,6 +700,8 @@ WebInspector.ResourcesPanel.prototype = {
if (InspectorBackend.resourceTrackingEnabled()) {
this.largerResourcesButton.visible = false;
this.sortingSelectElement.visible = false;
+ WebInspector.resources = {};
+ WebInspector.resourceURLMap = {};
InspectorBackend.disableResourceTracking(true);
} else {
this.largerResourcesButton.visible = true;
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 9d0b137..6239640 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -63,6 +63,7 @@ var WebInspector = {
// 4 - ?path
// 5 - ?fragment
URLRegExp: /^(http[s]?|file):\/\/([^\/:]*)(?::([\d]+))?(?:(\/[^#]*)(?:#(.*))?)?$/i,
+ GenericURLRegExp: /^([^:]+):\/\/([^\/:]*)(?::([\d]+))?(?:(\/[^#]*)(?:#(.*))?)?$/i,
get platform()
{
@@ -610,6 +611,45 @@ WebInspector.close = function(event)
InspectorFrontendHost.closeWindow();
}
+WebInspector.documentMouseOver = function(event)
+{
+ if (event.target.tagName !== "A")
+ return;
+
+ const anchor = event.target;
+ if (!anchor.hasStyleClass("webkit-html-external-link") && !anchor.hasStyleClass("webkit-html-resource-link"))
+ return;
+
+ if (WebInspector.canShowSourceLine(anchor.href, anchor.lineNumber, anchor.preferredPanel) || WebInspector.ProfileType.URLRegExp.exec(anchor.href))
+ return;
+
+ WebInspector._showPopupTimer = setTimeout(WebInspector.showBadLinkPopup.bind(WebInspector, anchor), 250);
+}
+
+WebInspector.documentMouseOut = function(event)
+{
+ if (event.target.tagName !== "A")
+ return;
+
+ if (WebInspector._showPopupTimer) {
+ clearTimeout(WebInspector._showPopupTimer);
+ delete WebInspector._showPopupTimer;
+ } else if (WebInspector._badLinkPopup && !this._mouseOverPopup)
+ WebInspector._hidePopupTimer = setTimeout(WebInspector.hideBadLinkPopupIfNecessary.bind(WebInspector), 750);
+}
+
+WebInspector.hideBadLinkPopupIfNecessary = function()
+{
+ if (!this._badLinkPopup)
+ return;
+ this._badLinkPopup.hide();
+ delete this._badLinkPopup;
+ if (this._hidePopupTimer) {
+ clearTimeout(this._hidePopupTimer);
+ delete this._hidePopupTimer;
+ }
+}
+
WebInspector.documentClick = function(event)
{
var anchor = event.target.enclosingNodeOrSelfWithNodeName("a");
@@ -629,11 +669,26 @@ WebInspector.documentClick = function(event)
}
WebInspector.showSourceLine(anchor.href, anchor.lineNumber, anchor.preferredPanel);
- } else {
- var profileString = WebInspector.ProfileType.URLRegExp.exec(anchor.href);
- if (profileString)
- WebInspector.showProfileForURL(anchor.href);
+ return;
}
+
+ const profileMatch = WebInspector.ProfileType.URLRegExp.exec(anchor.href);
+ if (profileMatch) {
+ WebInspector.showProfileForURL(anchor.href);
+ return;
+ }
+
+ const urlMatch = WebInspector.GenericURLRegExp.exec(anchor.href);
+ if (urlMatch && urlMatch[1] === "webkit-link-action") {
+ if (urlMatch[2] === "show-panel") {
+ const panel = urlMatch[4].substring(1);
+ if (WebInspector.panels[panel])
+ WebInspector.currentPanel = WebInspector.panels[panel];
+ }
+ return;
+ }
+
+ WebInspector.showBadLinkPopup(anchor);
}
if (WebInspector.followLinkTimeout)
@@ -650,6 +705,61 @@ WebInspector.documentClick = function(event)
followLink();
}
+WebInspector.showBadLinkPopup = function(anchor)
+{
+ this.hideBadLinkPopupIfNecessary();
+
+ // Show an info popup for a link that cannot be opened right away.
+ var popupContentElement = document.createElement("span");
+ popupContentElement.className = "monospace";
+
+ var message = WebInspector.UIString(
+ "Cannot open this link. Make sure that resource tracking is enabled in the %s panel.");
+ var anchorIndex = message.indexOf("%s");
+ if (anchorIndex < 0) {
+ var leftPart = message;
+ var rightPart = "";
+ } else {
+ var leftPart = message.substring(0, anchorIndex);
+ var panelAnchorElement = document.createElement("a");
+ panelAnchorElement.href = "webkit-link-action://show-panel/resources";
+ 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);
+
+ if (panelAnchorElement)
+ panelAnchorElement.addEventListener("click", this.hideBadLinkPopupIfNecessary.bind(this));
+
+ function popupOverOut(event)
+ {
+ if (event.type === "mouseover") {
+ if (this._mouseOverPopup)
+ return; // Entered from child.
+ clearTimeout(this._hidePopupTimer);
+ delete this._hidePopupTimer;
+ this._mouseOverPopup = true;
+ } else {
+ const relTarget = event.relatedTarget;
+ if (relTarget && relTarget.enclosingNodeOrSelfWithClass("popover"))
+ return; // Leaving to child.
+ delete this._mouseOverPopup;
+ this.hideBadLinkPopupIfNecessary();
+ }
+ }
+ const boundHandler = popupOverOut.bind(this);
+ popupContentElement.addEventListener("mouseover", boundHandler, true);
+ popupContentElement.addEventListener("mouseout", boundHandler, true);
+
+ popup.show(anchor);
+ this._badLinkPopup = popup;
+ delete this._showPopupTimer;
+}
+
WebInspector.documentKeyDown = function(event)
{
if (this.currentFocusElement && this.currentFocusElement.handleKeyEvent) {
@@ -1594,6 +1704,8 @@ WebInspector.addMainEventListeners = function(doc)
doc.defaultView.addEventListener("focus", this.windowFocused.bind(this), false);
doc.defaultView.addEventListener("blur", this.windowBlurred.bind(this), false);
doc.addEventListener("click", this.documentClick.bind(this), true);
+ doc.addEventListener("mouseover", this.documentMouseOver.bind(this), true);
+ doc.addEventListener("mouseout", this.documentMouseOut.bind(this), true);
}
WebInspector._searchFieldManualFocus = function(event)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list