Changeset 158788 in webkit


Ignore:
Timestamp:
Nov 6, 2013 2:08:46 PM (10 years ago)
Author:
Alexandru Chiculita
Message:

Web Inspector: CSS Regions: When a flow is clicked the content of flow needs to be displayed
https://bugs.webkit.org/show_bug.cgi?id=122927

Reviewed by Joseph Pecoraro.

ContentFlowTreeContentView is now used to display the content nodes of a ContentFlow. It is
very similar to the DOMTreeContentView class, but can handle multiple root nodes.

  • UserInterface/ContentFlowTreeContentView.js: Added.

(WebInspector.ContentFlowTreeContentView):
(WebInspector.ContentFlowTreeContentView.prototype.get selectionPathComponents):
(WebInspector.ContentFlowTreeContentView.prototype.updateLayout):
(WebInspector.ContentFlowTreeContentView.prototype.shown):
(WebInspector.ContentFlowTreeContentView.prototype.hidden):
(WebInspector.ContentFlowTreeContentView.prototype.closed):
(WebInspector.ContentFlowTreeContentView.prototype._selectedNodeDidChange):
(WebInspector.ContentFlowTreeContentView.prototype._pathComponentSelected):
(WebInspector.ContentFlowTreeContentView.prototype._createContentNodeTree):
(WebInspector.ContentFlowTreeContentView.prototype._createContentTrees):
(WebInspector.ContentFlowTreeContentView.prototype._contentNodeWasAdded):
(WebInspector.ContentFlowTreeContentView.prototype._contentNodeWasRemoved):

  • UserInterface/ContentView.js:

(WebInspector.ContentView):
(WebInspector.ContentView.isViewable):

  • UserInterface/DOMTreeElement.js:

(WebInspector.DOMTreeElement.prototype.ondeselect): We need to remove the selected "dom node"
so that the element is not going to stay selected after the we move to a different DOM tree.

  • UserInterface/DOMTreeOutline.js:

(WebInspector.DOMTreeOutline.prototype.selectDOMNode):

  • UserInterface/Main.html:
  • UserInterface/Main.js:

(WebInspector.sidebarPanelForRepresentedObject):

  • UserInterface/ResourceSidebarPanel.js:

(WebInspector.ResourceSidebarPanel.prototype._treeElementSelected):

