[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
pfeldman at chromium.org
pfeldman at chromium.org
Thu Apr 8 01:51:59 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit a75a3592cd5300b839e7dd4fb3f6e65dcad98b34
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Feb 18 16:12:53 2010 +0000
2010-02-18 Pavel Feldman <pfeldman at chromium.org>
Reviewed by Timothy Hatcher.
Web Inspector: Implement evaluate-on-hover for scripts panel.
https://bugs.webkit.org/show_bug.cgi?id=35003
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* inspector/front-end/Images/gearButtonGlyph.png: Added.
* inspector/front-end/Images/popoverArrows.png: Added.
* inspector/front-end/Images/popoverBackground.png: Added.
* inspector/front-end/Images/thumbActiveHoriz.png: Added.
* inspector/front-end/Images/thumbActiveVert.png: Added.
* inspector/front-end/Images/thumbHoriz.png: Added.
* inspector/front-end/Images/thumbHoverHoriz.png: Added.
* inspector/front-end/Images/thumbHoverVert.png: Added.
* inspector/front-end/Images/thumbVert.png: Added.
* inspector/front-end/Images/trackHoriz.png: Added.
* inspector/front-end/Images/trackVert.png: Added.
* inspector/front-end/Popup.js:
(WebInspector.Popup):
(WebInspector.Popup.prototype.show):
(WebInspector.Popup.prototype.hide):
(WebInspector.Popup.prototype._positionElement):
* inspector/front-end/SourceFrame.js:
(WebInspector.SourceFrame.prototype._createViewerIfNeeded):
(WebInspector.SourceFrame.prototype._scroll):
(WebInspector.SourceFrame.prototype._mouseDown):
(WebInspector.SourceFrame.prototype._mouseUp):
(WebInspector.SourceFrame.prototype._mouseMove):
(WebInspector.SourceFrame.prototype._mouseOut):
(WebInspector.SourceFrame.prototype._resetHoverTimer):
(WebInspector.SourceFrame.prototype._hidePopup):
(WebInspector.SourceFrame.prototype._mouseHover):
(WebInspector.SourceFrame.prototype._showPopup.showTextPopup):
(WebInspector.SourceFrame.prototype._showPopup.showObjectPopup):
(WebInspector.SourceFrame.prototype._showPopup.evaluateCallback):
(WebInspector.SourceFrame.prototype._showPopup):
(WebInspector.HoverPropertiesSection):
(WebInspector.HoverPropertiesSection.prototype.update):
* inspector/front-end/TextEditorHighlighter.js:
(WebInspector.TextEditorHighlighter):
(WebInspector.TextEditorHighlighter.prototype._lex):
* inspector/front-end/TextViewer.js:
(WebInspector.TextViewer.prototype._paintLine):
* inspector/front-end/WebKit.qrc:
* inspector/front-end/inspector.css:
* inspector/front-end/inspector.html:
* inspector/front-end/inspectorSyntaxHighlight.css:
* inspector/front-end/popover.css: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54962 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1776cf6..c22a618 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,56 @@
+2010-02-18 Pavel Feldman <pfeldman at chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: Implement evaluate-on-hover for scripts panel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35003
+
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * inspector/front-end/Images/gearButtonGlyph.png: Added.
+ * inspector/front-end/Images/popoverArrows.png: Added.
+ * inspector/front-end/Images/popoverBackground.png: Added.
+ * inspector/front-end/Images/thumbActiveHoriz.png: Added.
+ * inspector/front-end/Images/thumbActiveVert.png: Added.
+ * inspector/front-end/Images/thumbHoriz.png: Added.
+ * inspector/front-end/Images/thumbHoverHoriz.png: Added.
+ * inspector/front-end/Images/thumbHoverVert.png: Added.
+ * inspector/front-end/Images/thumbVert.png: Added.
+ * inspector/front-end/Images/trackHoriz.png: Added.
+ * inspector/front-end/Images/trackVert.png: Added.
+ * inspector/front-end/Popup.js:
+ (WebInspector.Popup):
+ (WebInspector.Popup.prototype.show):
+ (WebInspector.Popup.prototype.hide):
+ (WebInspector.Popup.prototype._positionElement):
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame.prototype._createViewerIfNeeded):
+ (WebInspector.SourceFrame.prototype._scroll):
+ (WebInspector.SourceFrame.prototype._mouseDown):
+ (WebInspector.SourceFrame.prototype._mouseUp):
+ (WebInspector.SourceFrame.prototype._mouseMove):
+ (WebInspector.SourceFrame.prototype._mouseOut):
+ (WebInspector.SourceFrame.prototype._resetHoverTimer):
+ (WebInspector.SourceFrame.prototype._hidePopup):
+ (WebInspector.SourceFrame.prototype._mouseHover):
+ (WebInspector.SourceFrame.prototype._showPopup.showTextPopup):
+ (WebInspector.SourceFrame.prototype._showPopup.showObjectPopup):
+ (WebInspector.SourceFrame.prototype._showPopup.evaluateCallback):
+ (WebInspector.SourceFrame.prototype._showPopup):
+ (WebInspector.HoverPropertiesSection):
+ (WebInspector.HoverPropertiesSection.prototype.update):
+ * inspector/front-end/TextEditorHighlighter.js:
+ (WebInspector.TextEditorHighlighter):
+ (WebInspector.TextEditorHighlighter.prototype._lex):
+ * inspector/front-end/TextViewer.js:
+ (WebInspector.TextViewer.prototype._paintLine):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/inspector.css:
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/inspectorSyntaxHighlight.css:
+ * inspector/front-end/popover.css: Added.
+
2010-02-18 Ben Murdoch <benm at google.com>
Reviewed by Jeremy Orlow.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 76f479d..30614f2 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -3755,7 +3755,7 @@
'inspector/front-end/Panel.js',
'inspector/front-end/PanelEnablerView.js',
'inspector/front-end/Placard.js',
- 'inspector/front-end/Popup.js',
+ 'inspector/front-end/Popover.js',
'inspector/front-end/ProfileDataGridTree.js',
'inspector/front-end/ProfilesPanel.js',
'inspector/front-end/ProfileView.js',
@@ -3801,6 +3801,7 @@
'inspector/front-end/audits.css',
'inspector/front-end/inspector.css',
'inspector/front-end/inspectorSyntaxHighlight.css',
+ 'inspector/front-end/popover.css',
'inspector/front-end/textViewer.css',
],
'webinspector_image_files': [
@@ -3838,6 +3839,7 @@
'inspector/front-end/Images/excludeButtonGlyph.png',
'inspector/front-end/Images/focusButtonGlyph.png',
'inspector/front-end/Images/forward.png',
+ 'inspector/front-end/Images/gearButtonGlyph.png',
'inspector/front-end/Images/glossyHeader.png',
'inspector/front-end/Images/glossyHeaderPressed.png',
'inspector/front-end/Images/glossyHeaderSelected.png',
@@ -3855,6 +3857,8 @@
'inspector/front-end/Images/paneSettingsButtons.png',
'inspector/front-end/Images/pauseOnExceptionButtonGlyph.png',
'inspector/front-end/Images/percentButtonGlyph.png',
+ 'inspector/front-end/Images/popoverArrow.png',
+ 'inspector/front-end/Images/popoverBackground.png',
'inspector/front-end/Images/profileGroupIcon.png',
'inspector/front-end/Images/profileIcon.png',
'inspector/front-end/Images/profilesIcon.png',
@@ -3898,6 +3902,12 @@
'inspector/front-end/Images/statusbarResizerVertical.png',
'inspector/front-end/Images/storageIcon.png',
'inspector/front-end/Images/successGreenDot.png',
+ 'inspector/front-end/Images/thumbActiveHoriz.png',
+ 'inspector/front-end/Images/thumbActiveVert.png',
+ 'inspector/front-end/Images/thumbHoriz.png',
+ 'inspector/front-end/Images/thumbVert.png',
+ 'inspector/front-end/Images/thumbHoverHoriz.png',
+ 'inspector/front-end/Images/thumbHoverVert.png',
'inspector/front-end/Images/timelineHollowPillBlue.png',
'inspector/front-end/Images/timelineHollowPillGray.png',
'inspector/front-end/Images/timelineHollowPillGreen.png',
@@ -3923,6 +3933,8 @@
'inspector/front-end/Images/timelinePillRed.png',
'inspector/front-end/Images/timelinePillYellow.png',
'inspector/front-end/Images/toolbarItemSelected.png',
+ 'inspector/front-end/Images/trackHoriz.png',
+ 'inspector/front-end/Images/trackVert.png',
'inspector/front-end/Images/treeDownTriangleBlack.png',
'inspector/front-end/Images/treeDownTriangleWhite.png',
'inspector/front-end/Images/treeRightTriangleBlack.png',
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index a0f724e..9ff2639 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -42884,7 +42884,11 @@
>
</File>
<File
- RelativePath="..\inspector\front-end\Popup.js"
+ RelativePath="..\inspector\front-end\popover.css"
+ >
+ </File>
+ <File
+ RelativePath="..\inspector\front-end\Popover.js"
>
</File>
<File
diff --git a/WebCore/inspector/front-end/Images/gearButtonGlyph.png b/WebCore/inspector/front-end/Images/gearButtonGlyph.png
new file mode 100644
index 0000000..19659c9
Binary files /dev/null and b/WebCore/inspector/front-end/Images/gearButtonGlyph.png differ
diff --git a/WebCore/inspector/front-end/Images/popoverArrows.png b/WebCore/inspector/front-end/Images/popoverArrows.png
new file mode 100644
index 0000000..ccefa16
Binary files /dev/null and b/WebCore/inspector/front-end/Images/popoverArrows.png differ
diff --git a/WebCore/inspector/front-end/Images/popoverBackground.png b/WebCore/inspector/front-end/Images/popoverBackground.png
new file mode 100644
index 0000000..f20c988
Binary files /dev/null and b/WebCore/inspector/front-end/Images/popoverBackground.png differ
diff --git a/WebCore/inspector/front-end/Images/thumbActiveHoriz.png b/WebCore/inspector/front-end/Images/thumbActiveHoriz.png
new file mode 100644
index 0000000..a6ee561
Binary files /dev/null and b/WebCore/inspector/front-end/Images/thumbActiveHoriz.png differ
diff --git a/WebCore/inspector/front-end/Images/thumbActiveVert.png b/WebCore/inspector/front-end/Images/thumbActiveVert.png
new file mode 100644
index 0000000..a3eabe8
Binary files /dev/null and b/WebCore/inspector/front-end/Images/thumbActiveVert.png differ
diff --git a/WebCore/inspector/front-end/Images/thumbHoriz.png b/WebCore/inspector/front-end/Images/thumbHoriz.png
new file mode 100644
index 0000000..c16559a
Binary files /dev/null and b/WebCore/inspector/front-end/Images/thumbHoriz.png differ
diff --git a/WebCore/inspector/front-end/Images/thumbHoverHoriz.png b/WebCore/inspector/front-end/Images/thumbHoverHoriz.png
new file mode 100644
index 0000000..0fe8d6a
Binary files /dev/null and b/WebCore/inspector/front-end/Images/thumbHoverHoriz.png differ
diff --git a/WebCore/inspector/front-end/Images/thumbHoverVert.png b/WebCore/inspector/front-end/Images/thumbHoverVert.png
new file mode 100644
index 0000000..30e315a
Binary files /dev/null and b/WebCore/inspector/front-end/Images/thumbHoverVert.png differ
diff --git a/WebCore/inspector/front-end/Images/thumbVert.png b/WebCore/inspector/front-end/Images/thumbVert.png
new file mode 100644
index 0000000..61fbc06
Binary files /dev/null and b/WebCore/inspector/front-end/Images/thumbVert.png differ
diff --git a/WebCore/inspector/front-end/Images/trackHoriz.png b/WebCore/inspector/front-end/Images/trackHoriz.png
new file mode 100644
index 0000000..517d306
Binary files /dev/null and b/WebCore/inspector/front-end/Images/trackHoriz.png differ
diff --git a/WebCore/inspector/front-end/Images/trackVert.png b/WebCore/inspector/front-end/Images/trackVert.png
new file mode 100644
index 0000000..d49620d
Binary files /dev/null and b/WebCore/inspector/front-end/Images/trackVert.png differ
diff --git a/WebCore/inspector/front-end/Popover.js b/WebCore/inspector/front-end/Popover.js
new file mode 100644
index 0000000..8894b82
--- /dev/null
+++ b/WebCore/inspector/front-end/Popover.js
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * 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.
+ * * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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.Popover = function(contentElement)
+{
+ this.element = document.createElement("div");
+ this.element.className = "popover";
+
+ this._popupArrowElement = document.createElement("div");
+ this._popupArrowElement.className = "arrow";
+ this.element.appendChild(this._popupArrowElement);
+
+ this.contentElement = contentElement;
+}
+
+WebInspector.Popover.prototype = {
+ show: function(anchor, preferredWidth, preferredHeight)
+ {
+ // Temporarily attach in order to measure preferred dimensions.
+ this.contentElement.positionAt(0, 0);
+ document.body.appendChild(this.contentElement);
+ var preferredWidth = preferredWidth || this.contentElement.offsetWidth;
+ var preferredHeight = preferredHeight || this.contentElement.offsetHeight;
+
+ this.contentElement.addStyleClass("content");
+ this.element.appendChild(this.contentElement);
+ document.body.appendChild(this.element);
+ this._positionElement(anchor, preferredWidth, preferredHeight);
+ },
+
+ hide: function()
+ {
+ document.body.removeChild(this.element);
+ },
+
+ _positionElement: function(anchorElement, preferredWidth, preferredHeight)
+ {
+ const borderWidth = 25;
+ const scrollerWidth = 11;
+ const arrowHeight = 10;
+ const arrowOffset = 15;
+
+ // Skinny tooltips are not pretty, their arrow location is not nice.
+ preferredWidth = Math.max(preferredWidth, 50);
+ const totalWidth = window.innerWidth;
+ const totalHeight = window.innerHeight;
+
+ var anchorBox = {x: anchorElement.totalOffsetLeft, y: anchorElement.totalOffsetTop, width: anchorElement.offsetWidth, height: anchorElement.offsetHeight};
+ while (anchorElement !== document.body) {
+ if (anchorElement.scrollLeft)
+ anchorBox.x -= anchorElement.scrollLeft;
+ if (anchorElement.scrollTop)
+ anchorBox.y -= anchorElement.scrollTop;
+ anchorElement = anchorElement.parentElement;
+ }
+
+ var newElementPosition = { x: 0, y: 0, width: preferredWidth + borderWidth * 2, height: preferredHeight + borderWidth * 2 };
+
+ var verticalAlignment;
+ var roomAbove = anchorBox.y;
+ var roomBelow = totalHeight - anchorBox.y - anchorBox.height;
+
+ if (roomAbove > roomBelow) {
+ // Positioning above the anchor.
+ if (anchorBox.y > newElementPosition.height)
+ newElementPosition.y = anchorBox.y - newElementPosition.height;
+ else {
+ newElementPosition.y = 0;
+ newElementPosition.height = anchorBox.y - newElementPosition.y;
+ // Reserve room for vertical scroller anyways.
+ newElementPosition.width += scrollerWidth;
+ }
+ verticalAlignment = "bottom";
+ } else {
+ // Positioning below the anchor.
+ newElementPosition.y = anchorBox.y + anchorBox.height;
+ if (newElementPosition.y + newElementPosition.height >= totalHeight) {
+ newElementPosition.height = totalHeight - anchorBox.y - anchorBox.height;
+ // Reserve room for vertical scroller.
+ newElementPosition.width += scrollerWidth;
+ }
+ // Align arrow.
+ newElementPosition.y -= arrowHeight;
+ verticalAlignment = "top";
+ }
+
+ var horizontalAlignment;
+ if (anchorBox.x + newElementPosition.width < totalWidth) {
+ newElementPosition.x = Math.max(0, anchorBox.x) - borderWidth - arrowOffset;
+ horizontalAlignment = "left";
+ } else if (newElementPosition.width < totalWidth) {
+ newElementPosition.x = totalWidth - newElementPosition.width;
+ horizontalAlignment = "right";
+ // Position arrow accurately.
+ this._popupArrowElement.style.right = totalWidth - anchorBox.x - borderWidth - anchorBox.width + "px";
+ } else {
+ newElementPosition.x = 0;
+ newElementPosition.width = totalWidth;
+ horizontalAlignment = "left";
+ if (verticalAlignment === "bottom")
+ newElementPosition.y -= scrollerWidth;
+ // Position arrow accurately.
+ this._popupArrowElement.style.left = anchorBox.x - borderWidth + "px";
+ }
+
+ // Reserve room for horizontal scroller.
+ newElementPosition.height += scrollerWidth;
+
+ this.element.className = "popover " + verticalAlignment + "-" + horizontalAlignment + "-arrow";
+ this.element.positionAt(newElementPosition.x, newElementPosition.y);
+ this.element.style.width = newElementPosition.width + "px";
+ this.element.style.height = newElementPosition.height + "px";
+ }
+}
diff --git a/WebCore/inspector/front-end/Popup.js b/WebCore/inspector/front-end/Popup.js
deleted file mode 100644
index 9c8ef24..0000000
--- a/WebCore/inspector/front-end/Popup.js
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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.
- * * Neither the name of Google Inc. 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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.
- */
-
-/**
- * This class provides a popup that can be shown relative to an anchor element
- * or at an arbitrary absolute position.
- * Points are Objects: {x: xValue, y: yValue}.
- * Rectangles are Objects: {x: xValue, y: yValue, width: widthValue, height: heightValue}.
- *
- * element is an optional unparented visible element (style.display != "none" AND style.visibility != "hidden").
- * If the element is absent/undefined, it must have been set with the element(x) setter before the show() method invocation.
- */
-WebInspector.Popup = function(element)
-{
- if (element)
- this.element = element;
- this._keyHandler = this._keyEventHandler.bind(this);
- this._mouseDownHandler = this._mouseDownEventHandler.bind(this);
- this._visible = false;
- this._autoHide = true;
-}
-
-WebInspector.Popup.prototype = {
- show: function()
- {
- if (this.visible)
- return;
- var ownerDocument = this._contentElement.ownerDocument;
- if (!ownerDocument)
- return;
-
- this._glasspaneElement = ownerDocument.createElement("div");
- this._glasspaneElement.className = "popup-glasspane";
- ownerDocument.body.appendChild(this._glasspaneElement);
-
- this._contentElement.positionAt(0, 0);
- this._contentElement.removeStyleClass("hidden");
- ownerDocument.body.appendChild(this._contentElement);
-
- this.positionElement();
- this._visible = true;
- ownerDocument.addEventListener("keydown", this._keyHandler, false);
- ownerDocument.addEventListener("mousedown", this._mouseDownHandler, false);
- },
-
- hide: function()
- {
- if (this.visible) {
- this._visible = false;
- this._contentElement.ownerDocument.removeEventListener("keydown", this._keyHandler, false);
- this._contentElement.ownerDocument.removeEventListener("mousedown", this._mouseDownHandler, false);
- this._glasspaneElement.parentElement.removeChild(this._glasspaneElement);
- this._contentElement.parentElement.removeChild(this._contentElement);
- }
- },
-
- get visible()
- {
- return this._visible;
- },
-
- set element(x)
- {
- this._checkNotVisible();
- this._contentElement = x;
- this._contentElement.addStyleClass("hidden");
- },
-
- get element()
- {
- return this._contentElement;
- },
-
- positionElement: function()
- {
- var element = this._contentElement;
- var anchorElement = this._anchorElement;
-
- var targetDocument = element.ownerDocument;
- var targetDocumentBody = targetDocument.body;
- var targetDocumentElement = targetDocument.documentElement;
- var clippingBox = {x: 0, y: 0, width: targetDocumentElement.clientWidth, height: targetDocumentElement.clientHeight};
- var parentElement = element.offsetParent || element.parentElement;
-
- var anchorPosition = {x: anchorElement.totalOffsetLeft, y: anchorElement.totalOffsetTop};
-
- // FIXME(apavlov at chromium.org): Translate anchorPosition to the element.ownerDocument frame when https://bugs.webkit.org/show_bug.cgi?id=28913 is fixed.
- var anchorBox = {x: anchorPosition.x, y: anchorPosition.y, width: anchorElement.offsetWidth, height: anchorElement.offsetHeight};
- var elementBox = {x: element.totalOffsetLeft, y: element.totalOffsetTop, width: element.offsetWidth, height: element.offsetHeight};
- var newElementPosition = {x: 0, y: 0};
-
- if (anchorBox.y - elementBox.height >= clippingBox.y)
- newElementPosition.y = anchorBox.y - elementBox.height;
- else
- newElementPosition.y = Math.min(anchorBox.y + anchorBox.height, Math.max(clippingBox.y, clippingBox.y + clippingBox.height - elementBox.height));
-
- if (anchorBox.x + elementBox.height <= clippingBox.x + clippingBox.height)
- newElementPosition.x = anchorBox.x;
- else
- newElementPosition.x = Math.max(clippingBox.x, clippingBox.x + clippingBox.height - elementBox.height);
- element.positionAt(newElementPosition.x, newElementPosition.y);
- },
-
- set anchor(x)
- {
- this._checkNotVisible();
- this._anchorElement = x;
- },
-
- get anchor()
- {
- return this._anchorElement;
- },
-
- set autoHide(x)
- {
- this._autoHide = x;
- },
-
- _checkNotVisible: function()
- {
- if (this.visible)
- throw new Error("The popup must not be visible.");
- },
-
- _keyEventHandler: function(event)
- {
- // Escape hides the popup.
- if (event.keyIdentifier == "U+001B") {
- this.hide();
- event.preventDefault();
- event.handled = true;
- }
- },
-
- _mouseDownEventHandler: function(event)
- {
- if (this._autoHide && event.originalTarget === this._glasspaneElement)
- this.hide();
- }
-}
diff --git a/WebCore/inspector/front-end/SourceFrame.js b/WebCore/inspector/front-end/SourceFrame.js
index 51c9f4b..2a98f3c 100644
--- a/WebCore/inspector/front-end/SourceFrame.js
+++ b/WebCore/inspector/front-end/SourceFrame.js
@@ -45,6 +45,7 @@ WebInspector.SourceFrame = function(parentElement, addBreakpointDelegate, remove
this._addBreakpointDelegate = addBreakpointDelegate;
this._removeBreakpointDelegate = removeBreakpointDelegate;
+ this._popoverObjectGroup = "popover";
}
WebInspector.SourceFrame.prototype = {
@@ -160,6 +161,8 @@ WebInspector.SourceFrame.prototype = {
element.addEventListener("keydown", this._keyDown.bind(this), true);
element.addEventListener("contextmenu", this._contextMenu.bind(this), true);
element.addEventListener("mousedown", this._mouseDown.bind(this), true);
+ element.addEventListener("mousemove", this._mouseMove.bind(this), true);
+ element.addEventListener("scroll", this._scroll.bind(this), true);
this._parentElement.appendChild(element);
this._needsProgramCounterImage = true;
@@ -423,8 +426,15 @@ WebInspector.SourceFrame.prototype = {
contextMenu.show(event);
},
+ _scroll: function(event)
+ {
+ this._hidePopup();
+ },
+
_mouseDown: function(event)
{
+ this._resetHoverTimer();
+ this._hidePopup();
if (event.button != 0 || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
return;
if (event.target.className !== "webkit-line-number")
@@ -441,6 +451,160 @@ WebInspector.SourceFrame.prototype = {
event.preventDefault();
},
+ _mouseMove: function(event)
+ {
+ // Pretend that nothing has happened.
+ if (this._hoverElement === event.target)
+ return;
+
+ this._resetHoverTimer();
+
+ // User has 500ms to reach the popup.
+ if (this._popup) {
+ var self = this;
+ function doHide()
+ {
+ self._hidePopup();
+ delete self._hidePopupTimer;
+ }
+ this._hidePopupTimer = setTimeout(doHide, 500);
+ }
+
+ this._hoverElement = event.target;
+
+ // Now that cleanup routines are set up above, leave this in case we are not on a break.
+ if (!WebInspector.panels.scripts || !WebInspector.panels.scripts.paused)
+ return;
+
+ // We are interested in identifiers and "this" keyword.
+ if (this._hoverElement.hasStyleClass("webkit-javascript-keyword")) {
+ if (this._hoverElement.textContent !== "this")
+ return;
+ } else if (!this._hoverElement.hasStyleClass("webkit-javascript-ident"))
+ return;
+
+ const toolTipDelay = 1500;
+ this._hoverTimer = setTimeout(this._mouseHover.bind(this, this._hoverElement), toolTipDelay);
+ },
+
+ _resetHoverTimer: function()
+ {
+ if (this._hoverTimer) {
+ clearTimeout(this._hoverTimer);
+ delete this._hoverTimer;
+ }
+ },
+
+ _hidePopup: function()
+ {
+ if (this._popup) {
+ this._popup.hide();
+ delete this._popup;
+ InspectorBackend.releaseWrapperObjectGroup(0, this._popoverObjectGroup);
+ }
+ },
+
+ _mouseHover: function(element)
+ {
+ delete this._hoverTimer;
+
+ if (!WebInspector.panels.scripts || !WebInspector.panels.scripts.paused)
+ return;
+
+ var lineRow = element.enclosingNodeOrSelfWithNodeName("tr");
+ if (!lineRow)
+ return;
+
+ // Find text offset of the hovered node (iterate over text nodes until we hit ours).
+ var offset = 0;
+ var node = lineRow.lastChild.traverseNextTextNode(lineRow.lastChild);
+ while (node && node !== element.firstChild) {
+ offset += node.nodeValue.length;
+ node = node.traverseNextTextNode(lineRow.lastChild);
+ }
+
+ // Imagine that the line is "foo(A.B.C.D)" and we hit C. Following code goes through following steps:
+ // "foo(A.B.C" -> "C.B.A(oof" -> "C.B.A" -> "A.B.C" (target eval expression).
+ var lineNumber = lineRow.lineNumber;
+ var prefix = this._textModel.line(lineNumber).substring(0, offset + element.textContent.length);
+ var reversedPrefix = prefix.split("").reverse().join("");
+ var match = /[a-zA-Z\x80-\xFF\_$0-9.]+/.exec(reversedPrefix);
+ if (!match)
+ return;
+ var expression = match[0].split("").reverse().join("");
+ this._showPopup(element, expression);
+ },
+
+ _showPopup: function(element, expression)
+ {
+ function killHidePopupTimer()
+ {
+ if (this._hidePopupTimer) {
+ clearTimeout(this._hidePopupTimer);
+ delete this._hidePopupTimer;
+ }
+ }
+
+ function showTextPopup(text)
+ {
+ if (!WebInspector.panels.scripts.paused)
+ return;
+
+ var popupContentElement = document.createElement("span");
+ popupContentElement.className = "monospace";
+ popupContentElement.style.whiteSpace = "pre";
+ popupContentElement.textContent = text;
+ this._popup = new WebInspector.Popover(popupContentElement);
+ this._popup.show(element);
+ popupContentElement.addEventListener("mousemove", killHidePopupTimer.bind(this), true);
+ }
+
+ function showObjectPopup(result)
+ {
+ if (!WebInspector.panels.scripts.paused)
+ return;
+
+ var popupContentElement = null;
+ if (result.type !== "object") {
+ popupContentElement = document.createElement("span");
+ popupContentElement.className = "monospace";
+ popupContentElement.style.whiteSpace = "pre";
+ popupContentElement.textContent = result.description;
+ this._popup = new WebInspector.Popover(popupContentElement);
+ this._popup.show(element);
+ } else {
+ var popupContentElement = document.createElement("div");
+
+ var titleElement = document.createElement("div");
+ titleElement.className = "source-frame-popover-title monospace";
+ titleElement.textContent = result.description;
+ popupContentElement.appendChild(titleElement);
+
+ var section = new WebInspector.ObjectPropertiesSection(result, "", null, false);
+ section.expanded = true;
+ section.element.addStyleClass("source-frame-popover-tree");
+ section.headerElement.addStyleClass("hidden");
+ popupContentElement.appendChild(section.element);
+
+ this._popup = new WebInspector.Popover(popupContentElement);
+ const popupWidth = 300;
+ const popupHeight = 250;
+ this._popup.show(element, popupWidth, popupHeight);
+ }
+ popupContentElement.addEventListener("mousemove", killHidePopupTimer.bind(this), true);
+ }
+
+ function evaluateCallback(result, exception)
+ {
+ if (exception)
+ return;
+ if (!WebInspector.panels.scripts.paused)
+ return;
+ showObjectPopup.call(this, result);
+ }
+ WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, this._popoverObjectGroup, evaluateCallback.bind(this));
+ },
+
_editBreakpointCondition: function(breakpoint)
{
this._showBreakpointConditionPopup(breakpoint.line);
@@ -658,4 +822,5 @@ WebInspector.SourceFrame.prototype = {
}
}
+
WebInspector.SourceFrame.prototype.__proto__ = WebInspector.Object.prototype;
diff --git a/WebCore/inspector/front-end/TextEditorHighlighter.js b/WebCore/inspector/front-end/TextEditorHighlighter.js
index c73e036..cf0b590 100644
--- a/WebCore/inspector/front-end/TextEditorHighlighter.js
+++ b/WebCore/inspector/front-end/TextEditorHighlighter.js
@@ -32,36 +32,8 @@
WebInspector.TextEditorHighlighter = function(textModel, damageCallback)
{
this._textModel = textModel;
-
- this._styles = [];
-
- this._styles["css-comment"] = "rgb(0, 116, 0)";
- this._styles["css-params"] = "rgb(7, 144, 154)";
- this._styles["css-string"] = "rgb(7, 144, 154)";
- this._styles["css-keyword"] = "rgb(7, 144, 154)";
- this._styles["css-number"] = "rgb(50, 0, 255)";
- this._styles["css-property"] = "rgb(200, 0, 0)";
- this._styles["css-at-rule"] = "rgb(200, 0, 0)";
- this._styles["css-selector"] = "rgb(0, 0, 0)";
- this._styles["css-important"] = "rgb(200, 0, 180)";
-
- /* Keep this in sync with inspector.css and view-source.css */
- this._styles["html-tag"] = "rgb(136, 18, 128)";
- this._styles["html-attribute-name"] = "rgb(153, 69, 0)";
- this._styles["html-attribute-value"] = "rgb(26, 26, 166)";
- this._styles["html-comment"] = "rgb(35, 110, 37)";
- this._styles["html-doctype"] = "rgb(192, 192, 192)";
- this._styles["html-external-link"] = "#00e";
- this._styles["html-resource-link"] = "#00e";
-
- this._styles["javascript-comment"] = "rgb(0, 116, 0)";
- this._styles["javascript-string"] = "rgb(196, 26, 22)";
- this._styles["javascript-regexp"] = "rgb(196, 26, 22)";
- this._styles["javascript-keyword"] = "rgb(170, 13, 145)";
- this._styles["javascript-number"] = "rgb(28, 0, 207)";
-
- this.mimeType = "text/html";
- this._damageCallback = damageCallback;
+ this._tokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer("text/html");
+ this._damageCallback = damageCallback;
}
WebInspector.TextEditorHighlighter.prototype = {
@@ -190,7 +162,7 @@ WebInspector.TextEditorHighlighter.prototype = {
var newColumn = this._tokenizer.nextToken(column);
var tokenType = this._tokenizer.tokenType;
if (tokenType)
- attributes[column] = { length: newColumn - column, tokenType: tokenType, style: this._styles[tokenType] };
+ attributes[column] = { length: newColumn - column, tokenType: tokenType };
column = newColumn;
} while (column < line.length)
}
diff --git a/WebCore/inspector/front-end/TextViewer.js b/WebCore/inspector/front-end/TextViewer.js
index 81d0814..9be6a00 100644
--- a/WebCore/inspector/front-end/TextViewer.js
+++ b/WebCore/inspector/front-end/TextViewer.js
@@ -349,7 +349,7 @@ WebInspector.TextViewer.prototype = {
break;
}
var attribute = highlighterState && highlighterState.attributes[j];
- if (!attribute || !attribute.style) {
+ if (!attribute || !attribute.tokenType) {
if (plainTextStart === -1)
plainTextStart = j;
j++;
diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc
index efa2bfc..062bde5 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -45,7 +45,7 @@
<file>Panel.js</file>
<file>PanelEnablerView.js</file>
<file>Placard.js</file>
- <file>Popup.js</file>
+ <file>Popover.js</file>
<file>ProfileDataGridTree.js</file>
<file>ProfilesPanel.js</file>
<file>ProfileView.js</file>
@@ -91,6 +91,7 @@
<file>audits.css</file>
<file>inspector.css</file>
<file>inspectorSyntaxHighlight.css</file>
+ <file>popover.css</file>
<file>textViewer.css</file>
<file>Images/back.png</file>
<file>Images/checker.png</file>
@@ -125,6 +126,7 @@
<file>Images/excludeButtonGlyph.png</file>
<file>Images/focusButtonGlyph.png</file>
<file>Images/forward.png</file>
+ <file>Images/gearButtonGlyph.png</file>
<file>Images/glossyHeader.png</file>
<file>Images/glossyHeaderPressed.png</file>
<file>Images/glossyHeaderSelected.png</file>
@@ -142,6 +144,8 @@
<file>Images/paneSettingsButtons.png</file>
<file>Images/pauseOnExceptionButtonGlyph.png</file>
<file>Images/percentButtonGlyph.png</file>
+ <file>Images/popoverArrow.png</file>
+ <file>Images/popoverBackground.png</file>
<file>Images/profileGroupIcon.png</file>
<file>Images/profileIcon.png</file>
<file>Images/profilesIcon.png</file>
@@ -185,6 +189,12 @@
<file>Images/statusbarResizerVertical.png</file>
<file>Images/storageIcon.png</file>
<file>Images/successGreenDot.png</file>
+ <file>Images/thumbActiveHoriz.png</file>
+ <file>Images/thumbActiveVert.png</file>
+ <file>Images/thumbHoriz.png</file>
+ <file>Images/thumbVert.png</file>
+ <file>Images/thumbHoverHoriz.png</file>
+ <file>Images/thumbHoverVert.png</file>
<file>Images/timelineBarBlue.png</file>
<file>Images/timelineBarGray.png</file>
<file>Images/timelineBarGreen.png</file>
@@ -210,6 +220,8 @@
<file>Images/timelinePillRed.png</file>
<file>Images/timelinePillYellow.png</file>
<file>Images/toolbarItemSelected.png</file>
+ <file>Images/trackHoriz.png</file>
+ <file>Images/trackVert.png</file>
<file>Images/treeDownTriangleBlack.png</file>
<file>Images/treeDownTriangleWhite.png</file>
<file>Images/treeRightTriangleBlack.png</file>
diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css
index 174830b..76b31fc 100644
--- a/WebCore/inspector/front-end/inspector.css
+++ b/WebCore/inspector/front-end/inspector.css
@@ -29,8 +29,11 @@
body {
cursor: default;
- height: 100%;
- width: 100%;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
overflow: hidden;
font-family: Lucida Grande, sans-serif;
font-size: 10px;
@@ -1348,7 +1351,6 @@ body.inactive .placard.selected {
margin: 0;
padding: 2px 6px 3px;
list-style: none;
- background-color: white;
min-height: 18px;
}
@@ -3812,3 +3814,21 @@ ol.breakpoint-list {
outline: none !important;
-webkit-user-modify: read-write;
}
+
+.source-frame-popover-title {
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+ font-weight: bold;
+ padding-left: 18px;
+}
+
+.source-frame-popover-tree {
+ border-top: 1px solid rgb(190, 190, 190);
+ overflow: auto;
+ position: absolute;
+ top: 15px;
+ bottom: 0;
+ left: 0;
+ right: 0;
+}
diff --git a/WebCore/inspector/front-end/inspector.html b/WebCore/inspector/front-end/inspector.html
index 4ddd10e..85633b5 100644
--- a/WebCore/inspector/front-end/inspector.html
+++ b/WebCore/inspector/front-end/inspector.html
@@ -30,9 +30,10 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="audits.css">
- <link rel="stylesheet" type="text/css" href="textViewer.css">
<link rel="stylesheet" type="text/css" href="inspector.css">
<link rel="stylesheet" type="text/css" href="inspectorSyntaxHighlight.css">
+ <link rel="stylesheet" type="text/css" href="popover.css">
+ <link rel="stylesheet" type="text/css" href="textViewer.css">
<script type="text/javascript" src="utilities.js"></script>
<script type="text/javascript" src="treeoutline.js"></script>
<script type="text/javascript" src="inspector.js"></script>
@@ -43,7 +44,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="ContextMenu.js"></script>
<script type="text/javascript" src="KeyboardShortcut.js"></script>
<script type="text/javascript" src="TextPrompt.js"></script>
- <script type="text/javascript" src="Popup.js"></script>
+ <script type="text/javascript" src="Popover.js"></script>
<script type="text/javascript" src="Placard.js"></script>
<script type="text/javascript" src="View.js"></script>
<script type="text/javascript" src="Callback.js"></script>
diff --git a/WebCore/inspector/front-end/inspectorSyntaxHighlight.css b/WebCore/inspector/front-end/inspectorSyntaxHighlight.css
index 1292f00..0965a5c 100644
--- a/WebCore/inspector/front-end/inspectorSyntaxHighlight.css
+++ b/WebCore/inspector/front-end/inspectorSyntaxHighlight.css
@@ -26,29 +26,29 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
- .webkit-css-comment {
- color: rgb(0, 116, 0);
- }
+.webkit-css-comment {
+ color: rgb(0, 116, 0);
+}
- .webkit-css-url, .webkit-css-color, .webkit-css-string, .webkit-css-keyword {
- color: rgb(7, 144, 154);
+.webkit-css-url, .webkit-css-color, .webkit-css-string, .webkit-css-keyword {
+ color: rgb(7, 144, 154);
}
- .webkit-css-number {
- color: rgb(50, 0, 255);
- }
+.webkit-css-number {
+ color: rgb(50, 0, 255);
+}
- .webkit-css-property, .webkit-css-at-rule {
- color: rgb(200, 0, 0);
- }
+.webkit-css-property, .webkit-css-at-rule {
+ color: rgb(200, 0, 0);
+}
- .webkit-css-selector {
- rgb(0, 0, 0);
- }
+.webkit-css-selector {
+ color: black;
+}
- .webkit-css-important {
- color: rgb(200, 0, 180);
- }
+.webkit-css-important {
+ color: rgb(200, 0, 180);
+}
.webkit-javascript-comment {
color: rgb(0, 116, 0);
@@ -66,6 +66,10 @@
color: rgb(196, 26, 22);
}
+.webkit-javascript-ident {
+ color: black;
+}
+
.webkit-html-comment {
/* Keep this in sync with view-source.css (.webkit-html-comment) */
color: rgb(35, 110, 37);
diff --git a/WebCore/inspector/front-end/popover.css b/WebCore/inspector/front-end/popover.css
new file mode 100644
index 0000000..ae6f610
--- /dev/null
+++ b/WebCore/inspector/front-end/popover.css
@@ -0,0 +1,200 @@
+.popover {
+ position: absolute;
+ -webkit-border-image: url(Images/popoverBackground.png) 25 25 25 25;
+ border-width: 25px;
+ z-index: 100;
+ pointer-events: none;
+}
+
+.popover .content {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ pointer-events: auto;
+ overflow: auto;
+}
+
+.popover .arrow {
+ position: absolute;
+ background-image: url(Images/popoverArrows.png);
+ width: 19px;
+ height: 19px;
+ margin-left: 15px;
+ margin-top: -25px;
+ top: 0;
+ left: 0;
+}
+
+.popover.top-left-arrow .arrow {
+ /* The default is top-left, no styles needed. */
+}
+
+.popover.top-right-arrow .arrow {
+ right: 25px;
+ left: auto;
+}
+
+.popover.bottom-left-arrow .arrow {
+ top: auto;
+ bottom: 0;
+ margin-top: 0;
+ margin-bottom: -25px;
+ background-position: 0 -19px;
+}
+
+.popover.bottom-right-arrow .arrow {
+ right: 15px;
+ left: auto;
+ top: auto;
+ bottom: 0;
+ margin-top: 0;
+ margin-bottom: -25px;
+ background-position: 0 -19px;
+}
+
+.popover.left-top-arrow .arrow {
+ top: 0;
+ margin-top: 15px;
+ margin-left: -25px;
+ background-position: 0 -38px;
+}
+
+.popover.left-bottom-arrow .arrow {
+ top: auto;
+ bottom: 0;
+ margin-bottom: 15px;
+ margin-left: -25px;
+ background-position: 0 -38px;
+}
+
+.popover.right-top-arrow .arrow {
+ right: 0;
+ left: auto;
+ top: 0;
+ margin-top: 15px;
+ margin-right: -25px;
+ background-position: 0 -57px;
+}
+
+.popover.right-bottom-arrow .arrow {
+ right: 0;
+ left: auto;
+ top: auto;
+ bottom: 0;
+ margin-bottom: 15px;
+ margin-right: -25px;
+ background-position: 0 -57px;
+}
+
+.popover ::-webkit-scrollbar {
+ width: 11px;
+ height: 11px;
+}
+
+.popover ::-webkit-scrollbar-corner {
+ display: none;
+}
+
+.popover ::-webkit-resizer {
+ display: none;
+}
+
+/* Horizontal Scrollbar Styles */
+
+.popover ::-webkit-scrollbar:horizontal:corner-present {
+ border-right-width: 0;
+}
+
+.popover ::-webkit-scrollbar-thumb:horizontal {
+ -webkit-border-image: url(Images/thumbHoriz.png) 0 11 0 11;
+ border-color: transparent;
+ border-width: 0 11px;
+ min-width: 20px;
+}
+
+.popover ::-webkit-scrollbar-thumb:horizontal:hover {
+ -webkit-border-image: url(Images/thumbHoverHoriz.png) 0 11 0 11;
+}
+
+.popover ::-webkit-scrollbar-thumb:horizontal:active {
+ -webkit-border-image: url(Images/thumbActiveHoriz.png) 0 11 0 11;
+}
+
+.popover ::-webkit-scrollbar-track-piece:horizontal:start {
+ margin-left: 5px;
+}
+
+.popover ::-webkit-scrollbar-track-piece:horizontal:end {
+ margin-right: 5px;
+}
+
+.popover ::-webkit-scrollbar-track-piece:horizontal:end:corner-present {
+ margin-right: 4px;
+}
+
+.popover ::-webkit-scrollbar-track-piece:horizontal:decrement {
+ -webkit-border-image: url(Images/trackHoriz.png) 0 11 0 11;
+ border-color: transparent;
+ border-width: 0 0 0 11px;
+}
+
+.popover ::-webkit-scrollbar-track-piece:horizontal:increment {
+ -webkit-border-image: url(Images/trackHoriz.png) 0 11 0 11;
+ border-color: transparent;
+ border-width: 0 11px 0 0;
+}
+
+/* Vertical Scrollbar Styles */
+
+
+.popover ::-webkit-scrollbar:vertical:corner-present {
+ border-bottom-width: 0;
+}
+
+.popover ::-webkit-scrollbar-thumb:vertical {
+ -webkit-border-image: url(Images/thumbVert.png) 11 0 11 0;
+ border-color: transparent;
+ border-width: 11px 0;
+ min-height: 20px;
+}
+
+.popover ::-webkit-scrollbar-thumb:vertical:hover {
+ -webkit-border-image: url(Images/thumbHoverVert.png) 11 0 11 0;
+}
+
+.popover ::-webkit-scrollbar-thumb:vertical:active {
+ -webkit-border-image: url(Images/thumbActiveVert.png) 11 0 11 0;
+}
+
+
+.popover ::-webkit-scrollbar-track-piece:vertical:start {
+ margin-top: 5px;
+}
+
+.popover ::-webkit-scrollbar-track-piece:vertical:end {
+ margin-bottom: 5px;
+}
+
+.popover ::-webkit-scrollbar-track-piece:vertical:end:corner-present {
+ margin-bottom: 4px;
+}
+
+.popover ::-webkit-scrollbar-track-piece:vertical:decrement {
+ -webkit-border-image: url(Images/trackVert.png) 11 0 11 0;
+ border-color: transparent;
+ border-width: 11px 0 0 0;
+}
+
+.popover ::-webkit-scrollbar-track-piece:vertical:increment {
+ -webkit-border-image: url(Images/trackVert.png) 11 0 11 0;
+ border-color: transparent;
+ border-width: 0 0 11px 0;
+}
+
+/* Forced Scrollbar Mode Styles */
+
+.popover ::-webkit-scrollbar-button {
+ display: none;
+}
diff --git a/WebCore/inspector/front-end/utilities.js b/WebCore/inspector/front-end/utilities.js
index 80bb73b..f30ab9f 100644
--- a/WebCore/inspector/front-end/utilities.js
+++ b/WebCore/inspector/front-end/utilities.js
@@ -271,7 +271,7 @@ Element.prototype.__defineGetter__("totalOffsetLeft", function()
{
var total = 0;
for (var element = this; element; element = element.offsetParent)
- total += element.offsetLeft;
+ total += element.offsetLeft + (this !== element ? element.clientLeft : 0);
return total;
});
@@ -279,7 +279,7 @@ Element.prototype.__defineGetter__("totalOffsetTop", function()
{
var total = 0;
for (var element = this; element; element = element.offsetParent)
- total += element.offsetTop;
+ total += element.offsetTop + (this !== element ? element.clientTop : 0);
return total;
});
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list