Changeset 31024 in webkit


Ignore:
Timestamp:
Mar 12, 2008 11:13:02 PM (16 years ago)
Author:
Adam Roben
Message:

Update the styles/metrics panes and breadcrumb after editing DOM attributes

Reviewed by Tim.

  • page/inspector/DocumentPanel.js: (WebInspector.DocumentPanel.set focusedDOMNode): Moved code to update the parts of the DocumentPanel other than the DOM tree into a new function, _focusedNodeChanged. (WebInspector.DocumentPanel._focusedNodeChanged): Added. The forceUpdate parameter specifies whether the update should occur even if the focused node hasn't changed since the last update. (WebInspector.DocumentPanel.updateBreadcrumb): Added a forceUpdate parameter. If forceUpdate is true, we always rebuild the breadcrumbs. (WebInspector.DocumentPanel.updateStyles): Added a forceUpdate parameter. If forceUpdate is true, we always rebuild the styles pane. (WebInspector.DOMNodeTreeElement._attributeEditingCommitted): Added a call to DocumentPanel._focusedNodeChanged. We have to force the update because we haven't changed the focused node (the attributes of the node have changed).
  • page/inspector/StylesSidebarPane.js: (WebInspector.StylesSidebarPane.update): Added a forceUpdate parameter. If forceUpdate is true we always rebuild the styles.
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r31021 r31024  
     12008-03-12  Adam Roben  <aroben@apple.com>
     2
     3        Update the styles/metrics panes and breadcrumb after editing DOM
     4        attributes
     5
     6        Reviewed by Tim.
     7
     8        * page/inspector/DocumentPanel.js:
     9        (WebInspector.DocumentPanel.set focusedDOMNode): Moved code to update
     10        the parts of the DocumentPanel other than the DOM tree into a new
     11        function, _focusedNodeChanged.
     12        (WebInspector.DocumentPanel._focusedNodeChanged): Added. The
     13        forceUpdate parameter specifies whether the update should occur even
     14        if the focused node hasn't changed since the last update.
     15        (WebInspector.DocumentPanel.updateBreadcrumb): Added a forceUpdate
     16        parameter. If forceUpdate is true, we always rebuild the breadcrumbs.
     17        (WebInspector.DocumentPanel.updateStyles): Added a forceUpdate
     18        parameter. If forceUpdate is true, we always rebuild the styles pane.
     19        (WebInspector.DOMNodeTreeElement._attributeEditingCommitted): Added a
     20        call to DocumentPanel._focusedNodeChanged. We have to force the update
     21        because we haven't changed the focused node (the attributes of the
     22        node have changed).
     23        * page/inspector/StylesSidebarPane.js:
     24        (WebInspector.StylesSidebarPane.update): Added a forceUpdate
     25        parameter. If forceUpdate is true we always rebuild the styles.
     26
    1272008-03-12  Mark Rowe  <mrowe@apple.com>
    228
  • trunk/WebCore/page/inspector/DocumentPanel.js

    r31009 r31024  
    140140        this._focusedDOMNode = x;
    141141
    142         this.updateBreadcrumb();
    143 
    144         for (var pane in this.views.dom.sidebarPanes)
    145             this.views.dom.sidebarPanes[pane].needsUpdate = true;
    146 
    147         this.updateStyles();
    148         this.updateMetrics();
    149         this.updateProperties();
     142        this._focusedNodeChanged();
    150143
    151144        InspectorController.highlightDOMNode(x);
     
    154147        if (nodeItem)
    155148            nodeItem.select();
     149    },
     150
     151    _focusedNodeChanged: function(forceUpdate)
     152    {
     153        this.updateBreadcrumb(forceUpdate);
     154
     155        for (var pane in this.views.dom.sidebarPanes)
     156            this.views.dom.sidebarPanes[pane].needsUpdate = true;
     157
     158        this.updateStyles(forceUpdate);
     159        this.updateMetrics();
     160        this.updateProperties();
    156161    },
    157162
     
    183188    },
    184189
    185     updateBreadcrumb: function()
     190    updateBreadcrumb: function(forceUpdate)
    186191    {
    187192        if (!this.visible)
     
    212217        }
    213218
    214         if (handled) {
     219        if (handled && !forceUpdate) {
    215220            // We don't need to rebuild the crumbs, but we need to adjust sizes
    216221            // to reflect the new focused or root node.
     
    631636    },
    632637
    633     updateStyles: function()
     638    updateStyles: function(forceUpdate)
    634639    {
    635640        var stylesSidebarPane = this.views.dom.sidebarPanes.styles;
     
    637642            return;
    638643
    639         stylesSidebarPane.update(this.focusedDOMNode);
     644        stylesSidebarPane.update(this.focusedDOMNode, undefined, forceUpdate);
    640645        stylesSidebarPane.needsUpdate = false;
    641646    },
     
    973978
    974979        this._updateTitle();
     980        this.treeOutline.panel._focusedNodeChanged(true);
    975981    },
    976982
  • trunk/WebCore/page/inspector/StylesSidebarPane.js

    r30931 r31024  
    3333
    3434WebInspector.StylesSidebarPane.prototype = {
    35     update: function(node, editedSection)
     35    update: function(node, editedSection, forceUpdate)
    3636    {
    3737        var refresh = false;
    3838
    39         if (!node || node === this.node)
     39        if (!forceUpdate && (!node || node === this.node))
    4040            refresh = true;
    4141
Note: See TracChangeset for help on using the changeset viewer.