Location:
trunk/Source/WebInspectorUI
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r158440 r158788  
     12013-11-06  Alexandru Chiculita  <achicu@adobe.com>
     2
     3        Web Inspector: CSS Regions: When a flow is clicked the content of flow needs to be displayed
     4        https://bugs.webkit.org/show_bug.cgi?id=122927
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        ContentFlowTreeContentView is now used to display the content nodes of a ContentFlow. It is
     9        very similar to the DOMTreeContentView class, but can handle multiple root nodes.
     10
     11        * UserInterface/ContentFlowTreeContentView.js: Added.
     12        (WebInspector.ContentFlowTreeContentView):
     13        (WebInspector.ContentFlowTreeContentView.prototype.get selectionPathComponents):
     14        (WebInspector.ContentFlowTreeContentView.prototype.updateLayout):
     15        (WebInspector.ContentFlowTreeContentView.prototype.shown):
     16        (WebInspector.ContentFlowTreeContentView.prototype.hidden):
     17        (WebInspector.ContentFlowTreeContentView.prototype.closed):
     18        (WebInspector.ContentFlowTreeContentView.prototype._selectedNodeDidChange):
     19        (WebInspector.ContentFlowTreeContentView.prototype._pathComponentSelected):
     20        (WebInspector.ContentFlowTreeContentView.prototype._createContentNodeTree):
     21        (WebInspector.ContentFlowTreeContentView.prototype._createContentTrees):
     22        (WebInspector.ContentFlowTreeContentView.prototype._contentNodeWasAdded):
     23        (WebInspector.ContentFlowTreeContentView.prototype._contentNodeWasRemoved):
     24        * UserInterface/ContentView.js:
     25        (WebInspector.ContentView):
     26        (WebInspector.ContentView.isViewable):
     27        * UserInterface/DOMTreeElement.js:
     28        (WebInspector.DOMTreeElement.prototype.ondeselect): We need to remove the selected "dom node"
     29        so that the element is not going to stay selected after the we move to a different DOM tree.
     30        * UserInterface/DOMTreeOutline.js:
     31        (WebInspector.DOMTreeOutline.prototype.selectDOMNode):
     32        * UserInterface/Main.html:
     33        * UserInterface/Main.js:
     34        (WebInspector.sidebarPanelForRepresentedObject):
     35        * UserInterface/ResourceSidebarPanel.js:
     36        (WebInspector.ResourceSidebarPanel.prototype._treeElementSelected):
     37
    1382013-11-01  Antoine Quint  <graouts@apple.com>
    239
  • trunk/Source/WebInspectorUI/UserInterface/ContentFlow.js

    r158159 r158788  
    1313 *    disclaimer in the documentation and/or other materials
    1414 *    provided with the distribution.
    15  * 
     15 *
    1616 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY
    1717 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     
    4747
    4848    constructor: WebInspector.ContentFlow,
     49    __proto__: WebInspector.Object.prototype,
    4950
    5051    // Public
     
    106107    }
    107108};
    108 
    109 
    110 WebInspector.ContentFlow.prototype.__proto__ = WebInspector.Object.prototype;
  • trunk/Source/WebInspectorUI/UserInterface/ContentView.js

    r157269 r158788  
    7373            return new WebInspector.CanvasProfileView(representedObject);
    7474
     75        if (representedObject instanceof WebInspector.ContentFlow)
     76            return new WebInspector.ContentFlowTreeContentView(representedObject);
     77
    7578        if (typeof representedObject === "string" || representedObject instanceof String)
    7679            return new WebInspector.TextContentView(representedObject);
     
    126129        return true;
    127130    if (representedObject instanceof WebInspector.CanvasProfileObject)
     131        return true;
     132    if (representedObject instanceof WebInspector.ContentFlow)
    128133        return true;
    129134    if (typeof representedObject === "string" || representedObject instanceof String)
  • trunk/Source/WebInspectorUI/UserInterface/DOMTreeElement.js

    r157459 r158788  
    482482    },
    483483
     484    ondeselect: function(treeElement)
     485    {
     486        this.treeOutline.selectDOMNode(null);
     487    },
     488
    484489    ondelete: function()
    485490    {
  • trunk/Source/WebInspectorUI/UserInterface/DOMTreeOutline.js

    r156672 r158788  
    156156        // avoid calling _selectedNodeChanged() twice, first check if _selectedDOMNode is the same
    157157        // node as the one passed in.
    158         if (this._selectedDOMNode === node)
     158        // Note that _revealAndSelectNode will not do anything for a null node.
     159        if (!node || this._selectedDOMNode === node)
    159160            this._selectedNodeChanged();
    160161    },
  • trunk/Source/WebInspectorUI/UserInterface/Main.html

    r157938 r158788  
    401401    <script src="LoadLocalizedStrings.js"></script>
    402402    <script src="GoToLineDialog.js"></script>
     403    <script src="ContentFlowTreeContentView.js"></script>
    403404    <script src="Main.js"></script>
    404405
  • trunk/Source/WebInspectorUI/UserInterface/Main.js

    r157938 r158788  
    323323{
    324324    if (representedObject instanceof WebInspector.Frame || representedObject instanceof WebInspector.Resource ||
    325         representedObject instanceof WebInspector.Script)
     325        representedObject instanceof WebInspector.Script || representedObject instanceof WebInspector.ContentFlow)
    326326        return this.resourceSidebarPanel;
    327327
  • trunk/Source/WebInspectorUI/UserInterface/ResourceSidebarPanel.js

    r157649 r158788  
    611611    _treeElementSelected: function(treeElement, selectedByUser)
    612612    {
    613         if (treeElement instanceof WebInspector.ContentFlowTreeElement) {
    614             // FIXME: Implement DOM tree inspector for content flow tree elements.
    615             // https://bugs.webkit.org/show_bug.cgi?id=122927
    616             console.log("Content Flow view not implemented");
    617             return;
    618         }
    619 
    620613        if (treeElement instanceof WebInspector.FolderTreeElement)
    621614            return;
     
    623616        if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement ||
    624617            treeElement instanceof WebInspector.StorageTreeElement || treeElement instanceof WebInspector.DatabaseTableTreeElement ||
    625             treeElement instanceof WebInspector.DatabaseTreeElement || treeElement instanceof WebInspector.ApplicationCacheFrameTreeElement) {
     618            treeElement instanceof WebInspector.DatabaseTreeElement || treeElement instanceof WebInspector.ApplicationCacheFrameTreeElement ||
     619            treeElement instanceof WebInspector.ContentFlowTreeElement) {
    626620            WebInspector.contentBrowser.showContentViewForRepresentedObject(treeElement.representedObject);
    627621            return;
Note: See TracChangeset for help on using the changeset viewer.