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

Unified Diff: WebCore/html/HTMLFormElement.cpp

Issue 3464001: Merge 67240 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/517/
Patch Set: Created 10 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « WebCore/html/HTMLFormElement.h ('k') | WebKit/chromium/src/WebFormElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/html/HTMLFormElement.cpp
===================================================================
--- WebCore/html/HTMLFormElement.cpp (revision 67715)
+++ WebCore/html/HTMLFormElement.cpp (working copy)
@@ -65,7 +65,7 @@
HTMLFormElement::HTMLFormElement(const QualifiedName& tagName, Document* document)
: HTMLElement(tagName, document)
- , m_submissionTrigger(NotSubmittedByJavaScript)
+ , m_wasUserSubmitted(false)
, m_autocomplete(true)
, m_insubmit(false)
, m_doingsubmit(false)
@@ -106,13 +106,13 @@
{
if (!isDemoted())
return HTMLElement::rendererIsNeeded(style);
-
+
Node* node = parentNode();
RenderObject* parentRenderer = node->renderer();
bool parentIsTableElementPart = (parentRenderer->isTable() && node->hasTagName(tableTag))
|| (parentRenderer->isTableRow() && node->hasTagName(trTag))
|| (parentRenderer->isTableSection() && node->hasTagName(tbodyTag))
- || (parentRenderer->isTableCol() && node->hasTagName(colTag))
+ || (parentRenderer->isTableCol() && node->hasTagName(colTag))
|| (parentRenderer->isTableCell() && node->hasTagName(trTag));
if (!parentIsTableElementPart)
@@ -139,7 +139,7 @@
{
if (document()->isHTMLDocument())
static_cast<HTMLDocument*>(document())->removeNamedItem(m_name);
-
+
HTMLElement::removedFromDocument();
}
@@ -263,7 +263,7 @@
m_insubmit = false;
if (m_doingsubmit)
- submit(event, true, false, NotSubmittedByJavaScript);
+ submit(event, true, true, NotSubmittedByJavaScript);
return m_doingsubmit;
}
@@ -271,12 +271,12 @@
void HTMLFormElement::submit(Frame* javaScriptActiveFrame)
{
if (javaScriptActiveFrame)
- submit(0, false, !javaScriptActiveFrame->script()->anyPageIsProcessingUserGesture(), SubmittedByJavaScript);
+ submit(0, false, javaScriptActiveFrame->script()->anyPageIsProcessingUserGesture(), SubmittedByJavaScript);
else
- submit(0, false, false, NotSubmittedByJavaScript);
+ submit(0, false, true, NotSubmittedByJavaScript);
}
-void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool lockHistory, FormSubmissionTrigger formSubmissionTrigger)
+void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool processingUserGesture, FormSubmissionTrigger formSubmissionTrigger)
{
FrameView* view = document()->view();
Frame* frame = document()->frame();
@@ -289,11 +289,11 @@
}
m_insubmit = true;
- m_submissionTrigger = formSubmissionTrigger;
+ m_wasUserSubmitted = processingUserGesture;
HTMLFormControlElement* firstSuccessfulSubmitButton = 0;
bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button?
-
+
for (unsigned i = 0; i < m_associatedElements.size(); ++i) {
HTMLFormControlElement* control = m_associatedElements[i];
if (needButtonActivation) {
@@ -307,11 +307,11 @@
if (needButtonActivation && firstSuccessfulSubmitButton)
firstSuccessfulSubmitButton->setActivatedSubmit(true);
- frame->loader()->submitForm(FormSubmission::create(this, m_attributes, event, lockHistory, formSubmissionTrigger));
+ frame->loader()->submitForm(FormSubmission::create(this, m_attributes, event, !processingUserGesture, formSubmissionTrigger));
if (needButtonActivation && firstSuccessfulSubmitButton)
firstSuccessfulSubmitButton->setActivatedSubmit(false);
-
+
m_doingsubmit = m_insubmit = false;
}
@@ -355,7 +355,7 @@
} else if (attr->name() == autocompleteAttr) {
m_autocomplete = !equalIgnoringCase(attr->value(), "off");
if (!m_autocomplete)
- document()->registerForDocumentActivationCallbacks(this);
+ document()->registerForDocumentActivationCallbacks(this);
else
document()->unregisterForDocumentActivationCallbacks(this);
} else if (attr->name() == onsubmitAttr)
@@ -482,9 +482,9 @@
return getAttribute(targetAttr);
}
-FormSubmissionTrigger HTMLFormElement::submissionTrigger() const
+bool HTMLFormElement::wasUserSubmitted() const
{
- return m_submissionTrigger;
+ return m_wasUserSubmitted;
}
HTMLFormControlElement* HTMLFormElement::defaultButton() const
@@ -556,13 +556,13 @@
}
// name has been accessed, remember it
if (namedItems.size() && aliasElem != namedItems.first())
- addElementAlias(static_cast<HTMLFormControlElement*>(namedItems.first().get()), name);
+ addElementAlias(static_cast<HTMLFormControlElement*>(namedItems.first().get()), name);
}
void HTMLFormElement::documentDidBecomeActive()
{
ASSERT(!m_autocomplete);
-
+
for (unsigned i = 0; i < m_associatedElements.size(); ++i)
m_associatedElements[i]->reset();
}
« no previous file with comments | « WebCore/html/HTMLFormElement.h ('k') | WebKit/chromium/src/WebFormElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698