Diff
Modified: trunk/LayoutTests/ChangeLog (203373 => 203374)
--- trunk/LayoutTests/ChangeLog 2016-07-18 21:12:14 UTC (rev 203373)
+++ trunk/LayoutTests/ChangeLog 2016-07-18 21:15:02 UTC (rev 203374)
@@ -1,5 +1,18 @@
2016-07-18 Brent Fulgham <bfulg...@apple.com>
+ Unreviewed, rolling out r203373.
+
+ Unaddressed
+
+ Reverted changeset:
+
+ "Don't associate form-associated elements with forms in other
+ trees."
+ https://bugs.webkit.org/show_bug.cgi?id=119451
+ http://trac.webkit.org/changeset/203373
+
+2016-07-18 Brent Fulgham <bfulg...@apple.com>
+
Don't associate form-associated elements with forms in other trees.
https://bugs.webkit.org/show_bug.cgi?id=119451
<rdar://problem/27382946>
Deleted: trunk/LayoutTests/fast/forms/image-disconnected-during-parse-expected.txt (203373 => 203374)
--- trunk/LayoutTests/fast/forms/image-disconnected-during-parse-expected.txt 2016-07-18 21:12:14 UTC (rev 203373)
+++ trunk/LayoutTests/fast/forms/image-disconnected-during-parse-expected.txt 2016-07-18 21:15:02 UTC (rev 203374)
@@ -1,10 +0,0 @@
-Image elements should not be associated with forms in different trees
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS document.forms[0].myimage is undefined.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: trunk/LayoutTests/fast/forms/image-disconnected-during-parse.html (203373 => 203374)
--- trunk/LayoutTests/fast/forms/image-disconnected-during-parse.html 2016-07-18 21:12:14 UTC (rev 203373)
+++ trunk/LayoutTests/fast/forms/image-disconnected-during-parse.html 2016-07-18 21:15:02 UTC (rev 203374)
@@ -1,16 +0,0 @@
-<!DOCTYPE html>
-<form>
- <div id="target">
- <script>
- var d = document.getElementById('target');
- d.parentNode.removeChild(d);
- </script>
- <img name=myimage>
- </div>
-</form>
-<script src=""
-<script>
-description('Image elements should not be associated with forms in different trees');
-shouldBeUndefined('document.forms[0].myimage');
-</script>
-<script src=""
\ No newline at end of file
Deleted: trunk/LayoutTests/fast/forms/input-disconnected-during-parse-expected.txt (203373 => 203374)
--- trunk/LayoutTests/fast/forms/input-disconnected-during-parse-expected.txt 2016-07-18 21:12:14 UTC (rev 203373)
+++ trunk/LayoutTests/fast/forms/input-disconnected-during-parse-expected.txt 2016-07-18 21:15:02 UTC (rev 203374)
@@ -1,10 +0,0 @@
-FormAssociatedElements should not be associated with forms in different trees (and should not crash)
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS document.forms[0].elements[0] is undefined.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
Deleted: trunk/LayoutTests/fast/forms/input-disconnected-during-parse.html (203373 => 203374)
--- trunk/LayoutTests/fast/forms/input-disconnected-during-parse.html 2016-07-18 21:12:14 UTC (rev 203373)
+++ trunk/LayoutTests/fast/forms/input-disconnected-during-parse.html 2016-07-18 21:15:02 UTC (rev 203374)
@@ -1,19 +0,0 @@
-<!DOCTYPE html>
-<form>
- <div>
- <script>
- var d = document.querySelector('div');
- d.parentNode.removeChild(d);
- </script>
- <input>
- </div>
-</form>
-<script src=""
-<script>
-description('FormAssociatedElements should not be associated with forms in different trees (and should not crash)');
-var unused = document.forms[0].elements.length;
-d = null;
-gc();
-shouldBeUndefined('document.forms[0].elements[0]');
-</script>
-<script src=""
Modified: trunk/Source/WebCore/ChangeLog (203373 => 203374)
--- trunk/Source/WebCore/ChangeLog 2016-07-18 21:12:14 UTC (rev 203373)
+++ trunk/Source/WebCore/ChangeLog 2016-07-18 21:15:02 UTC (rev 203374)
@@ -1,5 +1,18 @@
2016-07-18 Brent Fulgham <bfulg...@apple.com>
+ Unreviewed, rolling out r203373.
+
+ Unaddressed
+
+ Reverted changeset:
+
+ "Don't associate form-associated elements with forms in other
+ trees."
+ https://bugs.webkit.org/show_bug.cgi?id=119451
+ http://trac.webkit.org/changeset/203373
+
+2016-07-18 Brent Fulgham <bfulg...@apple.com>
+
Don't associate form-associated elements with forms in other trees.
https://bugs.webkit.org/show_bug.cgi?id=119451
<rdar://problem/27382946>
Modified: trunk/Source/WebCore/dom/NodeTraversal.h (203373 => 203374)
--- trunk/Source/WebCore/dom/NodeTraversal.h 2016-07-18 21:12:14 UTC (rev 203373)
+++ trunk/Source/WebCore/dom/NodeTraversal.h 2016-07-18 21:15:02 UTC (rev 203374)
@@ -22,7 +22,8 @@
*
*/
-#pragma once
+#ifndef NodeTraversal_h
+#define NodeTraversal_h
#include "ContainerNode.h"
#include "Text.h"
@@ -64,7 +65,6 @@
Node* nextIncludingPseudo(const Node&, const Node* = nullptr);
Node* nextIncludingPseudoSkippingChildren(const Node&, const Node* = nullptr);
-Node& highestAncestorOrSelf(Node&);
}
namespace NodeTraversal {
@@ -127,13 +127,7 @@
return current.parentNode();
}
-inline Node& highestAncestorOrSelf(Node& current)
-{
- Node* highest = ¤t;
- while (highest->parentNode())
- highest = highest->parentNode();
- return *highest;
}
+}
-}
-}
+#endif
Modified: trunk/Source/WebCore/html/FormAssociatedElement.cpp (203373 => 203374)
--- trunk/Source/WebCore/html/FormAssociatedElement.cpp 2016-07-18 21:12:14 UTC (rev 203373)
+++ trunk/Source/WebCore/html/FormAssociatedElement.cpp 2016-07-18 21:15:02 UTC (rev 203374)
@@ -2,7 +2,7 @@
* Copyright (C) 1999 Lars Knoll (kn...@kde.org)
* (C) 1999 Antti Koivisto (koivi...@kde.org)
* (C) 2001 Dirk Mueller (muel...@kde.org)
- * Copyright (C) 2004-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
* (C) 2006 Alexey Proskuryakov (a...@nypop.com)
*
* This library is free software; you can redistribute it and/or
@@ -33,7 +33,6 @@
#include "HTMLNames.h"
#include "HTMLObjectElement.h"
#include "IdTargetObserver.h"
-#include "NodeTraversal.h"
namespace WebCore {
@@ -76,9 +75,6 @@
m_formSetByParser = nullptr;
}
- if (m_form && !NodeTraversal::highestAncestorOrSelf(insertionPoint).isSameNode(&NodeTraversal::highestAncestorOrSelf(*m_form)))
- setForm(nullptr);
-
if (!insertionPoint.inDocument())
return;
Modified: trunk/Source/WebCore/html/HTMLImageElement.cpp (203373 => 203374)
--- trunk/Source/WebCore/html/HTMLImageElement.cpp 2016-07-18 21:12:14 UTC (rev 203373)
+++ trunk/Source/WebCore/html/HTMLImageElement.cpp 2016-07-18 21:15:02 UTC (rev 203374)
@@ -38,7 +38,6 @@
#include "MIMETypeRegistry.h"
#include "MediaList.h"
#include "MediaQueryEvaluator.h"
-#include "NodeTraversal.h"
#include "Page.h"
#include "RenderImage.h"
#include "Settings.h"
@@ -308,11 +307,6 @@
m_form->registerImgElement(this);
}
- if (m_form && !NodeTraversal::highestAncestorOrSelf(insertionPoint).isSameNode(&NodeTraversal::highestAncestorOrSelf(*m_form))) {
- m_form->removeImgElement(this);
- m_form = nullptr;
- }
-
if (!m_form) {
m_form = HTMLFormElement::findClosestFormAncestor(*this);
if (m_form)