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


C++ LocalFrame类代码示例

本文整理汇总了C++中LocalFrame的典型用法代码示例。如果您正苦于以下问题:C++ LocalFrame类的具体用法?C++ LocalFrame怎么用?C++ LocalFrame使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: hasFocus

bool InputMethodContext::hasFocus() const
{
    LocalFrame* frame = m_element->document().frame();
    if (!frame)
        return false;

    const Element* element = frame->document()->focusedElement();
    return element && element->isHTMLElement() && m_element == toHTMLElement(element);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:9,代码来源:InputMethodContext.cpp

示例2: pageZoomFactor

static float pageZoomFactor(const UIEvent* event)
{
    if (!event->view() || !event->view()->isLocalDOMWindow())
        return 1;
    LocalFrame* frame = toLocalDOMWindow(event->view())->frame();
    if (!frame)
        return 1;
    return frame->pageZoomFactor();
}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:9,代码来源:MouseRelatedEvent.cpp

示例3: toPluginView

void HTMLPlugInElement::registerAsRenderless(Widget* widget)
{
    if (!widget || !widget->isPluginView())
        return;

    LocalFrame* frame = toPluginView(widget)->pluginFrame();
    ASSERT(frame);
    frame->registerPluginElement(this);
}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例4: ASSERT

int HTMLTextFormControlElement::computeSelectionEnd() const
{
    ASSERT(isTextFormControl());
    LocalFrame* frame = document().frame();
    if (!frame)
        return 0;

    return indexForVisiblePosition(VisiblePosition(frame->selection().end()));
}
开发者ID:jeremyroman,项目名称:blink,代码行数:9,代码来源:HTMLTextFormControlElement.cpp

示例5: ASSERT

int HTMLTextFormControlElement::computeSelectionStart() const
{
    ASSERT(isTextFormControl());
    LocalFrame* frame = document().frame();
    if (!frame)
        return 0;

    return indexForPosition(innerEditorElement(), frame->selection().start());
}
开发者ID:joone,项目名称:blink-crosswalk,代码行数:9,代码来源:HTMLTextFormControlElement.cpp

示例6: focusedOrMainFrame

bool FocusController::advanceFocusInDocumentOrder(FocusType type, bool initialFocus)
{
    LocalFrame* frame = focusedOrMainFrame();
    ASSERT(frame);
    Document* document = frame->document();

    Node* currentNode = document->focusedElement();

    document->updateLayout();

    RefPtr<Node> node = findFocusableNodeAcrossFocusScope(type, FocusNavigationScope::focusNavigationScopeOf(currentNode ? currentNode : document), currentNode);

    if (!node) {
        // We didn't find a node to focus, so we should try to pass focus to Chrome.
        if (!initialFocus && m_page->canTakeFocus(type)) {
            document->setFocusedElement(nullptr);
            setFocusedFrame(nullptr);
            m_page->takeFocus(type);
            return true;
        }

        // Chrome doesn't want focus, so we should wrap focus.
        node = findFocusableNodeRecursively(type, FocusNavigationScope::focusNavigationScopeOf(m_page->mainFrame()->document()), 0);
        node = findFocusableNodeDecendingDownIntoFrameDocument(type, node.get());

        if (!node)
            return false;
    }

    ASSERT(node);

    if (node == document->focusedElement())
        // Focus wrapped around to the same node.
        return true;

    if (!node->isElementNode())
        // FIXME: May need a way to focus a document here.
        return false;

    Element* element = toElement(node);

    // FIXME: It would be nice to just be able to call setFocusedElement(node)
    // here, but we can't do that because some elements (e.g. HTMLInputElement
    // and HTMLTextAreaElement) do extra work in their focus() methods.
    Document& newDocument = element->document();

    if (&newDocument != document) {
        // Focus is going away from this document, so clear the focused node.
        document->setFocusedElement(nullptr);
    }

    setFocusedFrame(newDocument.frame());

    element->focus(false, type);
    return true;
}
开发者ID:takaaptech,项目名称:sky_engine,代码行数:56,代码来源:FocusController.cpp

示例7: localToPageQuad

static void localToPageQuad(const RenderObject& renderer, const LayoutRect& rect, FloatQuad* quad)
{
    LocalFrame* frame = renderer.frame();
    FrameView* view = frame->view();
    FloatQuad absolute = renderer.localToAbsoluteQuad(FloatQuad(rect));
    quad->setP1(view->contentsToRootView(roundedIntPoint(absolute.p1())));
    quad->setP2(view->contentsToRootView(roundedIntPoint(absolute.p2())));
    quad->setP3(view->contentsToRootView(roundedIntPoint(absolute.p3())));
    quad->setP4(view->contentsToRootView(roundedIntPoint(absolute.p4())));
}
开发者ID:coinpayee,项目名称:blink,代码行数:10,代码来源:InspectorTraceEvents.cpp

示例8: paintCarets

void BlockPainter::paintCarets(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
    LocalFrame* frame = m_layoutBlock.frame();

    if (m_layoutBlock.hasCursorCaret())
        frame->selection().paintCaret(paintInfo.context, paintOffset);

    if (m_layoutBlock.hasDragCaret())
        frame->page()->dragCaretController().paintDragCaret(frame, paintInfo.context, paintOffset);
}
开发者ID:zhihuizhiming,项目名称:chromium,代码行数:10,代码来源:BlockPainter.cpp

示例9: ownerFrame

void TextFinder::unmarkAllTextMatches()
{
    LocalFrame* frame = ownerFrame().frame();
    if (frame && frame->page() && frame->editor().markedTextMatchesAreHighlighted()) {
        if (ownerFrame().client() && ownerFrame().client()->shouldSearchSingleFrame())
            frame->document()->markers().removeMarkers(DocumentMarker::TextMatch);
        else
            frame->page()->unmarkAllTextMatches();
    }
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:10,代码来源:TextFinder.cpp

示例10: mainFrame

void Page::setTimerAlignmentInterval(double interval)
{
    if (interval == m_timerAlignmentInterval)
        return;

    m_timerAlignmentInterval = interval;
    LocalFrame* frame = mainFrame();
    if (frame->document())
        frame->document()->didChangeTimerAlignmentInterval();
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例11: hasAnimations

bool SVGImage::hasAnimations() const
{
    if (!m_page)
        return false;
    LocalFrame* frame = m_page->mainFrame();
    SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement();
    if (!rootElement)
        return false;
    return rootElement->timeContainer()->hasAnimations() || frame->document()->timeline().hasPendingUpdates();
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例12: stopAnimation

void SVGImage::stopAnimation()
{
    if (!m_page)
        return;
    LocalFrame* frame = m_page->mainFrame();
    SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement();
    if (!rootElement)
        return;
    rootElement->pauseAnimations();
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例13: hasRelativeHeight

bool SVGImage::hasRelativeHeight() const
{
    if (!m_page)
        return false;
    LocalFrame* frame = m_page->mainFrame();
    SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement();
    if (!rootElement)
        return false;
    return rootElement->intrinsicHeight().isPercent();
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例14: embeddedContentBox

RenderBox* SVGImage::embeddedContentBox() const
{
    if (!m_page)
        return 0;
    LocalFrame* frame = m_page->mainFrame();
    SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement();
    if (!rootElement)
        return 0;
    return toRenderBox(rootElement->renderer());
}
开发者ID:,项目名称:,代码行数:10,代码来源:

示例15: TEST

TEST(MediaQueryEvaluatorTest, DynamicNoView) {
  std::unique_ptr<DummyPageHolder> pageHolder =
      DummyPageHolder::create(IntSize(500, 500));
  LocalFrame* frame = &pageHolder->frame();
  pageHolder.reset();
  ASSERT_EQ(nullptr, frame->view());
  MediaQueryEvaluator mediaQueryEvaluator(frame);
  MediaQuerySet* querySet = MediaQuerySet::create("foobar");
  EXPECT_FALSE(mediaQueryEvaluator.eval(querySet));
}
开发者ID:mirror,项目名称:chromium,代码行数:10,代码来源:MediaQueryEvaluatorTest.cpp


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