当前位置: 首页>>代码示例>>C++>>正文


C++ HTMLInputElement::document方法代码示例

本文整理汇总了C++中HTMLInputElement::document方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLInputElement::document方法的具体用法?C++ HTMLInputElement::document怎么用?C++ HTMLInputElement::document使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTMLInputElement的用法示例。


在下文中一共展示了HTMLInputElement::document方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: handleDOMActivateEvent

void FileInputType::handleDOMActivateEvent(Event* event)
{
    if (element()->disabled())
        return;

    if (!ScriptController::processingUserGesture())
        return;

    if (Chrome* chrome = this->chrome()) {
        FileChooserSettings settings;
        HTMLInputElement* input = element();
#if ENABLE(DIRECTORY_UPLOAD)
        settings.allowsDirectoryUpload = input->fastHasAttribute(webkitdirectoryAttr);
        settings.allowsMultipleFiles = settings.allowsDirectoryUpload || input->fastHasAttribute(multipleAttr);
#else
        settings.allowsMultipleFiles = input->fastHasAttribute(multipleAttr);
#endif
        settings.acceptMIMETypes = input->acceptMIMETypes();
        settings.acceptFileExtensions = input->acceptFileExtensions();
        settings.selectedFiles = m_fileList->paths();
#if ENABLE(MEDIA_CAPTURE)
        settings.capture = input->capture();
#endif
        chrome->runOpenPanel(input->document()->frame(), newFileChooser(settings));
    }
    event->setDefaultHandled();
}
开发者ID:,项目名称:,代码行数:27,代码来源:

示例2: textFieldDidEndEditing

void EditorClientImpl::textFieldDidEndEditing(Element* element)
{
    HTMLInputElement* inputElement = toHTMLInputElement(element);
    if (m_webView->autoFillClient() && inputElement)
        m_webView->autoFillClient()->textFieldDidEndEditing(WebInputElement(inputElement));

    // Notification that focus was lost.  Be careful with this, it's also sent
    // when the page is being closed.

    // Cancel any pending DoAutofill call.
    m_autofillArgs.clear();
    m_autofillTimer.stop();

    // Hide any showing popup.
    m_webView->hideAutoFillPopup();

    if (!m_webView->client())
        return; // The page is getting closed, don't fill the password.

    // Notify any password-listener of the focus change.
    if (!inputElement)
        return;

    WebFrameImpl* webframe = WebFrameImpl::fromFrame(inputElement->document()->frame());
    if (!webframe)
        return;

    WebPasswordAutocompleteListener* listener = webframe->getPasswordListener(inputElement);
    if (!listener)
        return;

    listener->didBlurInputElement(inputElement->value());
}
开发者ID:dankurka,项目名称:webkit_titanium,代码行数:33,代码来源:EditorClientImpl.cpp

示例3: remove

void RadioButtonGroup::remove(HTMLInputElement* button) {
  DCHECK_EQ(button->type(), InputTypeNames::radio);
  auto it = m_members.find(button);
  if (it == m_members.end())
    return;
  bool wasValid = isValid();
  DCHECK_EQ(it->value, button->isRequired());
  updateRequiredButton(*it, false);
  m_members.remove(it);
  if (m_checkedButton == button)
    m_checkedButton = nullptr;

  if (m_members.isEmpty()) {
    DCHECK(!m_requiredCount);
    DCHECK(!m_checkedButton);
  } else if (wasValid != isValid()) {
    setNeedsValidityCheckForAllButtons();
  }
  if (!wasValid) {
    // A radio button not in a group is always valid. We need to make it
    // valid only if the group was invalid.
    button->setNeedsValidityCheck();
  }

  // Send notification to update AX attributes for AXObjects which radiobutton
  // group has.
  if (!m_members.isEmpty()) {
    HTMLInputElement* input = m_members.begin()->key;
    if (AXObjectCache* cache = input->document().existingAXObjectCache())
      cache->radiobuttonRemovedFromGroup(input);
  }
}
开发者ID:mirror,项目名称:chromium,代码行数:32,代码来源:RadioButtonGroupScope.cpp

