当前位置: 首页>>代码示例>>C++>>正文


C++ HTMLSelectElement::activeSelectionEndListIndex方法代码示例

本文整理汇总了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());
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:12,代码来源:HTMLSelectElementTest.cpp

示例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;
        }
    }
}
开发者ID:,项目名称:,代码行数:25,代码来源:

示例3: isSelectedOptionActive

bool AccessibilityListBoxOption::isSelectedOptionActive() const
{
    HTMLSelectElement* listBoxParentNode = listBoxOptionParentNode();
    if (!listBoxParentNode)
        return false;

    return listBoxParentNode->activeSelectionEndListIndex() == listBoxOptionIndex();
}
开发者ID:166MMX,项目名称:openjdk.java.net-openjfx-8u40-rt,代码行数:8,代码来源:AccessibilityListBoxOption.cpp

示例4: scrollToRevealSelection

void RenderListBox::scrollToRevealSelection()
{    
    HTMLSelectElement* select = toHTMLSelectElement(node());

    m_scrollToRevealSelectionAfterLayout = false;

    int firstIndex = select->activeSelectionStartListIndex();
    if (firstIndex >= 0 && !listIndexIsVisible(select->activeSelectionEndListIndex()))
        scrollToRevealElementAtListIndex(firstIndex);
}
开发者ID:,项目名称:,代码行数:10,代码来源:


注:本文中的HTMLSelectElement::activeSelectionEndListIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。