本文整理汇总了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;
}
示例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;
}
示例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());
}
}
示例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);
}
示例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;
}
示例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());
}
}