Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Unified Diff: third_party/WebKit/Source/core/html/HTMLFormElement.cpp

Issue 2588293002: Fix a crash in HTMLFormElement::reset() due to <output>. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/form-reset-crash.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/HTMLFormElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
index fcfa50f06f51d6e20763e1ef9e31a106e1891503..7d3658d7f49ca4272e7104e5cbc088caddb60f5b 100644
--- a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
@@ -465,7 +465,10 @@ void HTMLFormElement::reset() {
return;
}
- for (const auto& element : listedElements()) {
+ // Copy the element list because |reset()| implementation can update DOM
+ // structure.
kochi 2016/12/21 01:45:58 Is it guaranteed that none of |elements| will be d
tkent 2016/12/21 02:13:31 An element can be disconnected, but it keeps alive
kochi 2016/12/21 02:20:05 I see, thanks for the explanation!
+ ListedElement::List elements(listedElements());
+ for (const auto& element : elements) {
if (element->isFormControlElement())
toHTMLFormControlElement(element)->reset();
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/forms/form-reset-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698