本文整理汇总了C++中HTMLDataListElement类的典型用法代码示例。如果您正苦于以下问题:C++ HTMLDataListElement类的具体用法?C++ HTMLDataListElement怎么用?C++ HTMLDataListElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HTMLDataListElement类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ENABLE
WebNodeCollection WebInputElement::dataListOptions() const
{
#if ENABLE(DATALIST_ELEMENT)
HTMLDataListElement* dataList = static_cast<HTMLDataListElement*>(constUnwrap<HTMLInputElement>()->list());
if (dataList)
return WebNodeCollection(dataList->options());
#endif
return WebNodeCollection();
}
示例2: element
Vector<Color> ColorInputType::suggestions() const
{
Vector<Color> suggestions;
if (RuntimeEnabledFeatures::dataListElementEnabled()) {
HTMLDataListElement* dataList = element()->dataList();
if (dataList) {
RefPtr<HTMLCollection> options = dataList->options();
for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement(options->item(i)); i++) {
if (!element()->isValidValue(option->value()))
continue;
Color color(option->value());
if (!color.isValid())
continue;
suggestions.append(color);
}
}
}
return suggestions;
}
示例3: ENABLE
Vector<Color> ColorInputType::suggestions() const
{
Vector<Color> suggestions;
#if ENABLE(DATALIST_ELEMENT)
HTMLDataListElement* dataList = element().dataList();
if (dataList) {
RefPtr<HTMLCollection> options = dataList->options();
for (unsigned i = 0; HTMLOptionElement* option = toHTMLOptionElement(options->item(i)); i++) {
if (!element().isValidValue(option->value()))
continue;
Color color(option->value());
if (!color.isValid())
continue;
suggestions.append(color);
}
}
#endif
return suggestions;
}
示例4: element
Vector<ColorSuggestion> ColorInputType::suggestions() const
{
Vector<ColorSuggestion> suggestions;
HTMLDataListElement* dataList = element().dataList();
if (dataList) {
RefPtrWillBeRawPtr<HTMLDataListOptionsCollection> options = dataList->options();
for (unsigned i = 0; HTMLOptionElement* option = options->item(i); i++) {
if (!element().isValidValue(option->value()))
continue;
Color color;
if (!color.setFromString(option->value()))
continue;
ColorSuggestion suggestion(color, option->label().left(maxSuggestionLabelLength));
suggestions.append(suggestion);
if (suggestions.size() >= maxSuggestions)
break;
}
}
return suggestions;
}
示例5: element
void RangeInputType::updateTickMarkValues() {
if (!m_tickMarkValuesDirty)
return;
m_tickMarkValues.clear();
m_tickMarkValuesDirty = false;
HTMLDataListElement* dataList = element().dataList();
if (!dataList)
return;
HTMLDataListOptionsCollection* options = dataList->options();
m_tickMarkValues.reserveCapacity(options->length());
for (unsigned i = 0; i < options->length(); ++i) {
HTMLOptionElement* optionElement = options->item(i);
String optionValue = optionElement->value();
if (!this->element().isValidValue(optionValue))
continue;
m_tickMarkValues.append(parseToNumber(optionValue, Decimal::nan()));
}
m_tickMarkValues.shrinkToFit();
nonCopyingSort(m_tickMarkValues.begin(), m_tickMarkValues.end(),
decimalCompare);
}
示例6: element
void RangeInputType::updateTickMarkValues()
{
if (!m_tickMarkValuesDirty)
return;
m_tickMarkValues.clear();
m_tickMarkValuesDirty = false;
HTMLDataListElement* dataList = element().dataList();
if (!dataList)
return;
Ref<HTMLCollection> options = dataList->options();
m_tickMarkValues.reserveCapacity(options->length());
for (unsigned i = 0; i < options->length(); ++i) {
Node* node = options->item(i);
HTMLOptionElement& optionElement = downcast<HTMLOptionElement>(*node);
String optionValue = optionElement.value();
if (!element().isValidValue(optionValue))
continue;
m_tickMarkValues.append(parseToNumber(optionValue, Decimal::nan()));
}
m_tickMarkValues.shrinkToFit();
std::sort(m_tickMarkValues.begin(), m_tickMarkValues.end());
}