[webkit-reviews] review granted: [Bug 195146] Web Inspector: View.removeSubview not removing the element properly when not parented : [Attachment 363193] [PATCH] Proposed Fix

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 28 00:30:08 PST 2019


Matt Baker <mattbaker at apple.com> has granted Joseph Pecoraro
<joepeck at webkit.org>'s request for review:
Bug 195146: Web Inspector: View.removeSubview not removing the element properly
when not parented
https://bugs.webkit.org/show_bug.cgi?id=195146

Attachment 363193: [PATCH] Proposed Fix

https://bugs.webkit.org/attachment.cgi?id=363193&action=review




--- Comment #2 from Matt Baker <mattbaker at apple.com> ---
Comment on attachment 363193
  --> https://bugs.webkit.org/attachment.cgi?id=363193
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=363193&action=review

> Source/WebInspectorUI/ChangeLog:10
> +	   Since the element may not be a direct child, just use
Element.prototype.remove.

Nice fix!

I think we should add an assertion around View.js:110, before we try to insert
the child view's DOM element:

console.assert(!view.element.parentNode ||
this._element.contains(view.element.parentNode), "Subview DOM element must be a
descendant of the parent view element.");

This can balance the assertion at the top of View.removeSubview.


More information about the webkit-reviews mailing list