本文整理汇总了C++中HTMLSelectElement::setBooleanAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLSelectElement::setBooleanAttribute方法的具体用法?C++ HTMLSelectElement::setBooleanAttribute怎么用?C++ HTMLSelectElement::setBooleanAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLSelectElement
的用法示例。
在下文中一共展示了HTMLSelectElement::setBooleanAttribute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: document
TEST_F(HTMLSelectElementTest, DefaultToolTip)
{
document().documentElement()->setInnerHTML("<select size=4><option value="">Placeholder</option><optgroup><option>o2</option></optgroup></select>", ASSERT_NO_EXCEPTION);
document().view()->updateAllLifecyclePhases();
HTMLSelectElement* select = toHTMLSelectElement(document().body()->firstChild());
Element* option = toElement(select->firstChild());
Element* optgroup = toElement(option->nextSibling());
EXPECT_EQ(String(), select->defaultToolTip()) << "defaultToolTip for SELECT without FORM and without required attribute should return null string.";
EXPECT_EQ(select->defaultToolTip(), option->defaultToolTip());
EXPECT_EQ(select->defaultToolTip(), optgroup->defaultToolTip());
select->setBooleanAttribute(HTMLNames::requiredAttr, true);
EXPECT_EQ("<<ValidationValueMissingForSelect>>", select->defaultToolTip()) << "defaultToolTip for SELECT without FORM and with required attribute should return a valueMissing message.";
EXPECT_EQ(select->defaultToolTip(), option->defaultToolTip());
EXPECT_EQ(select->defaultToolTip(), optgroup->defaultToolTip());
HTMLFormElement* form = HTMLFormElement::create(document());
document().body()->appendChild(form);
form->appendChild(select);
EXPECT_EQ("<<ValidationValueMissingForSelect>>", select->defaultToolTip()) << "defaultToolTip for SELECT with FORM and required attribute should return a valueMissing message.";
EXPECT_EQ(select->defaultToolTip(), option->defaultToolTip());
EXPECT_EQ(select->defaultToolTip(), optgroup->defaultToolTip());
form->setBooleanAttribute(HTMLNames::novalidateAttr, true);
EXPECT_EQ(String(), select->defaultToolTip()) << "defaultToolTip for SELECT with FORM[novalidate] and required attribute should return null string.";
EXPECT_EQ(select->defaultToolTip(), option->defaultToolTip());
EXPECT_EQ(select->defaultToolTip(), optgroup->defaultToolTip());
option->remove();
optgroup->remove();
EXPECT_EQ(String(), option->defaultToolTip());
EXPECT_EQ(String(), optgroup->defaultToolTip());
}
示例2: autofocusAttrSetter
static void autofocusAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.HTMLSelectElement.autofocus._set");
HTMLSelectElement* imp = V8HTMLSelectElement::toNative(info.Holder());
bool v = value->BooleanValue();
imp->setBooleanAttribute(WebCore::HTMLNames::autofocusAttr, v);
return;
}
示例3: setJSHTMLSelectElementRequired
void setJSHTMLSelectElementRequired(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSHTMLSelectElement* castedThis = static_cast<JSHTMLSelectElement*>(thisObject);
HTMLSelectElement* imp = static_cast<HTMLSelectElement*>(castedThis->impl());
imp->setBooleanAttribute(WebCore::HTMLNames::requiredAttr, value.toBoolean(exec));
}