本文整理汇总了C++中NodeRenderingContext类的典型用法代码示例。如果您正苦于以下问题:C++ NodeRenderingContext类的具体用法?C++ NodeRenderingContext怎么用?C++ NodeRenderingContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了NodeRenderingContext类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: childShouldCreateRenderer
bool HTMLSummaryElement::childShouldCreateRenderer(const NodeRenderingContext& childContext) const
{
if (childContext.node()->isPseudoElement())
return HTMLElement::childShouldCreateRenderer(childContext);
return childContext.isOnEncapsulationBoundary() && HTMLElement::childShouldCreateRenderer(childContext);
}
示例2: childShouldCreateRenderer
bool HTMLDetailsElement::childShouldCreateRenderer(const NodeRenderingContext& childContext) const
{
if (!childContext.isOnEncapsulationBoundary())
return false;
if (m_isOpen)
return HTMLElement::childShouldCreateRenderer(childContext);
if (!childContext.node()->hasTagName(summaryTag))
return false;
return childContext.node() == findMainSummary() && HTMLElement::childShouldCreateRenderer(childContext);
}
示例3: rendererIsNeeded
bool HTMLFormElement::rendererIsNeeded(const NodeRenderingContext& context)
{
if (!m_wasDemoted)
return HTMLElement::rendererIsNeeded(context);
ContainerNode* node = parentNode();
RenderObject* parentRenderer = node->renderer();
// FIXME: Shouldn't we also check for table caption (see |formIsTablePart| below).
bool parentIsTableElementPart = (parentRenderer->isTable() && node->hasTagName(tableTag))
|| (parentRenderer->isTableRow() && node->hasTagName(trTag))
|| (parentRenderer->isTableSection() && node->hasTagName(tbodyTag))
|| (parentRenderer->isRenderTableCol() && node->hasTagName(colTag))
|| (parentRenderer->isTableCell() && node->hasTagName(trTag));
if (!parentIsTableElementPart)
return true;
EDisplay display = context.style()->display();
bool formIsTablePart = display == TABLE || display == INLINE_TABLE || display == TABLE_ROW_GROUP
|| display == TABLE_HEADER_GROUP || display == TABLE_FOOTER_GROUP || display == TABLE_ROW
|| display == TABLE_COLUMN_GROUP || display == TABLE_COLUMN || display == TABLE_CELL
|| display == TABLE_CAPTION;
return formIsTablePart;
}
示例4: textRendererIsNeeded
bool Text::textRendererIsNeeded(const NodeRenderingContext& context)
{
if (isEditingText())
return true;
if (!length())
return false;
if (context.style()->display() == NONE)
return false;
if (!containsOnlyWhitespace())
return true;
RenderObject* parent = context.parentRenderer();
if (!parent->canHaveWhitespaceChildren())
return false;
if (context.style()->preserveNewline()) // pre/pre-wrap/pre-line always make renderers.
return true;
RenderObject* prev = context.previousRenderer();
if (prev && prev->isBR()) // <span><br/> <br/></span>
return false;
if (parent->isRenderInline()) {
// <span><div/> <div/></span>
if (prev && !prev->isInline())
return false;
} else {
if (parent->isRenderBlock() && !parent->childrenInline() && (!prev || !prev->isInline()))
return false;
// Avoiding creation of a Renderer for the text node is a non-essential memory optimization.
// So to avoid blowing up on very wide DOMs, we limit the number of siblings to visit.
unsigned maxSiblingsToVisit = 50;
RenderObject* first = parent->firstChild();
while (first && first->isFloatingOrOutOfFlowPositioned() && maxSiblingsToVisit--)
first = first->nextSibling();
if (!first || context.nextRenderer() == first)
// Whitespace at the start of a block just goes away. Don't even
// make a render object for this text.
return false;
}
return true;
}
示例5: textRendererIsNeeded
bool Text::textRendererIsNeeded(const NodeRenderingContext& context)
{
if (isEditingText())
return true;
if (!length())
return false;
if (context.style()->display() == NONE)
return false;
bool onlyWS = containsOnlyWhitespace();
if (!onlyWS)
return true;
RenderObject* parent = context.parentRenderer();
if (parent->isTable() || parent->isTableRow() || parent->isTableSection() || parent->isRenderTableCol() || parent->isFrameSet())
return false;
if (context.style()->preserveNewline()) // pre/pre-wrap/pre-line always make renderers.
return true;
RenderObject* prev = context.previousRenderer();
if (prev && prev->isBR()) // <span><br/> <br/></span>
return false;
if (parent->isRenderInline()) {
// <span><div/> <div/></span>
if (prev && !prev->isInline())
return false;
} else {
if (parent->isRenderBlock() && !parent->childrenInline() && (!prev || !prev->isInline()))
return false;
RenderObject* first = parent->firstChild();
while (first && first->isFloatingOrOutOfFlowPositioned())
first = first->nextSibling();
if (!first || context.nextRenderer() == first) {
// Whitespace at the start of a block just goes away. Don't even
// make a render object for this text.
return false;
}
}
return true;
}
示例6: childShouldCreateRenderer
bool SVGSwitchElement::childShouldCreateRenderer(const NodeRenderingContext& childContext) const
{
// FIXME: This function does not do what the comment below implies it does.
// It will create a renderer for any valid SVG element children, not just the first one.
for (Node* node = firstChild(); node; node = node->nextSibling()) {
if (!node->isSVGElement())
continue;
SVGElement* element = toSVGElement(node);
if (!element || !element->isValid())
continue;
return node == childContext.node(); // Only allow this child if it's the first valid child
}
return false;
}
示例7: childShouldCreateRenderer
bool SVGTextElement::childShouldCreateRenderer(const NodeRenderingContext& childContext) const
{
if (childContext.node()->isTextNode()
|| childContext.node()->hasTagName(SVGNames::aTag)
#if ENABLE(SVG_FONTS)
|| childContext.node()->hasTagName(SVGNames::altGlyphTag)
#endif
|| childContext.node()->hasTagName(SVGNames::textPathTag)
|| childContext.node()->hasTagName(SVGNames::trefTag)
|| childContext.node()->hasTagName(SVGNames::tspanTag))
return true;
return false;
}
示例8: childShouldCreateRenderer
bool SVGDocument::childShouldCreateRenderer(const NodeRenderingContext& childContext) const
{
if (childContext.node()->hasTagName(SVGNames::svgTag))
return toSVGSVGElement(childContext.node())->isValid();
return true;
}
示例9: rendererIsNeeded
bool HTMLIFrameElement::rendererIsNeeded(const NodeRenderingContext& context)
{
return isURLAllowed() && context.style()->display() != NONE;
}
示例10: rendererIsNeeded
bool HTMLFrameSetElement::rendererIsNeeded(const NodeRenderingContext& context)
{
// For compatibility, frames render even when display: none is set.
// However, we delay creating a renderer until stylesheets have loaded.
return context.style()->isStyleAvailable();
}
示例11: childShouldCreateRenderer
bool SVGAltGlyphElement::childShouldCreateRenderer(const NodeRenderingContext& childContext) const
{
if (childContext.node()->isTextNode())
return true;
return false;
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_external_chromium_org_third_party_WebKit,代码行数:6,代码来源:SVGAltGlyphElement.cpp
示例12: rendererIsNeeded
bool PseudoElement::rendererIsNeeded(const NodeRenderingContext& context)
{
return pseudoElementRendererIsNeeded(context.style());
}