本文整理汇总了C++中ContainerNode::hasTagName方法的典型用法代码示例。如果您正苦于以下问题:C++ ContainerNode::hasTagName方法的具体用法?C++ ContainerNode::hasTagName怎么用?C++ ContainerNode::hasTagName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContainerNode
的用法示例。
在下文中一共展示了ContainerNode::hasTagName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gradientElement
SVGGradientElement* RenderSVGGradientStop::gradientElement() const
{
ContainerNode* parentNode = node()->parentNode();
if (parentNode->hasTagName(linearGradientTag) || parentNode->hasTagName(radialGradientTag))
return static_cast<SVGGradientElement*>(parentNode);
return 0;
}
示例2: rendererIsNeeded
bool HTMLFormElement::rendererIsNeeded(const RenderStyle& style)
{
if (!m_wasDemoted)
return HTMLElement::rendererIsNeeded(style);
ContainerNode* node = parentNode();
RenderObject* parentRenderer = node->renderer();
// FIXME: Shouldn't we also check for table caption (see |formIsTablePart| below).
// FIXME: This check is not correct for Shadow DOM.
bool parentIsTableElementPart = (parentRenderer->isTable() && isHTMLTableElement(node))
|| (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 = 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;
}
示例3: ownerSelectElement
HTMLSelectElement* HTMLOptionElement::ownerSelectElement() const
{
ContainerNode* select = parentNode();
while (select && !(select->hasTagName(selectTag) || select->hasTagName(keygenTag)))
select = select->parentNode();
if (!select)
return 0;
return static_cast<HTMLSelectElement*>(select);
}
示例4: updateFieldSetAndLegendAncestor
void HTMLFormControlElement::updateFieldSetAndLegendAncestor() const
{
m_fieldSetAncestor = 0;
m_legendAncestor = 0;
for (ContainerNode* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNode()) {
if (!m_legendAncestor && ancestor->hasTagName(legendTag))
m_legendAncestor = static_cast<HTMLLegendElement*>(ancestor);
if (ancestor->hasTagName(fieldsetTag)) {
m_fieldSetAncestor = static_cast<HTMLFieldSetElement*>(ancestor);
break;
}
}
m_fieldSetAncestorValid = true;
}
示例5: viewportElement
SVGElement* SVGElement::viewportElement() const
{
// This function needs shadow tree support - as RenderSVGContainer uses this function
// to determine the "overflow" property. <use> on <symbol> wouldn't work otherwhise.
ContainerNode* n = parentOrShadowHostNode();
while (n) {
if (n->hasTagName(SVGNames::svgTag) || isSVGImageElement(n) || n->hasTagName(SVGNames::symbolTag))
return toSVGElement(n);
n = n->parentOrShadowHostNode();
}
return 0;
}
示例6: updateAncestorDisabledState
void HTMLFormControlElement::updateAncestorDisabledState() const
{
HTMLFieldSetElement* fieldSetAncestor = 0;
ContainerNode* legendAncestor = 0;
for (ContainerNode* ancestor = parentNode(); ancestor; ancestor = ancestor->parentNode()) {
if (!legendAncestor && ancestor->hasTagName(legendTag))
legendAncestor = ancestor;
if (ancestor->hasTagName(fieldsetTag)) {
fieldSetAncestor = toHTMLFieldSetElement(ancestor);
break;
}
}
m_ancestorDisabledState = (fieldSetAncestor && fieldSetAncestor->isDisabledFormControl() && !(legendAncestor && legendAncestor == fieldSetAncestor->legend())) ? AncestorDisabledStateDisabled : AncestorDisabledStateEnabled;
}
示例7: childrenChanged
void SVGFontFaceFormatElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
{
SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
if (!parentNode() || !parentNode()->hasTagName(font_face_uriTag))
return;
ContainerNode* ancestor = parentNode()->parentNode();
if (!ancestor || !ancestor->hasTagName(font_face_srcTag))
return;
ancestor = ancestor->parentNode();
if (ancestor && ancestor->hasTagName(font_faceTag))
static_cast<SVGFontFaceElement*>(ancestor)->rebuildFontFace();
}
示例8: childrenChanged
void SVGFontFaceFormatElement::childrenChanged(const ChildChange& change)
{
SVGElement::childrenChanged(change);
if (!parentNode() || !parentNode()->hasTagName(font_face_uriTag))
return;
ContainerNode* ancestor = parentNode()->parentNode();
if (!ancestor || !ancestor->hasTagName(font_face_srcTag))
return;
ancestor = ancestor->parentNode();
if (ancestor && ancestor->hasTagName(font_faceTag))
toSVGFontFaceElement(ancestor)->rebuildFontFace();
}
示例9: rendererIsNeeded
bool HTMLEmbedElement::rendererIsNeeded(const RenderStyle& style)
{
if (isImageType())
return HTMLPlugInImageElement::rendererIsNeeded(style);
// If my parent is an <object> and is not set to use fallback content, I
// should be ignored and not get a renderer.
ContainerNode* p = parentNode();
if (p && p->hasTagName(objectTag)) {
if (!p->renderer())
return false;
if (!toHTMLObjectElement(p)->useFallbackContent()) {
ASSERT(!p->renderer()->isEmbeddedObject());
return false;
}
}
#if ENABLE(DASHBOARD_SUPPORT)
// Workaround for <rdar://problem/6642221>.
if (document().frame()->settings().usesDashboardBackwardCompatibilityMode())
return true;
#endif
return HTMLPlugInImageElement::rendererIsNeeded(style);
}
示例10: svgAttributeChanged
void SVGFELightElement::svgAttributeChanged(const QualifiedName& attrName)
{
SVGElement::svgAttributeChanged(attrName);
if (attrName == SVGNames::azimuthAttr
|| attrName == SVGNames::elevationAttr
|| attrName == SVGNames::xAttr
|| attrName == SVGNames::yAttr
|| attrName == SVGNames::zAttr
|| attrName == SVGNames::pointsAtXAttr
|| attrName == SVGNames::pointsAtYAttr
|| attrName == SVGNames::pointsAtZAttr
|| attrName == SVGNames::specularExponentAttr
|| attrName == SVGNames::limitingConeAngleAttr) {
ContainerNode* parent = parentNode();
if (!parent)
return;
RenderObject* renderer = parent->renderer();
if (!renderer || !renderer->isSVGResourceFilterPrimitive())
return;
if (parent->hasTagName(SVGNames::feDiffuseLightingTag)) {
SVGFEDiffuseLightingElement* diffuseLighting = static_cast<SVGFEDiffuseLightingElement*>(parent);
diffuseLighting->lightElementAttributeChanged(this, attrName);
return;
}
// Handler for SpecularLighting has not implemented yet.
RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
}
示例11: findParentTable
HTMLTableElement* HTMLTablePartElement::findParentTable() const
{
ContainerNode* parent = parentNode();
while (parent && !parent->hasTagName(tableTag))
parent = parent->parentNode();
return static_cast<HTMLTableElement*>(parent);
}
示例12: findParentTable
HTMLTableElement* HTMLTablePartElement::findParentTable() const
{
ContainerNode* parent = NodeRenderingTraversal::parent(this);
while (parent && !parent->hasTagName(tableTag))
parent = NodeRenderingTraversal::parent(parent);
return toHTMLTableElement(parent);
}
示例13: enclosingList
HTMLElement* enclosingList(Node* node)
{
if (!node)
return 0;
Node* root = highestEditableRoot(firstPositionInOrBeforeNode(node));
for (ContainerNode* n = node->parentNode(); n; n = n->parentNode()) {
if (n->hasTagName(ulTag) || n->hasTagName(olTag))
return toHTMLElement(n);
if (n == root)
return 0;
}
return 0;
}
示例14: textIndentedToRespectGroupLabel
String HTMLOptionElement::textIndentedToRespectGroupLabel() const
{
ContainerNode* parent = parentNode();
if (parent && parent->hasTagName(optgroupTag))
return " " + text();
return text();
}
示例15: recalcSelectOptions
void HTMLOptGroupElement::recalcSelectOptions()
{
ContainerNode* select = parentNode();
while (select && !select->hasTagName(selectTag))
select = select->parentNode();
if (select)
toHTMLSelectElement(select)->setRecalcListItems();
}