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


C++ LayoutObject::frameView方法代码示例

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


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

示例1: outputLinkedDestinations

void PrintContext::outputLinkedDestinations(GraphicsContext& context,
                                            const IntRect& pageRect) {
  if (!m_linkedDestinationsValid) {
    // Collect anchors in the top-level frame only because our PrintContext
    // supports only one namespace for the anchors.
    collectLinkedDestinations(frame()->document());
    m_linkedDestinationsValid = true;
  }

  for (const auto& entry : m_linkedDestinations) {
    LayoutObject* layoutObject = entry.value->layoutObject();
    if (!layoutObject || !layoutObject->frameView())
      continue;
    IntRect boundingBox = layoutObject->absoluteBoundingBoxRect();
    // TODO(bokan): boundingBox looks to be in content coordinates but
    // convertToRootFrame doesn't apply scroll offsets when converting up to
    // the root frame.
    IntPoint point =
        layoutObject->frameView()->convertToRootFrame(boundingBox.location());
    if (!pageRect.contains(point))
      continue;
    point.clampNegativeToZero();
    context.setURLDestinationLocation(entry.key, point);
  }
}
开发者ID:mirror,项目名称:chromium,代码行数:25,代码来源:PrintContext.cpp

示例2:

LayoutAnalyzer::Scope::Scope(const LayoutObject& o)
    : m_layoutObject(o)
    , m_analyzer(o.frameView()->layoutAnalyzer())
{
    if (m_analyzer)
        m_analyzer->push(o);
}
开发者ID:smishenk,项目名称:chromium-crosswalk,代码行数:7,代码来源:LayoutAnalyzer.cpp

示例3: appendNodeHighlight

void InspectorHighlight::appendNodeHighlight(Node* node, const InspectorHighlightConfig& highlightConfig)
{
    LayoutObject* layoutObject = node->layoutObject();
    if (!layoutObject)
        return;

    // LayoutSVGRoot should be highlighted through the isBox() code path, all other SVG elements should just dump their absoluteQuads().
    if (layoutObject->node() && layoutObject->node()->isSVGElement() && !layoutObject->isSVGRoot()) {
        Vector<FloatQuad> quads;
        layoutObject->absoluteQuads(quads);
        FrameView* containingView = layoutObject->frameView();
        for (size_t i = 0; i < quads.size(); ++i) {
            if (containingView)
                contentsQuadToViewport(containingView, quads[i]);
            appendQuad(quads[i], highlightConfig.content, highlightConfig.contentOutline);
        }
        return;
    }

    FloatQuad content, padding, border, margin;
    if (!buildNodeQuads(node, &content, &padding, &border, &margin))
        return;
    appendQuad(content, highlightConfig.content, highlightConfig.contentOutline, "content");
    appendQuad(padding, highlightConfig.padding, Color::transparent, "padding");
    appendQuad(border, highlightConfig.border, Color::transparent, "border");
    appendQuad(margin, highlightConfig.margin, Color::transparent, "margin");
}
开发者ID:howardroark2018,项目名称:chromium,代码行数:27,代码来源:InspectorHighlight.cpp

示例4:

LayoutAnalyzer::Scope::Scope(const LayoutObject& o)
    : m_layoutObject(o)
    , m_analyzer(o.frameView()->layoutAnalyzer())
{
    if (UNLIKELY(m_analyzer != nullptr))
        m_analyzer->push(o);
}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:7,代码来源:LayoutAnalyzer.cpp

示例5: remove

void DepthOrderedLayoutObjectList::remove(LayoutObject& object) {
  auto it = m_data->m_objects.find(&object);
  if (it == m_data->m_objects.end())
    return;
  ASSERT(!object.frameView()->isInPerformLayout());
  m_data->m_objects.remove(it);
  m_data->m_orderedObjects.clear();
}
开发者ID:mirror,项目名称:chromium,代码行数:8,代码来源:DepthOrderedLayoutObjectList.cpp

示例6: outputLinkedDestinations

void PrintContext::outputLinkedDestinations(SkCanvas* canvas, const IntRect& pageRect)
{
    if (!m_linkedDestinationsValid) {
        // Collect anchors in the top-level frame only because our PrintContext
        // supports only one namespace for the anchors.
        collectLinkedDestinations(frame()->document());
        m_linkedDestinationsValid = true;
    }

    for (const auto& entry : m_linkedDestinations) {
        LayoutObject* layoutObject = entry.value->layoutObject();
        if (!layoutObject || !layoutObject->frameView())
            continue;
        IntRect boundingBox = layoutObject->absoluteBoundingBoxRect();
        boundingBox = layoutObject->frameView()->convertToContainingWindow(boundingBox);
        if (!pageRect.intersects(boundingBox))
            continue;
        IntPoint point = boundingBox.minXMinYCorner();
        point.clampNegativeToZero();
        SkAutoDataUnref nameData(SkData::NewWithCString(entry.key.utf8().data()));
        SkAnnotateNamedDestination(canvas, SkPoint::Make(point.x(), point.y()), nameData);
    }
}
开发者ID:dstockwell,项目名称:blink,代码行数:23,代码来源:PrintContext.cpp

示例7: chooseInterpolationQuality

