void SVGPathElement::pathSegListChanged(SVGPathSegRole role, ListModification listModification) { switch (role) { case PathSegNormalizedRole: // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists! break; case PathSegUnalteredRole: if (listModification == ListModificationAppend) { ASSERT(!m_pathSegList.value.isEmpty()); appendSVGPathByteStreamFromSVGPathSeg(m_pathSegList.value.last().copyRef(), m_pathByteStream, UnalteredParsing); } else buildSVGPathByteStreamFromSVGPathSegList(m_pathSegList.value, m_pathByteStream, UnalteredParsing); break; case PathSegUndefinedRole: return; } invalidateSVGAttributes(); RenderSVGPath* renderer = downcast<RenderSVGPath>(this->renderer()); if (!renderer) return; renderer->setNeedsShapeUpdate(); RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); }
void SVGLineElement::svgAttributeChanged(const QualifiedName& attrName) { SVGStyledTransformableElement::svgAttributeChanged(attrName); bool isLengthAttribute = attrName == SVGNames::x1Attr || attrName == SVGNames::y1Attr || attrName == SVGNames::x2Attr || attrName == SVGNames::y2Attr; if (isLengthAttribute) updateRelativeLengthsInformation(); if (SVGTests::handleAttributeChange(this, attrName)) return; RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer()); if (!renderer) return; if (isLengthAttribute) { renderer->setNeedsPathUpdate(); RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); return; } if (SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); }
void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName) { if (!isSupportedAttribute(attrName)) { SVGGraphicsElement::svgAttributeChanged(attrName); return; } InstanceInvalidationGuard guard(*this); RenderSVGPath* renderer = downcast<RenderSVGPath>(this->renderer()); if (attrName == SVGNames::dAttr) { if (m_pathSegList.shouldSynchronize && !SVGAnimatedProperty::lookupWrapper<SVGPathElement, SVGAnimatedPathSegListPropertyTearOff>(this, dPropertyInfo())->isAnimating()) { SVGPathSegList newList(PathSegUnalteredRole); buildSVGPathSegListFromByteStream(m_pathByteStream, *this, newList, UnalteredParsing); m_pathSegList.value = newList; } if (renderer) renderer->setNeedsShapeUpdate(); invalidateMPathDependencies(); } if (renderer) RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); }
void SVGPolyElement::svgAttributeChanged(const QualifiedName& attrName) { SVGStyledTransformableElement::svgAttributeChanged(attrName); if (SVGTests::handleAttributeChange(this, attrName)) return; RenderSVGPath* renderer = static_cast<RenderSVGPath*>(this->renderer()); if (!renderer) return; if (SVGStyledTransformableElement::isKnownAttribute(attrName)) { renderer->setNeedsTransformUpdate(); RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); return; } if (attrName == SVGNames::pointsAttr) { renderer->setNeedsPathUpdate(); RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); return; } if (SVGLangSpace::isKnownAttribute(attrName) || SVGExternalResourcesRequired::isKnownAttribute(attrName)) RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); }
FloatRect SVGPathElement::getBBox(StyleUpdateStrategy styleUpdateStrategy) { if (styleUpdateStrategy == AllowStyleUpdate) document().updateLayoutIgnorePendingStylesheets(); RenderSVGPath* renderer = downcast<RenderSVGPath>(this->renderer()); // FIXME: Eventually we should support getBBox for detached elements. if (!renderer) return FloatRect(); return renderer->path().boundingRect(); }