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

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

Issue 6709024: Merge 80797 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 9 months 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
« no previous file with comments | « Source/WebCore/dom/Node.cpp ('k') | Source/WebCore/html/HTMLCollection.cpp » ('j') | 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 void FormAssociatedElement::resetFormOwner(HTMLFormElement* form) 125 void FormAssociatedElement::resetFormOwner(HTMLFormElement* form)
126 { 126 {
127 HTMLElement* element = toHTMLElement(this); 127 HTMLElement* element = toHTMLElement(this);
128 const AtomicString& formId(element->fastGetAttribute(formAttr)); 128 const AtomicString& formId(element->fastGetAttribute(formAttr));
129 if (m_form) { 129 if (m_form) {
130 if (formId.isNull()) 130 if (formId.isNull())
131 return; 131 return;
132 m_form->removeFormElement(this); 132 m_form->removeFormElement(this);
133 } 133 }
134 m_form = 0; 134 m_form = 0;
135 if (!formId.isNull()) { 135 if (!formId.isNull() && element->inDocument()) {
136 // The HTML5 spec says that the element should be associated with 136 // The HTML5 spec says that the element should be associated with
137 // the first element in the document to have an ID that equal to 137 // the first element in the document to have an ID that equal to
138 // the value of form attribute, so we put the result of 138 // the value of form attribute, so we put the result of
139 // document()->getElementById() over the given element. 139 // document()->getElementById() over the given element.
140 Element* firstElement = element->document()->getElementById(formId); 140 Element* firstElement = element->document()->getElementById(formId);
141 if (firstElement && firstElement->hasTagName(formTag)) 141 if (firstElement && firstElement->hasTagName(formTag))
142 m_form = static_cast<HTMLFormElement*>(firstElement); 142 m_form = static_cast<HTMLFormElement*>(firstElement);
143 else 143 else
144 m_form = form; 144 m_form = form;
145 } else 145 } else
(...skipping 26 matching lines...) Expand all
172 ASSERT(element->hasTagName(objectTag)); 172 ASSERT(element->hasTagName(objectTag));
173 return element; 173 return element;
174 } 174 }
175 175
176 HTMLElement* toHTMLElement(FormAssociatedElement* associatedElement) 176 HTMLElement* toHTMLElement(FormAssociatedElement* associatedElement)
177 { 177 {
178 return const_cast<HTMLElement*>(toHTMLElement(static_cast<const FormAssociat edElement*>(associatedElement))); 178 return const_cast<HTMLElement*>(toHTMLElement(static_cast<const FormAssociat edElement*>(associatedElement)));
179 } 179 }
180 180
181 } // namespace Webcore 181 } // namespace Webcore
OLDNEW
« no previous file with comments | « Source/WebCore/dom/Node.cpp ('k') | Source/WebCore/html/HTMLCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698