[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
pfeldman at chromium.org
pfeldman at chromium.org
Wed Dec 22 15:44:08 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 2acfd0cb514cb04189504115be3a2f773868728e
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Nov 11 13:46:46 2010 +0000
2010-11-09 Pavel Feldman <pfeldman at chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: Provide context menu item 'Reveal in Elements Panel'
on elements in inspector UI.
https://bugs.webkit.org/show_bug.cgi?id=49161
* English.lproj/localizedStrings.js:
* inspector/front-end/ElementsTreeOutline.js:
(WebInspector.ElementsTreeOutline.prototype._contextMenuEventFired.focusElement):
(WebInspector.ElementsTreeOutline.prototype._contextMenuEventFired):
* inspector/front-end/ObjectPropertiesSection.js:
(WebInspector.ObjectPropertyTreeElement.prototype.update):
(WebInspector.ObjectPropertyTreeElement.prototype._contextMenuEventFired):
(WebInspector.ObjectPropertyTreeElement.prototype._contextMenuEventFired.revealElement):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71812 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 372cb43..f020e72 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-11-09 Pavel Feldman <pfeldman at chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Provide context menu item 'Reveal in Elements Panel'
+ on elements in inspector UI.
+ https://bugs.webkit.org/show_bug.cgi?id=49161
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeOutline.prototype._contextMenuEventFired.focusElement):
+ (WebInspector.ElementsTreeOutline.prototype._contextMenuEventFired):
+ * inspector/front-end/ObjectPropertiesSection.js:
+ (WebInspector.ObjectPropertyTreeElement.prototype.update):
+ (WebInspector.ObjectPropertyTreeElement.prototype._contextMenuEventFired):
+ (WebInspector.ObjectPropertyTreeElement.prototype._contextMenuEventFired.revealElement):
+
2010-11-11 Pavel Feldman <pfeldman at chromium.org>
Reviewed by Yury Semikhatsky.
diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js
index 4404051..a9d86e6 100644
--- a/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -265,21 +265,28 @@ WebInspector.ElementsTreeOutline.prototype = {
return;
var contextMenu = new WebInspector.ContextMenu();
-
- var href = event.target.enclosingNodeOrSelfWithClass("webkit-html-resource-link") || event.target.enclosingNodeOrSelfWithClass("webkit-html-external-link");
- var tag = event.target.enclosingNodeOrSelfWithClass("webkit-html-tag");
- var textNode = event.target.enclosingNodeOrSelfWithClass("webkit-html-text-node");
- var needSeparator;
- if (href)
- needSeparator = WebInspector.panels.elements.populateHrefContextMenu(contextMenu, event, href);
- if (tag && listItem.treeElement._populateTagContextMenu) {
- if (needSeparator)
- contextMenu.appendSeparator();
- listItem.treeElement._populateTagContextMenu(contextMenu, event);
- } else if (textNode && listItem.treeElement._populateTextContextMenu) {
- if (needSeparator)
- contextMenu.appendSeparator();
- listItem.treeElement._populateTextContextMenu(contextMenu, textNode);
+ if (this.showInElementsPanelEnabled) {
+ function focusElement()
+ {
+ WebInspector.panels.elements.focusedDOMNode = listItem.treeElement.representedObject;
+ }
+ contextMenu.appendItem(WebInspector.UIString("Reveal in Elements Panel"), focusElement.bind(this));
+ } else {
+ var href = event.target.enclosingNodeOrSelfWithClass("webkit-html-resource-link") || event.target.enclosingNodeOrSelfWithClass("webkit-html-external-link");
+ var tag = event.target.enclosingNodeOrSelfWithClass("webkit-html-tag");
+ var textNode = event.target.enclosingNodeOrSelfWithClass("webkit-html-text-node");
+ var needSeparator;
+ if (href)
+ needSeparator = WebInspector.panels.elements.populateHrefContextMenu(contextMenu, event, href);
+ if (tag && listItem.treeElement._populateTagContextMenu) {
+ if (needSeparator)
+ contextMenu.appendSeparator();
+ listItem.treeElement._populateTagContextMenu(contextMenu, event);
+ } else if (textNode && listItem.treeElement._populateTextContextMenu) {
+ if (needSeparator)
+ contextMenu.appendSeparator();
+ listItem.treeElement._populateTextContextMenu(contextMenu, textNode);
+ }
}
contextMenu.show(event);
}
diff --git a/WebCore/inspector/front-end/ObjectPropertiesSection.js b/WebCore/inspector/front-end/ObjectPropertiesSection.js
index 015039c..610dc41 100644
--- a/WebCore/inspector/front-end/ObjectPropertiesSection.js
+++ b/WebCore/inspector/front-end/ObjectPropertiesSection.js
@@ -186,6 +186,8 @@ WebInspector.ObjectPropertyTreeElement.prototype = {
this.valueElement.addStyleClass("error");
if (this.property.value.type)
this.valueElement.addStyleClass("console-formatted-" + this.property.value.type);
+ if (this.property.value.type === "node")
+ this.valueElement.addEventListener("contextmenu", this._contextMenuEventFired.bind(this), true);
this.listItemElement.removeChildren();
@@ -195,6 +197,24 @@ WebInspector.ObjectPropertyTreeElement.prototype = {
this.hasChildren = this.property.value.hasChildren;
},
+ _contextMenuEventFired: function()
+ {
+ function selectNode(nodeId)
+ {
+ if (nodeId)
+ WebInspector.panels.elements.focusedDOMNode = WebInspector.domAgent.nodeForId(nodeId);
+ }
+
+ function revealElement()
+ {
+ this.property.value.pushNodeToFrontend(selectNode);
+ }
+
+ var contextMenu = new WebInspector.ContextMenu();
+ contextMenu.appendItem(WebInspector.UIString("Reveal in Elements Panel"), revealElement.bind(this));
+ contextMenu.show(event);
+ },
+
updateSiblings: function()
{
if (this.parent.root)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list