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

Side by Side Diff: Source/core/html/FormAssociatedElement.cpp

Issue 114783002: Merge 163680 "Fix a crash when a form control is in a past naems..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1700/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/forms/past-names-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 if (!currentAssociatedForm) 116 if (!currentAssociatedForm)
117 return element->findFormAncestor(); 117 return element->findFormAncestor();
118 118
119 return currentAssociatedForm; 119 return currentAssociatedForm;
120 } 120 }
121 121
122 void FormAssociatedElement::formRemovedFromTree(const Node* formRoot) 122 void FormAssociatedElement::formRemovedFromTree(const Node* formRoot)
123 { 123 {
124 ASSERT(m_form); 124 ASSERT(m_form);
125 if (toHTMLElement(this)->highestAncestor() != formRoot) 125 if (toHTMLElement(this)->highestAncestor() == formRoot)
126 setForm(0); 126 return;
127 RefPtr<HTMLElement> protector(toHTMLElement(this));
128 setForm(0);
127 } 129 }
128 130
129 void FormAssociatedElement::setForm(HTMLFormElement* newForm) 131 void FormAssociatedElement::setForm(HTMLFormElement* newForm)
130 { 132 {
131 if (m_form == newForm) 133 if (m_form == newForm)
132 return; 134 return;
133 willChangeForm(); 135 willChangeForm();
134 if (m_form) 136 if (m_form)
135 m_form->removeFormElement(this); 137 m_form->removeFormElement(this);
136 m_form = newForm; 138 m_form = newForm;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 , m_element(element) 299 , m_element(element)
298 { 300 {
299 } 301 }
300 302
301 void FormAttributeTargetObserver::idTargetChanged() 303 void FormAttributeTargetObserver::idTargetChanged()
302 { 304 {
303 m_element->formAttributeTargetChanged(); 305 m_element->formAttributeTargetChanged();
304 } 306 }
305 307
306 } // namespace Webcore 308 } // namespace Webcore
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/past-names-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698