Title: [193089] branches/safari-601-branch/Source/WebInspectorUI

Diff

Modified: branches/safari-601-branch/Source/WebInspectorUI/ChangeLog (193088 => 193089)


--- branches/safari-601-branch/Source/WebInspectorUI/ChangeLog	2015-12-03 18:45:29 UTC (rev 193088)
+++ branches/safari-601-branch/Source/WebInspectorUI/ChangeLog	2015-12-03 18:45:36 UTC (rev 193089)
@@ -1,5 +1,35 @@
 2015-12-02  Timothy Hatcher  <[email protected]>
 
+        Merge r188343. rdar://problem/23221163
+
+    2015-08-12  Joseph Pecoraro  <[email protected]>
+
+            Web Inspector: DOM Node should have context menu to scroll it into view on the inspected page
+            https://bugs.webkit.org/show_bug.cgi?id=147913
+
+            Reviewed by Timothy Hatcher.
+
+            * Localizations/en.lproj/localizedStrings.js:
+            * UserInterface/Views/DOMTreeElement.js:
+            (WebInspector.DOMTreeElement.prototype._updateChildren.set continue):
+            (WebInspector.DOMTreeElement.prototype._populateNodeContextMenu):
+            Add a context menu item to scroll into view for element nodes.
+
+            (WebInspector.DOMTreeElement.prototype._scrollIntoView.resolvedNode.scrollIntoView):
+            (WebInspector.DOMTreeElement.prototype._scrollIntoView.resolvedNode):
+            (WebInspector.DOMTreeElement.prototype._scrollIntoView):
+            Call scrollIntoViewIfNeeded on the real Node.
+
+            * UserInterface/Views/DOMTreeOutline.js:
+            (WebInspector.DOMTreeOutline.prototype.populateContextMenu):
+            Remove unused parameter.
+
+            * UserInterface/Views/ObjectTreeBaseTreeElement.js:
+            (WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
+            Add context menu for Nodes in ObjectTrees.
+
+2015-12-02  Timothy Hatcher  <[email protected]>
+
         Merge r188336. rdar://problem/23221163
 
     2015-08-12  Dan Bernstein  <[email protected]>

Modified: branches/safari-601-branch/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (193088 => 193089)


--- branches/safari-601-branch/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2015-12-03 18:45:29 UTC (rev 193088)
+++ branches/safari-601-branch/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2015-12-03 18:45:36 UTC (rev 193089)
@@ -439,6 +439,7 @@
 localizedStrings["Script"] = "Script";
 localizedStrings["Script Evaluated"] = "Script Evaluated";
 localizedStrings["Scripts"] = "Scripts";
+localizedStrings["Scroll Into View"] = "Scroll Into View";
 localizedStrings["Search"] = "Search";
 localizedStrings["Search Resource Content"] = "Search Resource Content";
 localizedStrings["Secure"] = "Secure";

Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js (193088 => 193089)


--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js	2015-12-03 18:45:29 UTC (rev 193088)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js	2015-12-03 18:45:36 UTC (rev 193089)
@@ -668,6 +668,10 @@
         contextMenu.appendItem(WebInspector.UIString("Copy as HTML"), this._copyHTML.bind(this));
         if (this.editable)
             contextMenu.appendItem(WebInspector.UIString("Delete Node"), this.remove.bind(this));
+
+        var node = this.representedObject;
+        if (node.nodeType() === Node.ELEMENT_NODE)
+            contextMenu.appendItem(WebInspector.UIString("Scroll Into View"), this._scrollIntoView.bind(this));
     }
 
     _startEditing()
@@ -1356,6 +1360,26 @@
         this.representedObject.removeNode(removeNodeCallback);
     }
 
+    _scrollIntoView()
+    {
+        function resolvedNode(object)
+        {
+            if (!object)
+                return;
+
+            function scrollIntoView()
+            {
+                this.scrollIntoViewIfNeeded(true);
+            }
+
+            object.callFunction(scrollIntoView, undefined, false, function() {});
+            object.release();
+        }
+
+        var node = this.representedObject;
+        WebInspector.RemoteObject.resolveNode(node, "", resolvedNode);
+    }
+
     _editAsHTML()
     {
         var treeOutline = this.treeOutline;

Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js (193088 => 193089)


--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js	2015-12-03 18:45:29 UTC (rev 193088)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js	2015-12-03 18:45:36 UTC (rev 193089)
@@ -266,7 +266,7 @@
         } else if (commentNode && treeElement._populateNodeContextMenu) {
             if (populated)
                 contextMenu.appendSeparator();
-            treeElement._populateNodeContextMenu(contextMenu, textNode);
+            treeElement._populateNodeContextMenu(contextMenu);
             populated = true;
         }
 

Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js (193088 => 193089)


--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js	2015-12-03 18:45:29 UTC (rev 193088)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js	2015-12-03 18:45:36 UTC (rev 193089)
@@ -237,6 +237,11 @@
                 });
             });
 
+            contextMenu.appendItem(WebInspector.UIString("Scroll Into View"), function() {
+                function scrollIntoView() { this.scrollIntoViewIfNeeded(true); }
+                resolvedValue.callFunction(scrollIntoView, undefined, false, function() {});
+            });
+
             contextMenu.appendSeparator();
 
             contextMenu.appendItem(WebInspector.UIString("Reveal in DOM Tree"), function() {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to