| 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 this._hideWidget(true); | 365 this._hideWidget(true); |
| 366 | 366 |
| 367 // Update widget hierarchy. | 367 // Update widget hierarchy. |
| 368 if (this._parentWidget) { | 368 if (this._parentWidget) { |
| 369 var childIndex = this._parentWidget._children.indexOf(this); | 369 var childIndex = this._parentWidget._children.indexOf(this); |
| 370 UI.Widget.__assert(childIndex >= 0, 'Attempt to remove non-child widget'); | 370 UI.Widget.__assert(childIndex >= 0, 'Attempt to remove non-child widget'); |
| 371 this._parentWidget._children.splice(childIndex, 1); | 371 this._parentWidget._children.splice(childIndex, 1); |
| 372 if (this._parentWidget._defaultFocusedChild === this) | 372 if (this._parentWidget._defaultFocusedChild === this) |
| 373 this._parentWidget._defaultFocusedChild = null; | 373 this._parentWidget._defaultFocusedChild = null; |
| 374 this._parentWidget.childWasDetached(this); | 374 this._parentWidget.childWasDetached(this); |
| 375 var parent = this._parentWidget; | |
| 376 this._parentWidget = null; | 375 this._parentWidget = null; |
| 377 this._processWasDetachedFromHierarchy(); | 376 this._processWasDetachedFromHierarchy(); |
| 378 } else { | 377 } else { |
| 379 UI.Widget.__assert(this._isRoot, 'Removing non-root widget from DOM'); | 378 UI.Widget.__assert(this._isRoot, 'Removing non-root widget from DOM'); |
| 380 } | 379 } |
| 381 } | 380 } |
| 382 | 381 |
| 383 detachChildWidgets() { | 382 detachChildWidgets() { |
| 384 var children = this._children.slice(); | 383 var children = this._children.slice(); |
| 385 for (var i = 0; i < children.length; ++i) | 384 for (var i = 0; i < children.length; ++i) |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 UI.Widget.__assert( | 746 UI.Widget.__assert( |
| 748 !child.__widgetCounter && !child.__widget, | 747 !child.__widgetCounter && !child.__widget, |
| 749 'Attempt to remove element containing widget via regular DOM operation'); | 748 'Attempt to remove element containing widget via regular DOM operation'); |
| 750 return UI.Widget._originalRemoveChild.call(this, child); | 749 return UI.Widget._originalRemoveChild.call(this, child); |
| 751 }; | 750 }; |
| 752 | 751 |
| 753 Element.prototype.removeChildren = function() { | 752 Element.prototype.removeChildren = function() { |
| 754 UI.Widget.__assert(!this.__widgetCounter, 'Attempt to remove element containin
g widget via regular DOM operation'); | 753 UI.Widget.__assert(!this.__widgetCounter, 'Attempt to remove element containin
g widget via regular DOM operation'); |
| 755 UI.Widget._originalRemoveChildren.call(this); | 754 UI.Widget._originalRemoveChildren.call(this); |
| 756 }; | 755 }; |
| OLD | NEW |