summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/html/FormAssociatedElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/html/FormAssociatedElement.cpp')
-rw-r--r--Source/WebCore/html/FormAssociatedElement.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/WebCore/html/FormAssociatedElement.cpp b/Source/WebCore/html/FormAssociatedElement.cpp
index 3571744..ea36b2a 100644
--- a/Source/WebCore/html/FormAssociatedElement.cpp
+++ b/Source/WebCore/html/FormAssociatedElement.cpp
@@ -132,7 +132,7 @@ void FormAssociatedElement::resetFormOwner(HTMLFormElement* form)
m_form->removeFormElement(this);
}
m_form = 0;
- if (!formId.isNull()) {
+ if (!formId.isNull() && element->inDocument()) {
// The HTML5 spec says that the element should be associated with
// the first element in the document to have an ID that equal to
// the value of form attribute, so we put the result of