本文整理汇总了C++中HTMLInputElement::findCustomValidationMessageTextDirection方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLInputElement::findCustomValidationMessageTextDirection方法的具体用法?C++ HTMLInputElement::findCustomValidationMessageTextDirection怎么用?C++ HTMLInputElement::findCustomValidationMessageTextDirection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLInputElement
的用法示例。
在下文中一共展示了HTMLInputElement::findCustomValidationMessageTextDirection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: document
TEST_F(HTMLFormControlElementTest, customValidationMessageTextDirection)
{
document().documentElement()->setInnerHTML("<body><input required id=input></body>", ASSERT_NO_EXCEPTION);
document().view()->updateLayoutAndStyleIfNeededRecursive();
HTMLInputElement* input = toHTMLInputElement(document().getElementById("input"));
input->setCustomValidity(String::fromUTF8("\xD8\xB9\xD8\xB1\xD8\xA8\xD9\x89"));
input->setAttribute(HTMLNames::titleAttr, AtomicString::fromUTF8("\xD8\xB9\xD8\xB1\xD8\xA8\xD9\x89"));
String message = input->validationMessage().stripWhiteSpace();
String subMessage = String();
TextDirection messageDir = RTL;
TextDirection subMessageDir = LTR;
input->findCustomValidationMessageTextDirection(message, messageDir, subMessage, subMessageDir);
EXPECT_EQ(RTL, messageDir);
EXPECT_EQ(LTR, subMessageDir);
input->layoutObject()->style()->setDirection(RTL);
input->findCustomValidationMessageTextDirection(message, messageDir, subMessage, subMessageDir);
EXPECT_EQ(RTL, messageDir);
EXPECT_EQ(RTL, subMessageDir);
input->setCustomValidity(String::fromUTF8("Main message."));
message = input->validationMessage().stripWhiteSpace();
input->findCustomValidationMessageTextDirection(message, messageDir, subMessage, subMessageDir);
EXPECT_EQ(LTR, messageDir);
EXPECT_EQ(RTL, subMessageDir);
}