本文整理汇总了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;
}
示例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();
}
示例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);
}
}
示例4: allowsMultipleFiles
bool RenderFileUploadControl::allowsMultipleFiles()
{
#if ENABLE(DIRECTORY_UPLOAD)
if (allowsDirectoryUpload())
return true;
#endif
HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
return input->fastHasAttribute(multipleAttr);
}
示例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);
}
}
示例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;
}
示例7: allowsDirectoryUpload
bool RenderFileUploadControl::allowsDirectoryUpload()
{
HTMLInputElement* input = static_cast<HTMLInputElement*>(node());
return input->fastHasAttribute(webkitdirectoryAttr);
}