Title: [159286] trunk/Source/WebInspectorUI
Revision
159286
Author
grao...@apple.com
Date
2013-11-14 08:03:30 -0800 (Thu, 14 Nov 2013)

Log Message

Web Inspector: Popovers may shrink unnecessarily
https://bugs.webkit.org/show_bug.cgi?id=124350

Reviewed by Timothy Hatcher.

Because we always get the intersection of the preferred frame and the container frame to
ensure the popover fits within its container based on a preferred frame that would place
the arrow within the center of the attachment edge, we get in situations where we may
shrink the popover instead of shifting it to fit within the container frame. We now first
shift the preferred frame before getting its intersection with the container frame to
avoid such situations.

* UserInterface/Popover.js:
(WebInspector.Popover.prototype._bestMetricsForEdge):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (159285 => 159286)


--- trunk/Source/WebInspectorUI/ChangeLog	2013-11-14 15:38:12 UTC (rev 159285)
+++ trunk/Source/WebInspectorUI/ChangeLog	2013-11-14 16:03:30 UTC (rev 159286)
@@ -1,3 +1,20 @@
+2013-11-14  Antoine Quint  <grao...@apple.com>
+
+        Web Inspector: Popovers may shrink unnecessarily
+        https://bugs.webkit.org/show_bug.cgi?id=124350
+
+        Reviewed by Timothy Hatcher.
+
+        Because we always get the intersection of the preferred frame and the container frame to
+        ensure the popover fits within its container based on a preferred frame that would place
+        the arrow within the center of the attachment edge, we get in situations where we may
+        shrink the popover instead of shifting it to fit within the container frame. We now first
+        shift the preferred frame before getting its intersection with the container frame to
+        avoid such situations. 
+
+        * UserInterface/Popover.js:
+        (WebInspector.Popover.prototype._bestMetricsForEdge):
+
 2013-11-13  Joseph Pecoraro  <pecor...@apple.com>
 
         Web Inspector: Split Inspector.json into individual domain json files

Modified: trunk/Source/WebInspectorUI/UserInterface/Popover.js (159285 => 159286)


--- trunk/Source/WebInspectorUI/UserInterface/Popover.js	2013-11-14 15:38:12 UTC (rev 159285)
+++ trunk/Source/WebInspectorUI/UserInterface/Popover.js	2013-11-14 16:03:30 UTC (rev 159286)
@@ -394,6 +394,15 @@
             break;
         }
 
+        if (x < containerFrame.minX())
+            x = containerFrame.minX(); 
+        if (y < containerFrame.minY())
+            y = containerFrame.minY();
+        if (x + width > containerFrame.maxX())
+            x += containerFrame.maxX() - (x + width);
+        if (y + height > containerFrame.maxY())
+            y += containerFrame.maxY() - (y + height);
+
         var preferredFrame = new WebInspector.Rect(x, y, width, height);
         var bestFrame = preferredFrame.intersectionWithRect(containerFrame);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to