Title: [108061] trunk/Source/WebCore
Revision
108061
Author
[email protected]
Date
2012-02-17 04:28:46 -0800 (Fri, 17 Feb 2012)

Log Message

Web Inspector: new image preview has poorly positioned popover arrow.
https://bugs.webkit.org/show_bug.cgi?id=78884

Reviewed by Vsevolod Vlasov.

* inspector/front-end/Popover.js:
(WebInspector.Popover.prototype._positionElement):
* inspector/front-end/utilities.js:
(Element.prototype.boxInWindow):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (108060 => 108061)


--- trunk/Source/WebCore/ChangeLog	2012-02-17 12:23:06 UTC (rev 108060)
+++ trunk/Source/WebCore/ChangeLog	2012-02-17 12:28:46 UTC (rev 108061)
@@ -1,5 +1,17 @@
 2012-02-17  Pavel Feldman  <[email protected]>
 
+        Web Inspector: new image preview has poorly positioned popover arrow.
+        https://bugs.webkit.org/show_bug.cgi?id=78884
+
+        Reviewed by Vsevolod Vlasov.
+
+        * inspector/front-end/Popover.js:
+        (WebInspector.Popover.prototype._positionElement):
+        * inspector/front-end/utilities.js:
+        (Element.prototype.boxInWindow):
+
+2012-02-17  Pavel Feldman  <[email protected]>
+
         Web Inspector: enable "Single click CSS editing" experiment by default.
         https://bugs.webkit.org/show_bug.cgi?id=78881
 

Modified: trunk/Source/WebCore/inspector/front-end/Popover.js (108060 => 108061)


--- trunk/Source/WebCore/inspector/front-end/Popover.js	2012-02-17 12:23:06 UTC (rev 108060)
+++ trunk/Source/WebCore/inspector/front-end/Popover.js	2012-02-17 12:28:46 UTC (rev 108061)
@@ -152,6 +152,7 @@
             // Position arrow accurately.
             var arrowRightPosition = Math.max(0, totalWidth - anchorBox.x - anchorBox.width - borderRadius - arrowOffset);
             arrowRightPosition += anchorBox.width / 2;
+            arrowRightPosition = Math.min(arrowRightPosition, newElementPosition.width - borderRadius - arrowOffset);
             this._popupArrowElement.style.right = arrowRightPosition + "px";
         } else {
             newElementPosition.x = borderRadius;

Modified: trunk/Source/WebCore/inspector/front-end/utilities.js (108060 => 108061)


--- trunk/Source/WebCore/inspector/front-end/utilities.js	2012-02-17 12:23:06 UTC (rev 108060)
+++ trunk/Source/WebCore/inspector/front-end/utilities.js	2012-02-17 12:28:46 UTC (rev 108061)
@@ -342,8 +342,8 @@
     targetWindow = targetWindow || this.ownerDocument.defaultView;
 
     var anchorBox = this.offsetRelativeToWindow(window);
-    anchorBox.width = this.offsetWidth;
-    anchorBox.height = this.offsetHeight;
+    anchorBox.width = Math.min(this.offsetWidth, window.innerWidth - anchorBox.x);
+    anchorBox.height = Math.min(this.offsetHeight, window.innerHeight - anchorBox.y);
 
     return anchorBox;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to