本文整理汇总了C++中webcore::Frame::document方法的典型用法代码示例。如果您正苦于以下问题:C++ Frame::document方法的具体用法?C++ Frame::document怎么用?C++ Frame::document使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webcore::Frame
的用法示例。
在下文中一共展示了Frame::document方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WKAccessibilityRootObject
void* WKAccessibilityRootObject(WKBundlePageRef pageRef)
{
#if HAVE(ACCESSIBILITY)
if (!pageRef)
return 0;
WebCore::Page* page = toImpl(pageRef)->corePage();
if (!page)
return 0;
WebCore::Frame* core = page->mainFrame();
if (!core || !core->document())
return 0;
WebCore::AXObjectCache::enableAccessibility();
WebCore::AccessibilityObject* root = core->document()->axObjectCache()->rootObject();
if (!root)
return 0;
return root->wrapper();
#else
return 0;
#endif
}
示例2: printFrames
static void printFrames(const WebCore::Frame& frame, const WebCore::Frame* targetFrame, int indent)
{
if (&frame == targetFrame) {
printf("--> ");
printIndent(indent - 1);
} else
printIndent(indent);
WebCore::FrameView* view = frame.view();
printf("Frame %p %dx%d\n", &frame, view ? view->width() : 0, view ? view->height() : 0);
printIndent(indent);
printf(" ownerElement=%p\n", frame.ownerElement());
printIndent(indent);
printf(" frameView=%p (needs layout %d)\n", view, view ? view->needsLayout() : false);
printIndent(indent);
printf(" renderView=%p\n", view ? view->renderView() : nullptr);
printIndent(indent);
printf(" ownerRenderer=%p\n", frame.ownerRenderer());
printIndent(indent);
printf(" document=%p (needs style recalc %d)\n", frame.document(), frame.document() ? frame.document()->childNeedsStyleRecalc() : false);
printIndent(indent);
printf(" uri=%s\n", frame.document()->documentURI().utf8().data());
for (WebCore::Frame* child = frame.tree().firstChild(); child; child = child->tree().nextSibling())
printFrames(*child, targetFrame, indent + 1);
}
示例3: WebCoreEditCommandPrivate
wxWebEditCommand::wxWebEditCommand(wxWebFrame* webframe)
{
if (webframe) {
WebCore::Frame* frame = webframe->GetFrame();
if (frame && frame->document())
m_impl = new WebCoreEditCommandPrivate(new WebCore::WebCoreEditCommand(frame->document()));
}
}
示例4: retrieveCachedResource
// SAMSUNG CHANGE : CopyImage >>
// Copy Image Issue on Nested Frame
CachedResource *retrieveCachedResource(Frame* frame, String imageUrl)
{
if (NULL == frame || imageUrl.isEmpty())
return NULL;
FrameTree *frameTree = frame->tree();
if (!frameTree)
return frame->document()->cachedResourceLoader()->cachedResource(imageUrl);
WebCore::Frame *childFrame = frameTree->firstChild();
Document *childFrameDocument = NULL;
CachedResource* cachedResource = NULL;
while (childFrame)
{
childFrameDocument = childFrame->document();
if (childFrameDocument)
{
cachedResource = childFrameDocument->cachedResourceLoader()->cachedResource(imageUrl);
if (cachedResource)
break;
}
cachedResource = retrieveCachedResource(childFrame, imageUrl);
if (cachedResource)
break;
childFrame = childFrame->tree()->nextSibling();
}
if (cachedResource)
return cachedResource;
else
return frame->document()->cachedResourceLoader()->cachedResource(imageUrl);
}
开发者ID:johnwpoliver,项目名称:Samsung-GT-P3113-AOSP-CM-Kernel-and-Ramdisk,代码行数:34,代码来源:PasteBoardAndroid.cpp
示例5: JumpToId
bool ViewNavigationDelegate::JumpToId(const char* jumpToId)
{
WebCore::Frame* pFrame = mView->GetFrame();
// Search for the desired element in all the frames
while(pFrame)
{
WebCore::Document* document = pFrame->document();
EAW_ASSERT(document);
if (document)
{
JumpToElementWithIdDelegate delegate1(mView, jumpToId);
DOMWalker<JumpToElementWithIdDelegate> walker(document, delegate1);
WebCore::Element* element = delegate1.FoundElement();
if (element)
{
return true;
}
}
pFrame = pFrame->tree()->traverseNext();
}
return false;
}
示例6: ClickElementsByIdOrClass
bool ViewNavigationDelegate::ClickElementsByIdOrClass(const char* idOrClassName)
{
EAW_ASSERT(idOrClassName);
if(!idOrClassName || !idOrClassName[0])
return false;
IOverlayInputClient* pOverlayInputClient = mView->GetOverlayInputClient();
if(pOverlayInputClient)
pOverlayInputClient->OnFocusChangeEvent(false);
bool elementClicked = false;
WebCore::Frame* pFrame = mView->GetFrame();
while(pFrame)
{
WebCore::Document* document = pFrame->document();
EAW_ASSERT(document);
ClickElementsByIdOrClassDelegate delegate(idOrClassName, true);
DOMWalker<ClickElementsByIdOrClassDelegate> walker(document, delegate);
elementClicked = delegate.GetReturnValue();
if(elementClicked)
break;
pFrame = pFrame->tree()->traverseNext();
}
return elementClicked;
}
示例7: selectedRange
bool DumpRenderTreeSupportEfl::selectedRange(Evas_Object* ewkView, int* start, int* length)
{
if (!(start && length))
return false;
DRT_SUPPRT_PAGE_GET_OR_RETURN(ewkView, page, false);
if (!page->focusController() || !page->focusController()->focusedOrMainFrame())
return false;
WebCore::Frame* frame = page->focusController()->focusedOrMainFrame();
RefPtr<WebCore::Range> range = frame->selection()->toNormalizedRange().get();
if (!range)
return false;
WebCore::Element* selectionRoot = frame->selection()->rootEditableElement();
WebCore::Element* scope = selectionRoot ? selectionRoot : frame->document()->documentElement();
RefPtr<WebCore::Range> testRange = WebCore::Range::create(scope->document(), scope, 0, range->startContainer(), range->startOffset());
*start = WebCore::TextIterator::rangeLength(testRange.get());
WebCore::ExceptionCode ec;
testRange->setEnd(range->endContainer(), range->endOffset(), ec);
*length = WebCore::TextIterator::rangeLength(testRange.get());
return true;
}
示例8: OnPaint
void wxWebView::OnPaint(wxPaintEvent& event)
{
if (m_beingDestroyed || !m_mainFrame)
return;
WebCore::Frame* frame = m_mainFrame->GetFrame();
if (!frame || !frame->view())
return;
wxAutoBufferedPaintDC dc(this);
if (IsShown() && frame->document()) {
#if USE(WXGC)
wxGCDC gcdc(dc);
#endif
if (dc.IsOk()) {
wxRect paintRect = GetUpdateRegion().GetBox();
#if USE(WXGC)
WebCore::GraphicsContext gc(&gcdc);
#else
WebCore::GraphicsContext gc(&dc);
#endif
if (frame->contentRenderer()) {
frame->view()->layoutIfNeededRecursive();
frame->view()->paint(&gc, paintRect);
}
}
}
}
示例9: fromDocumentRange
// static
WebRange WebRange::fromDocumentRange(WebFrame* frame, int start, int length)
{
WebCore::Frame* webFrame = static_cast<WebFrameImpl*>(frame)->frame();
Element* selectionRoot = webFrame->selection()->rootEditableElement();
Element* scope = selectionRoot ? selectionRoot : webFrame->document()->documentElement();
return TextIterator::rangeFromLocationAndLength(scope, start, length);
}
示例10: setMediaType
void DumpRenderTreeSupportQt::setMediaType(QWebFrame* frame, const QString& type)
{
WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
WebCore::FrameView* view = coreFrame->view();
view->setMediaType(type);
coreFrame->document()->styleSelectorChanged(RecalcStyleImmediately);
view->layout();
}
示例11: handleMouseWheelChanged
void BWebPage::handleMouseWheelChanged(BMessage* message)
{
WebCore::Frame* frame = fMainFrame->Frame();
if (!frame->view() || !frame->document())
return;
PlatformWheelEvent event(message);
frame->eventHandler()->handleWheelEvent(event);
}
示例12: OnPaint
void WebView::OnPaint(wxPaintEvent& event)
{
if (m_beingDestroyed || !m_mainFrame)
return;
WebCore::Frame* frame = m_mainFrame->GetFrame();
if (!frame || !frame->view())
return;
// we can't use wxAutoBufferedPaintDC here because it will not create
// a 32-bit bitmap for its buffer.
#if __WXMSW__
wxPaintDC paintdc(this);
int width, height;
paintdc.GetSize(&width, &height);
wxBitmap bitmap(width, height, 32);
wxMemoryDC dc(bitmap);
#else
wxPaintDC dc(this);
#endif
if (IsShown() && frame->document()) {
#if USE(WXGC)
#if wxCHECK_VERSION(2, 9, 2) && defined(wxUSE_CAIRO) && wxUSE_CAIRO
wxGraphicsRenderer* renderer = wxGraphicsRenderer::GetCairoRenderer();
if (!renderer)
renderer = wxGraphicsRenderer::GetDefaultRenderer();
wxGraphicsContext* context = renderer->CreateContext(dc);
wxGCDC gcdc(context);
#else
wxGCDC gcdc(dc);
#endif
#endif
if (dc.IsOk()) {
wxRect paintRect = GetUpdateRegion().GetBox();
#if USE(WXGC)
WebCore::GraphicsContext gc(&gcdc);
#else
WebCore::GraphicsContext gc(&dc);
#endif
if (frame->contentRenderer()) {
frame->view()->updateLayoutAndStyleIfNeededRecursive();
frame->view()->paint(&gc, paintRect);
#if __WXMSW__
dc.SelectObject(wxNullBitmap);
paintdc.DrawBitmap(bitmap, 0, 0);
#endif
}
}
}
}
示例13: handleKeyEvent
void BWebPage::handleKeyEvent(BMessage* message)
{
WebCore::Frame* frame = fPage->focusController()->focusedOrMainFrame();
if (!frame->view() || !frame->document())
return;
PlatformKeyboardEvent event(message);
// Try to let WebCore handle this event
if (!frame->eventHandler()->keyEvent(event) && message->what == B_KEY_DOWN) {
// Handle keyboard scrolling (probably should be extracted to a method.)
ScrollDirection direction;
ScrollGranularity granularity;
BString bytes = message->FindString("bytes");
switch (bytes.ByteAt(0)) {
case B_UP_ARROW:
granularity = ScrollByLine;
direction = ScrollUp;
break;
case B_DOWN_ARROW:
granularity = ScrollByLine;
direction = ScrollDown;
break;
case B_LEFT_ARROW:
granularity = ScrollByLine;
direction = ScrollLeft;
break;
case B_RIGHT_ARROW:
granularity = ScrollByLine;
direction = ScrollRight;
break;
case B_HOME:
granularity = ScrollByDocument;
direction = ScrollUp;
break;
case B_END:
granularity = ScrollByDocument;
direction = ScrollDown;
break;
case B_PAGE_UP:
granularity = ScrollByPage;
direction = ScrollUp;
break;
case B_PAGE_DOWN:
granularity = ScrollByPage;
direction = ScrollDown;
break;
default:
return;
}
frame->eventHandler()->scrollRecursively(direction, granularity);
}
}
示例14: printFrames
static void printFrames(const WebCore::Frame& frame, const WebCore::Frame* targetFrame, int indent)
{
if (&frame == targetFrame) {
printf("--> ");
printIndent(indent - 1);
} else
printIndent(indent);
WebCore::FrameView* view = frame.view();
printf("Frame %p %dx%d\n", &frame, view ? view->width() : 0, view ? view->height() : 0);
printIndent(indent);
printf(" ownerElement=%p\n", frame.ownerElement());
printIndent(indent);
printf(" frameView=%p\n", view);
printIndent(indent);
printf(" document=%p\n", frame.document());
printIndent(indent);
printf(" uri=%s\n\n", frame.document()->documentURI().utf8().data());
for (WebCore::Frame* child = frame.tree().firstChild(); child; child = child->tree().nextSibling())
printFrames(*child, targetFrame, indent + 1);
}
示例15: pauseTransition
bool DumpRenderTreeSupportEfl::pauseTransition(Evas_Object* ewkFrame, const char* name, const char* elementId, double time)
{
WebCore::Frame* frame = EWKPrivate::coreFrame(ewkFrame);
if (!frame)
return false;
WebCore::Element* element = frame->document()->getElementById(elementId);
if (!element || !element->renderer())
return false;
return frame->animation()->pauseTransitionAtTime(element->renderer(), name, time);
}