[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

eric at webkit.org eric at webkit.org
Thu Feb 4 21:21:40 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 6903222d827678411685845591aae657b9eb821c
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 20 13:58:22 2010 +0000

    2010-01-20  Alexander Pavlov  <apavlov at chromium.org>
    
            Reviewed by Timothy Hatcher.
    
            Optimize resize event handling for hidden views
            https://bugs.webkit.org/show_bug.cgi?id=33803
    
            * inspector/front-end/AbstractTimelinePanel.js:
            (WebInspector.AbstractTimelinePanel.prototype.resize):
            (WebInspector.AbstractTimelinePanel.prototype.updateMainViewWidth):
            * inspector/front-end/AuditsPanel.js:
            * inspector/front-end/Panel.js:
            (WebInspector.Panel.prototype.updateSidebarWidth):
            (WebInspector.Panel.prototype.resize):
            * inspector/front-end/PanelEnablerView.js:
            (WebInspector.PanelEnablerView):
            (WebInspector.PanelEnablerView.prototype.show):
            (WebInspector.PanelEnablerView.prototype.resize):
            * inspector/front-end/ProfilesPanel.js:
            (WebInspector.ProfilesPanel.prototype.show):
            (WebInspector.ProfilesPanel.prototype.addProfileHeader):
            (WebInspector.ProfilesPanel.prototype.showProfile):
            (WebInspector.ProfilesPanel.prototype.showView):
            (WebInspector.ProfilesPanel.prototype.closeVisibleView):
            (WebInspector.ProfilesPanel.prototype._updateInterface):
            (WebInspector.ProfilesPanel.prototype.updateMainViewWidth):
            * inspector/front-end/ResourcesPanel.js:
            (WebInspector.ResourcesPanel.prototype.show):
            (WebInspector.ResourcesPanel.prototype.get visibleView):
            (WebInspector.ResourcesPanel.prototype.updateMainViewWidth):
            * inspector/front-end/Settings.js:
            * inspector/front-end/StoragePanel.js:
            (WebInspector.StoragePanel.prototype.updateMainViewWidth):
            * inspector/front-end/WelcomeView.js:
            (WebInspector.WelcomeView):
            (WebInspector.WelcomeView.prototype.show):
            (WebInspector.WelcomeView.prototype.resize):
            * inspector/front-end/inspector.css:
            * inspector/front-end/inspector.js:
            (WebInspector.windowResize):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53545 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 42ab404..f6696a7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,44 @@
+2010-01-20  Alexander Pavlov  <apavlov at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Optimize resize event handling for hidden views
+        https://bugs.webkit.org/show_bug.cgi?id=33803
+
+        * inspector/front-end/AbstractTimelinePanel.js:
+        (WebInspector.AbstractTimelinePanel.prototype.resize):
+        (WebInspector.AbstractTimelinePanel.prototype.updateMainViewWidth):
+        * inspector/front-end/AuditsPanel.js:
+        * inspector/front-end/Panel.js:
+        (WebInspector.Panel.prototype.updateSidebarWidth):
+        (WebInspector.Panel.prototype.resize):
+        * inspector/front-end/PanelEnablerView.js:
+        (WebInspector.PanelEnablerView):
+        (WebInspector.PanelEnablerView.prototype.show):
+        (WebInspector.PanelEnablerView.prototype.resize):
+        * inspector/front-end/ProfilesPanel.js:
+        (WebInspector.ProfilesPanel.prototype.show):
+        (WebInspector.ProfilesPanel.prototype.addProfileHeader):
+        (WebInspector.ProfilesPanel.prototype.showProfile):
+        (WebInspector.ProfilesPanel.prototype.showView):
+        (WebInspector.ProfilesPanel.prototype.closeVisibleView):
+        (WebInspector.ProfilesPanel.prototype._updateInterface):
+        (WebInspector.ProfilesPanel.prototype.updateMainViewWidth):
+        * inspector/front-end/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype.show):
+        (WebInspector.ResourcesPanel.prototype.get visibleView):
+        (WebInspector.ResourcesPanel.prototype.updateMainViewWidth):
+        * inspector/front-end/Settings.js:
+        * inspector/front-end/StoragePanel.js:
+        (WebInspector.StoragePanel.prototype.updateMainViewWidth):
+        * inspector/front-end/WelcomeView.js:
+        (WebInspector.WelcomeView):
+        (WebInspector.WelcomeView.prototype.show):
+        (WebInspector.WelcomeView.prototype.resize):
+        * inspector/front-end/inspector.css:
+        * inspector/front-end/inspector.js:
+        (WebInspector.windowResize):
+
 2010-01-20  Steve Block  <steveblock at google.com>
 
         Reviewed by David Levin.
