WebKit Bugzilla
Attachment 356881 Details for
Bug 191237
: Remove SVG properties tear-off objects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
21-Extra
21-Extra.patch (text/plain), 89.89 KB, created by
Said Abou-Hallawa
on 2018-12-08 11:34:14 PST
(
hide
)
Description:
21-Extra
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-12-08 11:34:14 PST
Size:
89.89 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e9397b3bd1d..fe364c128b5 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,144 @@ >+2018-12-08 Said Abou-Hallawa <sabouhallawa@apple.com> >+ >+ Remove SVG properties tear-off objects >+ https://bugs.webkit.org/show_bug.cgi?id=191237 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patches makes WebKit build with the new architecture of the SVG >+ properties. The changes are the following: >+ >+ -- Every property will have two getter: 1) a const getter which returns >+ a const reference to the property's "value". 2) a non- const getter >+ which returns a reference to the Ref<SVGProperty> or to the >+ Ref<SVGAnimatedProperty>. So if we need to access the property value >+ we need to have a const SVGElement. Many changes in this patch changes >+ a function argument to be const for this purpose. >+ >+ -- Some of the tear-off object files were not deleted. >+ >+ -- Synchronizing the SVG properties is now managed by the SVGElement and >+ the dirty flag on every SVGProperty. So the code in Element.cpp should >+ be simplified. >+ >+ -- Some IDL files make the returned property be a NewObject. This is not >+ needed anymore. See SVGTests.idl. >+ >+ * WebCore.xcodeproj/project.pbxproj: >+ * accessibility/AccessibilitySVGElement.cpp: >+ (WebCore::AccessibilitySVGElement::targetForUseElement const): >+ * css/CSSCursorImageValue.cpp: >+ (WebCore::CSSCursorImageValue::cursorElementChanged): >+ (WebCore::CSSCursorImageValue::loadImage): >+ * css/CSSCursorImageValue.h: >+ * cssjit/SelectorCompiler.cpp: >+ (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributesMatching): >+ (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSynchronizeAllAnimatedSVGAttribute): Deleted. >+ * dom/Element.cpp: >+ (WebCore::Element::synchronizeAllAttributes const): >+ (WebCore::Element::synchronizeAttribute const): >+ (WebCore::Element::fastAttributeLookupAllowed const): >+ * rendering/CSSFilter.cpp: >+ (WebCore::CSSFilter::buildReferenceFilter): >+ * rendering/svg/RenderSVGForeignObject.cpp: >+ (WebCore::RenderSVGForeignObject::foreignObjectElement const): >+ * rendering/svg/RenderSVGForeignObject.h: >+ * rendering/svg/RenderSVGGradientStop.h: >+ * rendering/svg/RenderSVGImage.cpp: >+ (WebCore::RenderSVGImage::updateImageViewport): >+ (WebCore::RenderSVGImage::paintForeground): >+ * rendering/svg/RenderSVGRect.cpp: >+ (WebCore::RenderSVGRect::rectElement const): >+ * rendering/svg/RenderSVGRect.h: >+ * rendering/svg/RenderSVGResourceClipper.cpp: >+ (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage): >+ * rendering/svg/RenderSVGResourceClipper.h: >+ (isType): >+ * rendering/svg/RenderSVGResourceFilter.h: >+ * rendering/svg/RenderSVGResourceGradient.cpp: >+ (WebCore::RenderSVGResourceGradient::applyResource): >+ * rendering/svg/RenderSVGResourceMarker.h: >+ * rendering/svg/RenderSVGResourceMasker.h: >+ * rendering/svg/RenderSVGResourcePattern.cpp: >+ (WebCore::RenderSVGResourcePattern::applyResource): >+ * rendering/svg/RenderSVGRoot.cpp: >+ (WebCore::RenderSVGRoot::computeIntrinsicRatioInformation const): >+ * rendering/svg/RenderSVGTextPath.cpp: >+ (WebCore::RenderSVGTextPath::textPathElement const): >+ * rendering/svg/RenderSVGTextPath.h: >+ * rendering/svg/RenderSVGTransformableContainer.cpp: >+ (WebCore::RenderSVGTransformableContainer::calculateLocalTransform): >+ * rendering/svg/RenderSVGViewportContainer.cpp: >+ (WebCore::RenderSVGViewportContainer::calcViewport): >+ * rendering/svg/SVGPathData.cpp: >+ (WebCore::pathFromCircleElement): >+ (WebCore::pathFromEllipseElement): >+ (WebCore::pathFromLineElement): >+ (WebCore::pathFromPathElement): >+ (WebCore::pathFromPolygonElement): >+ (WebCore::pathFromPolylineElement): >+ (WebCore::pathFromRectElement): >+ (WebCore::pathFromGraphicsElement): >+ * rendering/svg/SVGPathData.h: >+ * rendering/svg/SVGRenderTreeAsText.cpp: >+ (WebCore::operator<<): >+ * rendering/svg/SVGResources.cpp: >+ (WebCore::targetReferenceFromResource): >+ * rendering/svg/SVGTextChunk.cpp: >+ (WebCore::SVGTextChunk::SVGTextChunk): >+ * rendering/svg/SVGTextLayoutAttributesBuilder.cpp: >+ (WebCore::updateCharacterData): >+ (WebCore::SVGTextLayoutAttributesBuilder::fillCharacterDataMap): >+ * rendering/svg/SVGTextLayoutAttributesBuilder.h: >+ * rendering/svg/SVGTextLayoutEngine.cpp: >+ (WebCore::SVGTextLayoutEngine::parentDefinesTextLength const): >+ (WebCore::SVGTextLayoutEngine::beginTextPathLayout): >+ * svg/LinearGradientAttributes.h: >+ (WebCore::LinearGradientAttributes::setX1): >+ (WebCore::LinearGradientAttributes::setY1): >+ (WebCore::LinearGradientAttributes::setX2): >+ (WebCore::LinearGradientAttributes::setY2): >+ * svg/SVGAnimatedBoolean.cpp: Removed. >+ * svg/SVGAnimatedBoolean.h: Removed. >+ * svg/SVGAnimatedPath.cpp: Removed. >+ * svg/SVGAnimatedPath.h: Removed. >+ * svg/SVGAnimatedPointList.cpp: Removed. >+ * svg/SVGAnimatedPointList.h: Removed. >+ * svg/SVGAnimatedPreserveAspectRatio.cpp: Removed. >+ * svg/SVGAnimatedPreserveAspectRatio.h: Removed. >+` * svg/SVGImageLoader.cpp: >+ (WebCore::SVGImageLoader::dispatchLoadEvent): >+ * svg/SVGMarkerTypes.h: >+ (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::autoString): >+ (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::autoStartReverseString): >+ (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString): >+ (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::toString): >+ * svg/SVGSVGElement.idl: >+ * svg/SVGSetElement.cpp: >+ (WebCore::SVGSetElement::SVGSetElement): >+ (WebCore::SVGSetElement::updateAnimationMode): >+ * svg/SVGTests.idl: >+ * svg/SVGTransformDistance.cpp: >+ (WebCore::SVGTransformDistance::addToSVGTransform const): >+ * svg/SVGTransformable.cpp: >+ (WebCore::SVGTransformable::parseAndSkipType): >+ (WebCore::parseAndSkipType): Deleted. >+ (WebCore::SVGTransformable::parseTransformAttribute): Deleted. >+ * svg/SVGTransformable.h: >+ * svg/SVGZoomAndPan.h: >+ (WebCore::SVGZoomAndPan::zoomAndPan const): >+ (WebCore::SVGZoomAndPan::setZoomAndPan): >+ (WebCore::SVGZoomAndPan::reset): >+ (WebCore::SVGZoomAndPan::attributeRegistry): Deleted. >+ (WebCore::SVGZoomAndPan::isKnownAttribute): Deleted. >+ * svg/SVGZoomAndPanType.h: >+ * svg/animation/SVGSMILElement.cpp: >+ (WebCore::SVGSMILElement::hasValidAttributeName const): >+ (WebCore::SVGSMILElement::hasValidAttributeName): Deleted. >+ * svg/animation/SVGSMILElement.h: >+ * svg/graphics/SVGImage.cpp: >+ (WebCore::SVGImage::computeIntrinsicDimensions): >+ > 2018-12-07 Said Abou-Hallawa <sabouhallawa@apple.com> > > Remove SVG properties tear-off objects >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 3dc53bee0a6..4e194951fd2 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -2070,6 +2070,9 @@ > 724EE5501DC80D7F00A91FFB /* ActivityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54E1DC7F25B00A91FFB /* ActivityState.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 724EE5511DC80D8400A91FFB /* ActivityStateChangeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54F1DC7F25B00A91FFB /* ActivityStateChangeObserver.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 727AFED41A2EA6AE000442E8 /* EXTsRGB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 727AFED11A2EA6A0000442E8 /* EXTsRGB.cpp */; }; >+ 7294ADA221BBC7F100E16D32 /* SVGPrimitiveList.h in Headers */ = {isa = PBXBuildFile; fileRef = 72227A7321B50901008EC3E4 /* SVGPrimitiveList.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 7294ADA421BBC7FE00E16D32 /* SVGList.h in Headers */ = {isa = PBXBuildFile; fileRef = 72227A7421B50901008EC3E4 /* SVGList.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 7294ADA521BBC84000E16D32 /* SVGPropertyOwner.h in Headers */ = {isa = PBXBuildFile; fileRef = 72227A6C21B4B1F6008EC3E4 /* SVGPropertyOwner.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 72F1ADA21A3904DC00014E18 /* EXTFragDepth.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72F1AD9F1A3904C300014E18 /* EXTFragDepth.cpp */; }; > 7553CFE8108F473F00EA281E /* TimelineRecordFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */; }; > 75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793E810D0CE0B3007FC0AC /* MessageEvent.h */; }; >@@ -27651,6 +27654,7 @@ > 073B87691E4385AC0071C0EC /* AudioSampleDataSource.h in Headers */, > FD8C46EC154608E700A5910C /* AudioScheduledSourceNode.h in Headers */, > CDA7982A170A3D0000D45C55 /* AudioSession.h in Headers */, >+ 7294ADA521BBC84000E16D32 /* SVGPropertyOwner.h in Headers */, > FD31608912B026F700C1A359 /* AudioSourceProvider.h in Headers */, > CD8A7BBC197735FE00CBD643 /* AudioSourceProviderAVFObjC.h in Headers */, > FD62F52E145898D80094B0ED /* AudioSourceProviderClient.h in Headers */, >@@ -27940,6 +27944,7 @@ > 46C696CB1E7205F700597937 /* CPUMonitor.h in Headers */, > D0B0556809C6700100307E43 /* CreateLinkCommand.h in Headers */, > 514C766E0CE923A1007EF3CD /* Credential.h in Headers */, >+ 7294ADA221BBC7F100E16D32 /* SVGPrimitiveList.h in Headers */, > 3792917A1985EF3900F4B661 /* CredentialBase.h in Headers */, > 3792917E1987678F00F4B661 /* CredentialCocoa.h in Headers */, > 77D5100D1ED5E29500DA4C87 /* CredentialCreationOptions.h in Headers */, >@@ -30071,6 +30076,7 @@ > A9C6E5A60D746458006442E9 /* Navigator.h in Headers */, > E12719C70EEEC16800F61213 /* NavigatorBase.h in Headers */, > 8321507E1F27EA1B0095B136 /* NavigatorBeacon.h in Headers */, >+ 7294ADA421BBC7FE00E16D32 /* SVGList.h in Headers */, > 372D3E57216578AE00C5E021 /* NavigatorCredentials.h in Headers */, > 9711460414EF009A00674FD9 /* NavigatorGeolocation.h in Headers */, > 5EA725D61ACABD5700EAD17B /* NavigatorMediaDevices.h in Headers */, >diff --git a/Source/WebCore/accessibility/AccessibilitySVGElement.cpp b/Source/WebCore/accessibility/AccessibilitySVGElement.cpp >index 791bef08757..681b855721e 100644 >--- a/Source/WebCore/accessibility/AccessibilitySVGElement.cpp >+++ b/Source/WebCore/accessibility/AccessibilitySVGElement.cpp >@@ -60,7 +60,7 @@ AccessibilityObject* AccessibilitySVGElement::targetForUseElement() const > if (!is<SVGUseElement>(element())) > return nullptr; > >- SVGUseElement& use = downcast<SVGUseElement>(*element()); >+ const SVGUseElement& use = downcast<SVGUseElement>(*element()); > String href = use.href(); > if (href.isEmpty()) > href = getAttribute(HTMLNames::hrefAttr); >diff --git a/Source/WebCore/css/CSSCursorImageValue.cpp b/Source/WebCore/css/CSSCursorImageValue.cpp >index 33a529e8126..4e6c8c8e9f6 100644 >--- a/Source/WebCore/css/CSSCursorImageValue.cpp >+++ b/Source/WebCore/css/CSSCursorImageValue.cpp >@@ -88,7 +88,7 @@ void CSSCursorImageValue::cursorElementRemoved(SVGCursorElement& cursorElement) > m_cursorElements.remove(&cursorElement); > } > >-void CSSCursorImageValue::cursorElementChanged(SVGCursorElement& cursorElement) >+void CSSCursorImageValue::cursorElementChanged(const SVGCursorElement& cursorElement) > { > // FIXME: This will override hot spot specified in CSS, which is probably incorrect. > SVGLengthContext lengthContext(nullptr); >@@ -105,7 +105,7 @@ std::pair<CachedImage*, float> CSSCursorImageValue::loadImage(CachedResourceLoad > if (is<CSSImageSetValue>(m_imageValue.get())) > return downcast<CSSImageSetValue>(m_imageValue.get()).loadBestFitImage(loader, options); > >- if (auto* cursorElement = updateCursorElement(*loader.document())) { >+ if (const auto* cursorElement = updateCursorElement(*loader.document())) { > if (cursorElement->href() != downcast<CSSImageValue>(m_imageValue.get()).url()) > m_imageValue = CSSImageValue::create(loader.document()->completeURL(cursorElement->href()), m_loadedFromOpaqueSource); > } >diff --git a/Source/WebCore/css/CSSCursorImageValue.h b/Source/WebCore/css/CSSCursorImageValue.h >index 7edad67786c..4456edfc16e 100644 >--- a/Source/WebCore/css/CSSCursorImageValue.h >+++ b/Source/WebCore/css/CSSCursorImageValue.h >@@ -63,7 +63,7 @@ public: > bool equals(const CSSCursorImageValue&) const; > > void cursorElementRemoved(SVGCursorElement&); >- void cursorElementChanged(SVGCursorElement&); >+ void cursorElementChanged(const SVGCursorElement&); > > private: > CSSCursorImageValue(Ref<CSSValue>&& imageValue, bool hasHotSpot, const IntPoint& hotSpot, LoadedFromOpaqueSource); >diff --git a/Source/WebCore/cssjit/SelectorCompiler.cpp b/Source/WebCore/cssjit/SelectorCompiler.cpp >index efbcc0dcd45..b5efd462c27 100644 >--- a/Source/WebCore/cssjit/SelectorCompiler.cpp >+++ b/Source/WebCore/cssjit/SelectorCompiler.cpp >@@ -305,7 +305,6 @@ private: > void generateElementIsOnlyChild(Assembler::JumpList& failureCases); > void generateElementHasPlaceholderShown(Assembler::JumpList& failureCases); > void generateSynchronizeStyleAttribute(Assembler::RegisterID elementDataArraySizeAndFlags); >- void generateSynchronizeAllAnimatedSVGAttribute(Assembler::RegisterID elementDataArraySizeAndFlags); > void generateElementAttributesMatching(Assembler::JumpList& failureCases, const LocalRegister& elementDataAddress, const SelectorFragment&); > void generateElementAttributeMatching(Assembler::JumpList& failureCases, Assembler::RegisterID currentAttributeAddress, Assembler::RegisterID decIndexRegister, const AttributeMatchingInfo& attributeInfo); > void generateElementAttributeValueMatching(Assembler::JumpList& failureCases, Assembler::RegisterID currentAttributeAddress, const AttributeMatchingInfo& attributeInfo); >@@ -2740,21 +2739,6 @@ static inline bool canMatchAnimatableSVGAttribute(const SelectorFragment& fragme > return false; > } > >-void SelectorCodeGenerator::generateSynchronizeAllAnimatedSVGAttribute(Assembler::RegisterID elementDataArraySizeAndFlags) >-{ >- // SVG attributes can be updated lazily depending on the flag AnimatedSVGAttributesAreDirty. We need to check >- // that first. >- Assembler::Jump animatedSVGAttributesNotDirty = m_assembler.branchTest32(Assembler::Zero, elementDataArraySizeAndFlags, Assembler::TrustedImm32(ElementData::animatedSVGAttributesAreDirtyFlag())); >- >- FunctionCall functionCall(m_assembler, m_registerAllocator, m_stackAllocator, m_functionCalls); >- functionCall.setFunctionAddress(SVGElement::synchronizeAllAnimatedSVGAttribute); >- Assembler::RegisterID elementAddress = elementAddressRegister; >- functionCall.setOneArgument(elementAddress); >- functionCall.call(); >- >- animatedSVGAttributesNotDirty.link(&m_assembler); >-} >- > void SelectorCodeGenerator::generateElementAttributesMatching(Assembler::JumpList& failureCases, const LocalRegister& elementDataAddress, const SelectorFragment& fragment) > { > LocalRegister scratchRegister(m_registerAllocator); >@@ -2766,9 +2750,6 @@ void SelectorCodeGenerator::generateElementAttributesMatching(Assembler::JumpLis > if (canMatchStyleAttribute(fragment)) > generateSynchronizeStyleAttribute(elementDataArraySizeAndFlags); > >- if (canMatchAnimatableSVGAttribute(fragment)) >- generateSynchronizeAllAnimatedSVGAttribute(elementDataArraySizeAndFlags); >- > // Attributes can be stored either in a separate vector for UniqueElementData, or after the elementData itself > // for ShareableElementData. > LocalRegister attributeArrayPointer(m_registerAllocator); >diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp >index 5a15a69d6cd..52bd4ce5d21 100644 >--- a/Source/WebCore/dom/Element.cpp >+++ b/Source/WebCore/dom/Element.cpp >@@ -448,10 +448,8 @@ void Element::synchronizeAllAttributes() const > static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal(); > } > >- if (elementData()->animatedSVGAttributesAreDirty()) { >- ASSERT(isSVGElement()); >- downcast<SVGElement>(*this).synchronizeAnimatedSVGAttribute(anyQName()); >- } >+ if (isSVGElement()) >+ downcast<SVGElement>(const_cast<Element&>(*this)).synchronizeAllAttributes(); > } > > ALWAYS_INLINE void Element::synchronizeAttribute(const QualifiedName& name) const >@@ -464,10 +462,8 @@ ALWAYS_INLINE void Element::synchronizeAttribute(const QualifiedName& name) cons > return; > } > >- if (UNLIKELY(elementData()->animatedSVGAttributesAreDirty())) { >- ASSERT(isSVGElement()); >- downcast<SVGElement>(*this).synchronizeAnimatedSVGAttribute(name); >- } >+ if (isSVGElement()) >+ downcast<SVGElement>(const_cast<Element&>(*this)).synchronizeAttribute(name); > } > > static ALWAYS_INLINE bool isStyleAttribute(const Element& element, const AtomicString& attributeLocalName) >@@ -488,11 +484,8 @@ ALWAYS_INLINE void Element::synchronizeAttribute(const AtomicString& localName) > static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal(); > return; > } >- if (elementData()->animatedSVGAttributesAreDirty()) { >- // We're not passing a namespace argument on purpose. SVGNames::*Attr are defined w/o namespaces as well. >- ASSERT_WITH_SECURITY_IMPLICATION(isSVGElement()); >- downcast<SVGElement>(*this).synchronizeAnimatedSVGAttribute(QualifiedName(nullAtom(), localName, nullAtom())); >- } >+ if (isSVGElement()) >+ downcast<SVGElement>(const_cast<Element&>(*this)).synchronizeAttribute(QualifiedName(nullAtom(), localName, nullAtom())); > } > > const AtomicString& Element::getAttribute(const QualifiedName& name) const >@@ -3450,7 +3443,7 @@ bool Element::fastAttributeLookupAllowed(const QualifiedName& name) const > return false; > > if (isSVGElement()) >- return !downcast<SVGElement>(*this).isAnimatableAttribute(name); >+ return !downcast<SVGElement>(*this).isAnimatedPropertyAttribute(name); > > return true; > } >diff --git a/Source/WebCore/rendering/CSSFilter.cpp b/Source/WebCore/rendering/CSSFilter.cpp >index 84971b64a68..3793a897abc 100644 >--- a/Source/WebCore/rendering/CSSFilter.cpp >+++ b/Source/WebCore/rendering/CSSFilter.cpp >@@ -114,7 +114,7 @@ RefPtr<FilterEffect> CSSFilter::buildReferenceFilter(RenderElement& renderer, Fi > auto builder = std::make_unique<SVGFilterBuilder>(&previousEffect); > m_sourceAlpha = builder->getEffectById(SourceAlpha::effectName()); > >- for (auto& effectElement : childrenOfType<SVGFilterPrimitiveStandardAttributes>(*filter)) { >+ for (const auto& effectElement : childrenOfType<SVGFilterPrimitiveStandardAttributes>(*filter)) { > effect = effectElement.build(builder.get(), *this); > if (!effect) > continue; >diff --git a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp b/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp >index 22fa7d01090..275435c2e5a 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp >@@ -46,7 +46,7 @@ RenderSVGForeignObject::RenderSVGForeignObject(SVGForeignObjectElement& element, > > RenderSVGForeignObject::~RenderSVGForeignObject() = default; > >-SVGForeignObjectElement& RenderSVGForeignObject::foreignObjectElement() const >+const SVGForeignObjectElement& RenderSVGForeignObject::foreignObjectElement() const > { > return downcast<SVGForeignObjectElement>(RenderSVGBlock::graphicsElement()); > } >diff --git a/Source/WebCore/rendering/svg/RenderSVGForeignObject.h b/Source/WebCore/rendering/svg/RenderSVGForeignObject.h >index 35def3075bc..1786298c83c 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGForeignObject.h >+++ b/Source/WebCore/rendering/svg/RenderSVGForeignObject.h >@@ -35,7 +35,7 @@ public: > RenderSVGForeignObject(SVGForeignObjectElement&, RenderStyle&&); > virtual ~RenderSVGForeignObject(); > >- SVGForeignObjectElement& foreignObjectElement() const; >+ const SVGForeignObjectElement& foreignObjectElement() const; > > void paint(PaintInfo&, const LayoutPoint&) override; > >diff --git a/Source/WebCore/rendering/svg/RenderSVGGradientStop.h b/Source/WebCore/rendering/svg/RenderSVGGradientStop.h >index 3550ed15fb3..84b2bc8fa49 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGGradientStop.h >+++ b/Source/WebCore/rendering/svg/RenderSVGGradientStop.h >@@ -35,7 +35,7 @@ public: > RenderSVGGradientStop(SVGStopElement&, RenderStyle&&); > virtual ~RenderSVGGradientStop(); > >- SVGStopElement& element() const { return downcast<SVGStopElement>(RenderObject::nodeForNonAnonymous()); } >+ const SVGStopElement& element() const { return downcast<SVGStopElement>(RenderObject::nodeForNonAnonymous()); } > > private: > void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override; >diff --git a/Source/WebCore/rendering/svg/RenderSVGImage.cpp b/Source/WebCore/rendering/svg/RenderSVGImage.cpp >index 0a58f8fd1ad..cb65a48f35c 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGImage.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGImage.cpp >@@ -73,15 +73,16 @@ bool RenderSVGImage::updateImageViewport() > FloatRect oldBoundaries = m_objectBoundingBox; > bool updatedViewport = false; > >- SVGLengthContext lengthContext(&imageElement()); >- m_objectBoundingBox = FloatRect(imageElement().x().value(lengthContext), imageElement().y().value(lengthContext), imageElement().width().value(lengthContext), imageElement().height().value(lengthContext)); >- >- URL imageSourceURL = document().completeURL(imageElement().imageSourceURL()); >+ const auto& imageElement = this->imageElement(); >+ SVGLengthContext lengthContext(&imageElement); >+ m_objectBoundingBox = FloatRect(imageElement.x().value(lengthContext), imageElement.y().value(lengthContext), imageElement.width().value(lengthContext), imageElement.height().value(lengthContext)); >+ >+ URL imageSourceURL = document().completeURL(imageElement.imageSourceURL()); > > // Images with preserveAspectRatio=none should force non-uniform scaling. This can be achieved > // by setting the image's container size to its intrinsic size. > // See: http://www.w3.org/TR/SVG/single-page.html, 7.8 The âpreserveAspectRatioâ attribute. >- if (imageElement().preserveAspectRatio().align() == SVGPreserveAspectRatioValue::SVG_PRESERVEASPECTRATIO_NONE) { >+ if (imageElement.preserveAspectRatio().align() == SVGPreserveAspectRatioValue::SVG_PRESERVEASPECTRATIO_NONE) { > if (CachedImage* cachedImage = imageResource().cachedImage()) { > LayoutSize intrinsicSize = cachedImage->imageSizeForRenderer(nullptr, style().effectiveZoom()); > if (intrinsicSize != imageResource().imageSize(style().effectiveZoom())) { >@@ -174,7 +175,8 @@ void RenderSVGImage::paintForeground(PaintInfo& paintInfo) > FloatRect destRect = m_objectBoundingBox; > FloatRect srcRect(0, 0, image->width(), image->height()); > >- imageElement().preserveAspectRatio().transformRect(destRect, srcRect); >+ const auto& imageElement = this->imageElement(); >+ imageElement.preserveAspectRatio().transformRect(destRect, srcRect); > > paintInfo.context().drawImage(*image, destRect, srcRect); > } >diff --git a/Source/WebCore/rendering/svg/RenderSVGRect.cpp b/Source/WebCore/rendering/svg/RenderSVGRect.cpp >index b8642d21929..1d1cc4b72b2 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGRect.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGRect.cpp >@@ -42,7 +42,7 @@ RenderSVGRect::RenderSVGRect(SVGRectElement& element, RenderStyle&& style) > > RenderSVGRect::~RenderSVGRect() = default; > >-SVGRectElement& RenderSVGRect::rectElement() const >+const SVGRectElement& RenderSVGRect::rectElement() const > { > return downcast<SVGRectElement>(RenderSVGShape::graphicsElement()); > } >diff --git a/Source/WebCore/rendering/svg/RenderSVGRect.h b/Source/WebCore/rendering/svg/RenderSVGRect.h >index 4ff5218a153..d608caed85f 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGRect.h >+++ b/Source/WebCore/rendering/svg/RenderSVGRect.h >@@ -38,7 +38,7 @@ public: > RenderSVGRect(SVGRectElement&, RenderStyle&&); > virtual ~RenderSVGRect(); > >- SVGRectElement& rectElement() const; >+ const SVGRectElement& rectElement() const; > > private: > void graphicsElement() const = delete; >diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp >index 7398ef32b38..db11fc6bc3e 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp >@@ -197,7 +197,7 @@ bool RenderSVGResourceClipper::drawContentIntoMaskImage(const ClipperMaskImage& > view().frameView().setPaintBehavior(oldBehavior | PaintBehavior::RenderingSVGMask); > > // Draw all clipPath children into a global mask. >- for (auto& child : childrenOfType<SVGElement>(clipPathElement())) { >+ for (const auto& child : childrenOfType<SVGElement>(clipPathElement())) { > auto renderer = child.renderer(); > if (!renderer) > continue; >@@ -212,7 +212,7 @@ bool RenderSVGResourceClipper::drawContentIntoMaskImage(const ClipperMaskImage& > WindRule newClipRule = style.svgStyle().clipRule(); > bool isUseElement = child.hasTagName(SVGNames::useTag); > if (isUseElement) { >- SVGUseElement& useElement = downcast<SVGUseElement>(child); >+ const SVGUseElement& useElement = downcast<SVGUseElement>(child); > renderer = useElement.rendererClipChild(); > if (!renderer) > continue; >diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h b/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h >index 556cc1da40c..2fbb11c6aaf 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h >+++ b/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h >@@ -38,7 +38,7 @@ public: > RenderSVGResourceClipper(SVGClipPathElement&, RenderStyle&&); > virtual ~RenderSVGResourceClipper(); > >- SVGClipPathElement& clipPathElement() const { return downcast<SVGClipPathElement>(nodeForNonAnonymous()); } >+ const SVGClipPathElement& clipPathElement() const { return downcast<SVGClipPathElement>(nodeForNonAnonymous()); } > > void removeAllClientsFromCache(bool markForInvalidation = true) override; > void removeClientFromCache(RenderElement&, bool markForInvalidation = true) override; >@@ -77,6 +77,6 @@ private: > } > > SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::RenderSVGResourceClipper) >-static bool isType(const WebCore::RenderObject& renderer) { return renderer.isSVGResourceClipper(); } >-static bool isType(const WebCore::RenderSVGResource& resource) { return resource.resourceType() == WebCore::ClipperResourceType; } >+ static bool isType(const WebCore::RenderObject& renderer) { return renderer.isSVGResourceClipper(); } >+ static bool isType(const WebCore::RenderSVGResource& resource) { return resource.resourceType() == WebCore::ClipperResourceType; } > SPECIALIZE_TYPE_TRAITS_END() >diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceFilter.h b/Source/WebCore/rendering/svg/RenderSVGResourceFilter.h >index 319c5eec196..69eb3c69bed 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGResourceFilter.h >+++ b/Source/WebCore/rendering/svg/RenderSVGResourceFilter.h >@@ -60,7 +60,7 @@ public: > RenderSVGResourceFilter(SVGFilterElement&, RenderStyle&&); > virtual ~RenderSVGResourceFilter(); > >- SVGFilterElement& filterElement() const { return downcast<SVGFilterElement>(RenderSVGResourceContainer::element()); } >+ const SVGFilterElement& filterElement() const { return downcast<SVGFilterElement>(RenderSVGResourceContainer::element()); } > > void removeAllClientsFromCache(bool markForInvalidation = true) override; > void removeClientFromCache(RenderElement&, bool markForInvalidation = true) override; >diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp >index eb35ac541e0..d8ad080466c 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp >@@ -104,7 +104,7 @@ bool RenderSVGResourceGradient::applyResource(RenderElement& renderer, const Ren > // synchronization to kick in, which causes removeAllClientsFromCache() to be called, which in turn deletes our > // GradientData object! Leaving out the line below will cause svg/dynamic-updates/SVG*GradientElement-svgdom* to crash. > if (m_shouldCollectGradientAttributes) { >- gradientElement().synchronizeAnimatedSVGAttribute(anyQName()); >+ gradientElement().synchronizeAllAttributes(); > if (!collectGradientAttributes()) > return false; > >diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceMarker.h b/Source/WebCore/rendering/svg/RenderSVGResourceMarker.h >index e3d9f83092b..dc69ace479b 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGResourceMarker.h >+++ b/Source/WebCore/rendering/svg/RenderSVGResourceMarker.h >@@ -33,7 +33,7 @@ public: > RenderSVGResourceMarker(SVGMarkerElement&, RenderStyle&&); > virtual ~RenderSVGResourceMarker(); > >- SVGMarkerElement& markerElement() const { return downcast<SVGMarkerElement>(RenderSVGResourceContainer::element()); } >+ const SVGMarkerElement& markerElement() const { return downcast<SVGMarkerElement>(RenderSVGResourceContainer::element()); } > > void removeAllClientsFromCache(bool markForInvalidation = true) override; > void removeClientFromCache(RenderElement&, bool markForInvalidation = true) override; >diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceMasker.h b/Source/WebCore/rendering/svg/RenderSVGResourceMasker.h >index 29e8e7c2475..cc5b27936ac 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGResourceMasker.h >+++ b/Source/WebCore/rendering/svg/RenderSVGResourceMasker.h >@@ -40,7 +40,7 @@ public: > RenderSVGResourceMasker(SVGMaskElement&, RenderStyle&&); > virtual ~RenderSVGResourceMasker(); > >- SVGMaskElement& maskElement() const { return downcast<SVGMaskElement>(RenderSVGResourceContainer::element()); } >+ const SVGMaskElement& maskElement() const { return downcast<SVGMaskElement>(RenderSVGResourceContainer::element()); } > > void removeAllClientsFromCache(bool markForInvalidation = true) override; > void removeClientFromCache(RenderElement&, bool markForInvalidation = true) override; >diff --git a/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp b/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp >index ba6ea47e9b2..cc2cbfcf0fe 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp >@@ -149,7 +149,7 @@ bool RenderSVGResourcePattern::applyResource(RenderElement& renderer, const Rend > ASSERT(!resourceMode.isEmpty()); > > if (m_shouldCollectPatternAttributes) { >- patternElement().synchronizeAnimatedSVGAttribute(anyQName()); >+ patternElement().synchronizeAllAttributes(); > > m_attributes = PatternAttributes(); > collectPatternAttributes(m_attributes); >diff --git a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp >index b86f5e580a2..9b0f8eb3623 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp >@@ -90,7 +90,8 @@ void RenderSVGRoot::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, d > // aspect ratio is calculated from the width and height values of the âviewBoxâ specified for the current SVG document > // fragment. If the âviewBoxâ is not correctly specified, or set to 'none', the intrinsic aspect ratio cannot be > // calculated and is considered unspecified. >- FloatSize viewBoxSize = svgSVGElement().viewBox().size(); >+ const auto& svgSVGElement = this->svgSVGElement(); >+ FloatSize viewBoxSize = svgSVGElement.viewBox().size(); > if (!viewBoxSize.isEmpty()) { > // The viewBox can only yield an intrinsic ratio, not an intrinsic size. > intrinsicRatio = viewBoxSize.width() / static_cast<double>(viewBoxSize.height()); >diff --git a/Source/WebCore/rendering/svg/RenderSVGTextPath.cpp b/Source/WebCore/rendering/svg/RenderSVGTextPath.cpp >index 1961e17b9d5..d71156fb30a 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGTextPath.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGTextPath.cpp >@@ -39,7 +39,7 @@ RenderSVGTextPath::RenderSVGTextPath(SVGTextPathElement& element, RenderStyle&& > { > } > >-SVGTextPathElement& RenderSVGTextPath::textPathElement() const >+const SVGTextPathElement& RenderSVGTextPath::textPathElement() const > { > return downcast<SVGTextPathElement>(RenderSVGInline::graphicsElement()); > } >diff --git a/Source/WebCore/rendering/svg/RenderSVGTextPath.h b/Source/WebCore/rendering/svg/RenderSVGTextPath.h >index 5bc4b594622..3aba8ef676f 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGTextPath.h >+++ b/Source/WebCore/rendering/svg/RenderSVGTextPath.h >@@ -29,7 +29,7 @@ class RenderSVGTextPath final : public RenderSVGInline { > public: > RenderSVGTextPath(SVGTextPathElement&, RenderStyle&&); > >- SVGTextPathElement& textPathElement() const; >+ const SVGTextPathElement& textPathElement() const; > > Path layoutPath() const; > float startOffset() const; >diff --git a/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp b/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp >index 66353ec4318..250fb2529ca 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGTransformableContainer.cpp >@@ -44,7 +44,7 @@ bool RenderSVGTransformableContainer::calculateLocalTransform() > // If we're either the renderer for a <use> element, or for any <g> element inside the shadow > // 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; >+ const SVGUseElement* useElement = nullptr; > if (is<SVGUseElement>(element)) > useElement = &downcast<SVGUseElement>(element); > else if (element.isInShadowTree() && is<SVGGElement>(element)) { >diff --git a/Source/WebCore/rendering/svg/RenderSVGViewportContainer.cpp b/Source/WebCore/rendering/svg/RenderSVGViewportContainer.cpp >index b5bd36eff70..1e9ecf0020e 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGViewportContainer.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGViewportContainer.cpp >@@ -58,7 +58,7 @@ void RenderSVGViewportContainer::applyViewportClip(PaintInfo& paintInfo) > > void RenderSVGViewportContainer::calcViewport() > { >- SVGSVGElement& element = svgSVGElement(); >+ const SVGSVGElement& element = svgSVGElement(); > SVGLengthContext lengthContext(&element); > FloatRect newViewport(element.x().value(lengthContext), element.y().value(lengthContext), element.width().value(lengthContext), element.height().value(lengthContext)); > >diff --git a/Source/WebCore/rendering/svg/SVGPathData.cpp b/Source/WebCore/rendering/svg/SVGPathData.cpp >index 5ba9281e2e0..1ec2211654a 100644 >--- a/Source/WebCore/rendering/svg/SVGPathData.cpp >+++ b/Source/WebCore/rendering/svg/SVGPathData.cpp >@@ -39,11 +39,11 @@ > > namespace WebCore { > >-static Path pathFromCircleElement(SVGElement& element) >+static Path pathFromCircleElement(const SVGElement& element) > { > ASSERT(is<SVGCircleElement>(element)); > >- RenderElement* renderer = element.renderer(); >+ const auto* renderer = element.renderer(); > if (!renderer) > return { }; > >@@ -59,9 +59,9 @@ static Path pathFromCircleElement(SVGElement& element) > return path; > } > >-static Path pathFromEllipseElement(SVGElement& element) >+static Path pathFromEllipseElement(const SVGElement& element) > { >- RenderElement* renderer = element.renderer(); >+ const auto* renderer = element.renderer(); > if (!renderer) > return { }; > >@@ -82,7 +82,7 @@ static Path pathFromEllipseElement(SVGElement& element) > return path; > } > >-static Path pathFromLineElement(SVGElement& element) >+static Path pathFromLineElement(const SVGElement& element) > { > Path path; > const auto& line = downcast<SVGLineElement>(element); >@@ -93,46 +93,46 @@ static Path pathFromLineElement(SVGElement& element) > return path; > } > >-static Path pathFromPathElement(SVGElement& element) >+static Path pathFromPathElement(const SVGElement& element) > { >- return downcast<SVGPathElement>(element).pathForByteStream(); >+ return downcast<SVGPathElement>(element).path(); > } > >-static Path pathFromPolygonElement(SVGElement& element) >+static Path pathFromPolygonElement(const SVGElement& element) > { >- auto& points = downcast<SVGPolygonElement>(element).animatedPoints()->values(); >+ const auto& points = downcast<SVGPolygonElement>(element).points().items(); > if (points.isEmpty()) > return { }; > > Path path; >- path.moveTo(points.first()); >+ path.moveTo(points.first()->value()); > > unsigned size = points.size(); > for (unsigned i = 1; i < size; ++i) >- path.addLineTo(points.at(i)); >+ path.addLineTo(points.at(i)->value()); > > path.closeSubpath(); > return path; > } > >-static Path pathFromPolylineElement(SVGElement& element) >+static Path pathFromPolylineElement(const SVGElement& element) > { >- auto& points = downcast<SVGPolylineElement>(element).animatedPoints()->values(); >+ const auto& points = downcast<SVGPolylineElement>(element).points().items(); > if (points.isEmpty()) > return { }; > > Path path; >- path.moveTo(points.first()); >+ path.moveTo(points.first()->value()); > > unsigned size = points.size(); > for (unsigned i = 1; i < size; ++i) >- path.addLineTo(points.at(i)); >+ path.addLineTo(points.at(i)->value()); > return path; > } > >-static Path pathFromRectElement(SVGElement& element) >+static Path pathFromRectElement(const SVGElement& element) > { >- RenderElement* renderer = element.renderer(); >+ const auto* renderer = element.renderer(); > if (!renderer) > return { }; > >@@ -169,11 +169,11 @@ static Path pathFromRectElement(SVGElement& element) > return path; > } > >-Path pathFromGraphicsElement(SVGElement* element) >+Path pathFromGraphicsElement(const SVGElement* element) > { > ASSERT(element); > >- typedef Path (*PathFromFunction)(SVGElement&); >+ typedef Path (*PathFromFunction)(const SVGElement&); > static HashMap<AtomicStringImpl*, PathFromFunction>* map = 0; > if (!map) { > map = new HashMap<AtomicStringImpl*, PathFromFunction>; >diff --git a/Source/WebCore/rendering/svg/SVGPathData.h b/Source/WebCore/rendering/svg/SVGPathData.h >index 62dd819833c..46ff815cb84 100644 >--- a/Source/WebCore/rendering/svg/SVGPathData.h >+++ b/Source/WebCore/rendering/svg/SVGPathData.h >@@ -24,6 +24,6 @@ namespace WebCore { > class SVGElement; > class Path; > >-Path pathFromGraphicsElement(SVGElement*); >+Path pathFromGraphicsElement(const SVGElement*); > > } // namespace WebCore >diff --git a/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp b/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp >index fabc8b2ab8b..98d1de8f2f1 100644 >--- a/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp >+++ b/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp >@@ -271,7 +271,7 @@ static TextStream& operator<<(TextStream& ts, const RenderSVGShape& shape) > writeNameValuePair(ts, "r", element.r().value(lengthContext)); > } else if (is<SVGPolyElement>(svgElement)) { > const SVGPolyElement& element = downcast<SVGPolyElement>(svgElement); >- writeNameAndQuotedValue(ts, "points", element.pointList().valueAsString()); >+ writeNameAndQuotedValue(ts, "points", element.points().valueAsString()); > } else if (is<SVGPathElement>(svgElement)) { > const SVGPathElement& element = downcast<SVGPathElement>(svgElement); > String pathString; >diff --git a/Source/WebCore/rendering/svg/SVGResources.cpp b/Source/WebCore/rendering/svg/SVGResources.cpp >index a2cc4bad9bf..c30566e9d01 100644 >--- a/Source/WebCore/rendering/svg/SVGResources.cpp >+++ b/Source/WebCore/rendering/svg/SVGResources.cpp >@@ -139,7 +139,7 @@ static HashSet<AtomicString>& chainableResourceTags() > return s_tagList; > } > >-static inline String targetReferenceFromResource(SVGElement& element) >+static inline String targetReferenceFromResource(const SVGElement& element) > { > String target; > if (is<SVGPatternElement>(element)) >diff --git a/Source/WebCore/rendering/svg/SVGTextChunk.cpp b/Source/WebCore/rendering/svg/SVGTextChunk.cpp >index b60b2ce08e4..651080c575a 100644 >--- a/Source/WebCore/rendering/svg/SVGTextChunk.cpp >+++ b/Source/WebCore/rendering/svg/SVGTextChunk.cpp >@@ -53,7 +53,7 @@ SVGTextChunk::SVGTextChunk(const Vector<SVGInlineTextBox*>& lineLayoutBoxes, uns > break; > } > >- if (auto* textContentElement = SVGTextContentElement::elementFromRenderer(box->renderer().parent())) { >+ if (const auto* textContentElement = SVGTextContentElement::elementFromRenderer(box->renderer().parent())) { > SVGLengthContext lengthContext(textContentElement); > m_desiredTextLength = textContentElement->specifiedTextLength().value(lengthContext); > >diff --git a/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp b/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp >index 6ffefd1f007..7efe590cda8 100644 >--- a/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp >+++ b/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.cpp >@@ -160,18 +160,18 @@ void SVGTextLayoutAttributesBuilder::buildCharacterDataMap(RenderSVGText& textRo > fillCharacterDataMap(m_textPositions[i]); > } > >-static inline void updateCharacterData(unsigned i, float& lastRotation, SVGCharacterData& data, const SVGLengthContext& lengthContext, const SVGLengthListValues* xList, const SVGLengthListValues* yList, const SVGLengthListValues* dxList, const SVGLengthListValues* dyList, const SVGNumberListValues* rotateList) >+static inline void updateCharacterData(unsigned i, float& lastRotation, SVGCharacterData& data, const SVGLengthContext& lengthContext, const SVGLengthList* xList, const SVGLengthList* yList, const SVGLengthList* dxList, const SVGLengthList* dyList, const SVGNumberList* rotateList) > { > if (xList) >- data.x = xList->at(i).value(lengthContext); >+ data.x = xList->items()[i]->value().value(lengthContext); > if (yList) >- data.y = yList->at(i).value(lengthContext); >+ data.y = yList->items()[i]->value().value(lengthContext); > if (dxList) >- data.dx = dxList->at(i).value(lengthContext); >+ data.dx = dxList->items()[i]->value().value(lengthContext); > if (dyList) >- data.dy = dyList->at(i).value(lengthContext); >+ data.dy = dyList->items()[i]->value().value(lengthContext); > if (rotateList) { >- data.rotate = rotateList->at(i); >+ data.rotate = rotateList->items()[i]->value(); > lastRotation = data.rotate; > } > } >@@ -184,22 +184,22 @@ void SVGTextLayoutAttributesBuilder::fillCharacterDataMap(const TextPosition& po > const auto& dyList = position.element->dy(); > const auto& rotateList = position.element->rotate(); > >- unsigned xListSize = xList.size(); >- unsigned yListSize = yList.size(); >- unsigned dxListSize = dxList.size(); >- unsigned dyListSize = dyList.size(); >- unsigned rotateListSize = rotateList.size(); >+ unsigned xListSize = xList.items().size(); >+ unsigned yListSize = yList.items().size(); >+ unsigned dxListSize = dxList.items().size(); >+ unsigned dyListSize = dyList.items().size(); >+ unsigned rotateListSize = rotateList.items().size(); > if (!xListSize && !yListSize && !dxListSize && !dyListSize && !rotateListSize) > return; > > float lastRotation = SVGTextLayoutAttributes::emptyValue(); > SVGLengthContext lengthContext(position.element); > for (unsigned i = 0; i < position.length; ++i) { >- const SVGLengthListValues* xListPtr = i < xListSize ? &xList : 0; >- const SVGLengthListValues* yListPtr = i < yListSize ? &yList : 0; >- const SVGLengthListValues* dxListPtr = i < dxListSize ? &dxList : 0; >- const SVGLengthListValues* dyListPtr = i < dyListSize ? &dyList : 0; >- const SVGNumberListValues* rotateListPtr = i < rotateListSize ? &rotateList : 0; >+ const SVGLengthList* xListPtr = i < xListSize ? &xList : nullptr; >+ const SVGLengthList* yListPtr = i < yListSize ? &yList : nullptr; >+ const SVGLengthList* dxListPtr = i < dxListSize ? &dxList : nullptr; >+ const SVGLengthList* dyListPtr = i < dyListSize ? &dyList : nullptr; >+ const SVGNumberList* rotateListPtr = i < rotateListSize ? &rotateList : nullptr; > if (!xListPtr && !yListPtr && !dxListPtr && !dyListPtr && !rotateListPtr) > break; > >@@ -218,7 +218,7 @@ void SVGTextLayoutAttributesBuilder::fillCharacterDataMap(const TextPosition& po > if (lastRotation == SVGTextLayoutAttributes::emptyValue()) > return; > >- for (unsigned i = rotateList.size(); i < position.length; ++i) { >+ for (unsigned i = rotateList.items().size(); i < position.length; ++i) { > SVGCharacterDataMap::iterator it = m_characterDataMap.find(position.start + i + 1); > if (it == m_characterDataMap.end()) { > SVGCharacterData data; >diff --git a/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h b/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h >index 99c5f422da6..0f8567e0059 100644 >--- a/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h >+++ b/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h >@@ -59,7 +59,7 @@ private: > { > } > >- SVGTextPositioningElement* element; >+ const SVGTextPositioningElement* element; > unsigned start; > unsigned length; > }; >diff --git a/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp b/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp >index 2333701d243..235f36fb71a 100644 >--- a/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp >+++ b/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp >@@ -146,7 +146,7 @@ bool SVGTextLayoutEngine::parentDefinesTextLength(RenderObject* parent) const > { > RenderObject* currentParent = parent; > while (currentParent) { >- if (SVGTextContentElement* textContentElement = SVGTextContentElement::elementFromRenderer(currentParent)) { >+ if (const SVGTextContentElement* textContentElement = SVGTextContentElement::elementFromRenderer(currentParent)) { > SVGLengthContext lengthContext(textContentElement); > if (textContentElement->lengthAdjust() == SVGLengthAdjustSpacing && textContentElement->specifiedTextLength().value(lengthContext) > 0) > return true; >@@ -182,7 +182,7 @@ void SVGTextLayoutEngine::beginTextPathLayout(RenderSVGTextPath& textPath, SVGTe > m_textPathCurrentOffset = m_textPathStartOffset; > > // Eventually handle textLength adjustments. >- auto* textContentElement = SVGTextContentElement::elementFromRenderer(&textPath); >+ const auto* textContentElement = SVGTextContentElement::elementFromRenderer(&textPath); > if (!textContentElement) > return; > >diff --git a/Source/WebCore/svg/LinearGradientAttributes.h b/Source/WebCore/svg/LinearGradientAttributes.h >index f52019fffe9..a68113f50ee 100644 >--- a/Source/WebCore/svg/LinearGradientAttributes.h >+++ b/Source/WebCore/svg/LinearGradientAttributes.h >@@ -40,10 +40,10 @@ struct LinearGradientAttributes : GradientAttributes { > SVGLengthValue x2() const { return m_x2; } > SVGLengthValue y2() const { return m_y2; } > >- void setX1(SVGLengthValue value) { m_x1 = value; m_x1Set = true; } >- void setY1(SVGLengthValue value) { m_y1 = value; m_y1Set = true; } >- void setX2(SVGLengthValue value) { m_x2 = value; m_x2Set = true; } >- void setY2(SVGLengthValue value) { m_y2 = value; m_y2Set = true; } >+ void setX1(const SVGLengthValue& value) { m_x1 = value; m_x1Set = true; } >+ void setY1(const SVGLengthValue& value) { m_y1 = value; m_y1Set = true; } >+ void setX2(const SVGLengthValue& value) { m_x2 = value; m_x2Set = true; } >+ void setY2(const SVGLengthValue& value) { m_y2 = value; m_y2Set = true; } > > bool hasX1() const { return m_x1Set; } > bool hasY1() const { return m_y1Set; } >diff --git a/Source/WebCore/svg/SVGAnimatedBoolean.cpp b/Source/WebCore/svg/SVGAnimatedBoolean.cpp >deleted file mode 100644 >index cbf02aedf15..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedBoolean.cpp >+++ /dev/null >@@ -1,86 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2011. All rights reserved. >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#include "config.h" >-#include "SVGAnimatedBoolean.h" >- >-#include "SVGAnimateElementBase.h" >- >-namespace WebCore { >- >-SVGAnimatedBooleanAnimator::SVGAnimatedBooleanAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedBoolean, animationElement, contextElement) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedBooleanAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGPropertyTraits<bool>::fromString(string)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedBooleanAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- return constructFromBaseValue<SVGAnimatedBoolean>(animatedTypes); >-} >- >-void SVGAnimatedBooleanAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForType<SVGAnimatedBoolean>(animatedTypes); >-} >- >-void SVGAnimatedBooleanAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- resetFromBaseValue<SVGAnimatedBoolean>(animatedTypes, type); >-} >- >-void SVGAnimatedBooleanAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForType<SVGAnimatedBoolean>(animatedTypes); >-} >- >-void SVGAnimatedBooleanAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForType<SVGAnimatedBoolean>(animatedTypes); >-} >- >-void SVGAnimatedBooleanAnimator::addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*) >-{ >- ASSERT_NOT_REACHED(); >-} >- >-void SVGAnimatedBooleanAnimator::calculateAnimatedValue(float percentage, unsigned, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType*, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- ASSERT(m_contextElement); >- >- const auto fromBoolean = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<bool>(); >- const auto toBoolean = to->as<bool>(); >- auto& animatedBoolean = animated->as<bool>(); >- >- m_animationElement->animateDiscreteType<bool>(percentage, fromBoolean, toBoolean, animatedBoolean); >-} >- >-float SVGAnimatedBooleanAnimator::calculateDistance(const String&, const String&) >-{ >- // No paced animations for boolean. >- return -1; >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedBoolean.h b/Source/WebCore/svg/SVGAnimatedBoolean.h >deleted file mode 100644 >index 875909f076b..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedBoolean.h >+++ /dev/null >@@ -1,53 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010. All rights reserved. >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#pragma once >- >-#include "SVGAnimatedStaticPropertyTearOff.h" >-#include "SVGAnimatedTypeAnimator.h" >-#include "SVGAttributeAccessor.h" >- >-namespace WebCore { >- >-class SVGAnimationElement; >- >-using SVGAnimatedBoolean = SVGAnimatedStaticPropertyTearOff<bool>; >-using SVGAnimatedBooleanAttribute = SVGAnimatedAttribute<SVGAnimatedBoolean>; >- >-template<typename OwnerType> >-using SVGAnimatedBooleanAttributeAccessor = SVGAnimatedAttributeAccessor<OwnerType, SVGAnimatedBooleanAttribute, AnimatedBoolean>; >- >-class SVGAnimatedBooleanAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedBooleanAnimator(SVGAnimationElement*, SVGElement*); >- >- std::unique_ptr<SVGAnimatedType> constructFromString(const String&) override; >- std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) override; >- void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) override; >- void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType&) override; >- void animValWillChange(const SVGElementAnimatedPropertyList&) override; >- void animValDidChange(const SVGElementAnimatedPropertyList&) override; >- >- void addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*) override; >- void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*) override; >- float calculateDistance(const String& fromString, const String& toString) override; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAnimatedPath.cpp b/Source/WebCore/svg/SVGAnimatedPath.cpp >deleted file mode 100644 >index 14520303ef1..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedPath.cpp >+++ /dev/null >@@ -1,148 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2011, 2012. All rights reserved. >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#include "config.h" >-#include "SVGAnimatedPath.h" >- >-#include "SVGAnimateElementBase.h" >-#include "SVGAnimatedPathSegListPropertyTearOff.h" >- >-namespace WebCore { >- >-SVGAnimatedPathAnimator::SVGAnimatedPathAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedPath, animationElement, contextElement) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedPathAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGPropertyTraits<SVGPathByteStream>::fromString(string)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedPathAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- ASSERT(animatedTypes.size() >= 1); >- >- // Build initial path byte stream. >- auto animatedType = SVGAnimatedType::create<SVGPathByteStream>(); >- resetAnimValToBaseVal(animatedTypes, *animatedType); >- return animatedType; >-} >- >-void SVGAnimatedPathAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForType<SVGAnimatedPathSegListPropertyTearOff>(animatedTypes); >-} >- >-void SVGAnimatedPathAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGPathByteStream* byteStream) >-{ >- RefPtr<SVGAnimatedPathSegListPropertyTearOff> property = castAnimatedPropertyToActualType<SVGAnimatedPathSegListPropertyTearOff>(animatedTypes[0].properties[0].get()); >- const auto& baseValue = property->currentBaseValue(); >- >- buildSVGPathByteStreamFromSVGPathSegListValues(baseValue, *byteStream, UnalteredParsing); >- >- Vector<RefPtr<SVGAnimatedPathSegListPropertyTearOff>> result; >- >- for (auto& type : animatedTypes) { >- auto* segment = castAnimatedPropertyToActualType<SVGAnimatedPathSegListPropertyTearOff>(type.properties[0].get()); >- if (segment->isAnimating()) >- continue; >- result.append(segment); >- } >- >- if (!result.isEmpty()) { >- SVGElement::InstanceUpdateBlocker blocker(*property->contextElement()); >- for (auto& segment : result) >- segment->animationStarted(byteStream, &baseValue); >- } >-} >- >-void SVGAnimatedPathAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- ASSERT(animatedTypes.size() >= 1); >- ASSERT(type.type() == m_type); >- resetAnimValToBaseVal(animatedTypes, &type.as<SVGPathByteStream>()); >-} >- >-void SVGAnimatedPathAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForType<SVGAnimatedPathSegListPropertyTearOff>(animatedTypes); >-} >- >-void SVGAnimatedPathAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForType<SVGAnimatedPathSegListPropertyTearOff>(animatedTypes); >-} >- >-void SVGAnimatedPathAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to) >-{ >- ASSERT(from->type() == AnimatedPath); >- ASSERT(from->type() == to->type()); >- >- const auto& fromPath = from->as<SVGPathByteStream>(); >- auto& toPath = to->as<SVGPathByteStream>(); >- unsigned fromPathSize = fromPath.size(); >- if (!fromPathSize || fromPathSize != toPath.size()) >- return; >- addToSVGPathByteStream(toPath, fromPath); >-} >- >-void SVGAnimatedPathAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- ASSERT(m_contextElement); >- >- bool isToAnimation = m_animationElement->animationMode() == ToAnimation; >- auto& animatedPath = animated->as<SVGPathByteStream>(); >- >- SVGPathByteStream underlyingPath; >- if (isToAnimation) >- underlyingPath = animatedPath; >- >- const auto& fromPath = isToAnimation ? underlyingPath : from->as<SVGPathByteStream>(); >- const auto& toPath = to->as<SVGPathByteStream>(); >- const auto& toAtEndOfDurationPath = toAtEndOfDuration->as<SVGPathByteStream>(); >- >- // Cache the current animated value before the buildAnimatedSVGPathByteStream() clears animatedPath. >- SVGPathByteStream lastAnimatedPath; >- if (!fromPath.size() || (m_animationElement->isAdditive() && !isToAnimation)) >- lastAnimatedPath = animatedPath; >- >- // Pass false to 'resizeAnimatedListIfNeeded' here, as the path animation is not a regular Vector<SVGXXX> type, but a SVGPathByteStream, that works differently. >- if (!m_animationElement->adjustFromToListValues<SVGPathByteStream>(fromPath, toPath, animatedPath, percentage, false)) >- return; >- >- buildAnimatedSVGPathByteStream(fromPath, toPath, animatedPath, percentage); >- >- // Handle additive='sum'. >- if (!lastAnimatedPath.isEmpty()) >- addToSVGPathByteStream(animatedPath, lastAnimatedPath); >- >- // Handle accumulate='sum'. >- if (m_animationElement->isAccumulated() && repeatCount) >- addToSVGPathByteStream(animatedPath, toAtEndOfDurationPath, repeatCount); >-} >- >-float SVGAnimatedPathAnimator::calculateDistance(const String&, const String&) >-{ >- // FIXME: Support paced animations. >- return -1; >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedPath.h b/Source/WebCore/svg/SVGAnimatedPath.h >deleted file mode 100644 >index b864ed32bb4..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedPath.h >+++ /dev/null >@@ -1,53 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2011, 2012. All rights reserved. >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#pragma once >- >-#include "SVGAnimatedPathSegListPropertyTearOff.h" >-#include "SVGAnimatedTypeAnimator.h" >-#include "SVGAttributeAccessor.h" >- >-namespace WebCore { >- >-class SVGAnimationElement; >- >-using SVGAnimatedPathSegList = SVGAnimatedPathSegListPropertyTearOff; >-using SVGAnimatedPathSegListAttribute = SVGAnimatedAttributeList<SVGAnimatedPathSegList>; >- >-class SVGAnimatedPathAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedPathAnimator(SVGAnimationElement*, SVGElement*); >- >- std::unique_ptr<SVGAnimatedType> constructFromString(const String&) override; >- std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) override; >- void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) override; >- void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType&) override; >- void animValWillChange(const SVGElementAnimatedPropertyList&) override; >- void animValDidChange(const SVGElementAnimatedPropertyList&) override; >- >- void addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*) override; >- void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*) override; >- float calculateDistance(const String& fromString, const String& toString) override; >- >-private: >- void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGPathByteStream*); >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAnimatedPointList.cpp b/Source/WebCore/svg/SVGAnimatedPointList.cpp >deleted file mode 100644 >index 8aa039d3f6e..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedPointList.cpp >+++ /dev/null >@@ -1,116 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2011, 2012. All rights reserved. >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#include "config.h" >-#include "SVGAnimatedPointList.h" >- >-#include "SVGAnimateElementBase.h" >-#include "SVGParserUtilities.h" >-#include "SVGPoint.h" >-#include "SVGPointListValues.h" >- >-namespace WebCore { >- >-SVGAnimatedPointListAnimator::SVGAnimatedPointListAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedPoints, animationElement, contextElement) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedPointListAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGPropertyTraits<SVGPointListValues>::fromString(string)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedPointListAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- return constructFromBaseValue<SVGAnimatedPointList>(animatedTypes); >-} >- >-void SVGAnimatedPointListAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForType<SVGAnimatedPointList>(animatedTypes); >-} >- >-void SVGAnimatedPointListAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- resetFromBaseValue<SVGAnimatedPointList>(animatedTypes, type); >-} >- >-void SVGAnimatedPointListAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForType<SVGAnimatedPointList>(animatedTypes); >-} >- >-void SVGAnimatedPointListAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForType<SVGAnimatedPointList>(animatedTypes); >-} >- >-void SVGAnimatedPointListAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to) >-{ >- ASSERT(from->type() == AnimatedPoints); >- ASSERT(from->type() == to->type()); >- >- const auto& fromPointList = from->as<SVGPointListValues>(); >- auto& toPointList = to->as<SVGPointListValues>(); >- >- unsigned fromPointListSize = fromPointList.size(); >- if (!fromPointListSize || fromPointListSize != toPointList.size()) >- return; >- >- for (unsigned i = 0; i < fromPointListSize; ++i) >- toPointList[i] += fromPointList[i]; >-} >- >-void SVGAnimatedPointListAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- >- const auto& fromPointList = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<SVGPointListValues>(); >- const auto& toPointList = to->as<SVGPointListValues>(); >- const auto& toAtEndOfDurationPointList = toAtEndOfDuration->as<SVGPointListValues>(); >- auto& animatedPointList = animated->as<SVGPointListValues>(); >- if (!m_animationElement->adjustFromToListValues<SVGPointListValues>(fromPointList, toPointList, animatedPointList, percentage)) >- return; >- >- unsigned fromPointListSize = fromPointList.size(); >- unsigned toPointListSize = toPointList.size(); >- unsigned toAtEndOfDurationSize = toAtEndOfDurationPointList.size(); >- >- for (unsigned i = 0; i < toPointListSize; ++i) { >- FloatPoint effectiveFrom; >- if (fromPointListSize) >- effectiveFrom = fromPointList[i]; >- FloatPoint effectiveToAtEnd = i < toAtEndOfDurationSize ? toAtEndOfDurationPointList[i] : FloatPoint(); >- >- float animatedX = animatedPointList[i].x(); >- float animatedY = animatedPointList[i].y(); >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, effectiveFrom.x(), toPointList[i].x(), effectiveToAtEnd.x(), animatedX); >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, effectiveFrom.y(), toPointList[i].y(), effectiveToAtEnd.y(), animatedY); >- animatedPointList[i] = FloatPoint(animatedX, animatedY); >- } >-} >- >-float SVGAnimatedPointListAnimator::calculateDistance(const String&, const String&) >-{ >- // FIXME: Distance calculation is not possible for SVGPointListValues right now. We need the distance of for every single value. >- return -1; >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedPointList.h b/Source/WebCore/svg/SVGAnimatedPointList.h >deleted file mode 100644 >index 1e773e1c98d..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedPointList.h >+++ /dev/null >@@ -1,53 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2011. All rights reserved. >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#pragma once >- >-#include "SVGAnimatedListPropertyTearOff.h" >-#include "SVGAnimatedTypeAnimator.h" >-#include "SVGPointList.h" >- >-namespace WebCore { >- >-class SVGAnimationElement; >- >-using SVGAnimatedPointList = SVGAnimatedListPropertyTearOff<SVGPointListValues>; >-using SVGAnimatedPointListAttribute = SVGAnimatedAttributeList<SVGAnimatedPointList>; >- >-template<typename OwnerType> >-using SVGAnimatedPointListAttributeAccessor = SVGAnimatedAttributeAccessor<OwnerType, SVGAnimatedPointListAttribute, AnimatedPoints>; >- >-class SVGAnimatedPointListAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedPointListAnimator(SVGAnimationElement*, SVGElement*); >- >- std::unique_ptr<SVGAnimatedType> constructFromString(const String&) override; >- std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) override; >- void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) override; >- void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType&) override; >- void animValWillChange(const SVGElementAnimatedPropertyList&) override; >- void animValDidChange(const SVGElementAnimatedPropertyList&) override; >- >- void addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*) override; >- void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*) override; >- float calculateDistance(const String& fromString, const String& toString) override; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.cpp b/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.cpp >deleted file mode 100644 >index 7d7428599ef..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.cpp >+++ /dev/null >@@ -1,85 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2011. All rights reserved. >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#include "config.h" >-#include "SVGAnimatedPreserveAspectRatio.h" >- >-#include "SVGAnimateElementBase.h" >- >-namespace WebCore { >- >-SVGAnimatedPreserveAspectRatioAnimator::SVGAnimatedPreserveAspectRatioAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedPreserveAspectRatio, animationElement, contextElement) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedPreserveAspectRatioAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGPropertyTraits<SVGPreserveAspectRatioValue>::fromString(string)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedPreserveAspectRatioAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- return constructFromBaseValue<SVGAnimatedPreserveAspectRatio>(animatedTypes); >-} >- >-void SVGAnimatedPreserveAspectRatioAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForType<SVGAnimatedPreserveAspectRatio>(animatedTypes); >-} >- >-void SVGAnimatedPreserveAspectRatioAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- resetFromBaseValue<SVGAnimatedPreserveAspectRatio>(animatedTypes, type); >-} >- >-void SVGAnimatedPreserveAspectRatioAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForType<SVGAnimatedPreserveAspectRatio>(animatedTypes); >-} >- >-void SVGAnimatedPreserveAspectRatioAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForType<SVGAnimatedPreserveAspectRatio>(animatedTypes); >-} >- >-void SVGAnimatedPreserveAspectRatioAnimator::addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*) >-{ >- ASSERT_NOT_REACHED(); >-} >- >-void SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue(float percentage, unsigned, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType*, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- ASSERT(m_contextElement); >- >- const auto& fromPreserveAspectRatio = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<SVGPreserveAspectRatioValue>(); >- const auto& toPreserveAspectRatio = to->as<SVGPreserveAspectRatioValue>(); >- auto& animatedPreserveAspectRatio = animated->as<SVGPreserveAspectRatioValue>(); >- >- m_animationElement->animateDiscreteType<SVGPreserveAspectRatioValue>(percentage, fromPreserveAspectRatio, toPreserveAspectRatio, animatedPreserveAspectRatio); >-} >- >-float SVGAnimatedPreserveAspectRatioAnimator::calculateDistance(const String&, const String&) >-{ >- // No paced animations for SVGPreserveAspectRatio. >- return -1; >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.h b/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.h >deleted file mode 100644 >index 2699d9d0747..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedPreserveAspectRatio.h >+++ /dev/null >@@ -1,54 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010. All rights reserved. >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#pragma once >- >-#include "SVGAnimatedPropertyTearOff.h" >-#include "SVGAnimatedTypeAnimator.h" >-#include "SVGAttributeAccessor.h" >-#include "SVGPreserveAspectRatio.h" >- >-namespace WebCore { >- >-class SVGAnimationElement; >- >-using SVGAnimatedPreserveAspectRatio = SVGAnimatedPropertyTearOff<SVGPreserveAspectRatio>; >-using SVGAnimatedPreserveAspectRatioAttribute = SVGAnimatedAttribute<SVGAnimatedPreserveAspectRatio>; >- >-template<typename OwnerType> >-using SVGAnimatedPreserveAspectRatioAttributeAccessor = SVGAnimatedAttributeAccessor<OwnerType, SVGAnimatedPreserveAspectRatioAttribute, AnimatedPreserveAspectRatio>; >- >-class SVGAnimatedPreserveAspectRatioAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedPreserveAspectRatioAnimator(SVGAnimationElement*, SVGElement*); >- >- std::unique_ptr<SVGAnimatedType> constructFromString(const String&) override; >- std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) override; >- void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) override; >- void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType&) override; >- void animValWillChange(const SVGElementAnimatedPropertyList&) override; >- void animValDidChange(const SVGElementAnimatedPropertyList&) override; >- >- void addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*) override; >- void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*) override; >- float calculateDistance(const String& fromString, const String& toString) override; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGImageLoader.cpp b/Source/WebCore/svg/SVGImageLoader.cpp >index 7221dfcb7dd..ba0c8d732c9 100644 >--- a/Source/WebCore/svg/SVGImageLoader.cpp >+++ b/Source/WebCore/svg/SVGImageLoader.cpp >@@ -41,7 +41,7 @@ void SVGImageLoader::dispatchLoadEvent() > if (image()->errorOccurred()) > element().dispatchEvent(Event::create(eventNames().errorEvent, Event::CanBubble::No, Event::IsCancelable::No)); > else { >- if (downcast<SVGImageElement>(element()).externalResourcesRequired()) >+ if (downcast<SVGImageElement>(element()).externalResourcesRequired()->currentValue()) > downcast<SVGImageElement>(ImageLoader::element()).sendSVGLoadEventIfPossible(true); > } > } >diff --git a/Source/WebCore/svg/SVGMarkerTypes.h b/Source/WebCore/svg/SVGMarkerTypes.h >index fac187c3229..ba67918d002 100644 >--- a/Source/WebCore/svg/SVGMarkerTypes.h >+++ b/Source/WebCore/svg/SVGMarkerTypes.h >@@ -75,17 +75,32 @@ struct SVGPropertyTraits<SVGMarkerUnitsType> { > > template<> > struct SVGPropertyTraits<SVGMarkerOrientType> { >+ static const String autoString() >+ { >+ static const NeverDestroyed<String> autoString = MAKE_STATIC_STRING_IMPL("auto"); >+ return autoString; >+ } >+ static const String autoStartReverseString() >+ { >+ static const NeverDestroyed<String> autoStartReverseString = MAKE_STATIC_STRING_IMPL("auto-start-reverse"); >+ return autoStartReverseString; >+ } > static unsigned highestEnumValue() { return SVGMarkerOrientAutoStartReverse; } >- static SVGMarkerOrientType fromString(const String& value, SVGAngleValue& angle) >+ static SVGMarkerOrientType fromString(const String& string) > { >- if (value == "auto") >+ if (string == autoString()) > return SVGMarkerOrientAuto; >- if (value == "auto-start-reverse") >+ if (string == autoStartReverseString()) > return SVGMarkerOrientAutoStartReverse; >- auto setValueResult = angle.setValueAsString(value); >- if (setValueResult.hasException()) >- return SVGMarkerOrientUnknown; >- return SVGMarkerOrientAngle; >+ return SVGMarkerOrientUnknown; >+ } >+ static String toString(SVGMarkerOrientType type) >+ { >+ if (type == SVGMarkerOrientAuto) >+ return autoString(); >+ if (type == SVGMarkerOrientAutoStartReverse) >+ return autoStartReverseString(); >+ return emptyString(); > } > }; > >@@ -93,18 +108,18 @@ template<> > inline unsigned SVGIDLEnumLimits<SVGMarkerOrientType>::highestExposedEnumValue() { return SVGMarkerOrientAngle; } > > template<> >-struct SVGPropertyTraits<std::pair<SVGAngleValue, unsigned>> { >- static std::pair<SVGAngleValue, unsigned> initialValue() { return { }; } >- static std::pair<SVGAngleValue, unsigned> fromString(const String& string) >+struct SVGPropertyTraits<std::pair<SVGAngleValue, SVGMarkerOrientType>> { >+ static std::pair<SVGAngleValue, SVGMarkerOrientType> fromString(const String& string) > { > SVGAngleValue angle; >- SVGMarkerOrientType orientType = SVGPropertyTraits<SVGMarkerOrientType>::fromString(string, angle); >- if (orientType != SVGMarkerOrientAngle) >- angle = { }; >- return std::pair<SVGAngleValue, unsigned>(angle, orientType); >+ SVGMarkerOrientType orientType = SVGPropertyTraits<SVGMarkerOrientType>::fromString(string); >+ if (orientType == SVGMarkerOrientUnknown) { >+ auto result = angle.setValueAsString(string); >+ if (!result.hasException()) >+ orientType = SVGMarkerOrientAngle; >+ } >+ return std::make_pair(angle, orientType); > } >- static std::optional<std::pair<SVGAngleValue, unsigned>> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >- static String toString(const std::pair<SVGAngleValue, unsigned>&) { ASSERT_NOT_REACHED(); return emptyString(); } > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGSVGElement.idl b/Source/WebCore/svg/SVGSVGElement.idl >index d9687d239c3..3deb05ea184 100644 >--- a/Source/WebCore/svg/SVGSVGElement.idl >+++ b/Source/WebCore/svg/SVGSVGElement.idl >@@ -42,7 +42,7 @@ > readonly attribute boolean useCurrentView; > readonly attribute SVGViewSpec currentView; > attribute unrestricted float currentScale; >- [NewObject] readonly attribute SVGPoint currentTranslate; >+ readonly attribute SVGPoint currentTranslate; > > unsigned long suspendRedraw(optional unsigned long maxWaitMilliseconds = 0); > void unsuspendRedraw(optional unsigned long suspendHandleId = 0); >diff --git a/Source/WebCore/svg/SVGSetElement.cpp b/Source/WebCore/svg/SVGSetElement.cpp >index b40ef81cce0..4bb80f74b2b 100644 >--- a/Source/WebCore/svg/SVGSetElement.cpp >+++ b/Source/WebCore/svg/SVGSetElement.cpp >@@ -31,7 +31,7 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(SVGSetElement); > inline SVGSetElement::SVGSetElement(const QualifiedName& tagName, Document& document) > : SVGAnimateElementBase(tagName, document) > { >- setAnimationMode(ToAnimation); >+ setAnimationMode(AnimationMode::To); > ASSERT(hasTagName(SVGNames::setTag)); > } > >@@ -42,7 +42,7 @@ Ref<SVGSetElement> SVGSetElement::create(const QualifiedName& tagName, Document& > > void SVGSetElement::updateAnimationMode() > { >- // No-op, as <set> has a constant animation mode of ToAnimation. >+ // No-op, as <set> has a constant animation mode of AnimationMode::To. > // See: http://www.w3.org/TR/SVG/single-page.html#animate-SetElement > } > >diff --git a/Source/WebCore/svg/SVGTests.idl b/Source/WebCore/svg/SVGTests.idl >index a44f073e944..3b7a9c78809 100644 >--- a/Source/WebCore/svg/SVGTests.idl >+++ b/Source/WebCore/svg/SVGTests.idl >@@ -28,9 +28,9 @@ > NoInterfaceObject, > SuppressToJSObject, > ] interface SVGTests { >- [NewObject] readonly attribute SVGStringList requiredFeatures; >- [NewObject] readonly attribute SVGStringList requiredExtensions; >- [NewObject] readonly attribute SVGStringList systemLanguage; >+ readonly attribute SVGStringList requiredFeatures; >+ readonly attribute SVGStringList requiredExtensions; >+ readonly attribute SVGStringList systemLanguage; > > // FIXME: Using "undefined" as default parameter value is wrong. > boolean hasExtension(optional DOMString extension = "undefined"); >diff --git a/Source/WebCore/svg/SVGTransformDistance.cpp b/Source/WebCore/svg/SVGTransformDistance.cpp >index 04f08358d95..3847d53c72a 100644 >--- a/Source/WebCore/svg/SVGTransformDistance.cpp >+++ b/Source/WebCore/svg/SVGTransformDistance.cpp >@@ -160,7 +160,7 @@ SVGTransformValue SVGTransformDistance::addSVGTransforms(const SVGTransformValue > > SVGTransformValue SVGTransformDistance::addToSVGTransform(const SVGTransformValue& transform) const > { >- ASSERT(m_type == transform.type() || transform == SVGTransformValue()); >+ ASSERT(m_type == transform.type() || !transform.isValid()); > > SVGTransformValue newTransform(transform); > >diff --git a/Source/WebCore/svg/SVGTransformable.cpp b/Source/WebCore/svg/SVGTransformable.cpp >index b8c0bedae04..06d7a6235b5 100644 >--- a/Source/WebCore/svg/SVGTransformable.cpp >+++ b/Source/WebCore/svg/SVGTransformable.cpp >@@ -27,7 +27,6 @@ > #include "SVGElement.h" > #include "SVGNames.h" > #include "SVGParserUtilities.h" >-#include "SVGTransformListValues.h" > #include <wtf/text/StringView.h> > > namespace WebCore { >@@ -144,7 +143,7 @@ static const UChar translateDesc[] = {'t', 'r', 'a', 'n', 's', 'l', 'a', 't', ' > static const UChar rotateDesc[] = {'r', 'o', 't', 'a', 't', 'e'}; > static const UChar matrixDesc[] = {'m', 'a', 't', 'r', 'i', 'x'}; > >-static inline bool parseAndSkipType(const UChar*& currTransform, const UChar* end, SVGTransformValue::SVGTransformType& type) >+bool SVGTransformable::parseAndSkipType(const UChar*& currTransform, const UChar* end, SVGTransformValue::SVGTransformType& type) > { > if (currTransform >= end) > return false; >@@ -179,34 +178,4 @@ SVGTransformValue::SVGTransformType SVGTransformable::parseTransformType(const S > return type; > } > >-bool SVGTransformable::parseTransformAttribute(SVGTransformListValues& list, const UChar*& currTransform, const UChar* end, TransformParsingMode mode) >-{ >- if (mode == ClearList) >- list.clear(); >- >- bool delimParsed = false; >- while (currTransform < end) { >- delimParsed = false; >- SVGTransformValue::SVGTransformType type = SVGTransformValue::SVG_TRANSFORM_UNKNOWN; >- skipOptionalSVGSpaces(currTransform, end); >- >- if (!parseAndSkipType(currTransform, end, type)) >- return false; >- >- SVGTransformValue transform; >- if (!parseTransformValue(type, currTransform, end, transform)) >- return false; >- >- list.append(transform); >- skipOptionalSVGSpaces(currTransform, end); >- if (currTransform < end && *currTransform == ',') { >- delimParsed = true; >- ++currTransform; >- } >- skipOptionalSVGSpaces(currTransform, end); >- } >- >- return !delimParsed; >-} >- > } >diff --git a/Source/WebCore/svg/SVGTransformable.h b/Source/WebCore/svg/SVGTransformable.h >index b5e07175a5b..b70cf8c2f5b 100644 >--- a/Source/WebCore/svg/SVGTransformable.h >+++ b/Source/WebCore/svg/SVGTransformable.h >@@ -27,20 +27,14 @@ > namespace WebCore { > > class AffineTransform; >-class SVGTransformListValues; > > class SVGTransformable : public SVGLocatable { > public: >- enum TransformParsingMode { >- ClearList, >- DoNotClearList >- }; >- > virtual ~SVGTransformable(); > >- static bool parseTransformAttribute(SVGTransformListValues&, const UChar*& ptr, const UChar* end, TransformParsingMode = ClearList); > static bool parseTransformValue(SVGTransformValue::SVGTransformType, const UChar*& ptr, const UChar* end, SVGTransformValue&); > static SVGTransformValue::SVGTransformType parseTransformType(const String&); >+ static bool parseAndSkipType(const UChar*& currTransform, const UChar* end, SVGTransformValue::SVGTransformType&); > > AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const override { return animatedLocalTransform(); } > virtual AffineTransform animatedLocalTransform() const = 0; >diff --git a/Source/WebCore/svg/SVGZoomAndPanType.h b/Source/WebCore/svg/SVGZoomAndPanType.h >index 481e4f5d4d6..120fa93f637 100644 >--- a/Source/WebCore/svg/SVGZoomAndPanType.h >+++ b/Source/WebCore/svg/SVGZoomAndPanType.h >@@ -25,7 +25,6 @@ > > #pragma once > >-#include "SVGAttributeAccessor.h" > #include "SVGPropertyTraits.h" > > namespace WebCore { >@@ -36,11 +35,6 @@ enum SVGZoomAndPanType { > SVGZoomAndPanMagnify > }; > >-using SVGZoomAndPanTypeAttribute = SVGPropertyAttribute<SVGZoomAndPanType>; >- >-template<typename OwnerType> >-using SVGZoomAndPanTypeAttributeAccessor = SVGPropertyAttributeAccessor<OwnerType, SVGZoomAndPanTypeAttribute>; >- > template<> > struct SVGPropertyTraits<SVGZoomAndPanType> { > static SVGZoomAndPanType initialValue() { return SVGZoomAndPanMagnify; } >diff --git a/Source/WebCore/svg/animation/SVGSMILElement.cpp b/Source/WebCore/svg/animation/SVGSMILElement.cpp >index bbda240ac1f..c0448213ebb 100644 >--- a/Source/WebCore/svg/animation/SVGSMILElement.cpp >+++ b/Source/WebCore/svg/animation/SVGSMILElement.cpp >@@ -309,7 +309,7 @@ void SVGSMILElement::removedFromAncestor(RemovalType removalType, ContainerNode& > SVGElement::removedFromAncestor(removalType, oldParentOfRemovedTree); > } > >-bool SVGSMILElement::hasValidAttributeName() >+bool SVGSMILElement::hasValidAttributeName() const > { > return attributeName() != anyQName(); > } >diff --git a/Source/WebCore/svg/animation/SVGSMILElement.h b/Source/WebCore/svg/animation/SVGSMILElement.h >index ca533aed3ea..ef9924af96a 100644 >--- a/Source/WebCore/svg/animation/SVGSMILElement.h >+++ b/Source/WebCore/svg/animation/SVGSMILElement.h >@@ -51,8 +51,8 @@ public: > InsertedIntoAncestorResult insertedIntoAncestor(InsertionType, ContainerNode&) override; > void removedFromAncestor(RemovalType, ContainerNode&) override; > >- virtual bool hasValidAttributeType() = 0; >- virtual bool hasValidAttributeName(); >+ virtual bool hasValidAttributeType() const = 0; >+ virtual bool hasValidAttributeName() const; > virtual void animationAttributeChanged() = 0; > > SMILTimeContainer* timeContainer() { return m_timeContainer.get(); } >diff --git a/Source/WebCore/svg/graphics/SVGImage.cpp b/Source/WebCore/svg/graphics/SVGImage.cpp >index af4f1e11df7..9e60a9fc0d6 100644 >--- a/Source/WebCore/svg/graphics/SVGImage.cpp >+++ b/Source/WebCore/svg/graphics/SVGImage.cpp >@@ -374,7 +374,7 @@ bool SVGImage::hasRelativeHeight() const > > void SVGImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) > { >- auto rootElement = this->rootElement(); >+ const SVGSVGElement* rootElement = this->rootElement().get(); > if (!rootElement) > return; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 191237
:
353808
|
353812
|
353815
|
353817
|
353818
|
353820
|
353824
|
353825
|
355382
|
355386
|
355388
|
355393
|
355568
|
355574
|
355575
|
355577
|
355580
|
355582
|
355585
|
355666
|
355672
|
355693
|
355699
|
355711
|
355752
|
355777
|
355820
|
356333
|
356334
|
356338
|
356340
|
356342
|
356344
|
356346
|
356351
|
356352
|
356358
|
356360
|
356380
|
356497
|
356500
|
356507
|
356579
|
356607
|
356728
|
356729
|
356730
|
356731
|
356732
|
356733
|
356752
|
356810
|
356811
|
356879
|
356880
|
356881
|
356882
|
356883
|
356884
|
356885
|
356887
|
356888
|
356889
|
356892
|
356895
|
356896
|
359721
|
359735
|
359747
|
363581
|
363595
|
363613
|
363690
|
364172
|
364180
|
366512
|
366557
|
366636