本文整理汇总了C++中HTMLFormControlElement::dispatchSimulatedClick方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLFormControlElement::dispatchSimulatedClick方法的具体用法?C++ HTMLFormControlElement::dispatchSimulatedClick怎么用?C++ HTMLFormControlElement::dispatchSimulatedClick使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLFormControlElement
的用法示例。
在下文中一共展示了HTMLFormControlElement::dispatchSimulatedClick方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: submitImplicitly
void HTMLFormElement::submitImplicitly(Event* event, bool fromImplicitSubmissionTrigger)
{
int submissionTriggerCount = 0;
bool seenDefaultButton = false;
for (unsigned i = 0; i < m_associatedElements.size(); ++i) {
FormAssociatedElement* formAssociatedElement = m_associatedElements[i];
if (!formAssociatedElement->isFormControlElement())
continue;
HTMLFormControlElement* control = toHTMLFormControlElement(formAssociatedElement);
if (!seenDefaultButton && control->canBeSuccessfulSubmitButton()) {
if (fromImplicitSubmissionTrigger)
seenDefaultButton = true;
if (control->isSuccessfulSubmitButton()) {
if (control->renderer()) {
control->dispatchSimulatedClick(event);
return;
}
} else if (fromImplicitSubmissionTrigger) {
// Default (submit) button is not activated; no implicit submission.
return;
}
} else if (control->canTriggerImplicitSubmission()) {
++submissionTriggerCount;
}
}
if (fromImplicitSubmissionTrigger && submissionTriggerCount == 1)
prepareForSubmission(event);
}
示例2: submitImplicitly
void HTMLFormElement::submitImplicitly(Event* event, bool fromImplicitSubmissionTrigger)
{
unsigned submissionTriggerCount = 0;
for (unsigned i = 0; i < m_associatedElements.size(); ++i) {
FormAssociatedElement* formAssociatedElement = m_associatedElements[i];
if (!formAssociatedElement->isFormControlElement())
continue;
HTMLFormControlElement* formElement = static_cast<HTMLFormControlElement*>(formAssociatedElement);
if (formElement->isSuccessfulSubmitButton()) {
if (formElement->renderer()) {
formElement->dispatchSimulatedClick(event);
return;
}
} else if (formElement->canTriggerImplicitSubmission())
++submissionTriggerCount;
}
if (!submissionTriggerCount)
return;
// Older iOS apps using WebViews expect the behavior of auto submitting multi-input forms.
Settings* settings = document().settings();
if (fromImplicitSubmissionTrigger && (submissionTriggerCount == 1 || (settings && settings->allowMultiElementImplicitSubmission())))
prepareForSubmission(event);
}