https://bugs.webkit.org/show_bug.cgi?id=137058
Reviewed by Dirk Schulze.
Use is<SVG*Element>() instead of isSVG*Element() and drop support for
generated isSVG*Element().
No new tests, no behavior change.
* css/CSSCursorImageValue.cpp:
(WebCore::resourceReferencedByCursorElement):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::useSVGZoomRulesForLength):
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
* dom/ScriptElement.cpp:
(WebCore::toScriptElementIfPossible):
* dom/make_names.pl:
(printTypeHelpers):
* editing/gtk/EditorGtk.cpp:
(WebCore::elementURL):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::absoluteImageURL):
(WebCore::HitTestResult::isLiveLink):
* rendering/svg/RenderSVGEllipse.cpp:
(WebCore::RenderSVGEllipse::calculateRadiiAndCenter):
* rendering/svg/RenderSVGTransformableContainer.cpp:
(WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
* rendering/svg/SVGPathData.cpp:
(WebCore::updatePathFromCircleElement):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::operator<<):
* rendering/svg/SVGResources.cpp:
(WebCore::targetReferenceFromResource):
* svg/SVGAltGlyphDefElement.cpp:
(WebCore::SVGAltGlyphDefElement::hasValidGlyphElements):
* svg/SVGAltGlyphElement.cpp:
(WebCore::SVGAltGlyphElement::hasValidGlyphElements):
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::hasValidAttributeType):
* svg/SVGDocument.cpp:
(WebCore::SVGDocument::rootElement):
* svg/SVGElement.cpp:
(WebCore::SVGElement::isOutermostSVGSVGElement):
(WebCore::SVGElement::ownerSVGElement):
(WebCore::SVGElement::viewportElement):
* svg/SVGFEComponentTransferElement.cpp:
(WebCore::SVGFEComponentTransferElement::build):
* svg/SVGFELightElement.cpp:
(WebCore::SVGFELightElement::findLightElement):
* svg/SVGFontData.cpp:
(WebCore::SVGFontData::applySVGGlyphSelection):
* svg/SVGFontElement.cpp:
(WebCore::SVGFontElement::ensureGlyphCache):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::associatedFontElement):
(WebCore::SVGFontFaceElement::rebuildFontFace):
* svg/SVGFontFaceSrcElement.cpp:
(WebCore::SVGFontFaceSrcElement::srcValue):
(WebCore::SVGFontFaceSrcElement::childrenChanged):
* svg/SVGGlyphElement.cpp:
(WebCore::SVGGlyphElement::invalidateGlyphCache):
* svg/SVGHKernElement.cpp:
(WebCore::SVGHKernElement::insertedInto):
(WebCore::SVGHKernElement::removedFrom):
* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::determineViewport):
* svg/SVGLocatable.cpp:
(WebCore::isViewportElement):
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::pathElement):
(WebCore::SVGMPathElement::notifyParentOfPathChange):
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::invalidateMPathDependencies):
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::collectPatternAttributes):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::setupInitialView):
* svg/SVGUseElement.cpp:
(WebCore::dumpInstanceTree):
(WebCore::SVGUseElement::expandUseElementsInShadowTree):
* svg/SVGVKernElement.cpp:
(WebCore::SVGVKernElement::insertedInto):
(WebCore::SVGVKernElement::removedFrom):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173921
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-09-24 Christophe Dumez <cdumez@apple.com>
+
+ Use is<SVG*Element>() instead of isSVG*Element()
+ https://bugs.webkit.org/show_bug.cgi?id=137058
+
+ Reviewed by Dirk Schulze.
+
+ Use is<SVG*Element>() instead of isSVG*Element() and drop support for
+ generated isSVG*Element().
+
+ No new tests, no behavior change.
+
+ * css/CSSCursorImageValue.cpp:
+ (WebCore::resourceReferencedByCursorElement):
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::useSVGZoomRulesForLength):
+ * dom/DocumentStyleSheetCollection.cpp:
+ (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
+ * dom/ScriptElement.cpp:
+ (WebCore::toScriptElementIfPossible):
+ * dom/make_names.pl:
+ (printTypeHelpers):
+ * editing/gtk/EditorGtk.cpp:
+ (WebCore::elementURL):
+ * rendering/HitTestResult.cpp:
+ (WebCore::HitTestResult::absoluteImageURL):
+ (WebCore::HitTestResult::isLiveLink):
+ * rendering/svg/RenderSVGEllipse.cpp:
+ (WebCore::RenderSVGEllipse::calculateRadiiAndCenter):
+ * rendering/svg/RenderSVGTransformableContainer.cpp:
+ (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
+ * rendering/svg/SVGPathData.cpp:
+ (WebCore::updatePathFromCircleElement):
+ * rendering/svg/SVGRenderTreeAsText.cpp:
+ (WebCore::operator<<):
+ * rendering/svg/SVGResources.cpp:
+ (WebCore::targetReferenceFromResource):
+ * svg/SVGAltGlyphDefElement.cpp:
+ (WebCore::SVGAltGlyphDefElement::hasValidGlyphElements):
+ * svg/SVGAltGlyphElement.cpp:
+ (WebCore::SVGAltGlyphElement::hasValidGlyphElements):
+ * svg/SVGAnimateMotionElement.cpp:
+ (WebCore::SVGAnimateMotionElement::hasValidAttributeType):
+ * svg/SVGDocument.cpp:
+ (WebCore::SVGDocument::rootElement):
+ * svg/SVGElement.cpp:
+ (WebCore::SVGElement::isOutermostSVGSVGElement):
+ (WebCore::SVGElement::ownerSVGElement):
+ (WebCore::SVGElement::viewportElement):
+ * svg/SVGFEComponentTransferElement.cpp:
+ (WebCore::SVGFEComponentTransferElement::build):
+ * svg/SVGFELightElement.cpp:
+ (WebCore::SVGFELightElement::findLightElement):
+ * svg/SVGFontData.cpp:
+ (WebCore::SVGFontData::applySVGGlyphSelection):
+ * svg/SVGFontElement.cpp:
+ (WebCore::SVGFontElement::ensureGlyphCache):
+ * svg/SVGFontFaceElement.cpp:
+ (WebCore::SVGFontFaceElement::associatedFontElement):
+ (WebCore::SVGFontFaceElement::rebuildFontFace):
+ * svg/SVGFontFaceSrcElement.cpp:
+ (WebCore::SVGFontFaceSrcElement::srcValue):
+ (WebCore::SVGFontFaceSrcElement::childrenChanged):
+ * svg/SVGGlyphElement.cpp:
+ (WebCore::SVGGlyphElement::invalidateGlyphCache):
+ * svg/SVGHKernElement.cpp:
+ (WebCore::SVGHKernElement::insertedInto):
+ (WebCore::SVGHKernElement::removedFrom):
+ * svg/SVGLengthContext.cpp:
+ (WebCore::SVGLengthContext::determineViewport):
+ * svg/SVGLocatable.cpp:
+ (WebCore::isViewportElement):
+ * svg/SVGMPathElement.cpp:
+ (WebCore::SVGMPathElement::pathElement):
+ (WebCore::SVGMPathElement::notifyParentOfPathChange):
+ * svg/SVGPathElement.cpp:
+ (WebCore::SVGPathElement::invalidateMPathDependencies):
+ * svg/SVGPatternElement.cpp:
+ (WebCore::SVGPatternElement::collectPatternAttributes):
+ * svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::setupInitialView):
+ * svg/SVGUseElement.cpp:
+ (WebCore::dumpInstanceTree):
+ (WebCore::SVGUseElement::expandUseElementsInShadowTree):
+ * svg/SVGVKernElement.cpp:
+ (WebCore::SVGVKernElement::insertedInto):
+ (WebCore::SVGVKernElement::removedFrom):
+
2014-09-24 Benjamin Poulain <bpoulain@apple.com>
Remove the style marking from :nth-child()
static inline SVGCursorElement* resourceReferencedByCursorElement(const String& url, Document& document)
{
Element* element = SVGURIReference::targetElementFromIRIString(url, document);
- if (element && isSVGCursorElement(element))
+ if (element && is<SVGCursorElement>(element))
return downcast<SVGCursorElement>(element);
return nullptr;
// Scale with/height properties on inline SVG root.
bool StyleResolver::useSVGZoomRulesForLength()
{
- return m_state.element() && m_state.element()->isSVGElement() && !(isSVGSVGElement(m_state.element()) && m_state.element()->parentNode());
+ return m_state.element() && m_state.element()->isSVGElement() && !(is<SVGSVGElement>(m_state.element()) && m_state.element()->parentNode());
}
#if ENABLE(CSS_GRID_LAYOUT)
}
// Get the current preferred styleset. This is the
// set of sheets that will be enabled.
- if (isSVGStyleElement(element))
+ if (is<SVGStyleElement>(element))
sheet = downcast<SVGStyleElement>(element).sheet();
else if (isHTMLLinkElement(element))
sheet = downcast<HTMLLinkElement>(element).sheet();
if (isHTMLScriptElement(element))
return downcast<HTMLScriptElement>(element);
- if (isSVGScriptElement(element))
+ if (is<SVGScriptElement>(element))
return downcast<SVGScriptElement>(element);
return nullptr;
}
print F <<END
};
-
+END
+ ;
+ if ($parameters{namespace} eq "HTML") {
+ print F <<END
// FIXME: Remove these macros once the code has been ported to using
// is<*Element>().
#define is$class(x) WebCore::is<WebCore::$class>(x)
END
- ;
+ ;
+ }
print F "\n";
}
}
{
if (isHTMLImageElement(element) || isHTMLInputElement(element))
return element.fastGetAttribute(HTMLNames::srcAttr);
- if (isSVGImageElement(element))
+ if (is<SVGImageElement>(element))
return element.fastGetAttribute(XLinkNames::hrefAttr);
if (isHTMLEmbedElement(element) || isHTMLObjectElement(element))
return element.imageSourceURL();
|| isHTMLImageElement(m_innerNonSharedNode.get())
|| isHTMLInputElement(m_innerNonSharedNode.get())
|| m_innerNonSharedNode->hasTagName(objectTag)
- || isSVGImageElement(m_innerNonSharedNode.get()))
+ || is<SVGImageElement>(m_innerNonSharedNode.get()))
{
Element* element = toElement(m_innerNonSharedNode.get());
urlString = element->imageSourceURL();
if (isHTMLAnchorElement(*m_innerURLElement))
return downcast<HTMLAnchorElement>(*m_innerURLElement).isLiveLink();
- if (isSVGAElement(*m_innerURLElement))
+ if (is<SVGAElement>(*m_innerURLElement))
return m_innerURLElement->isLink();
return false;
m_center = FloatPoint(
lengthContext.valueForLength(style().svgStyle().cx(), LengthModeWidth),
lengthContext.valueForLength(style().svgStyle().cy(), LengthModeHeight));
- if (isSVGCircleElement(graphicsElement())) {
+ if (is<SVGCircleElement>(graphicsElement())) {
float radius = lengthContext.valueForLength(style().svgStyle().r());
m_radii = FloatSize(radius, radius);
return;
}
- ASSERT(isSVGEllipseElement(graphicsElement()));
+ ASSERT(is<SVGEllipseElement>(graphicsElement()));
m_radii = FloatSize(
lengthContext.valueForLength(style().svgStyle().rx(), LengthModeWidth),
lengthContext.valueForLength(style().svgStyle().ry(), LengthModeHeight));
// tree, that was created during the use/symbol/svg expansion in SVGUseElement. These containers
// need to respect the translations induced by their corresponding use elements x/y attributes.
SVGUseElement* useElement = nullptr;
- if (isSVGUseElement(element))
+ if (is<SVGUseElement>(element))
useElement = &downcast<SVGUseElement>(element);
- else if (element.isInShadowTree() && isSVGGElement(element)) {
+ else if (element.isInShadowTree() && is<SVGGElement>(element)) {
SVGElement* correspondingElement = element.correspondingElement();
- if (correspondingElement && isSVGUseElement(correspondingElement))
+ if (correspondingElement && is<SVGUseElement>(correspondingElement))
useElement = downcast<SVGUseElement>(correspondingElement);
}
static void updatePathFromCircleElement(SVGElement* element, Path& path)
{
- ASSERT(isSVGCircleElement(element));
+ ASSERT(is<SVGCircleElement>(element));
SVGLengthContext lengthContext(element);
RenderElement* renderer = element->renderer();
SVGGraphicsElement& svgElement = shape.graphicsElement();
SVGLengthContext lengthContext(&svgElement);
- if (isSVGRectElement(svgElement)) {
+ if (is<SVGRectElement>(svgElement)) {
const SVGRectElement& element = downcast<SVGRectElement>(svgElement);
writeNameValuePair(ts, "x", element.x().value(lengthContext));
writeNameValuePair(ts, "y", element.y().value(lengthContext));
writeNameValuePair(ts, "width", element.width().value(lengthContext));
writeNameValuePair(ts, "height", element.height().value(lengthContext));
- } else if (isSVGLineElement(svgElement)) {
+ } else if (is<SVGLineElement>(svgElement)) {
const SVGLineElement& element = downcast<SVGLineElement>(svgElement);
writeNameValuePair(ts, "x1", element.x1().value(lengthContext));
writeNameValuePair(ts, "y1", element.y1().value(lengthContext));
writeNameValuePair(ts, "x2", element.x2().value(lengthContext));
writeNameValuePair(ts, "y2", element.y2().value(lengthContext));
- } else if (isSVGEllipseElement(svgElement)) {
+ } else if (is<SVGEllipseElement>(svgElement)) {
const SVGEllipseElement& element = downcast<SVGEllipseElement>(svgElement);
writeNameValuePair(ts, "cx", element.cx().value(lengthContext));
writeNameValuePair(ts, "cy", element.cy().value(lengthContext));
writeNameValuePair(ts, "rx", element.rx().value(lengthContext));
writeNameValuePair(ts, "ry", element.ry().value(lengthContext));
- } else if (isSVGCircleElement(svgElement)) {
+ } else if (is<SVGCircleElement>(svgElement)) {
const SVGCircleElement& element = downcast<SVGCircleElement>(svgElement);
writeNameValuePair(ts, "cx", element.cx().value(lengthContext));
writeNameValuePair(ts, "cy", element.cy().value(lengthContext));
} else if (svgElement.hasTagName(SVGNames::polygonTag) || svgElement.hasTagName(SVGNames::polylineTag)) {
const SVGPolyElement& element = toSVGPolyElement(svgElement);
writeNameAndQuotedValue(ts, "points", element.pointList().valueAsString());
- } else if (isSVGPathElement(svgElement)) {
+ } else if (is<SVGPathElement>(svgElement)) {
const SVGPathElement& element = downcast<SVGPathElement>(svgElement);
String pathString;
// FIXME: We should switch to UnalteredParsing here - this will affect the path dumping output of dozens of tests.
static inline String targetReferenceFromResource(SVGElement& element)
{
String target;
- if (isSVGPatternElement(element))
+ if (is<SVGPatternElement>(element))
target = downcast<SVGPatternElement>(element).href();
else if (isSVGGradientElement(element))
target = toSVGGradientElement(element).href();
- else if (isSVGFilterElement(element))
+ else if (is<SVGFilterElement>(element))
target = downcast<SVGFilterElement>(element).href();
else
ASSERT_NOT_REACHED();
bool foundFirstAltGlyphItem = false;
for (auto& child : childrenOfType<SVGElement>(*this)) {
- if (!foundFirstAltGlyphItem && isSVGGlyphRefElement(child)) {
+ if (!foundFirstAltGlyphItem && is<SVGGlyphRefElement>(child)) {
fountFirstGlyphRef = true;
String referredGlyphName;
glyphNames.clear();
return false;
}
- } else if (!fountFirstGlyphRef && isSVGAltGlyphItemElement(child)) {
+ } else if (!fountFirstGlyphRef && is<SVGAltGlyphItemElement>(child)) {
foundFirstAltGlyphItem = true;
// As the spec says "The first 'altGlyphItem' in which all referenced glyphs
if (!element)
return false;
- if (isSVGGlyphElement(element)) {
+ if (is<SVGGlyphElement>(element)) {
glyphNames.append(target);
return true;
}
- if (isSVGAltGlyphDefElement(element)
+ if (is<SVGAltGlyphDefElement>(element)
&& downcast<SVGAltGlyphDefElement>(*element).hasValidGlyphElements(glyphNames))
return true;
if (targetElement->hasTagName(gTag)
|| targetElement->hasTagName(defsTag)
|| targetElement->hasTagName(useTag)
- || isSVGImageElement(targetElement)
+ || is<SVGImageElement>(targetElement)
|| targetElement->hasTagName(switchTag)
|| targetElement->hasTagName(pathTag)
|| targetElement->hasTagName(rectTag)
SVGSVGElement* SVGDocument::rootElement() const
{
Element* element = documentElement();
- if (element && isSVGSVGElement(element))
+ if (element && is<SVGSVGElement>(element))
return downcast<SVGSVGElement>(element);
return nullptr;
bool SVGElement::isOutermostSVGSVGElement() const
{
- if (!isSVGSVGElement(this))
+ if (!is<SVGSVGElement>(this))
return false;
// If we're living in a shadow tree, we're a <svg> element that got created as replacement
{
ContainerNode* node = parentOrShadowHostNode();
while (node) {
- if (isSVGSVGElement(node))
+ if (is<SVGSVGElement>(node))
return downcast<SVGSVGElement>(node);
node = node->parentOrShadowHostNode();
// to determine the "overflow" property. <use> on <symbol> wouldn't work otherwhise.
ContainerNode* node = parentOrShadowHostNode();
while (node) {
- if (isSVGSVGElement(node) || isSVGImageElement(node) || node->hasTagName(SVGNames::symbolTag))
+ if (is<SVGSVGElement>(node) || is<SVGImageElement>(node) || node->hasTagName(SVGNames::symbolTag))
return downcast<SVGElement>(node);
node = node->parentOrShadowHostNode();
ComponentTransferFunction alpha;
for (auto& child : childrenOfType<SVGElement>(*this)) {
- if (isSVGFEFuncRElement(child))
+ if (is<SVGFEFuncRElement>(child))
red = downcast<SVGFEFuncRElement>(child).transferFunction();
- else if (isSVGFEFuncGElement(child))
+ else if (is<SVGFEFuncGElement>(child))
green = downcast<SVGFEFuncGElement>(child).transferFunction();
- else if (isSVGFEFuncBElement(child))
+ else if (is<SVGFEFuncBElement>(child))
blue = downcast<SVGFEFuncBElement>(child).transferFunction();
- else if (isSVGFEFuncAElement(child))
+ else if (is<SVGFEFuncAElement>(child))
alpha = downcast<SVGFEFuncAElement>(child).transferFunction();
}
SVGFELightElement* SVGFELightElement::findLightElement(const SVGElement* svgElement)
{
for (auto& child : childrenOfType<SVGElement>(*svgElement)) {
- if (isSVGFEDistantLightElement(child) || isSVGFEPointLightElement(child) || isSVGFESpotLightElement(child))
+ if (is<SVGFEDistantLightElement>(child) || is<SVGFEPointLightElement>(child) || is<SVGFESpotLightElement>(child))
return static_cast<SVGFELightElement*>(const_cast<SVGElement*>(&child));
}
return nullptr;
if (Element* parentRendererElement = parentRenderer->element()) {
language = parentRendererElement->getAttribute(XMLNames::langAttr);
- if (isSVGAltGlyphElement(parentRendererElement)) {
+ if (is<SVGAltGlyphElement>(parentRendererElement)) {
SVGAltGlyphElement& altGlyph = downcast<SVGAltGlyphElement>(*parentRendererElement);
if (!altGlyph.hasValidGlyphElements(altGlyphNames))
altGlyphNames.clear();
const SVGMissingGlyphElement* firstMissingGlyphElement = nullptr;
Vector<String> ligatures;
for (auto& child : childrenOfType<SVGElement>(*this)) {
- if (isSVGGlyphElement(child)) {
+ if (is<SVGGlyphElement>(child)) {
SVGGlyphElement& glyph = downcast<SVGGlyphElement>(child);
AtomicString unicode = glyph.fastGetAttribute(SVGNames::unicodeAttr);
AtomicString glyphId = glyph.getIdAttribute();
// Register ligatures, if needed, don't mix up with surrogate pairs though!
if (unicode.length() > 1 && !U16_IS_SURROGATE(unicode[0]))
ligatures.append(unicode.string());
- } else if (isSVGHKernElement(child)) {
+ } else if (is<SVGHKernElement>(child)) {
SVGHKernElement& hkern = downcast<SVGHKernElement>(child);
SVGKerningPair kerningPair;
if (hkern.buildHorizontalKerningPair(kerningPair))
m_horizontalKerningMap.insert(kerningPair);
- } else if (isSVGVKernElement(child)) {
+ } else if (is<SVGVKernElement>(child)) {
SVGVKernElement& vkern = downcast<SVGVKernElement>(child);
SVGKerningPair kerningPair;
if (vkern.buildVerticalKerningPair(kerningPair))
m_verticalKerningMap.insert(kerningPair);
- } else if (isSVGMissingGlyphElement(child) && !firstMissingGlyphElement)
+ } else if (is<SVGMissingGlyphElement>(child) && !firstMissingGlyphElement)
firstMissingGlyphElement = &downcast<SVGMissingGlyphElement>(child);
}
SVGFontElement* SVGFontFaceElement::associatedFontElement() const
{
ASSERT(parentNode() == m_fontElement);
- ASSERT(!parentNode() || isSVGFontElement(parentNode()));
+ ASSERT(!parentNode() || is<SVGFontElement>(parentNode()));
return m_fontElement;
}
// we currently ignore all but the first src element, alternatively we could concat them
auto srcElement = childrenOfType<SVGFontFaceSrcElement>(*this).first();
- bool describesParentFont = isSVGFontElement(parentNode());
+ bool describesParentFont = is<SVGFontElement>(parentNode());
RefPtr<CSSValueList> list;
if (describesParentFont) {
RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
for (auto& child : childrenOfType<SVGElement>(*this)) {
RefPtr<CSSFontFaceSrcValue> srcValue;
- if (isSVGFontFaceUriElement(child))
+ if (is<SVGFontFaceUriElement>(child))
srcValue = downcast<SVGFontFaceUriElement>(child).srcValue();
- else if (isSVGFontFaceNameElement(child))
+ else if (is<SVGFontFaceNameElement>(child))
srcValue = downcast<SVGFontFaceNameElement>(child).srcValue();
if (srcValue && srcValue->resource().length())
list->append(srcValue.releaseNonNull());
void SVGFontFaceSrcElement::childrenChanged(const ChildChange& change)
{
SVGElement::childrenChanged(change);
- if (parentNode() && isSVGFontFaceElement(parentNode()))
+ if (parentNode() && is<SVGFontFaceElement>(parentNode()))
downcast<SVGFontFaceElement>(*parentNode()).rebuildFontFace();
}
void SVGGlyphElement::invalidateGlyphCache()
{
ContainerNode* fontNode = parentNode();
- if (fontNode && isSVGFontElement(fontNode))
+ if (fontNode && is<SVGFontElement>(fontNode))
downcast<SVGFontElement>(*fontNode).invalidateGlyphCache();
}
Node::InsertionNotificationRequest SVGHKernElement::insertedInto(ContainerNode& rootParent)
{
ContainerNode* fontNode = parentNode();
- if (fontNode && isSVGFontElement(fontNode))
+ if (fontNode && is<SVGFontElement>(fontNode))
downcast<SVGFontElement>(*fontNode).invalidateGlyphCache();
return SVGElement::insertedInto(rootParent);
void SVGHKernElement::removedFrom(ContainerNode& rootParent)
{
ContainerNode* fontNode = parentNode();
- if (fontNode && isSVGFontElement(fontNode))
+ if (fontNode && is<SVGFontElement>(fontNode))
downcast<SVGFontElement>(*fontNode).invalidateGlyphCache();
SVGElement::removedFrom(rootParent);
// Take size from nearest viewport element.
SVGElement* viewportElement = m_context->viewportElement();
- if (!viewportElement || !isSVGSVGElement(viewportElement))
+ if (!viewportElement || !is<SVGSVGElement>(viewportElement))
return false;
const SVGSVGElement& svg = downcast<SVGSVGElement>(*viewportElement);
return (node->hasTagName(SVGNames::svgTag)
|| node->hasTagName(SVGNames::symbolTag)
|| node->hasTagName(SVGNames::foreignObjectTag)
- || isSVGImageElement(node));
+ || is<SVGImageElement>(node));
}
SVGElement* SVGLocatable::nearestViewportElement(const SVGElement* element)
SVGPathElement* SVGMPathElement::pathElement()
{
Element* target = targetElementFromIRIString(href(), document());
- if (target && isSVGPathElement(target))
+ if (target && is<SVGPathElement>(target))
return downcast<SVGPathElement>(target);
return nullptr;
}
void SVGMPathElement::notifyParentOfPathChange(ContainerNode* parent)
{
- if (parent && isSVGAnimateMotionElement(parent))
+ if (parent && is<SVGAnimateMotionElement>(parent))
downcast<SVGAnimateMotionElement>(*parent).updateAnimationPath();
}
// markForLayoutAndParentResourceInvalidation so we update any mpath dependencies manually.
if (HashSet<SVGElement*>* dependencies = document().accessSVGExtensions().setOfElementsReferencingTarget(this)) {
for (auto* element : *dependencies) {
- if (isSVGMPathElement(element))
+ if (is<SVGMPathElement>(element))
downcast<SVGMPathElement>(*element).targetPathChanged();
}
}
// Respect xlink:href, take attributes from referenced element
Element* refElement = SVGURIReference::targetElementFromIRIString(current->href(), document());
- if (refElement && isSVGPatternElement(refElement)) {
+ if (refElement && is<SVGPatternElement>(refElement)) {
current = downcast<SVGPatternElement>(refElement);
// Cycle detection
// or MyDrawing.svg#xpointer(id('MyView'))) then the closest ancestor ‘svg’ element is displayed in the viewport.
// Any view specification attributes included on the given ‘view’ element override the corresponding view specification
// attributes on the closest ancestor ‘svg’ element.
- if (anchorNode && isSVGViewElement(anchorNode)) {
+ if (anchorNode && is<SVGViewElement>(anchorNode)) {
SVGViewElement& viewElement = downcast<SVGViewElement>(*anchorNode);
SVGElement* element = SVGLocatable::nearestViewportElement(&viewElement);
- if (isSVGSVGElement(element)) {
+ if (is<SVGSVGElement>(element)) {
SVGSVGElement& svg = downcast<SVGSVGElement>(*element);
svg.inheritViewAttributes(&viewElement);
SVGElement* element = targetInstance->correspondingElement();
ASSERT(element);
- if (isSVGUseElement(element)) {
+ if (is<SVGUseElement>(element)) {
if (downcast<SVGUseElement>(*element).cachedDocumentIsStillLoading())
return;
}
// contains <use> tags, we'd miss them. So once we're done with settin' up the
// actual shadow tree (after the special case modification for svg/symbol) we have
// to walk it completely and expand all <use> elements.
- if (isSVGUseElement(element)) {
+ if (is<SVGUseElement>(element)) {
SVGUseElement& use = downcast<SVGUseElement>(*element);
ASSERT(!use.cachedDocumentIsStillLoading());
{
if (rootParent.inDocument()) {
ContainerNode* fontNode = parentNode();
- if (fontNode && isSVGFontElement(fontNode))
+ if (fontNode && is<SVGFontElement>(fontNode))
downcast<SVGFontElement>(*fontNode).invalidateGlyphCache();
}
void SVGVKernElement::removedFrom(ContainerNode& rootParent)
{
ContainerNode* fontNode = parentNode();
- if (fontNode && isSVGFontElement(fontNode))
+ if (fontNode && is<SVGFontElement>(fontNode))
downcast<SVGFontElement>(*fontNode).invalidateGlyphCache();
SVGElement::removedFrom(rootParent);