| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 var activeElement = this.element.ownerDocument.activeElement; | 453 var activeElement = this.element.ownerDocument.activeElement; |
| 454 return activeElement && activeElement.isSelfOrDescendant(this.element); | 454 return activeElement && activeElement.isSelfOrDescendant(this.element); |
| 455 }, | 455 }, |
| 456 | 456 |
| 457 /** | 457 /** |
| 458 * @return {!Size} | 458 * @return {!Size} |
| 459 */ | 459 */ |
| 460 measurePreferredSize: function() | 460 measurePreferredSize: function() |
| 461 { | 461 { |
| 462 var document = this.element.ownerDocument; | 462 var document = this.element.ownerDocument; |
| 463 var oldParent = this.element.parentElement; |
| 464 var oldNextSibling = this.element.nextSibling; |
| 465 |
| 463 WebInspector.Widget._originalAppendChild.call(document.body, this.elemen
t); | 466 WebInspector.Widget._originalAppendChild.call(document.body, this.elemen
t); |
| 464 this.element.positionAt(0, 0); | 467 this.element.positionAt(0, 0); |
| 465 var result = new Size(this.element.offsetWidth, this.element.offsetHeigh
t); | 468 var result = new Size(this.element.offsetWidth, this.element.offsetHeigh
t); |
| 469 |
| 466 this.element.positionAt(undefined, undefined); | 470 this.element.positionAt(undefined, undefined); |
| 467 WebInspector.Widget._originalRemoveChild.call(document.body, this.elemen
t); | 471 if (oldParent) |
| 472 WebInspector.Widget._originalInsertBefore.call(oldParent, this.eleme
nt, oldNextSibling); |
| 473 else |
| 474 WebInspector.Widget._originalRemoveChild.call(document.body, this.el
ement); |
| 468 return result; | 475 return result; |
| 469 }, | 476 }, |
| 470 | 477 |
| 471 /** | 478 /** |
| 472 * @return {!Constraints} | 479 * @return {!Constraints} |
| 473 */ | 480 */ |
| 474 calculateConstraints: function() | 481 calculateConstraints: function() |
| 475 { | 482 { |
| 476 return new Constraints(); | 483 return new Constraints(); |
| 477 }, | 484 }, |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 { | 792 { |
| 786 WebInspector.Widget.__assert(!child.__widgetCounter && !child.__widget, "Att
empt to remove element containing widget via regular DOM operation"); | 793 WebInspector.Widget.__assert(!child.__widgetCounter && !child.__widget, "Att
empt to remove element containing widget via regular DOM operation"); |
| 787 return WebInspector.Widget._originalRemoveChild.call(this, child); | 794 return WebInspector.Widget._originalRemoveChild.call(this, child); |
| 788 } | 795 } |
| 789 | 796 |
| 790 Element.prototype.removeChildren = function() | 797 Element.prototype.removeChildren = function() |
| 791 { | 798 { |
| 792 WebInspector.Widget.__assert(!this.__widgetCounter, "Attempt to remove eleme
nt containing widget via regular DOM operation"); | 799 WebInspector.Widget.__assert(!this.__widgetCounter, "Attempt to remove eleme
nt containing widget via regular DOM operation"); |
| 793 WebInspector.Widget._originalRemoveChildren.call(this); | 800 WebInspector.Widget._originalRemoveChildren.call(this); |
| 794 } | 801 } |
| OLD | NEW |