本文整理汇总了C++中FrameView::fixedElementsLayoutRelativeToFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameView::fixedElementsLayoutRelativeToFrame方法的具体用法?C++ FrameView::fixedElementsLayoutRelativeToFrame怎么用?C++ FrameView::fixedElementsLayoutRelativeToFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FrameView
的用法示例。
在下文中一共展示了FrameView::fixedElementsLayoutRelativeToFrame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setPageScaleFactor
void Page::setPageScaleFactor(float scale, const IntPoint& origin)
{
Document* document = mainFrame()->document();
FrameView* view = document->view();
if (scale == m_pageScaleFactor) {
if (view && (view->scrollPosition() != origin || view->delegatesScrolling())) {
if (!m_settings->applyPageScaleFactorInCompositor())
document->updateLayoutIgnorePendingStylesheets();
view->setScrollPosition(origin);
}
return;
}
m_pageScaleFactor = scale;
if (!m_settings->applyPageScaleFactorInCompositor()) {
if (document->renderer())
document->renderer()->setNeedsLayout(true);
document->recalcStyle(Style::Force);
// Transform change on RenderView doesn't trigger repaint on non-composited contents.
mainFrame()->view()->invalidateRect(IntRect(LayoutRect::infiniteRect()));
}
#if USE(ACCELERATED_COMPOSITING)
mainFrame()->deviceOrPageScaleFactorChanged();
#endif
if (view && view->fixedElementsLayoutRelativeToFrame())
view->setViewportConstrainedObjectsNeedLayout();
if (view && view->scrollPosition() != origin) {
if (!m_settings->applyPageScaleFactorInCompositor() && document->renderer() && document->renderer()->needsLayout() && view->didFirstLayout())
view->layout();
view->setScrollPosition(origin);
}
}
示例2: frameViewLayoutUpdated
void AsyncScrollingCoordinator::frameViewLayoutUpdated(FrameView& frameView)
{
ASSERT(isMainThread());
ASSERT(m_page);
// If there isn't a root node yet, don't do anything. We'll be called again after creating one.
if (!m_scrollingStateTree->rootStateNode())
return;
// Compute the region of the page that we can't do fast scrolling for. This currently includes
// all scrollable areas, such as subframes, overflow divs and list boxes. We need to do this even if the
// frame view whose layout was updated is not the main frame.
// In the future, we may want to have the ability to set non-fast scrolling regions for more than
// just the root node. But right now, this concept only applies to the root.
m_scrollingStateTree->rootStateNode()->setNonFastScrollableRegion(absoluteNonFastScrollableRegion());
m_nonFastScrollableRegionDirty = false;
if (!coordinatesScrollingForFrameView(frameView))
return;
ScrollingStateFrameScrollingNode* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(frameView.scrollLayerID()));
if (!node)
return;
Scrollbar* verticalScrollbar = frameView.verticalScrollbar();
Scrollbar* horizontalScrollbar = frameView.horizontalScrollbar();
node->setScrollbarPaintersFromScrollbars(verticalScrollbar, horizontalScrollbar);
node->setFrameScaleFactor(frameView.frame().frameScaleFactor());
node->setHeaderHeight(frameView.headerHeight());
node->setFooterHeight(frameView.footerHeight());
node->setTopContentInset(frameView.topContentInset());
node->setScrollOrigin(frameView.scrollOrigin());
node->setScrollableAreaSize(frameView.visibleContentRect().size());
node->setTotalContentsSize(frameView.totalContentsSize());
node->setReachableContentsSize(frameView.totalContentsSize());
node->setFixedElementsLayoutRelativeToFrame(frameView.fixedElementsLayoutRelativeToFrame());
#if ENABLE(CSS_SCROLL_SNAP)
frameView.updateSnapOffsets();
updateScrollSnapPropertiesWithFrameView(frameView);
#endif
#if PLATFORM(COCOA)
Page* page = frameView.frame().page();
if (page && page->expectsWheelEventTriggers()) {
LOG(WheelEventTestTriggers, " AsyncScrollingCoordinator::frameViewLayoutUpdated: Expects wheel event test trigger=%d", page->expectsWheelEventTriggers());
node->setExpectsWheelEventTestTrigger(page->expectsWheelEventTriggers());
}
#endif
ScrollableAreaParameters scrollParameters;
scrollParameters.horizontalScrollElasticity = frameView.horizontalScrollElasticity();
scrollParameters.verticalScrollElasticity = frameView.verticalScrollElasticity();
scrollParameters.hasEnabledHorizontalScrollbar = horizontalScrollbar && horizontalScrollbar->enabled();
scrollParameters.hasEnabledVerticalScrollbar = verticalScrollbar && verticalScrollbar->enabled();
scrollParameters.horizontalScrollbarMode = frameView.horizontalScrollbarMode();
scrollParameters.verticalScrollbarMode = frameView.verticalScrollbarMode();
node->setScrollableAreaParameters(scrollParameters);
}