示例4: openTextDataListChooser

void ChromeClientImpl::openTextDataListChooser(HTMLInputElement& input)
{
    notifyPopupOpeningObservers();
    WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(input.document().frame());
    if (webframe->autofillClient())
        webframe->autofillClient()->openTextDataListChooser(WebInputElement(&input));
}
开发者ID:howardroark2018,项目名称:chromium,代码行数:7,代码来源:ChromeClientImpl.cpp

示例5: didEndEditingOnTextField

void ChromeClientImpl::didEndEditingOnTextField(
    HTMLInputElement& inputElement) {
  WebLocalFrameImpl* webframe =
      WebLocalFrameImpl::fromFrame(inputElement.document().frame());
  if (webframe->autofillClient())
    webframe->autofillClient()->textFieldDidEndEditing(
        WebInputElement(&inputElement));
}
开发者ID:mirror,项目名称:chromium,代码行数:8,代码来源:ChromeClientImpl.cpp

示例6: handleKeyboardEventOnTextField

void ChromeClientImpl::handleKeyboardEventOnTextField(
    HTMLInputElement& inputElement,
    KeyboardEvent& event) {
  WebLocalFrameImpl* webframe =
      WebLocalFrameImpl::fromFrame(inputElement.document().frame());
  if (webframe->autofillClient())
    webframe->autofillClient()->textFieldDidReceiveKeyDown(
        WebInputElement(&inputElement), WebKeyboardEventBuilder(event));
}
开发者ID:mirror,项目名称:chromium,代码行数:9,代码来源:ChromeClientImpl.cpp

示例7: doAutofill

void EditorClientImpl::doAutofill(Timer<EditorClientImpl>* timer)
{
    OwnPtr<AutofillArgs> args(m_autofillArgs.release());
    HTMLInputElement* inputElement = args->inputElement.get();

    const String& value = inputElement->value();

    // Enforce autofill_on_empty_value and caret_at_end.

    bool isCaretAtEnd = true;
    if (args->requireCaretAtEnd)
        isCaretAtEnd = inputElement->selectionStart() == inputElement->selectionEnd()
                       && inputElement->selectionEnd() == static_cast<int>(value.length());

    if ((!args->autofillOnEmptyValue && value.isEmpty()) || !isCaretAtEnd) {
        m_webView->hideAutoFillPopup();
        return;
    }

    // First let's see if there is a password listener for that element.
    // We won't trigger form autofill in that case, as having both behavior on
    // a node would be confusing.
    WebFrameImpl* webframe = WebFrameImpl::fromFrame(inputElement->document()->frame());
    if (!webframe)
        return;
    WebPasswordAutocompleteListener* listener = webframe->getPasswordListener(inputElement);
    if (listener) {
        if (args->autofillFormOnly)
            return;

        listener->performInlineAutocomplete(value,
                                            args->backspaceOrDeletePressed,
                                            true);
        return;
    }

    // Then trigger form autofill.
    WebString name = WebInputElement(inputElement).nameForAutofill();
    ASSERT(static_cast<int>(name.length()) > 0);

    if (m_webView->client())
        m_webView->client()->queryAutofillSuggestions(WebNode(inputElement),
                                                      name, WebString(value));
}
开发者ID:,项目名称:,代码行数:44,代码来源:

示例8: textFieldDataListChanged

void ChromeClientImpl::textFieldDataListChanged(HTMLInputElement& input) {
  WebLocalFrameImpl* webframe =
      WebLocalFrameImpl::fromFrame(input.document().frame());
  if (webframe->autofillClient())
    webframe->autofillClient()->dataListOptionsChanged(WebInputElement(&input));
}
开发者ID:mirror,项目名称:chromium,代码行数:6,代码来源:ChromeClientImpl.cpp


注:本文中的HTMLInputElement::document方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。