Diff
Modified: trunk/Source/WebCore/ChangeLog (96583 => 96584)
--- trunk/Source/WebCore/ChangeLog 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/ChangeLog 2011-10-04 11:37:25 UTC (rev 96584)
@@ -1,3 +1,51 @@
+2011-10-04 Pavel Feldman <[email protected]>
+
+ Web Inspector: start adding UI components to the compilation process.
+ https://bugs.webkit.org/show_bug.cgi?id=69319
+
+ Reviewed by Yury Semikhatsky.
+
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * inspector/compile-front-end.sh:
+ * inspector/front-end/Drawer.js:
+ (WebInspector.Drawer.prototype.show.animationFinished):
+ (WebInspector.Drawer.prototype.show):
+ (WebInspector.Drawer.prototype.resize):
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.prototype.statusBarResized):
+ * inspector/front-end/EmptyView.js:
+ * inspector/front-end/Panel.js:
+ (WebInspector.Panel.prototype.set get toolbarItemLabel):
+ (WebInspector.Panel.prototype.get statusBarItems):
+ (WebInspector.Panel.prototype.updateMainViewWidth):
+ (WebInspector.Panel.prototype.statusBarResized):
+ * inspector/front-end/PropertiesSection.js:
+ * inspector/front-end/SearchController.js:
+ (WebInspector.SearchController.prototype._onKeyDown):
+ * inspector/front-end/Section.js:
+ (WebInspector.Section.prototype.set populated):
+ (WebInspector.Section.prototype.onpopulate):
+ (WebInspector.Section.prototype.expand):
+ * inspector/front-end/SidebarPane.js:
+ * inspector/front-end/Toolbar.js:
+ (WebInspector.Toolbar.createPanelToolbarItem):
+ (WebInspector.ToolbarDropdown.prototype.show):
+ * inspector/front-end/UIUtils.js: Added.
+ (WebInspector.elementDragStart):
+ (WebInspector.elementDragEnd):
+ (WebInspector.animateStyle):
+ (WebInspector.animateStyle.forceComplete):
+ (WebInspector.animateStyle.cancel):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/externs.js:
+ (WebInspector.extensionServer.notifyPanelShown):
+ (WebInspector.extensionServer.notifyPanelHidden):
+ (WebInspector.currentPanel):
+ (WebInspector.setCurrentPanel):
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspector.js:
+
2011-10-04 Kenichi Ishibashi <[email protected]>
[Chromium] Implement font shaping with font-feature-settings on Windows
Modified: trunk/Source/WebCore/WebCore.gypi (96583 => 96584)
--- trunk/Source/WebCore/WebCore.gypi 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/WebCore.gypi 2011-10-04 11:37:25 UTC (rev 96584)
@@ -6334,6 +6334,7 @@
'inspector/front-end/TopDownProfileDataGridTree.js',
'inspector/front-end/treeoutline.js',
'inspector/front-end/UISourceCode.js',
+ 'inspector/front-end/UIUtils.js',
'inspector/front-end/UserMetrics.js',
'inspector/front-end/utilities.js',
'inspector/front-end/View.js',
Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (96583 => 96584)
--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2011-10-04 11:37:25 UTC (rev 96584)
@@ -69641,6 +69641,10 @@
>
</File>
<File
+ RelativePath="..\inspector\front-end\UIUtils.js"
+ >
+ </File>
+ <File
RelativePath="..\inspector\front-end\UserMetrics.js"
>
</File>
Modified: trunk/Source/WebCore/inspector/compile-front-end.sh (96583 => 96584)
--- trunk/Source/WebCore/inspector/compile-front-end.sh 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/inspector/compile-front-end.sh 2011-10-04 11:37:25 UTC (rev 96584)
@@ -44,7 +44,7 @@
--js Source/WebCore/inspector/front-end/Object.js \
--js Source/WebCore/inspector/front-end/Settings.js \
--js Source/WebCore/inspector/front-end/UserMetrics.js \
- --module jsmodule_sdk:16:jsmodule_common,jsmodule_host \
+ --module jsmodule_sdk:16:jsmodule_common \
--js Source/WebCore/inspector/front-end/ConsoleModel.js \
--js Source/WebCore/inspector/front-end/ContentProviders.js \
--js Source/WebCore/inspector/front-end/CookieParser.js \
@@ -61,20 +61,30 @@
--js Source/WebCore/inspector/front-end/Resource.js \
--js Source/WebCore/inspector/front-end/NetworkManager.js \
--js Source/WebCore/inspector/front-end/UISourceCode.js \
- --module jsmodule_misc:16:jsmodule_sdk \
+ --module jsmodule_ui:21:jsmodule_common \
--js Source/WebCore/inspector/front-end/Checkbox.js \
--js Source/WebCore/inspector/front-end/ContextMenu.js \
- --js Source/WebCore/inspector/front-end/ConsoleMessage.js \
- --js Source/WebCore/inspector/front-end/ConsoleView.js \
+ --js Source/WebCore/inspector/front-end/Drawer.js \
+ --js Source/WebCore/inspector/front-end/EmptyView.js \
--js Source/WebCore/inspector/front-end/HelpScreen.js \
--js Source/WebCore/inspector/front-end/KeyboardShortcut.js \
- --js Source/WebCore/inspector/front-end/_javascript_ContextManager.js \
- --js Source/WebCore/inspector/front-end/View.js \
+ --js Source/WebCore/inspector/front-end/Panel.js \
--js Source/WebCore/inspector/front-end/Placard.js \
--js Source/WebCore/inspector/front-end/Popover.js \
+ --js Source/WebCore/inspector/front-end/PropertiesSection.js \
+ --js Source/WebCore/inspector/front-end/SearchController.js \
+ --js Source/WebCore/inspector/front-end/Section.js \
+ --js Source/WebCore/inspector/front-end/SidebarPane.js \
+ --js Source/WebCore/inspector/front-end/ShortcutsScreen.js \
--js Source/WebCore/inspector/front-end/SoftContextMenu.js \
- --js Source/WebCore/inspector/front-end/ShortcutsScreen.js \
--js Source/WebCore/inspector/front-end/StatusBarButton.js \
--js Source/WebCore/inspector/front-end/TabbedPane.js \
--js Source/WebCore/inspector/front-end/TextPrompt.js \
+ --js Source/WebCore/inspector/front-end/Toolbar.js \
+ --js Source/WebCore/inspector/front-end/UIUtils.js \
+ --js Source/WebCore/inspector/front-end/View.js \
+ --module jsmodule_inspector:4:jsmodule_sdk,jsmodule_ui \
+ --js Source/WebCore/inspector/front-end/ConsoleMessage.js \
+ --js Source/WebCore/inspector/front-end/ConsoleView.js \
+ --js Source/WebCore/inspector/front-end/_javascript_ContextManager.js \
--js Source/WebCore/inspector/front-end/TimelineManager.js
Modified: trunk/Source/WebCore/inspector/front-end/Drawer.js (96583 => 96584)
--- trunk/Source/WebCore/inspector/front-end/Drawer.js 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/inspector/front-end/Drawer.js 2011-10-04 11:37:25 UTC (rev 96584)
@@ -27,6 +27,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/**
+ * @constructor
+ */
WebInspector.Drawer = function()
{
this.element = document.getElementById("drawer");
@@ -100,8 +103,7 @@
function animationFinished()
{
- if ("updateStatusBarItems" in WebInspector.currentPanel())
- WebInspector.currentPanel().updateStatusBarItems();
+ WebInspector.currentPanel().statusBarResized();
if (this._view && this._view.afterShow)
this._view.afterShow();
delete this._currentAnimation;
@@ -131,8 +133,7 @@
// like Elements in their updateStatusBarItems call will size things to fit the final location.
this._mainStatusBar.style.setProperty("padding-left", (anchoredItems.offsetWidth - 1) + "px");
document.body.removeStyleClass("drawer-visible");
- if ("updateStatusBarItems" in WebInspector.currentPanel())
- WebInspector.currentPanel().updateStatusBarItems();
+ WebInspector.currentPanel().statusBarResized();
document.body.addStyleClass("drawer-visible");
var animations = [
@@ -178,7 +179,7 @@
return;
this._view.storeScrollPositions();
- var height = this._constrainHeight(parseInt(this.element.style.height));
+ var height = this._constrainHeight(parseInt(this.element.style.height, 10));
this._mainElement.style.bottom = height + "px";
this.element.style.height = height + "px";
this._view.doResize();
Modified: trunk/Source/WebCore/inspector/front-end/ElementsPanel.js (96583 => 96584)
--- trunk/Source/WebCore/inspector/front-end/ElementsPanel.js 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/inspector/front-end/ElementsPanel.js 2011-10-04 11:37:25 UTC (rev 96584)
@@ -140,7 +140,7 @@
return this.treeOutline.element;
},
- updateStatusBarItems: function()
+ statusBarResized: function()
{
this.updateBreadcrumbSizes();
},
Modified: trunk/Source/WebCore/inspector/front-end/EmptyView.js (96583 => 96584)
--- trunk/Source/WebCore/inspector/front-end/EmptyView.js 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/inspector/front-end/EmptyView.js 2011-10-04 11:37:25 UTC (rev 96584)
@@ -28,6 +28,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/**
+ * @constructor
+ * @extends {WebInspector.View}
+ */
WebInspector.EmptyView = function(text)
{
WebInspector.View.call(this);
Modified: trunk/Source/WebCore/inspector/front-end/Panel.js (96583 => 96584)
--- trunk/Source/WebCore/inspector/front-end/Panel.js 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/inspector/front-end/Panel.js 2011-10-04 11:37:25 UTC (rev 96584)
@@ -26,6 +26,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/**
+ * @extends {WebInspector.View}
+ * @constructor
+ */
WebInspector.Panel = function(name)
{
WebInspector.View.call(this);
@@ -227,11 +231,24 @@
WebInspector.settings[this._sidebarWidthSettingName()].set(this.sidebarElement.offsetWidth);
},
+ // Should be implemented by ancestors.
+
+ get toolbarItemLabel()
+ {
+ },
+
+ get statusBarItems()
+ {
+ },
+
updateMainViewWidth: function(width)
{
- // Should be implemented by ancestors.
},
+ statusBarResized: function()
+ {
+ },
+
canShowAnchorLocation: function(anchor)
{
return false;
Modified: trunk/Source/WebCore/inspector/front-end/PropertiesSection.js (96583 => 96584)
--- trunk/Source/WebCore/inspector/front-end/PropertiesSection.js 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/inspector/front-end/PropertiesSection.js 2011-10-04 11:37:25 UTC (rev 96584)
@@ -27,6 +27,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/**
+ * @constructor
+ * @extends {WebInspector.Section}
+ */
WebInspector.PropertiesSection = function(title, subtitle)
{
WebInspector.Section.call(this, title, subtitle);
Modified: trunk/Source/WebCore/inspector/front-end/SearchController.js (96583 => 96584)
--- trunk/Source/WebCore/inspector/front-end/SearchController.js 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/inspector/front-end/SearchController.js 2011-10-04 11:37:25 UTC (rev 96584)
@@ -29,6 +29,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/**
+ * @constructor
+ */
WebInspector.SearchController = function()
{
this.element = document.getElementById("search");
@@ -130,7 +133,7 @@
if (!this._currentQuery)
return;
- panel = WebInspector.currentPanel();
+ var panel = WebInspector.currentPanel();
if (panel.performSearch) {
function performPanelSearch()
{
@@ -148,6 +151,10 @@
}
},
+ /**
+ * @param {?number=} matches
+ * @param {number=} currentMatchIndex
+ */
_updateSearchMatchesCountAndCurrentMatchIndex: function(matches, currentMatchIndex)
{
if (matches == null) {
@@ -193,12 +200,12 @@
// If focus belongs here and text is empty - nothing to do, return unhandled.
// When search was selected manually and is currently blank, we'd like Esc stay unhandled
// and hit console drawer handler.
- if (event.target.value === "" && this.currentFocusElement === this.previousFocusElement)
+ if (event.target.value === "" && WebInspector.currentFocusElement === WebInspector.previousFocusElement)
return;
event.preventDefault();
event.stopPropagation();
- this.cancelSearch(event);
+ this.cancelSearch();
WebInspector.currentFocusElement = WebInspector.previousFocusElement;
if (WebInspector.currentFocusElement === event.target)
WebInspector.currentFocusElement.currentFocusElement.select();
@@ -227,6 +234,11 @@
this._performSearch(event.target.value, forceSearch, event.shiftKey, false);
},
+ /**
+ * @param {boolean=} forceSearch
+ * @param {boolean=} isBackwardSearch
+ * @param {boolean=} repeatSearch
+ */
_performSearch: function(query, forceSearch, isBackwardSearch, repeatSearch)
{
var isShortSearch = (query.length < 3);
@@ -285,3 +297,8 @@
currentPanel.performSearch(query);
}
}
+
+/**
+ * @type {?WebInspector.SearchController}
+ */
+WebInspector.searchController = null;
Modified: trunk/Source/WebCore/inspector/front-end/Section.js (96583 => 96584)
--- trunk/Source/WebCore/inspector/front-end/Section.js 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/inspector/front-end/Section.js 2011-10-04 11:37:25 UTC (rev 96584)
@@ -27,6 +27,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/**
+ * @constructor
+ */
WebInspector.Section = function(title, subtitle)
{
this.element = document.createElement("div");
@@ -118,12 +121,17 @@
set populated(x)
{
this._populated = x;
- if (!x && this.onpopulate && this._expanded) {
- this.onpopulate(this);
+ if (!x && this._expanded) {
+ this.onpopulate();
this._populated = true;
}
},
+ onpopulate: function()
+ {
+ // Overriden by subclasses.
+ },
+
get firstSibling()
{
var parent = this.element.parentElement;
@@ -183,8 +191,8 @@
this._expanded = true;
this.element.addStyleClass("expanded");
- if (!this._populated && this.onpopulate) {
- this.onpopulate(this);
+ if (!this._populated) {
+ this.onpopulate();
this._populated = true;
}
},
Modified: trunk/Source/WebCore/inspector/front-end/SidebarPane.js (96583 => 96584)
--- trunk/Source/WebCore/inspector/front-end/SidebarPane.js 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/inspector/front-end/SidebarPane.js 2011-10-04 11:37:25 UTC (rev 96584)
@@ -26,6 +26,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/**
+ * @constructor
+ * @extends {WebInspector.Object}
+ */
WebInspector.SidebarPane = function(title)
{
this.element = document.createElement("div");
Modified: trunk/Source/WebCore/inspector/front-end/Toolbar.js (96583 => 96584)
--- trunk/Source/WebCore/inspector/front-end/Toolbar.js 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/inspector/front-end/Toolbar.js 2011-10-04 11:37:25 UTC (rev 96584)
@@ -29,6 +29,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/**
+ * @constructor
+ */
WebInspector.Toolbar = function()
{
this.element = document.getElementById("toolbar");
@@ -142,7 +145,7 @@
else
this._dropdownButton.addStyleClass("hidden");
}
-};
+}
WebInspector.Toolbar.createPanelToolbarItem = function(panel)
{
@@ -155,7 +158,7 @@
WebInspector.toolbar._updateDropdownButtonAndHideDropdown();
WebInspector.setCurrentPanel(panel);
}
- toolbarItem.addEventListener("click", onToolbarItemClicked);
+ toolbarItem.addEventListener("click", onToolbarItemClicked, false);
var iconElement = toolbarItem.createChild("div", "toolbar-icon");
@@ -168,6 +171,9 @@
return toolbarItem;
}
+/**
+ * @constructor
+ */
WebInspector.ToolbarDropdown = function()
{
this._toolbar = document.getElementById("toolbar");
@@ -193,7 +199,6 @@
this.element.style.left = this._arrow.totalOffsetLeft() + "px";
this._contentElement.style.maxHeight = window.innerHeight - top - 20 + "px";
this._toolbar.appendChild(this.element);
- WebInspector.currentFocusElement = this.contentElement;
},
hide: function()
@@ -227,4 +232,9 @@
event.stopPropagation();
this.hide();
}
-};
+}
+
+/**
+ * @type {?WebInspector.Toolbar}
+ */
+WebInspector.toolbar = null;
Added: trunk/Source/WebCore/inspector/front-end/UIUtils.js (0 => 96584)
--- trunk/Source/WebCore/inspector/front-end/UIUtils.js (rev 0)
+++ trunk/Source/WebCore/inspector/front-end/UIUtils.js 2011-10-04 11:37:25 UTC (rev 96584)
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Matt Lilek ([email protected]).
+ * Copyright (C) 2009 Joseph Pecoraro
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.elementDragStart = function(element, dividerDrag, elementDragEnd, event, cursor)
+{
+ if (WebInspector._elementDraggingEventListener || WebInspector._elementEndDraggingEventListener)
+ WebInspector.elementDragEnd(event);
+
+ WebInspector._elementDraggingEventListener = dividerDrag;
+ WebInspector._elementEndDraggingEventListener = elementDragEnd;
+
+ var targetDocument = event.target.ownerDocument;
+ targetDocument.addEventListener("mousemove", dividerDrag, true);
+ targetDocument.addEventListener("mouseup", elementDragEnd, true);
+
+ targetDocument.body.style.cursor = cursor;
+
+ event.preventDefault();
+}
+
+WebInspector.elementDragEnd = function(event)
+{
+ var targetDocument = event.target.ownerDocument;
+ targetDocument.removeEventListener("mousemove", WebInspector._elementDraggingEventListener, true);
+ targetDocument.removeEventListener("mouseup", WebInspector._elementEndDraggingEventListener, true);
+
+ targetDocument.body.style.removeProperty("cursor");
+
+ delete WebInspector._elementDraggingEventListener;
+ delete WebInspector._elementEndDraggingEventListener;
+
+ event.preventDefault();
+}
+
+WebInspector.animateStyle = function(animations, duration, callback)
+{
+ var interval;
+ var complete = 0;
+ var hasCompleted = false;
+
+ const intervalDuration = (1000 / 30); // 30 frames per second.
+ const animationsLength = animations.length;
+ const propertyUnit = {opacity: ""};
+ const defaultUnit = "px";
+
+ function cubicInOut(t, b, c, d)
+ {
+ if ((t/=d/2) < 1) return c/2*t*t*t + b;
+ return c/2*((t-=2)*t*t + 2) + b;
+ }
+
+ // Pre-process animations.
+ for (var i = 0; i < animationsLength; ++i) {
+ var animation = animations[i];
+ var element = null, start = null, end = null, key = null;
+ for (key in animation) {
+ if (key === "element")
+ element = animation[key];
+ else if (key === "start")
+ start = animation[key];
+ else if (key === "end")
+ end = animation[key];
+ }
+
+ if (!element || !end)
+ continue;
+
+ if (!start) {
+ var computedStyle = element.ownerDocument.defaultView.getComputedStyle(element);
+ start = {};
+ for (key in end)
+ start[key] = parseInt(computedStyle.getPropertyValue(key), 10);
+ animation.start = start;
+ } else
+ for (key in start)
+ element.style.setProperty(key, start[key] + (key in propertyUnit ? propertyUnit[key] : defaultUnit));
+ }
+
+ function animateLoop()
+ {
+ if (hasCompleted)
+ return;
+
+ // Advance forward.
+ complete += intervalDuration;
+ var next = complete + intervalDuration;
+
+ // Make style changes.
+ for (var i = 0; i < animationsLength; ++i) {
+ var animation = animations[i];
+ var element = animation.element;
+ var start = animation.start;
+ var end = animation.end;
+ if (!element || !end)
+ continue;
+
+ var style = element.style;
+ for (key in end) {
+ var endValue = end[key];
+ if (next < duration) {
+ var startValue = start[key];
+ var newValue = cubicInOut(complete, startValue, endValue - startValue, duration);
+ style.setProperty(key, newValue + (key in propertyUnit ? propertyUnit[key] : defaultUnit));
+ } else
+ style.setProperty(key, endValue + (key in propertyUnit ? propertyUnit[key] : defaultUnit));
+ }
+ }
+
+ // End condition.
+ if (complete >= duration) {
+ hasCompleted = true;
+ clearInterval(interval);
+ if (callback)
+ callback();
+ }
+ }
+
+ function forceComplete()
+ {
+ if (hasCompleted)
+ return;
+
+ complete = duration;
+ animateLoop();
+ }
+
+ function cancel()
+ {
+ hasCompleted = true;
+ clearInterval(interval);
+ }
+
+ interval = setInterval(animateLoop, intervalDuration);
+ return {
+ cancel: cancel,
+ forceComplete: forceComplete
+ };
+}
+
Property changes on: trunk/Source/WebCore/inspector/front-end/UIUtils.js
___________________________________________________________________
Added: svn:eol-style
Modified: trunk/Source/WebCore/inspector/front-end/WebKit.qrc (96583 => 96584)
--- trunk/Source/WebCore/inspector/front-end/WebKit.qrc 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/inspector/front-end/WebKit.qrc 2011-10-04 11:37:25 UTC (rev 96584)
@@ -135,6 +135,7 @@
<file>TopDownProfileDataGridTree.js</file>
<file>treeoutline.js</file>
<file>UISourceCode.js</file>
+ <file>UIUtils.js</file>
<file>UserMetrics.js</file>
<file>utilities.js</file>
<file>View.js</file>
Modified: trunk/Source/WebCore/inspector/front-end/externs.js (96583 => 96584)
--- trunk/Source/WebCore/inspector/front-end/externs.js 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/inspector/front-end/externs.js 2011-10-04 11:37:25 UTC (rev 96584)
@@ -76,6 +76,8 @@
WebInspector.extensionServer = {}
WebInspector.extensionServer.notifyResourceContentCommitted = function(resource, content) {}
+WebInspector.extensionServer.notifyPanelShown = function(panel) {}
+WebInspector.extensionServer.notifyPanelHidden = function(panel) {}
/**
* @param {string} url
@@ -146,3 +148,28 @@
* @type {?WebInspector.ScriptsPanel}
*/
WebInspector.panels.scripts = null;
+
+/**
+ * @return {WebInspector.Panel}
+ */
+WebInspector.currentPanel = function() {}
+
+/**
+ * @param {WebInspector.Panel} panel
+ */
+WebInspector.setCurrentPanel = function(panel) {}
+
+/**
+ * @type {?Element}
+ */
+WebInspector.currentFocusElement = null;
+
+/**
+ * @type {?Element}
+ */
+WebInspector.previousFocusElement = null;
+
+/**
+ * @type {string}
+ */
+WebInspector.platformFlavor = "";
Modified: trunk/Source/WebCore/inspector/front-end/inspector.html (96583 => 96584)
--- trunk/Source/WebCore/inspector/front-end/inspector.html 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/inspector/front-end/inspector.html 2011-10-04 11:37:25 UTC (rev 96584)
@@ -44,6 +44,7 @@
<script type="text/_javascript_" src=""
<script type="text/_javascript_" src=""
<script type="text/_javascript_" src=""
+ <script type="text/_javascript_" src=""
<script type="text/_javascript_" src=""
<script type="text/_javascript_" src=""
<script type="text/_javascript_" src=""
Modified: trunk/Source/WebCore/inspector/front-end/inspector.js (96583 => 96584)
--- trunk/Source/WebCore/inspector/front-end/inspector.js 2011-10-04 11:03:42 UTC (rev 96583)
+++ trunk/Source/WebCore/inspector/front-end/inspector.js 2011-10-04 11:37:25 UTC (rev 96584)
@@ -889,142 +889,6 @@
event.preventDefault();
}
-WebInspector.animateStyle = function(animations, duration, callback)
-{
- var interval;
- var complete = 0;
- var hasCompleted = false;
-
- const intervalDuration = (1000 / 30); // 30 frames per second.
- const animationsLength = animations.length;
- const propertyUnit = {opacity: ""};
- const defaultUnit = "px";
-
- function cubicInOut(t, b, c, d)
- {
- if ((t/=d/2) < 1) return c/2*t*t*t + b;
- return c/2*((t-=2)*t*t + 2) + b;
- }
-
- // Pre-process animations.
- for (var i = 0; i < animationsLength; ++i) {
- var animation = animations[i];
- var element = null, start = null, end = null, key = null;
- for (key in animation) {
- if (key === "element")
- element = animation[key];
- else if (key === "start")
- start = animation[key];
- else if (key === "end")
- end = animation[key];
- }
-
- if (!element || !end)
- continue;
-
- if (!start) {
- var computedStyle = element.ownerDocument.defaultView.getComputedStyle(element);
- start = {};
- for (key in end)
- start[key] = parseInt(computedStyle.getPropertyValue(key));
- animation.start = start;
- } else
- for (key in start)
- element.style.setProperty(key, start[key] + (key in propertyUnit ? propertyUnit[key] : defaultUnit));
- }
-
- function animateLoop()
- {
- if (hasCompleted)
- return;
-
- // Advance forward.
- complete += intervalDuration;
- var next = complete + intervalDuration;
-
- // Make style changes.
- for (var i = 0; i < animationsLength; ++i) {
- var animation = animations[i];
- var element = animation.element;
- var start = animation.start;
- var end = animation.end;
- if (!element || !end)
- continue;
-
- var style = element.style;
- for (key in end) {
- var endValue = end[key];
- if (next < duration) {
- var startValue = start[key];
- var newValue = cubicInOut(complete, startValue, endValue - startValue, duration);
- style.setProperty(key, newValue + (key in propertyUnit ? propertyUnit[key] : defaultUnit));
- } else
- style.setProperty(key, endValue + (key in propertyUnit ? propertyUnit[key] : defaultUnit));
- }
- }
-
- // End condition.
- if (complete >= duration) {
- hasCompleted = true;
- clearInterval(interval);
- if (callback)
- callback();
- }
- }
-
- function forceComplete()
- {
- if (hasCompleted)
- return;
-
- complete = duration;
- animateLoop();
- }
-
- function cancel()
- {
- hasCompleted = true;
- clearInterval(interval);
- }
-
- interval = setInterval(animateLoop, intervalDuration);
- return {
- cancel: cancel,
- forceComplete: forceComplete
- };
-}
-
-WebInspector.elementDragStart = function(element, dividerDrag, elementDragEnd, event, cursor)
-{
- if (this._elementDraggingEventListener || this._elementEndDraggingEventListener)
- this.elementDragEnd(event);
-
- this._elementDraggingEventListener = dividerDrag;
- this._elementEndDraggingEventListener = elementDragEnd;
-
- var targetDocument = event.target.ownerDocument;
- targetDocument.addEventListener("mousemove", dividerDrag, true);
- targetDocument.addEventListener("mouseup", elementDragEnd, true);
-
- targetDocument.body.style.cursor = cursor;
-
- event.preventDefault();
-}
-
-WebInspector.elementDragEnd = function(event)
-{
- var targetDocument = event.target.ownerDocument;
- targetDocument.removeEventListener("mousemove", this._elementDraggingEventListener, true);
- targetDocument.removeEventListener("mouseup", this._elementEndDraggingEventListener, true);
-
- targetDocument.body.style.removeProperty("cursor");
-
- delete this._elementDraggingEventListener;
- delete this._elementEndDraggingEventListener;
-
- event.preventDefault();
-}
-
WebInspector.toggleSearchingForNode = function()
{
if (this.panels.elements) {