Modified: branches/safari-602.1.32-branch/Source/WebInspectorUI/ChangeLog (201008 => 201009)
--- branches/safari-602.1.32-branch/Source/WebInspectorUI/ChangeLog 2016-05-17 08:47:11 UTC (rev 201008)
+++ branches/safari-602.1.32-branch/Source/WebInspectorUI/ChangeLog 2016-05-17 08:47:13 UTC (rev 201009)
@@ -1,5 +1,28 @@
2016-05-17 Babak Shafiei <[email protected]>
+ Merge r200792. rdar://problem/26253394
+
+ 2016-05-12 Joseph Pecoraro <[email protected]>
+
+ Web Inspector: Layout timeline popovers are inconsistently shown
+ https://bugs.webkit.org/show_bug.cgi?id=157640
+ <rdar://problem/26253394>
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Views/TimelineDataGrid.js:
+ (WebInspector.TimelineDataGrid.prototype._showPopoverForSelectedNodeSoon):
+ Fix the bug by clearing _showPopoverTimeout when we show the popover.
+
+ (WebInspector.TimelineDataGrid.prototype._hidePopover):
+ Modernize the code to use arrow functions and avoid binds.
+
+ (WebInspector.TimelineDataGrid.prototype._updatePopoverForSelectedNode):
+ Updating with presentNewContentWithFrame animates the popover to the correct
+ position instead of jumping and ending up at the wrong location.
+
+2016-05-17 Babak Shafiei <[email protected]>
+
Merge r200708. rdar://problem/26228913
2016-05-11 Joseph Pecoraro <[email protected]>
Modified: branches/safari-602.1.32-branch/Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.js (201008 => 201009)
--- branches/safari-602.1.32-branch/Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.js 2016-05-17 08:47:11 UTC (rev 201008)
+++ branches/safari-602.1.32-branch/Source/WebInspectorUI/UserInterface/Views/TimelineDataGrid.js 2016-05-17 08:47:13 UTC (rev 201009)
@@ -450,15 +450,12 @@
if (this._showPopoverTimeout)
return;
- function delayedWork()
- {
+ this._showPopoverTimeout = setTimeout(() => {
if (!this._popover)
this._popover = new WebInspector.Popover;
-
this._updatePopoverForSelectedNode(true);
- }
-
- this._showPopoverTimeout = setTimeout(delayedWork.bind(this), WebInspector.TimelineDataGrid.DelayedPopoverShowTimeout);
+ this._showPopoverTimeout = undefined;
+ }, WebInspector.TimelineDataGrid.DelayedPopoverShowTimeout);
}
_hidePopover()
@@ -471,15 +468,13 @@
if (this._popover)
this._popover.dismiss();
- function delayedWork()
- {
- if (this._popoverCallStackTreeOutline)
- this._popoverCallStackTreeOutline.removeChildren();
- }
-
if (this._hidePopoverContentClearTimeout)
clearTimeout(this._hidePopoverContentClearTimeout);
- this._hidePopoverContentClearTimeout = setTimeout(delayedWork.bind(this), WebInspector.TimelineDataGrid.DelayedPopoverHideContentClearTimeout);
+
+ this._hidePopoverContentClearTimeout = setTimeout(() => {
+ if (this._popoverCallStackTreeOutline)
+ this._popoverCallStackTreeOutline.removeChildren();
+ }, WebInspector.TimelineDataGrid.DelayedPopoverHideContentClearTimeout);
}
_updatePopoverForSelectedNode(updateContent)
@@ -487,15 +482,14 @@
if (!this._popover || !this.selectedNode)
return;
- var targetPopoverElement = this.callFramePopoverAnchorElement();
+ let targetPopoverElement = this.callFramePopoverAnchorElement();
console.assert(targetPopoverElement, "TimelineDataGrid subclass should always return a valid element from callFramePopoverAnchorElement.");
if (!targetPopoverElement)
return;
- var targetFrame = WebInspector.Rect.rectFromClientRect(targetPopoverElement.getBoundingClientRect());
-
// The element might be hidden if it does not have a width and height.
- if (!targetFrame.size.width && !targetFrame.size.height)
+ let rect = WebInspector.Rect.rectFromClientRect(targetPopoverElement.getBoundingClientRect());
+ if (!rect.size.width && !targetFrame.rect.height)
return;
if (this._hidePopoverContentClearTimeout) {
@@ -503,10 +497,13 @@
this._hidePopoverContentClearTimeout = undefined;
}
- if (updateContent)
- this._popover.content = this._createPopoverContent();
+ let targetFrame = rect.pad(2);
+ let preferredEdges = [WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MIN_Y, WebInspector.RectEdge.MAX_X];
- this._popover.present(targetFrame.pad(2), [WebInspector.RectEdge.MAX_Y, WebInspector.RectEdge.MIN_Y, WebInspector.RectEdge.MAX_X]);
+ if (updateContent)
+ this._popover.presentNewContentWithFrame(this._createPopoverContent(), targetFrame, preferredEdges);
+ else
+ this._popover.present(targetFrame, preferredEdges);
}
_createPopoverContent()
@@ -548,8 +545,6 @@
}
};
-WebInspector.TimelineDataGrid.WasExpandedDuringFilteringSymbol = Symbol("was-expanded-during-filtering");
-
WebInspector.TimelineDataGrid.HasNonDefaultFilterStyleClassName = "has-non-default-filter";
WebInspector.TimelineDataGrid.DelayedPopoverShowTimeout = 250;
WebInspector.TimelineDataGrid.DelayedPopoverHideContentClearTimeout = 500;