Changeset 242241 in webkit
- Timestamp:
- Feb 28, 2019 4:48:01 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r242237 r242241 1 2019-02-28 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: View.removeSubview not removing the element properly when not parented 4 https://bugs.webkit.org/show_bug.cgi?id=195146 5 6 Reviewed by Matt Baker. 7 8 * inspector/view/basics-expected.txt: 9 * inspector/view/basics.html: 10 1 11 2019-02-28 Myles C. Maxfield <mmaxfield@apple.com> 2 12 -
trunk/LayoutTests/inspector/view/basics-expected.txt
r223011 r242241 32 32 PASS: Removing a nonexistent view should have no effect. 33 33 34 -- Running test case: View.removeSubview.IndirectDescendant 35 PASS: Removed view should not be in the DOM. 36 34 37 -- Running test case: View.insertSubviewBefore 35 38 PASS: Inserting a view before `null` should append the view. -
trunk/LayoutTests/inspector/view/basics.html
r223011 r242241 77 77 parent.removeSubview(new WI.View); 78 78 InspectorTest.expectShallowEqual(previousSubviews, parent.subviews, "Removing a nonexistent view should have no effect.") 79 80 return true; 81 } 82 }); 83 84 suite.addTestCase({ 85 name: "View.removeSubview.IndirectDescendant", 86 test() { 87 let parent = new WI.View; 88 let middleElement = parent.element.appendChild(document.createElement("div")); 89 90 let child = new WI.View; 91 middleElement.appendChild(child.element); 92 93 parent.addSubview(child); 94 parent.removeSubview(child); 95 96 InspectorTest.expectFalse(child.element.parentNode, "Removed view should not be in the DOM."); 79 97 80 98 return true; -
trunk/Source/WebInspectorUI/ChangeLog
r242228 r242241 1 2019-02-28 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: View.removeSubview not removing the element properly when not parented 4 https://bugs.webkit.org/show_bug.cgi?id=195146 5 6 Reviewed by Matt Baker. 7 8 * UserInterface/Views/View.js: 9 (WI.View.prototype.removeSubview): 10 Since the element may not be a direct child, just use Element.prototype.remove. 11 1 12 2019-02-28 Matt Baker <mattbaker@apple.com> 2 13 -
trunk/Source/WebInspectorUI/UserInterface/Views/View.js
r242073 r242241 109 109 this._subviews.insertAtIndex(view, beforeIndex); 110 110 111 console.assert(!view.element.parentNode || this._element.contains(view.element.parentNode), "Subview DOM element must be a descendant of the parent view element."); 111 112 if (!view.element.parentNode) 112 113 this._element.insertBefore(view.element, referenceView ? referenceView.element : null); … … 127 128 128 129 this._subviews.splice(index, 1); 129 this._element.removeChild(view.element);130 view.element.remove(); 130 131 131 132 view._didMoveToParent(null);
Note: See TracChangeset
for help on using the changeset viewer.