Changeset 151704 in webkit
- Timestamp:
- Jun 18, 2013, 3:44:24 PM (12 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r151688 r151704 1 2013-06-18 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Infrequent uncaught exception with debugger popovers breaks inspector 4 https://bugs.webkit.org/show_bug.cgi?id=117755 5 6 Create the ZERO_SIZE and ZERO_RECT objects after we've setup the Size 7 and Rect prototypes, so they get the expected methods. We then need to 8 handle the ZERO_RECT case better, and not attempt to draw a background 9 in a canvas with a 0 size, which would produce an exception. 10 11 Reviewed by Timothy Hatcher. 12 13 * UserInterface/Geometry.js: 14 * UserInterface/Popover.js: 15 (WebInspector.Popover.prototype._update): 16 1 17 2013-06-18 Timothy Hatcher <timothy@apple.com> 2 18 -
trunk/Source/WebInspectorUI/UserInterface/Geometry.js
r151453 r151704 66 66 }; 67 67 68 WebInspector.Size.ZERO_SIZE = new WebInspector.Size(0, 0);69 70 68 WebInspector.Size.prototype = { 71 69 constructor: WebInspector.Size, … … 87 85 }; 88 86 87 WebInspector.Size.ZERO_SIZE = new WebInspector.Size(0, 0); 88 89 89 90 WebInspector.Rect = function(x, y, width, height) 90 91 { … … 92 93 this.size = new WebInspector.Size(width || 0, height || 0); 93 94 }; 94 95 WebInspector.Rect.ZERO_RECT = new WebInspector.Rect(0, 0, 0, 0);96 95 97 96 WebInspector.Rect.rectFromClientRect = function(clientRect) … … 177 176 }; 178 177 178 WebInspector.Rect.ZERO_RECT = new WebInspector.Rect(0, 0, 0, 0); 179 180 179 181 WebInspector.EdgeInsets = function(top, right, bottom, left) 180 182 { -
trunk/Source/WebInspectorUI/UserInterface/Popover.js
r151453 r151704 218 218 var anchorPoint; 219 219 var bestFrame = bestMetrics.frame; 220 switch (bestEdge) {221 case WebInspector.RectEdge.MIN_X: // Displayed on the left of the target, arrow points right.222 anchorPoint = new WebInspector.Point(bestFrame.size.width - WebInspector.Popover.ShadowPadding, targetFrame.midY() - bestFrame.minY());223 break;224 case WebInspector.RectEdge.MAX_X: // Displayed on the right of the target, arrow points left.225 anchorPoint = new WebInspector.Point(WebInspector.Popover.ShadowPadding, targetFrame.midY() - bestFrame.minY());226 break;227 case WebInspector.RectEdge.MIN_Y: // Displayed above the target, arrow points down.228 anchorPoint = new WebInspector.Point(targetFrame.midX() - bestFrame.minX(), bestFrame.size.height - WebInspector.Popover.ShadowPadding);229 break;230 case WebInspector.RectEdge.MAX_Y: // Displayed below the target, arrow points up.231 anchorPoint = new WebInspector.Point(targetFrame.midX() - bestFrame.minX(), WebInspector.Popover.ShadowPadding);232 break;233 }234 220 235 221 var needsToDrawBackground = !this._frame.size.equals(bestFrame.size) || this._edge !== bestEdge; … … 238 224 this._edge = bestEdge; 239 225 240 this._element.classList.add(this._cssClassNameForEdge()); 241 242 if (needsToDrawBackground) 243 this._drawBackground(bestEdge, anchorPoint); 244 245 // Make sure content is centered in case either of the dimension is smaller than the minimal bounds. 246 if (this._preferredSize.width < WebInspector.Popover.MinWidth || this._preferredSize.height < WebInspector.Popover.MinHeight) 247 this._container.classList.add("center"); 248 else 249 this._container.classList.remove("center"); 250 226 if (this.frame === WebInspector.Rect.ZERO_RECT) { 227 // The target for the popover is offscreen. 228 this.dismiss(); 229 } else { 230 switch (bestEdge) { 231 case WebInspector.RectEdge.MIN_X: // Displayed on the left of the target, arrow points right. 232 anchorPoint = new WebInspector.Point(bestFrame.size.width - WebInspector.Popover.ShadowPadding, targetFrame.midY() - bestFrame.minY()); 233 break; 234 case WebInspector.RectEdge.MAX_X: // Displayed on the right of the target, arrow points left. 235 anchorPoint = new WebInspector.Point(WebInspector.Popover.ShadowPadding, targetFrame.midY() - bestFrame.minY()); 236 break; 237 case WebInspector.RectEdge.MIN_Y: // Displayed above the target, arrow points down. 238 anchorPoint = new WebInspector.Point(targetFrame.midX() - bestFrame.minX(), bestFrame.size.height - WebInspector.Popover.ShadowPadding); 239 break; 240 case WebInspector.RectEdge.MAX_Y: // Displayed below the target, arrow points up. 241 anchorPoint = new WebInspector.Point(targetFrame.midX() - bestFrame.minX(), WebInspector.Popover.ShadowPadding); 242 break; 243 } 244 245 this._element.classList.add(this._cssClassNameForEdge()); 246 247 if (needsToDrawBackground) 248 this._drawBackground(bestEdge, anchorPoint); 249 250 // Make sure content is centered in case either of the dimension is smaller than the minimal bounds. 251 if (this._preferredSize.width < WebInspector.Popover.MinWidth || this._preferredSize.height < WebInspector.Popover.MinHeight) 252 this._container.classList.add("center"); 253 else 254 this._container.classList.remove("center"); 255 } 256 251 257 // Wrap the content in the container so that it's located correctly. 252 258 if (this._contentNeedsUpdate) {
Note:
See TracChangeset
for help on using the changeset viewer.