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


C++ VisibleSelection::rootEditableElement方法代码示例

本文整理汇总了C++中VisibleSelection::rootEditableElement方法的典型用法代码示例。如果您正苦于以下问题:C++ VisibleSelection::rootEditableElement方法的具体用法?C++ VisibleSelection::rootEditableElement怎么用?C++ VisibleSelection::rootEditableElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VisibleSelection的用法示例。


在下文中一共展示了VisibleSelection::rootEditableElement方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setEndingSelection

void EditCommand::setEndingSelection(const VisibleSelection &s)
{
    Element* root = s.rootEditableElement();
    for (EditCommand* cmd = this; cmd; cmd = cmd->m_parent) {
        cmd->m_endingSelection = s;
        cmd->m_endingRootEditableElement = root;
    }
}
开发者ID:13W,项目名称:phantomjs,代码行数:8,代码来源:EditCommand.cpp

示例2: canAppendNewLineFeedToSelection

bool canAppendNewLineFeedToSelection(const VisibleSelection& selection)
{
    Node* node = selection.rootEditableElement();
    if (!node)
        return false;
    
    RefPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(String("\n"));
    node->dispatchEvent(event, IGNORE_EXCEPTION);
    return event->text().length();
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:10,代码来源:TextInsertionBaseCommand.cpp

示例3: canAppendNewLineFeedToSelection

bool canAppendNewLineFeedToSelection(const VisibleSelection& selection)
{
    Element* element = selection.rootEditableElement();
    if (!element)
        return false;

    RefPtrWillBeRawPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(String("\n"));
    element->dispatchEvent(event);
    return event->text().length();
}
开发者ID:Pluto-tv,项目名称:blink-crosswalk,代码行数:10,代码来源:TextInsertionBaseCommand.cpp

示例4: setStartingSelection

void EditCommand::setStartingSelection(const VisibleSelection& s)
{
    Element* root = s.rootEditableElement();
    for (EditCommand* cmd = this; ; cmd = cmd->m_parent) {
        cmd->m_startingSelection = s;
        cmd->m_startingRootEditableElement = root;
        if (!cmd->m_parent || cmd->m_parent->isFirstCommand(cmd))
            break;
    }
}
开发者ID:13W,项目名称:phantomjs,代码行数:10,代码来源:EditCommand.cpp

示例5: canAppendNewLineFeed

static bool canAppendNewLineFeed(const VisibleSelection& selection)
{
    Node* node = selection.rootEditableElement();
    if (!node)
        return false;

    RefPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(String("\n"));
    ExceptionCode ec = 0;
    node->dispatchEvent(event, ec);
    return event->text().length();
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例6: toggleContinuousSpellChecking

void EditorClientImpl::toggleContinuousSpellChecking()
{
    if (isContinuousSpellCheckingEnabled()) {
        m_spellCheckThisFieldStatus = SpellCheckForcedOff;
    } else {
        m_spellCheckThisFieldStatus = SpellCheckForcedOn;
        const Frame* frame = m_webView->focusedWebCoreFrame();
        if (frame) {
            VisibleSelection frameSelection = frame->selection()->selection();
            Element* rootEditableElement = frameSelection.rootEditableElement();
            // If a selection is in an editable element spell check its content.
            if (rootEditableElement) {
                VisibleSelection selection = VisibleSelection::selectionFromContentsOfNode(rootEditableElement);
                frame->editor()->markMisspellingsAndBadGrammar(selection);
            }
        }
    }
}
开发者ID:windyuuy,项目名称:opera,代码行数:18,代码来源:EditorClientImpl.cpp

示例7: toggleContinuousSpellChecking

void EditorClientImpl::toggleContinuousSpellChecking()
{
    if (isContinuousSpellCheckingEnabled()) {
        m_spellCheckThisFieldStatus = SpellCheckForcedOff;
        if (Page* page = m_webView->page()) {
            for (Frame* frame = page->mainFrame(); frame && frame->document(); frame = frame->tree()->traverseNext()) {
                frame->document()->markers()->removeMarkers(DocumentMarker::MisspellingMarkers());
            }
        }
    } else {
        m_spellCheckThisFieldStatus = SpellCheckForcedOn;
        if (Frame* frame = m_webView->focusedWebCoreFrame()) {
            VisibleSelection frameSelection = frame->selection().selection();
            // If a selection is in an editable element spell check its content.
            if (Element* rootEditableElement = frameSelection.rootEditableElement()) {
                frame->editor().elementDidBeginEditing(rootEditableElement);
            }
        }
    }
}
开发者ID:huningxin,项目名称:blink-crosswalk,代码行数:20,代码来源:EditorClientImpl.cpp


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