本文整理汇总了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);
}
示例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();
}
示例3: toPluginView
void HTMLPlugInElement::registerAsRenderless(Widget* widget)
{
if (!widget || !widget->isPluginView())
return;
LocalFrame* frame = toPluginView(widget)->pluginFrame();
ASSERT(frame);
frame->registerPluginElement(this);
}
示例4: ASSERT
int HTMLTextFormControlElement::computeSelectionEnd() const
{
ASSERT(isTextFormControl());
LocalFrame* frame = document().frame();
if (!frame)
return 0;
return indexForVisiblePosition(VisiblePosition(frame->selection().end()));
}
示例5: ASSERT
int HTMLTextFormControlElement::computeSelectionStart() const
{
ASSERT(isTextFormControl());
LocalFrame* frame = document().frame();
if (!frame)
return 0;
return indexForPosition(innerEditorElement(), frame->selection().start());
}
示例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;
}
示例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())));
}
示例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);
}
示例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();
}
}
示例10: mainFrame
void Page::setTimerAlignmentInterval(double interval)
{
if (interval == m_timerAlignmentInterval)
return;
m_timerAlignmentInterval = interval;
LocalFrame* frame = mainFrame();
if (frame->document())
frame->document()->didChangeTimerAlignmentInterval();
}
示例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();
}
示例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();
}
示例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();
}
示例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());
}
示例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));
}