Diff
Modified: branches/safari-603-branch/LayoutTests/ChangeLog (212681 => 212682)
--- branches/safari-603-branch/LayoutTests/ChangeLog 2017-02-21 00:08:34 UTC (rev 212681)
+++ branches/safari-603-branch/LayoutTests/ChangeLog 2017-02-21 00:18:31 UTC (rev 212682)
@@ -1,5 +1,9 @@
2017-02-20 Matthew Hanson <matthew_han...@apple.com>
+ Rollout r212647. rdar://problem/30563318
+
+2017-02-20 Matthew Hanson <matthew_han...@apple.com>
+
Merge r211750. rdar://problem/30383964
2017-02-06 Simon Fraser <simon.fra...@apple.com>
Deleted: branches/safari-603-branch/LayoutTests/fast/parser/adoption-agency-unload-iframe-3-expected.txt (212681 => 212682)
--- branches/safari-603-branch/LayoutTests/fast/parser/adoption-agency-unload-iframe-3-expected.txt 2017-02-21 00:08:34 UTC (rev 212681)
+++ branches/safari-603-branch/LayoutTests/fast/parser/adoption-agency-unload-iframe-3-expected.txt 2017-02-21 00:18:31 UTC (rev 212682)
@@ -1,3 +0,0 @@
-
-PASS An element removed by the adoption agency algorithm must not be inserted if it had been inserted elsewhere
-
Deleted: branches/safari-603-branch/LayoutTests/fast/parser/adoption-agency-unload-iframe-3.html (212681 => 212682)
--- branches/safari-603-branch/LayoutTests/fast/parser/adoption-agency-unload-iframe-3.html 2017-02-21 00:08:34 UTC (rev 212681)
+++ branches/safari-603-branch/LayoutTests/fast/parser/adoption-agency-unload-iframe-3.html 2017-02-21 00:18:31 UTC (rev 212682)
@@ -1,41 +0,0 @@
-<!DOCTYPE html>
-<head>
-<script src=""
-<script src=""
-<script>
-
-function runTest() {
- const section = document.querySelector('section');
- const container = document.querySelector('div');
- const p = document.querySelector('p');
- const iframe = document.createElement('iframe');
- document.querySelector('b').appendChild(iframe);
- /* div
- + b
- + p
- + script
- + iframe */
- iframe.contentWindow._onunload_ = () => {
- section.appendChild(p);
- container.remove();
- /* body
- + p
- + script
- + iframe */
- }
-
- window._onload_ = () => {
- let test = async_test('An element removed by the adoption agency algorithm must not be inserted if it had been inserted elsewhere');
- test.step(() => {
- assert_not_equals(p.parentNode, container);
- assert_equals(p.parentNode, section);
- });
- test.done();
- }
-}
-
-</script>
-</head>
-<body>
-<section><div><b><p><script>runTest();</script></b></p></div></section>
-</body>
Deleted: branches/safari-603-branch/LayoutTests/fast/parser/adoption-agency-unload-iframe-4-expected.txt (212681 => 212682)
--- branches/safari-603-branch/LayoutTests/fast/parser/adoption-agency-unload-iframe-4-expected.txt 2017-02-21 00:08:34 UTC (rev 212681)
+++ branches/safari-603-branch/LayoutTests/fast/parser/adoption-agency-unload-iframe-4-expected.txt 2017-02-21 00:18:31 UTC (rev 212682)
@@ -1,3 +0,0 @@
-
-PASS An element removed by the adoption agency algorithm must not be inserted if it had been inserted elsewhere
-
Deleted: branches/safari-603-branch/LayoutTests/fast/parser/adoption-agency-unload-iframe-4.html (212681 => 212682)
--- branches/safari-603-branch/LayoutTests/fast/parser/adoption-agency-unload-iframe-4.html 2017-02-21 00:08:34 UTC (rev 212681)
+++ branches/safari-603-branch/LayoutTests/fast/parser/adoption-agency-unload-iframe-4.html 2017-02-21 00:18:31 UTC (rev 212682)
@@ -1,47 +0,0 @@
-<html>
-<head>
-<script src=""
-<script src=""
-</head>
-<body>
-<script>
-
-let test = async_test('An element removed by the adoption agency algorithm must not be inserted if it had been inserted elsewhere');
-
-var p;
-test.step(() => {
- const iframe = document.createElement('iframe');
- document.body.appendChild(iframe);
-
- let doc = iframe.contentDocument;
- doc.write(`<body><a id="target" href=""
-
- const target = doc.querySelector('a');
- target._onfocus_ = () => {
- target._onfocus_ = null;
-
- test.step(() => {
- let container = doc.querySelector('div');
- container.remove();
- doc.body.appendChild(p);
- });
-
- setTimeout(() => {
- test.step(() => {
- assert_equals(p.parentNode, doc.body);
- });
- test.done();
- iframe.remove();
- }, 0);
- }
-
- doc.write(`<div><b><p><script>
- parent.p = document.querySelector('p');
- document.write('<link rel="stylesheet" href=""
- location.hash = 'target';
- <\/script></b></p></div></body>`);
-});
-
-</script>
-</body>
-</html>
Deleted: branches/safari-603-branch/LayoutTests/fast/parser/xml-error-unload-iframe-expected.txt (212681 => 212682)
--- branches/safari-603-branch/LayoutTests/fast/parser/xml-error-unload-iframe-expected.txt 2017-02-21 00:08:34 UTC (rev 212681)
+++ branches/safari-603-branch/LayoutTests/fast/parser/xml-error-unload-iframe-expected.txt 2017-02-21 00:18:31 UTC (rev 212682)
@@ -1,3 +0,0 @@
-
-PASS An element removed by the adoption agency algorithm must not be inserted if it had been inserted elsewhere
-
Deleted: branches/safari-603-branch/LayoutTests/fast/parser/xml-error-unload-iframe.html (212681 => 212682)
--- branches/safari-603-branch/LayoutTests/fast/parser/xml-error-unload-iframe.html 2017-02-21 00:08:34 UTC (rev 212681)
+++ branches/safari-603-branch/LayoutTests/fast/parser/xml-error-unload-iframe.html 2017-02-21 00:18:31 UTC (rev 212682)
@@ -1,36 +0,0 @@
-<!DOCTYPE html>
-<head>
-<script src=""
-<script src=""
-</head>
-<body>
-<script>
-
-let svgElement;
-function moveIframe(svgDoc) {
- if (svgElement)
- return;
- svgElement = svgDoc.documentElement;
- const iframe = document.createElement('iframe');
- svgDoc.documentElement.appendChild(iframe);
- iframe.contentWindow._onunload_ = () => {
- document.body.appendChild(svgElement);
- }
-}
-
-const content = `<svg xmlns="http://www.w3.org/2000/svg"><script>parent.moveIframe(document);<\/script><element a="1" a="2"/></svg>`;
-const iframe = document.createElement('iframe');
-iframe.src = "" Blob([content], {type: 'text/xml'}));
-document.documentElement.appendChild(iframe);
-
-window._onload_ = () => {
- let test = async_test('An element removed by the adoption agency algorithm must not be inserted if it had been inserted elsewhere');
- test.step(() => {
- assert_equals(svgElement.parentNode, document.body);
- svgElement.remove();
- });
- test.done();
-}
-
-</script>
-</body>
Modified: branches/safari-603-branch/Source/WebCore/ChangeLog (212681 => 212682)
--- branches/safari-603-branch/Source/WebCore/ChangeLog 2017-02-21 00:08:34 UTC (rev 212681)
+++ branches/safari-603-branch/Source/WebCore/ChangeLog 2017-02-21 00:18:31 UTC (rev 212682)
@@ -1,5 +1,9 @@
2017-02-20 Matthew Hanson <matthew_han...@apple.com>
+ Rollout r212647. rdar://problem/30563318
+
+2017-02-20 Matthew Hanson <matthew_han...@apple.com>
+
Merge r211750. rdar://problem/30383964
2017-02-06 Simon Fraser <simon.fra...@apple.com>
Modified: branches/safari-603-branch/Source/WebCore/dom/ContainerNode.cpp (212681 => 212682)
--- branches/safari-603-branch/Source/WebCore/dom/ContainerNode.cpp 2017-02-21 00:08:34 UTC (rev 212681)
+++ branches/safari-603-branch/Source/WebCore/dom/ContainerNode.cpp 2017-02-21 00:18:31 UTC (rev 212682)
@@ -598,28 +598,24 @@
void ContainerNode::parserRemoveChild(Node& oldChild)
{
disconnectSubframesIfNeeded(*this, DescendantsOnly);
- if (oldChild.parentNode() != this)
- return;
- {
- NoEventDispatchAssertion assertNoEventDispatch;
+ NoEventDispatchAssertion assertNoEventDispatch;
- document().nodeChildrenWillBeRemoved(*this);
+ document().nodeChildrenWillBeRemoved(*this);
- ASSERT(oldChild.parentNode() == this);
- ASSERT(!oldChild.isDocumentFragment());
+ ASSERT(oldChild.parentNode() == this);
+ ASSERT(!oldChild.isDocumentFragment());
- Node* prev = oldChild.previousSibling();
- Node* next = oldChild.nextSibling();
+ Node* prev = oldChild.previousSibling();
+ Node* next = oldChild.nextSibling();
- ChildListMutationScope(*this).willRemoveChild(oldChild);
- oldChild.notifyMutationObserversNodeWillDetach();
+ ChildListMutationScope(*this).willRemoveChild(oldChild);
+ oldChild.notifyMutationObserversNodeWillDetach();
- removeBetween(prev, next, oldChild);
+ removeBetween(prev, next, oldChild);
- notifyChildRemoved(oldChild, prev, next, ChildChangeSourceParser);
- document().notifyRemovePendingSheetIfNeeded();
- }
+ notifyChildRemoved(oldChild, prev, next, ChildChangeSourceParser);
+ document().notifyRemovePendingSheetIfNeeded();
}
// this differs from other remove functions because it forcibly removes all the children,
@@ -723,12 +719,11 @@
ASSERT(!newChild.isDocumentFragment());
ASSERT(!hasTagName(HTMLNames::templateTag));
+ if (&document() != &newChild.document())
+ document().adoptNode(newChild);
+
{
NoEventDispatchAssertion assertNoEventDispatch;
-
- if (&document() != &newChild.document())
- document().adoptNode(newChild);
-
appendChildCommon(newChild);
treeScope().adoptIfNeeded(newChild);
}
Modified: branches/safari-603-branch/Source/WebCore/html/parser/HTMLConstructionSite.cpp (212681 => 212682)
--- branches/safari-603-branch/Source/WebCore/html/parser/HTMLConstructionSite.cpp 2017-02-21 00:08:34 UTC (rev 212681)
+++ branches/safari-603-branch/Source/WebCore/html/parser/HTMLConstructionSite.cpp 2017-02-21 00:18:31 UTC (rev 212682)
@@ -133,9 +133,6 @@
if (auto* parent = task.child->parentNode())
parent->parserRemoveChild(*task.child);
- if (task.child->parentNode())
- return;
-
task.parent->parserAppendChild(*task.child);
}
@@ -143,9 +140,6 @@
{
ASSERT(task.operation == HTMLConstructionSiteTask::InsertAlreadyParsedChild);
- if (task.child->parentNode())
- return;
-
insert(task);
}
Modified: branches/safari-603-branch/Source/WebCore/xml/XMLErrors.cpp (212681 => 212682)
--- branches/safari-603-branch/Source/WebCore/xml/XMLErrors.cpp 2017-02-21 00:08:34 UTC (rev 212681)
+++ branches/safari-603-branch/Source/WebCore/xml/XMLErrors.cpp 2017-02-21 00:18:31 UTC (rev 212682)
@@ -140,9 +140,8 @@
rootElement->parserAppendChild(body);
m_document.parserRemoveChild(*documentElement);
- if (!documentElement->parentNode())
- body->parserAppendChild(*documentElement);
+ body->parserAppendChild(*documentElement);
m_document.parserAppendChild(rootElement);
documentElement = WTFMove(body);
Modified: branches/safari-603-branch/Source/WebCore/xml/parser/XMLDocumentParser.cpp (212681 => 212682)
--- branches/safari-603-branch/Source/WebCore/xml/parser/XMLDocumentParser.cpp 2017-02-21 00:08:34 UTC (rev 212681)
+++ branches/safari-603-branch/Source/WebCore/xml/parser/XMLDocumentParser.cpp 2017-02-21 00:18:31 UTC (rev 212682)
@@ -195,11 +195,9 @@
if (m_parserPaused)
return;
- if (m_sawError) {
+ if (m_sawError)
insertErrorMessageBlock();
- if (isDetached()) // Inserting an error message may have ran arbitrary scripts.
- return;
- } else {
+ else {
updateLeafTextNode();
document()->styleScope().didChangeStyleSheetEnvironment();
}
@@ -217,8 +215,6 @@
// makes sense to call any methods on DocumentParser once it's been stopped.
// However, FrameLoader::stop calls DocumentParser::finish unconditionally.
- Ref<XMLDocumentParser> protectedThis(*this);
-
if (m_parserPaused)
m_finishCalled = true;
else