本文整理汇总了C++中HTMLSelectElement::activeSelectionEndListIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLSelectElement::activeSelectionEndListIndex方法的具体用法?C++ HTMLSelectElement::activeSelectionEndListIndex怎么用?C++ HTMLSelectElement::activeSelectionEndListIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLSelectElement
的用法示例。
在下文中一共展示了HTMLSelectElement::activeSelectionEndListIndex方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: document
TEST_F(HTMLSelectElementTest, ActiveSelectionEndAfterOptionRemoval)
{
document().documentElement()->setInnerHTML("<select><optgroup><option selected>o1</option></optgroup></select>", ASSERT_NO_EXCEPTION);
document().view()->updateAllLifecyclePhases();
HTMLSelectElement* select = toHTMLSelectElement(document().body()->firstChild());
HTMLOptionElement* option = toHTMLOptionElement(select->firstChild()->firstChild());
EXPECT_EQ(1, select->activeSelectionEndListIndex());
select->firstChild()->removeChild(option, ASSERT_NO_EXCEPTION);
EXPECT_EQ(-1, select->activeSelectionEndListIndex());
select->appendChild(option, ASSERT_NO_EXCEPTION);
EXPECT_EQ(1, select->activeSelectionEndListIndex());
}
示例2: addFocusRingRects
void RenderListBox::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset)
{
if (!isSpatialNavigationEnabled(frame()))
return RenderBlock::addFocusRingRects(rects, additionalOffset);
HTMLSelectElement* select = toHTMLSelectElement(node());
// Focus the last selected item.
int selectedItem = select->activeSelectionEndListIndex();
if (selectedItem >= 0) {
rects.append(itemBoundingBoxRect(additionalOffset, selectedItem));
return;
}
// No selected items, find the first non-disabled item.
int size = numItems();
const Vector<HTMLElement*>& listItems = select->listItems();
for (int i = 0; i < size; ++i) {
HTMLElement* element = listItems[i];
if (element->hasTagName(optionTag) && !toHTMLOptionElement(element)->disabled()) {
rects.append(itemBoundingBoxRect(additionalOffset, i));
return;
}
}
}
示例3: isSelectedOptionActive
bool AccessibilityListBoxOption::isSelectedOptionActive() const
{
HTMLSelectElement* listBoxParentNode = listBoxOptionParentNode();
if (!listBoxParentNode)
return false;
return listBoxParentNode->activeSelectionEndListIndex() == listBoxOptionIndex();
}
示例4: scrollToRevealSelection
void RenderListBox::scrollToRevealSelection()
{
HTMLSelectElement* select = toHTMLSelectElement(node());
m_scrollToRevealSelectionAfterLayout = false;
int firstIndex = select->activeSelectionStartListIndex();
if (firstIndex >= 0 && !listIndexIsVisible(select->activeSelectionEndListIndex()))
scrollToRevealElementAtListIndex(firstIndex);
}