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


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

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


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

示例1: getImageResourceContent

static ImageResourceContent* getImageResourceContent(Element* element) {
  // Attempt to pull ImageResourceContent from element
  ASSERT(element);
  LayoutObject* layoutObject = element->layoutObject();
  if (!layoutObject || !layoutObject->isImage())
    return 0;

  LayoutImage* image = toLayoutImage(layoutObject);
  if (image->cachedImage() && !image->cachedImage()->errorOccurred())
    return image->cachedImage();

  return 0;
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例2: image

Image* HitTestResult::image() const
{
    Node* innerNodeOrImageMapImage = this->innerNodeOrImageMapImage();
    if (!innerNodeOrImageMapImage)
        return nullptr;

    LayoutObject* layoutObject = innerNodeOrImageMapImage->layoutObject();
    if (layoutObject && layoutObject->isImage()) {
        LayoutImage* image = toLayoutImage(layoutObject);
        if (image->cachedImage() && !image->cachedImage()->errorOccurred())
            return image->cachedImage()->image();
    }

    return nullptr;
}
开发者ID:mtucker6784,项目名称:chromium,代码行数:15,代码来源:HitTestResult.cpp

示例3: didRecalcStyle

void PseudoElement::didRecalcStyle(StyleRecalcChange)
{
    if (!layoutObject())
        return;

    // The renderers inside pseudo elements are anonymous so they don't get notified of recalcStyle and must have
    // the style propagated downward manually similar to LayoutObject::propagateStyleToAnonymousChildren.
    LayoutObject* renderer = this->layoutObject();
    for (LayoutObject* child = renderer->nextInPreOrder(renderer); child; child = child->nextInPreOrder(renderer)) {
        // We only manage the style for the generated content items.
        if (!child->isText() && !child->isQuote() && !child->isImage())
            continue;

        child->setPseudoStyle(renderer->style());
    }
}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:16,代码来源:PseudoElement.cpp

示例4: setFocus

void HTMLAreaElement::setFocus(bool shouldBeFocused)
{
    if (focused() == shouldBeFocused)
        return;

    HTMLAnchorElement::setFocus(shouldBeFocused);

    HTMLImageElement* imageElement = this->imageElement();
    if (!imageElement)
        return;

    LayoutObject* layoutObject = imageElement->layoutObject();
    if (!layoutObject || !layoutObject->isImage())
        return;

    toLayoutImage(layoutObject)->areaElementFocusChanged(this);
}
开发者ID:mtucker6784,项目名称:chromium,代码行数:17,代码来源:HTMLAreaElement.cpp

示例5: layoutImageResource

LayoutImageResource* ImageLoader::layoutImageResource() {
    LayoutObject* layoutObject = m_element->layoutObject();

    if (!layoutObject)
        return 0;

    // We don't return style generated image because it doesn't belong to the
    // ImageLoader. See <https://bugs.webkit.org/show_bug.cgi?id=42840>
    if (layoutObject->isImage() &&
            !static_cast<LayoutImage*>(layoutObject)->isGeneratedContent())
        return toLayoutImage(layoutObject)->imageResource();

    if (layoutObject->isSVGImage())
        return toLayoutSVGImage(layoutObject)->imageResource();

    if (layoutObject->isVideo())
        return toLayoutVideo(layoutObject)->imageResource();

    return 0;
}
开发者ID:ollie314,项目名称:chromium,代码行数:20,代码来源:ImageLoader.cpp

示例6: didRecalcStyle

void FirstLetterPseudoElement::didRecalcStyle(StyleRecalcChange)
{
    if (!layoutObject())
        return;

    // The layoutObjects inside pseudo elements are anonymous so they don't get notified of recalcStyle and must have
    // the style propagated downward manually similar to LayoutObject::propagateStyleToAnonymousChildren.
    LayoutObject* layoutObject = this->layoutObject();
    for (LayoutObject* child = layoutObject->nextInPreOrder(layoutObject); child; child = child->nextInPreOrder(layoutObject)) {
        // We need to re-calculate the correct style for the first letter element
        // and then apply that to the container and the text fragment inside.
        if (child->style()->styleType() == FIRST_LETTER && m_remainingTextLayoutObject) {
            if (ComputedStyle* pseudoStyle = styleForFirstLetter(m_remainingTextLayoutObject->parent()))
                child->setPseudoStyle(pseudoStyle);
            continue;
        }

        // We only manage the style for the generated content items.
        if (!child->isText() && !child->isQuote() && !child->isImage())
            continue;

        child->setPseudoStyle(layoutObject->mutableStyle());
    }
}
开发者ID:dstockwell,项目名称:blink,代码行数:24,代码来源:FirstLetterPseudoElement.cpp


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