本文整理汇总了C++中WebFrame::nextSibling方法的典型用法代码示例。如果您正苦于以下问题:C++ WebFrame::nextSibling方法的具体用法?C++ WebFrame::nextSibling怎么用?C++ WebFrame::nextSibling使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebFrame
的用法示例。
在下文中一共展示了WebFrame::nextSibling方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dumpFramesAsPrintedText
static string dumpFramesAsPrintedText(WebFrame* frame, bool recursive)
{
string result;
// Cannot do printed format for anything other than HTML
if (!frame->document().isHTMLDocument())
return string();
// Add header for all but the main frame. Skip empty frames.
if (frame->parent() && !frame->document().documentElement().isNull()) {
result.append("\n--------\nFrame: '");
result.append(frame->name().utf8().data());
result.append("'\n--------\n");
}
result.append(frame->renderTreeAsText(WebFrame::RenderAsTextPrinting).utf8());
result.append("\n");
if (recursive) {
for (WebFrame* child = frame->firstChild(); child; child = child->nextSibling())
result.append(dumpFramesAsPrintedText(child, recursive));
}
return result;
}
示例2: traceFramesImpl
ALWAYS_INLINE void WebFrame::traceFramesImpl(VisitorDispatcher visitor, WebFrame* frame)
{
ASSERT(frame);
traceFrame(visitor, frame->m_parent);
for (WebFrame* child = frame->firstChild(); child; child = child->nextSibling())
traceFrame(visitor, child);
// m_opener is a weak reference.
frame->m_openedFrameTracker->traceFrames(visitor);
}
示例3: dumpFrameScrollPosition
static void dumpFrameScrollPosition(WebFrame* frame, bool recursive)
{
WebSize offset = frame->scrollOffset();
if (offset.width > 0 || offset.height > 0) {
if (frame->parent())
printf("frame '%s' ", frame->name().utf8().data());
printf("scrolled to %d,%d\n", offset.width, offset.height);
}
if (!recursive)
return;
for (WebFrame* child = frame->firstChild(); child; child = child->nextSibling())
dumpFrameScrollPosition(child, recursive);
}
示例4: runIFrameTest
void TouchActionTest::runIFrameTest(std::string file) {
TouchActionTrackingWebViewClient client;
WebView* webView = setupTest(file, client);
WebFrame* curFrame = webView->mainFrame()->firstChild();
ASSERT_TRUE(curFrame);
for (; curFrame; curFrame = curFrame->nextSibling()) {
// Oilpan: see runTouchActionTest() comment why these are persistent
// references.
Persistent<Document> contentDoc =
static_cast<Document*>(curFrame->document());
runTestOnTree(contentDoc.get(), webView, client);
}
// Explicitly reset to break dependency on locally scoped client.
m_webViewHelper.reset();
}
示例5: updateFindMatchRects
void TextFinder::updateFindMatchRects() {
IntSize currentContentsSize = ownerFrame().contentsSize();
if (m_contentsSizeForCurrentFindMatchRects != currentContentsSize) {
m_contentsSizeForCurrentFindMatchRects = currentContentsSize;
m_findMatchRectsAreValid = false;
}
size_t deadMatches = 0;
for (FindMatch& match : m_findMatchesCache) {
if (!match.m_range->boundaryPointsValid() ||
!match.m_range->startContainer()->isConnected())
match.m_rect = FloatRect();
else if (!m_findMatchRectsAreValid)
match.m_rect = findInPageRectFromRange(match.m_range.get());
if (match.m_rect.isEmpty())
++deadMatches;
}
// Remove any invalid matches from the cache.
if (deadMatches) {
HeapVector<FindMatch> filteredMatches;
filteredMatches.reserveCapacity(m_findMatchesCache.size() - deadMatches);
for (const FindMatch& match : m_findMatchesCache) {
if (!match.m_rect.isEmpty())
filteredMatches.append(match);
}
m_findMatchesCache.swap(filteredMatches);
}
// Invalidate the rects in child frames. Will be updated later during
// traversal.
if (!m_findMatchRectsAreValid)
for (WebFrame* child = ownerFrame().firstChild(); child;
child = child->nextSibling())
toWebLocalFrameImpl(child)->ensureTextFinder().m_findMatchRectsAreValid =
false;
m_findMatchRectsAreValid = true;
}
示例6: dumpFramesAsText
static string dumpFramesAsText(WebFrame* frame, bool recursive)
{
string result;
// Add header for all but the main frame. Skip empty frames.
if (frame->parent() && !frame->document().documentElement().isNull()) {
result.append("\n--------\nFrame: '");
result.append(frame->name().utf8().data());
result.append("'\n--------\n");
}
result.append(dumpDocumentText(frame));
result.append("\n");
if (recursive) {
for (WebFrame* child = frame->firstChild(); child; child = child->nextSibling())
result.append(dumpFramesAsText(child, recursive));
}
return result;
}
示例7: updateFindMatchRects
void TextFinder::updateFindMatchRects()
{
IntSize currentContentsSize = m_ownerFrame.contentsSize();
if (m_contentsSizeForCurrentFindMatchRects != currentContentsSize) {
m_contentsSizeForCurrentFindMatchRects = currentContentsSize;
m_findMatchRectsAreValid = false;
}
size_t deadMatches = 0;
for (Vector<FindMatch>::iterator it = m_findMatchesCache.begin(); it != m_findMatchesCache.end(); ++it) {
if (!it->m_range->boundaryPointsValid() || !it->m_range->startContainer()->inDocument())
it->m_rect = FloatRect();
else if (!m_findMatchRectsAreValid)
it->m_rect = findInPageRectFromRange(it->m_range.get());
if (it->m_rect.isEmpty())
++deadMatches;
}
// Remove any invalid matches from the cache.
if (deadMatches) {
WillBeHeapVector<FindMatch> filteredMatches;
filteredMatches.reserveCapacity(m_findMatchesCache.size() - deadMatches);
for (Vector<FindMatch>::const_iterator it = m_findMatchesCache.begin(); it != m_findMatchesCache.end(); ++it) {
if (!it->m_rect.isEmpty())
filteredMatches.append(*it);
}
m_findMatchesCache.swap(filteredMatches);
}
// Invalidate the rects in child frames. Will be updated later during traversal.
if (!m_findMatchRectsAreValid)
for (WebFrame* child = m_ownerFrame.firstChild(); child; child = child->nextSibling())
toWebLocalFrameImpl(child)->ensureTextFinder().m_findMatchRectsAreValid = false;
m_findMatchRectsAreValid = true;
}