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


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

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


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

示例1: receiveDroppedFiles

bool FileInputType::receiveDroppedFiles(const DragData* dragData)
{
    Vector<String> paths;
    dragData->asFilenames(paths);
    if (paths.isEmpty())
        return false;

    HTMLInputElement* input = element();
#if ENABLE(DIRECTORY_UPLOAD)
    if (input->fastHasAttribute(webkitdirectoryAttr)) {
        receiveDropForDirectoryUpload(paths);
        return true;
    }
#endif

#if ENABLE(FILE_SYSTEM)
    m_droppedFileSystemId = dragData->droppedFileSystemId();
#endif

    Vector<FileChooserFileInfo> files;
    for (unsigned i = 0; i < paths.size(); ++i)
        files.append(FileChooserFileInfo(paths[i]));

    if (input->fastHasAttribute(multipleAttr))
        filesChosen(files);
    else {
        Vector<FileChooserFileInfo> firstFileOnly;
        firstFileOnly.append(files[0]);
        filesChosen(firstFileOnly);
    }
    return true;
}
开发者ID:,项目名称:,代码行数:32,代码来源:

示例2: 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,代码来源:

示例3: receiveDroppedFiles

void FileInputType::receiveDroppedFiles(const Vector<String>& paths)
{
    HTMLInputElement* input = element();
#if ENABLE(DIRECTORY_UPLOAD)
    if (input->fastHasAttribute(webkitdirectoryAttr)) {
        receiveDropForDirectoryUpload(paths);
        return;
    }
#endif

    if (input->fastHasAttribute(multipleAttr))
        filesChosen(paths);
    else {
        Vector<String> firstPathOnly;
        firstPathOnly.append(paths[0]);
        filesChosen(firstPathOnly);
    }
}
开发者ID:1833183060,项目名称:wke,代码行数:18,代码来源:FileInputType.cpp

示例4: allowsMultipleFiles

bool RenderFileUploadControl::allowsMultipleFiles()
{
#if ENABLE(DIRECTORY_UPLOAD)
    if (allowsDirectoryUpload())
      return true;
#endif

    HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
    return input->fastHasAttribute(multipleAttr);
}
开发者ID:DreamOnTheGo,项目名称:src,代码行数:10,代码来源:RenderFileUploadControl.cpp

示例5: receiveDroppedFiles

void FileInputType::receiveDroppedFiles(const Vector<String>& paths)
{
    HTMLInputElement* input = element();
#if ENABLE(DIRECTORY_UPLOAD)
    if (input->fastHasAttribute(webkitdirectoryAttr)) {
        receiveDropForDirectoryUpload(paths);
        return;
    }
#endif

    Vector<FileChooserFileInfo> files;
    for (unsigned i = 0; i < paths.size(); ++i)
        files.append(FileChooserFileInfo(paths[i]));

    if (input->fastHasAttribute(multipleAttr))
        filesChosen(files);
    else {
        Vector<FileChooserFileInfo> firstFileOnly;
        firstFileOnly.append(files[0]);
        filesChosen(firstFileOnly);
    }
}
开发者ID:dzhshf,项目名称:WebKit,代码行数:22,代码来源:FileInputType.cpp

示例6: receiveDroppedFiles

bool FileInputType::receiveDroppedFiles(const DragData& dragData)
{
    Vector<String> paths;
    dragData.asFilenames(paths);
    if (paths.isEmpty())
        return false;

    HTMLInputElement* input = &element();

    Vector<FileChooserFileInfo> files;
    for (unsigned i = 0; i < paths.size(); ++i)
        files.append(FileChooserFileInfo(paths[i]));

    if (input->fastHasAttribute(multipleAttr))
        filesChosen(files);
    else {
        Vector<FileChooserFileInfo> firstFileOnly;
        firstFileOnly.append(files[0]);
        filesChosen(firstFileOnly);
    }
    return true;
}
开发者ID:MYSHLIFE,项目名称:webkit,代码行数:22,代码来源:FileInputType.cpp

示例7: allowsDirectoryUpload

bool RenderFileUploadControl::allowsDirectoryUpload()
{
    HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
    return input->fastHasAttribute(webkitdirectoryAttr);
}
开发者ID:DreamOnTheGo,项目名称:src,代码行数:5,代码来源:RenderFileUploadControl.cpp


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