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


C++ LayoutBox::borderBottom方法代码示例

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


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

示例1: if

LayoutState::LayoutState(LayoutBox& layoutObject, const LayoutSize& offset, LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged, bool containingBlockLogicalWidthChanged)
    : m_containingBlockLogicalWidthChanged(containingBlockLogicalWidthChanged)
    , m_next(layoutObject.view()->layoutState())
    , m_layoutObject(layoutObject)
{
    if (layoutObject.isLayoutFlowThread())
        m_flowThread = toLayoutFlowThread(&layoutObject);
    else if (!layoutObject.isOutOfFlowPositioned())
        m_flowThread = m_next->flowThread();
    else
        m_flowThread = nullptr;
    layoutObject.view()->pushLayoutState(*this);
    bool fixed = layoutObject.isOutOfFlowPositioned() && layoutObject.style()->position() == FixedPosition;
    if (fixed) {
        // FIXME: This doesn't work correctly with transforms.
        FloatPoint fixedOffset = layoutObject.view()->localToAbsolute(FloatPoint(), IsFixed);
        m_layoutOffset = LayoutSize(fixedOffset.x(), fixedOffset.y()) + offset;
    } else {
        m_layoutOffset = m_next->m_layoutOffset + offset;
    }
    m_heightOffsetForTableHeaders = m_next->heightOffsetForTableHeaders();

    if (layoutObject.isOutOfFlowPositioned() && !fixed) {
        if (LayoutObject* container = layoutObject.container()) {
            if (container->style()->hasInFlowPosition() && container->isLayoutInline())
                m_layoutOffset += toLayoutInline(container)->offsetForInFlowPositionedInline(layoutObject);
        }
    }
    // If we establish a new page height, then cache the offset to the top of the first page.
    // We can compare this later on to figure out what part of the page we're actually on,
    if (pageLogicalHeight || layoutObject.isLayoutFlowThread()) {
        m_pageLogicalHeight = pageLogicalHeight;
        bool isFlipped = layoutObject.style()->isFlippedBlocksWritingMode();
        m_pageOffset = LayoutSize(m_layoutOffset.width() + (!isFlipped ? layoutObject.borderLeft() + layoutObject.paddingLeft() : layoutObject.borderRight() + layoutObject.paddingRight()),
            m_layoutOffset.height() + (!isFlipped ? layoutObject.borderTop() + layoutObject.paddingTop() : layoutObject.borderBottom() + layoutObject.paddingBottom()));
        m_pageLogicalHeightChanged = pageLogicalHeightChanged;
        m_isPaginated = true;
    } else if (m_layoutObject.isSVG() && !m_layoutObject.isSVGRoot()) {
        // Pagination inside SVG is not allowed.
        m_flowThread = nullptr;
        m_pageLogicalHeightChanged = false;
        m_isPaginated = false;
    } else {
        // If we don't establish a new page height, then propagate the old page height and offset down.
        m_pageLogicalHeight = m_next->m_pageLogicalHeight;
        m_pageLogicalHeightChanged = m_next->m_pageLogicalHeightChanged;
        m_pageOffset = m_next->m_pageOffset;

        // Disable pagination for objects we don't support. For now this includes overflow:scroll/auto, inline blocks and
        // writing mode roots.
        if (layoutObject.getPaginationBreakability() == LayoutBox::ForbidBreaks) {
            m_flowThread = nullptr;
            m_pageLogicalHeight = LayoutUnit();
            m_isPaginated = false;
        } else {
            m_isPaginated = m_pageLogicalHeight || m_flowThread;
        }
    }

    // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip if present.
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:61,代码来源:LayoutState.cpp


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