Web Inspector: Fixed colorpicker editing and scrolling.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Feb 2013 15:25:00 +0000 (15:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Feb 2013 15:25:00 +0000 (15:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=109434.

Patch by Vladislav Kaznacheev <kaznacheev@chromium.org> on 2013-02-13
Reviewed by Alexander Pavlov.

The color picker scrolling logic relied on the fixed DOM structure which changed with the introduction of
SidebarPaneStack (https://bugs.webkit.org/show_bug.cgi?id=108183).
Added a special CSS class to mark the scroll target.

No new tests.

* inspector/front-end/SplitView.js:
(WebInspector.SplitView):
* inspector/front-end/StylesSidebarPane.js:
(WebInspector.StylePropertyTreeElement.prototype.updateTitle.):
* inspector/front-end/TabbedPane.js:
(WebInspector.TabbedPane):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142745 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/SplitView.js
Source/WebCore/inspector/front-end/StylesSidebarPane.js
Source/WebCore/inspector/front-end/TabbedPane.js

index 79d4aa9b82e73a713863efc4767e11353fc3fa64..24822dfb18ccb1e314e66d4f3c9afeb80f6a1d9b 100644 (file)
@@ -1,3 +1,23 @@
+2013-02-13  Vladislav Kaznacheev  <kaznacheev@chromium.org>
+
+        Web Inspector: Fixed colorpicker editing and scrolling.
+        https://bugs.webkit.org/show_bug.cgi?id=109434.
+
+        Reviewed by Alexander Pavlov.
+
+        The color picker scrolling logic relied on the fixed DOM structure which changed with the introduction of
+        SidebarPaneStack (https://bugs.webkit.org/show_bug.cgi?id=108183).
+        Added a special CSS class to mark the scroll target.
+
+        No new tests.
+
+        * inspector/front-end/SplitView.js:
+        (WebInspector.SplitView):
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylePropertyTreeElement.prototype.updateTitle.):
+        * inspector/front-end/TabbedPane.js:
+        (WebInspector.TabbedPane):
 2013-02-13  Andrey Lushnikov  <lushnikov@chromium.org>
 
         Web Inspector: fix js compilation warnings in TextPrompt
index e7c2ffcb46347b6a9239c9abeb83be0471492d1f..36625cd9f30a93dc43496c9f6e1e03f4176e825e 100644 (file)
@@ -42,11 +42,8 @@ WebInspector.SplitView = function(isVertical, sidebarSizeSettingName, defaultSid
 
     this.element.className = "split-view";
 
-    this._firstElement = this.element.createChild("div", "split-view-contents");
-    this._firstElement.addStyleClass("split-view-contents-first");
-
-    this._secondElement = this.element.createChild("div", "split-view-contents");
-    this._secondElement.addStyleClass("split-view-contents-second");
+    this._firstElement = this.element.createChild("div", "split-view-contents scroll-target split-view-contents-first");
+    this._secondElement = this.element.createChild("div", "split-view-contents scroll-target split-view-contents-second");
 
     this._resizerElement = this.element.createChild("div", "split-view-resizer");
     this.installResizer(this._resizerElement);
index ce9026d99e579ea195c99f69a229705cc5845b53..d54102db4e50be24be66ef3c2e0b08eb7cb1ce64 100644 (file)
@@ -1771,7 +1771,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
                 colorSwatch.setColorString(text);
                 colorSwatch.element.addEventListener("click", swatchClick, false);
 
-                var scrollerElement = hasSpectrum ? self._parentPane._computedStylePane.element.parentElement : null;
+                var scrollerElement;
 
                 function spectrumChanged(e)
                 {
@@ -1785,7 +1785,8 @@ WebInspector.StylePropertyTreeElement.prototype = {
 
                 function spectrumHidden(event)
                 {
-                    scrollerElement.removeEventListener("scroll", repositionSpectrum, false);
+                    if (scrollerElement)
+                        scrollerElement.removeEventListener("scroll", repositionSpectrum, false);
                     var commitEdit = event.data;
                     var propertyText = !commitEdit && self.originalPropertyText ? self.originalPropertyText : (nameElement.textContent + ": " + valueElement.textContent);
                     self.applyStyleText(propertyText, true, true, false);
@@ -1817,7 +1818,11 @@ WebInspector.StylePropertyTreeElement.prototype = {
                             spectrum.addEventListener(WebInspector.Spectrum.Events.ColorChanged, spectrumChanged);
                             spectrumHelper.addEventListener(WebInspector.SpectrumPopupHelper.Events.Hidden, spectrumHidden);
 
-                            scrollerElement.addEventListener("scroll", repositionSpectrum, false);
+                            scrollerElement = colorSwatch.element.enclosingNodeOrSelfWithClass("scroll-target");
+                            if (scrollerElement)
+                                scrollerElement.addEventListener("scroll", repositionSpectrum, false);
+                            else
+                                console.error("Unable to handle color picker scrolling");
                         }
                     }
                     e.consume(true);
index a8c50ab93547254a34a7a01c3dc206e48fb16dae..e17d702afd149884da673320ba795802ba6d0caf 100644 (file)
@@ -40,7 +40,7 @@ WebInspector.TabbedPane = function()
     this._headerElement = this.element.createChild("div", "tabbed-pane-header");
     this._headerContentsElement = this._headerElement.createChild("div", "tabbed-pane-header-contents");
     this._tabsElement = this._headerContentsElement.createChild("div", "tabbed-pane-header-tabs");
-    this._contentElement = this.element.createChild("div", "tabbed-pane-content");
+    this._contentElement = this.element.createChild("div", "tabbed-pane-content scroll-target");
     this._tabs = [];
     this._tabsHistory = [];
     this._tabsById = {};