本文整理汇总了C++中HTMLInputElement::autoComplete方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLInputElement::autoComplete方法的具体用法?C++ HTMLInputElement::autoComplete怎么用?C++ HTMLInputElement::autoComplete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLInputElement
的用法示例。
在下文中一共展示了HTMLInputElement::autoComplete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: findPasswordFormFields
void findPasswordFormFields(HTMLFormElement* form, PasswordFormFields* fields)
{
ASSERT(form);
ASSERT(fields);
int firstPasswordIndex = 0;
// First, find the password fields and activated submit button
const Vector<HTMLFormControlElement*>& formElements = form->associatedElements();
for (size_t i = 0; i < formElements.size(); i++) {
HTMLFormControlElement* formElement = formElements[i];
if (formElement->isActivatedSubmit())
fields->submit = formElement;
if (!formElement->hasLocalName(HTMLNames::inputTag))
continue;
HTMLInputElement* inputElement = toHTMLInputElement(formElement);
if (!inputElement->isEnabledFormControl())
continue;
if ((fields->passwords.size() < maxPasswords)
&& inputElement->isPasswordField()
&& inputElement->autoComplete()) {
if (fields->passwords.isEmpty())
firstPasswordIndex = i;
fields->passwords.append(inputElement);
}
}
if (!fields->passwords.isEmpty()) {
// Then, search backwards for the username field
for (int i = firstPasswordIndex - 1; i >= 0; i--) {
HTMLFormControlElement* formElement = formElements[i];
if (!formElement->hasLocalName(HTMLNames::inputTag))
continue;
HTMLInputElement* inputElement = toHTMLInputElement(formElement);
if (!inputElement->isEnabledFormControl())
continue;
// Various input types such as text, url, email can be a username field.
if ((inputElement->isTextField() && !inputElement->isPasswordField())
&& (inputElement->autoComplete())) {
fields->userName = inputElement;
break;
}
}
}
}
示例2: elementDoesAutoCompleteForElementWithId
bool DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId(QWebFrame* frame, const QString& elementId)
{
Frame* coreFrame = QWebFramePrivate::core(frame);
if (!coreFrame)
return false;
Document* doc = coreFrame->document();
Q_ASSERT(doc);
Node* coreNode = doc->getElementById(elementId);
if (!coreNode || !coreNode->renderer())
return false;
HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(coreNode);
return inputElement->isTextField() && !inputElement->isPasswordField() && inputElement->autoComplete();
}
示例3: elementDoesAutoComplete
bool WebFrame::elementDoesAutoComplete(DOMElement *element)
{
if (!element)
return false;
HTMLInputElement *inputElement = inputElementFromDOMElement(element);
if (!inputElement)
return false;
else
return inputElement->isTextField() && inputElement->inputType() != HTMLInputElement::PASSWORD && inputElement->autoComplete();
}