https://bugs.webkit.org/show_bug.cgi?id=137030
Reviewed by Ryosuke Niwa.
Have Document::accessSVGExtensions() return a reference instead of a
pointer as it can never return null.
No new tests, no behavior change.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeChild):
(WebCore::ContainerNode::removeChildren):
* dom/Document.cpp:
(WebCore::Document::commonTeardown):
(WebCore::Document::implicitClose):
(WebCore::Document::accessSVGExtensions):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::~Element):
(WebCore::Element::removedFrom):
* editing/markup.cpp:
(WebCore::isPlainTextMarkup):
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::buildReferenceFilter):
* rendering/svg/RenderSVGResource.cpp:
(WebCore::removeFromCacheAndInvalidateDependencies):
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::svgExtensionsFromElement):
* rendering/svg/RenderSVGResourceContainer.h:
(WebCore::getRenderSVGResourceContainerById):
(WebCore::getRenderSVGResourceById):
* rendering/svg/SVGResources.cpp:
(WebCore::registerPendingResource):
(WebCore::SVGResources::buildCachedResources):
* rendering/svg/SVGResourcesCache.cpp:
(WebCore::resourcesCacheFromRenderer):
(WebCore::SVGResourcesCache::resourceDestroyed):
* svg/SVGElement.cpp:
(WebCore::SVGElement::~SVGElement):
(WebCore::SVGElement::reportAttributeParsingError):
(WebCore::SVGElement::removedFrom):
(WebCore::SVGElement::viewportElement):
(WebCore::SVGElement::attributeChanged):
(WebCore::SVGElement::buildPendingResourcesIfNeeded):
(WebCore::SVGElement::accessDocumentSVGExtensions): Deleted.
* svg/SVGElement.h:
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::parseAttribute):
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::parseAttribute):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::clearResourceReferences):
(WebCore::SVGFEImageElement::buildPendingResource):
* svg/SVGFitToViewBox.cpp:
(WebCore::SVGFitToViewBox::parseViewBox):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::insertedInto):
(WebCore::SVGFontFaceElement::removedFrom):
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::buildPendingResource):
(WebCore::SVGMPathElement::clearResourceReferences):
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::parseAttribute):
(WebCore::SVGPathElement::invalidateMPathDependencies):
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::parseAttribute):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::~SVGSVGElement):
(WebCore::SVGSVGElement::insertedInto):
(WebCore::SVGSVGElement::removedFrom):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::detachTarget):
(WebCore::SVGTRefElement::buildPendingResource):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::clearResourceReferences):
(WebCore::SVGTextPathElement::buildPendingResource):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::clearResourceReferences):
(WebCore::SVGUseElement::buildPendingResource):
(WebCore::SVGUseElement::toClipPath):
(WebCore::SVGUseElement::buildInstanceTree):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::clearResourceReferences):
(WebCore::SVGSMILElement::buildPendingResource):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173883
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-09-23 Chris Dumez <cdumez@apple.com>
+
+ Have Document::accessSVGExtensions() return a reference
+ https://bugs.webkit.org/show_bug.cgi?id=137030
+
+ Reviewed by Ryosuke Niwa.
+
+ Have Document::accessSVGExtensions() return a reference instead of a
+ pointer as it can never return null.
+
+ No new tests, no behavior change.
+
+ * dom/ContainerNode.cpp:
+ (WebCore::ContainerNode::removeChild):
+ (WebCore::ContainerNode::removeChildren):
+ * dom/Document.cpp:
+ (WebCore::Document::commonTeardown):
+ (WebCore::Document::implicitClose):
+ (WebCore::Document::accessSVGExtensions):
+ * dom/Document.h:
+ * dom/Element.cpp:
+ (WebCore::Element::~Element):
+ (WebCore::Element::removedFrom):
+ * editing/markup.cpp:
+ (WebCore::isPlainTextMarkup):
+ * history/CachedFrame.cpp:
+ (WebCore::CachedFrameBase::restore):
+ * rendering/FilterEffectRenderer.cpp:
+ (WebCore::FilterEffectRenderer::buildReferenceFilter):
+ * rendering/svg/RenderSVGResource.cpp:
+ (WebCore::removeFromCacheAndInvalidateDependencies):
+ * rendering/svg/RenderSVGResourceContainer.cpp:
+ (WebCore::svgExtensionsFromElement):
+ * rendering/svg/RenderSVGResourceContainer.h:
+ (WebCore::getRenderSVGResourceContainerById):
+ (WebCore::getRenderSVGResourceById):
+ * rendering/svg/SVGResources.cpp:
+ (WebCore::registerPendingResource):
+ (WebCore::SVGResources::buildCachedResources):
+ * rendering/svg/SVGResourcesCache.cpp:
+ (WebCore::resourcesCacheFromRenderer):
+ (WebCore::SVGResourcesCache::resourceDestroyed):
+ * svg/SVGElement.cpp:
+ (WebCore::SVGElement::~SVGElement):
+ (WebCore::SVGElement::reportAttributeParsingError):
+ (WebCore::SVGElement::removedFrom):
+ (WebCore::SVGElement::viewportElement):
+ (WebCore::SVGElement::attributeChanged):
+ (WebCore::SVGElement::buildPendingResourcesIfNeeded):
+ (WebCore::SVGElement::accessDocumentSVGExtensions): Deleted.
+ * svg/SVGElement.h:
+ * svg/SVGFEConvolveMatrixElement.cpp:
+ (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
+ * svg/SVGFEGaussianBlurElement.cpp:
+ (WebCore::SVGFEGaussianBlurElement::parseAttribute):
+ * svg/SVGFEImageElement.cpp:
+ (WebCore::SVGFEImageElement::clearResourceReferences):
+ (WebCore::SVGFEImageElement::buildPendingResource):
+ * svg/SVGFitToViewBox.cpp:
+ (WebCore::SVGFitToViewBox::parseViewBox):
+ * svg/SVGFontFaceElement.cpp:
+ (WebCore::SVGFontFaceElement::insertedInto):
+ (WebCore::SVGFontFaceElement::removedFrom):
+ * svg/SVGMPathElement.cpp:
+ (WebCore::SVGMPathElement::buildPendingResource):
+ (WebCore::SVGMPathElement::clearResourceReferences):
+ * svg/SVGPathElement.cpp:
+ (WebCore::SVGPathElement::parseAttribute):
+ (WebCore::SVGPathElement::invalidateMPathDependencies):
+ * svg/SVGPolyElement.cpp:
+ (WebCore::SVGPolyElement::parseAttribute):
+ * svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::~SVGSVGElement):
+ (WebCore::SVGSVGElement::insertedInto):
+ (WebCore::SVGSVGElement::removedFrom):
+ * svg/SVGTRefElement.cpp:
+ (WebCore::SVGTRefElement::detachTarget):
+ (WebCore::SVGTRefElement::buildPendingResource):
+ * svg/SVGTextPathElement.cpp:
+ (WebCore::SVGTextPathElement::clearResourceReferences):
+ (WebCore::SVGTextPathElement::buildPendingResource):
+ * svg/SVGUseElement.cpp:
+ (WebCore::SVGUseElement::clearResourceReferences):
+ (WebCore::SVGUseElement::buildPendingResource):
+ (WebCore::SVGUseElement::toClipPath):
+ (WebCore::SVGUseElement::buildInstanceTree):
+ * svg/animation/SVGSMILElement.cpp:
+ (WebCore::SVGSMILElement::clearResourceReferences):
+ (WebCore::SVGSMILElement::buildPendingResource):
+
2014-09-23 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Should be able to attach a debugger to a JSContext before anything is executed
if (document().svgExtensions()) {
Element* shadowHost = this->shadowHost();
if (!shadowHost || !shadowHost->hasTagName(SVGNames::useTag))
- document().accessSVGExtensions()->rebuildElements();
+ document().accessSVGExtensions().rebuildElements();
}
dispatchSubtreeModifiedEvent();
if (document().svgExtensions()) {
Element* shadowHost = this->shadowHost();
if (!shadowHost || !shadowHost->hasTagName(SVGNames::useTag))
- document().accessSVGExtensions()->rebuildElements();
+ document().accessSVGExtensions().rebuildElements();
}
dispatchSubtreeModifiedEvent();
void Document::commonTeardown()
{
if (svgExtensions())
- accessSVGExtensions()->pauseAnimations();
+ accessSVGExtensions().pauseAnimations();
#if ENABLE(REQUEST_ANIMATION_FRAME)
clearScriptedAnimationController();
// here, instead of doing it from SVGElement::finishedParsingChildren (if externalResourcesRequired="false",
// which is the default, for ='true' its fired at a later time, once all external resources finished loading).
if (svgExtensions())
- accessSVGExtensions()->dispatchSVGLoadEventToOutermostSVGElements();
+ accessSVGExtensions().dispatchSVGLoadEventToOutermostSVGElements();
dispatchWindowLoadEvent();
enqueuePageshowEvent(PageshowEventNotPersisted);
#endif
if (svgExtensions())
- accessSVGExtensions()->startAnimations();
+ accessSVGExtensions().startAnimations();
}
void Document::setParsing(bool b)
return m_svgExtensions.get();
}
-SVGDocumentExtensions* Document::accessSVGExtensions()
+SVGDocumentExtensions& Document::accessSVGExtensions()
{
if (!m_svgExtensions)
m_svgExtensions = std::make_unique<SVGDocumentExtensions>(this);
- return m_svgExtensions.get();
+ return *m_svgExtensions;
}
bool Document::hasSVGRootNode() const
virtual void removeAllEventListeners() override;
WEBCORE_EXPORT const SVGDocumentExtensions* svgExtensions();
- WEBCORE_EXPORT SVGDocumentExtensions* accessSVGExtensions();
+ WEBCORE_EXPORT SVGDocumentExtensions& accessSVGExtensions();
void initSecurityContext();
void initContentSecurityPolicy();
detachAllAttrNodesFromElement();
if (hasPendingResources()) {
- document().accessSVGExtensions()->removeElementFromPendingResources(this);
+ document().accessSVGExtensions().removeElementFromPendingResources(this);
ASSERT(!hasPendingResources());
}
}
ContainerNode::removedFrom(insertionPoint);
if (hasPendingResources())
- document().accessSVGExtensions()->removeElementFromPendingResources(this);
+ document().accessSVGExtensions().removeElementFromPendingResources(this);
}
void Element::unregisterNamedFlowContentElement()
if (!isHTMLDivElement(node))
return false;
- HTMLDivElement& element = toHTMLDivElement(*node);
+ HTMLDivElement& element = downcast<HTMLDivElement>(*node);
if (element.hasAttributes())
return false;
m_cachedFrameScriptData->restore(frame);
if (m_document->svgExtensions())
- m_document->accessSVGExtensions()->unpauseAnimations();
+ m_document->accessSVGExtensions().unpauseAnimations();
frame.animation().resumeAnimationsForDocument(m_document.get());
m_document->resumeActiveDOMObjects(ActiveDOMObject::DocumentWillBecomeInactive);
PassRefPtr<FilterEffect> FilterEffectRenderer::buildReferenceFilter(RenderElement* renderer, PassRefPtr<FilterEffect> previousEffect, ReferenceFilterOperation* filterOperation)
{
if (!renderer)
- return 0;
+ return nullptr;
Document* document = &renderer->document();
document = cachedSVGDocument->document();
if (!document)
- return 0;
+ return nullptr;
Element* filter = document->getElementById(filterOperation->fragment());
if (!filter) {
// Although we did not find the referenced filter, it might exist later in the document.
// FIXME: This skips anonymous RenderObjects. <https://webkit.org/b/131085>
if (Element* element = renderer->element())
- document->accessSVGExtensions()->addPendingResource(filterOperation->fragment(), element);
- return 0;
+ document->accessSVGExtensions().addPendingResource(filterOperation->fragment(), element);
+ return nullptr;
}
RefPtr<FilterEffect> effect;
if (!renderer.element() || !renderer.element()->isSVGElement())
return;
- HashSet<SVGElement*>* dependencies = renderer.document().accessSVGExtensions()->setOfElementsReferencingTarget(downcast<SVGElement>(renderer.element()));
+ HashSet<SVGElement*>* dependencies = renderer.document().accessSVGExtensions().setOfElementsReferencingTarget(downcast<SVGElement>(renderer.element()));
if (!dependencies)
return;
for (auto* element : *dependencies) {
static inline SVGDocumentExtensions& svgExtensionsFromElement(SVGElement& element)
{
- // FIXME: accessSVGExtensions() should return a reference.
- return *element.document().accessSVGExtensions();
+ return element.document().accessSVGExtensions();
}
RenderSVGResourceContainer::RenderSVGResourceContainer(SVGElement& element, PassRef<RenderStyle> style)
inline RenderSVGResourceContainer* getRenderSVGResourceContainerById(Document& document, const AtomicString& id)
{
if (id.isEmpty())
- return 0;
+ return nullptr;
- if (RenderSVGResourceContainer* renderResource = document.accessSVGExtensions()->resourceById(id))
+ if (RenderSVGResourceContainer* renderResource = document.accessSVGExtensions().resourceById(id))
return renderResource;
- return 0;
+ return nullptr;
}
template<typename Renderer>
if (RenderSVGResourceContainer* container = getRenderSVGResourceContainerById(document, id))
return container->cast<Renderer>();
- return 0;
+ return nullptr;
}
}
return container;
}
-static inline void registerPendingResource(SVGDocumentExtensions* extensions, const AtomicString& id, SVGElement& element)
+static inline void registerPendingResource(SVGDocumentExtensions& extensions, const AtomicString& id, SVGElement& element)
{
- extensions->addPendingResource(id, &element);
+ extensions.addPendingResource(id, &element);
}
bool SVGResources::buildCachedResources(const RenderElement& renderer, const SVGRenderStyle& svgStyle)
Document& document = element.document();
- SVGDocumentExtensions* extensions = document.accessSVGExtensions();
- ASSERT(extensions);
+ SVGDocumentExtensions& extensions = document.accessSVGExtensions();
const AtomicString& tagName = element.localName();
if (tagName.isNull())
static inline SVGResourcesCache& resourcesCacheFromRenderer(const RenderElement& renderer)
{
- SVGDocumentExtensions* extensions = renderer.document().accessSVGExtensions();
- ASSERT(extensions);
- return extensions->resourcesCache();
+ return renderer.document().accessSVGExtensions().resourcesCache();
}
SVGResources* SVGResourcesCache::cachedResourcesForRenderer(const RenderElement& renderer)
// Mark users of destroyed resources as pending resolution based on the id of the old resource.
Element& resourceElement = resource.element();
Element* clientElement = it.key->element();
- SVGDocumentExtensions* extensions = clientElement->document().accessSVGExtensions();
-
- extensions->addPendingResource(resourceElement.getIdAttribute(), clientElement);
+ clientElement->document().accessSVGExtensions().addPendingResource(resourceElement.getIdAttribute(), clientElement);
}
}
m_svgRareData = nullptr;
}
- document().accessSVGExtensions()->rebuildAllElementReferencesForTarget(*this);
- document().accessSVGExtensions()->removeAllElementReferencesForTarget(this);
+ document().accessSVGExtensions().rebuildAllElementReferencesForTarget(*this);
+ document().accessSVGExtensions().removeAllElementReferencesForTarget(this);
}
short SVGElement::tabIndex() const
return;
String errorString = "<" + tagName() + "> attribute " + name.toString() + "=\"" + value + "\"";
- SVGDocumentExtensions* extensions = document().accessSVGExtensions();
+ SVGDocumentExtensions& extensions = document().accessSVGExtensions();
if (error == NegativeValueForbiddenError) {
- extensions->reportError("Invalid negative value for " + errorString);
+ extensions.reportError("Invalid negative value for " + errorString);
return;
}
if (error == ParsingAttributeFailedError) {
- extensions->reportError("Invalid value for " + errorString);
+ extensions.reportError("Invalid value for " + errorString);
return;
}
StyledElement::removedFrom(rootParent);
if (wasInDocument) {
- document().accessSVGExtensions()->clearTargetDependencies(*this);
- document().accessSVGExtensions()->removeAllElementReferencesForTarget(this);
+ document().accessSVGExtensions().clearTargetDependencies(*this);
+ document().accessSVGExtensions().removeAllElementReferencesForTarget(this);
}
SVGElementInstance::invalidateAllInstancesOfElement(this);
}
return nullptr;
}
-
-SVGDocumentExtensions* SVGElement::accessDocumentSVGExtensions()
-{
- // This function is provided for use by SVGAnimatedProperty to avoid
- // global inclusion of Document.h in SVG code.
- return document().accessSVGExtensions();
-}
void SVGElement::mapInstanceToElement(SVGElementInstance* instance)
{
StyledElement::attributeChanged(name, oldValue, newValue);
if (name == HTMLNames::idAttr)
- document().accessSVGExtensions()->rebuildAllElementReferencesForTarget(*this);
+ document().accessSVGExtensions().rebuildAllElementReferencesForTarget(*this);
// Changes to the style attribute are processed lazily (see Element::getAttribute() and related methods),
// so we don't want changes to the style attribute to result in extra work here.
if (!needsPendingResourceHandling() || !inDocument() || isInShadowTree())
return;
- SVGDocumentExtensions* extensions = document().accessSVGExtensions();
+ SVGDocumentExtensions& extensions = document().accessSVGExtensions();
String resourceId = getIdAttribute();
- if (!extensions->isIdOfPendingResource(resourceId))
+ if (!extensions.isIdOfPendingResource(resourceId))
return;
// Mark pending resources as pending for removal.
- extensions->markPendingResourcesForRemoval(resourceId);
+ extensions.markPendingResourcesForRemoval(resourceId);
// Rebuild pending resources for each client of a pending resource that is being removed.
- while (Element* clientElement = extensions->removeElementFromPendingResourcesForRemovalMap(resourceId)) {
+ while (Element* clientElement = extensions.removeElementFromPendingResourcesForRemovalMap(resourceId)) {
ASSERT(clientElement->hasPendingResources());
if (clientElement->hasPendingResources()) {
clientElement->buildPendingResource();
- extensions->clearHasPendingResourcesIfPossible(clientElement);
+ extensions.clearHasPendingResourcesIfPossible(clientElement);
}
}
}
void setInstanceUpdatesBlocked(bool);
virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const;
- SVGDocumentExtensions* accessDocumentSVGExtensions();
-
virtual bool isSVGGraphicsElement() const { return false; }
virtual bool isFilterEffect() const { return false; }
virtual bool isGradientStop() const { return false; }
setOrderXBaseValue(x);
setOrderYBaseValue(y);
} else
- document().accessSVGExtensions()->reportWarning(
+ document().accessSVGExtensions().reportWarning(
"feConvolveMatrix: problem parsing order=\"" + value
+ "\". Filtered element will not be displayed.");
return;
if (propertyValue > 0)
setEdgeModeBaseValue(propertyValue);
else
- document().accessSVGExtensions()->reportWarning(
+ document().accessSVGExtensions().reportWarning(
"feConvolveMatrix: problem parsing edgeMode=\"" + value
+ "\". Filtered element will not be displayed.");
return;
if (divisor)
setDivisorBaseValue(divisor);
else
- document().accessSVGExtensions()->reportWarning(
+ document().accessSVGExtensions().reportWarning(
"feConvolveMatrix: problem parsing divisor=\"" + value
+ "\". Filtered element will not be displayed.");
return;
setKernelUnitLengthXBaseValue(x);
setKernelUnitLengthYBaseValue(y);
} else
- document().accessSVGExtensions()->reportWarning(
+ document().accessSVGExtensions().reportWarning(
"feConvolveMatrix: problem parsing kernelUnitLength=\"" + value
+ "\". Filtered element will not be displayed.");
return;
else if (value == "false")
setPreserveAlphaBaseValue(false);
else
- document().accessSVGExtensions()->reportWarning(
+ document().accessSVGExtensions().reportWarning(
"feConvolveMatrix: problem parsing preserveAlphaAttr=\"" + value
+ "\". Filtered element will not be displayed.");
return;
if (propertyValue > 0)
setEdgeModeBaseValue(propertyValue);
else
- document().accessSVGExtensions()->reportWarning(
+ document().accessSVGExtensions().reportWarning(
"feGaussianBlur: problem parsing edgeMode=\"" + value
+ "\". Filtered element will not be displayed.");
return;
m_cachedImage = 0;
}
- document().accessSVGExtensions()->removeAllTargetReferencesForElement(this);
+ document().accessSVGExtensions().removeAllTargetReferencesForElement(this);
}
void SVGFEImageElement::requestImageResource()
if (id.isEmpty())
requestImageResource();
else {
- document().accessSVGExtensions()->addPendingResource(id, this);
+ document().accessSVGExtensions().addPendingResource(id, this);
ASSERT(hasPendingResources());
}
} else if (target->isSVGElement()) {
// Register us with the target in the dependencies map. Any change of hrefElement
// that leads to relayout/repainting now informs us, so we can react to it.
- document().accessSVGExtensions()->addElementReferencingTarget(this, downcast<SVGElement>(target));
+ document().accessSVGExtensions().addElementReferencingTarget(this, downcast<SVGElement>(target));
}
invalidate();
return true;
}
if (!valid) {
- doc->accessSVGExtensions()->reportWarning("Problem parsing viewBox=\"" + str + "\"");
+ doc->accessSVGExtensions().reportWarning("Problem parsing viewBox=\"" + str + "\"");
return false;
}
if (width < 0.0) { // check that width is positive
- doc->accessSVGExtensions()->reportError("A negative value for ViewBox width is not allowed");
+ doc->accessSVGExtensions().reportError("A negative value for ViewBox width is not allowed");
return false;
}
if (height < 0.0) { // check that height is positive
- doc->accessSVGExtensions()->reportError("A negative value for ViewBox height is not allowed");
+ doc->accessSVGExtensions().reportError("A negative value for ViewBox height is not allowed");
return false;
}
skipOptionalSVGSpaces(c, end);
if (c < end) { // nothing should come after the last, fourth number
- doc->accessSVGExtensions()->reportWarning("Problem parsing viewBox=\"" + str + "\"");
+ doc->accessSVGExtensions().reportWarning("Problem parsing viewBox=\"" + str + "\"");
return false;
}
ASSERT(!m_fontElement);
return InsertionDone;
}
- document().accessSVGExtensions()->registerSVGFontFaceElement(this);
+ document().accessSVGExtensions().registerSVGFontFaceElement(this);
rebuildFontFace();
return InsertionDone;
if (rootParent.inDocument()) {
m_fontElement = 0;
- document().accessSVGExtensions()->unregisterSVGFontFaceElement(this);
+ document().accessSVGExtensions().unregisterSVGFontFaceElement(this);
m_fontFaceRule->mutableProperties().clear();
document().styleResolverChanged(DeferRecalcStyle);
Element* target = SVGURIReference::targetElementFromIRIString(href(), document(), &id);
if (!target) {
// Do not register as pending if we are already pending this resource.
- if (document().accessSVGExtensions()->isPendingResource(this, id))
+ if (document().accessSVGExtensions().isPendingResource(this, id))
return;
if (!id.isEmpty()) {
- document().accessSVGExtensions()->addPendingResource(id, this);
+ document().accessSVGExtensions().addPendingResource(id, this);
ASSERT(hasPendingResources());
}
} else if (target->isSVGElement()) {
// Register us with the target in the dependencies map. Any change of hrefElement
// that leads to relayout/repainting now informs us, so we can react to it.
- document().accessSVGExtensions()->addElementReferencingTarget(this, downcast<SVGElement>(target));
+ document().accessSVGExtensions().addElementReferencingTarget(this, downcast<SVGElement>(target));
}
targetPathChanged();
void SVGMPathElement::clearResourceReferences()
{
- document().accessSVGExtensions()->removeAllTargetReferencesForElement(this);
+ document().accessSVGExtensions().removeAllTargetReferencesForElement(this);
}
Node::InsertionNotificationRequest SVGMPathElement::insertedInto(ContainerNode& rootParent)
if (name == SVGNames::dAttr) {
if (!buildSVGPathByteStreamFromString(value, m_pathByteStream.get(), UnalteredParsing))
- document().accessSVGExtensions()->reportError("Problem parsing d=\"" + value + "\"");
+ document().accessSVGExtensions().reportError("Problem parsing d=\"" + value + "\"");
return;
}
if (name == SVGNames::pathLengthAttr) {
setPathLengthBaseValue(value.toFloat());
if (pathLengthBaseValue() < 0)
- document().accessSVGExtensions()->reportError("A negative value for path attribute <pathLength> is not allowed");
+ document().accessSVGExtensions().reportError("A negative value for path attribute <pathLength> is not allowed");
return;
}
{
// <mpath> can only reference <path> but this dependency is not handled in
// markForLayoutAndParentResourceInvalidation so we update any mpath dependencies manually.
- if (HashSet<SVGElement*>* dependencies = document().accessSVGExtensions()->setOfElementsReferencingTarget(this)) {
+ if (HashSet<SVGElement*>* dependencies = document().accessSVGExtensions().setOfElementsReferencingTarget(this)) {
for (auto* element : *dependencies) {
if (isSVGMPathElement(element))
downcast<SVGMPathElement>(*element).targetPathChanged();
if (name == SVGNames::pointsAttr) {
SVGPointList newList;
if (!pointsListFromSVGData(newList, value))
- document().accessSVGExtensions()->reportError("Problem parsing points=\"" + value + "\"");
+ document().accessSVGExtensions().reportError("Problem parsing points=\"" + value + "\"");
if (SVGAnimatedProperty* wrapper = SVGAnimatedProperty::lookupWrapper<SVGPolyElement, SVGAnimatedPointList>(this, pointsPropertyInfo()))
static_cast<SVGAnimatedPointList*>(wrapper)->detachListWrappers(newList.size());
document().unregisterForPageCacheSuspensionCallbacks(this);
// There are cases where removedFromDocument() is not called.
// see ContainerNode::removeAllChildren, called by its destructor.
- document().accessSVGExtensions()->removeTimeContainer(this);
+ document().accessSVGExtensions().removeTimeContainer(this);
}
void SVGSVGElement::didMoveToNewDocument(Document* oldDocument)
Node::InsertionNotificationRequest SVGSVGElement::insertedInto(ContainerNode& rootParent)
{
if (rootParent.inDocument()) {
- document().accessSVGExtensions()->addTimeContainer(this);
+ document().accessSVGExtensions().addTimeContainer(this);
// Animations are started at the end of document parsing and after firing the load event,
// but if we miss that train (deferred programmatic element insertion for example) we need
void SVGSVGElement::removedFrom(ContainerNode& rootParent)
{
if (rootParent.inDocument())
- document().accessSVGExtensions()->removeTimeContainer(this);
+ document().accessSVGExtensions().removeTimeContainer(this);
SVGGraphicsElement::removedFrom(rootParent);
}
String id;
SVGURIReference::targetElementFromIRIString(href(), document(), &id);
if (!id.isEmpty())
- document().accessSVGExtensions()->addPendingResource(id, this);
+ document().accessSVGExtensions().addPendingResource(id, this);
}
bool SVGTRefElement::isSupportedAttribute(const QualifiedName& attrName)
if (id.isEmpty())
return;
- document().accessSVGExtensions()->addPendingResource(id, this);
+ document().accessSVGExtensions().addPendingResource(id, this);
ASSERT(hasPendingResources());
return;
}
void SVGTextPathElement::clearResourceReferences()
{
- document().accessSVGExtensions()->removeAllTargetReferencesForElement(this);
+ document().accessSVGExtensions().removeAllTargetReferencesForElement(this);
}
bool SVGTextPathElement::isSupportedAttribute(const QualifiedName& attrName)
Element* target = SVGURIReference::targetElementFromIRIString(href(), document(), &id);
if (!target) {
// Do not register as pending if we are already pending this resource.
- if (document().accessSVGExtensions()->isPendingResource(this, id))
+ if (document().accessSVGExtensions().isPendingResource(this, id))
return;
if (!id.isEmpty()) {
- document().accessSVGExtensions()->addPendingResource(id, this);
+ document().accessSVGExtensions().addPendingResource(id, this);
ASSERT(hasPendingResources());
}
} else if (target->hasTagName(SVGNames::pathTag)) {
// Register us with the target in the dependencies map. Any change of hrefElement
// that leads to relayout/repainting now informs us, so we can react to it.
- document().accessSVGExtensions()->addElementReferencingTarget(this, downcast<SVGElement>(target));
+ document().accessSVGExtensions().addElementReferencingTarget(this, downcast<SVGElement>(target));
}
}
m_needsShadowTreeRecreation = false;
- document().accessSVGExtensions()->removeAllTargetReferencesForElement(this);
+ document().accessSVGExtensions().removeAllTargetReferencesForElement(this);
}
void SVGUseElement::buildPendingResource()
if (id.isEmpty())
return;
- referencedDocument()->accessSVGExtensions()->addPendingResource(id, this);
+ referencedDocument()->accessSVGExtensions().addPendingResource(id, this);
ASSERT(hasPendingResources());
return;
}
if (node->isSVGElement() && downcast<SVGElement>(*node).isSVGGraphicsElement()) {
if (!isDirectReference(downcast<SVGElement>(*node))) {
// Spec: Indirect references are an error (14.3.5)
- document().accessSVGExtensions()->reportError("Not allowed to use indirect reference in <clip-path>");
+ document().accessSVGExtensions().reportError("Not allowed to use indirect reference in <clip-path>");
} else {
toSVGGraphicsElement(*node).toClipPath(path);
// FIXME: Avoid manual resolution of x/y here. Its potentially harmful.
// We only need to track first degree <use> dependencies. Indirect references are handled
// as the invalidation bubbles up the dependency chain.
if (!foundUse) {
- document().accessSVGExtensions()->addElementReferencingTarget(this, target);
+ document().accessSVGExtensions().addElementReferencingTarget(this, target);
foundUse = true;
}
} else if (isDisallowedElement(*target)) {
void SVGSMILElement::clearResourceReferences()
{
- document().accessSVGExtensions()->removeAllTargetReferencesForElement(this);
+ document().accessSVGExtensions().removeAllTargetReferencesForElement(this);
}
void SVGSMILElement::clearTarget()
if (!svgTarget) {
// Do not register as pending if we are already pending this resource.
- if (document().accessSVGExtensions()->isPendingResource(this, id))
+ if (document().accessSVGExtensions().isPendingResource(this, id))
return;
if (!id.isEmpty()) {
- document().accessSVGExtensions()->addPendingResource(id, this);
+ document().accessSVGExtensions().addPendingResource(id, this);
ASSERT(hasPendingResources());
}
} else {
// Register us with the target in the dependencies map. Any change of hrefElement
// that leads to relayout/repainting now informs us, so we can react to it.
- document().accessSVGExtensions()->addElementReferencingTarget(this, svgTarget);
+ document().accessSVGExtensions().addElementReferencingTarget(this, svgTarget);
}
}