InterpolationQuality ImageQualityController::chooseInterpolationQuality(
    const LayoutObject& object,
    Image* image,
    const void* layer,
    const LayoutSize& layoutSize) {
    if (object.style()->imageRendering() == ImageRenderingPixelated)
        return InterpolationNone;

    if (InterpolationDefault == InterpolationLow)
        return InterpolationLow;

    if (shouldPaintAtLowQuality(
                object, image, layer, layoutSize,
                object.frameView()->page()->chromeClient().lastFrameTimeMonotonic()))
        return InterpolationLow;

    // For images that are potentially animated we paint them at medium quality.
    if (image && image->maybeAnimated())
        return InterpolationMedium;

    return InterpolationDefault;
}
开发者ID:mirror,项目名称:chromium,代码行数:22,代码来源:ImageQualityController.cpp

示例8: clear

void ScrollAnchor::clear() {
  LayoutObject* layoutObject =
      m_anchorObject ? m_anchorObject : scrollerLayoutBox(m_scroller);
  PaintLayer* layer = nullptr;
  if (LayoutObject* parent = layoutObject->parent())
    layer = parent->enclosingLayer();

  // Walk up the layer tree to clear any scroll anchors.
  while (layer) {
    if (PaintLayerScrollableArea* scrollableArea = layer->getScrollableArea()) {
      ScrollAnchor* anchor = scrollableArea->scrollAnchor();
      DCHECK(anchor);
      anchor->clearSelf();
    }
    layer = layer->parent();
  }

  if (FrameView* view = layoutObject->frameView()) {
    ScrollAnchor* anchor = view->scrollAnchor();
    DCHECK(anchor);
    anchor->clearSelf();
  }
}
开发者ID:,项目名称:,代码行数:23,代码来源:

示例9: add

void DepthOrderedLayoutObjectList::add(LayoutObject& object) {
  ASSERT(!object.frameView()->isInPerformLayout());
  m_data->m_objects.add(&object);
  m_data->m_orderedObjects.clear();
}
开发者ID:mirror,项目名称:chromium,代码行数:5,代码来源:DepthOrderedLayoutObjectList.cpp

示例10: buildNodeQuads

bool InspectorHighlight::buildNodeQuads(Node* node, FloatQuad* content, FloatQuad* padding, FloatQuad* border, FloatQuad* margin)
{
    LayoutObject* layoutObject = node->layoutObject();
    if (!layoutObject)
        return false;

    FrameView* containingView = layoutObject->frameView();
    if (!containingView)
        return false;
    if (!layoutObject->isBox() && !layoutObject->isLayoutInline())
        return false;

    LayoutRect contentBox;
    LayoutRect paddingBox;
    LayoutRect borderBox;
    LayoutRect marginBox;

    if (layoutObject->isBox()) {
        LayoutBox* layoutBox = toLayoutBox(layoutObject);

        // LayoutBox returns the "pure" content area box, exclusive of the scrollbars (if present), which also count towards the content area in CSS.
        const int verticalScrollbarWidth = layoutBox->verticalScrollbarWidth();
        const int horizontalScrollbarHeight = layoutBox->horizontalScrollbarHeight();
        contentBox = layoutBox->contentBoxRect();
        contentBox.setWidth(contentBox.width() + verticalScrollbarWidth);
        contentBox.setHeight(contentBox.height() + horizontalScrollbarHeight);

        paddingBox = layoutBox->paddingBoxRect();
        paddingBox.setWidth(paddingBox.width() + verticalScrollbarWidth);
        paddingBox.setHeight(paddingBox.height() + horizontalScrollbarHeight);

        borderBox = layoutBox->borderBoxRect();

        marginBox = LayoutRect(borderBox.x() - layoutBox->marginLeft(), borderBox.y() - layoutBox->marginTop(),
            borderBox.width() + layoutBox->marginWidth(), borderBox.height() + layoutBox->marginHeight());
    } else {
        LayoutInline* layoutInline = toLayoutInline(layoutObject);

        // LayoutInline's bounding box includes paddings and borders, excludes margins.
        borderBox = LayoutRect(layoutInline->linesBoundingBox());
        paddingBox = LayoutRect(borderBox.x() + layoutInline->borderLeft(), borderBox.y() + layoutInline->borderTop(),
            borderBox.width() - layoutInline->borderLeft() - layoutInline->borderRight(), borderBox.height() - layoutInline->borderTop() - layoutInline->borderBottom());
        contentBox = LayoutRect(paddingBox.x() + layoutInline->paddingLeft(), paddingBox.y() + layoutInline->paddingTop(),
            paddingBox.width() - layoutInline->paddingLeft() - layoutInline->paddingRight(), paddingBox.height() - layoutInline->paddingTop() - layoutInline->paddingBottom());
        // Ignore marginTop and marginBottom for inlines.
        marginBox = LayoutRect(borderBox.x() - layoutInline->marginLeft(), borderBox.y(),
            borderBox.width() + layoutInline->marginWidth(), borderBox.height());
    }

    *content = layoutObject->localToAbsoluteQuad(FloatRect(contentBox));
    *padding = layoutObject->localToAbsoluteQuad(FloatRect(paddingBox));
    *border = layoutObject->localToAbsoluteQuad(FloatRect(borderBox));
    *margin = layoutObject->localToAbsoluteQuad(FloatRect(marginBox));

    contentsQuadToViewport(containingView, *content);
    contentsQuadToViewport(containingView, *padding);
    contentsQuadToViewport(containingView, *border);
    contentsQuadToViewport(containingView, *margin);

    return true;
}
开发者ID:howardroark2018,项目名称:chromium,代码行数:61,代码来源:InspectorHighlight.cpp


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