Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(764)

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/Widget.js

Issue 2190213002: DevTools: measure should not destroy elements hierarchy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui/Widget.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Widget.js b/third_party/WebKit/Source/devtools/front_end/ui/Widget.js
index 8866bcbbb9a657a22e65854575a88dfd4239d2c0..285875b0a2d3c1f7c6402ae9e02d9e0de331c96e 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/Widget.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Widget.js
@@ -460,11 +460,18 @@ WebInspector.Widget.prototype = {
measurePreferredSize: function()
{
var document = this.element.ownerDocument;
+ var oldParent = this.element.parentElement;
+ var oldNextSibling = this.element.nextSibling;
+
WebInspector.Widget._originalAppendChild.call(document.body, this.element);
this.element.positionAt(0, 0);
var result = new Size(this.element.offsetWidth, this.element.offsetHeight);
+
this.element.positionAt(undefined, undefined);
- WebInspector.Widget._originalRemoveChild.call(document.body, this.element);
+ if (oldParent)
+ WebInspector.Widget._originalInsertBefore.call(oldParent, this.element, oldNextSibling);
+ else
+ WebInspector.Widget._originalRemoveChild.call(document.body, this.element);
return result;
},
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698