diff --git a/WebCore/inspector/front-end/AbstractTimelinePanel.js b/WebCore/inspector/front-end/AbstractTimelinePanel.js
index 05af9c2..6c5d715 100644
--- a/WebCore/inspector/front-end/AbstractTimelinePanel.js
+++ b/WebCore/inspector/front-end/AbstractTimelinePanel.js
@@ -260,13 +260,15 @@ WebInspector.AbstractTimelinePanel.prototype = {
 
     resize: function()
     {
+        WebInspector.Panel.prototype.resize.call(this);
+
         this.updateGraphDividersIfNeeded();
     },
 
     updateMainViewWidth: function(width)
     {
         this._containerContentElement.style.left = width + "px";
-        this.updateGraphDividersIfNeeded();
+        this.resize();
     },
 
     invalidateAllItems: function()
diff --git a/WebCore/inspector/front-end/AuditsPanel.js b/WebCore/inspector/front-end/AuditsPanel.js
index 99784a1..c4d7aef 100644
--- a/WebCore/inspector/front-end/AuditsPanel.js
+++ b/WebCore/inspector/front-end/AuditsPanel.js
@@ -249,13 +249,6 @@ WebInspector.AuditsPanel.prototype = {
         this.auditsItemTreeElement.select();
     },
 
-    resize: function()
-    {
-        var visibleView = this.visibleView;
-        if (visibleView && "resize" in visibleView)
-            visibleView.resize();
-    },
-
     updateMainViewWidth: function(width)
     {
         this.viewsContainerElement.style.left = width + "px";
diff --git a/WebCore/inspector/front-end/Panel.js b/WebCore/inspector/front-end/Panel.js
index 51b987b..5e81e2d 100644
--- a/WebCore/inspector/front-end/Panel.js
+++ b/WebCore/inspector/front-end/Panel.js
@@ -348,10 +348,6 @@ WebInspector.Panel.prototype = {
         this.setSidebarWidth(width);
 
         this.updateMainViewWidth(width);
-
-        var visibleView = this.visibleView;
-        if (visibleView && "resize" in visibleView)
-            visibleView.resize();
     },
 
     setSidebarWidth: function(width)
@@ -365,6 +361,13 @@ WebInspector.Panel.prototype = {
         // Should be implemented by ancestors.
     },
 
+    resize: function()
+    {
+        var visibleView = this.visibleView;
+        if (visibleView && "resize" in visibleView)
+            visibleView.resize();
+    },
+
     canShowSourceLineForURL: function(url)
     {
         return false;
diff --git a/WebCore/inspector/front-end/PanelEnablerView.js b/WebCore/inspector/front-end/PanelEnablerView.js
index fab6d76..5c26604 100644
--- a/WebCore/inspector/front-end/PanelEnablerView.js
+++ b/WebCore/inspector/front-end/PanelEnablerView.js
@@ -71,8 +71,6 @@ WebInspector.PanelEnablerView = function(identifier, headingText, disclaimerText
     this.enableButton.textContent = buttonTitle;
     this.enableButton.addEventListener("click", this._enableButtonCicked.bind(this), false);
     this.choicesForm.appendChild(this.enableButton);
-
-    window.addEventListener("resize", this._windowResized.bind(this), true);
 }
 
 WebInspector.PanelEnablerView.prototype = {
@@ -81,7 +79,14 @@ WebInspector.PanelEnablerView.prototype = {
         this.dispatchEventToListeners("enable clicked");
     },
 
-    _windowResized: function()
+    show: function(parentElement)
+    {
+        WebInspector.View.prototype.show.call(this, parentElement);
+
+        setTimeout(this.resize.bind(this), 0);
+    },
+
+    resize: function()
     {
         this.imageElement.removeStyleClass("hidden");
 
diff --git a/WebCore/inspector/front-end/ProfilesPanel.js b/WebCore/inspector/front-end/ProfilesPanel.js
index 6cbee84..4950f14 100644
--- a/WebCore/inspector/front-end/ProfilesPanel.js
+++ b/WebCore/inspector/front-end/ProfilesPanel.js
@@ -157,8 +157,12 @@ WebInspector.ProfilesPanel.prototype = {
     show: function()
     {
         WebInspector.Panel.prototype.show.call(this);
-        if (!this.visibleView)
+        this._updateInterface();
+        if (!this.visibleView) {
+            this.visibleView = this.welcomeView;
             this.welcomeView.show();
+        }
+        this.visibleView.show();
         if (this._shouldPopulateProfiles)
             this._populateProfiles();
     },
@@ -303,7 +307,7 @@ WebInspector.ProfilesPanel.prototype = {
         profile._profilesTreeElement = profileTreeElement;
 
         sidebarParent.appendChild(profileTreeElement);
-        if (!this.visibleView)
+        if (!this.visibleView || this.visibleView === this.welcomeView)
             this.showProfile(profile);
     },
 
@@ -312,9 +316,7 @@ WebInspector.ProfilesPanel.prototype = {
         if (!profile)
             return;
 
-        this.welcomeView.hide();
-        if (this.visibleView)
-            this.visibleView.hide();
+        this.closeVisibleView();
 
         var view = profile.__profilesPanelProfileType.viewForProfile(profile);
 
@@ -334,7 +336,19 @@ WebInspector.ProfilesPanel.prototype = {
 
     showView: function(view)
     {
-        this.showProfile(view.profile);
+        if (this.visibleView === view) {
+            if (this.visibleView && !this.visibleView.visible)
+                view.show();
+            return;
+        }
+
+        this._previousVisibleView = this.visibleView;
+        if (view === this.welcomeView) {
+            this.closeVisibleView();
+            this.visibleView = view;
+            view.show();
+        } else
+            this.showProfile(view.profile);
     },
 
     getProfileType: function(typeId)
@@ -366,7 +380,6 @@ WebInspector.ProfilesPanel.prototype = {
         if (this.visibleView)
             this.visibleView.hide();
         delete this.visibleView;
-        this.welcomeView.show();
     },
 
     displayTitleForProfileLink: function(title, typeId)
@@ -428,13 +441,6 @@ WebInspector.ProfilesPanel.prototype = {
         }
     },
 
-    resize: function()
-    {
-        var visibleView = this.visibleView;
-        if (visibleView && "resize" in visibleView)
-            visibleView.resize();
-    },
-
     _updateInterface: function()
     {
         // FIXME: Replace ProfileType-specific button visibility changes by a single ProfileType-agnostic "combo-button" visibility change.
@@ -446,6 +452,7 @@ WebInspector.ProfilesPanel.prototype = {
             this.profileViewStatusBarItemsContainer.removeStyleClass("hidden");
             this.panelEnablerView.visible = false;
             this.welcomeView.visible = true;
+            this.visibleView = this._previousVisibleView || this.welcomeView;
         } else {
             this.enableToggleButton.title = WebInspector.UIString("Profiling disabled. Click to enable.");
             this.enableToggleButton.toggled = false;
@@ -454,6 +461,7 @@ WebInspector.ProfilesPanel.prototype = {
             this.profileViewStatusBarItemsContainer.addStyleClass("hidden");
             this.welcomeView.visible = false;
             this.panelEnablerView.visible = true;
+            this.visibleView = this.panelEnablerView;
         }
     },
 
@@ -496,8 +504,10 @@ WebInspector.ProfilesPanel.prototype = {
 
     updateMainViewWidth: function(width)
     {
+        this.welcomeView.element.style.left = width + "px";
         this.profileViews.style.left = width + "px";
         this.profileViewStatusBarItemsContainer.style.left = width + "px";
+        this.resize();
     }
 }
 
diff --git a/WebCore/inspector/front-end/ResourcesPanel.js b/WebCore/inspector/front-end/ResourcesPanel.js
index 0347294..a9b5146 100644
--- a/WebCore/inspector/front-end/ResourcesPanel.js
+++ b/WebCore/inspector/front-end/ResourcesPanel.js
@@ -192,10 +192,11 @@ WebInspector.ResourcesPanel.prototype = {
         WebInspector.AbstractTimelinePanel.prototype.show.call(this);
 
         var visibleView = this.visibleView;
-        if (visibleView) {
+        if (this.visibleResource) {
             visibleView.headersVisible = true;
             visibleView.show(this.viewsContainerElement);
-        }
+        } else if (visibleView)
+            visibleView.show();
 
         // Hide any views that are visible that are not this panel's current visible view.
         // This can happen when a ResourceView is visible in the Scripts panel then switched
@@ -210,15 +211,6 @@ WebInspector.ResourcesPanel.prototype = {
         }
     },
 
-    resize: function()
-    {
-        WebInspector.AbstractTimelinePanel.prototype.resize.call(this);
-
-        var visibleView = this.visibleView;
-        if (visibleView && "resize" in visibleView)
-            visibleView.resize();
-    },
-
     get searchableViews()
     {
         var views = [];
@@ -287,7 +279,7 @@ WebInspector.ResourcesPanel.prototype = {
     {
         if (this.visibleResource)
             return this.visibleResource._resourcesView;
-        return null;
+        return InspectorBackend.resourceTrackingEnabled() ? null : this.panelEnablerView;
     },
 
     get sortingFunction()
@@ -684,8 +676,10 @@ WebInspector.ResourcesPanel.prototype = {
 
     updateMainViewWidth: function(width)
     {
-        WebInspector.AbstractTimelinePanel.prototype.updateMainViewWidth.call(this, width);
         this.viewsContainerElement.style.left = width + "px";
+
+        WebInspector.AbstractTimelinePanel.prototype.updateMainViewWidth.call(this, width);
+        this.resize();
     },
 
     _enableResourceTracking: function()
diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js
index 6cd4497..3fdd19c 100644
--- a/WebCore/inspector/front-end/Settings.js
+++ b/WebCore/inspector/front-end/Settings.js
@@ -37,7 +37,6 @@ var Preferences = {
     minScriptsSidebarWidth: 200,
     styleRulesExpandedState: {},
     showMissingLocalizedStrings: false,
-    heapProfilerPresent: false,
     samplingCPUProfiler: false,
     showColorNicknames: true
 }
diff --git a/WebCore/inspector/front-end/StoragePanel.js b/WebCore/inspector/front-end/StoragePanel.js
index dd558df..dee4442 100644
--- a/WebCore/inspector/front-end/StoragePanel.js
+++ b/WebCore/inspector/front-end/StoragePanel.js
@@ -354,13 +354,6 @@ WebInspector.StoragePanel.prototype = {
         return dataGrid;
     },
 
-    resize: function()
-    {
-        var visibleView = this.visibleView;
-        if (visibleView && "resize" in visibleView)
-            visibleView.resize();
-    },
-
     updateDOMStorage: function(storageId)
     {
         var domStorage = this._domStorageForId(storageId);
@@ -389,6 +382,7 @@ WebInspector.StoragePanel.prototype = {
     {
         this.storageViews.style.left = width + "px";
         this.storageViewStatusBarItemsContainer.style.left = width + "px";
+        this.resize();
     }
 }
 
diff --git a/WebCore/inspector/front-end/WelcomeView.js b/WebCore/inspector/front-end/WelcomeView.js
index 1e16c4e..73e6447 100644
--- a/WebCore/inspector/front-end/WelcomeView.js
+++ b/WebCore/inspector/front-end/WelcomeView.js
@@ -52,12 +52,18 @@ WebInspector.WelcomeView = function(identifier, headingText, instructionsText)
 
     if (instructionsText)
         this.addMessage(instructionsText);
-
-    window.addEventListener("resize", this._windowResized.bind(this), true);
 }
 
 WebInspector.WelcomeView.prototype = {
-    _windowResized: function()
+
+    show: function(parentElement)
+    {
+        WebInspector.View.prototype.show.call(this, parentElement);
+
+        setTimeout(this.resize.bind(this), 0);
+    },
+
+    resize: function()
     {
         this.imageElement.removeStyleClass("hidden");
 
diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css
index 0aa79e2..fa65f88 100644
--- a/WebCore/inspector/front-end/inspector.css
+++ b/WebCore/inspector/front-end/inspector.css
@@ -2275,7 +2275,6 @@ body.inactive .data-grid th.sort-ascending, body.inactive .data-grid th.sort-des
 
 .panel-enabler-view.welcome {
     z-index: auto;
-    left: 200px;
 }
 
 .panel-enabler-view.welcome img {
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index c4f458d..5cf93b3 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -522,7 +522,7 @@ WebInspector.windowUnload = function(event)
 
 WebInspector.windowResize = function(event)
 {
-    if (this.currentPanel && this.currentPanel.resize)
+    if (this.currentPanel)
         this.currentPanel.resize();
     this.drawer.resize();
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list