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


C++ FrameView::contentsHeight方法代码示例

本文整理汇总了C++中FrameView::contentsHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameView::contentsHeight方法的具体用法?C++ FrameView::contentsHeight怎么用?C++ FrameView::contentsHeight使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FrameView的用法示例。


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

示例1: contentsSize

/*!
    \property QWebFrame::contentsSize
    \brief the size of the contents in this frame
*/
QSize QWebFrame::contentsSize() const
{
    FrameView *view = d->frame->view();
    if (!view)
        return QSize();
    return QSize(view->contentsWidth(), view->contentsHeight());
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例2: calcHeight

void RenderPartObject::calcHeight() {
    RenderPart::calcHeight();
    if (!node()->hasTagName(iframeTag) || !widget() || !widget()->isFrameView())
        return;
    FrameView* view = static_cast<FrameView*>(widget());
    RenderView* root = static_cast<RenderView*>(view->frame()->contentRenderer());
    if (!root)
        return;
    // Do not expand if the scrollbars are suppressed and the height is fixed.
    bool scrolling = static_cast<HTMLIFrameElement*>(node())->scrollingMode() != ScrollbarAlwaysOff;
    if (!scrolling && style()->height().isFixed())
        return;
    // Update the widget
    updateWidgetPosition();

//SAMSUNG CHANGE >>
    // Browser freeze issue in http://www.enuri.com/
    /* do {
        view->layout();
     } while (view->layoutPending() || root->needsLayout()); */

    node()->document()->page()->mainFrame()->view()->layoutIfNeededRecursive();
//SAMSUNG CHANGE <<

    int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom();
    setHeight(max(width(), view->contentsHeight() + extraHeight));

    // Update one last time to ensure the dimensions.
    updateWidgetPosition();
}
开发者ID:federivas,项目名称:s6500d_official_platform,代码行数:30,代码来源:RenderPartObject.cpp

示例3: layout

void RenderFrame::layout()
{
    FrameView* view = static_cast<FrameView*>(widget());
    RenderView* root = view ? view->frame()->contentRenderer() : 0;

    // Do not expand frames which has zero width or height
    if (!width() || !height() || !root) {
        updateWidgetPosition();
        if (view)
            view->layout();
        setNeedsLayout(false);
        return;
    }

    HTMLFrameElementBase* element = static_cast<HTMLFrameElementBase*>(node());
    if (element->scrollingMode() == ScrollbarAlwaysOff && !root->isFrameSet()) {
        setNeedsLayout(false);
        return;
    }

    // Update the dimensions to get the correct width and height
    updateWidgetPosition();
    if (root->preferredLogicalWidthsDirty())
        root->computePreferredLogicalWidths();

    // Expand the frame by setting frame height = content height
    setWidth(max(view->contentsWidth() + borderAndPaddingWidth(), width()));
    setHeight(max(view->contentsHeight() + borderAndPaddingHeight(), height()));

    // Update one more time
    updateWidgetPosition();

    setNeedsLayout(false);
}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:34,代码来源:RenderFrame.cpp

示例4: scrollHeight

int HTMLBodyElement::scrollHeight() const
{
    // Update the document's layout.
    Document* document = this->document();
    document->updateLayoutIgnorePendingStylesheets();
    FrameView* view = document->view();
    return view ? adjustForZoom(view->contentsHeight(), document) : 0;    
}
开发者ID:13W,项目名称:phantomjs,代码行数:8,代码来源:HTMLBodyElement.cpp

示例5: scrollHeight

int HTMLBodyElement::scrollHeight() const
{
    // Update the document's layout.
    Document* doc = document();
    doc->updateLayoutIgnorePendingStylesheets();
    FrameView* view = doc->view();
    return view ? view->contentsHeight() : 0;    
}
开发者ID:Czerrr,项目名称:ISeeBrowser,代码行数:8,代码来源:HTMLBodyElement.cpp

示例6: ASSERT

InRegionScrollableArea::InRegionScrollableArea(WebPagePrivate* webPage, RenderLayer* layer)
    : m_webPage(webPage)
    , m_layer(layer)
{
    ASSERT(webPage);
    ASSERT(layer);
    m_isNull = false;

    // FIXME: Add an ASSERT here as the 'layer' must be scrollable.

    RenderObject* layerRenderer = layer->renderer();
    ASSERT(layerRenderer);

    if (layerRenderer->isRenderView()) { // #document case

        FrameView* view = toRenderView(layerRenderer)->frameView();
        ASSERT(view);

        Frame* frame = view->frame();
        ASSERT_UNUSED(frame, frame);

        m_scrollPosition = m_webPage->mapToTransformed(view->scrollPosition());
        m_contentsSize = m_webPage->mapToTransformed(view->contentsSize());
        m_viewportSize = m_webPage->mapToTransformed(view->visibleContentRect(false /*includeScrollbars*/)).size();

        m_visibleWindowRect = m_webPage->mapToTransformed(m_webPage->getRecursiveVisibleWindowRect(view));
        IntRect transformedWindowRect = IntRect(IntPoint::zero(), m_webPage->transformedViewportSize());
        m_visibleWindowRect.intersect(transformedWindowRect);

        m_scrollsHorizontally = view->contentsWidth() > view->visibleWidth();
        m_scrollsVertically = view->contentsHeight() > view->visibleHeight();

        m_overscrollLimitFactor = 0.0; // FIXME eventually support overscroll
    } else { // RenderBox-based elements case (scrollable boxes (div's, p's, textarea's, etc)).

        RenderBox* box = m_layer->renderBox();
        ASSERT(box);
        ASSERT(box->canBeScrolledAndHasScrollableArea());

        ScrollableArea* scrollableArea = static_cast<ScrollableArea*>(m_layer);
        m_scrollPosition = m_webPage->mapToTransformed(scrollableArea->scrollPosition());
        m_contentsSize = m_webPage->mapToTransformed(scrollableArea->contentsSize());
        m_viewportSize = m_webPage->mapToTransformed(scrollableArea->visibleContentRect(false /*includeScrollbars*/)).size();

        m_visibleWindowRect = m_layer->renderer()->absoluteClippedOverflowRect();
        m_visibleWindowRect = m_layer->renderer()->frame()->view()->contentsToWindow(m_visibleWindowRect);
        IntRect visibleFrameWindowRect = m_webPage->getRecursiveVisibleWindowRect(m_layer->renderer()->frame()->view());
        m_visibleWindowRect.intersect(visibleFrameWindowRect);
        m_visibleWindowRect = m_webPage->mapToTransformed(m_visibleWindowRect);
        IntRect transformedWindowRect = IntRect(IntPoint::zero(), m_webPage->transformedViewportSize());
        m_visibleWindowRect.intersect(transformedWindowRect);

        m_scrollsHorizontally = box->scrollWidth() != box->clientWidth() && box->scrollsOverflowX();
        m_scrollsVertically = box->scrollHeight() != box->clientHeight() && box->scrollsOverflowY();

        m_overscrollLimitFactor = 0.0; // FIXME eventually support overscroll
    }
}
开发者ID:dzhshf,项目名称:WebKit,代码行数:58,代码来源:InRegionScrollableArea.cpp

示例7: layout

void RenderPartObject::layout()
{
    ASSERT(needsLayout());

    calcWidth();
    calcHeight();
    
#ifdef FLATTEN_IFRAME
    // Some IFrames have a width and/or height of 1 when they are meant to be
    // hidden. If that is the case, don't try to expand.
    if (m_widget && m_widget->isFrameView() &&
            m_width > 1 && m_height > 1) {
        FrameView* view = static_cast<FrameView*>(m_widget);
        RenderView* root = NULL;
        if (view->frame() && view->frame()->document() &&
            view->frame()->document()->renderer() && view->frame()->document()->renderer()->isRenderView())
            root = static_cast<RenderView*>(view->frame()->document()->renderer());
        if (root) {
            // Update the dimensions to get the correct minimum preferred width
            updateWidgetPosition();

            // Use the preferred width if it is larger.
            m_width = max(m_width, root->minPrefWidth());
            int extraWidth = paddingLeft() + paddingRight() + borderLeft() + borderRight();
            int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom();
            // Resize the view to recalc the height.
            int height = m_height - extraHeight;
            int width = m_width - extraWidth;
            if (width > view->width())
                height = 0;
            if (width != view->width() || height != view->height()) {
                view->resize(width, height);
                root->setNeedsLayout(true, false);
            }
            // Layout the view.
            if (view->needsLayout())
                view->layout();
            int contentHeight = view->contentsHeight();
            int contentWidth = view->contentsWidth();
            // Do not shrink iframes with specified sizes
            if (contentHeight > m_height || style()->height().isAuto())
                m_height = contentHeight;
            m_width = std::min(contentWidth, 800);
        }
    }
#endif
    adjustOverflowForBoxShadow();

    RenderPart::layout();

    if (!m_widget && m_view)
        m_view->addWidgetToUpdate(this);
    
    setNeedsLayout(false);
}
开发者ID:,项目名称:,代码行数:55,代码来源:

示例8: contentBounds

IntRect WebFrame::contentBounds() const
{    
    if (!m_coreFrame)
        return IntRect();
    
    FrameView* view = m_coreFrame->view();
    if (!view)
        return IntRect();
    
    return IntRect(0, 0, view->contentsWidth(), view->contentsHeight());
}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:11,代码来源:WebFrame.cpp

示例9: contentBounds

IntRect WebFrame::contentBounds()
{
    Frame* coreFrame = core(this);
    if (!coreFrame)
        return IntRect();

    FrameView* view = coreFrame->view();
    if (!view)
        return IntRect();

    return IntRect(0, 0, view->contentsWidth(), view->contentsHeight());
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:12,代码来源:WebFrame.cpp

示例10: scrollHeight

int HTMLBodyElement::scrollHeight()
{
    // Update the document's layout.
    document().updateLayoutIgnorePendingStylesheets();
    Frame* frame = document().frame();
    if (!frame)
        return 0;
    FrameView* view = frame->view();
    if (!view)
        return 0;
    return adjustForZoom(view->contentsHeight(), *frame);
}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例11: layoutWithFlattening

void RenderFrameBase::layoutWithFlattening(bool fixedWidth, bool fixedHeight)
{
    FrameView* childFrameView = static_cast<FrameView*>(widget());
    RenderView* childRoot = childFrameView ? static_cast<RenderView*>(childFrameView->frame()->contentRenderer()) : 0;

    // Do not expand frames which has zero width or height
    if (!width() || !height() || !childRoot) {
        updateWidgetPosition();
        if (childFrameView)
            childFrameView->layout();
        setNeedsLayout(false);
        return;
    }

    // need to update to calculate min/max correctly
    updateWidgetPosition();
    if (childRoot->preferredLogicalWidthsDirty())
        childRoot->computePreferredLogicalWidths();

    // if scrollbars are off, and the width or height are fixed
    // we obey them and do not expand. With frame flattening
    // no subframe much ever become scrollable.

    HTMLFrameElementBase* element = static_cast<HTMLFrameElementBase*>(node());
    bool isScrollable = element->scrollingMode() != ScrollbarAlwaysOff;

    // consider iframe inset border
    int hBorder = borderLeft() + borderRight();
    int vBorder = borderTop() + borderBottom();

    // make sure minimum preferred width is enforced
    if (isScrollable || !fixedWidth) {
        setWidth(max(width(), childRoot->minPreferredLogicalWidth() + hBorder));
        // update again to pass the new width to the child frame
        updateWidgetPosition();
        childFrameView->layout();
    }

    // expand the frame by setting frame height = content height
    if (isScrollable || !fixedHeight || childRoot->isFrameSet())
        setHeight(max(height(), childFrameView->contentsHeight() + vBorder));
    if (isScrollable || !fixedWidth || childRoot->isFrameSet())
        setWidth(max(width(), childFrameView->contentsWidth() + hBorder));

    updateWidgetPosition();

    ASSERT(!childFrameView->layoutPending());
    ASSERT(!childRoot->needsLayout());
    ASSERT(!childRoot->firstChild() || !childRoot->firstChild()->firstChild() || !childRoot->firstChild()->firstChild()->needsLayout());

    setNeedsLayout(false);
}
开发者ID:CannedFish,项目名称:deepin-webkit,代码行数:52,代码来源:RenderFrameBase.cpp

示例12: hasScrollBars

bool WebFrame::hasScrollBars()
{
    Frame* coreFrame = core(this);
    if (!coreFrame)
        return false;

    FrameView* view = coreFrame->view();
    if (!view)
        return false;

    if (view->vScrollbarMode() == ScrollbarAlwaysOn || view->visibleHeight() < view->contentsHeight() ||
            view->hScrollbarMode() == ScrollbarAlwaysOn || view->visibleWidth() < view->contentsWidth())
        return true;
    return false;
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:15,代码来源:WebFrame.cpp

示例13: calcHeight

void RenderPartObject::calcHeight()
{
    RenderPart::calcHeight();
    if (!flattenFrame())
         return;

    HTMLIFrameElement* frame = static_cast<HTMLIFrameElement*>(node());
    bool isScrollable = frame->scrollingMode() != ScrollbarAlwaysOff;

    if (isScrollable || !style()->height().isFixed()) {
        FrameView* view = static_cast<FrameView*>(widget());
        int border = borderTop() + borderBottom();
        setHeight(max(height(), view->contentsHeight() + border));
    }
}
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:15,代码来源:RenderPartObject.cpp

示例14: layout

void RenderPartObject::layout()
{
    ASSERT(needsLayout());
    ASSERT(minMaxKnown());

    FrameView* childFrameView = static_cast<FrameView*>(m_widget);
    RenderView* childRoot = 0;
    
    bool flatten = m_widget && element()->hasTagName(iframeTag) && element() && element()->document()->frame() && 
        element()->document()->frame()->settings()->flatFrameSetLayoutEnabled() && 
        (static_cast<HTMLIFrameElement*>(element())->scrollingMode() != ScrollBarAlwaysOff || !style()->width().isFixed() || !style()->height().isFixed()) &&
        (childRoot = childFrameView ? static_cast<RenderView*>(childFrameView->frame()->renderer()) : 0);

    if (flatten) {
        
        if (!childRoot->minMaxKnown())
            childRoot->calcMinMaxWidth();
        
        calcWidth();
        calcHeight();
        
        bool scrolling = static_cast<HTMLIFrameElement*>(element())->scrollingMode() != ScrollBarAlwaysOff;
        if (scrolling || !style()->width().isFixed())
            m_width = max(m_width, childRoot->minWidth());

        updateWidgetPosition();
        do
            childFrameView->layout();
        while (childFrameView->layoutPending() || childRoot->needsLayout());     
        
        if (scrolling || !style()->height().isFixed())
            m_height = max(m_height, childFrameView->contentsHeight());
        if (scrolling || !style()->width().isFixed())
            m_width = max(m_width, childFrameView->contentsWidth());
        
        updateWidgetPosition();
        
        ASSERT(!childFrameView->layoutPending());
        ASSERT(!childRoot->needsLayout());
        ASSERT(!childRoot->firstChild() || !childRoot->firstChild()->firstChild() || !childRoot->firstChild()->firstChild()->needsLayout());
    } else {
    calcWidth();
    calcHeight();

    RenderPart::layout();
    }
    setNeedsLayout(false);
}
开发者ID:oroisec,项目名称:ios,代码行数:48,代码来源:RenderPartObject.cpp

示例15: layoutWithFlattening

void RenderFrameBase::layoutWithFlattening(bool hasFixedWidth, bool hasFixedHeight)
{
    FrameView* childFrameView = toFrameView(widget());
    RenderView* childRoot = childFrameView ? childFrameView->frame().contentRenderer() : 0;

    if (!childRoot || !shouldExpandFrame(width(), height(), hasFixedWidth, hasFixedHeight)) {
        updateWidgetPosition();
        if (childFrameView)
            childFrameView->layout();
        clearNeedsLayout();
        return;
    }

    // need to update to calculate min/max correctly
    updateWidgetPosition();

    // if scrollbars are off, and the width or height are fixed
    // we obey them and do not expand. With frame flattening
    // no subframe much ever become scrollable.

    bool isScrollable = frameOwnerElement().scrollingMode() != ScrollbarAlwaysOff;

    // consider iframe inset border
    int hBorder = borderLeft() + borderRight();
    int vBorder = borderTop() + borderBottom();

    // make sure minimum preferred width is enforced
    if (isScrollable || !hasFixedWidth) {
        setWidth(std::max(width(), childRoot->minPreferredLogicalWidth() + hBorder));
        // update again to pass the new width to the child frame
        updateWidgetPosition();
        childFrameView->layout();
    }

    // expand the frame by setting frame height = content height
    if (isScrollable || !hasFixedHeight || childRoot->isFrameSet())
        setHeight(std::max<LayoutUnit>(height(), childFrameView->contentsHeight() + vBorder));
    if (isScrollable || !hasFixedWidth || childRoot->isFrameSet())
        setWidth(std::max<LayoutUnit>(width(), childFrameView->contentsWidth() + hBorder));

    updateWidgetPosition();

    ASSERT(!childFrameView->layoutPending());
    ASSERT(!childRoot->needsLayout());
    ASSERT(!childRoot->firstChild() || !childRoot->firstChild()->firstChildSlow() || !childRoot->firstChild()->firstChildSlow()->needsLayout());

    clearNeedsLayout();
}
开发者ID:,项目名称:,代码行数:48,代码来源:


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