Changeset 212647 in webkit
- Timestamp:
- Feb 20, 2017 9:29:20 AM (7 years ago)
- Location:
- branches/safari-603-branch
- Files:
-
- 6 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-603-branch/LayoutTests/ChangeLog
r212645 r212647 1 2017-02-20 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r212621. rdar://problem/30563318 4 5 2017-02-18 Ryosuke Niwa <rniwa@webkit.org> 6 7 REGRESSION(r212218): Assertion failures in and after parserRemoveChild 8 https://bugs.webkit.org/show_bug.cgi?id=168458 9 10 Reviewed by Antti Koivisto. 11 12 Add tests to make sure parserAppendChild aren't called when a node removed by parserRemoveChild 13 had already been been inserted elsewhere by scripts. 14 15 * fast/parser/adoption-agency-unload-iframe-3-expected.txt: Added. 16 * fast/parser/adoption-agency-unload-iframe-3.html: Added. 17 * fast/parser/adoption-agency-unload-iframe-4-expected.txt: Added. 18 * fast/parser/adoption-agency-unload-iframe-4.html: Added. 19 * fast/parser/xml-error-unload-iframe-expected.txt: Added. 20 * fast/parser/xml-error-unload-iframe.html: Added. 21 1 22 2017-02-20 Matthew Hanson <matthew_hanson@apple.com> 2 23 -
branches/safari-603-branch/Source/WebCore/ChangeLog
r212645 r212647 1 2017-02-20 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r212621. rdar://problem/30563318 4 5 2017-02-18 Ryosuke Niwa <rniwa@webkit.org> 6 7 REGRESSION(r212218): Assertion failures in and after parserRemoveChild 8 https://bugs.webkit.org/show_bug.cgi?id=168458 9 10 Reviewed by Antti Koivisto. 11 12 The bug was caused by parserRemoveChild not preceeding to remove oldChild even when 13 oldChild had been inserted elsewhere during unload evnets of the disconnected frames. 14 Fixed the bug by checking this condition and exiting early. 15 16 Also fixed various callers of parserRemoveChild to not call parserAppendChild when 17 the removed node had already been inserted elsewhere by scripts. 18 19 Tests: fast/parser/adoption-agency-unload-iframe-3.html 20 fast/parser/adoption-agency-unload-iframe-4.html 21 fast/parser/xml-error-unload-iframe.html 22 23 * dom/ContainerNode.cpp: 24 (WebCore::ContainerNode::parserRemoveChild): Exit early when the node had been 25 inserted elsewhere while firing unload events. Also moved the call to 26 notifyRemovePendingSheetIfNeeded outside NoEventDispatchAssertion since it can 27 synchrnously fire a focus event. 28 (WebCore::ContainerNode::parserAppendChild): Moved adoptNode call to inside 29 NoEventDispatchAssertion since adoptNode call here should never mutate DOM. 30 * html/parser/HTMLConstructionSite.cpp: 31 (WebCore::executeReparentTask): Added an early exit when the node had already been 32 inserted elsewhere. 33 (WebCore::executeInsertAlreadyParsedChildTask): Ditto. 34 * xml/XMLErrors.cpp: 35 (WebCore::XMLErrors::insertErrorMessageBlock): Ditto. 36 * xml/parser/XMLDocumentParser.cpp: 37 (WebCore::XMLDocumentParser::end): Fixed a crash unveiled by one of the test cases. 38 Exit early when insertErrorMessageBlock detached the parser (by author scripts). 39 (WebCore::XMLDocumentParser::finish): Keep the parser alive until we exit. 40 1 41 2017-02-20 Matthew Hanson <matthew_hanson@apple.com> 2 42 -
branches/safari-603-branch/Source/WebCore/dom/ContainerNode.cpp
r212600 r212647 599 599 { 600 600 disconnectSubframesIfNeeded(*this, DescendantsOnly); 601 602 NoEventDispatchAssertion assertNoEventDispatch; 603 604 document().nodeChildrenWillBeRemoved(*this); 605 606 ASSERT(oldChild.parentNode() == this); 607 ASSERT(!oldChild.isDocumentFragment()); 608 609 Node* prev = oldChild.previousSibling(); 610 Node* next = oldChild.nextSibling(); 611 612 ChildListMutationScope(*this).willRemoveChild(oldChild); 613 oldChild.notifyMutationObserversNodeWillDetach(); 614 615 removeBetween(prev, next, oldChild); 616 617 notifyChildRemoved(oldChild, prev, next, ChildChangeSourceParser); 618 document().notifyRemovePendingSheetIfNeeded(); 601 if (oldChild.parentNode() != this) 602 return; 603 604 { 605 NoEventDispatchAssertion assertNoEventDispatch; 606 607 document().nodeChildrenWillBeRemoved(*this); 608 609 ASSERT(oldChild.parentNode() == this); 610 ASSERT(!oldChild.isDocumentFragment()); 611 612 Node* prev = oldChild.previousSibling(); 613 Node* next = oldChild.nextSibling(); 614 615 ChildListMutationScope(*this).willRemoveChild(oldChild); 616 oldChild.notifyMutationObserversNodeWillDetach(); 617 618 removeBetween(prev, next, oldChild); 619 620 notifyChildRemoved(oldChild, prev, next, ChildChangeSourceParser); 621 document().notifyRemovePendingSheetIfNeeded(); 622 } 619 623 } 620 624 … … 720 724 ASSERT(!hasTagName(HTMLNames::templateTag)); 721 725 722 if (&document() != &newChild.document())723 document().adoptNode(newChild);724 725 726 { 726 727 NoEventDispatchAssertion assertNoEventDispatch; 728 729 if (&document() != &newChild.document()) 730 document().adoptNode(newChild); 731 727 732 appendChildCommon(newChild); 728 733 treeScope().adoptIfNeeded(newChild); -
branches/safari-603-branch/Source/WebCore/html/parser/HTMLConstructionSite.cpp
r212598 r212647 134 134 parent->parserRemoveChild(*task.child); 135 135 136 if (task.child->parentNode()) 137 return; 138 136 139 task.parent->parserAppendChild(*task.child); 137 140 } … … 140 143 { 141 144 ASSERT(task.operation == HTMLConstructionSiteTask::InsertAlreadyParsedChild); 145 146 if (task.child->parentNode()) 147 return; 142 148 143 149 insert(task); -
branches/safari-603-branch/Source/WebCore/xml/XMLErrors.cpp
r209627 r212647 141 141 142 142 m_document.parserRemoveChild(*documentElement); 143 if (!documentElement->parentNode()) 144 body->parserAppendChild(*documentElement); 143 145 144 body->parserAppendChild(*documentElement);145 146 m_document.parserAppendChild(rootElement); 146 147 -
branches/safari-603-branch/Source/WebCore/xml/parser/XMLDocumentParser.cpp
r209129 r212647 196 196 return; 197 197 198 if (m_sawError) 198 if (m_sawError) { 199 199 insertErrorMessageBlock(); 200 else { 200 if (isDetached()) // Inserting an error message may have ran arbitrary scripts. 201 return; 202 } else { 201 203 updateLeafTextNode(); 202 204 document()->styleScope().didChangeStyleSheetEnvironment(); … … 215 217 // makes sense to call any methods on DocumentParser once it's been stopped. 216 218 // However, FrameLoader::stop calls DocumentParser::finish unconditionally. 219 220 Ref<XMLDocumentParser> protectedThis(*this); 217 221 218 222 if (m_parserPaused)
Note: See TracChangeset
for help on using the changeset viewer.