WebKit Bugzilla
Attachment 356892 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]
EWSPatch
EWSPatch-2.patch (text/plain), 1.50 MB, created by
Said Abou-Hallawa
on 2018-12-08 16:24:38 PST
(
hide
)
Description:
EWSPatch
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2018-12-08 16:24:38 PST
Size:
1.50 MB
patch
obsolete
>diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 6057740b421..f8b0a55cbb1 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,50 @@ >+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!). >+ >+ These changes are because the the SVG list interface has changed from >+ SVG1.1 and SVG2. See: >+ https://www.w3.org/TR/SVG11/types.html#InterfaceSVGLengthList >+ https://www.w3.org/TR/SVG/types.html#TermListInterface >+ >+ The biggest difference is related to inserting an newItem into a list >+ and the newItem is attached to another list. SVG1.1 states that the >+ newItem from its old list before adding it to the new list. SVG2 states >+ that only a copy of the newItem will be inserted. >+ >+ * svg/animations/svglength-element-removed-crash.svg: >+ * svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt: >+ * svg/dom/SVGAnimatedEnumeration-SVGMarkerElement.html: >+ * svg/dom/SVGLengthList-appendItem-expected.txt: >+ * svg/dom/SVGLengthList-appendItem.xhtml: >+ * svg/dom/SVGLengthList-basics-expected.txt: >+ * svg/dom/SVGLengthList-basics.xhtml: >+ * svg/dom/SVGLengthList-initialize-expected.txt: >+ * svg/dom/SVGLengthList-initialize.xhtml: >+ * svg/dom/SVGLengthList-insertItemBefore-expected.txt: >+ * svg/dom/SVGLengthList-insertItemBefore.xhtml: >+ * svg/dom/SVGLengthList-removeItem-expected.txt: >+ * svg/dom/SVGLengthList-removeItem.xhtml: >+ * svg/dom/SVGLengthList-replaceItem-expected.txt: >+ * svg/dom/SVGLengthList-replaceItem.xhtml: >+ * svg/dom/SVGNumberList-basics-expected.txt: >+ * svg/dom/SVGNumberList-basics.xhtml: >+ * svg/dom/SVGPathSegList-appendItem-expected.txt: >+ * svg/dom/SVGPathSegList-appendItem.xhtml: >+ * svg/dom/SVGPathSegList-clear-and-initialize-expected.txt: >+ * svg/dom/SVGPathSegList-clear-and-initialize.xhtml: >+ * svg/dom/SVGPathSegList-insertItemBefore-expected.txt: >+ * svg/dom/SVGPathSegList-insertItemBefore.xhtml: >+ * svg/dom/SVGPathSegList-replaceItem-expected.txt: >+ * svg/dom/SVGPathSegList-replaceItem.xhtml: >+ * svg/dom/SVGPointList-basics-expected.txt: >+ * svg/dom/SVGPointList-basics.xhtml: >+ * svg/dom/SVGTransformList-basics-expected.txt: >+ * svg/dom/SVGTransformList-basics.xhtml: >+ > 2018-12-08 Simon Fraser <simon.fraser@apple.com> > > Allow control over child order when adding nodes to the scrolling tree >diff --git a/LayoutTests/svg/animations/svglength-element-removed-crash.svg b/LayoutTests/svg/animations/svglength-element-removed-crash.svg >index 511cd63f2a3..b132c76fb1a 100644 >--- a/LayoutTests/svg/animations/svglength-element-removed-crash.svg >+++ b/LayoutTests/svg/animations/svglength-element-removed-crash.svg >@@ -32,8 +32,8 @@ function load() { > // The rest of this test should FAIL without requiring gmalloc if this test has regressed. > var liveDelta = window.internals.numberOfLiveNodes() - originalLiveElements; > >- // Make sure that the <rect> is still alive; if it's not, liveDelta will be -1. >- if (liveDelta == 0) >+ // Make sure that the <rect> is deleted; if it's not, liveDelta will be 0. >+ if (liveDelta == -1) > log(" PASS"); > else > log(" FAIL: " + liveDelta + " extra live node(s)"); >diff --git a/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt b/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt >index a1249f95087..bfe48581fa1 100644 >--- a/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt >+++ b/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMarkerElement-expected.txt >@@ -101,16 +101,16 @@ PASS markerElement.getAttribute('orient') is "10deg" > > Test case sensitivity of attributes - try setting invalid values > PASS markerElement.setAttribute('orient', 'AUTO-START-REVERSE') did not throw exception. >-FAIL markerElement.getAttribute('orient') should be AUTO-START-REVERSE. Was 10deg. >-PASS markerElement.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE >+PASS markerElement.getAttribute('orient') is "AUTO-START-REVERSE" >+PASS markerElement.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN > PASS markerElement.setAttribute('orient', 'AUTO') did not throw exception. >-FAIL markerElement.getAttribute('orient') should be AUTO. Was 10deg. >-PASS markerElement.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE >+PASS markerElement.getAttribute('orient') is "AUTO" >+PASS markerElement.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN > > Switch back to 'auto' value > PASS markerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO is SVGMarkerElement.SVG_MARKER_ORIENT_AUTO >-PASS markerElement.orientAngle.baseVal.value is 10 >-PASS markerElement.orientAngle.baseVal.unitType is SVGAngle.SVG_ANGLETYPE_DEG >+PASS markerElement.orientAngle.baseVal.value is 0 >+PASS markerElement.orientAngle.baseVal.unitType is SVGAngle.SVG_ANGLETYPE_UNSPECIFIED > PASS markerElement.orientType.baseVal is SVGMarkerElement.SVG_MARKER_ORIENT_AUTO > PASS markerElement.getAttribute('orient') is "auto" > >diff --git a/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMarkerElement.html b/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMarkerElement.html >index c0cda198b6f..2c5e670cce7 100644 >--- a/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMarkerElement.html >+++ b/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGMarkerElement.html >@@ -132,24 +132,18 @@ shouldBeEqualToString("markerElement.getAttribute('orient')", "10deg"); > debug(""); > debug("Test case sensitivity of attributes - try setting invalid values"); > shouldNotThrow("markerElement.setAttribute('orient', 'AUTO-START-REVERSE')"); >-// The line below fails as a result of https://bugs.webkit.org/show_bug.cgi?id=154141 >-// The attribute value is not updated to the invalid value. >-// The expected result recognises this and should be updated when the above bug >-// is resolved. >-// What's important here though is that the DOM values are unchanged, and this >-// is demonstrated correctly. > shouldBeEqualToString("markerElement.getAttribute('orient')", "AUTO-START-REVERSE"); >-shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE"); >+shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN"); > > shouldNotThrow("markerElement.setAttribute('orient', 'AUTO')"); > shouldBeEqualToString("markerElement.getAttribute('orient')", "AUTO"); >-shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_ANGLE"); >+shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN"); > > debug(""); > debug("Switch back to 'auto' value"); > shouldBe("markerElement.orientType.baseVal = SVGMarkerElement.SVG_MARKER_ORIENT_AUTO", "SVGMarkerElement.SVG_MARKER_ORIENT_AUTO"); >-shouldBe("markerElement.orientAngle.baseVal.value", "10"); >-shouldBe("markerElement.orientAngle.baseVal.unitType", "SVGAngle.SVG_ANGLETYPE_DEG"); >+shouldBe("markerElement.orientAngle.baseVal.value", "0"); >+shouldBe("markerElement.orientAngle.baseVal.unitType", "SVGAngle.SVG_ANGLETYPE_UNSPECIFIED"); > shouldBe("markerElement.orientType.baseVal", "SVGMarkerElement.SVG_MARKER_ORIENT_AUTO"); > shouldBeEqualToString("markerElement.getAttribute('orient')", "auto"); > >diff --git a/LayoutTests/svg/dom/SVGLengthList-appendItem-expected.txt b/LayoutTests/svg/dom/SVGLengthList-appendItem-expected.txt >index d45a9940a34..e6a69d9a382 100644 >--- a/LayoutTests/svg/dom/SVGLengthList-appendItem-expected.txt >+++ b/LayoutTests/svg/dom/SVGLengthList-appendItem-expected.txt >@@ -27,7 +27,8 @@ PASS text2.x.baseVal.getItem(2).value is 1000 > PASS text2.x.baseVal.getItem(3) threw exception IndexSizeError: The index is not in the allowed range.. > > Append fourth item x=900 to the text1 x list >-PASS text1.x.baseVal.appendItem(text1.x.baseVal.getItem(3)) is text1.x.baseVal.getItem(4) >+PASS text1.x.baseVal.appendItem(text1.x.baseVal.getItem(3)) is text1.x.baseVal.getItem(5) >+PASS text1.x.baseVal.removeItem(3).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 5 > PASS text1.x.baseVal.getItem(0).value is 500 > PASS text1.x.baseVal.getItem(1).value is 50 >@@ -37,7 +38,8 @@ PASS text1.x.baseVal.getItem(4).value is 900 > PASS text1.x.baseVal.getItem(5) threw exception IndexSizeError: The index is not in the allowed range.. > > Append first item x=500 to the text1 x list >-PASS text1.x.baseVal.appendItem(text1.x.baseVal.getItem(0)) is text1.x.baseVal.getItem(4) >+PASS text1.x.baseVal.appendItem(text1.x.baseVal.getItem(0)) is text1.x.baseVal.getItem(5) >+PASS text1.x.baseVal.removeItem(0).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 5 > PASS text1.x.baseVal.getItem(0).value is 50 > PASS text1.x.baseVal.getItem(1).value is 100 >@@ -59,7 +61,9 @@ PASS text1.x.baseVal.getItem(6) threw exception IndexSizeError: The index is not > > Append third and fourth item of the text1 x list to the text2 x list > PASS text2.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value is 1000 >+PASS text1.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text2.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value is 900 >+PASS text1.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 4 > PASS text1.x.baseVal.getItem(0).value is 50 > PASS text1.x.baseVal.getItem(1).value is 100 >@@ -77,10 +81,14 @@ PASS newLength2.value is 150 > > Shuffle around items in text1 and text2 list using appendItem, to get x=50,100,150,... in both lists > PASS text1.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value is 500 >+PASS text1.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text2.x.baseVal.appendItem(newLength2).value is 150 > PASS text2.x.baseVal.appendItem(text2.x.baseVal.getItem(2)).value is 1000 >+PASS text2.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text2.x.baseVal.appendItem(text2.x.baseVal.getItem(3)).value is 900 >+PASS text2.x.baseVal.removeItem(3).toString() is "[object SVGLength]" > PASS text2.x.baseVal.appendItem(text2.x.baseVal.getItem(2)).value is 1000 >+PASS text2.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 4 > PASS text1.x.baseVal.getItem(0).value is 50 > PASS text1.x.baseVal.getItem(1).value is 100 >diff --git a/LayoutTests/svg/dom/SVGLengthList-appendItem.xhtml b/LayoutTests/svg/dom/SVGLengthList-appendItem.xhtml >index 49ec802bee7..eb54b951250 100644 >--- a/LayoutTests/svg/dom/SVGLengthList-appendItem.xhtml >+++ b/LayoutTests/svg/dom/SVGLengthList-appendItem.xhtml >@@ -46,7 +46,8 @@ > > debug(""); > debug("Append fourth item x=900 to the text1 x list"); >- shouldBe("text1.x.baseVal.appendItem(text1.x.baseVal.getItem(3))", "text1.x.baseVal.getItem(4)"); >+ shouldBe("text1.x.baseVal.appendItem(text1.x.baseVal.getItem(3))", "text1.x.baseVal.getItem(5)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(3).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "5"); > shouldBe("text1.x.baseVal.getItem(0).value", "500"); > shouldBe("text1.x.baseVal.getItem(1).value", "50"); >@@ -57,7 +58,8 @@ > > debug(""); > debug("Append first item x=500 to the text1 x list"); >- shouldBe("text1.x.baseVal.appendItem(text1.x.baseVal.getItem(0))", "text1.x.baseVal.getItem(4)"); >+ shouldBe("text1.x.baseVal.appendItem(text1.x.baseVal.getItem(0))", "text1.x.baseVal.getItem(5)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(0).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "5"); > shouldBe("text1.x.baseVal.getItem(0).value", "50"); > shouldBe("text1.x.baseVal.getItem(1).value", "100"); >@@ -81,7 +83,9 @@ > debug(""); > debug("Append third and fourth item of the text1 x list to the text2 x list"); > shouldBe("text2.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value", "1000"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text2.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value", "900"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "4"); > shouldBe("text1.x.baseVal.getItem(0).value", "50"); > shouldBe("text1.x.baseVal.getItem(1).value", "100"); >@@ -103,10 +107,14 @@ > debug(""); > debug("Shuffle around items in text1 and text2 list using appendItem, to get x=50,100,150,... in both lists"); > shouldBe("text1.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value", "500"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text2.x.baseVal.appendItem(newLength2).value", "150"); > shouldBe("text2.x.baseVal.appendItem(text2.x.baseVal.getItem(2)).value", "1000"); >+ shouldBeEqualToString("text2.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text2.x.baseVal.appendItem(text2.x.baseVal.getItem(3)).value", "900"); >+ shouldBeEqualToString("text2.x.baseVal.removeItem(3).toString()", "[object SVGLength]"); > shouldBe("text2.x.baseVal.appendItem(text2.x.baseVal.getItem(2)).value", "1000"); >+ shouldBeEqualToString("text2.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "4"); > shouldBe("text1.x.baseVal.getItem(0).value", "50"); > shouldBe("text1.x.baseVal.getItem(1).value", "100"); >diff --git a/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt b/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt >index 70256c8828a..aff90b23a90 100644 >--- a/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt >+++ b/LayoutTests/svg/dom/SVGLengthList-basics-expected.txt >@@ -29,24 +29,28 @@ PASS text1.x.baseVal.insertItemBefore('aString') threw exception TypeError: Not > PASS text1.x.baseVal.insertItemBefore(text1) threw exception TypeError: Not enough arguments. > PASS text1.x.baseVal.insertItemBefore(null) threw exception TypeError: Not enough arguments. > PASS text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 'aString') is text1.x.baseVal.getItem(0) >+PASS text1.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 3 > PASS text1.x.baseVal.getItem(0).value is 1000 > PASS text1.x.baseVal.getItem(1).value is 500 > PASS text1.x.baseVal.getItem(2).value is 1500 > PASS text1.getAttribute('x') is "1000 500 1500" > PASS text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), text1) is text1.x.baseVal.getItem(0) >+PASS text1.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 3 > PASS text1.x.baseVal.getItem(0).value is 500 > PASS text1.x.baseVal.getItem(1).value is 1000 > PASS text1.x.baseVal.getItem(2).value is 1500 > PASS text1.getAttribute('x') is "500 1000 1500" > PASS text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), null) is text1.x.baseVal.getItem(0) >+PASS text1.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 3 > PASS text1.x.baseVal.getItem(0).value is 1000 > PASS text1.x.baseVal.getItem(1).value is 500 > PASS text1.x.baseVal.getItem(2).value is 1500 > PASS text1.getAttribute('x') is "1000 500 1500" > PASS text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 0) is text1.x.baseVal.getItem(0) >+PASS text1.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 3 > PASS text1.x.baseVal.getItem(0).value is 500 > PASS text1.x.baseVal.getItem(1).value is 1000 >@@ -62,10 +66,13 @@ PASS text1.setAttribute('x', '1 2 3 4') is undefined. > > Test edge cases for insertItemBefore() > PASS text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(3), 3) is text1.x.baseVal.getItem(3) >+PASS text1.x.baseVal.removeItem(4).toString() is "[object SVGLength]" > PASS text1.getAttribute('x') is "1 2 3 4" >-PASS text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 5) is text1.x.baseVal.getItem(3) >+PASS text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 5) is text1.x.baseVal.getItem(4) >+PASS text1.x.baseVal.removeItem(1).toString() is "[object SVGLength]" > PASS text1.getAttribute('x') is "1 3 4 2" > PASS text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 0) is text1.x.baseVal.getItem(0) >+PASS text1.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text1.getAttribute('x') is "3 1 4 2" > > Set x='1 2 3 4' for text1 >@@ -111,7 +118,8 @@ Test edge cases for replaceItem() > PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(3), 3) is text1.x.baseVal.getItem(3) > PASS text1.x.baseVal.numberOfItems is 4 > PASS text1.getAttribute('x') is "1 2 3 4" >-PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(1), 3) is text1.x.baseVal.getItem(2) >+PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(1), 3) is text1.x.baseVal.getItem(3) >+PASS text1.x.baseVal.removeItem(1).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 3 > PASS text1.getAttribute('x') is "1 3 2" > PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(3), 4) threw exception IndexSizeError: The index is not in the allowed range.. >@@ -120,13 +128,16 @@ Set x='1 2 3 4' for text1 > PASS text1.setAttribute('x', '1 2 3 4') is undefined. > > Test overlapping edge cases for replaceItem() >-PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 3) is text1.x.baseVal.getItem(2) >+PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 3) is text1.x.baseVal.getItem(3) >+PASS text1.x.baseVal.removeItem(0).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 3 > PASS text1.x.baseVal.getItem(2).value is 2 >-PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 2) is text1.x.baseVal.getItem(1) >+PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 2) is text1.x.baseVal.getItem(2) >+PASS text1.x.baseVal.removeItem(0).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 2 > PASS text1.x.baseVal.getItem(1).value is 4 >-PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 1) is text1.x.baseVal.getItem(0) >+PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 1) is text1.x.baseVal.getItem(1) >+PASS text1.x.baseVal.removeItem(1).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 1 > PASS text1.x.baseVal.getItem(0).value is 6 > PASS text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 0) is text1.x.baseVal.getItem(0) >diff --git a/LayoutTests/svg/dom/SVGLengthList-basics.xhtml b/LayoutTests/svg/dom/SVGLengthList-basics.xhtml >index 415ed90e86c..a783101ab33 100644 >--- a/LayoutTests/svg/dom/SVGLengthList-basics.xhtml >+++ b/LayoutTests/svg/dom/SVGLengthList-basics.xhtml >@@ -50,6 +50,7 @@ > shouldThrow("text1.x.baseVal.insertItemBefore(null)"); > > shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 'aString')", "text1.x.baseVal.getItem(0)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "3"); > shouldBe("text1.x.baseVal.getItem(0).value", "1000"); > shouldBe("text1.x.baseVal.getItem(1).value", "500"); >@@ -57,6 +58,7 @@ > shouldBeEqualToString("text1.getAttribute('x')", "1000 500 1500"); > > shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), text1)", "text1.x.baseVal.getItem(0)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "3"); > shouldBe("text1.x.baseVal.getItem(0).value", "500"); > shouldBe("text1.x.baseVal.getItem(1).value", "1000"); >@@ -64,6 +66,7 @@ > shouldBeEqualToString("text1.getAttribute('x')", "500 1000 1500"); > > shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), null)", "text1.x.baseVal.getItem(0)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "3"); > shouldBe("text1.x.baseVal.getItem(0).value", "1000"); > shouldBe("text1.x.baseVal.getItem(1).value", "500"); >@@ -71,6 +74,7 @@ > shouldBeEqualToString("text1.getAttribute('x')", "1000 500 1500"); > > shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 0)", "text1.x.baseVal.getItem(0)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "3"); > shouldBe("text1.x.baseVal.getItem(0).value", "500"); > shouldBe("text1.x.baseVal.getItem(1).value", "1000"); >@@ -89,10 +93,13 @@ > debug(""); > debug("Test edge cases for insertItemBefore()"); > shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(3), 3)", "text1.x.baseVal.getItem(3)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(4).toString()", "[object SVGLength]"); > shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4"); >- shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 5)", "text1.x.baseVal.getItem(3)"); >+ shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 5)", "text1.x.baseVal.getItem(4)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(1).toString()", "[object SVGLength]"); > shouldBeEqualToString("text1.getAttribute('x')", "1 3 4 2"); > shouldBe("text1.x.baseVal.insertItemBefore(text1.x.baseVal.getItem(1), 0)", "text1.x.baseVal.getItem(0)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBeEqualToString("text1.getAttribute('x')", "3 1 4 2"); > > debug(""); >@@ -145,7 +152,8 @@ > shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(3), 3)", "text1.x.baseVal.getItem(3)"); > shouldBe("text1.x.baseVal.numberOfItems", "4"); > shouldBeEqualToString("text1.getAttribute('x')", "1 2 3 4"); >- shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(1), 3)", "text1.x.baseVal.getItem(2)"); >+ shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(1), 3)", "text1.x.baseVal.getItem(3)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(1).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "3"); > shouldBeEqualToString("text1.getAttribute('x')", "1 3 2"); > shouldThrow("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(3), 4)"); >@@ -157,17 +165,20 @@ > debug(""); > debug("Test overlapping edge cases for replaceItem()"); > var item = text1.x.baseVal.getItem(3); >- shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 3)", "text1.x.baseVal.getItem(2)"); >+ shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 3)", "text1.x.baseVal.getItem(3)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(0).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "3"); > item = text1.x.baseVal.getItem(2); > item.newValueSpecifiedUnits(item.unitType, item.value * 2); > shouldBe("text1.x.baseVal.getItem(2).value", "2"); >- shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 2)", "text1.x.baseVal.getItem(1)"); >+ shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 2)", "text1.x.baseVal.getItem(2)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(0).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "2"); > item = text1.x.baseVal.getItem(1); > item.newValueSpecifiedUnits(item.unitType, item.value * 2); > shouldBe("text1.x.baseVal.getItem(1).value", "4"); >- shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 1)", "text1.x.baseVal.getItem(0)"); >+ shouldBe("text1.x.baseVal.replaceItem(text1.x.baseVal.getItem(0), 1)", "text1.x.baseVal.getItem(1)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(1).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "1"); > item = text1.x.baseVal.getItem(0); > item.newValueSpecifiedUnits(item.unitType, item.value * 2); >diff --git a/LayoutTests/svg/dom/SVGLengthList-initialize-expected.txt b/LayoutTests/svg/dom/SVGLengthList-initialize-expected.txt >index 8c6fe2d2f81..9d9006e71df 100644 >--- a/LayoutTests/svg/dom/SVGLengthList-initialize-expected.txt >+++ b/LayoutTests/svg/dom/SVGLengthList-initialize-expected.txt >@@ -45,7 +45,8 @@ PASS text2.x.baseVal.getItem(1).value is 500 > PASS text2.x.baseVal.getItem(1).value is 50 > > Override the third text elements x list with the item x=50 from the second text element, where it should be removed afterwards >-PASS text3.x.baseVal.initialize(itemInAnotherList) is itemInAnotherList >+PASS text3.x.baseVal.initialize(itemInAnotherList) is text3.x.baseVal.getItem(0) >+PASS text2.x.baseVal.removeItem(1).toString() is "[object SVGLength]" > PASS text3.x.baseVal.getItem(0).value is 50 > PASS text2.x.baseVal.getItem(0).value is 50 > PASS text2.x.baseVal.getItem(1) threw exception IndexSizeError: The index is not in the allowed range.. >@@ -59,7 +60,8 @@ PASS itemInAnotherList.value is 50 > PASS text3.x.baseVal.getItem(0).value is 50 > > Move item from text3 to text4 >-PASS text4.x.baseVal.initialize(text3.x.baseVal.getItem(0)) is itemInAnotherList >+PASS text4.x.baseVal.initialize(text3.x.baseVal.getItem(0)) is text4.x.baseVal.getItem(0) >+PASS text3.x.baseVal.removeItem(0).toString() is "[object SVGLength]" > PASS text4.x.baseVal.getItem(0).value is 50 > PASS text3.x.baseVal.getItem(0) threw exception IndexSizeError: The index is not in the allowed range.. > >diff --git a/LayoutTests/svg/dom/SVGLengthList-initialize.xhtml b/LayoutTests/svg/dom/SVGLengthList-initialize.xhtml >index 63ebf3fa652..ed27d0445e8 100644 >--- a/LayoutTests/svg/dom/SVGLengthList-initialize.xhtml >+++ b/LayoutTests/svg/dom/SVGLengthList-initialize.xhtml >@@ -71,11 +71,12 @@ > itemInAnotherList.value = 50; > shouldBe("text2.x.baseVal.getItem(1).value", "50"); > >- // Spec: If the inserted item is already in a list, it is removed from its previous list before it is inserted into this list. >- // The inserted item is the item itself and not a copy. >+ // Spec: If the inserted item is already in a list, a copy of the item will be inserted. > debug(""); > debug("Override the third text elements x list with the item x=50 from the second text element, where it should be removed afterwards"); >- shouldBe("text3.x.baseVal.initialize(itemInAnotherList)", "itemInAnotherList"); >+ shouldBe("text3.x.baseVal.initialize(itemInAnotherList)", "text3.x.baseVal.getItem(0)"); >+ shouldBeEqualToString("text2.x.baseVal.removeItem(1).toString()", "[object SVGLength]"); >+ itemInAnotherList = text3.x.baseVal.getItem(0); > shouldBe("text3.x.baseVal.getItem(0).value", "50"); > shouldBe("text2.x.baseVal.getItem(0).value", "50"); > shouldThrow("text2.x.baseVal.getItem(1)"); >@@ -91,7 +92,8 @@ > > debug(""); > debug("Move item from text3 to text4"); >- shouldBe("text4.x.baseVal.initialize(text3.x.baseVal.getItem(0))", "itemInAnotherList"); >+ shouldBe("text4.x.baseVal.initialize(text3.x.baseVal.getItem(0))", "text4.x.baseVal.getItem(0)"); >+ shouldBeEqualToString("text3.x.baseVal.removeItem(0).toString()", "[object SVGLength]"); > shouldBe("text4.x.baseVal.getItem(0).value", "50"); > shouldThrow("text3.x.baseVal.getItem(0)"); > >diff --git a/LayoutTests/svg/dom/SVGLengthList-insertItemBefore-expected.txt b/LayoutTests/svg/dom/SVGLengthList-insertItemBefore-expected.txt >index 191f3464a1d..ba825bf1766 100644 >--- a/LayoutTests/svg/dom/SVGLengthList-insertItemBefore-expected.txt >+++ b/LayoutTests/svg/dom/SVGLengthList-insertItemBefore-expected.txt >@@ -62,7 +62,8 @@ PASS text1.x.baseVal.getItem(5).value is 50 > PASS text1.x.baseVal.getItem(6) threw exception IndexSizeError: The index is not in the allowed range.. > > Insert item 'newLength3' at position=1, between '100' and '500', remove it from the old position=2 afterwards. >-PASS text1.x.baseVal.insertItemBefore(newLength3, 1) is newLength3 >+PASS text1.x.baseVal.insertItemBefore(newLength3, 1) is text1.x.baseVal.getItem(1) >+PASS text1.x.baseVal.removeItem(3).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 6 > PASS text1.x.baseVal.getItem(0).value is 100 > PASS text1.x.baseVal.getItem(1).value is 150 >@@ -73,7 +74,8 @@ PASS text1.x.baseVal.getItem(5).value is 50 > PASS text1.x.baseVal.getItem(6) threw exception IndexSizeError: The index is not in the allowed range.. > > Insert item 'newLength3' at position=0, before '100', remove it from the old position=5 afterwards. >-PASS text1.x.baseVal.insertItemBefore(newLength1, 0) is newLength1 >+PASS text1.x.baseVal.insertItemBefore(newLength1, 0) is text1.x.baseVal.getItem(0) >+PASS text1.x.baseVal.removeItem(6).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 6 > PASS text1.x.baseVal.getItem(0).value is 50 > PASS text1.x.baseVal.getItem(1).value is 100 >diff --git a/LayoutTests/svg/dom/SVGLengthList-insertItemBefore.xhtml b/LayoutTests/svg/dom/SVGLengthList-insertItemBefore.xhtml >index e1dfe188a68..ac678ea59d8 100644 >--- a/LayoutTests/svg/dom/SVGLengthList-insertItemBefore.xhtml >+++ b/LayoutTests/svg/dom/SVGLengthList-insertItemBefore.xhtml >@@ -96,11 +96,11 @@ > shouldBe("text1.x.baseVal.getItem(5).value", "50"); > shouldThrow("text1.x.baseVal.getItem(6)"); > >- // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list. >- // Spec: If the item is already in this list, note that the index of the item to insert before is before the removal of the item. >+ // Spec: If newItem is already in a list, a clone of newItem inserted into this list. > debug(""); > debug("Insert item 'newLength3' at position=1, between '100' and '500', remove it from the old position=2 afterwards."); >- shouldBe("text1.x.baseVal.insertItemBefore(newLength3, 1)", "newLength3"); >+ shouldBe("text1.x.baseVal.insertItemBefore(newLength3, 1)", "text1.x.baseVal.getItem(1)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(3).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "6"); > shouldBe("text1.x.baseVal.getItem(0).value", "100"); > shouldBe("text1.x.baseVal.getItem(1).value", "150"); >@@ -112,7 +112,8 @@ > > debug(""); > debug("Insert item 'newLength3' at position=0, before '100', remove it from the old position=5 afterwards."); >- shouldBe("text1.x.baseVal.insertItemBefore(newLength1, 0)", "newLength1"); >+ shouldBe("text1.x.baseVal.insertItemBefore(newLength1, 0)", "text1.x.baseVal.getItem(0)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(6).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "6"); > shouldBe("text1.x.baseVal.getItem(0).value", "50"); > shouldBe("text1.x.baseVal.getItem(1).value", "100"); >diff --git a/LayoutTests/svg/dom/SVGLengthList-removeItem-expected.txt b/LayoutTests/svg/dom/SVGLengthList-removeItem-expected.txt >index d45a9940a34..e6a69d9a382 100644 >--- a/LayoutTests/svg/dom/SVGLengthList-removeItem-expected.txt >+++ b/LayoutTests/svg/dom/SVGLengthList-removeItem-expected.txt >@@ -27,7 +27,8 @@ PASS text2.x.baseVal.getItem(2).value is 1000 > PASS text2.x.baseVal.getItem(3) threw exception IndexSizeError: The index is not in the allowed range.. > > Append fourth item x=900 to the text1 x list >-PASS text1.x.baseVal.appendItem(text1.x.baseVal.getItem(3)) is text1.x.baseVal.getItem(4) >+PASS text1.x.baseVal.appendItem(text1.x.baseVal.getItem(3)) is text1.x.baseVal.getItem(5) >+PASS text1.x.baseVal.removeItem(3).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 5 > PASS text1.x.baseVal.getItem(0).value is 500 > PASS text1.x.baseVal.getItem(1).value is 50 >@@ -37,7 +38,8 @@ PASS text1.x.baseVal.getItem(4).value is 900 > PASS text1.x.baseVal.getItem(5) threw exception IndexSizeError: The index is not in the allowed range.. > > Append first item x=500 to the text1 x list >-PASS text1.x.baseVal.appendItem(text1.x.baseVal.getItem(0)) is text1.x.baseVal.getItem(4) >+PASS text1.x.baseVal.appendItem(text1.x.baseVal.getItem(0)) is text1.x.baseVal.getItem(5) >+PASS text1.x.baseVal.removeItem(0).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 5 > PASS text1.x.baseVal.getItem(0).value is 50 > PASS text1.x.baseVal.getItem(1).value is 100 >@@ -59,7 +61,9 @@ PASS text1.x.baseVal.getItem(6) threw exception IndexSizeError: The index is not > > Append third and fourth item of the text1 x list to the text2 x list > PASS text2.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value is 1000 >+PASS text1.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text2.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value is 900 >+PASS text1.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 4 > PASS text1.x.baseVal.getItem(0).value is 50 > PASS text1.x.baseVal.getItem(1).value is 100 >@@ -77,10 +81,14 @@ PASS newLength2.value is 150 > > Shuffle around items in text1 and text2 list using appendItem, to get x=50,100,150,... in both lists > PASS text1.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value is 500 >+PASS text1.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text2.x.baseVal.appendItem(newLength2).value is 150 > PASS text2.x.baseVal.appendItem(text2.x.baseVal.getItem(2)).value is 1000 >+PASS text2.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text2.x.baseVal.appendItem(text2.x.baseVal.getItem(3)).value is 900 >+PASS text2.x.baseVal.removeItem(3).toString() is "[object SVGLength]" > PASS text2.x.baseVal.appendItem(text2.x.baseVal.getItem(2)).value is 1000 >+PASS text2.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text1.x.baseVal.numberOfItems is 4 > PASS text1.x.baseVal.getItem(0).value is 50 > PASS text1.x.baseVal.getItem(1).value is 100 >diff --git a/LayoutTests/svg/dom/SVGLengthList-removeItem.xhtml b/LayoutTests/svg/dom/SVGLengthList-removeItem.xhtml >index 49ec802bee7..eb54b951250 100644 >--- a/LayoutTests/svg/dom/SVGLengthList-removeItem.xhtml >+++ b/LayoutTests/svg/dom/SVGLengthList-removeItem.xhtml >@@ -46,7 +46,8 @@ > > debug(""); > debug("Append fourth item x=900 to the text1 x list"); >- shouldBe("text1.x.baseVal.appendItem(text1.x.baseVal.getItem(3))", "text1.x.baseVal.getItem(4)"); >+ shouldBe("text1.x.baseVal.appendItem(text1.x.baseVal.getItem(3))", "text1.x.baseVal.getItem(5)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(3).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "5"); > shouldBe("text1.x.baseVal.getItem(0).value", "500"); > shouldBe("text1.x.baseVal.getItem(1).value", "50"); >@@ -57,7 +58,8 @@ > > debug(""); > debug("Append first item x=500 to the text1 x list"); >- shouldBe("text1.x.baseVal.appendItem(text1.x.baseVal.getItem(0))", "text1.x.baseVal.getItem(4)"); >+ shouldBe("text1.x.baseVal.appendItem(text1.x.baseVal.getItem(0))", "text1.x.baseVal.getItem(5)"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(0).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "5"); > shouldBe("text1.x.baseVal.getItem(0).value", "50"); > shouldBe("text1.x.baseVal.getItem(1).value", "100"); >@@ -81,7 +83,9 @@ > debug(""); > debug("Append third and fourth item of the text1 x list to the text2 x list"); > shouldBe("text2.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value", "1000"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text2.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value", "900"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "4"); > shouldBe("text1.x.baseVal.getItem(0).value", "50"); > shouldBe("text1.x.baseVal.getItem(1).value", "100"); >@@ -103,10 +107,14 @@ > debug(""); > debug("Shuffle around items in text1 and text2 list using appendItem, to get x=50,100,150,... in both lists"); > shouldBe("text1.x.baseVal.appendItem(text1.x.baseVal.getItem(2)).value", "500"); >+ shouldBeEqualToString("text1.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text2.x.baseVal.appendItem(newLength2).value", "150"); > shouldBe("text2.x.baseVal.appendItem(text2.x.baseVal.getItem(2)).value", "1000"); >+ shouldBeEqualToString("text2.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text2.x.baseVal.appendItem(text2.x.baseVal.getItem(3)).value", "900"); >+ shouldBeEqualToString("text2.x.baseVal.removeItem(3).toString()", "[object SVGLength]"); > shouldBe("text2.x.baseVal.appendItem(text2.x.baseVal.getItem(2)).value", "1000"); >+ shouldBeEqualToString("text2.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text1.x.baseVal.numberOfItems", "4"); > shouldBe("text1.x.baseVal.getItem(0).value", "50"); > shouldBe("text1.x.baseVal.getItem(1).value", "100"); >diff --git a/LayoutTests/svg/dom/SVGLengthList-replaceItem-expected.txt b/LayoutTests/svg/dom/SVGLengthList-replaceItem-expected.txt >index b1389167a18..5ba61032161 100644 >--- a/LayoutTests/svg/dom/SVGLengthList-replaceItem-expected.txt >+++ b/LayoutTests/svg/dom/SVGLengthList-replaceItem-expected.txt >@@ -46,6 +46,7 @@ PASS text2.x.baseVal.getItem(4) threw exception IndexSizeError: The index is not > > Replace the first item in text2 x list with the third item in the list > PASS text2.x.baseVal.replaceItem(text2.x.baseVal.getItem(2), 0).value is 50 >+PASS text2.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text2.x.baseVal.numberOfItems is 3 > PASS text2.x.baseVal.getItem(0).value is 50 > PASS text2.x.baseVal.getItem(1).value is 100 >@@ -70,6 +71,7 @@ PASS text4.x.baseVal.getItem(4) threw exception IndexSizeError: The index is not > > Replace the first item in text4 x list with the second item in the text3 x list > PASS text4.x.baseVal.replaceItem(text3.x.baseVal.getItem(1), 0).value is 50 >+PASS text3.x.baseVal.removeItem(1).toString() is "[object SVGLength]" > PASS text3.x.baseVal.numberOfItems is 4 > PASS text3.x.baseVal.getItem(0).value is 50 > PASS text3.x.baseVal.getItem(1).value is 100 >@@ -85,6 +87,7 @@ PASS text4.x.baseVal.getItem(4) threw exception IndexSizeError: The index is not > > Replace the second item in text4 x list with the second item in the text4 x list > PASS text4.x.baseVal.replaceItem(text3.x.baseVal.getItem(2), 1).value is 100 >+PASS text3.x.baseVal.removeItem(2).toString() is "[object SVGLength]" > PASS text4.x.baseVal.numberOfItems is 4 > PASS text4.x.baseVal.getItem(0).value is 50 > PASS text4.x.baseVal.getItem(1).value is 100 >diff --git a/LayoutTests/svg/dom/SVGLengthList-replaceItem.xhtml b/LayoutTests/svg/dom/SVGLengthList-replaceItem.xhtml >index b6824a4c9aa..cb74d43b159 100644 >--- a/LayoutTests/svg/dom/SVGLengthList-replaceItem.xhtml >+++ b/LayoutTests/svg/dom/SVGLengthList-replaceItem.xhtml >@@ -75,6 +75,7 @@ > debug(""); > debug("Replace the first item in text2 x list with the third item in the list"); > shouldBe("text2.x.baseVal.replaceItem(text2.x.baseVal.getItem(2), 0).value", "50"); >+ shouldBeEqualToString("text2.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text2.x.baseVal.numberOfItems", "3"); > shouldBe("text2.x.baseVal.getItem(0).value", "50"); > shouldBe("text2.x.baseVal.getItem(1).value", "100"); >@@ -102,6 +103,7 @@ > debug(""); > debug("Replace the first item in text4 x list with the second item in the text3 x list"); > shouldBe("text4.x.baseVal.replaceItem(text3.x.baseVal.getItem(1), 0).value", "50"); >+ shouldBeEqualToString("text3.x.baseVal.removeItem(1).toString()", "[object SVGLength]"); > shouldBe("text3.x.baseVal.numberOfItems", "4"); > shouldBe("text3.x.baseVal.getItem(0).value", "50"); > shouldBe("text3.x.baseVal.getItem(1).value", "100"); >@@ -118,6 +120,7 @@ > debug(""); > debug("Replace the second item in text4 x list with the second item in the text4 x list"); > shouldBe("text4.x.baseVal.replaceItem(text3.x.baseVal.getItem(2), 1).value", "100"); >+ shouldBeEqualToString("text3.x.baseVal.removeItem(2).toString()", "[object SVGLength]"); > shouldBe("text4.x.baseVal.numberOfItems", "4"); > shouldBe("text4.x.baseVal.getItem(0).value", "50"); > shouldBe("text4.x.baseVal.getItem(1).value", "100"); >diff --git a/LayoutTests/svg/dom/SVGNumberList-basics-expected.txt b/LayoutTests/svg/dom/SVGNumberList-basics-expected.txt >index 9414957e7ab..6098ae2bed6 100644 >--- a/LayoutTests/svg/dom/SVGNumberList-basics-expected.txt >+++ b/LayoutTests/svg/dom/SVGNumberList-basics-expected.txt >@@ -26,24 +26,28 @@ PASS text1.rotate.baseVal.insertItemBefore('aString') threw exception TypeError: > PASS text1.rotate.baseVal.insertItemBefore(text1) threw exception TypeError: Not enough arguments. > PASS text1.rotate.baseVal.insertItemBefore(null) threw exception TypeError: Not enough arguments. > PASS text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), 'aString') is text1.rotate.baseVal.getItem(0) >+PASS text1.rotate.baseVal.removeItem(2).toString() is "[object SVGNumber]" > PASS text1.rotate.baseVal.numberOfItems is 3 > PASS text1.rotate.baseVal.getItem(0).value is 180 > PASS text1.rotate.baseVal.getItem(1).value is 90 > PASS text1.rotate.baseVal.getItem(2).value is 270 > PASS text1.getAttribute('rotate') is "180 90 270" > PASS text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), text1) is text1.rotate.baseVal.getItem(0) >+PASS text1.rotate.baseVal.removeItem(2).toString() is "[object SVGNumber]" > PASS text1.rotate.baseVal.numberOfItems is 3 > PASS text1.rotate.baseVal.getItem(0).value is 90 > PASS text1.rotate.baseVal.getItem(1).value is 180 > PASS text1.rotate.baseVal.getItem(2).value is 270 > PASS text1.getAttribute('rotate') is "90 180 270" > PASS text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), null) is text1.rotate.baseVal.getItem(0) >+PASS text1.rotate.baseVal.removeItem(2).toString() is "[object SVGNumber]" > PASS text1.rotate.baseVal.numberOfItems is 3 > PASS text1.rotate.baseVal.getItem(0).value is 180 > PASS text1.rotate.baseVal.getItem(1).value is 90 > PASS text1.rotate.baseVal.getItem(2).value is 270 > PASS text1.getAttribute('rotate') is "180 90 270" > PASS text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), 0) is text1.rotate.baseVal.getItem(0) >+PASS text1.rotate.baseVal.removeItem(2).toString() is "[object SVGNumber]" > PASS text1.rotate.baseVal.numberOfItems is 3 > PASS text1.rotate.baseVal.getItem(0).value is 90 > PASS text1.rotate.baseVal.getItem(1).value is 180 >diff --git a/LayoutTests/svg/dom/SVGNumberList-basics.xhtml b/LayoutTests/svg/dom/SVGNumberList-basics.xhtml >index cc4a96eeeca..d91a3428bfe 100644 >--- a/LayoutTests/svg/dom/SVGNumberList-basics.xhtml >+++ b/LayoutTests/svg/dom/SVGNumberList-basics.xhtml >@@ -47,6 +47,7 @@ > shouldThrow("text1.rotate.baseVal.insertItemBefore(null)"); > > shouldBe("text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), 'aString')", "text1.rotate.baseVal.getItem(0)"); >+ shouldBeEqualToString("text1.rotate.baseVal.removeItem(2).toString()", "[object SVGNumber]"); > shouldBe("text1.rotate.baseVal.numberOfItems", "3"); > shouldBe("text1.rotate.baseVal.getItem(0).value", "180"); > shouldBe("text1.rotate.baseVal.getItem(1).value", "90"); >@@ -54,6 +55,7 @@ > shouldBeEqualToString("text1.getAttribute('rotate')", "180 90 270"); > > shouldBe("text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), text1)", "text1.rotate.baseVal.getItem(0)"); >+ shouldBeEqualToString("text1.rotate.baseVal.removeItem(2).toString()", "[object SVGNumber]"); > shouldBe("text1.rotate.baseVal.numberOfItems", "3"); > shouldBe("text1.rotate.baseVal.getItem(0).value", "90"); > shouldBe("text1.rotate.baseVal.getItem(1).value", "180"); >@@ -61,6 +63,7 @@ > shouldBeEqualToString("text1.getAttribute('rotate')", "90 180 270"); > > shouldBe("text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), null)", "text1.rotate.baseVal.getItem(0)"); >+ shouldBeEqualToString("text1.rotate.baseVal.removeItem(2).toString()", "[object SVGNumber]"); > shouldBe("text1.rotate.baseVal.numberOfItems", "3"); > shouldBe("text1.rotate.baseVal.getItem(0).value", "180"); > shouldBe("text1.rotate.baseVal.getItem(1).value", "90"); >@@ -68,6 +71,7 @@ > shouldBeEqualToString("text1.getAttribute('rotate')", "180 90 270"); > > shouldBe("text1.rotate.baseVal.insertItemBefore(text1.rotate.baseVal.getItem(1), 0)", "text1.rotate.baseVal.getItem(0)"); >+ shouldBeEqualToString("text1.rotate.baseVal.removeItem(2).toString()", "[object SVGNumber]"); > shouldBe("text1.rotate.baseVal.numberOfItems", "3"); > shouldBe("text1.rotate.baseVal.getItem(0).value", "90"); > shouldBe("text1.rotate.baseVal.getItem(1).value", "180"); >diff --git a/LayoutTests/svg/dom/SVGPathSegList-appendItem-expected.txt b/LayoutTests/svg/dom/SVGPathSegList-appendItem-expected.txt >index 833738d73f2..44da68abd64 100644 >--- a/LayoutTests/svg/dom/SVGPathSegList-appendItem-expected.txt >+++ b/LayoutTests/svg/dom/SVGPathSegList-appendItem-expected.txt >@@ -36,9 +36,11 @@ PASS path2.pathSegList.getItem(3).x = -path2.pathSegList.getItem(3).x is -100 > > Swap segment four and five of path2 - now should look like a rectangle > PASS path2.pathSegList.appendItem(path2.pathSegList.getItem(3)).toString() is "[object SVGPathSegLinetoHorizontalRel]" >+PASS path2.pathSegList.removeItem(3).toString() is "[object SVGPathSegLinetoHorizontalRel]" > > Append second item from path2 to path1 list > PASS path1.pathSegList.appendItem(path2.pathSegList.getItem(1)).toString() is "[object SVGPathSegLinetoAbs]" >+PASS path2.pathSegList.removeItem(1).toString() is "[object SVGPathSegLinetoAbs]" > > Change last item of path1 list, that came from path2 list, assure it's updating path1 > PASS path1.pathSegList.getItem(3).x -= 50 is 0 >diff --git a/LayoutTests/svg/dom/SVGPathSegList-appendItem.xhtml b/LayoutTests/svg/dom/SVGPathSegList-appendItem.xhtml >index be5dd7f49ea..d5d899c8470 100644 >--- a/LayoutTests/svg/dom/SVGPathSegList-appendItem.xhtml >+++ b/LayoutTests/svg/dom/SVGPathSegList-appendItem.xhtml >@@ -57,10 +57,12 @@ > debug("") > debug("Swap segment four and five of path2 - now should look like a rectangle"); > shouldBeEqualToString("path2.pathSegList.appendItem(path2.pathSegList.getItem(3)).toString()", "[object SVGPathSegLinetoHorizontalRel]"); >+ shouldBeEqualToString("path2.pathSegList.removeItem(3).toString()", "[object SVGPathSegLinetoHorizontalRel]"); > > debug(""); > debug("Append second item from path2 to path1 list"); > shouldBeEqualToString("path1.pathSegList.appendItem(path2.pathSegList.getItem(1)).toString()", "[object SVGPathSegLinetoAbs]"); >+ shouldBeEqualToString("path2.pathSegList.removeItem(1).toString()", "[object SVGPathSegLinetoAbs]"); > > debug(""); > debug("Change last item of path1 list, that came from path2 list, assure it's updating path1"); >diff --git a/LayoutTests/svg/dom/SVGPathSegList-clear-and-initialize-expected.txt b/LayoutTests/svg/dom/SVGPathSegList-clear-and-initialize-expected.txt >index 2875461d992..1ea17b70a62 100644 >--- a/LayoutTests/svg/dom/SVGPathSegList-clear-and-initialize-expected.txt >+++ b/LayoutTests/svg/dom/SVGPathSegList-clear-and-initialize-expected.txt >@@ -59,6 +59,7 @@ PASS path2.pathSegList.getItem(2).y is 0 > > Initialize path1 list with first item of path2 > PASS path1.pathSegList.initialize(path2.pathSegList.getItem(0)).toString() is "[object SVGPathSegMovetoAbs]" >+PASS path2.pathSegList.removeItem(0).toString() is "[object SVGPathSegMovetoAbs]" > > Check intermediate list state of path1 > PASS path1.pathSegList.numberOfItems is 1 >diff --git a/LayoutTests/svg/dom/SVGPathSegList-clear-and-initialize.xhtml b/LayoutTests/svg/dom/SVGPathSegList-clear-and-initialize.xhtml >index f61654518e7..ae5aa071c86 100644 >--- a/LayoutTests/svg/dom/SVGPathSegList-clear-and-initialize.xhtml >+++ b/LayoutTests/svg/dom/SVGPathSegList-clear-and-initialize.xhtml >@@ -85,6 +85,7 @@ > debug(""); > debug("Initialize path1 list with first item of path2"); > shouldBeEqualToString("path1.pathSegList.initialize(path2.pathSegList.getItem(0)).toString()", "[object SVGPathSegMovetoAbs]"); >+ shouldBeEqualToString("path2.pathSegList.removeItem(0).toString()", "[object SVGPathSegMovetoAbs]"); > > debug(""); > debug("Check intermediate list state of path1"); >diff --git a/LayoutTests/svg/dom/SVGPathSegList-insertItemBefore-expected.txt b/LayoutTests/svg/dom/SVGPathSegList-insertItemBefore-expected.txt >index ca43b3de6c8..7767d124a75 100644 >--- a/LayoutTests/svg/dom/SVGPathSegList-insertItemBefore-expected.txt >+++ b/LayoutTests/svg/dom/SVGPathSegList-insertItemBefore-expected.txt >@@ -21,6 +21,7 @@ PASS path1.pathSegList.getItem(3).y is 100 > > Insert fourth item at position three using insertItemBefore() > PASS path1.pathSegList.insertItemBefore(path1.pathSegList.getItem(3), 2).toString() is "[object SVGPathSegLinetoAbs]" >+PASS path1.pathSegList.removeItem(4).toString() is "[object SVGPathSegLinetoAbs]" > > Check final 'pathSegList' value of path1 > PASS path1.pathSegList.numberOfItems is 4 >diff --git a/LayoutTests/svg/dom/SVGPathSegList-insertItemBefore.xhtml b/LayoutTests/svg/dom/SVGPathSegList-insertItemBefore.xhtml >index f1e390d1101..c87bc94f9f8 100644 >--- a/LayoutTests/svg/dom/SVGPathSegList-insertItemBefore.xhtml >+++ b/LayoutTests/svg/dom/SVGPathSegList-insertItemBefore.xhtml >@@ -38,6 +38,7 @@ > debug(""); > debug("Insert fourth item at position three using insertItemBefore()"); > shouldBeEqualToString("path1.pathSegList.insertItemBefore(path1.pathSegList.getItem(3), 2).toString()", "[object SVGPathSegLinetoAbs]"); >+ shouldBeEqualToString("path1.pathSegList.removeItem(4).toString()", "[object SVGPathSegLinetoAbs]"); > > debug(""); > debug("Check final 'pathSegList' value of path1"); >diff --git a/LayoutTests/svg/dom/SVGPathSegList-replaceItem-expected.txt b/LayoutTests/svg/dom/SVGPathSegList-replaceItem-expected.txt >index 6b982aacfc7..a785ef2b41d 100644 >--- a/LayoutTests/svg/dom/SVGPathSegList-replaceItem-expected.txt >+++ b/LayoutTests/svg/dom/SVGPathSegList-replaceItem-expected.txt >@@ -39,9 +39,11 @@ PASS path2.pathSegList.getItem(3).x is -100 > > Replace second item with third item of path1 > PASS path1.pathSegList.replaceItem(path1.pathSegList.getItem(2), 1).toString() is "[object SVGPathSegLinetoAbs]" >+PASS path1.pathSegList.removeItem(2).toString() is "[object SVGPathSegLinetoAbs]" > > Replace third item of path2 with fourth item of path1 > PASS path2.pathSegList.replaceItem(path1.pathSegList.getItem(3), 2).toString() is "[object SVGPathSegLinetoVerticalRel]" >+PASS path1.pathSegList.removeItem(3).toString() is "[object SVGPathSegLinetoVerticalRel]" > > Check final 'pathSegList' value of path1 > PASS path1.pathSegList.numberOfItems is 4 >diff --git a/LayoutTests/svg/dom/SVGPathSegList-replaceItem.xhtml b/LayoutTests/svg/dom/SVGPathSegList-replaceItem.xhtml >index 7fbfa872d2a..e8b403c4beb 100644 >--- a/LayoutTests/svg/dom/SVGPathSegList-replaceItem.xhtml >+++ b/LayoutTests/svg/dom/SVGPathSegList-replaceItem.xhtml >@@ -59,10 +59,12 @@ > debug(""); > debug("Replace second item with third item of path1"); > shouldBeEqualToString("path1.pathSegList.replaceItem(path1.pathSegList.getItem(2), 1).toString()", "[object SVGPathSegLinetoAbs]"); >+ shouldBeEqualToString("path1.pathSegList.removeItem(2).toString()", "[object SVGPathSegLinetoAbs]"); > > debug(""); > debug("Replace third item of path2 with fourth item of path1"); > shouldBeEqualToString("path2.pathSegList.replaceItem(path1.pathSegList.getItem(3), 2).toString()", "[object SVGPathSegLinetoVerticalRel]"); >+ shouldBeEqualToString("path1.pathSegList.removeItem(3).toString()", "[object SVGPathSegLinetoVerticalRel]"); > > debug(""); > debug("Check final 'pathSegList' value of path1"); >diff --git a/LayoutTests/svg/dom/SVGPointList-basics-expected.txt b/LayoutTests/svg/dom/SVGPointList-basics-expected.txt >index 6f6efdd9394..f12477f9880 100644 >--- a/LayoutTests/svg/dom/SVGPointList-basics-expected.txt >+++ b/LayoutTests/svg/dom/SVGPointList-basics-expected.txt >@@ -45,6 +45,7 @@ PASS poly1.points.insertItemBefore('aString') threw exception TypeError: Not eno > PASS poly1.points.insertItemBefore(poly1) threw exception TypeError: Not enough arguments. > PASS poly1.points.insertItemBefore(null) threw exception TypeError: Not enough arguments. > PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), 'aString')) is "x=100 y=0" >+PASS dumpPoint(poly1.points.removeItem(2, 'aString')) is "x=100 y=0" > PASS poly1.points.numberOfItems is 4 > PASS dumpPoint(poly1.points.getItem(0)) is "x=100 y=0" > PASS dumpPoint(poly1.points.getItem(1)) is "x=0 y=0" >@@ -52,6 +53,7 @@ PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100" > PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100" > PASS poly1.getAttribute('points').formatPointsAttribute() is "100 0 0 0 100 100 0 100" > PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), poly1)) is "x=0 y=0" >+PASS dumpPoint(poly1.points.removeItem(2, 'aString')) is "x=0 y=0" > PASS poly1.points.numberOfItems is 4 > PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0" > PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=0" >@@ -59,12 +61,14 @@ PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100" > PASS dumpPoint(poly1.points.getItem(3)) is "x=0 y=100" > PASS poly1.getAttribute('points').formatPointsAttribute() is "0 0 100 0 100 100 0 100" > PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), null)) is "x=100 y=0" >+PASS dumpPoint(poly1.points.removeItem(2, 'aString')) is "x=100 y=0" > PASS poly1.points.numberOfItems is 4 > PASS dumpPoint(poly1.points.getItem(0)) is "x=100 y=0" > PASS dumpPoint(poly1.points.getItem(1)) is "x=0 y=0" > PASS dumpPoint(poly1.points.getItem(2)) is "x=100 y=100" > PASS poly1.getAttribute('points').formatPointsAttribute() is "100 0 0 0 100 100 0 100" > PASS dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), 0)) is "x=0 y=0" >+PASS dumpPoint(poly1.points.removeItem(2, 'aString')) is "x=0 y=0" > PASS poly1.points.numberOfItems is 4 > PASS dumpPoint(poly1.points.getItem(0)) is "x=0 y=0" > PASS dumpPoint(poly1.points.getItem(1)) is "x=100 y=0" >diff --git a/LayoutTests/svg/dom/SVGPointList-basics.xhtml b/LayoutTests/svg/dom/SVGPointList-basics.xhtml >index a0663983319..f09bfc70268 100644 >--- a/LayoutTests/svg/dom/SVGPointList-basics.xhtml >+++ b/LayoutTests/svg/dom/SVGPointList-basics.xhtml >@@ -77,14 +77,16 @@ > shouldThrow("poly1.points.insertItemBefore(null)"); > > shouldBeEqualToString("dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), 'aString'))", "x=100 y=0"); >+ shouldBeEqualToString("dumpPoint(poly1.points.removeItem(2, 'aString'))", "x=100 y=0"); > shouldBe("poly1.points.numberOfItems", "4"); > shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=100 y=0"); > shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=0 y=0"); > shouldBeEqualToString("dumpPoint(poly1.points.getItem(2))", "x=100 y=100"); > shouldBeEqualToString("dumpPoint(poly1.points.getItem(3))", "x=0 y=100"); > shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "100 0 0 0 100 100 0 100"); >- >+ > shouldBeEqualToString("dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), poly1))", "x=0 y=0"); >+ shouldBeEqualToString("dumpPoint(poly1.points.removeItem(2, 'aString'))", "x=0 y=0"); > shouldBe("poly1.points.numberOfItems", "4"); > shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=0 y=0"); > shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=100 y=0"); >@@ -93,20 +95,22 @@ > shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "0 0 100 0 100 100 0 100"); > > shouldBeEqualToString("dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), null))", "x=100 y=0"); >+ shouldBeEqualToString("dumpPoint(poly1.points.removeItem(2, 'aString'))", "x=100 y=0"); > shouldBe("poly1.points.numberOfItems", "4"); > shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=100 y=0"); > shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=0 y=0"); > shouldBeEqualToString("dumpPoint(poly1.points.getItem(2))", "x=100 y=100"); > shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "100 0 0 0 100 100 0 100"); >- >+ > shouldBeEqualToString("dumpPoint(poly1.points.insertItemBefore(poly1.points.getItem(1), 0))", "x=0 y=0"); >+ shouldBeEqualToString("dumpPoint(poly1.points.removeItem(2, 'aString'))", "x=0 y=0"); > shouldBe("poly1.points.numberOfItems", "4"); > shouldBeEqualToString("dumpPoint(poly1.points.getItem(0))", "x=0 y=0"); > shouldBeEqualToString("dumpPoint(poly1.points.getItem(1))", "x=100 y=0"); > shouldBeEqualToString("dumpPoint(poly1.points.getItem(2))", "x=100 y=100"); > shouldBeEqualToString("dumpPoint(poly1.points.getItem(3))", "x=0 y=100"); > shouldBeEqualToString("poly1.getAttribute('points').formatPointsAttribute()", "0 0 100 0 100 100 0 100"); >- >+ > shouldThrow("poly1.points.insertItemBefore(30, 0)"); > shouldThrow("poly1.points.insertItemBefore('aString', 0)"); > shouldThrow("poly1.points.insertItemBefore(poly1, 0)"); >diff --git a/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt b/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt >index 3ce005eaa4d..f234daf5c00 100644 >--- a/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt >+++ b/LayoutTests/svg/dom/SVGTransformList-basics-expected.txt >@@ -27,21 +27,25 @@ PASS circle1.transform.baseVal.insertItemBefore('aString') threw exception TypeE > PASS circle1.transform.baseVal.insertItemBefore(circle1) threw exception TypeError: Not enough arguments. > PASS circle1.transform.baseVal.insertItemBefore(null) threw exception TypeError: Not enough arguments. > PASS circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), 'aString') is circle1.transform.baseVal.getItem(0) >+PASS dumpTransform(circle1.transform.baseVal.removeItem(2)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]" > PASS circle1.transform.baseVal.numberOfItems is 2 > PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]" > PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]" > PASS circle1.getAttribute('transform') is "translate(10 10) scale(2 2)" > PASS circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), circle1) is circle1.transform.baseVal.getItem(0) >+PASS dumpTransform(circle1.transform.baseVal.removeItem(2)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]" > PASS circle1.transform.baseVal.numberOfItems is 2 > PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]" > PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]" > PASS circle1.getAttribute('transform') is "scale(2 2) translate(10 10)" > PASS circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), null) is circle1.transform.baseVal.getItem(0) >+PASS dumpTransform(circle1.transform.baseVal.removeItem(2)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]" > PASS circle1.transform.baseVal.numberOfItems is 2 > PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]" > PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]" > PASS circle1.getAttribute('transform') is "translate(10 10) scale(2 2)" > PASS circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), 0) is circle1.transform.baseVal.getItem(0) >+PASS dumpTransform(circle1.transform.baseVal.removeItem(2)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]" > PASS circle1.transform.baseVal.numberOfItems is 2 > PASS dumpTransform(circle1.transform.baseVal.getItem(0)) is "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]" > PASS dumpTransform(circle1.transform.baseVal.getItem(1)) is "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]" >diff --git a/LayoutTests/svg/dom/SVGTransformList-basics.xhtml b/LayoutTests/svg/dom/SVGTransformList-basics.xhtml >index fd2cafa689b..1f932c1e07f 100644 >--- a/LayoutTests/svg/dom/SVGTransformList-basics.xhtml >+++ b/LayoutTests/svg/dom/SVGTransformList-basics.xhtml >@@ -74,24 +74,28 @@ > shouldThrow("circle1.transform.baseVal.insertItemBefore(null)"); > > shouldBe("circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), 'aString')", "circle1.transform.baseVal.getItem(0)"); >+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.removeItem(2))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"); > shouldBe("circle1.transform.baseVal.numberOfItems", "2"); > shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"); > shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"); > shouldBeEqualToString("circle1.getAttribute('transform')", "translate(10 10) scale(2 2)"); > > shouldBe("circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), circle1)", "circle1.transform.baseVal.getItem(0)"); >+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.removeItem(2))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"); > shouldBe("circle1.transform.baseVal.numberOfItems", "2"); > shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"); > shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"); > shouldBeEqualToString("circle1.getAttribute('transform')", "scale(2 2) translate(10 10)"); > > shouldBe("circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), null)", "circle1.transform.baseVal.getItem(0)"); >+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.removeItem(2))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"); > shouldBe("circle1.transform.baseVal.numberOfItems", "2"); > shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"); > shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"); > shouldBeEqualToString("circle1.getAttribute('transform')", "translate(10 10) scale(2 2)"); > > shouldBe("circle1.transform.baseVal.insertItemBefore(circle1.transform.baseVal.getItem(1), 0)", "circle1.transform.baseVal.getItem(0)"); >+ shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.removeItem(2))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"); > shouldBe("circle1.transform.baseVal.numberOfItems", "2"); > shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(0))", "type=SVG_TRANSFORM_SCALE matrix=[2.0 0.0 0.0 2.0 0.0 0.0]"); > shouldBeEqualToString("dumpTransform(circle1.transform.baseVal.getItem(1))", "type=SVG_TRANSFORM_TRANSLATE matrix=[1.0 0.0 0.0 1.0 10.0 10.0]"); >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ff73f217f12..6b988f7e0c4 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,1481 @@ >+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 patch is for EWS to ensure nothing is broken because of splitting >+ it into smaller patches. >+ >+ * Sources.txt: >+ * WebCore.xcodeproj/project.pbxproj: >+ * accessibility/AccessibilitySVGElement.cpp: >+ (WebCore::AccessibilitySVGElement::targetForUseElement const): >+ * bindings/js/JSSVGPathSegCustom.cpp: >+ * bindings/scripts/CodeGenerator.pm: >+ (IsSVGPathSegTypeName): >+ (IsSVGPathSegType): >+ (AttributeNameForGetterAndSetter): >+ * bindings/scripts/CodeGeneratorJS.pm: >+ (GenerateHeader): >+ * 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/SVGAElement.cpp: >+ (WebCore::SVGAElement::SVGAElement): >+ (WebCore::SVGAElement::parseAttribute): >+ (WebCore::SVGAElement::svgAttributeChanged): >+ (WebCore::SVGAElement::defaultEventHandler): >+ (WebCore::SVGAElement::registerAttributes): Deleted. >+ * svg/SVGAElement.h: >+ * svg/SVGAltGlyphElement.h: >+ * svg/SVGAngle.h: >+ (WebCore::SVGAngle::create): >+ (WebCore::SVGAngle::unitType): >+ (WebCore::SVGAngle::setValueForBindings): >+ (WebCore::SVGAngle::valueForBindings): >+ (WebCore::SVGAngle::setValueInSpecifiedUnits): >+ (WebCore::SVGAngle::valueInSpecifiedUnits): >+ (WebCore::SVGAngle::setValueAsString): >+ (WebCore::SVGAngle::newValueSpecifiedUnits): >+ (WebCore::SVGAngle::convertToSpecifiedUnits): >+ (WebCore::SVGAngle::valueAsString): Deleted. >+ (WebCore::SVGAngle::SVGAngle): Deleted. >+ * svg/SVGAngleValue.h: >+ (WebCore::SVGPropertyTraits<SVGAngleValue>::initialValue): Deleted. >+ (WebCore::SVGPropertyTraits<SVGAngleValue>::toString): Deleted. >+ * svg/SVGAnimateColorElement.cpp: >+ (WebCore::attributeValueIsCurrentColor): Deleted. >+ (WebCore::SVGAnimateColorElement::determinePropertyValueTypes): Deleted. >+ * svg/SVGAnimateColorElement.h: >+ * svg/SVGAnimateElementBase.cpp: >+ (WebCore::SVGAnimateElementBase::SVGAnimateElementBase): >+ (WebCore::SVGAnimateElementBase::setTargetElement): >+ (WebCore::SVGAnimateElementBase::setAttributeName): >+ (WebCore::SVGAnimateElementBase::createAnimator const): >+ (WebCore::SVGAnimateElementBase::resetAnimation): >+ (WebCore::SVGAnimateElementBase::hasValidAttributeType const): >+ (WebCore::SVGAnimateElementBase::isDiscreteAnimator const): >+ (WebCore::SVGAnimateElementBase::calculateFromAndToValues): >+ (WebCore::SVGAnimateElementBase::calculateFromAndByValues): >+ (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue): >+ (WebCore::SVGAnimateElementBase::resetAnimatedType): >+ (WebCore::SVGAnimateElementBase::calculateAnimatedValue): >+ (WebCore::SVGAnimateElementBase::applyResultsToTarget): >+ (WebCore::SVGAnimateElementBase::clearAnimatedType): >+ (WebCore::SVGAnimateElementBase::isTargetAttributeCSSProperty): >+ (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const): >+ (WebCore::SVGAnimateElementBase::calculateDistance): >+ (WebCore::SVGAnimateElementBase::hasValidAttributeType): Deleted. >+ (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const): Deleted. >+ (WebCore::propertyTypesAreConsistent): Deleted. >+ (WebCore::applyCSSPropertyToTarget): Deleted. >+ (WebCore::removeCSSPropertyFromTarget): Deleted. >+ (WebCore::applyCSSPropertyToTargetAndInstances): Deleted. >+ (WebCore::removeCSSPropertyFromTargetAndInstances): Deleted. >+ (WebCore::notifyTargetAboutAnimValChange): Deleted. >+ (WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted. >+ (WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition const): Deleted. >+ (WebCore::SVGAnimateElementBase::isAdditive const): Deleted. >+ (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): Deleted. >+ (WebCore::SVGAnimateElementBase::ensureAnimator): Deleted. >+ * svg/SVGAnimateElementBase.h: >+ (WebCore::SVGAnimateElementBase::animateRangeString const): >+ * svg/SVGAnimateMotionElement.cpp: >+ (WebCore::SVGAnimateMotionElement::hasValidAttributeType const): >+ (WebCore::SVGAnimateMotionElement::hasValidAttributeName const): >+ (WebCore::SVGAnimateMotionElement::calculateFromAndByValues): >+ (WebCore::SVGAnimateMotionElement::calculateAnimatedValue): >+ (WebCore::SVGAnimateMotionElement::updateAnimationMode): >+ (WebCore::SVGAnimateMotionElement::hasValidAttributeType): Deleted. >+ (WebCore::SVGAnimateMotionElement::hasValidAttributeName): Deleted. >+ * svg/SVGAnimateMotionElement.h: >+ * svg/SVGAnimateTransformElement.cpp: >+ (WebCore::SVGAnimateTransformElement::hasValidAttributeType const): >+ (WebCore::SVGAnimateTransformElement::animateRangeString const): >+ (WebCore::SVGAnimateTransformElement::hasValidAttributeType): Deleted. >+ * svg/SVGAnimateTransformElement.h: >+ * svg/SVGAnimatedAngle.cpp: Removed. >+ * svg/SVGAnimatedAngle.h: Removed. >+ * svg/SVGAnimatedBoolean.cpp: Removed. >+ * svg/SVGAnimatedBoolean.h: Removed. >+ * svg/SVGAnimatedColor.cpp: Removed. >+ * svg/SVGAnimatedColor.h: Removed. >+ * svg/SVGAnimatedEnumeration.cpp: Removed. >+ * svg/SVGAnimatedEnumeration.h: Removed. >+ * svg/SVGAnimatedInteger.cpp: Removed. >+ * svg/SVGAnimatedInteger.h: Removed. >+ * svg/SVGAnimatedIntegerOptionalInteger.cpp: Removed. >+ * svg/SVGAnimatedIntegerOptionalInteger.h: Removed. >+ * svg/SVGAnimatedLength.cpp: Removed. >+ * svg/SVGAnimatedLength.h: Removed. >+ * svg/SVGAnimatedLengthList.cpp: Removed. >+ * svg/SVGAnimatedLengthList.h: Removed. >+ * svg/SVGAnimatedNumber.cpp: Removed. >+ * svg/SVGAnimatedNumber.h: Removed. >+ * svg/SVGAnimatedNumberList.cpp: Removed. >+ * svg/SVGAnimatedNumberList.h: Removed. >+ * svg/SVGAnimatedNumberOptionalNumber.cpp: Removed. >+ * svg/SVGAnimatedNumberOptionalNumber.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/SVGAnimatedRect.cpp: Removed. >+ * svg/SVGAnimatedRect.h: Removed. >+ * svg/SVGAnimatedString.cpp: Removed. >+ * svg/SVGAnimatedString.h: Removed. >+ * svg/SVGAnimatedTransformList.cpp: Removed. >+ * svg/SVGAnimatedTransformList.h: Removed. >+ * svg/SVGAnimatedType.h: Removed. >+ * svg/SVGAnimatedTypeAnimator.cpp: Removed. >+ * svg/SVGAnimatedTypeAnimator.h: Removed. >+ * svg/SVGAnimationElement.cpp: >+ (WebCore::SVGAnimationElement::updateAnimationMode): >+ (WebCore::SVGAnimationElement::setAttributeType): >+ (WebCore::SVGAnimationElement::isAdditive const): >+ (WebCore::SVGAnimationElement::isAccumulated const): >+ (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced): >+ (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): >+ (WebCore::SVGAnimationElement::startedActiveInterval): >+ (WebCore::SVGAnimationElement::updateAnimation): >+ (WebCore::inheritsFromProperty): >+ (WebCore::SVGAnimationElement::resetAnimation): >+ (WebCore::SVGAnimationElement::isTargetAttributeCSSProperty): Deleted. >+ (WebCore::SVGAnimationElement::shouldApplyAnimation): Deleted. >+ (WebCore::SVGAnimationElement::computeCSSPropertyValue): Deleted. >+ (WebCore::SVGAnimationElement::adjustForInheritance): Deleted. >+ (WebCore::SVGAnimationElement::resetAnimatedPropertyType): Deleted. >+ (WebCore::SVGAnimationElement::setTargetElement): Deleted. >+ (WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Deleted. >+ * svg/SVGAnimationElement.h: >+ (WebCore::SVGAnimationElement::animateAdditiveNumber): >+ (WebCore::SVGAnimationElement::adjustForInheritance): Deleted. >+ (WebCore::SVGAnimationElement::adjustFromToListValues): Deleted. >+ (WebCore::SVGAnimationElement::animateDiscreteType): Deleted. >+ (WebCore::SVGAnimationElement::attributeRegistry): Deleted. >+ (WebCore::SVGAnimationElement::hasInvalidCSSAttributeType const): Deleted. >+ * svg/SVGCircleElement.cpp: >+ (WebCore::SVGCircleElement::SVGCircleElement): >+ (WebCore::SVGCircleElement::parseAttribute): >+ (WebCore::SVGCircleElement::svgAttributeChanged): >+ (WebCore::SVGCircleElement::registerAttributes): Deleted. >+ * svg/SVGCircleElement.h: >+ * svg/SVGClipPathElement.cpp: >+ (WebCore::SVGClipPathElement::SVGClipPathElement): >+ (WebCore::SVGClipPathElement::parseAttribute): >+ (WebCore::SVGClipPathElement::svgAttributeChanged): >+ (WebCore::SVGClipPathElement::registerAttributes): Deleted. >+ * svg/SVGClipPathElement.h: >+ * svg/SVGComponentTransferFunctionElement.cpp: >+ (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement): >+ (WebCore::SVGComponentTransferFunctionElement::parseAttribute): >+ (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged): >+ (WebCore::SVGComponentTransferFunctionElement::transferFunction const): >+ (WebCore::SVGComponentTransferFunctionElement::registerAttributes): Deleted. >+ * svg/SVGComponentTransferFunctionElement.h: >+ (WebCore::SVGComponentTransferFunctionElement::type const): >+ (WebCore::SVGComponentTransferFunctionElement::tableValues const): >+ (WebCore::SVGComponentTransferFunctionElement::slope const): >+ (WebCore::SVGComponentTransferFunctionElement::intercept const): >+ (WebCore::SVGComponentTransferFunctionElement::amplitude const): >+ (WebCore::SVGComponentTransferFunctionElement::exponent const): >+ (WebCore::SVGComponentTransferFunctionElement::offset const): >+ (WebCore::SVGComponentTransferFunctionElement::type): >+ (WebCore::SVGComponentTransferFunctionElement::tableValues): >+ (WebCore::SVGComponentTransferFunctionElement::slope): >+ (WebCore::SVGComponentTransferFunctionElement::intercept): >+ (WebCore::SVGComponentTransferFunctionElement::amplitude): >+ (WebCore::SVGComponentTransferFunctionElement::exponent): >+ (WebCore::SVGComponentTransferFunctionElement::offset): >+ (WebCore::SVGComponentTransferFunctionElement::typeAnimated): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::tableValuesAnimated): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::slopeAnimated): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::interceptAnimated): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::amplitudeAnimated): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::exponentAnimated): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::offsetAnimated): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::attributeRegistry): Deleted. >+ (WebCore::SVGComponentTransferFunctionElement::isKnownAttribute): Deleted. >+ * svg/SVGCursorElement.cpp: >+ (WebCore::SVGCursorElement::SVGCursorElement): >+ (WebCore::SVGCursorElement::parseAttribute): >+ (WebCore::SVGCursorElement::svgAttributeChanged): >+ (WebCore::SVGCursorElement::registerAttributes): Deleted. >+ * svg/SVGCursorElement.h: >+ * svg/SVGDefsElement.h: >+ * svg/SVGElement.cpp: >+ (WebCore::SVGElement::SVGElement): >+ (WebCore::SVGElement::~SVGElement): >+ (WebCore::SVGElement::parseAttribute): >+ (WebCore::SVGElement::haveLoadedRequiredResources const): >+ (WebCore::SVGElement::synchronizeAttribute): >+ (WebCore::SVGElement::synchronizeAllAttributes): >+ (WebCore::SVGElement::commitPropertyChange): >+ (WebCore::SVGElement::isAnimatedPropertyAttribute const): >+ (WebCore::SVGElement::isAnimatedAttribute const): >+ (WebCore::SVGElement::isAnimatedStyleAttribute const): >+ (WebCore::SVGElement::createAnimator): >+ (WebCore::SVGElement::svgAttributeChanged): >+ (WebCore::createAttributeNameToAnimatedPropertyTypeMap): Deleted. >+ (WebCore::attributeNameToAnimatedPropertyTypeMap): Deleted. >+ (WebCore::createCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted. >+ (WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted. >+ (WebCore::SVGElement::registerAttributes): Deleted. >+ (WebCore::SVGElement::animatedPropertyTypesForAttribute): Deleted. >+ (WebCore::SVGElement::haveLoadedRequiredResources): Deleted. >+ (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute): Deleted. >+ (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): Deleted. >+ (WebCore::SVGElement::isAnimatableAttribute const): Deleted. >+ (WebCore::SVGElement::filterOutAnimatableAttribute const): Deleted. >+ (WebCore::SVGElement::isAnimatableCSSProperty): Deleted. >+ (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Deleted. >+ * svg/SVGElement.h: >+ (WebCore::SVGElement::propertyRegistry const): >+ (WebCore::SVGElement::propertyAnimatorCreator): >+ (WebCore::SVGElement::className const): >+ (WebCore::SVGElement::className): >+ (WebCore::SVGElement::attributeRegistry): Deleted. >+ (WebCore::SVGElement::isKnownAttribute): Deleted. >+ (WebCore::SVGElement::attributeOwnerProxy const): Deleted. >+ (WebCore::SVGElement::synchronizeAttribute): Deleted. >+ (WebCore::SVGElement::synchronizeAttributes): Deleted. >+ (WebCore::SVGElement::animatedTypes const): Deleted. >+ (WebCore::SVGElement::lookupAnimatedProperty const): Deleted. >+ (WebCore::SVGElement::lookupOrCreateAnimatedProperty): Deleted. >+ (WebCore::SVGElement::lookupOrCreateAnimatedProperties): Deleted. >+ (WebCore::SVGElement::classNameAnimated): Deleted. >+ * svg/SVGEllipseElement.cpp: >+ (WebCore::SVGEllipseElement::SVGEllipseElement): >+ (WebCore::SVGEllipseElement::parseAttribute): >+ (WebCore::SVGEllipseElement::svgAttributeChanged): >+ (WebCore::SVGEllipseElement::registerAttributes): Deleted. >+ * svg/SVGEllipseElement.h: >+ * svg/SVGExternalResourcesRequired.cpp: >+ (WebCore::SVGExternalResourcesRequired::SVGExternalResourcesRequired): >+ (WebCore::SVGExternalResourcesRequired::parseAttribute): >+ (WebCore::SVGExternalResourcesRequired::svgAttributeChanged): >+ (WebCore::SVGExternalResourcesRequired::dispatchLoadEvent): >+ (WebCore::SVGExternalResourcesRequired::insertedIntoDocument): >+ (WebCore::SVGExternalResourcesRequired::finishParsingChildren): >+ (WebCore::SVGExternalResourcesRequired::haveLoadedRequiredResources const): >+ (WebCore::SVGExternalResourcesRequired::registerAttributes): Deleted. >+ * svg/SVGExternalResourcesRequired.h: >+ (WebCore::SVGExternalResourcesRequired::externalResourcesRequired const): >+ (WebCore::SVGExternalResourcesRequired::externalResourcesRequired): >+ (WebCore::SVGExternalResourcesRequired::isKnownAttribute): >+ (WebCore::SVGExternalResourcesRequired::attributeRegistry): Deleted. >+ (WebCore::SVGExternalResourcesRequired::externalResourcesRequiredAnimated): Deleted. >+ (WebCore::SVGExternalResourcesRequired::setExternalResourcesRequired): Deleted. >+ (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy): Deleted. >+ * svg/SVGFEBlendElement.cpp: >+ (WebCore::SVGFEBlendElement::SVGFEBlendElement): >+ (WebCore::SVGFEBlendElement::parseAttribute): >+ (WebCore::SVGFEBlendElement::setFilterEffectAttribute const): >+ (WebCore::SVGFEBlendElement::build const): >+ (WebCore::SVGFEBlendElement::registerAttributes): Deleted. >+ (WebCore::SVGFEBlendElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFEBlendElement::build): Deleted. >+ * svg/SVGFEBlendElement.h: >+ (WebCore::SVGPropertyTraits<BlendMode>::fromString): >+ * svg/SVGFEColorMatrixElement.cpp: >+ (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement): >+ (WebCore::SVGFEColorMatrixElement::parseAttribute): >+ (WebCore::SVGFEColorMatrixElement::setFilterEffectAttribute const): >+ (WebCore::SVGFEColorMatrixElement::build const): >+ (WebCore::SVGFEColorMatrixElement::registerAttributes): Deleted. >+ (WebCore::SVGFEColorMatrixElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFEColorMatrixElement::build): Deleted. >+ * svg/SVGFEColorMatrixElement.h: >+ * svg/SVGFEComponentTransferElement.cpp: >+ (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement): >+ (WebCore::SVGFEComponentTransferElement::parseAttribute): >+ (WebCore::SVGFEComponentTransferElement::build const): >+ (WebCore::SVGFEComponentTransferElement::registerAttributes): Deleted. >+ (WebCore::SVGFEComponentTransferElement::build): Deleted. >+ * svg/SVGFEComponentTransferElement.h: >+ * svg/SVGFECompositeElement.cpp: >+ (WebCore::SVGFECompositeElement::SVGFECompositeElement): >+ (WebCore::SVGFECompositeElement::parseAttribute): >+ (WebCore::SVGFECompositeElement::setFilterEffectAttribute const): >+ (WebCore::SVGFECompositeElement::build const): >+ (WebCore::SVGFECompositeElement::registerAttributes): Deleted. >+ (WebCore::SVGFECompositeElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFECompositeElement::build): Deleted. >+ * svg/SVGFECompositeElement.h: >+ * svg/SVGFEConvolveMatrixElement.cpp: >+ (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement): >+ (WebCore::SVGFEConvolveMatrixElement::parseAttribute): >+ (WebCore::SVGFEConvolveMatrixElement::setFilterEffectAttribute const): >+ (WebCore::SVGFEConvolveMatrixElement::setOrder): >+ (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength): >+ (WebCore::SVGFEConvolveMatrixElement::build const): >+ (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier): Deleted. >+ (WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier): Deleted. >+ (WebCore::SVGFEConvolveMatrixElement::orderXIdentifier): Deleted. >+ (WebCore::SVGFEConvolveMatrixElement::orderYIdentifier): Deleted. >+ (WebCore::SVGFEConvolveMatrixElement::registerAttributes): Deleted. >+ (WebCore::SVGFEConvolveMatrixElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFEConvolveMatrixElement::build): Deleted. >+ * svg/SVGFEConvolveMatrixElement.h: >+ * svg/SVGFEDiffuseLightingElement.cpp: >+ (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement): >+ (WebCore::SVGFEDiffuseLightingElement::parseAttribute): >+ (WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute const): >+ (WebCore::SVGFEDiffuseLightingElement::build const): >+ (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier): Deleted. >+ (WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier): Deleted. >+ (WebCore::SVGFEDiffuseLightingElement::registerAttributes): Deleted. >+ (WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFEDiffuseLightingElement::build): Deleted. >+ * svg/SVGFEDiffuseLightingElement.h: >+ * svg/SVGFEDisplacementMapElement.cpp: >+ (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement): >+ (WebCore::SVGFEDisplacementMapElement::parseAttribute): >+ (WebCore::SVGFEDisplacementMapElement::setFilterEffectAttribute const): >+ (WebCore::SVGFEDisplacementMapElement::build const): >+ (WebCore::SVGFEDisplacementMapElement::registerAttributes): Deleted. >+ (WebCore::SVGFEDisplacementMapElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFEDisplacementMapElement::build): Deleted. >+ * svg/SVGFEDisplacementMapElement.h: >+ * svg/SVGFEDropShadowElement.cpp: >+ (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement): >+ (WebCore::SVGFEDropShadowElement::setStdDeviation): >+ (WebCore::SVGFEDropShadowElement::parseAttribute): >+ (WebCore::SVGFEDropShadowElement::svgAttributeChanged): >+ (WebCore::SVGFEDropShadowElement::build const): >+ (WebCore::SVGFEDropShadowElement::stdDeviationXIdentifier): Deleted. >+ (WebCore::SVGFEDropShadowElement::stdDeviationYIdentifier): Deleted. >+ (WebCore::SVGFEDropShadowElement::registerAttributes): Deleted. >+ (WebCore::SVGFEDropShadowElement::build): Deleted. >+ * svg/SVGFEDropShadowElement.h: >+ * svg/SVGFEFloodElement.cpp: >+ (WebCore::SVGFEFloodElement::setFilterEffectAttribute const): >+ (WebCore::SVGFEFloodElement::build const): >+ (WebCore::SVGFEFloodElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFEFloodElement::build): Deleted. >+ * svg/SVGFEFloodElement.h: >+ * svg/SVGFEGaussianBlurElement.cpp: >+ (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement): >+ (WebCore::SVGFEGaussianBlurElement::setStdDeviation): >+ (WebCore::SVGFEGaussianBlurElement::parseAttribute): >+ (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged): >+ (WebCore::SVGFEGaussianBlurElement::build const): >+ (WebCore::SVGFEGaussianBlurElement::stdDeviationXIdentifier): Deleted. >+ (WebCore::SVGFEGaussianBlurElement::stdDeviationYIdentifier): Deleted. >+ (WebCore::SVGFEGaussianBlurElement::registerAttributes): Deleted. >+ (WebCore::SVGFEGaussianBlurElement::build): Deleted. >+ * svg/SVGFEGaussianBlurElement.h: >+ * svg/SVGFEImageElement.cpp: >+ (WebCore::SVGFEImageElement::SVGFEImageElement): >+ (WebCore::SVGFEImageElement::requestImageResource): >+ (WebCore::SVGFEImageElement::buildPendingResource): >+ (WebCore::SVGFEImageElement::parseAttribute): >+ (WebCore::SVGFEImageElement::build const): >+ (WebCore::SVGFEImageElement::registerAttributes): Deleted. >+ (WebCore::SVGFEImageElement::build): Deleted. >+ * svg/SVGFEImageElement.h: >+ * svg/SVGFELightElement.cpp: >+ (WebCore::SVGFELightElement::SVGFELightElement): >+ (WebCore::SVGFELightElement::parseAttribute): >+ (WebCore::SVGFELightElement::svgAttributeChanged): >+ (WebCore::SVGFELightElement::registerAttributes): Deleted. >+ * svg/SVGFELightElement.h: >+ (WebCore::SVGFELightElement::azimuth const): >+ (WebCore::SVGFELightElement::elevation const): >+ (WebCore::SVGFELightElement::x const): >+ (WebCore::SVGFELightElement::y const): >+ (WebCore::SVGFELightElement::z const): >+ (WebCore::SVGFELightElement::pointsAtX const): >+ (WebCore::SVGFELightElement::pointsAtY const): >+ (WebCore::SVGFELightElement::pointsAtZ const): >+ (WebCore::SVGFELightElement::specularExponent const): >+ (WebCore::SVGFELightElement::limitingConeAngle const): >+ (WebCore::SVGFELightElement::azimuth): >+ (WebCore::SVGFELightElement::elevation): >+ (WebCore::SVGFELightElement::x): >+ (WebCore::SVGFELightElement::y): >+ (WebCore::SVGFELightElement::z): >+ (WebCore::SVGFELightElement::pointsAtX): >+ (WebCore::SVGFELightElement::pointsAtY): >+ (WebCore::SVGFELightElement::pointsAtZ): >+ (WebCore::SVGFELightElement::specularExponent): >+ (WebCore::SVGFELightElement::limitingConeAngle): >+ (WebCore::SVGFELightElement::azimuthAnimated): Deleted. >+ (WebCore::SVGFELightElement::elevationAnimated): Deleted. >+ (WebCore::SVGFELightElement::xAnimated): Deleted. >+ (WebCore::SVGFELightElement::yAnimated): Deleted. >+ (WebCore::SVGFELightElement::zAnimated): Deleted. >+ (WebCore::SVGFELightElement::pointsAtXAnimated): Deleted. >+ (WebCore::SVGFELightElement::pointsAtYAnimated): Deleted. >+ (WebCore::SVGFELightElement::pointsAtZAnimated): Deleted. >+ (WebCore::SVGFELightElement::specularExponentAnimated): Deleted. >+ (WebCore::SVGFELightElement::limitingConeAngleAnimated): Deleted. >+ (WebCore::SVGFELightElement::attributeRegistry): Deleted. >+ (WebCore::SVGFELightElement::isKnownAttribute): Deleted. >+ * svg/SVGFEMergeElement.cpp: >+ (WebCore::SVGFEMergeElement::build const): >+ (WebCore::SVGFEMergeElement::build): Deleted. >+ * svg/SVGFEMergeElement.h: >+ * svg/SVGFEMergeNodeElement.cpp: >+ (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement): >+ (WebCore::SVGFEMergeNodeElement::parseAttribute): >+ (WebCore::SVGFEMergeNodeElement::registerAttributes): Deleted. >+ * svg/SVGFEMergeNodeElement.h: >+ * svg/SVGFEMorphologyElement.cpp: >+ (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement): >+ (WebCore::SVGFEMorphologyElement::setRadius): >+ (WebCore::SVGFEMorphologyElement::parseAttribute): >+ (WebCore::SVGFEMorphologyElement::setFilterEffectAttribute const): >+ (WebCore::SVGFEMorphologyElement::build const): >+ (WebCore::SVGFEMorphologyElement::radiusXIdentifier): Deleted. >+ (WebCore::SVGFEMorphologyElement::radiusYIdentifier): Deleted. >+ (WebCore::SVGFEMorphologyElement::registerAttributes): Deleted. >+ (WebCore::SVGFEMorphologyElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFEMorphologyElement::build): Deleted. >+ * svg/SVGFEMorphologyElement.h: >+ * svg/SVGFEOffsetElement.cpp: >+ (WebCore::SVGFEOffsetElement::SVGFEOffsetElement): >+ (WebCore::SVGFEOffsetElement::parseAttribute): >+ (WebCore::SVGFEOffsetElement::svgAttributeChanged): >+ (WebCore::SVGFEOffsetElement::build const): >+ (WebCore::SVGFEOffsetElement::registerAttributes): Deleted. >+ (WebCore::SVGFEOffsetElement::build): Deleted. >+ * svg/SVGFEOffsetElement.h: >+ * svg/SVGFESpecularLightingElement.cpp: >+ (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement): >+ (WebCore::SVGFESpecularLightingElement::parseAttribute): >+ (WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute const): >+ (WebCore::SVGFESpecularLightingElement::build const): >+ (WebCore::SVGFESpecularLightingElement::kernelUnitLengthXIdentifier): Deleted. >+ (WebCore::SVGFESpecularLightingElement::kernelUnitLengthYIdentifier): Deleted. >+ (WebCore::SVGFESpecularLightingElement::registerAttributes): Deleted. >+ (WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFESpecularLightingElement::build): Deleted. >+ * svg/SVGFESpecularLightingElement.h: >+ * svg/SVGFETileElement.cpp: >+ (WebCore::SVGFETileElement::SVGFETileElement): >+ (WebCore::SVGFETileElement::parseAttribute): >+ (WebCore::SVGFETileElement::build const): >+ (WebCore::SVGFETileElement::registerAttributes): Deleted. >+ (WebCore::SVGFETileElement::build): Deleted. >+ * svg/SVGFETileElement.h: >+ * svg/SVGFETurbulenceElement.cpp: >+ (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement): >+ (WebCore::SVGFETurbulenceElement::parseAttribute): >+ (WebCore::SVGFETurbulenceElement::setFilterEffectAttribute const): >+ (WebCore::SVGFETurbulenceElement::svgAttributeChanged): >+ (WebCore::SVGFETurbulenceElement::build const): >+ (WebCore::SVGFETurbulenceElement::baseFrequencyXIdentifier): Deleted. >+ (WebCore::SVGFETurbulenceElement::baseFrequencyYIdentifier): Deleted. >+ (WebCore::SVGFETurbulenceElement::registerAttributes): Deleted. >+ (WebCore::SVGFETurbulenceElement::setFilterEffectAttribute): Deleted. >+ (WebCore::SVGFETurbulenceElement::build): Deleted. >+ * svg/SVGFETurbulenceElement.h: >+ * svg/SVGFilterElement.cpp: >+ (WebCore::SVGFilterElement::SVGFilterElement): >+ (WebCore::SVGFilterElement::parseAttribute): >+ (WebCore::SVGFilterElement::svgAttributeChanged): >+ (WebCore::SVGFilterElement::registerAttributes): Deleted. >+ * svg/SVGFilterElement.h: >+ * svg/SVGFilterPrimitiveStandardAttributes.cpp: >+ (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::setFilterEffectAttribute const): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes): Deleted. >+ (WebCore::SVGFilterPrimitiveStandardAttributes::setFilterEffectAttribute): Deleted. >+ * svg/SVGFilterPrimitiveStandardAttributes.h: >+ (WebCore::SVGFilterPrimitiveStandardAttributes::x const): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::y const): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::width const): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::height const): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::result const): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::x): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::y): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::width): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::height): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::result): >+ (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry): Deleted. >+ (WebCore::SVGFilterPrimitiveStandardAttributes::xAnimated): Deleted. >+ (WebCore::SVGFilterPrimitiveStandardAttributes::yAnimated): Deleted. >+ (WebCore::SVGFilterPrimitiveStandardAttributes::widthAnimated): Deleted. >+ (WebCore::SVGFilterPrimitiveStandardAttributes::heightAnimated): Deleted. >+ (WebCore::SVGFilterPrimitiveStandardAttributes::resultAnimated): Deleted. >+ (WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute): Deleted. >+ * svg/SVGFitToViewBox.cpp: >+ (WebCore::SVGFitToViewBox::SVGFitToViewBox): >+ (WebCore::SVGFitToViewBox::setViewBox): >+ (WebCore::SVGFitToViewBox::resetViewBox): >+ (WebCore::SVGFitToViewBox::parseViewBox): >+ (WebCore::SVGFitToViewBox::registerAttributes): Deleted. >+ * svg/SVGFitToViewBox.h: >+ (WebCore::SVGFitToViewBox::viewBox const): >+ (WebCore::SVGFitToViewBox::preserveAspectRatio const): >+ (WebCore::SVGFitToViewBox::viewBox): >+ (WebCore::SVGFitToViewBox::preserveAspectRatio): >+ (WebCore::SVGFitToViewBox::setPreserveAspectRatio): >+ (WebCore::SVGFitToViewBox::resetPreserveAspectRatio): >+ (WebCore::SVGFitToViewBox::viewBoxString const): >+ (WebCore::SVGFitToViewBox::preserveAspectRatioString const): >+ (WebCore::SVGFitToViewBox::isKnownAttribute): >+ (WebCore::SVGFitToViewBox::attributeRegistry): Deleted. >+ (WebCore::SVGFitToViewBox::viewBoxAnimated): Deleted. >+ (WebCore::SVGFitToViewBox::preserveAspectRatioAnimated): Deleted. >+ * svg/SVGFontElement.h: >+ * svg/SVGForeignObjectElement.cpp: >+ (WebCore::SVGForeignObjectElement::SVGForeignObjectElement): >+ (WebCore::SVGForeignObjectElement::parseAttribute): >+ (WebCore::SVGForeignObjectElement::registerAttributes): Deleted. >+ * svg/SVGForeignObjectElement.h: >+ * svg/SVGGElement.h: >+ * svg/SVGGeometryElement.cpp: >+ (WebCore::SVGGeometryElement::SVGGeometryElement): >+ (WebCore::SVGGeometryElement::parseAttribute): >+ (WebCore::SVGGeometryElement::registerAttributes): Deleted. >+ * svg/SVGGeometryElement.h: >+ (WebCore::SVGGeometryElement::pathLength const): >+ (WebCore::SVGGeometryElement::pathLength): >+ (WebCore::SVGGeometryElement::attributeRegistry): Deleted. >+ (WebCore::SVGGeometryElement::pathLengthAnimated): Deleted. >+ (WebCore::SVGGeometryElement::isKnownAttribute): Deleted. >+ * svg/SVGGlyphRefElement.h: >+ * svg/SVGGradientElement.cpp: >+ (WebCore::SVGGradientElement::SVGGradientElement): >+ (WebCore::SVGGradientElement::parseAttribute): >+ (WebCore::SVGGradientElement::buildStops const): >+ (WebCore::SVGGradientElement::registerAttributes): Deleted. >+ (WebCore::SVGGradientElement::buildStops): Deleted. >+ * svg/SVGGradientElement.h: >+ (WebCore::SVGGradientElement::spreadMethod const): >+ (WebCore::SVGGradientElement::gradientUnits const): >+ (WebCore::SVGGradientElement::gradientTransform const): >+ (WebCore::SVGGradientElement::spreadMethod): >+ (WebCore::SVGGradientElement::gradientUnits): >+ (WebCore::SVGGradientElement::gradientTransform): >+ (WebCore::SVGGradientElement::isKnownAttribute): >+ (WebCore::SVGGradientElement::attributeRegistry): Deleted. >+ (WebCore::SVGGradientElement::spreadMethodAnimated): Deleted. >+ (WebCore::SVGGradientElement::gradientUnitsAnimated): Deleted. >+ (WebCore::SVGGradientElement::gradientTransformAnimated): Deleted. >+ * svg/SVGGraphicsElement.cpp: >+ (WebCore::SVGGraphicsElement::SVGGraphicsElement): >+ (WebCore::SVGGraphicsElement::parseAttribute): >+ (WebCore::SVGGraphicsElement::svgAttributeChanged): >+ (WebCore::SVGGraphicsElement::toClipPath const): >+ (WebCore::SVGGraphicsElement::registerAttributes): Deleted. >+ (WebCore::SVGGraphicsElement::toClipPath): Deleted. >+ * svg/SVGGraphicsElement.h: >+ (WebCore::SVGGraphicsElement::transform const): >+ (WebCore::SVGGraphicsElement::transform): >+ (WebCore::SVGGraphicsElement::attributeRegistry): Deleted. >+ (WebCore::SVGGraphicsElement::transformAnimated): Deleted. >+ (WebCore::SVGGraphicsElement::isKnownAttribute): Deleted. >+ * svg/SVGImageElement.cpp: >+ (WebCore::SVGImageElement::SVGImageElement): >+ (WebCore::SVGImageElement::parseAttribute): >+ (WebCore::SVGImageElement::haveLoadedRequiredResources const): >+ (WebCore::SVGImageElement::registerAttributes): Deleted. >+ (WebCore::SVGImageElement::haveLoadedRequiredResources): Deleted. >+ * svg/SVGImageElement.h: >+ * svg/SVGImageLoader.cpp: >+ (WebCore::SVGImageLoader::dispatchLoadEvent): >+ * svg/SVGLangSpace.cpp: >+ (WebCore::SVGLangSpace::SVGLangSpace): >+ (WebCore::SVGLangSpace::isKnownAttribute): >+ (WebCore::SVGLangSpace::xmlspace const): >+ (WebCore::SVGLangSpace::svgAttributeChanged): >+ (WebCore::SVGLangSpace::registerAttributes): Deleted. >+ * svg/SVGLangSpace.h: >+ (WebCore::SVGLangSpace::xmllang const): >+ (WebCore::SVGLangSpace::setXmllang): >+ (WebCore::SVGLangSpace::setXmlspace): >+ (WebCore::SVGLangSpace::attributeRegistry): Deleted. >+ (WebCore::SVGLangSpace::isKnownAttribute): Deleted. >+ * svg/SVGLength.h: >+ (WebCore::SVGLength::create): >+ (WebCore::SVGLength::clone const): >+ (WebCore::SVGLength::unitType): >+ (WebCore::SVGLength::valueForBindings): >+ (WebCore::SVGLength::setValueForBindings): >+ (WebCore::SVGLength::valueInSpecifiedUnits): >+ (WebCore::SVGLength::setValueInSpecifiedUnits): >+ (WebCore::SVGLength::setValueAsString): >+ (WebCore::SVGLength::newValueSpecifiedUnits): >+ (WebCore::SVGLength::convertToSpecifiedUnits): >+ (WebCore::SVGLength::valueAsString): Deleted. >+ (WebCore::SVGLength::SVGLength): Deleted. >+ * svg/SVGLengthList.h: >+ (WebCore::SVGLengthList::create): >+ (WebCore::SVGLengthList::lengthMode const): >+ (WebCore::SVGLengthList::parse): >+ (WebCore::SVGLengthList::SVGLengthList): >+ * svg/SVGLengthListValues.cpp: Removed. >+ * svg/SVGLengthListValues.h: Removed. >+ * svg/SVGLineElement.cpp: >+ (WebCore::SVGLineElement::SVGLineElement): >+ (WebCore::SVGLineElement::parseAttribute): >+ (WebCore::SVGLineElement::svgAttributeChanged): >+ (WebCore::SVGLineElement::registerAttributes): Deleted. >+ * svg/SVGLineElement.h: >+ * svg/SVGLinearGradientElement.cpp: >+ (WebCore::SVGLinearGradientElement::SVGLinearGradientElement): >+ (WebCore::SVGLinearGradientElement::parseAttribute): >+ (WebCore::SVGLinearGradientElement::svgAttributeChanged): >+ (WebCore::setGradientAttributes): >+ (WebCore::SVGLinearGradientElement::collectGradientAttributes): >+ (WebCore::SVGLinearGradientElement::registerAttributes): Deleted. >+ * svg/SVGLinearGradientElement.h: >+ * svg/SVGMPathElement.cpp: >+ (WebCore::SVGMPathElement::buildPendingResource): >+ (WebCore::SVGMPathElement::pathElement const): >+ (WebCore::SVGMPathElement::pathElement): Deleted. >+ * svg/SVGMPathElement.h: >+ * svg/SVGMarkerElement.cpp: >+ (WebCore::SVGMarkerElement::SVGMarkerElement): >+ (WebCore::SVGMarkerElement::parseAttribute): >+ (WebCore::SVGMarkerElement::svgAttributeChanged): >+ (WebCore::SVGMarkerElement::setOrient): >+ (WebCore::SVGMarkerElement::setOrientToAngle): >+ (WebCore::SVGMarkerElement::orientTypeIdentifier): Deleted. >+ (WebCore::SVGMarkerElement::orientAngleIdentifier): Deleted. >+ (WebCore::SVGMarkerElement::registerAttributes): Deleted. >+ * svg/SVGMarkerElement.h: >+ * svg/SVGMarkerTypes.h: >+ (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::autoString): >+ (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::autoStartReverseString): >+ (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString): >+ (WebCore::SVGPropertyTraits<SVGMarkerOrientType>::toString): >+ * svg/SVGMaskElement.cpp: >+ (WebCore::SVGMaskElement::SVGMaskElement): >+ (WebCore::SVGMaskElement::parseAttribute): >+ (WebCore::SVGMaskElement::svgAttributeChanged): >+ (WebCore::SVGMaskElement::registerAttributes): Deleted. >+ * svg/SVGMaskElement.h: >+ * svg/SVGMatrix.h: >+ (WebCore::SVGMatrix::create): >+ (WebCore::SVGMatrix::a): >+ (WebCore::SVGMatrix::setA): >+ (WebCore::SVGMatrix::b): >+ (WebCore::SVGMatrix::setB): >+ (WebCore::SVGMatrix::c): >+ (WebCore::SVGMatrix::setC): >+ (WebCore::SVGMatrix::d): >+ (WebCore::SVGMatrix::setD): >+ (WebCore::SVGMatrix::e): >+ (WebCore::SVGMatrix::setE): >+ (WebCore::SVGMatrix::f): >+ (WebCore::SVGMatrix::setF): >+ (WebCore::SVGMatrix::multiply const): >+ (WebCore::SVGMatrix::inverse const): >+ (WebCore::SVGMatrix::translate const): >+ (WebCore::SVGMatrix::scale const): >+ (WebCore::SVGMatrix::scaleNonUniform const): >+ (WebCore::SVGMatrix::rotate const): >+ (WebCore::SVGMatrix::rotateFromVector const): >+ (WebCore::SVGMatrix::flipX const): >+ (WebCore::SVGMatrix::flipY const): >+ (WebCore::SVGMatrix::skewX const): >+ (WebCore::SVGMatrix::skewY const): >+ (WebCore::SVGMatrix::multiply): Deleted. >+ (WebCore::SVGMatrix::inverse): Deleted. >+ (WebCore::SVGMatrix::translate): Deleted. >+ (WebCore::SVGMatrix::scale): Deleted. >+ (WebCore::SVGMatrix::scaleNonUniform): Deleted. >+ (WebCore::SVGMatrix::rotate): Deleted. >+ (WebCore::SVGMatrix::rotateFromVector): Deleted. >+ (WebCore::SVGMatrix::flipX): Deleted. >+ (WebCore::SVGMatrix::flipY): Deleted. >+ (WebCore::SVGMatrix::skewX): Deleted. >+ (WebCore::SVGMatrix::skewY): Deleted. >+ (WebCore::SVGMatrix::SVGMatrix): Deleted. >+ * svg/SVGMatrix.idl: >+ * svg/SVGMatrixValue.h: Removed. >+ * svg/SVGNumber.h: >+ (WebCore::SVGNumber::create): >+ (WebCore::SVGNumber::clone const): >+ (WebCore::SVGNumber::valueForBindings): >+ (WebCore::SVGNumber::setValueForBindings): >+ (WebCore::SVGNumber::SVGNumber): Deleted. >+ * svg/SVGNumberList.h: >+ (WebCore::SVGNumberList::create): >+ (WebCore::SVGNumberList::parse): >+ (WebCore::SVGNumberList::SVGNumberList): Deleted. >+ * svg/SVGNumberListValues.cpp: Removed. >+ * svg/SVGNumberListValues.h: Removed. >+ * svg/SVGParserUtilities.cpp: >+ (WebCore::pointsListFromSVGData): Deleted. >+ * svg/SVGPathElement.cpp: >+ (WebCore::SVGPathElement::SVGPathElement): >+ (WebCore::SVGPathElement::parseAttribute): >+ (WebCore::SVGPathElement::svgAttributeChanged): >+ (WebCore::SVGPathElement::createSVGPathSegClosePath): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegMovetoAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegMovetoRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegLinetoAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegLinetoRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegArcAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegArcRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs): Deleted. >+ (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel): Deleted. >+ (WebCore::SVGPathElement::registerAttributes): Deleted. >+ (WebCore::SVGPathElement::pathByteStream const): Deleted. >+ (WebCore::SVGPathElement::pathForByteStream const): Deleted. >+ (WebCore::SVGPathElement::lookupOrCreateDWrapper): Deleted. >+ (WebCore::SVGPathElement::animatedPropertyWillBeDeleted): Deleted. >+ (WebCore::SVGPathElement::pathSegList): Deleted. >+ (WebCore::SVGPathElement::normalizedPathSegList): Deleted. >+ (WebCore::SVGPathElement::animatedPathSegList): Deleted. >+ (WebCore::SVGPathElement::animatedNormalizedPathSegList): Deleted. >+ (WebCore::SVGPathElement::approximateMemoryCost const): Deleted. >+ (WebCore::SVGPathElement::pathSegListChanged): Deleted. >+ * svg/SVGPathElement.h: >+ * svg/SVGPathSeg.h: >+ * svg/SVGPathSegArc.h: Removed. >+ * svg/SVGPathSegArcAbs.h: Removed. >+ * svg/SVGPathSegArcRel.h: Removed. >+ * svg/SVGPathSegClosePath.h: Removed. >+ * svg/SVGPathSegCurvetoCubic.h: Removed. >+ * svg/SVGPathSegCurvetoCubicAbs.h: Removed. >+ * svg/SVGPathSegCurvetoCubicRel.h: Removed. >+ * svg/SVGPathSegCurvetoCubicSmooth.h: Removed. >+ * svg/SVGPathSegCurvetoCubicSmoothAbs.h: Removed. >+ * svg/SVGPathSegCurvetoCubicSmoothRel.h: Removed. >+ * svg/SVGPathSegCurvetoQuadratic.h: Removed. >+ * svg/SVGPathSegCurvetoQuadraticAbs.h: Removed. >+ * svg/SVGPathSegCurvetoQuadraticRel.h: Removed. >+ * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h: Removed. >+ * svg/SVGPathSegCurvetoQuadraticSmoothRel.h: Removed. >+ * svg/SVGPathSegImpl.h: Added. >+ * svg/SVGPathSegLinetoAbs.h: Removed. >+ * svg/SVGPathSegLinetoHorizontal.h: Removed. >+ * svg/SVGPathSegLinetoHorizontalAbs.h: Removed. >+ * svg/SVGPathSegLinetoHorizontalRel.h: Removed. >+ * svg/SVGPathSegLinetoRel.h: Removed. >+ * svg/SVGPathSegLinetoVertical.h: Removed. >+ * svg/SVGPathSegLinetoVerticalAbs.h: Removed. >+ * svg/SVGPathSegLinetoVerticalRel.h: Removed. >+ * svg/SVGPathSegList.cpp: Removed. >+ * svg/SVGPathSegList.h: >+ * svg/SVGPathSegListBuilder.cpp: >+ (WebCore::SVGPathSegListBuilder::SVGPathSegListBuilder): >+ (WebCore::SVGPathSegListBuilder::moveTo): >+ (WebCore::SVGPathSegListBuilder::lineTo): >+ (WebCore::SVGPathSegListBuilder::lineToHorizontal): >+ (WebCore::SVGPathSegListBuilder::lineToVertical): >+ (WebCore::SVGPathSegListBuilder::curveToCubic): >+ (WebCore::SVGPathSegListBuilder::curveToCubicSmooth): >+ (WebCore::SVGPathSegListBuilder::curveToQuadratic): >+ (WebCore::SVGPathSegListBuilder::curveToQuadraticSmooth): >+ (WebCore::SVGPathSegListBuilder::arcTo): >+ (WebCore::SVGPathSegListBuilder::closePath): >+ * svg/SVGPathSegListBuilder.h: >+ * svg/SVGPathSegListSource.cpp: >+ (WebCore::SVGPathSegListSource::SVGPathSegListSource): >+ * svg/SVGPathSegListSource.h: >+ * svg/SVGPathSegListValues.cpp: Removed. >+ * svg/SVGPathSegListValues.h: Removed. >+ * svg/SVGPathSegValue.h: Added. >+ (WebCore::SVGPathSegValue::create): >+ (WebCore::SVGPathSegValue::clone const): >+ (WebCore::SVGPathSegValue::SVGPathSegValue): >+ (WebCore::SVGPathSegValue::argument const): >+ (WebCore::SVGPathSegValue::setArgument): >+ (WebCore::SVGPathSegLinetoHorizontal::x const): >+ (WebCore::SVGPathSegLinetoHorizontal::setX): >+ (WebCore::SVGPathSegLinetoVertical::y const): >+ (WebCore::SVGPathSegLinetoVertical::setY): >+ (WebCore::SVGPathSegSingleCoordinate::x const): >+ (WebCore::SVGPathSegSingleCoordinate::setX): >+ (WebCore::SVGPathSegSingleCoordinate::y const): >+ (WebCore::SVGPathSegSingleCoordinate::setY): >+ (WebCore::SVGPathSegCurvetoQuadratic::x const): >+ (WebCore::SVGPathSegCurvetoQuadratic::setX): >+ (WebCore::SVGPathSegCurvetoQuadratic::y const): >+ (WebCore::SVGPathSegCurvetoQuadratic::setY): >+ (WebCore::SVGPathSegCurvetoQuadratic::x1 const): >+ (WebCore::SVGPathSegCurvetoQuadratic::setX1): >+ (WebCore::SVGPathSegCurvetoQuadratic::y1 const): >+ (WebCore::SVGPathSegCurvetoQuadratic::setY1): >+ (WebCore::SVGPathSegCurvetoCubicSmooth::x const): >+ (WebCore::SVGPathSegCurvetoCubicSmooth::setX): >+ (WebCore::SVGPathSegCurvetoCubicSmooth::y const): >+ (WebCore::SVGPathSegCurvetoCubicSmooth::setY): >+ (WebCore::SVGPathSegCurvetoCubicSmooth::x2 const): >+ (WebCore::SVGPathSegCurvetoCubicSmooth::setX2): >+ (WebCore::SVGPathSegCurvetoCubicSmooth::y2 const): >+ (WebCore::SVGPathSegCurvetoCubicSmooth::setY2): >+ (WebCore::SVGPathSegCurvetoCubic::x const): >+ (WebCore::SVGPathSegCurvetoCubic::setX): >+ (WebCore::SVGPathSegCurvetoCubic::y const): >+ (WebCore::SVGPathSegCurvetoCubic::setY): >+ (WebCore::SVGPathSegCurvetoCubic::x1 const): >+ (WebCore::SVGPathSegCurvetoCubic::setX1): >+ (WebCore::SVGPathSegCurvetoCubic::y1 const): >+ (WebCore::SVGPathSegCurvetoCubic::setY1): >+ (WebCore::SVGPathSegCurvetoCubic::x2 const): >+ (WebCore::SVGPathSegCurvetoCubic::setX2): >+ (WebCore::SVGPathSegCurvetoCubic::y2 const): >+ (WebCore::SVGPathSegCurvetoCubic::setY2): >+ (WebCore::SVGPathSegArc::x const): >+ (WebCore::SVGPathSegArc::setX): >+ (WebCore::SVGPathSegArc::y const): >+ (WebCore::SVGPathSegArc::setY): >+ (WebCore::SVGPathSegArc::r1 const): >+ (WebCore::SVGPathSegArc::setR1): >+ (WebCore::SVGPathSegArc::r2 const): >+ (WebCore::SVGPathSegArc::setR2): >+ (WebCore::SVGPathSegArc::angle const): >+ (WebCore::SVGPathSegArc::setAngle): >+ (WebCore::SVGPathSegArc::largeArcFlag const): >+ (WebCore::SVGPathSegArc::setLargeArcFlag): >+ (WebCore::SVGPathSegArc::sweepFlag const): >+ (WebCore::SVGPathSegArc::setSweepFlag): >+ * svg/SVGPathSegWithContext.h: Removed. >+ * svg/SVGPathUtilities.cpp: >+ (WebCore::buildSVGPathByteStreamFromSVGPathSegList): >+ (WebCore::buildSVGPathSegListFromByteStream): >+ (WebCore::buildStringFromByteStream): >+ (WebCore::buildSVGPathByteStreamFromSVGPathSegListValues): Deleted. >+ (WebCore::appendSVGPathByteStreamFromSVGPathSeg): Deleted. >+ (WebCore::buildSVGPathSegListValuesFromByteStream): Deleted. >+ (WebCore::buildStringFromSVGPathSegListValues): Deleted. >+ * svg/SVGPathUtilities.h: >+ * svg/SVGPatternElement.cpp: >+ (WebCore::SVGPatternElement::SVGPatternElement): >+ (WebCore::SVGPatternElement::parseAttribute): >+ (WebCore::SVGPatternElement::svgAttributeChanged): >+ (WebCore::SVGPatternElement::registerAttributes): Deleted. >+ * svg/SVGPatternElement.h: >+ * svg/SVGPoint.h: >+ (WebCore::SVGPoint::create): >+ (WebCore::SVGPoint::clone const): >+ (WebCore::SVGPoint::x): >+ (WebCore::SVGPoint::setX): >+ (WebCore::SVGPoint::y): >+ (WebCore::SVGPoint::setY): >+ (WebCore::SVGPoint::matrixTransform const): >+ (WebCore::SVGPoint::matrixTransform): Deleted. >+ (WebCore::SVGPoint::SVGPoint): Deleted. >+ * svg/SVGPoint.idl: >+ * svg/SVGPointList.h: >+ (WebCore::SVGPointList::create): >+ (WebCore::SVGPointList::parse): >+ (WebCore::SVGPointList::SVGPointList): Deleted. >+ * svg/SVGPointListValues.cpp: Removed. >+ * svg/SVGPointListValues.h: Removed. >+ * svg/SVGPolyElement.cpp: >+ (WebCore::SVGPolyElement::SVGPolyElement): >+ (WebCore::SVGPolyElement::parseAttribute): >+ (WebCore::SVGPolyElement::approximateMemoryCost const): >+ (WebCore::SVGPolyElement::registerAttributes): Deleted. >+ (WebCore::SVGPolyElement::points): Deleted. >+ (WebCore::SVGPolyElement::animatedPoints): Deleted. >+ * svg/SVGPolyElement.h: >+ (WebCore::SVGPolyElement::points const): >+ (WebCore::SVGPolyElement::points): >+ (WebCore::SVGPolyElement::animatedPoints): >+ (WebCore::SVGPolyElement::pointList const): Deleted. >+ (WebCore::SVGPolyElement::attributeRegistry): Deleted. >+ (WebCore::SVGPolyElement::isKnownAttribute): Deleted. >+ * svg/SVGPreserveAspectRatio.h: >+ (WebCore::SVGPreserveAspectRatio::create): >+ (WebCore::SVGPreserveAspectRatio::align): >+ (WebCore::SVGPreserveAspectRatio::setAlign): >+ (WebCore::SVGPreserveAspectRatio::meetOrSlice): >+ (WebCore::SVGPreserveAspectRatio::setMeetOrSlice): >+ (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio): Deleted. >+ * svg/SVGPreserveAspectRatioValue.h: >+ (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::initialValue): Deleted. >+ (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::fromString): Deleted. >+ (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::parse): Deleted. >+ (WebCore::SVGPropertyTraits<SVGPreserveAspectRatioValue>::toString): Deleted. >+ * svg/SVGRadialGradientElement.cpp: >+ (WebCore::SVGRadialGradientElement::SVGRadialGradientElement): >+ (WebCore::SVGRadialGradientElement::parseAttribute): >+ (WebCore::setGradientAttributes): >+ (WebCore::SVGRadialGradientElement::collectGradientAttributes const): >+ (WebCore::SVGRadialGradientElement::registerAttributes): Deleted. >+ (WebCore::SVGRadialGradientElement::collectGradientAttributes): Deleted. >+ * svg/SVGRadialGradientElement.h: >+ * svg/SVGRect.h: >+ (WebCore::SVGRect::create): >+ (WebCore::SVGRect::x): >+ (WebCore::SVGRect::setX): >+ (WebCore::SVGRect::y): >+ (WebCore::SVGRect::setY): >+ (WebCore::SVGRect::width): >+ (WebCore::SVGRect::setWidth): >+ (WebCore::SVGRect::height): >+ (WebCore::SVGRect::setHeight): >+ (WebCore::SVGRect::SVGRect): Deleted. >+ * svg/SVGRectElement.cpp: >+ (WebCore::SVGRectElement::SVGRectElement): >+ (WebCore::SVGRectElement::parseAttribute): >+ (WebCore::SVGRectElement::svgAttributeChanged): >+ (WebCore::SVGRectElement::registerAttributes): Deleted. >+ * svg/SVGRectElement.h: >+ * svg/SVGSVGElement.cpp: >+ (WebCore::SVGSVGElement::SVGSVGElement): >+ (WebCore::SVGSVGElement::setCurrentTranslate): >+ (WebCore::SVGSVGElement::parseAttribute): >+ (WebCore::SVGSVGElement::svgAttributeChanged): >+ (WebCore::checkIntersectionWithoutUpdatingLayout): >+ (WebCore::checkEnclosureWithoutUpdatingLayout): >+ (WebCore::SVGSVGElement::createSVGTransform): >+ (WebCore::SVGSVGElement::createSVGTransformFromMatrix): >+ (WebCore::SVGSVGElement::currentViewBoxRect const): >+ (WebCore::SVGSVGElement::viewBoxToViewTransform const): >+ (WebCore::SVGSVGElement::resetScrollAnchor): >+ (WebCore::SVGSVGElement::inheritViewAttributes): >+ (WebCore::SVGSVGElement::currentTranslate): Deleted. >+ (WebCore::SVGSVGElement::registerAttributes): Deleted. >+ * svg/SVGSVGElement.h: >+ * svg/SVGSVGElement.idl: >+ * svg/SVGScriptElement.cpp: >+ (WebCore::SVGScriptElement::svgAttributeChanged): >+ * svg/SVGScriptElement.h: >+ * svg/SVGSetElement.cpp: >+ (WebCore::SVGSetElement::SVGSetElement): >+ (WebCore::SVGSetElement::updateAnimationMode): >+ * svg/SVGStopElement.cpp: >+ (WebCore::SVGStopElement::SVGStopElement): >+ (WebCore::SVGStopElement::parseAttribute): >+ (WebCore::SVGStopElement::registerAttributes): Deleted. >+ * svg/SVGStopElement.h: >+ * svg/SVGStringList.h: >+ * svg/SVGStringListValues.cpp: Removed. >+ * svg/SVGStringListValues.h: Removed. >+ * svg/SVGSwitchElement.h: >+ * svg/SVGSymbolElement.h: >+ * svg/SVGTRefElement.cpp: >+ (WebCore::SVGTRefElement::detachTarget): >+ (WebCore::SVGTRefElement::buildPendingResource): >+ * svg/SVGTRefElement.h: >+ * svg/SVGTests.cpp: >+ (WebCore::SVGTests::SVGTests): >+ (WebCore::SVGTests::isKnownAttribute): >+ (WebCore::SVGTests::isValid const): >+ (WebCore::SVGTests::parseAttribute): >+ (WebCore::SVGTests::registerAttributes): Deleted. >+ (WebCore::SVGTests::attributeRegistry): Deleted. >+ (WebCore::SVGTests::requiredFeatures): Deleted. >+ (WebCore::SVGTests::requiredExtensions): Deleted. >+ (WebCore::SVGTests::systemLanguage): Deleted. >+ * svg/SVGTests.h: >+ (WebCore::SVGTests::requiredFeatures): >+ (WebCore::SVGTests::requiredExtensions): >+ (WebCore::SVGTests::systemLanguage): >+ (): Deleted. >+ * svg/SVGTests.idl: >+ * svg/SVGTextContentElement.cpp: >+ (WebCore::SVGTextContentElement::SVGTextContentElement): >+ (WebCore::SVGTextContentElement::parseAttribute): >+ (WebCore::SVGTextContentElement::svgAttributeChanged): >+ (WebCore::SVGTextContentElement::textLength): >+ (WebCore::SVGTextContentElement::registerAttributes): Deleted. >+ * svg/SVGTextContentElement.h: >+ (WebCore::SVGTextContentElement::specifiedTextLength const): >+ (WebCore::SVGTextContentElement::textLength const): >+ (WebCore::SVGTextContentElement::lengthAdjust const): >+ (WebCore::SVGTextContentElement::lengthAdjust): >+ (WebCore::SVGTextContentElement::specifiedTextLength): Deleted. >+ (WebCore::SVGTextContentElement::attributeRegistry): Deleted. >+ (WebCore::SVGTextContentElement::textLengthAnimated): Deleted. >+ (WebCore::SVGTextContentElement::lengthAdjustAnimated): Deleted. >+ (WebCore::SVGTextContentElement::isKnownAttribute): Deleted. >+ (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::SVGAnimatedCustomLengthAttribute): Deleted. >+ (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::synchronize): Deleted. >+ (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::animatedProperty): Deleted. >+ * svg/SVGTextElement.cpp: >+ * svg/SVGTextPathElement.cpp: >+ (WebCore::SVGTextPathElement::SVGTextPathElement): >+ (WebCore::SVGTextPathElement::parseAttribute): >+ (WebCore::SVGTextPathElement::svgAttributeChanged): >+ (WebCore::SVGTextPathElement::buildPendingResource): >+ (WebCore::SVGTextPathElement::registerAttributes): Deleted. >+ * svg/SVGTextPathElement.h: >+ * svg/SVGTextPositioningElement.cpp: >+ (WebCore::SVGTextPositioningElement::SVGTextPositioningElement): >+ (WebCore::SVGTextPositioningElement::parseAttribute): >+ (WebCore::SVGTextPositioningElement::svgAttributeChanged): >+ (WebCore::SVGTextPositioningElement::registerAttributes): Deleted. >+ * svg/SVGTextPositioningElement.h: >+ (WebCore::SVGTextPositioningElement::x const): >+ (WebCore::SVGTextPositioningElement::y const): >+ (WebCore::SVGTextPositioningElement::dx const): >+ (WebCore::SVGTextPositioningElement::dy const): >+ (WebCore::SVGTextPositioningElement::rotate const): >+ (WebCore::SVGTextPositioningElement::x): >+ (WebCore::SVGTextPositioningElement::y): >+ (WebCore::SVGTextPositioningElement::dx): >+ (WebCore::SVGTextPositioningElement::dy): >+ (WebCore::SVGTextPositioningElement::rotate): >+ (WebCore::SVGTextPositioningElement::attributeRegistry): Deleted. >+ (WebCore::SVGTextPositioningElement::xAnimated): Deleted. >+ (WebCore::SVGTextPositioningElement::yAnimated): Deleted. >+ (WebCore::SVGTextPositioningElement::dxAnimated): Deleted. >+ (WebCore::SVGTextPositioningElement::dyAnimated): Deleted. >+ (WebCore::SVGTextPositioningElement::rotateAnimated): Deleted. >+ (WebCore::SVGTextPositioningElement::isKnownAttribute): Deleted. >+ * svg/SVGTransform.cpp: Removed. >+ * svg/SVGTransform.h: >+ (WebCore::SVGTransform::create): >+ (WebCore::SVGTransform::~SVGTransform): >+ (WebCore::SVGTransform::clone const): >+ (WebCore::SVGTransform::type): >+ (WebCore::SVGTransform::angle): >+ (WebCore::SVGTransform::matrix): >+ (WebCore::SVGTransform::setMatrix): >+ (WebCore::SVGTransform::setTranslate): >+ (WebCore::SVGTransform::setScale): >+ (WebCore::SVGTransform::setRotate): >+ (WebCore::SVGTransform::setSkewX): >+ (WebCore::SVGTransform::setSkewY): >+ (WebCore::SVGTransform::SVGTransform): >+ * svg/SVGTransform.idl: >+ * svg/SVGTransformDistance.cpp: >+ (WebCore::SVGTransformDistance::addToSVGTransform const): >+ * svg/SVGTransformList.h: >+ * svg/SVGTransformList.idl: >+ * svg/SVGTransformListValues.cpp: Removed. >+ * svg/SVGTransformListValues.h: Removed. >+ * svg/SVGTransformValue.cpp: Removed. >+ * svg/SVGTransformValue.h: >+ (WebCore::SVGTransformValue::SVGTransformValue): >+ (WebCore::SVGTransformValue::operator=): >+ (WebCore::SVGTransformValue::type const): >+ (WebCore::SVGTransformValue::matrix const): >+ (WebCore::SVGTransformValue::rotationCenter const): >+ (WebCore::SVGTransformValue::isValid const): >+ (WebCore::SVGTransformValue::setMatrix): >+ (WebCore::SVGTransformValue::matrixDidChange): >+ (WebCore::SVGTransformValue::translate const): >+ (WebCore::SVGTransformValue::setTranslate): >+ (WebCore::SVGTransformValue::scale const): >+ (WebCore::SVGTransformValue::setScale): >+ (WebCore::SVGTransformValue::setRotate): >+ (WebCore::SVGTransformValue::setSkewX): >+ (WebCore::SVGTransformValue::setSkewY): >+ (WebCore::SVGTransformValue::valueAsString const): >+ (WebCore::SVGTransformValue::prefixForTransfromType): >+ (WebCore::SVGTransformValue::appendNumbers const): >+ (WebCore::SVGTransformValue::appendMatrix const): >+ (WebCore::SVGTransformValue::appendTranslate const): >+ (WebCore::SVGTransformValue::appendScale const): >+ (WebCore::SVGTransformValue::appendRotate const): >+ (WebCore::SVGTransformValue::appendSkewX const): >+ (WebCore::SVGTransformValue::appendSkewY const): >+ (WebCore::SVGTransformValue::svgMatrix): Deleted. >+ (WebCore::operator==): Deleted. >+ (WebCore::operator!=): Deleted. >+ * svg/SVGTransformable.cpp: >+ (WebCore::SVGTransformable::parseAndSkipType): >+ (WebCore::parseAndSkipType): Deleted. >+ (WebCore::SVGTransformable::parseTransformAttribute): Deleted. >+ * svg/SVGTransformable.h: >+ * svg/SVGURIReference.cpp: >+ (WebCore::SVGURIReference::SVGURIReference): >+ (WebCore::SVGURIReference::parseAttribute): >+ (WebCore::SVGURIReference::registerAttributes): Deleted. >+ (WebCore::SVGURIReference::attributeRegistry): Deleted. >+ (WebCore::SVGURIReference::isKnownAttribute): Deleted. >+ (WebCore::SVGURIReference::href const): Deleted. >+ (WebCore::SVGURIReference::hrefAnimated): Deleted. >+ * svg/SVGURIReference.h: >+ (WebCore::SVGURIReference::href const): >+ (WebCore::SVGURIReference::href): >+ (WebCore::SVGURIReference::isKnownAttribute): >+ * svg/SVGUseElement.cpp: >+ (WebCore::SVGUseElement::SVGUseElement): >+ (WebCore::SVGUseElement::parseAttribute): >+ (WebCore::SVGUseElement::svgAttributeChanged): >+ (WebCore::SVGUseElement::toClipPath const): >+ (WebCore::SVGUseElement::findTarget const): >+ (WebCore::SVGUseElement::updateExternalDocument): >+ (WebCore::SVGUseElement::haveLoadedRequiredResources const): >+ (WebCore::SVGUseElement::registerAttributes): Deleted. >+ (WebCore::SVGUseElement::toClipPath): Deleted. >+ (WebCore::SVGUseElement::haveLoadedRequiredResources): Deleted. >+ * svg/SVGUseElement.h: >+ * svg/SVGViewElement.cpp: >+ (WebCore::SVGViewElement::SVGViewElement): >+ (WebCore::SVGViewElement::parseAttribute): >+ (WebCore::SVGViewElement::viewTarget): Deleted. >+ * svg/SVGViewElement.h: >+ * svg/SVGViewSpec.cpp: >+ (WebCore::SVGViewSpec::SVGViewSpec): >+ (WebCore::SVGViewSpec::reset): >+ (WebCore::SVGViewSpec::parseViewSpec): >+ (WebCore::SVGViewSpec::registerAttributes): Deleted. >+ (WebCore::SVGViewSpec::transform): Deleted. >+ * svg/SVGViewSpec.h: >+ * svg/SVGZoomAndPan.cpp: >+ (WebCore::SVGZoomAndPan::parseZoomAndPan): >+ (WebCore::SVGZoomAndPan::parseAttribute): >+ (WebCore::SVGZoomAndPan::SVGZoomAndPan): Deleted. >+ (WebCore::SVGZoomAndPan::registerAttributes): Deleted. >+ * 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): >+ * svg/properties/SVGAccessor.h: Copied from Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h. >+ (WebCore::SVGAccessor::detach const): >+ (WebCore::SVGAccessor::isAnimatedProperty const): >+ (WebCore::SVGAccessor::isAnimatedLength const): >+ (WebCore::SVGAccessor::matches const): >+ (WebCore::SVGAccessor::synchronize const): >+ (WebCore::SVGAccessor::createAnimator const): >+ (WebCore::SVGAccessor::appendAnimatedInstance const): >+ * svg/properties/SVGAccessorPtr.h: Copied from Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h. >+ (WebCore::SVGAccessorPtr::SVGAccessorPtr): >+ (WebCore::SVGAccessorPtr::property const): >+ (WebCore::SVGAccessorPtr::singleton): >+ * svg/properties/SVGAnimatedDecoratedProperty.h: Added. >+ (WebCore::SVGAnimatedDecoratedProperty::create): >+ (WebCore::SVGAnimatedDecoratedProperty::SVGAnimatedDecoratedProperty): >+ (WebCore::SVGAnimatedDecoratedProperty::setBaseVal): >+ (WebCore::SVGAnimatedDecoratedProperty::setBaseValInternal): >+ (WebCore::SVGAnimatedDecoratedProperty::baseVal const): >+ (WebCore::SVGAnimatedDecoratedProperty::setAnimVal): >+ (WebCore::SVGAnimatedDecoratedProperty::animVal const): >+ (WebCore::SVGAnimatedDecoratedProperty::currentValue const): >+ * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h: Removed. >+ * svg/properties/SVGAnimatedListPropertyTearOff.h: Removed. >+ * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: Removed. >+ * svg/properties/SVGAnimatedPrimitiveProperty.h: Added. >+ (WebCore::SVGAnimatedPrimitiveProperty::create): >+ (WebCore::SVGAnimatedPrimitiveProperty::setBaseVal): >+ (WebCore::SVGAnimatedPrimitiveProperty::setBaseValInternal): >+ (WebCore::SVGAnimatedPrimitiveProperty::baseVal const): >+ (WebCore::SVGAnimatedPrimitiveProperty::setAnimVal): >+ (WebCore::SVGAnimatedPrimitiveProperty::animVal const): >+ (WebCore::SVGAnimatedPrimitiveProperty::animVal): >+ (WebCore::SVGAnimatedPrimitiveProperty::currentValue const): >+ (WebCore::SVGAnimatedPrimitiveProperty::SVGAnimatedPrimitiveProperty): >+ * svg/properties/SVGAnimatedProperty.cpp: >+ (WebCore::SVGAnimatedProperty::owner const): >+ (WebCore::SVGAnimatedProperty::commitPropertyChange): >+ (WebCore::SVGAnimatedProperty::SVGAnimatedProperty): Deleted. >+ (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): Deleted. >+ (WebCore::SVGAnimatedProperty::commitChange): Deleted. >+ * svg/properties/SVGAnimatedProperty.h: >+ (WebCore::SVGAnimatedProperty::isAttached const): >+ (WebCore::SVGAnimatedProperty::detach): >+ (WebCore::SVGAnimatedProperty::contextElement const): >+ (WebCore::SVGAnimatedProperty::baseValAsString const): >+ (WebCore::SVGAnimatedProperty::animValAsString const): >+ (WebCore::SVGAnimatedProperty::isDirty const): >+ (WebCore::SVGAnimatedProperty::setDirty): >+ (WebCore::SVGAnimatedProperty::synchronize): >+ (WebCore::SVGAnimatedProperty::isAnimating const): >+ (WebCore::SVGAnimatedProperty::startAnimation): >+ (WebCore::SVGAnimatedProperty::stopAnimation): >+ (WebCore::SVGAnimatedProperty::instanceStartAnimation): >+ (WebCore::SVGAnimatedProperty::instanceStopAnimation): >+ (WebCore::SVGAnimatedProperty::SVGAnimatedProperty): >+ (WebCore::SVGAnimatedProperty::isAnimatedListTearOff const): Deleted. >+ (WebCore::SVGAnimatedProperty::attributeName const): Deleted. >+ (WebCore::SVGAnimatedProperty::animatedPropertyType const): Deleted. >+ (WebCore::SVGAnimatedProperty::isReadOnly const): Deleted. >+ (WebCore::SVGAnimatedProperty::setIsReadOnly): Deleted. >+ (WebCore::SVGAnimatedProperty::lookupOrCreateAnimatedProperty): Deleted. >+ (WebCore::SVGAnimatedProperty::lookupAnimatedProperty): Deleted. >+ (WebCore::SVGAnimatedProperty::animatedPropertyCache): Deleted. >+ * svg/properties/SVGAnimatedPropertyAccessor.h: Copied from Source/WebCore/svg/properties/SVGAnimatedPropertyType.h. >+ * svg/properties/SVGAnimatedPropertyAccessorImpl.h: Added. >+ * svg/properties/SVGAnimatedPropertyAnimator.h: Added. >+ (WebCore::SVGAnimatedPropertyAnimator::appendAnimatedInstance): >+ (WebCore::SVGAnimatedPropertyAnimator::SVGAnimatedPropertyAnimator): >+ * svg/properties/SVGAnimatedPropertyAnimatorImpl.h: Added. >+ * svg/properties/SVGAnimatedPropertyDescription.h: Removed. >+ * svg/properties/SVGAnimatedPropertyImpl.h: Added. >+ (WebCore::SVGAnimatedOrientType::create): >+ (WebCore::SVGAnimatedPathSegList::create): >+ (WebCore::SVGAnimatedPathSegList::currentPathByteStream): >+ (WebCore::SVGAnimatedPathSegList::currentPath): >+ (WebCore::SVGAnimatedPathSegList::approximateMemoryCost const): >+ * svg/properties/SVGAnimatedPropertyList.h: Added. >+ (WebCore::SVGAnimatedPropertyList::create): >+ (WebCore::SVGAnimatedPropertyList::~SVGAnimatedPropertyList): >+ (WebCore::SVGAnimatedPropertyList::baseVal const): >+ (WebCore::SVGAnimatedPropertyList::baseVal): >+ (WebCore::SVGAnimatedPropertyList::animVal const): >+ (WebCore::SVGAnimatedPropertyList::animVal): >+ (WebCore::SVGAnimatedPropertyList::currentValue const): >+ (WebCore::SVGAnimatedPropertyList::SVGAnimatedPropertyList): >+ (WebCore::SVGAnimatedPropertyList::ensureAnimVal): >+ * svg/properties/SVGAnimatedPropertyPairAccessor.h: Added. >+ (WebCore::SVGAnimatedPropertyPairAccessor::SVGAnimatedPropertyPairAccessor): >+ (WebCore::SVGAnimatedPropertyPairAccessor::singleton): >+ (WebCore::SVGAnimatedPropertyPairAccessor::property1 const): >+ (WebCore::SVGAnimatedPropertyPairAccessor::property2 const): >+ * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h: Added. >+ * svg/properties/SVGAnimatedPropertyPairAnimator.h: Added. >+ (WebCore::SVGAnimatedPropertyPairAnimator::appendAnimatedInstance): >+ (WebCore::SVGAnimatedPropertyPairAnimator::SVGAnimatedPropertyPairAnimator): >+ * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: Added. >+ * svg/properties/SVGAnimatedPropertyTearOff.h: Removed. >+ * svg/properties/SVGAnimatedStaticPropertyTearOff.h: Removed. >+ * svg/properties/SVGAnimatedTransformListPropertyTearOff.h: Removed. >+ * svg/properties/SVGAnimatedValueProperty.h: Added. >+ (WebCore::SVGAnimatedValueProperty::create): >+ (WebCore::SVGAnimatedValueProperty::~SVGAnimatedValueProperty): >+ (WebCore::SVGAnimatedValueProperty::setBaseValInternal): >+ (WebCore::SVGAnimatedValueProperty::baseVal const): >+ (WebCore::SVGAnimatedValueProperty::baseVal): >+ (WebCore::SVGAnimatedValueProperty::setAnimVal): >+ (WebCore::SVGAnimatedValueProperty::animVal const): >+ (WebCore::SVGAnimatedValueProperty::animVal): >+ (WebCore::SVGAnimatedValueProperty::currentValue const): >+ (WebCore::SVGAnimatedValueProperty::SVGAnimatedValueProperty): >+ (WebCore::SVGAnimatedValueProperty::ensureAnimVal): >+ * svg/properties/SVGAnimationAdditiveFunction.h: Copied from Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h. >+ (WebCore::SVGAnimationAdditiveFunction::SVGAnimationAdditiveFunction): >+ (WebCore::SVGAnimationAdditiveFunction::progress): >+ * svg/properties/SVGAnimationAdditiveListFunction.h: Added. >+ (WebCore::SVGAnimationAdditiveListFunction::SVGAnimationAdditiveListFunction): >+ (WebCore::SVGAnimationAdditiveListFunction::toAtEndOfDuration const): >+ (WebCore::SVGAnimationAdditiveListFunction::adjustAnimatedList): >+ * svg/properties/SVGAnimationAdditiveListFunctionImpl.h: Added. >+ (WebCore::SVGAnimationLengthListFunction::SVGAnimationLengthListFunction): >+ (WebCore::SVGAnimationLengthListFunction::progress): >+ (WebCore::SVGAnimationNumberListFunction::progress): >+ (WebCore::SVGAnimationPointListFunction::progress): >+ (WebCore::SVGAnimationTransformListFunction::progress): >+ * svg/properties/SVGAnimationAdditiveValueFunction.h: Copied from Source/WebCore/svg/SVGTests.idl. >+ (WebCore::SVGAnimationAdditiveValueFunction::toAtEndOfDuration const): >+ * svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp: Copied from Source/WebCore/svg/properties/SVGAnimatedPropertyType.h. >+ (WebCore::SVGAnimationColorFunction::colorFromString): >+ * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: Added. >+ (WebCore::SVGAnimationNumberFunction::progress): >+ (WebCore::SVGAnimationIntegerFunction::progress): >+ (WebCore::SVGAnimationRectFunction::progress): >+ (WebCore::SVGAnimationColorFunction::progress): >+ (WebCore::SVGAnimationAngleFunction::progress): >+ (WebCore::SVGAnimationLengthFunction::SVGAnimationLengthFunction): >+ (WebCore::SVGAnimationLengthFunction::progress): >+ (WebCore::SVGAnimationPathSegListFunction::progress): >+ * svg/properties/SVGAnimationDiscreteFunction.h: Copied from Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h. >+ (WebCore::SVGAnimationDiscreteFunction::SVGAnimationDiscreteFunction): >+ (WebCore::SVGAnimationDiscreteFunction::progress): >+ * svg/properties/SVGAnimationDiscreteFunctionImpl.h: Added. >+ * svg/properties/SVGAnimationFunction.h: Copied from Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h. >+ (WebCore::SVGAnimationFunction::isDiscrete const): >+ (WebCore::SVGAnimationFunction::calculateDistance const): >+ (WebCore::SVGAnimationFunction::SVGAnimationFunction): >+ (WebCore::SVGAnimationFunction::addFromAndToValues): >+ * svg/properties/SVGAnimator.cpp: Added. >+ (WebCore::SVGAnimator::isAnimatedStylePropertyAniamtor const): >+ (WebCore::SVGAnimator::applyAnimatedStylePropertyChange): >+ (WebCore::SVGAnimator::removeAnimatedStyleProperty): >+ (WebCore::SVGAnimator::applyAnimatedPropertyChange): >+ * svg/properties/SVGAnimator.h: Added. >+ (WebCore::SVGAnimator::SVGAnimator): >+ (WebCore::SVGAnimator::isDiscrete const): >+ (WebCore::SVGAnimator::setFromAndToValues): >+ (WebCore::SVGAnimator::setFromAndByValues): >+ (WebCore::SVGAnimator::setToAtEndOfDurationValue): >+ (WebCore::SVGAnimator::calculateDistance const): >+ (WebCore::SVGAnimator::createSibling): >+ * svg/properties/SVGAttribute.h: Removed. >+ * svg/properties/SVGAttributeAccessor.h: Removed. >+ * svg/properties/SVGAttributeOwnerProxyImpl.h: Removed. >+ * svg/properties/SVGAttributeRegistry.h: Removed. >+ * svg/properties/SVGDecoratedEnumeration.h: Copied from Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h. >+ (WebCore::SVGDecoratedEnumeration::create): >+ * svg/properties/SVGDecoratedPrimitive.h: Copied from Source/WebCore/svg/properties/SVGAnimatedPropertyType.h. >+ (WebCore::SVGDecoratedPrimitive::SVGDecoratedPrimitive): >+ * svg/properties/SVGDecoratedProperty.h: Copied from Source/WebCore/svg/properties/SVGAnimatedPropertyType.h. >+ (WebCore::SVGDecoratedProperty::setValue): >+ (WebCore::SVGDecoratedProperty::value const): >+ * svg/properties/SVGList.h: Added. >+ (WebCore::SVGList::numberOfItems const): >+ (WebCore::SVGList::clear): >+ (WebCore::SVGList::getItem): >+ (WebCore::SVGList::initialize): >+ (WebCore::SVGList::insertItemBefore): >+ (WebCore::SVGList::replaceItem): >+ (WebCore::SVGList::removeItem): >+ (WebCore::SVGList::appendItem): >+ (WebCore::SVGList::items): >+ (WebCore::SVGList::items const): >+ (WebCore::SVGList::size const): >+ (WebCore::SVGList::isEmpty const): >+ (WebCore::SVGList::clearItems): >+ (WebCore::SVGList::canAlterList const): >+ (WebCore::SVGList::canGetItem): >+ (WebCore::SVGList::canReplaceItem): >+ (WebCore::SVGList::canRemoveItem): >+ (WebCore::SVGList::detachItems): >+ * svg/properties/SVGListProperty.h: Removed. >+ * svg/properties/SVGListPropertyTearOff.h: Removed. >+ * svg/properties/SVGMatrixTearOff.h: Removed. >+ * svg/properties/SVGPrimitiveList.h: Copied from Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h. >+ * svg/properties/SVGPrimitivePropertyAnimator.h: Added. >+ (WebCore::SVGPrimitivePropertyAnimator::SVGPrimitivePropertyAnimator): >+ * svg/properties/SVGPrimitivePropertyAnimatorImpl.h: Added. >+ (WebCore::SVGNumberAnimator::create): >+ (WebCore::SVGRectAnimator::create): >+ (WebCore::SVGStringAnimator::create): >+ * svg/properties/SVGProperty.h: >+ (WebCore::SVGProperty::isAttached const): >+ (WebCore::SVGProperty::attach): >+ (WebCore::SVGProperty::detach): >+ (WebCore::SVGProperty::contextElement const): >+ (WebCore::SVGProperty::commitChange): >+ (WebCore::SVGProperty::access const): >+ (WebCore::SVGProperty::isReadOnly const): >+ (WebCore::SVGProperty::isDirty const): >+ (WebCore::SVGProperty::setDirty): >+ (WebCore::SVGProperty::synchronize): >+ (WebCore::SVGProperty::valueAsString const): >+ (WebCore::SVGProperty::SVGProperty): >+ * svg/properties/SVGPropertyAccessor.h: Copied from Source/WebCore/svg/SVGTests.idl. >+ * svg/properties/SVGPropertyAccessorImpl.h: Copied from Source/WebCore/svg/SVGZoomAndPanType.h. >+ * svg/properties/SVGPropertyAnimator.h: Added. >+ (WebCore::SVGPropertyAnimator::SVGPropertyAnimator): >+ (WebCore::SVGPropertyAnimator::adjustForInheritance const): >+ (WebCore::SVGPropertyAnimator::computeCSSPropertyValue const): >+ (WebCore::SVGPropertyAnimator::computeInheritedCSSPropertyValue const): >+ * svg/properties/SVGPropertyAnimatorCreator.h: Added. >+ (WebCore::SVGPropertyAnimatorCreator::isKnownAttribute): >+ (WebCore::SVGPropertyAnimatorCreator::createAnimator): >+ (WebCore::SVGPropertyAnimatorCreator::animatorWillBeDeleted): >+ (WebCore::SVGPropertyAnimatorCreator::attributeAnimatorCreator): >+ (WebCore::SVGPropertyAnimatorCreator::createColorAnimator): >+ (WebCore::SVGPropertyAnimatorCreator::createLengthAnimator): >+ (WebCore::SVGPropertyAnimatorCreator::createLengthListAnimator): >+ (WebCore::SVGPropertyAnimatorCreator::createNumberAnimator): >+ (WebCore::SVGPropertyAnimatorCreator::createRectAnimator): >+ (WebCore::SVGPropertyAnimatorCreator::createStringAnimator): >+ * svg/properties/SVGPropertyList.h: Added. >+ (WebCore::SVGPropertyList::SVGPropertyList): >+ (WebCore::SVGPropertyList::~SVGPropertyList): >+ * svg/properties/SVGPropertyOwner.h: Renamed from Source/WebCore/svg/properties/SVGAnimatedPropertyType.h. >+ (WebCore::SVGPropertyOwner::owner const): >+ (WebCore::SVGPropertyOwner::attributeContextElement const): >+ (WebCore::SVGPropertyOwner::commitPropertyChange): >+ * svg/properties/SVGPropertyOwnerRegistry.h: Added. >+ (WebCore::SVGPropertyOwnerRegistry::SVGPropertyOwnerRegistry): >+ (WebCore::SVGPropertyOwnerRegistry::registerProperty): >+ (WebCore::SVGPropertyOwnerRegistry::enumerateRecursively): >+ (WebCore::SVGPropertyOwnerRegistry::isKnownAttribute): >+ (WebCore::SVGPropertyOwnerRegistry::isAnimatedLengthAttribute): >+ (WebCore::SVGPropertyOwnerRegistry::enumerateRecursivelyBaseTypes): >+ (WebCore::SVGPropertyOwnerRegistry::findAccessor): >+ * svg/properties/SVGPropertyRegistry.h: Copied from Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h. >+ * svg/properties/SVGPropertyTearOff.h: Removed. >+ * svg/properties/SVGStaticListPropertyTearOff.h: Removed. >+ * svg/properties/SVGStaticPropertyTearOff.h: Removed. >+ * svg/properties/SVGValueProperty.h: Copied from Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h. >+ (WebCore::SVGValueProperty::create): >+ (WebCore::SVGValueProperty::value const): >+ (WebCore::SVGValueProperty::setValue): >+ (WebCore::SVGValueProperty::value): >+ (WebCore::SVGValueProperty::SVGValueProperty): >+ * svg/properties/SVGValuePropertyAnimator.h: Copied from Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h. >+ (WebCore::SVGValuePropertyAnimator::SVGValuePropertyAnimator): >+ * svg/properties/SVGValuePropertyAnimatorImpl.h: Copied from Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h. >+ * svg/properties/SVGValuePropertyList.h: Added. >+ (WebCore::SVGValuePropertyList::operator=): >+ (WebCore::SVGValuePropertyList::operator Vector<typename PropertyType::ValueType> const): >+ (WebCore::SVGValuePropertyList::resize): >+ (WebCore::SVGValuePropertyList::SVGValuePropertyList): >+ * svg/properties/SVGValuePropertyListAnimator.h: Renamed from Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp. >+ (WebCore::SVGValuePropertyListAnimator::SVGValuePropertyListAnimator): >+ * svg/properties/SVGValuePropertyListAnimatorImpl.h: Renamed from Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h. >+ > 2018-12-08 Frederic Wang <fwang@igalia.com> > > Allow control over child order when adding nodes to the scrolling tree >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index 6a9882dc90c..0d7f3b2b752 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -2186,24 +2186,6 @@ svg/SVGAnimateElement.cpp > svg/SVGAnimateElementBase.cpp > svg/SVGAnimateMotionElement.cpp > svg/SVGAnimateTransformElement.cpp >-svg/SVGAnimatedAngle.cpp >-svg/SVGAnimatedBoolean.cpp >-svg/SVGAnimatedColor.cpp >-svg/SVGAnimatedEnumeration.cpp >-svg/SVGAnimatedInteger.cpp >-svg/SVGAnimatedIntegerOptionalInteger.cpp >-svg/SVGAnimatedLength.cpp >-svg/SVGAnimatedLengthList.cpp >-svg/SVGAnimatedNumber.cpp >-svg/SVGAnimatedNumberList.cpp >-svg/SVGAnimatedNumberOptionalNumber.cpp >-svg/SVGAnimatedPath.cpp >-svg/SVGAnimatedPointList.cpp >-svg/SVGAnimatedPreserveAspectRatio.cpp >-svg/SVGAnimatedRect.cpp >-svg/SVGAnimatedString.cpp >-svg/SVGAnimatedTransformList.cpp >-svg/SVGAnimatedTypeAnimator.cpp > svg/SVGAnimationElement.cpp > svg/SVGCircleElement.cpp > svg/SVGClipPathElement.cpp >@@ -2263,7 +2245,6 @@ svg/SVGImageElement.cpp > svg/SVGImageLoader.cpp > svg/SVGLangSpace.cpp > svg/SVGLengthContext.cpp >-svg/SVGLengthListValues.cpp > svg/SVGLengthValue.cpp > svg/SVGLineElement.cpp > svg/SVGLinearGradientElement.cpp >@@ -2273,7 +2254,6 @@ svg/SVGMarkerElement.cpp > svg/SVGMaskElement.cpp > svg/SVGMetadataElement.cpp > svg/SVGMissingGlyphElement.cpp >-svg/SVGNumberListValues.cpp > svg/SVGParserUtilities.cpp > svg/SVGPathBlender.cpp > svg/SVGPathBuilder.cpp >@@ -2281,16 +2261,13 @@ svg/SVGPathByteStreamBuilder.cpp > svg/SVGPathByteStreamSource.cpp > svg/SVGPathElement.cpp > svg/SVGPathParser.cpp >-svg/SVGPathSegList.cpp > svg/SVGPathSegListBuilder.cpp > svg/SVGPathSegListSource.cpp >-svg/SVGPathSegListValues.cpp > svg/SVGPathStringBuilder.cpp > svg/SVGPathStringSource.cpp > svg/SVGPathTraversalStateBuilder.cpp > svg/SVGPathUtilities.cpp > svg/SVGPatternElement.cpp >-svg/SVGPointListValues.cpp > svg/SVGPolyElement.cpp > svg/SVGPolygonElement.cpp > svg/SVGPolylineElement.cpp >@@ -2301,7 +2278,6 @@ svg/SVGSVGElement.cpp > svg/SVGScriptElement.cpp > svg/SVGSetElement.cpp > svg/SVGStopElement.cpp >-svg/SVGStringListValues.cpp > svg/SVGStyleElement.cpp > svg/SVGSwitchElement.cpp > svg/SVGSymbolElement.cpp >@@ -2314,10 +2290,7 @@ svg/SVGTextPathElement.cpp > svg/SVGTextPositioningElement.cpp > svg/SVGTitleElement.cpp > svg/SVGToOTFFontConversion.cpp >-svg/SVGTransform.cpp > svg/SVGTransformDistance.cpp >-svg/SVGTransformListValues.cpp >-svg/SVGTransformValue.cpp > svg/SVGTransformable.cpp > svg/SVGURIReference.cpp > svg/SVGUnknownElement.cpp >@@ -2340,8 +2313,9 @@ svg/graphics/filters/SVGFEImage.cpp > svg/graphics/filters/SVGFilter.cpp > svg/graphics/filters/SVGFilterBuilder.cpp > >-svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp > svg/properties/SVGAnimatedProperty.cpp >+svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp >+svg/properties/SVGAnimator.cpp > > workers/AbstractWorker.cpp > workers/DedicatedWorkerGlobalScope.cpp >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 5f6c7303150..e65bd799cdb 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -224,21 +224,14 @@ > 0806E57A12893045007CED32 /* SVGMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 0806E57912893045007CED32 /* SVGMatrix.h */; }; > 080E49261255F3BD00EFCA27 /* SVGTextLayoutEngineBaseline.h in Headers */ = {isa = PBXBuildFile; fileRef = 080E49221255F3BD00EFCA27 /* SVGTextLayoutEngineBaseline.h */; }; > 080E49281255F3BD00EFCA27 /* SVGTextLayoutEngineSpacing.h in Headers */ = {isa = PBXBuildFile; fileRef = 080E49241255F3BD00EFCA27 /* SVGTextLayoutEngineSpacing.h */; }; >- 0810764412828556007C63BA /* SVGListProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 0810764312828556007C63BA /* SVGListProperty.h */; }; > 081093DC1255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 081093DA1255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.h */; }; >- 0813A4EA1284132600992511 /* SVGStaticPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 0813A4E91284132600992511 /* SVGStaticPropertyTearOff.h */; }; > 081668D4125603BF006F25DE /* SVGTextChunkBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 081668D2125603BF006F25DE /* SVGTextChunkBuilder.h */; }; > 081668DA125603D5006F25DE /* SVGTextLayoutEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = 081668D8125603D5006F25DE /* SVGTextLayoutEngine.h */; }; > 081AA8DA1111237E002AB06E /* SVGElementRareData.h in Headers */ = {isa = PBXBuildFile; fileRef = 081AA8D91111237E002AB06E /* SVGElementRareData.h */; }; > 081EBF3B0FD34F4100DA7559 /* SVGFilterBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 081EBF390FD34F4100DA7559 /* SVGFilterBuilder.h */; }; >- 0823D159127AD6AC000EBC95 /* SVGAnimatedInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */; }; >- 08250939128BD4D800E2ED8E /* SVGAnimatedTransformList.h in Headers */ = {isa = PBXBuildFile; fileRef = 08250938128BD4D800E2ED8E /* SVGAnimatedTransformList.h */; }; >- 082DE42D1292621600D923DF /* SVGPathSegWithContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 082DE42C1292621600D923DF /* SVGPathSegWithContext.h */; }; > 083DAEA70F01A7FB00342754 /* RenderTextControlMultiLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 083DAEA30F01A7FB00342754 /* RenderTextControlMultiLine.h */; }; > 083DAEA90F01A7FB00342754 /* RenderTextControlSingleLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 083DAEA50F01A7FB00342754 /* RenderTextControlSingleLine.h */; }; > 0845680812B90DA600960A9F /* FontMetrics.h in Headers */ = {isa = PBXBuildFile; fileRef = 0845680712B90DA600960A9F /* FontMetrics.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 084DB59B128008CC002A6D64 /* SVGAnimatedString.h in Headers */ = {isa = PBXBuildFile; fileRef = 084DB59A128008CC002A6D64 /* SVGAnimatedString.h */; }; >- 08525E631278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 08525E621278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0854B0151255E4E600B9CDD0 /* RenderSVGInline.h in Headers */ = {isa = PBXBuildFile; fileRef = 0854B0031255E4E600B9CDD0 /* RenderSVGInline.h */; }; > 0854B0171255E4E600B9CDD0 /* RenderSVGInlineText.h in Headers */ = {isa = PBXBuildFile; fileRef = 0854B0051255E4E600B9CDD0 /* RenderSVGInlineText.h */; }; > 0854B0191255E4E600B9CDD0 /* RenderSVGText.h in Headers */ = {isa = PBXBuildFile; fileRef = 0854B0071255E4E600B9CDD0 /* RenderSVGText.h */; }; >@@ -248,38 +241,20 @@ > 0854B0211255E4E600B9CDD0 /* SVGInlineTextBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 0854B00F1255E4E600B9CDD0 /* SVGInlineTextBox.h */; }; > 0854B0231255E4E600B9CDD0 /* SVGRootInlineBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 0854B0111255E4E600B9CDD0 /* SVGRootInlineBox.h */; }; > 0854B0251255E4E600B9CDD0 /* SVGTextQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 0854B0131255E4E600B9CDD0 /* SVGTextQuery.h */; }; >- 085797091278394C00A8EC5F /* SVGAnimatedBoolean.h in Headers */ = {isa = PBXBuildFile; fileRef = 085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */; }; >- 085A15931289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */; }; > 085B92BB0EFDE73D00E6123C /* FormDataBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */; settings = {ATTRIBUTES = (); }; }; >- 0863951613B5FE5700BB344D /* SVGAnimatedPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 0863951413B5FE5700BB344D /* SVGAnimatedPath.h */; }; > 08641D4812142F7D008DE9F6 /* RenderImageResourceStyleImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 08641D4612142F7D008DE9F6 /* RenderImageResourceStyleImage.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 086BBD0F136039C2008B15D8 /* Glyph.h in Headers */ = {isa = PBXBuildFile; fileRef = 086BBD0E136039C2008B15D8 /* Glyph.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0873B86B136064EA00A522C2 /* GlyphPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 0873B86A136064EA00A522C2 /* GlyphPage.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 087558C613B4A57D00F49307 /* SurrogatePairAwareTextIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = 087558C413B4A57D00F49307 /* SurrogatePairAwareTextIterator.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 087B84961272CEC800A14417 /* SVGAnimatedAngle.h in Headers */ = {isa = PBXBuildFile; fileRef = 087B84951272CEC700A14417 /* SVGAnimatedAngle.h */; }; >- 0880F70E1282B46D00948505 /* SVGStaticListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 0880F70D1282B46D00948505 /* SVGStaticListPropertyTearOff.h */; }; > 0885067F11DA045B00182B98 /* PaintInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0885067D11DA045B00182B98 /* PaintInfo.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0885068011DA045B00182B98 /* PaintPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0885067E11DA045B00182B98 /* PaintPhase.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 088A0E04126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */; }; >- 088A0E06126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */; }; >- 088A0E09126EF1DB00978F7A /* SVGListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */; }; > 088A0E0A126EF1DB00978F7A /* SVGProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E01126EF1DB00978F7A /* SVGProperty.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 088A0E0B126EF1DB00978F7A /* SVGPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */; }; > 088A0E0C126EF1DB00978F7A /* SVGPropertyTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 088C2F7A12390081003D65CE /* SVGTextLayoutAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 088C2F7612390080003D65CE /* SVGTextLayoutAttributes.h */; }; >- 089021A9126EF5DE0092D5EA /* SVGAnimatedLength.h in Headers */ = {isa = PBXBuildFile; fileRef = 089021A8126EF5DE0092D5EA /* SVGAnimatedLength.h */; }; >- 089021AD126EF5E90092D5EA /* SVGAnimatedLengthList.h in Headers */ = {isa = PBXBuildFile; fileRef = 089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */; }; > 089582560E857A7E00F82C83 /* ImageLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 089582540E857A7E00F82C83 /* ImageLoader.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 089A8E07128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 089A8E06128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h */; }; > 08A484780E5272C500C3FE76 /* ScriptElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 08A484760E5272C500C3FE76 /* ScriptElement.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 08B35B13127B6A7C005314DD /* SVGAnimatedNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 08B35B12127B6A7C005314DD /* SVGAnimatedNumber.h */; }; >- 08B35B17127B6A88005314DD /* SVGAnimatedNumberList.h in Headers */ = {isa = PBXBuildFile; fileRef = 08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */; }; > 08C7A2C710DC7462002D368B /* SVGNames.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 656581E909D1508D000E61D7 /* SVGNames.h */; }; >- 08C859C01274575400A5728D /* SVGAnimatedRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C859BF1274575300A5728D /* SVGAnimatedRect.h */; }; > 08C9251A0FCC7C4A00480DEC /* FilterEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 08C925180FCC7C4A00480DEC /* FilterEffect.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 08CA3D4412894A3800FFF260 /* SVGMatrixTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 08CA3D4312894A3800FFF260 /* SVGMatrixTearOff.h */; }; >- 08D46CE3127AD5FC0089694B /* SVGAnimatedEnumeration.h in Headers */ = {isa = PBXBuildFile; fileRef = 08D46CE2127AD5FC0089694B /* SVGAnimatedEnumeration.h */; }; > 08EDE19F12A50B8E00B95797 /* SVGRect.h in Headers */ = {isa = PBXBuildFile; fileRef = 08EDE19E12A50B8E00B95797 /* SVGRect.h */; }; > 08F0BFC31255C53C00075185 /* SVGTextChunk.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F0BFBE1255C53C00075185 /* SVGTextChunk.h */; }; > 08F0BFC41255C53C00075185 /* SVGTextFragment.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F0BFBF1255C53C00075185 /* SVGTextFragment.h */; }; >@@ -287,7 +262,6 @@ > 08F2F00A1213E61700DCEC48 /* RenderImageResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F2F0081213E61700DCEC48 /* RenderImageResource.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 08F859D51463F9CD0067D933 /* SVGImageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F859D31463F9CD0067D933 /* SVGImageCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 08F859D51463F9CD0067D934 /* SVGImageForContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 08F859D31463F9CD0067D934 /* SVGImageForContainer.h */; }; >- 08FE0BC5127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h in Headers */ = {isa = PBXBuildFile; fileRef = 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */; }; > 0AFDAC3D10F5448C00E1F3D2 /* PluginViewBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AFDAC3C10F5448C00E1F3D2 /* PluginViewBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B9056160F2578BE0095FF6A /* DocumentThreadableLoader.h */; settings = {ATTRIBUTES = (); }; }; > 0B90561B0F2578BF0095FF6A /* ThreadableLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B9056170F2578BE0095FF6A /* ThreadableLoader.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -1162,7 +1136,6 @@ > 427DA71D13735DFA007C57FB /* JSServiceWorkerInternals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 427DA71B13735DFA007C57FB /* JSServiceWorkerInternals.cpp */; }; > 427DA71E13735DFA007C57FB /* JSServiceWorkerInternals.h in Headers */ = {isa = PBXBuildFile; fileRef = 427DA71C13735DFA007C57FB /* JSServiceWorkerInternals.h */; }; > 43107BE218CC19DE00CC18E8 /* SelectorPseudoTypeMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 43107BE118CC19DE00CC18E8 /* SelectorPseudoTypeMap.h */; }; >- 431A2F9C13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 431A2F9A13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h */; }; > 432D3FE818A8658400D7DC03 /* SelectorCheckerTestFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 432D3FE718A8658400D7DC03 /* SelectorCheckerTestFunctions.h */; }; > 4358E87D1360A2EE00E4748C /* JSSVGFEDropShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4358E87B1360A2EE00E4748C /* JSSVGFEDropShadowElement.h */; }; > 4358E8811360A31700E4748C /* FEDropShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = 4358E87F1360A31700E4748C /* FEDropShadow.h */; }; >@@ -1207,12 +1180,8 @@ > 439046EA12DA25E812AF80AC /* MathOperator.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D612DA25E812AF80AC /* MathOperator.h */; }; > 439046EC12DA25E800AF80A9 /* RenderMathMLToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 439046D812DA25E800AF80A9 /* RenderMathMLToken.h */; }; > 439176E012DA25E17BAF80A2 /* MathMLStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 439176CC12DA25E17BAF80A2 /* MathMLStyle.h */; }; >- 439D334313A6911C00C20F4F /* SVGAnimatedType.h in Headers */ = {isa = PBXBuildFile; fileRef = 439D334013A6911C00C20F4F /* SVGAnimatedType.h */; }; >- 439D334413A6911C00C20F4F /* SVGAnimatedTypeAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = 439D334113A6911C00C20F4F /* SVGAnimatedTypeAnimator.h */; }; > 439D334513A6911C00C20F4F /* SVGAnimatorFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 439D334213A6911C00C20F4F /* SVGAnimatorFactory.h */; }; >- 43A625F813B3304000AC94B8 /* SVGAnimatedColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 43A625F613B3304000AC94B8 /* SVGAnimatedColor.h */; }; > 43B85ED418CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 43B85ED218CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp */; }; >- 43B9336913B261B1004584BF /* SVGAnimatedPointList.h in Headers */ = {isa = PBXBuildFile; fileRef = 43B9336713B261B1004584BF /* SVGAnimatedPointList.h */; }; > 43C092BC12D9E4EE00A989C3 /* RenderSVGForeignObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 43C092BA12D9E4EE00A989C3 /* RenderSVGForeignObject.h */; }; > 43EDD67F1B485DBF00640E75 /* CombinedFiltersAlphabet.h in Headers */ = {isa = PBXBuildFile; fileRef = 43EDD67D1B485DBF00640E75 /* CombinedFiltersAlphabet.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 4415292E0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 4415292C0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -1761,7 +1730,6 @@ > 53ED3FDE167A88E7006762E6 /* JSInternalSettingsGenerated.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53ED3FDC167A88E7006762E6 /* JSInternalSettingsGenerated.cpp */; }; > 53ED3FDF167A88E7006762E6 /* JSInternalSettingsGenerated.h in Headers */ = {isa = PBXBuildFile; fileRef = 53ED3FDD167A88E7006762E6 /* JSInternalSettingsGenerated.h */; }; > 550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */ = {isa = PBXBuildFile; fileRef = 550A0BC8085F6039007353D6 /* QualifiedName.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 55346AF121150FAF0059BCDD /* SVGAttributeOwnerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 55346AF021150FAF0059BCDD /* SVGAttributeOwnerProxy.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 5546757B1FD212A9003B10B0 /* ImageSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 554675781FD1FC1A003B10B0 /* ImageSource.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 5550CB421E955E3C00111AA0 /* ImageTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 5550CB411E955E3C00111AA0 /* ImageTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 555130011E7CCCCB00A69E38 /* DecodingOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 555130001E7CCCCA00A69E38 /* DecodingOptions.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -1770,11 +1738,7 @@ > 55A336F91D821E3C0022C4C7 /* ImageBackingStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 55A336F81D821E3C0022C4C7 /* ImageBackingStore.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 55AF14E61EAAC59B0026EEAA /* UTIRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 55AF14E41EAAC59B0026EEAA /* UTIRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 55EC9599206AA7A0007DD0A9 /* PaintFrequencyTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EC95972069C92D007DD0A9 /* PaintFrequencyTracker.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 55FA7FF0210FA386005AEFE7 /* SVGAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 55FA7FEF210FA386005AEFE7 /* SVGAttribute.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 55FA7FF5210FB6B1005AEFE7 /* SVGAttributeAccessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 55FA7FF4210FB688005AEFE7 /* SVGAttributeAccessor.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 55FA7FF7210FBE3E005AEFE7 /* SVGAttributeRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 55FA7FF6210FBE3E005AEFE7 /* SVGAttributeRegistry.h */; }; > 55FA7FFB2110ECD7005AEFE7 /* SVGZoomAndPanType.h in Headers */ = {isa = PBXBuildFile; fileRef = 55FA7FFA2110ECD7005AEFE7 /* SVGZoomAndPanType.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 55FA7FFF21110E6E005AEFE7 /* SVGAnimatedPropertyType.h in Headers */ = {isa = PBXBuildFile; fileRef = 55FA7FFE21110E6E005AEFE7 /* SVGAnimatedPropertyType.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 55FA8001211113EE005AEFE7 /* SVGAnimatedProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 088A0DFC126EF1DB00978F7A /* SVGAnimatedProperty.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 5704405A1E53936200356601 /* JSAesCbcCfbParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 570440591E53936200356601 /* JSAesCbcCfbParams.h */; }; > 5706A6961DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h in Headers */ = {isa = PBXBuildFile; fileRef = 5706A6951DDE5C9500A03B14 /* CryptoAlgorithmRsaOaepParams.h */; }; >@@ -2102,14 +2066,15 @@ > 71C916081D1483A300ACA47D /* UserInterfaceLayoutDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 71C916071D1483A300ACA47D /* UserInterfaceLayoutDirection.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 71DCB7021568197600862271 /* JSSVGZoomAndPan.h in Headers */ = {isa = PBXBuildFile; fileRef = 71DCB7001568197600862271 /* JSSVGZoomAndPan.h */; }; > 71E2183A17359FB8006E6E4D /* PlugInsResources.h in Headers */ = {isa = PBXBuildFile; fileRef = 71E2183817359FB8006E6E4D /* PlugInsResources.h */; }; >- 71E623D1151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h in Headers */ = {isa = PBXBuildFile; fileRef = 71E623CF151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h */; }; > 71EFCEDC202B38A900D7C411 /* AnimationEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71EFCED7202B388D00D7C411 /* AnimationEffect.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 71FB967B1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h in Headers */ = {isa = PBXBuildFile; fileRef = 71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */; }; > 724ED32C1A3A7E5400F5F13C /* EXTBlendMinMax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 724ED3291A3A7E5400F5F13C /* EXTBlendMinMax.cpp */; }; > 724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */ = {isa = PBXBuildFile; fileRef = 724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */; }; > 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 */; }; >@@ -2200,8 +2165,6 @@ > 7C30D9861F815AEC00268356 /* JSAbortSignal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C30D9811F815AC100268356 /* JSAbortSignal.h */; }; > 7C330A021DF8FAC600D3395C /* GraphicsContext3DAttributes.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C330A011DF8FAC600D3395C /* GraphicsContext3DAttributes.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 7C330A081DF9F95100D3395C /* JSPositionOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C330A061DF9F95100D3395C /* JSPositionOptions.h */; }; >- 7C39C3651DDA865200FEFB29 /* SVGLengthListValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C39C3631DDA864900FEFB29 /* SVGLengthListValues.h */; }; >- 7C39C3771DDBE17000FEFB29 /* SVGStringListValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C39C3671DDB82CF00FEFB29 /* SVGStringListValues.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 7C3A91E61C963B8800D1A7E3 /* ClipboardAccessPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3A91E51C963B8800D1A7E3 /* ClipboardAccessPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 7C3B79711908757B00B47A2D /* UserMessageHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C3B796F1908757B00B47A2D /* UserMessageHandler.cpp */; }; > 7C3B79721908757B00B47A2D /* UserMessageHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C3B79701908757B00B47A2D /* UserMessageHandler.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -2332,8 +2295,6 @@ > 7CE1917B1F2ABE7100272F78 /* JSFetchRequestRedirect.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE1916A1F2AB70600272F78 /* JSFetchRequestRedirect.h */; }; > 7CE58D4A1DD64A5B00128552 /* SVGPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE58D491DD64A5B00128552 /* SVGPoint.h */; }; > 7CE58D501DD69A1E00128552 /* SVGNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE58D4F1DD69A1E00128552 /* SVGNumber.h */; }; >- 7CE58D581DD7D96D00128552 /* SVGTransformValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE58D561DD7D96D00128552 /* SVGTransformValue.h */; }; >- 7CE58D5C1DD7EC9C00128552 /* SVGMatrixValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE58D5B1DD7EC9C00128552 /* SVGMatrixValue.h */; }; > 7CE68344192143A800F4D928 /* UserMessageHandlerDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CE68342192143A800F4D928 /* UserMessageHandlerDescriptor.cpp */; }; > 7CE68345192143A800F4D928 /* UserMessageHandlerDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE68343192143A800F4D928 /* UserMessageHandlerDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 7CE683471921821500F4D928 /* UserMessageHandlerDescriptorTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE683461921821500F4D928 /* UserMessageHandlerDescriptorTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -2447,22 +2408,6 @@ > 83B9687B19F8AB83004EF7AF /* StyleBuilderConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = 83B9687919F8AB83004EF7AF /* StyleBuilderConverter.h */; }; > 83BB5C881D5D6F45005A71F4 /* AllDescendantsCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 83BB5C871D5D6F3A005A71F4 /* AllDescendantsCollection.h */; }; > 83C05A5B1A686212007E5DEA /* StylePropertyShorthandFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C05A591A686212007E5DEA /* StylePropertyShorthandFunctions.h */; }; >- 83C1D425178D5AB400141E68 /* SVGPathSegArcAbs.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D413178D5AB400141E68 /* SVGPathSegArcAbs.h */; }; >- 83C1D426178D5AB400141E68 /* SVGPathSegArcRel.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D414178D5AB400141E68 /* SVGPathSegArcRel.h */; }; >- 83C1D427178D5AB400141E68 /* SVGPathSegCurvetoCubicAbs.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D415178D5AB400141E68 /* SVGPathSegCurvetoCubicAbs.h */; }; >- 83C1D428178D5AB400141E68 /* SVGPathSegCurvetoCubicRel.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D416178D5AB400141E68 /* SVGPathSegCurvetoCubicRel.h */; }; >- 83C1D429178D5AB400141E68 /* SVGPathSegCurvetoCubicSmoothAbs.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D417178D5AB400141E68 /* SVGPathSegCurvetoCubicSmoothAbs.h */; }; >- 83C1D42A178D5AB400141E68 /* SVGPathSegCurvetoCubicSmoothRel.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D418178D5AB400141E68 /* SVGPathSegCurvetoCubicSmoothRel.h */; }; >- 83C1D42B178D5AB400141E68 /* SVGPathSegCurvetoQuadraticAbs.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D419178D5AB400141E68 /* SVGPathSegCurvetoQuadraticAbs.h */; }; >- 83C1D42C178D5AB500141E68 /* SVGPathSegCurvetoQuadraticRel.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D41A178D5AB400141E68 /* SVGPathSegCurvetoQuadraticRel.h */; }; >- 83C1D42D178D5AB500141E68 /* SVGPathSegCurvetoQuadraticSmoothAbs.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D41B178D5AB400141E68 /* SVGPathSegCurvetoQuadraticSmoothAbs.h */; }; >- 83C1D42E178D5AB500141E68 /* SVGPathSegCurvetoQuadraticSmoothRel.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D41C178D5AB400141E68 /* SVGPathSegCurvetoQuadraticSmoothRel.h */; }; >- 83C1D42F178D5AB500141E68 /* SVGPathSegLinetoAbs.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D41D178D5AB400141E68 /* SVGPathSegLinetoAbs.h */; }; >- 83C1D430178D5AB500141E68 /* SVGPathSegLinetoHorizontalAbs.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D41E178D5AB400141E68 /* SVGPathSegLinetoHorizontalAbs.h */; }; >- 83C1D431178D5AB500141E68 /* SVGPathSegLinetoHorizontalRel.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D41F178D5AB400141E68 /* SVGPathSegLinetoHorizontalRel.h */; }; >- 83C1D432178D5AB500141E68 /* SVGPathSegLinetoRel.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D420178D5AB400141E68 /* SVGPathSegLinetoRel.h */; }; >- 83C1D433178D5AB500141E68 /* SVGPathSegLinetoVerticalAbs.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D421178D5AB400141E68 /* SVGPathSegLinetoVerticalAbs.h */; }; >- 83C1D434178D5AB500141E68 /* SVGPathSegLinetoVerticalRel.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D422178D5AB400141E68 /* SVGPathSegLinetoVerticalRel.h */; }; > 83C1D435178D5AB500141E68 /* SVGPathSegMovetoAbs.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D423178D5AB400141E68 /* SVGPathSegMovetoAbs.h */; }; > 83C1D436178D5AB500141E68 /* SVGPathSegMovetoRel.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1D424178D5AB400141E68 /* SVGPathSegMovetoRel.h */; }; > 83C1F5941EDF69D300410D27 /* QualifiedNameCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 83C1F5921EDF69D300410D27 /* QualifiedNameCache.h */; }; >@@ -3478,13 +3423,6 @@ > B2227A570D00BF220071B782 /* SVGParserUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278C10D00BF200071B782 /* SVGParserUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; }; > B2227A590D00BF220071B782 /* SVGPathElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278C30D00BF200071B782 /* SVGPathElement.h */; }; > B2227A5B0D00BF220071B782 /* SVGPathSeg.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278C50D00BF200071B782 /* SVGPathSeg.h */; }; >- B2227A5E0D00BF220071B782 /* SVGPathSegArc.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278C80D00BF200071B782 /* SVGPathSegArc.h */; }; >- B2227A620D00BF220071B782 /* SVGPathSegClosePath.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278CC0D00BF200071B782 /* SVGPathSegClosePath.h */; }; >- B2227A650D00BF220071B782 /* SVGPathSegCurvetoCubic.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278CF0D00BF200071B782 /* SVGPathSegCurvetoCubic.h */; }; >- B2227A690D00BF220071B782 /* SVGPathSegCurvetoCubicSmooth.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278D30D00BF200071B782 /* SVGPathSegCurvetoCubicSmooth.h */; }; >- B2227A6D0D00BF220071B782 /* SVGPathSegCurvetoQuadratic.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278D70D00BF200071B782 /* SVGPathSegCurvetoQuadratic.h */; }; >- B2227A780D00BF220071B782 /* SVGPathSegLinetoHorizontal.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278E20D00BF200071B782 /* SVGPathSegLinetoHorizontal.h */; }; >- B2227A7D0D00BF220071B782 /* SVGPathSegLinetoVertical.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278E70D00BF200071B782 /* SVGPathSegLinetoVertical.h */; }; > B2227A810D00BF220071B782 /* SVGPathSegList.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278EB0D00BF200071B782 /* SVGPathSegList.h */; }; > B2227A880D00BF220071B782 /* SVGPatternElement.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278F20D00BF210071B782 /* SVGPatternElement.h */; }; > B2227A8C0D00BF220071B782 /* SVGPointList.h in Headers */ = {isa = PBXBuildFile; fileRef = B22278F60D00BF210071B782 /* SVGPointList.h */; }; >@@ -5544,10 +5482,8 @@ > 080E49221255F3BD00EFCA27 /* SVGTextLayoutEngineBaseline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutEngineBaseline.h; sourceTree = "<group>"; }; > 080E49231255F3BD00EFCA27 /* SVGTextLayoutEngineSpacing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextLayoutEngineSpacing.cpp; sourceTree = "<group>"; }; > 080E49241255F3BD00EFCA27 /* SVGTextLayoutEngineSpacing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutEngineSpacing.h; sourceTree = "<group>"; }; >- 0810764312828556007C63BA /* SVGListProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGListProperty.h; sourceTree = "<group>"; }; > 081093D91255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextLayoutAttributesBuilder.cpp; sourceTree = "<group>"; }; > 081093DA1255F0E700ED9D29 /* SVGTextLayoutAttributesBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutAttributesBuilder.h; sourceTree = "<group>"; }; >- 0813A4E91284132600992511 /* SVGStaticPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGStaticPropertyTearOff.h; sourceTree = "<group>"; }; > 081668D1125603BF006F25DE /* SVGTextChunkBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextChunkBuilder.cpp; sourceTree = "<group>"; }; > 081668D2125603BF006F25DE /* SVGTextChunkBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextChunkBuilder.h; sourceTree = "<group>"; }; > 081668D7125603D5006F25DE /* SVGTextLayoutEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextLayoutEngine.cpp; sourceTree = "<group>"; }; >@@ -5555,16 +5491,11 @@ > 081AA8D91111237E002AB06E /* SVGElementRareData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGElementRareData.h; sourceTree = "<group>"; }; > 081EBF380FD34F4100DA7559 /* SVGFilterBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFilterBuilder.cpp; sourceTree = "<group>"; }; > 081EBF390FD34F4100DA7559 /* SVGFilterBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFilterBuilder.h; sourceTree = "<group>"; }; >- 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedInteger.h; sourceTree = "<group>"; }; >- 08250938128BD4D800E2ED8E /* SVGAnimatedTransformList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedTransformList.h; sourceTree = "<group>"; }; >- 082DE42C1292621600D923DF /* SVGPathSegWithContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegWithContext.h; sourceTree = "<group>"; }; > 083DAEA20F01A7FB00342754 /* RenderTextControlMultiLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTextControlMultiLine.cpp; sourceTree = "<group>"; }; > 083DAEA30F01A7FB00342754 /* RenderTextControlMultiLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderTextControlMultiLine.h; sourceTree = "<group>"; }; > 083DAEA40F01A7FB00342754 /* RenderTextControlSingleLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTextControlSingleLine.cpp; sourceTree = "<group>"; }; > 083DAEA50F01A7FB00342754 /* RenderTextControlSingleLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderTextControlSingleLine.h; sourceTree = "<group>"; }; > 0845680712B90DA600960A9F /* FontMetrics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontMetrics.h; sourceTree = "<group>"; }; >- 084DB59A128008CC002A6D64 /* SVGAnimatedString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedString.h; sourceTree = "<group>"; }; >- 08525E621278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedStaticPropertyTearOff.h; sourceTree = "<group>"; }; > 0854B0021255E4E600B9CDD0 /* RenderSVGInline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGInline.cpp; sourceTree = "<group>"; }; > 0854B0031255E4E600B9CDD0 /* RenderSVGInline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGInline.h; sourceTree = "<group>"; }; > 0854B0041255E4E600B9CDD0 /* RenderSVGInlineText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGInlineText.cpp; sourceTree = "<group>"; }; >@@ -5582,46 +5513,27 @@ > 0854B0111255E4E600B9CDD0 /* SVGRootInlineBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGRootInlineBox.h; sourceTree = "<group>"; }; > 0854B0121255E4E600B9CDD0 /* SVGTextQuery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextQuery.cpp; sourceTree = "<group>"; }; > 0854B0131255E4E600B9CDD0 /* SVGTextQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextQuery.h; sourceTree = "<group>"; }; >- 085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedBoolean.h; sourceTree = "<group>"; }; >- 085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedTransformListPropertyTearOff.h; sourceTree = "<group>"; }; > 085B92B80EFDE73D00E6123C /* FormDataBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormDataBuilder.cpp; sourceTree = "<group>"; }; > 085B92B90EFDE73D00E6123C /* FormDataBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormDataBuilder.h; sourceTree = "<group>"; }; >- 0863951313B5FE5700BB344D /* SVGAnimatedPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedPath.cpp; sourceTree = "<group>"; }; >- 0863951413B5FE5700BB344D /* SVGAnimatedPath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPath.h; sourceTree = "<group>"; }; > 08641D4512142F7D008DE9F6 /* RenderImageResourceStyleImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderImageResourceStyleImage.cpp; sourceTree = "<group>"; }; > 08641D4612142F7D008DE9F6 /* RenderImageResourceStyleImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderImageResourceStyleImage.h; sourceTree = "<group>"; }; > 086BBD0E136039C2008B15D8 /* Glyph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Glyph.h; sourceTree = "<group>"; }; > 0873B86A136064EA00A522C2 /* GlyphPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GlyphPage.h; sourceTree = "<group>"; }; > 087558C313B4A57D00F49307 /* SurrogatePairAwareTextIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SurrogatePairAwareTextIterator.cpp; sourceTree = "<group>"; }; > 087558C413B4A57D00F49307 /* SurrogatePairAwareTextIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurrogatePairAwareTextIterator.h; sourceTree = "<group>"; }; >- 087B84951272CEC700A14417 /* SVGAnimatedAngle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedAngle.h; sourceTree = "<group>"; }; >- 0880F70D1282B46D00948505 /* SVGStaticListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGStaticListPropertyTearOff.h; sourceTree = "<group>"; }; > 0885067D11DA045B00182B98 /* PaintInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintInfo.h; sourceTree = "<group>"; }; > 0885067E11DA045B00182B98 /* PaintPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaintPhase.h; sourceTree = "<group>"; }; >- 088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedListPropertyTearOff.h; sourceTree = "<group>"; }; > 088A0DFC126EF1DB00978F7A /* SVGAnimatedProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedProperty.h; sourceTree = "<group>"; }; >- 088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyDescription.h; sourceTree = "<group>"; }; >- 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyTearOff.h; sourceTree = "<group>"; }; >- 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGListPropertyTearOff.h; sourceTree = "<group>"; }; > 088A0E01126EF1DB00978F7A /* SVGProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGProperty.h; sourceTree = "<group>"; }; >- 088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyTearOff.h; sourceTree = "<group>"; }; > 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyTraits.h; sourceTree = "<group>"; }; > 088C2F7512390080003D65CE /* SVGTextLayoutAttributes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextLayoutAttributes.cpp; sourceTree = "<group>"; }; > 088C2F7612390080003D65CE /* SVGTextLayoutAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextLayoutAttributes.h; sourceTree = "<group>"; }; >- 089021A8126EF5DE0092D5EA /* SVGAnimatedLength.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedLength.h; sourceTree = "<group>"; }; >- 089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedLengthList.h; sourceTree = "<group>"; }; > 089582530E857A7E00F82C83 /* ImageLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageLoader.cpp; sourceTree = "<group>"; }; > 089582540E857A7E00F82C83 /* ImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageLoader.h; sourceTree = "<group>"; }; >- 089A8E06128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPathSegListPropertyTearOff.h; sourceTree = "<group>"; }; > 08A484750E5272C500C3FE76 /* ScriptElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptElement.cpp; sourceTree = "<group>"; }; > 08A484760E5272C500C3FE76 /* ScriptElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptElement.h; sourceTree = "<group>"; }; >- 08B35B12127B6A7C005314DD /* SVGAnimatedNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedNumber.h; sourceTree = "<group>"; }; >- 08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedNumberList.h; sourceTree = "<group>"; }; >- 08C859BF1274575300A5728D /* SVGAnimatedRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedRect.h; sourceTree = "<group>"; }; > 08C925170FCC7C4A00480DEC /* FilterEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FilterEffect.cpp; sourceTree = "<group>"; }; > 08C925180FCC7C4A00480DEC /* FilterEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FilterEffect.h; sourceTree = "<group>"; }; >- 08CA3D4312894A3800FFF260 /* SVGMatrixTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMatrixTearOff.h; sourceTree = "<group>"; }; >- 08D46CE2127AD5FC0089694B /* SVGAnimatedEnumeration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedEnumeration.h; sourceTree = "<group>"; }; > 08EDE19E12A50B8E00B95797 /* SVGRect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGRect.h; sourceTree = "<group>"; }; > 08F0BFBD1255C53C00075185 /* SVGTextChunk.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextChunk.cpp; sourceTree = "<group>"; }; > 08F0BFBE1255C53C00075185 /* SVGTextChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextChunk.h; sourceTree = "<group>"; }; >@@ -5634,7 +5546,6 @@ > 08F859D21463F9CD0067D934 /* SVGImageForContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGImageForContainer.cpp; sourceTree = "<group>"; }; > 08F859D31463F9CD0067D933 /* SVGImageCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageCache.h; sourceTree = "<group>"; }; > 08F859D31463F9CD0067D934 /* SVGImageForContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageForContainer.h; sourceTree = "<group>"; }; >- 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPreserveAspectRatio.h; sourceTree = "<group>"; }; > 0AFDAC3C10F5448C00E1F3D2 /* PluginViewBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginViewBase.h; sourceTree = "<group>"; }; > 0B8C56D30F28627F000502E1 /* HTTPHeaderMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTTPHeaderMap.cpp; sourceTree = "<group>"; }; > 0B9056150F2578BE0095FF6A /* DocumentThreadableLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentThreadableLoader.cpp; sourceTree = "<group>"; }; >@@ -7473,14 +7384,7 @@ > 427DA71B13735DFA007C57FB /* JSServiceWorkerInternals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSServiceWorkerInternals.cpp; sourceTree = "<group>"; }; > 427DA71C13735DFA007C57FB /* JSServiceWorkerInternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSServiceWorkerInternals.h; sourceTree = "<group>"; }; > 43107BE118CC19DE00CC18E8 /* SelectorPseudoTypeMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorPseudoTypeMap.h; sourceTree = "<group>"; }; >- 43142E7913B1E97700F1C871 /* SVGAnimatedRect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedRect.cpp; sourceTree = "<group>"; }; >- 431A2F9A13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedNumberOptionalNumber.h; sourceTree = "<group>"; }; >- 431A2F9B13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumberOptionalNumber.cpp; sourceTree = "<group>"; }; >- 431A2FD613B7707A007791E4 /* SVGAnimatedLengthList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedLengthList.cpp; sourceTree = "<group>"; }; >- 431A302013B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedPreserveAspectRatio.cpp; sourceTree = "<group>"; }; >- 431A308713B8F978007791E4 /* SVGAnimatedBoolean.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedBoolean.cpp; sourceTree = "<group>"; }; > 432D3FE718A8658400D7DC03 /* SelectorCheckerTestFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectorCheckerTestFunctions.h; sourceTree = "<group>"; }; >- 4331AC7713B6870000A9E5AE /* SVGAnimatedNumberList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumberList.cpp; sourceTree = "<group>"; }; > 4358E87A1360A2EE00E4748C /* JSSVGFEDropShadowElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGFEDropShadowElement.cpp; sourceTree = "<group>"; }; > 4358E87B1360A2EE00E4748C /* JSSVGFEDropShadowElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGFEDropShadowElement.h; sourceTree = "<group>"; }; > 4358E87E1360A31700E4748C /* FEDropShadow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FEDropShadow.cpp; sourceTree = "<group>"; }; >@@ -7488,7 +7392,6 @@ > 4358E8821360A33B00E4748C /* SVGFEDropShadowElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGFEDropShadowElement.cpp; sourceTree = "<group>"; }; > 4358E8831360A33B00E4748C /* SVGFEDropShadowElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGFEDropShadowElement.h; sourceTree = "<group>"; }; > 4358E8841360A33B00E4748C /* SVGFEDropShadowElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SVGFEDropShadowElement.idl; sourceTree = "<group>"; }; >- 4362C7B813AC6F1A00344BEB /* SVGAnimatedAngle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedAngle.cpp; sourceTree = "<group>"; }; > 4367088112D9CA4A00044234 /* RenderSVGBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGBlock.cpp; sourceTree = "<group>"; }; > 4367088212D9CA4A00044234 /* RenderSVGBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGBlock.h; sourceTree = "<group>"; }; > 4367088312D9CA4A00044234 /* RenderSVGContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGContainer.cpp; sourceTree = "<group>"; }; >@@ -7542,7 +7445,6 @@ > 436708B912D9CA4B00044234 /* SVGResourcesCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResourcesCache.h; sourceTree = "<group>"; }; > 436708BA12D9CA4B00044234 /* SVGResourcesCycleSolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGResourcesCycleSolver.cpp; sourceTree = "<group>"; }; > 436708BB12D9CA4B00044234 /* SVGResourcesCycleSolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGResourcesCycleSolver.h; sourceTree = "<group>"; }; >- 4381763A13A697D4007D1187 /* SVGAnimatedLength.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedLength.cpp; sourceTree = "<group>"; }; > 439046C312DA25E800AF80A2 /* RenderMathMLBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLBlock.cpp; sourceTree = "<group>"; }; > 439046C412DA25E800AF80A2 /* RenderMathMLBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLBlock.h; sourceTree = "<group>"; }; > 439046C512DA25E800AF80A2 /* RenderMathMLFenced.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMathMLFenced.cpp; sourceTree = "<group>"; }; >@@ -7569,25 +7471,16 @@ > 439046D812DA25E800AF80A9 /* RenderMathMLToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLToken.h; sourceTree = "<group>"; }; > 439176CB12DA25E17BAF80A2 /* MathMLStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLStyle.cpp; sourceTree = "<group>"; }; > 439176CC12DA25E17BAF80A2 /* MathMLStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLStyle.h; sourceTree = "<group>"; }; >- 439D334013A6911C00C20F4F /* SVGAnimatedType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedType.h; sourceTree = "<group>"; }; >- 439D334113A6911C00C20F4F /* SVGAnimatedTypeAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedTypeAnimator.h; sourceTree = "<group>"; }; > 439D334213A6911C00C20F4F /* SVGAnimatorFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatorFactory.h; sourceTree = "<group>"; }; >- 43A0F0B013AC7D6D00A5F0A7 /* SVGAnimatedNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedNumber.cpp; sourceTree = "<group>"; }; >- 43A625F613B3304000AC94B8 /* SVGAnimatedColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedColor.h; sourceTree = "<group>"; }; >- 43A625F713B3304000AC94B8 /* SVGAnimatedColor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedColor.cpp; sourceTree = "<group>"; }; >- 43A6266613B3D11000AC94B8 /* SVGAnimatedString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedString.cpp; sourceTree = "<group>"; }; > 43B85ED018CBEACE00E31AF4 /* makeSelectorPseudoClassAndCompatibilityElementMap.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = makeSelectorPseudoClassAndCompatibilityElementMap.py; sourceTree = "<group>"; }; > 43B85ED218CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SelectorPseudoClassAndCompatibilityElementMap.cpp; path = DerivedSources/WebCore/SelectorPseudoClassAndCompatibilityElementMap.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; > 43B85ED318CBEC5200E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.gperf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; name = SelectorPseudoClassAndCompatibilityElementMap.gperf; path = DerivedSources/WebCore/SelectorPseudoClassAndCompatibilityElementMap.gperf; sourceTree = BUILT_PRODUCTS_DIR; }; > 43B85ED618CBEC9700E31AF4 /* SelectorPseudoClassAndCompatibilityElementMap.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SelectorPseudoClassAndCompatibilityElementMap.in; sourceTree = "<group>"; }; >- 43B9336713B261B1004584BF /* SVGAnimatedPointList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPointList.h; sourceTree = "<group>"; }; >- 43B9336813B261B1004584BF /* SVGAnimatedPointList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedPointList.cpp; sourceTree = "<group>"; }; > 43C092B912D9E4EE00A989C3 /* RenderSVGForeignObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGForeignObject.cpp; sourceTree = "<group>"; }; > 43C092BA12D9E4EE00A989C3 /* RenderSVGForeignObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGForeignObject.h; sourceTree = "<group>"; }; > 43D2597613C816F400608559 /* ImageBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageBuffer.cpp; sourceTree = "<group>"; }; > 43EDD67C1B485DBF00640E75 /* CombinedFiltersAlphabet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CombinedFiltersAlphabet.cpp; sourceTree = "<group>"; }; > 43EDD67D1B485DBF00640E75 /* CombinedFiltersAlphabet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CombinedFiltersAlphabet.h; sourceTree = "<group>"; }; >- 43F6FD9513BCD0B100224052 /* SVGAnimatedInteger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedInteger.cpp; sourceTree = "<group>"; }; > 4415292C0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLPlugInImageElement.h; sourceTree = "<group>"; }; > 4415292D0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLPlugInImageElement.cpp; sourceTree = "<group>"; }; > 442956CA218A6D300080DB54 /* DictionaryLookupLegacy.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = DictionaryLookupLegacy.mm; sourceTree = "<group>"; }; >@@ -8548,8 +8441,6 @@ > 550A0BC8085F6039007353D6 /* QualifiedName.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QualifiedName.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; > 55137B2C20379E550001004B /* SVGMarkerTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMarkerTypes.h; sourceTree = "<group>"; }; > 55137B34203CEB710001004B /* SVGValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGValue.h; sourceTree = "<group>"; }; >- 55346AF021150FAF0059BCDD /* SVGAttributeOwnerProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAttributeOwnerProxy.h; sourceTree = "<group>"; }; >- 55346AFA2117FFAF0059BCDD /* SVGAttributeOwnerProxyImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAttributeOwnerProxyImpl.h; sourceTree = "<group>"; }; > 554675771FD1FC1A003B10B0 /* ImageSource.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ImageSource.cpp; sourceTree = "<group>"; }; > 554675781FD1FC1A003B10B0 /* ImageSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ImageSource.h; sourceTree = "<group>"; }; > 5550CB411E955E3C00111AA0 /* ImageTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageTypes.h; sourceTree = "<group>"; }; >@@ -8565,12 +8456,7 @@ > 55AF14E41EAAC59B0026EEAA /* UTIRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UTIRegistry.h; sourceTree = "<group>"; }; > 55D408F71A7C631800C78450 /* SVGImageClients.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageClients.h; sourceTree = "<group>"; }; > 55EC95972069C92D007DD0A9 /* PaintFrequencyTracker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaintFrequencyTracker.h; sourceTree = "<group>"; }; >- 55FA7FEF210FA386005AEFE7 /* SVGAttribute.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAttribute.h; sourceTree = "<group>"; }; >- 55FA7FF4210FB688005AEFE7 /* SVGAttributeAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAttributeAccessor.h; sourceTree = "<group>"; }; >- 55FA7FF6210FBE3E005AEFE7 /* SVGAttributeRegistry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAttributeRegistry.h; sourceTree = "<group>"; }; > 55FA7FFA2110ECD7005AEFE7 /* SVGZoomAndPanType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGZoomAndPanType.h; sourceTree = "<group>"; }; >- 55FA7FFC2110F813005AEFE7 /* SVGAnimatedPathSegListPropertyTearOff.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedPathSegListPropertyTearOff.cpp; sourceTree = "<group>"; }; >- 55FA7FFE21110E6E005AEFE7 /* SVGAnimatedPropertyType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyType.h; sourceTree = "<group>"; }; > 570440571E53851600356601 /* CryptoAlgorithmAES_CFBMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmAES_CFBMac.cpp; sourceTree = "<group>"; }; > 570440591E53936200356601 /* JSAesCbcCfbParams.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAesCbcCfbParams.h; sourceTree = "<group>"; }; > 5704405B1E53937900356601 /* JSAesCbcCfbParams.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAesCbcCfbParams.cpp; sourceTree = "<group>"; }; >@@ -9255,7 +9141,6 @@ > 71556CB61F9F09FC00E78D08 /* JSKeyframeEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSKeyframeEffect.cpp; sourceTree = "<group>"; }; > 71556CB71F9F09FC00E78D08 /* JSKeyframeEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSKeyframeEffect.h; sourceTree = "<group>"; }; > 7157E3D11DC1EE4B0094550E /* scrubbing-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "scrubbing-support.js"; sourceTree = "<group>"; }; >- 7157F061150B6564006EAABD /* SVGAnimatedTransformList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedTransformList.cpp; sourceTree = "<group>"; }; > 715AD71D2050512400D592DC /* DeclarativeAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeclarativeAnimation.h; sourceTree = "<group>"; }; > 715AD71F2050512400D592DC /* DeclarativeAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeclarativeAnimation.cpp; sourceTree = "<group>"; }; > 715DA5D3201BB902002EF2B0 /* JSWebAnimationCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebAnimationCustom.cpp; sourceTree = "<group>"; }; >@@ -9324,7 +9209,6 @@ > 71C29E31203CE76C008F36D2 /* CSSAnimation.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CSSAnimation.idl; sourceTree = "<group>"; }; > 71C5BB1B1FB611EA0007A2AE /* Animatable.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Animatable.idl; sourceTree = "<group>"; }; > 71C916071D1483A300ACA47D /* UserInterfaceLayoutDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInterfaceLayoutDirection.h; sourceTree = "<group>"; }; >- 71CC7A1F152A0BFE009EEAF9 /* SVGAnimatedEnumeration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedEnumeration.cpp; sourceTree = "<group>"; }; > 71D02D901DB55C4E00DD5CF5 /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = main.js; sourceTree = "<group>"; }; > 71D02D921DB55C4E00DD5CF5 /* media-controller.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "media-controller.js"; sourceTree = "<group>"; }; > 71D2554F1DB900020004D76B /* skip-back-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "skip-back-support.js"; sourceTree = "<group>"; }; >@@ -9343,14 +9227,59 @@ > 71DE2794203A9C1C0058CB51 /* compact-media-controls.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "compact-media-controls.js"; sourceTree = "<group>"; }; > 71E2183817359FB8006E6E4D /* PlugInsResources.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; name = PlugInsResources.h; path = DerivedSources/WebCore/PlugInsResources.h; sourceTree = BUILT_PRODUCTS_DIR; }; > 71E2183917359FB8006E6E4D /* PlugInsResourcesData.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = PlugInsResourcesData.cpp; path = DerivedSources/WebCore/PlugInsResourcesData.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; >- 71E623CE151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedIntegerOptionalInteger.cpp; sourceTree = "<group>"; }; >- 71E623CF151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedIntegerOptionalInteger.h; sourceTree = "<group>"; }; > 71EFCED6202B388C00D7C411 /* AnimationEffect.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AnimationEffect.idl; sourceTree = "<group>"; }; > 71EFCED7202B388D00D7C411 /* AnimationEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationEffect.h; sourceTree = "<group>"; }; > 71EFCEDA202B388F00D7C411 /* AnimationEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationEffect.cpp; sourceTree = "<group>"; }; > 71EFCEDE202B39C700D7C411 /* JSAnimationEffectCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAnimationEffectCustom.cpp; sourceTree = "<group>"; }; > 71F936F71DD4F99B00922CC7 /* tracks-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "tracks-support.js"; sourceTree = "<group>"; }; >- 71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedEnumerationPropertyTearOff.h; sourceTree = "<group>"; }; >+ 72227A6C21B4B1F6008EC3E4 /* SVGPropertyOwner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyOwner.h; sourceTree = "<group>"; }; >+ 72227A6D21B4B1F7008EC3E4 /* SVGValueProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGValueProperty.h; sourceTree = "<group>"; }; >+ 72227A6E21B4B302008EC3E4 /* SVGTransformValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTransformValue.h; sourceTree = "<group>"; }; >+ 72227A6F21B4C5FE008EC3E4 /* SVGPathSegImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegImpl.h; sourceTree = "<group>"; }; >+ 72227A7021B4C5FF008EC3E4 /* SVGPathSegValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegValue.h; sourceTree = "<group>"; }; >+ 72227A7121B50900008EC3E4 /* SVGValuePropertyList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGValuePropertyList.h; sourceTree = "<group>"; }; >+ 72227A7221B50901008EC3E4 /* SVGPropertyList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyList.h; sourceTree = "<group>"; }; >+ 72227A7321B50901008EC3E4 /* SVGPrimitiveList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPrimitiveList.h; sourceTree = "<group>"; }; >+ 72227A7421B50901008EC3E4 /* SVGList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGList.h; sourceTree = "<group>"; }; >+ 72227A7521B586E7008EC3E4 /* SVGDecoratedEnumeration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGDecoratedEnumeration.h; sourceTree = "<group>"; }; >+ 72227A7621B586E8008EC3E4 /* SVGDecoratedPrimitive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGDecoratedPrimitive.h; sourceTree = "<group>"; }; >+ 72227A7721B586E8008EC3E4 /* SVGDecoratedProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGDecoratedProperty.h; sourceTree = "<group>"; }; >+ 72227A7F21B6DC6D008EC3E4 /* SVGAnimatedDecoratedProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedDecoratedProperty.h; sourceTree = "<group>"; }; >+ 72227A8021B6DC6E008EC3E4 /* SVGAnimatedPropertyImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyImpl.h; sourceTree = "<group>"; }; >+ 72227A8121B6DC6E008EC3E4 /* SVGAnimatedPrimitiveProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPrimitiveProperty.h; sourceTree = "<group>"; }; >+ 72227A8221B6DC6F008EC3E4 /* SVGAnimatedPropertyList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyList.h; sourceTree = "<group>"; }; >+ 72227A8321B6DC6F008EC3E4 /* SVGAnimatedValueProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedValueProperty.h; sourceTree = "<group>"; }; >+ 72227A8421B6EAA0008EC3E4 /* SVGAnimationAdditiveValueFunctionImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimationAdditiveValueFunctionImpl.cpp; sourceTree = "<group>"; }; >+ 72227A8521B6EAA1008EC3E4 /* SVGAnimationDiscreteFunctionImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimationDiscreteFunctionImpl.h; sourceTree = "<group>"; }; >+ 72227A8621B6EAA1008EC3E4 /* SVGAnimationAdditiveListFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimationAdditiveListFunction.h; sourceTree = "<group>"; }; >+ 72227A8721B6EAA2008EC3E4 /* SVGAnimationAdditiveValueFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimationAdditiveValueFunction.h; sourceTree = "<group>"; }; >+ 72227A8821B6EAA2008EC3E4 /* SVGAnimationAdditiveValueFunctionImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimationAdditiveValueFunctionImpl.h; sourceTree = "<group>"; }; >+ 72227A8921B6EAA3008EC3E4 /* SVGAnimationFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimationFunction.h; sourceTree = "<group>"; }; >+ 72227A8A21B6EAA3008EC3E4 /* SVGAnimationDiscreteFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimationDiscreteFunction.h; sourceTree = "<group>"; }; >+ 72227A8B21B6EAA4008EC3E4 /* SVGAnimationAdditiveListFunctionImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimationAdditiveListFunctionImpl.h; sourceTree = "<group>"; }; >+ 72227A8C21B6EAA4008EC3E4 /* SVGAnimationAdditiveFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimationAdditiveFunction.h; sourceTree = "<group>"; }; >+ 72227A8D21B6F5CB008EC3E4 /* SVGValuePropertyAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGValuePropertyAnimator.h; sourceTree = "<group>"; }; >+ 72227A8E21B6F5CC008EC3E4 /* SVGAnimatedPropertyPairAnimatorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyPairAnimatorImpl.h; sourceTree = "<group>"; }; >+ 72227A8F21B6F5CC008EC3E4 /* SVGAnimatedPropertyAnimatorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyAnimatorImpl.h; sourceTree = "<group>"; }; >+ 72227A9021B6F5CD008EC3E4 /* SVGPrimitivePropertyAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPrimitivePropertyAnimator.h; sourceTree = "<group>"; }; >+ 72227A9121B6F5CD008EC3E4 /* SVGPropertyAnimatorCreator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyAnimatorCreator.h; sourceTree = "<group>"; }; >+ 72227A9221B6F5CE008EC3E4 /* SVGAnimatedPropertyAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyAnimator.h; sourceTree = "<group>"; }; >+ 72227A9321B6F5CE008EC3E4 /* SVGPrimitivePropertyAnimatorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPrimitivePropertyAnimatorImpl.h; sourceTree = "<group>"; }; >+ 72227A9421B6F5CF008EC3E4 /* SVGPropertyAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyAnimator.h; sourceTree = "<group>"; }; >+ 72227A9521B6F5CF008EC3E4 /* SVGAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimator.h; sourceTree = "<group>"; }; >+ 72227A9621B6F5CF008EC3E4 /* SVGValuePropertyListAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGValuePropertyListAnimator.h; sourceTree = "<group>"; }; >+ 72227A9721B6F5D0008EC3E4 /* SVGAnimatedPropertyPairAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyPairAnimator.h; sourceTree = "<group>"; }; >+ 72227A9821B6F5D0008EC3E4 /* SVGValuePropertyAnimatorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGValuePropertyAnimatorImpl.h; sourceTree = "<group>"; }; >+ 72227A9921B6F5D1008EC3E4 /* SVGAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimator.cpp; sourceTree = "<group>"; }; >+ 72227A9A21B6F5D1008EC3E4 /* SVGValuePropertyListAnimatorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGValuePropertyListAnimatorImpl.h; sourceTree = "<group>"; }; >+ 72227A9B21B74E51008EC3E4 /* SVGAnimatedPropertyPairAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyPairAccessor.h; sourceTree = "<group>"; }; >+ 72227A9C21B74E52008EC3E4 /* SVGAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAccessor.h; sourceTree = "<group>"; }; >+ 72227A9D21B74E52008EC3E4 /* SVGPropertyAccessorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyAccessorImpl.h; sourceTree = "<group>"; }; >+ 72227A9E21B74E53008EC3E4 /* SVGPropertyAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyAccessor.h; sourceTree = "<group>"; }; >+ 72227A9F21B74E53008EC3E4 /* SVGAnimatedPropertyAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyAccessor.h; sourceTree = "<group>"; }; >+ 72227AA021B74E54008EC3E4 /* SVGAnimatedPropertyAccessorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyAccessorImpl.h; sourceTree = "<group>"; }; >+ 72227AA121B74E54008EC3E4 /* SVGAnimatedPropertyPairAccessorImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyPairAccessorImpl.h; sourceTree = "<group>"; }; >+ 72227AA221B74E54008EC3E4 /* SVGAccessorPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAccessorPtr.h; sourceTree = "<group>"; }; > 724ED3291A3A7E5400F5F13C /* EXTBlendMinMax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EXTBlendMinMax.cpp; sourceTree = "<group>"; }; > 724ED32A1A3A7E5400F5F13C /* EXTBlendMinMax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXTBlendMinMax.h; sourceTree = "<group>"; }; > 724ED32B1A3A7E5400F5F13C /* EXTBlendMinMax.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EXTBlendMinMax.idl; sourceTree = "<group>"; }; >@@ -9363,6 +9292,8 @@ > 727AFED31A2EA6A0000442E8 /* EXTsRGB.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EXTsRGB.idl; sourceTree = "<group>"; }; > 72E417611A2E8D2F004C562A /* JSEXTsRGB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEXTsRGB.cpp; sourceTree = "<group>"; }; > 72E417621A2E8D2F004C562A /* JSEXTsRGB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEXTsRGB.h; sourceTree = "<group>"; }; >+ 72EF237721B834C20092076B /* SVGPropertyRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyRegistry.h; sourceTree = "<group>"; }; >+ 72EF237921B834C30092076B /* SVGPropertyOwnerRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPropertyOwnerRegistry.h; sourceTree = "<group>"; }; > 72F1AD9F1A3904C300014E18 /* EXTFragDepth.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EXTFragDepth.cpp; sourceTree = "<group>"; }; > 72F1ADA01A3904C300014E18 /* EXTFragDepth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXTFragDepth.h; sourceTree = "<group>"; }; > 72F1ADA11A3904C300014E18 /* EXTFragDepth.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EXTFragDepth.idl; sourceTree = "<group>"; }; >@@ -9567,19 +9498,6 @@ > 7C330A051DF9F95100D3395C /* JSPositionOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSPositionOptions.cpp; sourceTree = "<group>"; }; > 7C330A061DF9F95100D3395C /* JSPositionOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSPositionOptions.h; sourceTree = "<group>"; }; > 7C33F3601B4A050400502CAF /* JSDocumentFragmentCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDocumentFragmentCustom.cpp; sourceTree = "<group>"; }; >- 7C39C3621DDA864900FEFB29 /* SVGLengthListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGLengthListValues.cpp; sourceTree = "<group>"; }; >- 7C39C3631DDA864900FEFB29 /* SVGLengthListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGLengthListValues.h; sourceTree = "<group>"; }; >- 7C39C3661DDB82CF00FEFB29 /* SVGStringListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGStringListValues.cpp; sourceTree = "<group>"; }; >- 7C39C3671DDB82CF00FEFB29 /* SVGStringListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGStringListValues.h; sourceTree = "<group>"; }; >- 7C39C3681DDB86D300FEFB29 /* SVGNumberListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGNumberListValues.cpp; sourceTree = "<group>"; }; >- 7C39C3691DDB86D300FEFB29 /* SVGNumberListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGNumberListValues.h; sourceTree = "<group>"; }; >- 7C39C36A1DDB871C00FEFB29 /* SVGPointListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPointListValues.cpp; sourceTree = "<group>"; }; >- 7C39C36B1DDB871C00FEFB29 /* SVGPointListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPointListValues.h; sourceTree = "<group>"; }; >- 7C39C36C1DDB8BB000FEFB29 /* SVGTransformListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTransformListValues.cpp; sourceTree = "<group>"; }; >- 7C39C36D1DDB8BB000FEFB29 /* SVGTransformListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTransformListValues.h; sourceTree = "<group>"; }; >- 7C39C36E1DDBA3E000FEFB29 /* SVGPathSegListValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSegListValues.cpp; sourceTree = "<group>"; }; >- 7C39C36F1DDBA3E000FEFB29 /* SVGPathSegListValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegListValues.h; sourceTree = "<group>"; }; >- 7C39C3701DDBA44000FEFB29 /* SVGPathSegList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathSegList.cpp; sourceTree = "<group>"; }; > 7C3A91E51C963B8800D1A7E3 /* ClipboardAccessPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClipboardAccessPolicy.h; sourceTree = "<group>"; }; > 7C3B796F1908757B00B47A2D /* UserMessageHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMessageHandler.cpp; sourceTree = "<group>"; }; > 7C3B79701908757B00B47A2D /* UserMessageHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMessageHandler.h; sourceTree = "<group>"; }; >@@ -9828,10 +9746,6 @@ > 7CE58D511DD7B09300128552 /* SVGLength.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGLength.h; sourceTree = "<group>"; }; > 7CE58D521DD7B09300128552 /* SVGLengthValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGLengthValue.cpp; sourceTree = "<group>"; }; > 7CE58D531DD7B09300128552 /* SVGLengthValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGLengthValue.h; sourceTree = "<group>"; }; >- 7CE58D551DD7D96D00128552 /* SVGTransformValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTransformValue.cpp; sourceTree = "<group>"; }; >- 7CE58D561DD7D96D00128552 /* SVGTransformValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTransformValue.h; sourceTree = "<group>"; }; >- 7CE58D591DD7DE5200128552 /* SVGTransform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTransform.cpp; sourceTree = "<group>"; }; >- 7CE58D5B1DD7EC9C00128552 /* SVGMatrixValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGMatrixValue.h; sourceTree = "<group>"; }; > 7CE68342192143A800F4D928 /* UserMessageHandlerDescriptor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserMessageHandlerDescriptor.cpp; sourceTree = "<group>"; }; > 7CE68343192143A800F4D928 /* UserMessageHandlerDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMessageHandlerDescriptor.h; sourceTree = "<group>"; }; > 7CE683461921821500F4D928 /* UserMessageHandlerDescriptorTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserMessageHandlerDescriptorTypes.h; sourceTree = "<group>"; }; >@@ -10002,7 +9916,6 @@ > 836D032D1DA8A13200FFD96B /* JSClipboardEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSClipboardEvent.cpp; sourceTree = "<group>"; }; > 836D032E1DA8A13200FFD96B /* JSClipboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSClipboardEvent.h; sourceTree = "<group>"; }; > 836DAA051CEAB7CD00A2B707 /* RenderDescendantIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderDescendantIterator.h; sourceTree = "<group>"; }; >- 836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedTypeAnimator.cpp; sourceTree = "<group>"; }; > 836FBCEB178C117F00B21A15 /* SVGAnimatedProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedProperty.cpp; sourceTree = "<group>"; }; > 837056881F50915000D93425 /* JSFileCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileCallback.cpp; sourceTree = "<group>"; }; > 837056891F50915000D93425 /* JSFileSystemEntryCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileSystemEntryCallback.h; sourceTree = "<group>"; }; >@@ -10058,22 +9971,6 @@ > 83BB5C871D5D6F3A005A71F4 /* AllDescendantsCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AllDescendantsCollection.h; sourceTree = "<group>"; }; > 83C05A581A686212007E5DEA /* StylePropertyShorthandFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StylePropertyShorthandFunctions.cpp; path = DerivedSources/WebCore/StylePropertyShorthandFunctions.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; > 83C05A591A686212007E5DEA /* StylePropertyShorthandFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StylePropertyShorthandFunctions.h; path = DerivedSources/WebCore/StylePropertyShorthandFunctions.h; sourceTree = BUILT_PRODUCTS_DIR; }; >- 83C1D413178D5AB400141E68 /* SVGPathSegArcAbs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegArcAbs.h; sourceTree = "<group>"; }; >- 83C1D414178D5AB400141E68 /* SVGPathSegArcRel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegArcRel.h; sourceTree = "<group>"; }; >- 83C1D415178D5AB400141E68 /* SVGPathSegCurvetoCubicAbs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegCurvetoCubicAbs.h; sourceTree = "<group>"; }; >- 83C1D416178D5AB400141E68 /* SVGPathSegCurvetoCubicRel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegCurvetoCubicRel.h; sourceTree = "<group>"; }; >- 83C1D417178D5AB400141E68 /* SVGPathSegCurvetoCubicSmoothAbs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegCurvetoCubicSmoothAbs.h; sourceTree = "<group>"; }; >- 83C1D418178D5AB400141E68 /* SVGPathSegCurvetoCubicSmoothRel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegCurvetoCubicSmoothRel.h; sourceTree = "<group>"; }; >- 83C1D419178D5AB400141E68 /* SVGPathSegCurvetoQuadraticAbs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegCurvetoQuadraticAbs.h; sourceTree = "<group>"; }; >- 83C1D41A178D5AB400141E68 /* SVGPathSegCurvetoQuadraticRel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegCurvetoQuadraticRel.h; sourceTree = "<group>"; }; >- 83C1D41B178D5AB400141E68 /* SVGPathSegCurvetoQuadraticSmoothAbs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegCurvetoQuadraticSmoothAbs.h; sourceTree = "<group>"; }; >- 83C1D41C178D5AB400141E68 /* SVGPathSegCurvetoQuadraticSmoothRel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegCurvetoQuadraticSmoothRel.h; sourceTree = "<group>"; }; >- 83C1D41D178D5AB400141E68 /* SVGPathSegLinetoAbs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegLinetoAbs.h; sourceTree = "<group>"; }; >- 83C1D41E178D5AB400141E68 /* SVGPathSegLinetoHorizontalAbs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegLinetoHorizontalAbs.h; sourceTree = "<group>"; }; >- 83C1D41F178D5AB400141E68 /* SVGPathSegLinetoHorizontalRel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegLinetoHorizontalRel.h; sourceTree = "<group>"; }; >- 83C1D420178D5AB400141E68 /* SVGPathSegLinetoRel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegLinetoRel.h; sourceTree = "<group>"; }; >- 83C1D421178D5AB400141E68 /* SVGPathSegLinetoVerticalAbs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegLinetoVerticalAbs.h; sourceTree = "<group>"; }; >- 83C1D422178D5AB400141E68 /* SVGPathSegLinetoVerticalRel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegLinetoVerticalRel.h; sourceTree = "<group>"; }; > 83C1D423178D5AB400141E68 /* SVGPathSegMovetoAbs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegMovetoAbs.h; sourceTree = "<group>"; }; > 83C1D424178D5AB400141E68 /* SVGPathSegMovetoRel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathSegMovetoRel.h; sourceTree = "<group>"; }; > 83C1F5911EDF69D300410D27 /* QualifiedNameCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QualifiedNameCache.cpp; sourceTree = "<group>"; }; >@@ -12203,28 +12100,21 @@ > B22278C40D00BF200071B782 /* SVGPathElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathElement.idl; sourceTree = "<group>"; }; > B22278C50D00BF200071B782 /* SVGPathSeg.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGPathSeg.h; sourceTree = "<group>"; }; > B22278C60D00BF200071B782 /* SVGPathSeg.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSeg.idl; sourceTree = "<group>"; }; >- B22278C80D00BF200071B782 /* SVGPathSegArc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGPathSegArc.h; sourceTree = "<group>"; }; > B22278C90D00BF200071B782 /* SVGPathSegArcAbs.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegArcAbs.idl; sourceTree = "<group>"; }; > B22278CA0D00BF200071B782 /* SVGPathSegArcRel.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegArcRel.idl; sourceTree = "<group>"; }; >- B22278CC0D00BF200071B782 /* SVGPathSegClosePath.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGPathSegClosePath.h; sourceTree = "<group>"; }; > B22278CD0D00BF200071B782 /* SVGPathSegClosePath.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegClosePath.idl; sourceTree = "<group>"; }; >- B22278CF0D00BF200071B782 /* SVGPathSegCurvetoCubic.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGPathSegCurvetoCubic.h; sourceTree = "<group>"; }; > B22278D00D00BF200071B782 /* SVGPathSegCurvetoCubicAbs.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegCurvetoCubicAbs.idl; sourceTree = "<group>"; }; > B22278D10D00BF200071B782 /* SVGPathSegCurvetoCubicRel.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegCurvetoCubicRel.idl; sourceTree = "<group>"; }; >- B22278D30D00BF200071B782 /* SVGPathSegCurvetoCubicSmooth.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGPathSegCurvetoCubicSmooth.h; sourceTree = "<group>"; }; > B22278D40D00BF200071B782 /* SVGPathSegCurvetoCubicSmoothAbs.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegCurvetoCubicSmoothAbs.idl; sourceTree = "<group>"; }; > B22278D50D00BF200071B782 /* SVGPathSegCurvetoCubicSmoothRel.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegCurvetoCubicSmoothRel.idl; sourceTree = "<group>"; }; >- B22278D70D00BF200071B782 /* SVGPathSegCurvetoQuadratic.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGPathSegCurvetoQuadratic.h; sourceTree = "<group>"; }; > B22278D80D00BF200071B782 /* SVGPathSegCurvetoQuadraticAbs.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegCurvetoQuadraticAbs.idl; sourceTree = "<group>"; }; > B22278D90D00BF200071B782 /* SVGPathSegCurvetoQuadraticRel.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegCurvetoQuadraticRel.idl; sourceTree = "<group>"; }; > B22278DC0D00BF200071B782 /* SVGPathSegCurvetoQuadraticSmoothAbs.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegCurvetoQuadraticSmoothAbs.idl; sourceTree = "<group>"; }; > B22278DD0D00BF200071B782 /* SVGPathSegCurvetoQuadraticSmoothRel.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegCurvetoQuadraticSmoothRel.idl; sourceTree = "<group>"; }; > B22278E00D00BF200071B782 /* SVGPathSegLinetoAbs.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegLinetoAbs.idl; sourceTree = "<group>"; }; >- B22278E20D00BF200071B782 /* SVGPathSegLinetoHorizontal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGPathSegLinetoHorizontal.h; sourceTree = "<group>"; }; > B22278E30D00BF200071B782 /* SVGPathSegLinetoHorizontalAbs.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegLinetoHorizontalAbs.idl; sourceTree = "<group>"; }; > B22278E40D00BF200071B782 /* SVGPathSegLinetoHorizontalRel.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegLinetoHorizontalRel.idl; sourceTree = "<group>"; }; > B22278E50D00BF200071B782 /* SVGPathSegLinetoRel.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegLinetoRel.idl; sourceTree = "<group>"; }; >- B22278E70D00BF200071B782 /* SVGPathSegLinetoVertical.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGPathSegLinetoVertical.h; sourceTree = "<group>"; }; > B22278E80D00BF200071B782 /* SVGPathSegLinetoVerticalAbs.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegLinetoVerticalAbs.idl; sourceTree = "<group>"; }; > B22278E90D00BF200071B782 /* SVGPathSegLinetoVerticalRel.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SVGPathSegLinetoVerticalRel.idl; sourceTree = "<group>"; }; > B22278EB0D00BF200071B782 /* SVGPathSegList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SVGPathSegList.h; sourceTree = "<group>"; }; >@@ -15819,30 +15709,57 @@ > 081CDFBD126ECFE800D215CA /* properties */ = { > isa = PBXGroup; > children = ( >- 71FB967A1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h */, >- 088A0DFB126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h */, >- 55FA7FFC2110F813005AEFE7 /* SVGAnimatedPathSegListPropertyTearOff.cpp */, >- 089A8E06128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h */, >+ 72227A9C21B74E52008EC3E4 /* SVGAccessor.h */, >+ 72227AA221B74E54008EC3E4 /* SVGAccessorPtr.h */, >+ 72227A7F21B6DC6D008EC3E4 /* SVGAnimatedDecoratedProperty.h */, >+ 72227A8121B6DC6E008EC3E4 /* SVGAnimatedPrimitiveProperty.h */, > 836FBCEB178C117F00B21A15 /* SVGAnimatedProperty.cpp */, > 088A0DFC126EF1DB00978F7A /* SVGAnimatedProperty.h */, >- 088A0DFD126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h */, >- 088A0DFF126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h */, >- 55FA7FFE21110E6E005AEFE7 /* SVGAnimatedPropertyType.h */, >- 08525E621278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h */, >- 085A15921289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h */, >- 55FA7FEF210FA386005AEFE7 /* SVGAttribute.h */, >- 55FA7FF4210FB688005AEFE7 /* SVGAttributeAccessor.h */, >- 55346AF021150FAF0059BCDD /* SVGAttributeOwnerProxy.h */, >- 55346AFA2117FFAF0059BCDD /* SVGAttributeOwnerProxyImpl.h */, >- 55FA7FF6210FBE3E005AEFE7 /* SVGAttributeRegistry.h */, >- 0810764312828556007C63BA /* SVGListProperty.h */, >- 088A0E00126EF1DB00978F7A /* SVGListPropertyTearOff.h */, >- 08CA3D4312894A3800FFF260 /* SVGMatrixTearOff.h */, >+ 72227A9F21B74E53008EC3E4 /* SVGAnimatedPropertyAccessor.h */, >+ 72227AA021B74E54008EC3E4 /* SVGAnimatedPropertyAccessorImpl.h */, >+ 72227A9221B6F5CE008EC3E4 /* SVGAnimatedPropertyAnimator.h */, >+ 72227A8F21B6F5CC008EC3E4 /* SVGAnimatedPropertyAnimatorImpl.h */, >+ 72227A8021B6DC6E008EC3E4 /* SVGAnimatedPropertyImpl.h */, >+ 72227A8221B6DC6F008EC3E4 /* SVGAnimatedPropertyList.h */, >+ 72227A9B21B74E51008EC3E4 /* SVGAnimatedPropertyPairAccessor.h */, >+ 72227AA121B74E54008EC3E4 /* SVGAnimatedPropertyPairAccessorImpl.h */, >+ 72227A9721B6F5D0008EC3E4 /* SVGAnimatedPropertyPairAnimator.h */, >+ 72227A8E21B6F5CC008EC3E4 /* SVGAnimatedPropertyPairAnimatorImpl.h */, >+ 72227A8321B6DC6F008EC3E4 /* SVGAnimatedValueProperty.h */, >+ 72227A8C21B6EAA4008EC3E4 /* SVGAnimationAdditiveFunction.h */, >+ 72227A8621B6EAA1008EC3E4 /* SVGAnimationAdditiveListFunction.h */, >+ 72227A8B21B6EAA4008EC3E4 /* SVGAnimationAdditiveListFunctionImpl.h */, >+ 72227A8721B6EAA2008EC3E4 /* SVGAnimationAdditiveValueFunction.h */, >+ 72227A8421B6EAA0008EC3E4 /* SVGAnimationAdditiveValueFunctionImpl.cpp */, >+ 72227A8821B6EAA2008EC3E4 /* SVGAnimationAdditiveValueFunctionImpl.h */, >+ 72227A8A21B6EAA3008EC3E4 /* SVGAnimationDiscreteFunction.h */, >+ 72227A8521B6EAA1008EC3E4 /* SVGAnimationDiscreteFunctionImpl.h */, >+ 72227A8921B6EAA3008EC3E4 /* SVGAnimationFunction.h */, >+ 72227A9921B6F5D1008EC3E4 /* SVGAnimator.cpp */, >+ 72227A9521B6F5CF008EC3E4 /* SVGAnimator.h */, >+ 72227A7521B586E7008EC3E4 /* SVGDecoratedEnumeration.h */, >+ 72227A7621B586E8008EC3E4 /* SVGDecoratedPrimitive.h */, >+ 72227A7721B586E8008EC3E4 /* SVGDecoratedProperty.h */, >+ 72227A7421B50901008EC3E4 /* SVGList.h */, >+ 72227A7321B50901008EC3E4 /* SVGPrimitiveList.h */, >+ 72227A9021B6F5CD008EC3E4 /* SVGPrimitivePropertyAnimator.h */, >+ 72227A9321B6F5CE008EC3E4 /* SVGPrimitivePropertyAnimatorImpl.h */, > 088A0E01126EF1DB00978F7A /* SVGProperty.h */, >- 088A0E02126EF1DB00978F7A /* SVGPropertyTearOff.h */, >+ 72227A9E21B74E53008EC3E4 /* SVGPropertyAccessor.h */, >+ 72227A9D21B74E52008EC3E4 /* SVGPropertyAccessorImpl.h */, >+ 72227A9421B6F5CF008EC3E4 /* SVGPropertyAnimator.h */, >+ 72227A9121B6F5CD008EC3E4 /* SVGPropertyAnimatorCreator.h */, >+ 72227A7221B50901008EC3E4 /* SVGPropertyList.h */, >+ 72227A6C21B4B1F6008EC3E4 /* SVGPropertyOwner.h */, >+ 72EF237921B834C30092076B /* SVGPropertyOwnerRegistry.h */, >+ 72EF237721B834C20092076B /* SVGPropertyRegistry.h */, > 088A0E03126EF1DB00978F7A /* SVGPropertyTraits.h */, >- 0880F70D1282B46D00948505 /* SVGStaticListPropertyTearOff.h */, >- 0813A4E91284132600992511 /* SVGStaticPropertyTearOff.h */, >+ 72227A6D21B4B1F7008EC3E4 /* SVGValueProperty.h */, >+ 72227A8D21B6F5CB008EC3E4 /* SVGValuePropertyAnimator.h */, >+ 72227A9821B6F5D0008EC3E4 /* SVGValuePropertyAnimatorImpl.h */, >+ 72227A7121B50900008EC3E4 /* SVGValuePropertyList.h */, >+ 72227A9621B6F5CF008EC3E4 /* SVGValuePropertyListAnimator.h */, >+ 72227A9A21B6F5D1008EC3E4 /* SVGValuePropertyListAnimatorImpl.h */, > ); > path = properties; > sourceTree = "<group>"; >@@ -23475,55 +23392,18 @@ > B22277E30D00BF1F0071B782 /* SVGAnimateColorElement.cpp */, > B22277E40D00BF1F0071B782 /* SVGAnimateColorElement.h */, > B22277E50D00BF1F0071B782 /* SVGAnimateColorElement.idl */, >- 4362C7B813AC6F1A00344BEB /* SVGAnimatedAngle.cpp */, >- 087B84951272CEC700A14417 /* SVGAnimatedAngle.h */, > B22277E60D00BF1F0071B782 /* SVGAnimatedAngle.idl */, >- 431A308713B8F978007791E4 /* SVGAnimatedBoolean.cpp */, >- 085797081278394C00A8EC5F /* SVGAnimatedBoolean.h */, > B22277E70D00BF1F0071B782 /* SVGAnimatedBoolean.idl */, >- 43A625F713B3304000AC94B8 /* SVGAnimatedColor.cpp */, >- 43A625F613B3304000AC94B8 /* SVGAnimatedColor.h */, >- 71CC7A1F152A0BFE009EEAF9 /* SVGAnimatedEnumeration.cpp */, >- 08D46CE2127AD5FC0089694B /* SVGAnimatedEnumeration.h */, > B22277E80D00BF1F0071B782 /* SVGAnimatedEnumeration.idl */, >- 43F6FD9513BCD0B100224052 /* SVGAnimatedInteger.cpp */, >- 0823D158127AD6AC000EBC95 /* SVGAnimatedInteger.h */, > B22277E90D00BF1F0071B782 /* SVGAnimatedInteger.idl */, >- 71E623CE151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.cpp */, >- 71E623CF151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h */, >- 4381763A13A697D4007D1187 /* SVGAnimatedLength.cpp */, >- 089021A8126EF5DE0092D5EA /* SVGAnimatedLength.h */, > B22277EA0D00BF1F0071B782 /* SVGAnimatedLength.idl */, >- 431A2FD613B7707A007791E4 /* SVGAnimatedLengthList.cpp */, >- 089021AC126EF5E90092D5EA /* SVGAnimatedLengthList.h */, > B22277EB0D00BF1F0071B782 /* SVGAnimatedLengthList.idl */, >- 43A0F0B013AC7D6D00A5F0A7 /* SVGAnimatedNumber.cpp */, >- 08B35B12127B6A7C005314DD /* SVGAnimatedNumber.h */, > B22277EC0D00BF1F0071B782 /* SVGAnimatedNumber.idl */, >- 4331AC7713B6870000A9E5AE /* SVGAnimatedNumberList.cpp */, >- 08B35B16127B6A88005314DD /* SVGAnimatedNumberList.h */, > B22277ED0D00BF1F0071B782 /* SVGAnimatedNumberList.idl */, >- 431A2F9B13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.cpp */, >- 431A2F9A13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h */, >- 0863951313B5FE5700BB344D /* SVGAnimatedPath.cpp */, >- 0863951413B5FE5700BB344D /* SVGAnimatedPath.h */, >- 43B9336813B261B1004584BF /* SVGAnimatedPointList.cpp */, >- 43B9336713B261B1004584BF /* SVGAnimatedPointList.h */, >- 431A302013B89DCC007791E4 /* SVGAnimatedPreserveAspectRatio.cpp */, >- 08FE0BC4127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h */, > B22277F40D00BF1F0071B782 /* SVGAnimatedPreserveAspectRatio.idl */, >- 43142E7913B1E97700F1C871 /* SVGAnimatedRect.cpp */, >- 08C859BF1274575300A5728D /* SVGAnimatedRect.h */, > B22277F50D00BF1F0071B782 /* SVGAnimatedRect.idl */, >- 43A6266613B3D11000AC94B8 /* SVGAnimatedString.cpp */, >- 084DB59A128008CC002A6D64 /* SVGAnimatedString.h */, > B22277F60D00BF1F0071B782 /* SVGAnimatedString.idl */, >- 7157F061150B6564006EAABD /* SVGAnimatedTransformList.cpp */, >- 08250938128BD4D800E2ED8E /* SVGAnimatedTransformList.h */, > B22277F80D00BF1F0071B782 /* SVGAnimatedTransformList.idl */, >- 439D334013A6911C00C20F4F /* SVGAnimatedType.h */, >- 836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */, >- 439D334113A6911C00C20F4F /* SVGAnimatedTypeAnimator.h */, > B22277F90D00BF1F0071B782 /* SVGAnimateElement.cpp */, > B22277FA0D00BF1F0071B782 /* SVGAnimateElement.h */, > B22277FB0D00BF1F0071B782 /* SVGAnimateElement.idl */, >@@ -23714,8 +23594,6 @@ > 7134496C146941B300720312 /* SVGLengthContext.h */, > B22278A00D00BF200071B782 /* SVGLengthList.h */, > B22278A10D00BF200071B782 /* SVGLengthList.idl */, >- 7C39C3621DDA864900FEFB29 /* SVGLengthListValues.cpp */, >- 7C39C3631DDA864900FEFB29 /* SVGLengthListValues.h */, > 7CE58D521DD7B09300128552 /* SVGLengthValue.cpp */, > 7CE58D531DD7B09300128552 /* SVGLengthValue.h */, > B22278A20D00BF200071B782 /* SVGLinearGradientElement.cpp */, >@@ -23735,7 +23613,6 @@ > B22278B20D00BF200071B782 /* SVGMaskElement.idl */, > 0806E57912893045007CED32 /* SVGMatrix.h */, > B22278B30D00BF200071B782 /* SVGMatrix.idl */, >- 7CE58D5B1DD7EC9C00128552 /* SVGMatrixValue.h */, > B22278B40D00BF200071B782 /* SVGMetadataElement.cpp */, > B22278B50D00BF200071B782 /* SVGMetadataElement.h */, > B22278B60D00BF200071B782 /* SVGMetadataElement.idl */, >@@ -23749,8 +23626,6 @@ > B22278B90D00BF200071B782 /* SVGNumber.idl */, > B22278BB0D00BF200071B782 /* SVGNumberList.h */, > B22278BC0D00BF200071B782 /* SVGNumberList.idl */, >- 7C39C3681DDB86D300FEFB29 /* SVGNumberListValues.cpp */, >- 7C39C3691DDB86D300FEFB29 /* SVGNumberListValues.h */, > B22278C00D00BF200071B782 /* SVGParserUtilities.cpp */, > B22278C10D00BF200071B782 /* SVGParserUtilities.h */, > 2D3A0E3513A7D76100E85AF0 /* SVGParsingError.h */, >@@ -23771,60 +23646,35 @@ > 8476C9EE11DF6A5800555B02 /* SVGPathParser.h */, > B22278C50D00BF200071B782 /* SVGPathSeg.h */, > B22278C60D00BF200071B782 /* SVGPathSeg.idl */, >- B22278C80D00BF200071B782 /* SVGPathSegArc.h */, >- 83C1D413178D5AB400141E68 /* SVGPathSegArcAbs.h */, > B22278C90D00BF200071B782 /* SVGPathSegArcAbs.idl */, >- 83C1D414178D5AB400141E68 /* SVGPathSegArcRel.h */, > B22278CA0D00BF200071B782 /* SVGPathSegArcRel.idl */, >- B22278CC0D00BF200071B782 /* SVGPathSegClosePath.h */, > B22278CD0D00BF200071B782 /* SVGPathSegClosePath.idl */, >- B22278CF0D00BF200071B782 /* SVGPathSegCurvetoCubic.h */, >- 83C1D415178D5AB400141E68 /* SVGPathSegCurvetoCubicAbs.h */, > B22278D00D00BF200071B782 /* SVGPathSegCurvetoCubicAbs.idl */, >- 83C1D416178D5AB400141E68 /* SVGPathSegCurvetoCubicRel.h */, > B22278D10D00BF200071B782 /* SVGPathSegCurvetoCubicRel.idl */, >- B22278D30D00BF200071B782 /* SVGPathSegCurvetoCubicSmooth.h */, >- 83C1D417178D5AB400141E68 /* SVGPathSegCurvetoCubicSmoothAbs.h */, > B22278D40D00BF200071B782 /* SVGPathSegCurvetoCubicSmoothAbs.idl */, >- 83C1D418178D5AB400141E68 /* SVGPathSegCurvetoCubicSmoothRel.h */, > B22278D50D00BF200071B782 /* SVGPathSegCurvetoCubicSmoothRel.idl */, >- B22278D70D00BF200071B782 /* SVGPathSegCurvetoQuadratic.h */, >- 83C1D419178D5AB400141E68 /* SVGPathSegCurvetoQuadraticAbs.h */, > B22278D80D00BF200071B782 /* SVGPathSegCurvetoQuadraticAbs.idl */, >- 83C1D41A178D5AB400141E68 /* SVGPathSegCurvetoQuadraticRel.h */, > B22278D90D00BF200071B782 /* SVGPathSegCurvetoQuadraticRel.idl */, >- 83C1D41B178D5AB400141E68 /* SVGPathSegCurvetoQuadraticSmoothAbs.h */, > B22278DC0D00BF200071B782 /* SVGPathSegCurvetoQuadraticSmoothAbs.idl */, >- 83C1D41C178D5AB400141E68 /* SVGPathSegCurvetoQuadraticSmoothRel.h */, > B22278DD0D00BF200071B782 /* SVGPathSegCurvetoQuadraticSmoothRel.idl */, >- 83C1D41D178D5AB400141E68 /* SVGPathSegLinetoAbs.h */, >+ 72227A6F21B4C5FE008EC3E4 /* SVGPathSegImpl.h */, > B22278E00D00BF200071B782 /* SVGPathSegLinetoAbs.idl */, >- B22278E20D00BF200071B782 /* SVGPathSegLinetoHorizontal.h */, >- 83C1D41E178D5AB400141E68 /* SVGPathSegLinetoHorizontalAbs.h */, > B22278E30D00BF200071B782 /* SVGPathSegLinetoHorizontalAbs.idl */, >- 83C1D41F178D5AB400141E68 /* SVGPathSegLinetoHorizontalRel.h */, > B22278E40D00BF200071B782 /* SVGPathSegLinetoHorizontalRel.idl */, >- 83C1D420178D5AB400141E68 /* SVGPathSegLinetoRel.h */, > B22278E50D00BF200071B782 /* SVGPathSegLinetoRel.idl */, >- B22278E70D00BF200071B782 /* SVGPathSegLinetoVertical.h */, >- 83C1D421178D5AB400141E68 /* SVGPathSegLinetoVerticalAbs.h */, > B22278E80D00BF200071B782 /* SVGPathSegLinetoVerticalAbs.idl */, >- 83C1D422178D5AB400141E68 /* SVGPathSegLinetoVerticalRel.h */, > B22278E90D00BF200071B782 /* SVGPathSegLinetoVerticalRel.idl */, >- 7C39C3701DDBA44000FEFB29 /* SVGPathSegList.cpp */, > B22278EB0D00BF200071B782 /* SVGPathSegList.h */, > B22278EC0D00BF210071B782 /* SVGPathSegList.idl */, > 8476C9E311DF6A0B00555B02 /* SVGPathSegListBuilder.cpp */, > 8476C9E411DF6A0B00555B02 /* SVGPathSegListBuilder.h */, > 84B6B975120F13E500B8EFAF /* SVGPathSegListSource.cpp */, > 84B6B976120F13E500B8EFAF /* SVGPathSegListSource.h */, >- 7C39C36E1DDBA3E000FEFB29 /* SVGPathSegListValues.cpp */, >- 7C39C36F1DDBA3E000FEFB29 /* SVGPathSegListValues.h */, > 83C1D423178D5AB400141E68 /* SVGPathSegMovetoAbs.h */, > B22278EF0D00BF210071B782 /* SVGPathSegMovetoAbs.idl */, > 83C1D424178D5AB400141E68 /* SVGPathSegMovetoRel.h */, > B22278F00D00BF210071B782 /* SVGPathSegMovetoRel.idl */, >- 082DE42C1292621600D923DF /* SVGPathSegWithContext.h */, >+ 72227A7021B4C5FF008EC3E4 /* SVGPathSegValue.h */, > 84300BD7120C9AD40021954A /* SVGPathSource.h */, > 8419D2B7120E0C7600141F8F /* SVGPathStringBuilder.cpp */, > 8419D2B8120E0C7600141F8F /* SVGPathStringBuilder.h */, >@@ -23841,8 +23691,6 @@ > B22278F40D00BF210071B782 /* SVGPoint.idl */, > B22278F60D00BF210071B782 /* SVGPointList.h */, > B22278F70D00BF210071B782 /* SVGPointList.idl */, >- 7C39C36A1DDB871C00FEFB29 /* SVGPointListValues.cpp */, >- 7C39C36B1DDB871C00FEFB29 /* SVGPointListValues.h */, > B22278F80D00BF210071B782 /* SVGPolyElement.cpp */, > B22278F90D00BF210071B782 /* SVGPolyElement.h */, > B22278FA0D00BF210071B782 /* SVGPolygonElement.cpp */, >@@ -23876,8 +23724,6 @@ > B22279140D00BF210071B782 /* SVGStopElement.idl */, > B22279160D00BF210071B782 /* SVGStringList.h */, > B22279170D00BF210071B782 /* SVGStringList.idl */, >- 7C39C3661DDB82CF00FEFB29 /* SVGStringListValues.cpp */, >- 7C39C3671DDB82CF00FEFB29 /* SVGStringListValues.h */, > B22279210D00BF210071B782 /* SVGStyleElement.cpp */, > B22279220D00BF210071B782 /* SVGStyleElement.h */, > B22279230D00BF210071B782 /* SVGStyleElement.idl */, >@@ -23911,7 +23757,6 @@ > B222793F0D00BF210071B782 /* SVGTitleElement.idl */, > 1CCDF5BB1990332400BCEBAD /* SVGToOTFFontConversion.cpp */, > 1CCDF5BC1990332400BCEBAD /* SVGToOTFFontConversion.h */, >- 7CE58D591DD7DE5200128552 /* SVGTransform.cpp */, > B22279410D00BF210071B782 /* SVGTransform.h */, > B22279420D00BF210071B782 /* SVGTransform.idl */, > B22279430D00BF210071B782 /* SVGTransformable.cpp */, >@@ -23920,10 +23765,7 @@ > B22279470D00BF210071B782 /* SVGTransformDistance.h */, > B22279490D00BF210071B782 /* SVGTransformList.h */, > B222794A0D00BF210071B782 /* SVGTransformList.idl */, >- 7C39C36C1DDB8BB000FEFB29 /* SVGTransformListValues.cpp */, >- 7C39C36D1DDB8BB000FEFB29 /* SVGTransformListValues.h */, >- 7CE58D551DD7D96D00128552 /* SVGTransformValue.cpp */, >- 7CE58D561DD7D96D00128552 /* SVGTransformValue.h */, >+ 72227A6E21B4B302008EC3E4 /* SVGTransformValue.h */, > B222794B0D00BF210071B782 /* SVGTRefElement.cpp */, > B222794C0D00BF210071B782 /* SVGTRefElement.h */, > B222794D0D00BF210071B782 /* SVGTRefElement.idl */, >@@ -27822,6 +27664,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 */, >@@ -28111,6 +27954,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 */, >@@ -30238,6 +30082,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 */, >@@ -31113,44 +30958,13 @@ > 24D912B813CA9A6900D21915 /* SVGAltGlyphItemElement.h in Headers */, > B22279770D00BF220071B782 /* SVGAngle.h in Headers */, > B222797A0D00BF220071B782 /* SVGAnimateColorElement.h in Headers */, >- 087B84961272CEC800A14417 /* SVGAnimatedAngle.h in Headers */, >- 085797091278394C00A8EC5F /* SVGAnimatedBoolean.h in Headers */, >- 43A625F813B3304000AC94B8 /* SVGAnimatedColor.h in Headers */, >- 08D46CE3127AD5FC0089694B /* SVGAnimatedEnumeration.h in Headers */, >- 71FB967B1383D64600AC8A4C /* SVGAnimatedEnumerationPropertyTearOff.h in Headers */, >- 0823D159127AD6AC000EBC95 /* SVGAnimatedInteger.h in Headers */, >- 71E623D1151F72A60036E2F4 /* SVGAnimatedIntegerOptionalInteger.h in Headers */, >- 089021A9126EF5DE0092D5EA /* SVGAnimatedLength.h in Headers */, >- 089021AD126EF5E90092D5EA /* SVGAnimatedLengthList.h in Headers */, >- 088A0E04126EF1DB00978F7A /* SVGAnimatedListPropertyTearOff.h in Headers */, >- 08B35B13127B6A7C005314DD /* SVGAnimatedNumber.h in Headers */, >- 08B35B17127B6A88005314DD /* SVGAnimatedNumberList.h in Headers */, >- 431A2F9C13B6F2B0007791E4 /* SVGAnimatedNumberOptionalNumber.h in Headers */, >- 0863951613B5FE5700BB344D /* SVGAnimatedPath.h in Headers */, >- 089A8E07128D8B3D00E7A534 /* SVGAnimatedPathSegListPropertyTearOff.h in Headers */, >- 43B9336913B261B1004584BF /* SVGAnimatedPointList.h in Headers */, >- 08FE0BC5127E2AC1000C4FB5 /* SVGAnimatedPreserveAspectRatio.h in Headers */, > 55FA8001211113EE005AEFE7 /* SVGAnimatedProperty.h in Headers */, >- 088A0E06126EF1DB00978F7A /* SVGAnimatedPropertyDescription.h in Headers */, >- 088A0E08126EF1DB00978F7A /* SVGAnimatedPropertyTearOff.h in Headers */, >- 55FA7FFF21110E6E005AEFE7 /* SVGAnimatedPropertyType.h in Headers */, >- 08C859C01274575400A5728D /* SVGAnimatedRect.h in Headers */, >- 08525E631278C00100A84778 /* SVGAnimatedStaticPropertyTearOff.h in Headers */, >- 084DB59B128008CC002A6D64 /* SVGAnimatedString.h in Headers */, >- 08250939128BD4D800E2ED8E /* SVGAnimatedTransformList.h in Headers */, >- 085A15931289A8DD002710E3 /* SVGAnimatedTransformListPropertyTearOff.h in Headers */, >- 439D334313A6911C00C20F4F /* SVGAnimatedType.h in Headers */, >- 439D334413A6911C00C20F4F /* SVGAnimatedTypeAnimator.h in Headers */, > B22279900D00BF220071B782 /* SVGAnimateElement.h in Headers */, > 832B843419D8E55100B26055 /* SVGAnimateElementBase.h in Headers */, > B22279930D00BF220071B782 /* SVGAnimateMotionElement.h in Headers */, > B22279950D00BF220071B782 /* SVGAnimateTransformElement.h in Headers */, > B22279980D00BF220071B782 /* SVGAnimationElement.h in Headers */, > 439D334513A6911C00C20F4F /* SVGAnimatorFactory.h in Headers */, >- 55FA7FF0210FA386005AEFE7 /* SVGAttribute.h in Headers */, >- 55FA7FF5210FB6B1005AEFE7 /* SVGAttributeAccessor.h in Headers */, >- 55346AF121150FAF0059BCDD /* SVGAttributeOwnerProxy.h in Headers */, >- 55FA7FF7210FBE3E005AEFE7 /* SVGAttributeRegistry.h in Headers */, > B222799C0D00BF220071B782 /* SVGCircleElement.h in Headers */, > B222799F0D00BF220071B782 /* SVGClipPathElement.h in Headers */, > B22279A50D00BF220071B782 /* SVGComponentTransferFunctionElement.h in Headers */, >@@ -31221,19 +31035,14 @@ > B2227A300D00BF220071B782 /* SVGLangSpace.h in Headers */, > 7134496E146941B300720312 /* SVGLengthContext.h in Headers */, > B2227A360D00BF220071B782 /* SVGLengthList.h in Headers */, >- 7C39C3651DDA865200FEFB29 /* SVGLengthListValues.h in Headers */, > 7CCEBFC01DD8F6AB002C40B8 /* SVGLengthValue.h in Headers */, > B2227A390D00BF220071B782 /* SVGLinearGradientElement.h in Headers */, > B2227A3C0D00BF220071B782 /* SVGLineElement.h in Headers */, >- 0810764412828556007C63BA /* SVGListProperty.h in Headers */, >- 088A0E09126EF1DB00978F7A /* SVGListPropertyTearOff.h in Headers */, > B2227A410D00BF220071B782 /* SVGLocatable.h in Headers */, > 436708EE12D9CA4B00044234 /* SVGMarkerData.h in Headers */, > B2227A440D00BF220071B782 /* SVGMarkerElement.h in Headers */, > B2227A470D00BF220071B782 /* SVGMaskElement.h in Headers */, > 0806E57A12893045007CED32 /* SVGMatrix.h in Headers */, >- 08CA3D4412894A3800FFF260 /* SVGMatrixTearOff.h in Headers */, >- 7CE58D5C1DD7EC9C00128552 /* SVGMatrixValue.h in Headers */, > B2227A4B0D00BF220071B782 /* SVGMetadataElement.h in Headers */, > B2A1F2B10CEF0ABF00442F6A /* SVGMissingGlyphElement.h in Headers */, > B2227A4E0D00BF220071B782 /* SVGMPathElement.h in Headers */, >@@ -31251,35 +31060,11 @@ > B2227A590D00BF220071B782 /* SVGPathElement.h in Headers */, > 8476C9F011DF6A5800555B02 /* SVGPathParser.h in Headers */, > B2227A5B0D00BF220071B782 /* SVGPathSeg.h in Headers */, >- B2227A5E0D00BF220071B782 /* SVGPathSegArc.h in Headers */, >- 83C1D425178D5AB400141E68 /* SVGPathSegArcAbs.h in Headers */, >- 83C1D426178D5AB400141E68 /* SVGPathSegArcRel.h in Headers */, >- B2227A620D00BF220071B782 /* SVGPathSegClosePath.h in Headers */, >- B2227A650D00BF220071B782 /* SVGPathSegCurvetoCubic.h in Headers */, >- 83C1D427178D5AB400141E68 /* SVGPathSegCurvetoCubicAbs.h in Headers */, >- 83C1D428178D5AB400141E68 /* SVGPathSegCurvetoCubicRel.h in Headers */, >- B2227A690D00BF220071B782 /* SVGPathSegCurvetoCubicSmooth.h in Headers */, >- 83C1D429178D5AB400141E68 /* SVGPathSegCurvetoCubicSmoothAbs.h in Headers */, >- 83C1D42A178D5AB400141E68 /* SVGPathSegCurvetoCubicSmoothRel.h in Headers */, >- B2227A6D0D00BF220071B782 /* SVGPathSegCurvetoQuadratic.h in Headers */, >- 83C1D42B178D5AB400141E68 /* SVGPathSegCurvetoQuadraticAbs.h in Headers */, >- 83C1D42C178D5AB500141E68 /* SVGPathSegCurvetoQuadraticRel.h in Headers */, >- 83C1D42D178D5AB500141E68 /* SVGPathSegCurvetoQuadraticSmoothAbs.h in Headers */, >- 83C1D42E178D5AB500141E68 /* SVGPathSegCurvetoQuadraticSmoothRel.h in Headers */, >- 83C1D42F178D5AB500141E68 /* SVGPathSegLinetoAbs.h in Headers */, >- B2227A780D00BF220071B782 /* SVGPathSegLinetoHorizontal.h in Headers */, >- 83C1D430178D5AB500141E68 /* SVGPathSegLinetoHorizontalAbs.h in Headers */, >- 83C1D431178D5AB500141E68 /* SVGPathSegLinetoHorizontalRel.h in Headers */, >- 83C1D432178D5AB500141E68 /* SVGPathSegLinetoRel.h in Headers */, >- B2227A7D0D00BF220071B782 /* SVGPathSegLinetoVertical.h in Headers */, >- 83C1D433178D5AB500141E68 /* SVGPathSegLinetoVerticalAbs.h in Headers */, >- 83C1D434178D5AB500141E68 /* SVGPathSegLinetoVerticalRel.h in Headers */, > B2227A810D00BF220071B782 /* SVGPathSegList.h in Headers */, > 8476C9E611DF6A0B00555B02 /* SVGPathSegListBuilder.h in Headers */, > 84B6B978120F13E500B8EFAF /* SVGPathSegListSource.h in Headers */, > 83C1D435178D5AB500141E68 /* SVGPathSegMovetoAbs.h in Headers */, > 83C1D436178D5AB500141E68 /* SVGPathSegMovetoRel.h in Headers */, >- 082DE42D1292621600D923DF /* SVGPathSegWithContext.h in Headers */, > 84300BD8120C9AD40021954A /* SVGPathSource.h in Headers */, > 8419D2BA120E0C7600141F8F /* SVGPathStringBuilder.h in Headers */, > 84300BD6120C9AAC0021954A /* SVGPathStringSource.h in Headers */, >@@ -31293,7 +31078,6 @@ > B2227A940D00BF220071B782 /* SVGPolylineElement.h in Headers */, > B2227A970D00BF220071B782 /* SVGPreserveAspectRatio.h in Headers */, > 088A0E0A126EF1DB00978F7A /* SVGProperty.h in Headers */, >- 088A0E0B126EF1DB00978F7A /* SVGPropertyTearOff.h in Headers */, > 088A0E0C126EF1DB00978F7A /* SVGPropertyTraits.h in Headers */, > B2227A9A0D00BF220071B782 /* SVGRadialGradientElement.h in Headers */, > 08EDE19F12A50B8E00B95797 /* SVGRect.h in Headers */, >@@ -31311,11 +31095,8 @@ > B2227AA30D00BF220071B782 /* SVGScriptElement.h in Headers */, > B2227AA60D00BF220071B782 /* SVGSetElement.h in Headers */, > E4AFD0100DAF335500F5F55C /* SVGSMILElement.h in Headers */, >- 0880F70E1282B46D00948505 /* SVGStaticListPropertyTearOff.h in Headers */, >- 0813A4EA1284132600992511 /* SVGStaticPropertyTearOff.h in Headers */, > B2227AA90D00BF220071B782 /* SVGStopElement.h in Headers */, > B2227AAC0D00BF220071B782 /* SVGStringList.h in Headers */, >- 7C39C3771DDBE17000FEFB29 /* SVGStringListValues.h in Headers */, > B2227AB80D00BF220071B782 /* SVGStyleElement.h in Headers */, > B2227ABB0D00BF220071B782 /* SVGSVGElement.h in Headers */, > B2227ABE0D00BF220071B782 /* SVGSwitchElement.h in Headers */, >@@ -31342,7 +31123,6 @@ > B2227ADA0D00BF220071B782 /* SVGTransformable.h in Headers */, > B2227ADD0D00BF220071B782 /* SVGTransformDistance.h in Headers */, > B2227ADF0D00BF220071B782 /* SVGTransformList.h in Headers */, >- 7CE58D581DD7D96D00128552 /* SVGTransformValue.h in Headers */, > B2227AE20D00BF220071B782 /* SVGTRefElement.h in Headers */, > B2227AE50D00BF220071B782 /* SVGTSpanElement.h in Headers */, > B2227AE70D00BF220071B782 /* SVGUnitTypes.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/bindings/js/JSSVGPathSegCustom.cpp b/Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp >index 86adb9d339f..08173ee0195 100644 >--- a/Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp >+++ b/Source/WebCore/bindings/js/JSSVGPathSegCustom.cpp >@@ -41,20 +41,6 @@ > #include "JSSVGPathSegMovetoAbs.h" > #include "JSSVGPathSegMovetoRel.h" > #include "SVGPathSeg.h" >-#include "SVGPathSegArc.h" >-#include "SVGPathSegClosePath.h" >-#include "SVGPathSegCurvetoCubic.h" >-#include "SVGPathSegCurvetoCubicSmooth.h" >-#include "SVGPathSegCurvetoQuadratic.h" >-#include "SVGPathSegCurvetoQuadraticSmoothAbs.h" >-#include "SVGPathSegCurvetoQuadraticSmoothRel.h" >-#include "SVGPathSegLinetoAbs.h" >-#include "SVGPathSegLinetoHorizontal.h" >-#include "SVGPathSegLinetoRel.h" >-#include "SVGPathSegLinetoVertical.h" >-#include "SVGPathSegMovetoAbs.h" >-#include "SVGPathSegMovetoRel.h" >- > > namespace WebCore { > using namespace JSC; >diff --git a/Source/WebCore/bindings/scripts/CodeGenerator.pm b/Source/WebCore/bindings/scripts/CodeGenerator.pm >index 75c19ecdba8..6268cf77682 100644 >--- a/Source/WebCore/bindings/scripts/CodeGenerator.pm >+++ b/Source/WebCore/bindings/scripts/CodeGenerator.pm >@@ -619,6 +619,22 @@ sub IsSVGAnimatedType > return $object->IsSVGAnimatedTypeName($type->name); > } > >+sub IsSVGPathSegTypeName >+{ >+ my ($object, $typeName) = @_; >+ >+ return $typeName =~ /^SVGPathSeg/; >+} >+ >+sub IsSVGPathSegType >+{ >+ my ($object, $type) = @_; >+ >+ assert("Not a type") if ref($type) ne "IDLType"; >+ >+ return $object->IsSVGPathSegTypeName($type->name); >+} >+ > sub IsConstructorType > { > my ($object, $type) = @_; >@@ -783,11 +799,6 @@ sub AttributeNameForGetterAndSetter > if ($attribute->extendedAttributes->{"ImplementedAs"}) { > $attributeName = $attribute->extendedAttributes->{"ImplementedAs"}; > } >- my $attributeType = $attribute->type; >- >- # SVG animated types need to use a special attribute name. >- # The rest of the special casing for SVG animated types is handled in the language-specific code generators. >- $attributeName .= "Animated" if $generator->IsSVGAnimatedType($attributeType); > > return $attributeName; > } >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >index 65e4536fa6e..a68964dda84 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >@@ -2499,8 +2499,6 @@ sub GenerateHeader > } > } > >- $headerIncludes{"$interfaceName.h"} = 1 if $hasParent && $interface->extendedAttributes->{JSGenerateToNativeObject}; >- > $headerIncludes{"SVGElement.h"} = 1 if $className =~ /^JSSVG/; > > my $implType = GetImplClassName($interface); >@@ -2512,8 +2510,11 @@ sub GenerateHeader > push(@headerContent, "\nnamespace WebCore {\n\n"); > > if ($codeGenerator->IsSVGAnimatedType($interface->type)) { >- $headerIncludes{"$interfaceName.h"} = 1; >+ $headerIncludes{"SVGAnimatedPropertyImpl.h"} = 1; >+ } elsif ($codeGenerator->IsSVGPathSegType($interface->type)) { >+ $headerIncludes{"SVGPathSegImpl.h"} = 1; > } else { >+ $headerIncludes{"$interfaceName.h"} = 1 if $hasParent && $interface->extendedAttributes->{JSGenerateToNativeObject}; > # Implementation class forward declaration > if (IsDOMGlobalObject($interface)) { > AddClassForwardIfNeeded($interface->type); >@@ -2563,7 +2564,9 @@ sub GenerateHeader > push(@headerContent, " return ptr;\n"); > push(@headerContent, " }\n\n"); > } else { >- AddIncludesForImplementationTypeInHeader($implType); >+ if (!$codeGenerator->IsSVGAnimatedType($interface->type) && !$codeGenerator->IsSVGPathSegType($interface->type)) { >+ AddIncludesForImplementationTypeInHeader($implType); >+ } > push(@headerContent, " static $className* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<$implType>&& impl)\n"); > push(@headerContent, " {\n"); > push(@headerContent, " $className* ptr = new (NotNull, JSC::allocateCell<$className>(globalObject->vm().heap)) $className(structure, *globalObject, WTFMove(impl));\n"); >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 efd1cf1a234..cb9fd8e5994 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 e63200697a6..158b83a7335 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/SVGAElement.cpp b/Source/WebCore/svg/SVGAElement.cpp >index ca9cdf06b9b..481d93f9318 100644 >--- a/Source/WebCore/svg/SVGAElement.cpp >+++ b/Source/WebCore/svg/SVGAElement.cpp >@@ -52,7 +52,11 @@ inline SVGAElement::SVGAElement(const QualifiedName& tagName, Document& document > , SVGURIReference(this) > { > ASSERT(hasTagName(SVGNames::aTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::targetAttr, &SVGAElement::m_target>(); >+ }); > } > > Ref<SVGAElement> SVGAElement::create(const QualifiedName& tagName, Document& document) >@@ -71,18 +75,10 @@ String SVGAElement::title() const > return SVGElement::title(); > } > >-void SVGAElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::targetAttr, &SVGAElement::m_target>(); >-} >- > void SVGAElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::targetAttr) { >- m_target.setValue(value); >+ m_target->setBaseValInternal(value); > return; > } > >@@ -95,7 +91,8 @@ void SVGAElement::svgAttributeChanged(const QualifiedName& attrName) > { > if (SVGURIReference::isKnownAttribute(attrName)) { > bool wasLink = isLink(); >- setIsLink(!href().isNull() && !shouldProhibitLinks(this)); >+ String href = this->href()->currentValue(); >+ setIsLink(!href.isNull() && !shouldProhibitLinks(this)); > if (wasLink != isLink()) { > InstanceInvalidationGuard guard(*this); > invalidateStyleForSubtree(); >@@ -125,7 +122,8 @@ void SVGAElement::defaultEventHandler(Event& event) > } > > if (MouseEvent::canTriggerActivationBehavior(event)) { >- String url = stripLeadingAndTrailingHTMLSpaces(href()); >+ String href = this->href()->currentValue(); >+ String url = stripLeadingAndTrailingHTMLSpaces(href); > > if (url[0] == '#') { > auto targetElement = makeRefPtr(treeScope().getElementById(url.substringSharingImpl(1))); >@@ -139,7 +137,7 @@ void SVGAElement::defaultEventHandler(Event& event) > return; > } > >- String target = this->target(); >+ String target = this->target()->currentValue(); > if (target.isEmpty() && attributeWithoutSynchronization(XLinkNames::showAttr) == "new") > target = "_blank"; > event.setDefaultHandled(); >diff --git a/Source/WebCore/svg/SVGAElement.h b/Source/WebCore/svg/SVGAElement.h >index d41ad0b3522..c39ee2f5851 100644 >--- a/Source/WebCore/svg/SVGAElement.h >+++ b/Source/WebCore/svg/SVGAElement.h >@@ -33,17 +33,15 @@ class SVGAElement final : public SVGGraphicsElement, public SVGExternalResources > public: > static Ref<SVGAElement> create(const QualifiedName&, Document&); > >- String target() const final { return m_target.currentValue(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> targetAnimated() { return m_target.animatedProperty(attributeOwnerProxy()); } >+ String target() const final { return m_target->currentValue(); } >+ Ref<SVGAnimatedString>& target() { return m_target; } > > private: > SVGAElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGAElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGURIReference>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGAElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGURIReference>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -63,8 +61,8 @@ private: > > bool willRespondToMouseClickEvents() final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_target; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_target { SVGAnimatedString::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAltGlyphElement.h b/Source/WebCore/svg/SVGAltGlyphElement.h >index 3b4e861a301..c305eb32cb6 100644 >--- a/Source/WebCore/svg/SVGAltGlyphElement.h >+++ b/Source/WebCore/svg/SVGAltGlyphElement.h >@@ -45,13 +45,13 @@ public: > private: > SVGAltGlyphElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGAltGlyphElement, SVGTextPositioningElement, SVGURIReference>; >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGAltGlyphElement, SVGTextPositioningElement, SVGURIReference>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; > bool childShouldCreateRenderer(const Node&) const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAngle.h b/Source/WebCore/svg/SVGAngle.h >index c02fa04f5fc..013732e2008 100644 >--- a/Source/WebCore/svg/SVGAngle.h >+++ b/Source/WebCore/svg/SVGAngle.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -26,32 +26,37 @@ > #pragma once > > #include "SVGAngleValue.h" >-#include "SVGPropertyTearOff.h" >+#include "SVGValueProperty.h" > > namespace WebCore { > >-class SVGAngle : public SVGPropertyTearOff<SVGAngleValue> { >+class SVGAngle : public SVGValueProperty<SVGAngleValue> { >+ using Base = SVGValueProperty<SVGAngleValue>; >+ using Base::Base; >+ using Base::m_value; >+ > public: >- static Ref<SVGAngle> create(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGAngleValue& value) >+ static Ref<SVGAngle> create(const SVGAngleValue& value = { }) > { >- return adoptRef(*new SVGAngle(animatedProperty, role, value)); >+ return adoptRef(*new SVGAngle(value)); > } > >- static Ref<SVGAngle> create(const SVGAngleValue& initialValue = { }) >+ static Ref<SVGAngle> create(SVGPropertyOwner* owner, SVGPropertyAccess access, const SVGAngleValue& value = { }) > { >- return adoptRef(*new SVGAngle(initialValue)); >+ return adoptRef(*new SVGAngle(owner, access, value)); > } > >- template<typename T> static ExceptionOr<Ref<SVGAngle>> create(ExceptionOr<T>&& initialValue) >+ template<typename T> >+ static ExceptionOr<Ref<SVGAngle>> create(ExceptionOr<T>&& value) > { >- if (initialValue.hasException()) >- return initialValue.releaseException(); >- return create(initialValue.releaseReturnValue()); >+ if (value.hasException()) >+ return value.releaseException(); >+ return adoptRef(*new SVGAngle(value.releaseReturnValue())); > } > > SVGAngleValue::Type unitType() > { >- return propertyReference().unitType(); >+ return m_value.unitType(); > } > > ExceptionOr<void> setValueForBindings(float value) >@@ -59,15 +64,14 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setValue(value); >+ m_value.setValue(value); > commitChange(); >- > return { }; > } > > float valueForBindings() > { >- return propertyReference().value(); >+ return m_value.value(); > } > > ExceptionOr<void> setValueInSpecifiedUnits(float valueInSpecifiedUnits) >@@ -75,15 +79,14 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setValueInSpecifiedUnits(valueInSpecifiedUnits); >+ m_value.setValueInSpecifiedUnits(valueInSpecifiedUnits); > commitChange(); >- > return { }; > } > > float valueInSpecifiedUnits() > { >- return propertyReference().valueInSpecifiedUnits(); >+ return m_value.valueInSpecifiedUnits(); > } > > ExceptionOr<void> setValueAsString(const String& value) >@@ -91,7 +94,7 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- auto result = propertyReference().setValueAsString(value); >+ auto result = m_value.setValueAsString(value); > if (result.hasException()) > return result; > >@@ -99,9 +102,9 @@ public: > return result; > } > >- String valueAsString() >+ String valueAsString() const override > { >- return propertyReference().valueAsString(); >+ return m_value.valueAsString(); > } > > ExceptionOr<void> newValueSpecifiedUnits(unsigned short unitType, float valueInSpecifiedUnits) >@@ -109,7 +112,7 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- auto result = propertyReference().newValueSpecifiedUnits(unitType, valueInSpecifiedUnits); >+ auto result = m_value.newValueSpecifiedUnits(unitType, valueInSpecifiedUnits); > if (result.hasException()) > return result; > >@@ -122,24 +125,13 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- auto result = propertyReference().convertToSpecifiedUnits(unitType); >+ auto result = m_value.convertToSpecifiedUnits(unitType); > if (result.hasException()) > return result; > > commitChange(); > return result; > } >- >-private: >- SVGAngle(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGAngleValue& value) >- : SVGPropertyTearOff<SVGAngleValue>(&animatedProperty, role, value) >- { >- } >- >- explicit SVGAngle(const SVGAngleValue& initialValue) >- : SVGPropertyTearOff<SVGAngleValue>(initialValue) >- { >- } > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAngleValue.h b/Source/WebCore/svg/SVGAngleValue.h >index 4d402f7fcd4..5978af4278c 100644 >--- a/Source/WebCore/svg/SVGAngleValue.h >+++ b/Source/WebCore/svg/SVGAngleValue.h >@@ -2,6 +2,7 @@ > * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> > * 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 >@@ -56,10 +57,4 @@ private: > float m_valueInSpecifiedUnits { 0 }; > }; > >-template<> >-struct SVGPropertyTraits<SVGAngleValue> { >- static SVGAngleValue initialValue() { return SVGAngleValue(); } >- static String toString(const SVGAngleValue& type) { return type.valueAsString(); } >-}; >- > } >diff --git a/Source/WebCore/svg/SVGAnimateColorElement.cpp b/Source/WebCore/svg/SVGAnimateColorElement.cpp >index 0b82c1ab9c0..4bbb140eac5 100644 >--- a/Source/WebCore/svg/SVGAnimateColorElement.cpp >+++ b/Source/WebCore/svg/SVGAnimateColorElement.cpp >@@ -2,6 +2,7 @@ > * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> > * Copyright (C) 2007 Eric Seidel <eric@webkit.org> >+ * 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 >@@ -40,19 +41,4 @@ Ref<SVGAnimateColorElement> SVGAnimateColorElement::create(const QualifiedName& > return adoptRef(*new SVGAnimateColorElement(tagName, document)); > } > >-static bool attributeValueIsCurrentColor(const String& value) >-{ >- static NeverDestroyed<const AtomicString> currentColor("currentColor", AtomicString::ConstructFromLiteral); >- return value == currentColor; >-} >- >-void SVGAnimateColorElement::determinePropertyValueTypes(const String& from, const String& to) >-{ >- SVGAnimateElementBase::determinePropertyValueTypes(from, to); >- if (attributeValueIsCurrentColor(from)) >- m_fromPropertyValueType = CurrentColorValue; >- if (attributeValueIsCurrentColor(to)) >- m_toPropertyValueType = CurrentColorValue; >-} >- > } >diff --git a/Source/WebCore/svg/SVGAnimateColorElement.h b/Source/WebCore/svg/SVGAnimateColorElement.h >index 87ba96c84b3..e38aa743f2d 100644 >--- a/Source/WebCore/svg/SVGAnimateColorElement.h >+++ b/Source/WebCore/svg/SVGAnimateColorElement.h >@@ -32,7 +32,6 @@ public: > > private: > SVGAnimateColorElement(const QualifiedName&, Document&); >- void determinePropertyValueTypes(const String& from, const String& to) override; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAnimateElementBase.cpp b/Source/WebCore/svg/SVGAnimateElementBase.cpp >index 2a7e079755f..820d70a3544 100644 >--- a/Source/WebCore/svg/SVGAnimateElementBase.cpp >+++ b/Source/WebCore/svg/SVGAnimateElementBase.cpp >@@ -1,9 +1,9 @@ > /* > * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> >- * Copyright (C) 2008 Apple Inc. All rights reserved. > * Copyright (C) Research In Motion Limited 2011. All rights reserved. > * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved. >+ * Copyright (C) 2008-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 >@@ -24,13 +24,10 @@ > #include "config.h" > #include "SVGAnimateElementBase.h" > >-#include "CSSPropertyNames.h" >-#include "CSSPropertyParser.h" > #include "QualifiedName.h" >-#include "RenderObject.h" >-#include "SVGAnimatorFactory.h" >+#include "SVGAnimator.h" > #include "SVGElement.h" >-#include "SVGNames.h" >+#include "SVGPropertyAnimatorCreator.h" > #include "StyleProperties.h" > #include <wtf/IsoMallocInlines.h> > >@@ -40,413 +37,154 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(SVGAnimateElementBase); > > SVGAnimateElementBase::SVGAnimateElementBase(const QualifiedName& tagName, Document& document) > : SVGAnimationElement(tagName, document) >- , m_animatedPropertyType(AnimatedString) > { > ASSERT(hasTagName(SVGNames::animateTag) || hasTagName(SVGNames::setTag) || hasTagName(SVGNames::animateColorTag) || hasTagName(SVGNames::animateTransformTag)); > } > >-SVGAnimateElementBase::~SVGAnimateElementBase() = default; >- >-bool SVGAnimateElementBase::hasValidAttributeType() >+void SVGAnimateElementBase::setTargetElement(SVGElement* target) > { >- if (!this->targetElement()) >- return false; >- >- return m_animatedPropertyType != AnimatedUnknown && !hasInvalidCSSAttributeType(); >+ SVGAnimationElement::setTargetElement(target); >+ resetAnimation(); > } > >-AnimatedPropertyType SVGAnimateElementBase::determineAnimatedPropertyType(SVGElement& targetElement) const >+void SVGAnimateElementBase::setAttributeName(const QualifiedName& attributeName) > { >- auto propertyTypes = targetElement.animatedPropertyTypesForAttribute(attributeName()); >- if (propertyTypes.isEmpty()) >- return AnimatedUnknown; >- >- ASSERT(propertyTypes.size() <= 2); >- AnimatedPropertyType type = propertyTypes[0]; >- if (hasTagName(SVGNames::animateColorTag) && type != AnimatedColor) >- return AnimatedUnknown; >- >- // Animations of transform lists are not allowed for <animate> or <set> >- // http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties >- if (type == AnimatedTransformList && !hasTagName(SVGNames::animateTransformTag)) >- return AnimatedUnknown; >- >- // Fortunately there's just one special case needed here: SVGMarkerElements orientAttr, which >- // corresponds to SVGAnimatedAngle orientAngle and SVGAnimatedEnumeration orientType. We have to >- // figure out whose value to change here. >- if (targetElement.hasTagName(SVGNames::markerTag) && type == AnimatedAngle) { >- ASSERT(propertyTypes.size() == 2); >- ASSERT(propertyTypes[0] == AnimatedAngle); >- ASSERT(propertyTypes[1] == AnimatedEnumeration); >- } else if (propertyTypes.size() == 2) >- ASSERT(propertyTypes[0] == propertyTypes[1]); >- >- return type; >+ SVGSMILElement::setAttributeName(attributeName); >+ resetAnimation(); > } > >-void SVGAnimateElementBase::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement* resultElement) >+RefPtr<SVGAnimator> SVGAnimateElementBase::createAnimator() const > { >- ASSERT(resultElement); >- auto targetElement = makeRefPtr(this->targetElement()); >- if (!targetElement) >- return; >- >- ASSERT(m_animatedPropertyType == determineAnimatedPropertyType(*targetElement)); >- >- ASSERT(percentage >= 0 && percentage <= 1); >- ASSERT(m_animatedPropertyType != AnimatedTransformList || hasTagName(SVGNames::animateTransformTag)); >- ASSERT(m_animatedPropertyType != AnimatedUnknown); >- ASSERT(m_animator); >- ASSERT(m_animator->type() == m_animatedPropertyType); >- ASSERT(m_fromType); >- ASSERT(m_fromType->type() == m_animatedPropertyType); >- ASSERT(m_toType); >- >- SVGAnimateElementBase& resultAnimationElement = downcast<SVGAnimateElementBase>(*resultElement); >- ASSERT(resultAnimationElement.m_animatedType); >- ASSERT(resultAnimationElement.m_animatedPropertyType == m_animatedPropertyType); >- >- if (hasTagName(SVGNames::setTag)) >- percentage = 1; >+ ASSERT(targetElement()); >+ ASSERT(!hasInvalidCSSAttributeType()); > >- if (calcMode() == CalcMode::Discrete) >- percentage = percentage < 0.5 ? 0 : 1; >- >- // Target element might have changed. >- m_animator->setContextElement(targetElement.get()); >+ if (!m_animator) >+ m_animator = targetElement()->createAnimator(attributeName(), animationMode(), calcMode(), isAccumulated(), isAdditive()); > >- // Be sure to detach list wrappers before we modfiy their underlying value. If we'd do >- // if after calculateAnimatedValue() ran the cached pointers in the list propery tear >- // offs would point nowhere, and we couldn't create copies of those values anymore, >- // while detaching. This is covered by assertions, moving this down would fire them. >- if (!m_animatedProperties.isEmpty()) >- m_animator->animValWillChange(m_animatedProperties); >+ return m_animator; >+} > >- // Values-animation accumulates using the last values entry corresponding to the end of duration time. >- SVGAnimatedType* toAtEndOfDurationType = m_toAtEndOfDurationType ? m_toAtEndOfDurationType.get() : m_toType.get(); >- m_animator->calculateAnimatedValue(percentage, repeatCount, m_fromType.get(), m_toType.get(), toAtEndOfDurationType, resultAnimationElement.m_animatedType.get()); >+void SVGAnimateElementBase::resetAnimation() >+{ >+ SVGAnimationElement::resetAnimation(); >+ m_animator = nullptr; > } > >-bool SVGAnimateElementBase::calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) >+bool SVGAnimateElementBase::hasValidAttributeType() const > { >- if (toAtEndOfDurationString.isEmpty()) >+ if (hasInvalidCSSAttributeType()) > return false; >- m_toAtEndOfDurationType = ensureAnimator()->constructFromString(toAtEndOfDurationString); >- return true; >+ return targetElement() && targetElement()->isAnimatedAttribute(attributeName()); >+} >+ >+bool SVGAnimateElementBase::isDiscreteAnimator() const >+{ >+ return hasValidAttributeType() && m_animator->isDiscrete(); > } > >-bool SVGAnimateElementBase::calculateFromAndToValues(const String& fromString, const String& toString) >+bool SVGAnimateElementBase::calculateFromAndToValues(const String& from, const String& to) > { >- if (!this->targetElement()) >+ if (!targetElement() || !createAnimator()) > return false; > >- determinePropertyValueTypes(fromString, toString); >- ensureAnimator()->calculateFromAndToValues(m_fromType, m_toType, fromString, toString); >- ASSERT(m_animatedPropertyType == m_animator->type()); >+ m_animator->setFromAndToValues(targetElement(), animateRangeString(from), animateRangeString(to)); > return true; > } > >-bool SVGAnimateElementBase::calculateFromAndByValues(const String& fromString, const String& byString) >+bool SVGAnimateElementBase::calculateFromAndByValues(const String& from, const String& by) > { >- if (!this->targetElement()) >+ if (!targetElement() || !createAnimator()) > return false; > >- if (animationMode() == ByAnimation && !isAdditive()) >+ if (animationMode() == AnimationMode::By && (!isAdditive() || isDiscreteAnimator())) > return false; > >- // from-by animation may only be used with attributes that support addition (e.g. most numeric attributes). >- if (animationMode() == FromByAnimation && !animatedPropertyTypeSupportsAddition()) >+ if (animationMode() == AnimationMode::FromBy && isDiscreteAnimator()) > return false; > > ASSERT(!hasTagName(SVGNames::setTag)); >- >- determinePropertyValueTypes(fromString, byString); >- ensureAnimator()->calculateFromAndByValues(m_fromType, m_toType, fromString, byString); >- ASSERT(m_animatedPropertyType == m_animator->type()); >+ m_animator->setFromAndByValues(targetElement(), animateRangeString(from), animateRangeString(by)); > return true; > } > >-#ifndef NDEBUG >-static inline bool propertyTypesAreConsistent(AnimatedPropertyType expectedPropertyType, const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- for (auto& type : animatedTypes) { >- for (auto& property : type.properties) { >- if (expectedPropertyType != property->animatedPropertyType()) { >- // This is the only allowed inconsistency. SVGAnimatedAngleAnimator handles both SVGAnimatedAngle & SVGAnimatedEnumeration for markers orient attribute. >- if (expectedPropertyType == AnimatedAngle && property->animatedPropertyType() == AnimatedEnumeration) >- return true; >- return false; >- } >- } >- } >- >- return true; >-} >-#endif >- >-void SVGAnimateElementBase::resetAnimatedType() >-{ >- SVGAnimatedTypeAnimator* animator = ensureAnimator(); >- ASSERT(m_animatedPropertyType == animator->type()); >- >- auto targetElement = makeRefPtr(this->targetElement()); >- if (!targetElement) >- return; >- >- const QualifiedName& attributeName = this->attributeName(); >- ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement.get(), attributeName); >- >- if (shouldApply == DontApplyAnimation) >- return; >- >- if (shouldApply == ApplyXMLAnimation || shouldApply == ApplyXMLandCSSAnimation) { >- // SVG DOM animVal animation code-path. >- m_animatedProperties = animator->findAnimatedPropertiesForAttributeName(*targetElement, attributeName); >- if (m_animatedProperties.isEmpty()) >- return; >- >- ASSERT(propertyTypesAreConsistent(m_animatedPropertyType, m_animatedProperties)); >- if (!m_animatedType) >- m_animatedType = animator->startAnimValAnimation(m_animatedProperties); >- else { >- animator->resetAnimValToBaseVal(m_animatedProperties, *m_animatedType); >- animator->animValDidChange(m_animatedProperties); >- } >- return; >- } >- >- // CSS properties animation code-path. >- ASSERT(m_animatedProperties.isEmpty()); >- String baseValue; >- >- if (shouldApply == ApplyCSSAnimation) { >- ASSERT(SVGAnimationElement::isTargetAttributeCSSProperty(targetElement.get(), attributeName)); >- computeCSSPropertyValue(targetElement.get(), cssPropertyID(attributeName.localName()), baseValue); >- } >- >- if (!m_animatedType) >- m_animatedType = animator->constructFromString(baseValue); >- else >- m_animatedType->setValueAsString(attributeName, baseValue); >-} >- >-static inline void applyCSSPropertyToTarget(SVGElement& targetElement, CSSPropertyID id, const String& value) >+bool SVGAnimateElementBase::calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) > { >- ASSERT(!targetElement.m_deletionHasBegun); >+ if (!targetElement() || !createAnimator()) >+ return false; > >- if (!targetElement.ensureAnimatedSMILStyleProperties().setProperty(id, value, false)) >- return; >+ if (toAtEndOfDurationString.isEmpty()) >+ return false; > >- targetElement.invalidateStyleAndLayerComposition(); >-} >+ if (isDiscreteAnimator()) >+ return true; > >-static inline void removeCSSPropertyFromTarget(SVGElement& targetElement, CSSPropertyID id) >-{ >- ASSERT(!targetElement.m_deletionHasBegun); >- targetElement.ensureAnimatedSMILStyleProperties().removeProperty(id); >- targetElement.invalidateStyleAndLayerComposition(); >+ m_animator->setToAtEndOfDurationValue(animateRangeString(toAtEndOfDurationString)); >+ return true; > } > >-static inline void applyCSSPropertyToTargetAndInstances(SVGElement& targetElement, const QualifiedName& attributeName, const String& valueAsString) >+void SVGAnimateElementBase::resetAnimatedType() > { >- // FIXME: Do we really need to check both isConnected and !parentNode? >- if (attributeName == anyQName() || !targetElement.isConnected() || !targetElement.parentNode()) >+ if (!targetElement() || !createAnimator()) > return; > >- CSSPropertyID id = cssPropertyID(attributeName.localName()); >- >- SVGElement::InstanceUpdateBlocker blocker(targetElement); >- applyCSSPropertyToTarget(targetElement, id, valueAsString); >- >- // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. >- for (auto* instance : targetElement.instances()) >- applyCSSPropertyToTarget(*instance, id, valueAsString); >+ m_animator->start(targetElement()); > } > >-static inline void removeCSSPropertyFromTargetAndInstances(SVGElement& targetElement, const QualifiedName& attributeName) >+void SVGAnimateElementBase::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement*) > { >- // FIXME: Do we really need to check both isConnected and !parentNode? >- if (attributeName == anyQName() || !targetElement.isConnected() || !targetElement.parentNode()) >+ if (!targetElement() || !createAnimator()) > return; > >- CSSPropertyID id = cssPropertyID(attributeName.localName()); >+ ASSERT(percentage >= 0 && percentage <= 1); > >- SVGElement::InstanceUpdateBlocker blocker(targetElement); >- removeCSSPropertyFromTarget(targetElement, id); >+ if (hasTagName(SVGNames::setTag)) >+ percentage = 1; > >- // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. >- for (auto* instance : targetElement.instances()) >- removeCSSPropertyFromTarget(*instance, id); >-} >+ if (calcMode() == CalcMode::Discrete) >+ percentage = percentage < 0.5 ? 0 : 1; > >-static inline void notifyTargetAboutAnimValChange(SVGElement& targetElement, const QualifiedName& attributeName) >-{ >- ASSERT(!targetElement.m_deletionHasBegun); >- targetElement.svgAttributeChanged(attributeName); >+ m_animator->progress(targetElement(), percentage, repeatCount); > } > >-static inline void notifyTargetAndInstancesAboutAnimValChange(SVGElement& targetElement, const QualifiedName& attributeName) >+void SVGAnimateElementBase::applyResultsToTarget() > { >- if (attributeName == anyQName() || !targetElement.isConnected() || !targetElement.parentNode()) >+ if (!targetElement() || !createAnimator()) > return; > >- SVGElement::InstanceUpdateBlocker blocker(targetElement); >- notifyTargetAboutAnimValChange(targetElement, attributeName); >- >- // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. >- for (auto* instance : targetElement.instances()) >- notifyTargetAboutAnimValChange(*instance, attributeName); >+ m_animator->apply(targetElement()); > } > > void SVGAnimateElementBase::clearAnimatedType(SVGElement* targetElement) > { >- if (!m_animatedType) >- return; >- >- // If the SVGAnimatedType is a list type, e.g. SVGLengthListValues, the wrappers of the >- // animated properties have to be detached from the items in the list before it's deleted. >- if (!m_animatedProperties.isEmpty()) >- m_animator->animValWillChange(m_animatedProperties); >- >- if (!targetElement) { >- m_animatedType = nullptr; >- return; >- } >- >- if (m_animatedProperties.isEmpty()) { >- // CSS properties animation code-path. >- removeCSSPropertyFromTargetAndInstances(*targetElement, attributeName()); >- m_animatedType = nullptr; >+ if (!targetElement || !m_animator) > return; >- } > >- ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName()); >- if (shouldApply == ApplyXMLandCSSAnimation) >- removeCSSPropertyFromTargetAndInstances(*targetElement, attributeName()); >- >- // SVG DOM animVal animation code-path. >- if (m_animator) { >- m_animator->stopAnimValAnimation(m_animatedProperties); >- notifyTargetAndInstancesAboutAnimValChange(*targetElement, attributeName()); >- } >- >- m_animatedProperties.clear(); >- m_animatedType = nullptr; >+ m_animator->stop(targetElement); > } > >-void SVGAnimateElementBase::applyResultsToTarget() >+bool SVGAnimateElementBase::isTargetAttributeCSSProperty(SVGElement* targetElement, const QualifiedName& attributeName) > { >- ASSERT(m_animatedPropertyType != AnimatedTransformList || hasTagName(SVGNames::animateTransformTag)); >- ASSERT(m_animatedPropertyType != AnimatedUnknown); >- ASSERT(m_animator); >- >- // Early exit if our animated type got destroyed by a previous endedActiveInterval(). >- if (!m_animatedType) >- return; >- >- auto targetElement = makeRefPtr(this->targetElement()); >- const QualifiedName& attributeName = this->attributeName(); >- >- ASSERT(targetElement); >- >- if (m_animatedProperties.isEmpty()) { >- // CSS properties animation code-path. >- // Convert the result of the animation to a String and apply it as CSS property on the target & all instances. >- applyCSSPropertyToTargetAndInstances(*targetElement, attributeName, m_animatedType->valueAsString()); >- return; >- } >- >- // We do update the style and the animation property independent of each other. >- ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement.get(), attributeName); >- if (shouldApply == ApplyXMLandCSSAnimation) >- applyCSSPropertyToTargetAndInstances(*targetElement, attributeName, m_animatedType->valueAsString()); >- >- // SVG DOM animVal animation code-path. >- // At this point the SVG DOM values are already changed, unlike for CSS. >- // We only have to trigger update notifications here. >- m_animator->animValDidChange(m_animatedProperties); >- notifyTargetAndInstancesAboutAnimValChange(*targetElement, attributeName); >+ return targetElement->isAnimatedStyleAttribute(attributeName); > } > >-bool SVGAnimateElementBase::animatedPropertyTypeSupportsAddition() const >+bool SVGAnimateElementBase::hasInvalidCSSAttributeType() const > { >- // Spec: http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties. >- switch (m_animatedPropertyType) { >- case AnimatedBoolean: >- case AnimatedEnumeration: >- case AnimatedPreserveAspectRatio: >- case AnimatedString: >- case AnimatedUnknown: >+ if (!targetElement()) > return false; >- case AnimatedAngle: >- case AnimatedColor: >- case AnimatedInteger: >- case AnimatedIntegerOptionalInteger: >- case AnimatedLength: >- case AnimatedLengthList: >- case AnimatedNumber: >- case AnimatedNumberList: >- case AnimatedNumberOptionalNumber: >- case AnimatedPath: >- case AnimatedPoints: >- case AnimatedRect: >- case AnimatedTransformList: >- return true; >- default: >- RELEASE_ASSERT_NOT_REACHED(); >- return true; >- } >-} >+ >+ if (!m_hasInvalidCSSAttributeType) >+ m_hasInvalidCSSAttributeType = hasValidAttributeName() && attributeType() == AttributeType::CSS && !isTargetAttributeCSSProperty(targetElement(), attributeName()); > >-bool SVGAnimateElementBase::isAdditive() const >-{ >- if (animationMode() == ByAnimation || animationMode() == FromByAnimation) { >- if (!animatedPropertyTypeSupportsAddition()) >- return false; >- } >- >- return SVGAnimationElement::isAdditive(); >+ return *m_hasInvalidCSSAttributeType; > } > >-float SVGAnimateElementBase::calculateDistance(const String& fromString, const String& toString) >+float SVGAnimateElementBase::calculateDistance(const String& from, const String& to) > { > // FIXME: A return value of float is not enough to support paced animations on lists. >- if (!this->targetElement()) >+ if (!targetElement() || !createAnimator()) > return -1; > >- return ensureAnimator()->calculateDistance(fromString, toString); >-} >- >-void SVGAnimateElementBase::setTargetElement(SVGElement* target) >-{ >- SVGAnimationElement::setTargetElement(target); >- resetAnimatedPropertyType(); >-} >- >-void SVGAnimateElementBase::setAttributeName(const QualifiedName& attributeName) >-{ >- SVGSMILElement::setAttributeName(attributeName); >- checkInvalidCSSAttributeType(targetElement()); >- resetAnimatedPropertyType(); >-} >- >-void SVGAnimateElementBase::resetAnimatedPropertyType() >-{ >- SVGAnimationElement::resetAnimatedPropertyType(); >- ASSERT(!m_animatedType); >- m_fromType = nullptr; >- m_toType = nullptr; >- m_toAtEndOfDurationType = nullptr; >- m_animator = nullptr; >- m_animatedPropertyType = targetElement() ? determineAnimatedPropertyType(*targetElement()) : AnimatedString; >-} >- >-SVGAnimatedTypeAnimator* SVGAnimateElementBase::ensureAnimator() >-{ >- if (!m_animator) >- m_animator = SVGAnimatorFactory::create(this, targetElement(), m_animatedPropertyType); >- ASSERT(m_animatedPropertyType == m_animator->type()); >- return m_animator.get(); >+ return m_animator->calculateDistance(targetElement(), from, to); > } > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAnimateElementBase.h b/Source/WebCore/svg/SVGAnimateElementBase.h >index aa5341d5eca..1a7afbb8c1a 100644 >--- a/Source/WebCore/svg/SVGAnimateElementBase.h >+++ b/Source/WebCore/svg/SVGAnimateElementBase.h >@@ -23,19 +23,17 @@ > > #pragma once > >-#include "SVGAnimatedType.h" >-#include "SVGAnimatedTypeAnimator.h" > #include "SVGAnimationElement.h" > #include "SVGNames.h" > > namespace WebCore { > >+class SVGAnimator; >+ > class SVGAnimateElementBase : public SVGAnimationElement { > WTF_MAKE_ISO_ALLOCATED(SVGAnimateElementBase); > public: >- virtual ~SVGAnimateElementBase(); >- >- AnimatedPropertyType determineAnimatedPropertyType(SVGElement&) const; >+ bool isDiscreteAnimator() const; > > protected: > SVGAnimateElementBase(const QualifiedName&, Document&); >@@ -43,33 +41,30 @@ protected: > void resetAnimatedType() override; > void clearAnimatedType(SVGElement* targetElement) override; > >- bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) override; > bool calculateFromAndToValues(const String& fromString, const String& toString) override; > bool calculateFromAndByValues(const String& fromString, const String& byString) override; >+ bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) override; >+ > void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement* resultElement) override; >+ > void applyResultsToTarget() override; > float calculateDistance(const String& fromString, const String& toString) override; >- bool isAdditive() const override; > > void setTargetElement(SVGElement*) override; > void setAttributeName(const QualifiedName&) override; >- void resetAnimatedPropertyType() override; >+ void resetAnimation() override; > >- AnimatedPropertyType m_animatedPropertyType; >+ virtual String animateRangeString(const String& string) const { return string; } > > private: >- SVGAnimatedTypeAnimator* ensureAnimator(); >- bool animatedPropertyTypeSupportsAddition() const; >- >- bool hasValidAttributeType() override; >+ RefPtr<SVGAnimator> createAnimator() const; > >- std::unique_ptr<SVGAnimatedType> m_fromType; >- std::unique_ptr<SVGAnimatedType> m_toType; >- std::unique_ptr<SVGAnimatedType> m_toAtEndOfDurationType; >- std::unique_ptr<SVGAnimatedType> m_animatedType; >+ bool hasValidAttributeType() const override; >+ static bool isTargetAttributeCSSProperty(SVGElement*, const QualifiedName&); >+ bool hasInvalidCSSAttributeType() const; > >- SVGElementAnimatedPropertyList m_animatedProperties; >- std::unique_ptr<SVGAnimatedTypeAnimator> m_animator; >+ mutable RefPtr<SVGAnimator> m_animator; >+ mutable std::optional<bool> m_hasInvalidCSSAttributeType; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAnimateMotionElement.cpp b/Source/WebCore/svg/SVGAnimateMotionElement.cpp >index 7a8c63e6703..1cb9af610db 100644 >--- a/Source/WebCore/svg/SVGAnimateMotionElement.cpp >+++ b/Source/WebCore/svg/SVGAnimateMotionElement.cpp >@@ -57,7 +57,7 @@ Ref<SVGAnimateMotionElement> SVGAnimateMotionElement::create(const QualifiedName > return adoptRef(*new SVGAnimateMotionElement(tagName, document)); > } > >-bool SVGAnimateMotionElement::hasValidAttributeType() >+bool SVGAnimateMotionElement::hasValidAttributeType() const > { > auto targetElement = makeRefPtr(this->targetElement()); > if (!targetElement) >@@ -90,7 +90,7 @@ bool SVGAnimateMotionElement::hasValidAttributeType() > return false; > } > >-bool SVGAnimateMotionElement::hasValidAttributeName() >+bool SVGAnimateMotionElement::hasValidAttributeName() const > { > // AnimateMotion does not use attributeName so it is always valid. > return true; >@@ -176,7 +176,7 @@ bool SVGAnimateMotionElement::calculateFromAndToValues(const String& fromString, > bool SVGAnimateMotionElement::calculateFromAndByValues(const String& fromString, const String& byString) > { > m_hasToPointAtEndOfDuration = false; >- if (animationMode() == ByAnimation && !isAdditive()) >+ if (animationMode() == AnimationMode::By && !isAdditive()) > return false; > parsePoint(fromString, m_fromPoint); > FloatPoint byPoint; >@@ -222,7 +222,7 @@ void SVGAnimateMotionElement::calculateAnimatedValue(float percentage, unsigned > if (!isAdditive()) > transform->makeIdentity(); > >- if (animationMode() != PathAnimation) { >+ if (animationMode() != AnimationMode::Path) { > FloatPoint toPointAtEndOfDuration = m_toPoint; > if (isAccumulated() && repeatCount && m_hasToPointAtEndOfDuration) > toPointAtEndOfDuration = m_toPointAtEndOfDuration; >@@ -288,7 +288,7 @@ float SVGAnimateMotionElement::calculateDistance(const String& fromString, const > void SVGAnimateMotionElement::updateAnimationMode() > { > if (!m_animationPath.isEmpty()) >- setAnimationMode(PathAnimation); >+ setAnimationMode(AnimationMode::Path); > else > SVGAnimationElement::updateAnimationMode(); > } >diff --git a/Source/WebCore/svg/SVGAnimateMotionElement.h b/Source/WebCore/svg/SVGAnimateMotionElement.h >index 24dececdd6b..f93e643f3d8 100644 >--- a/Source/WebCore/svg/SVGAnimateMotionElement.h >+++ b/Source/WebCore/svg/SVGAnimateMotionElement.h >@@ -36,8 +36,8 @@ public: > private: > SVGAnimateMotionElement(const QualifiedName&, Document&); > >- bool hasValidAttributeType() override; >- bool hasValidAttributeName() override; >+ bool hasValidAttributeType() const override; >+ bool hasValidAttributeName() const override; > > void parseAttribute(const QualifiedName&, const AtomicString&) override; > >diff --git a/Source/WebCore/svg/SVGAnimateTransformElement.cpp b/Source/WebCore/svg/SVGAnimateTransformElement.cpp >index 0149cc899e9..4738f81402f 100644 >--- a/Source/WebCore/svg/SVGAnimateTransformElement.cpp >+++ b/Source/WebCore/svg/SVGAnimateTransformElement.cpp >@@ -43,7 +43,7 @@ Ref<SVGAnimateTransformElement> SVGAnimateTransformElement::create(const Qualifi > return adoptRef(*new SVGAnimateTransformElement(tagName, document)); > } > >-bool SVGAnimateTransformElement::hasValidAttributeType() >+bool SVGAnimateTransformElement::hasValidAttributeType() const > { > if (!this->targetElement()) > return false; >@@ -51,7 +51,7 @@ bool SVGAnimateTransformElement::hasValidAttributeType() > if (attributeType() == AttributeType::CSS) > return false; > >- return m_animatedPropertyType == AnimatedTransformList; >+ return true; > } > > void SVGAnimateTransformElement::parseAttribute(const QualifiedName& name, const AtomicString& value) >@@ -66,4 +66,9 @@ void SVGAnimateTransformElement::parseAttribute(const QualifiedName& name, const > SVGAnimateElementBase::parseAttribute(name, value); > } > >+String SVGAnimateTransformElement::animateRangeString(const String& string) const >+{ >+ return SVGTransformValue::prefixForTransfromType(m_type) + string + ')'; >+} >+ > } >diff --git a/Source/WebCore/svg/SVGAnimateTransformElement.h b/Source/WebCore/svg/SVGAnimateTransformElement.h >index 62973082d0d..301ea88ab46 100644 >--- a/Source/WebCore/svg/SVGAnimateTransformElement.h >+++ b/Source/WebCore/svg/SVGAnimateTransformElement.h >@@ -39,8 +39,9 @@ public: > private: > SVGAnimateTransformElement(const QualifiedName&, Document&); > >- bool hasValidAttributeType() final; >+ bool hasValidAttributeType() const final; > void parseAttribute(const QualifiedName&, const AtomicString&) final; >+ String animateRangeString(const String&) const final; > > SVGTransformValue::SVGTransformType m_type; > }; >diff --git a/Source/WebCore/svg/SVGAnimatedAngle.cpp b/Source/WebCore/svg/SVGAnimatedAngle.cpp >deleted file mode 100644 >index 54b7145a0cd..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedAngle.cpp >+++ /dev/null >@@ -1,136 +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 "SVGAnimatedAngle.h" >- >-#include "SVGAnimateElementBase.h" >-#include "SVGMarkerElement.h" >- >-namespace WebCore { >- >-SVGAnimatedAngleAnimator::SVGAnimatedAngleAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedAngle, animationElement, contextElement) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedAngleAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGPropertyTraits<std::pair<SVGAngleValue, unsigned>>::fromString(string)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedAngleAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- return constructFromBaseValues<SVGAnimatedAngle, SVGAnimatedEnumeration>(animatedTypes); >-} >- >-void SVGAnimatedAngleAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForTypes<SVGAnimatedAngle, SVGAnimatedEnumeration>(animatedTypes); >-} >- >-void SVGAnimatedAngleAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- resetFromBaseValues<SVGAnimatedAngle, SVGAnimatedEnumeration>(animatedTypes, type); >-} >- >-void SVGAnimatedAngleAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForTypes<SVGAnimatedAngle, SVGAnimatedEnumeration>(animatedTypes); >-} >- >-void SVGAnimatedAngleAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForTypes<SVGAnimatedAngle, SVGAnimatedEnumeration>(animatedTypes); >-} >- >-void SVGAnimatedAngleAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to) >-{ >- ASSERT(from->type() == AnimatedAngle); >- ASSERT(from->type() == to->type()); >- >- const auto& fromAngleAndEnumeration = from->as<std::pair<SVGAngleValue, unsigned>>(); >- auto& toAngleAndEnumeration = to->as<std::pair<SVGAngleValue, unsigned>>(); >- // Only respect by animations, if from and by are both specified in angles (and not eg. 'auto'). >- if (fromAngleAndEnumeration.second != toAngleAndEnumeration.second || fromAngleAndEnumeration.second != SVGMarkerOrientAngle) >- return; >- const auto& fromAngle = fromAngleAndEnumeration.first; >- auto& toAngle = toAngleAndEnumeration.first; >- toAngle.setValue(toAngle.value() + fromAngle.value()); >-} >- >-void SVGAnimatedAngleAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- ASSERT(m_contextElement); >- >- const auto& fromAngleAndEnumeration = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<std::pair<SVGAngleValue, unsigned>>(); >- auto& toAngleAndEnumeration = to->as<std::pair<SVGAngleValue, unsigned>>(); >- auto& toAtEndOfDurationAngleAndEnumeration = toAtEndOfDuration->as<std::pair<SVGAngleValue, unsigned>>(); >- auto& animatedAngleAndEnumeration = animated->as<std::pair<SVGAngleValue, unsigned>>(); >- >- if (fromAngleAndEnumeration.second != toAngleAndEnumeration.second) { >- // Discrete animation - no linear interpolation possible between values (e.g. auto to angle). >- if (percentage < 0.5f) { >- animatedAngleAndEnumeration.second = fromAngleAndEnumeration.second; >- if (fromAngleAndEnumeration.second == SVGMarkerOrientAngle) >- animatedAngleAndEnumeration.first = fromAngleAndEnumeration.first; >- else >- animatedAngleAndEnumeration.first.setValue(0); >- return; >- } >- animatedAngleAndEnumeration.second = toAngleAndEnumeration.second; >- if (toAngleAndEnumeration.second == SVGMarkerOrientAngle) >- animatedAngleAndEnumeration.first = toAngleAndEnumeration.first; >- else >- animatedAngleAndEnumeration.first.setValue(0); >- return; >- } >- >- if (fromAngleAndEnumeration.second == SVGMarkerOrientAngle) { >- // Regular from angle to angle animation, with support for smooth interpolation, and additive and accumulated animation. >- animatedAngleAndEnumeration.second = SVGMarkerOrientAngle; >- >- auto& animatedSVGAngle = animatedAngleAndEnumeration.first; >- const auto& toAtEndOfDurationSVGAngle = toAtEndOfDurationAngleAndEnumeration.first; >- float animatedAngle = animatedSVGAngle.value(); >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromAngleAndEnumeration.first.value(), toAngleAndEnumeration.first.value(), toAtEndOfDurationSVGAngle.value(), animatedAngle); >- animatedSVGAngle.setValue(animatedAngle); >- return; >- } >- >- // auto, auto-start-reverse, or unknown. >- animatedAngleAndEnumeration.first.setValue(0); >- >- if (fromAngleAndEnumeration.second == SVGMarkerOrientAuto || fromAngleAndEnumeration.second == SVGMarkerOrientAutoStartReverse) >- animatedAngleAndEnumeration.second = fromAngleAndEnumeration.second; >- else >- animatedAngleAndEnumeration.second = SVGMarkerOrientUnknown; >-} >- >-float SVGAnimatedAngleAnimator::calculateDistance(const String& fromString, const String& toString) >-{ >- auto from = SVGAngleValue(); >- from.setValueAsString(fromString); >- auto to = SVGAngleValue(); >- to.setValueAsString(toString); >- return fabsf(to.value() - from.value()); >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedAngle.h b/Source/WebCore/svg/SVGAnimatedAngle.h >deleted file mode 100644 >index d4915683f61..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedAngle.h >+++ /dev/null >@@ -1,52 +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 "SVGAngle.h" >-#include "SVGAnimatedPropertyTearOff.h" >-#include "SVGAnimatedTypeAnimator.h" >-#include "SVGAttribute.h" >- >-namespace WebCore { >- >-class SVGAnimationElement; >- >-using SVGAnimatedAngle = SVGAnimatedPropertyTearOff<SVGAngle>; >-using SVGAnimatedAngleAttribute = SVGAnimatedAttribute<SVGAnimatedAngle>; >- >-class SVGAnimatedAngleAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedAngleAnimator(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/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/SVGAnimatedColor.cpp b/Source/WebCore/svg/SVGAnimatedColor.cpp >deleted file mode 100644 >index 33bd692412f..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedColor.cpp >+++ /dev/null >@@ -1,120 +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 "SVGAnimatedColor.h" >- >-#include "CSSParser.h" >-#include "RenderElement.h" >-#include "SVGAnimateElementBase.h" >- >-namespace WebCore { >- >-SVGAnimatedColorAnimator::SVGAnimatedColorAnimator(SVGAnimationElement& animationElement, SVGElement& contextElement) >- : SVGAnimatedTypeAnimator(AnimatedColor, &animationElement, &contextElement) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedColorAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGPropertyTraits<Color>::fromString(string)); >-} >- >-void SVGAnimatedColorAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to) >-{ >- ASSERT(from); >- ASSERT(to); >- ASSERT(from->type() == AnimatedColor); >- ASSERT(to->type() == AnimatedColor); >- >- // Ignores any alpha and sets alpha on result to 100% opaque. >- const auto& fromColor = from->as<Color>(); >- auto& toColor = to->as<Color>(); >- toColor = { roundAndClampColorChannel(toColor.red() + fromColor.red()), >- roundAndClampColorChannel(toColor.green() + fromColor.green()), >- roundAndClampColorChannel(toColor.blue() + fromColor.blue()) }; >-} >- >-static inline Color currentColor(SVGElement& targetElement) >-{ >- RenderElement* targetRenderer = targetElement.renderer(); >- if (!targetRenderer) >- return { }; >- return targetRenderer->style().visitedDependentColor(CSSPropertyColor); >-} >- >-static Color parseColorFromString(SVGAnimationElement*, const String& string) >-{ >- return CSSParser::parseColor(string.stripWhiteSpace()); >-} >- >-void SVGAnimatedColorAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- ASSERT(m_contextElement); >- >- auto fromColor = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<Color>(); >- auto toColor = to->as<Color>(); >- >- // Apply CSS inheritance rules. >- m_animationElement->adjustForInheritance<Color>(parseColorFromString, m_animationElement->fromPropertyValueType(), fromColor, m_contextElement); >- m_animationElement->adjustForInheritance<Color>(parseColorFromString, m_animationElement->toPropertyValueType(), toColor, m_contextElement); >- >- // Apply <animateColor> rules. >- if (m_animationElement->fromPropertyValueType() == CurrentColorValue) >- fromColor = currentColor(*m_contextElement); >- if (m_animationElement->toPropertyValueType() == CurrentColorValue) >- toColor = currentColor(*m_contextElement); >- >- const auto& toAtEndOfDurationColor = toAtEndOfDuration->as<Color>(); >- auto& animatedColor = animated->as<Color>(); >- >- // FIXME: ExtendedColor - this will need to handle blending between colors in different color spaces, >- // as well as work with non [0-255] Colors. >- float red = animatedColor.red(); >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromColor.red(), toColor.red(), toAtEndOfDurationColor.red(), red); >- >- float green = animatedColor.green(); >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromColor.green(), toColor.green(), toAtEndOfDurationColor.green(), green); >- >- float blue = animatedColor.blue(); >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromColor.blue(), toColor.blue(), toAtEndOfDurationColor.blue(), blue); >- >- float alpha = animatedColor.alpha(); >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromColor.alpha(), toColor.alpha(), toAtEndOfDurationColor.alpha(), alpha); >- >- animatedColor = { roundAndClampColorChannel(red), roundAndClampColorChannel(green), roundAndClampColorChannel(blue), roundAndClampColorChannel(alpha) }; >-} >- >-float SVGAnimatedColorAnimator::calculateDistance(const String& fromString, const String& toString) >-{ >- Color from = CSSParser::parseColor(fromString.stripWhiteSpace()); >- if (!from.isValid()) >- return -1; >- Color to = CSSParser::parseColor(toString.stripWhiteSpace()); >- if (!to.isValid()) >- return -1; >- float red = from.red() - to.red(); >- float green = from.green() - to.green(); >- float blue = from.blue() - to.blue(); >- return sqrtf(red * red + green * green + blue * blue); >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedColor.h b/Source/WebCore/svg/SVGAnimatedColor.h >deleted file mode 100644 >index 1e4041bae8c..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedColor.h >+++ /dev/null >@@ -1,42 +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. >- */ >- >-#pragma once >- >-#include "SVGAnimatedTypeAnimator.h" >- >-namespace WebCore { >- >-class SVGAnimatedColorAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedColorAnimator(SVGAnimationElement&, SVGElement&); >- >-private: >- std::unique_ptr<SVGAnimatedType> constructFromString(const String&) final; >- std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) final { return nullptr; } >- void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) final { } >- void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType&) final { } >- void animValWillChange(const SVGElementAnimatedPropertyList&) final { } >- void animValDidChange(const SVGElementAnimatedPropertyList&) final { } >- void addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*) final; >- void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*) final; >- float calculateDistance(const String& fromString, const String& toString) final; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAnimatedEnumeration.cpp b/Source/WebCore/svg/SVGAnimatedEnumeration.cpp >deleted file mode 100644 >index 34b4ca29a33..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedEnumeration.cpp >+++ /dev/null >@@ -1,164 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 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. >- */ >- >-#include "config.h" >-#include "SVGAnimatedEnumeration.h" >- >-#include "SVGAnimationElement.h" >-#include "SVGComponentTransferFunctionElement.h" >-#include "SVGFEBlendElement.h" >-#include "SVGFEColorMatrixElement.h" >-#include "SVGFECompositeElement.h" >-#include "SVGFEConvolveMatrixElement.h" >-#include "SVGFEDisplacementMapElement.h" >-#include "SVGFEMorphologyElement.h" >-#include "SVGFETurbulenceElement.h" >-#include "SVGGradientElement.h" >-#include "SVGMarkerElement.h" >-#include "SVGNames.h" >-#include "SVGTextContentElement.h" >-#include "SVGTextPathElement.h" >-#include "SVGUnitTypes.h" >- >-namespace WebCore { >- >-static inline unsigned enumerationValueForTargetAttribute(SVGElement* targetElement, const QualifiedName& attrName, const String& value) >-{ >- ASSERT(targetElement); >- if (attrName == SVGNames::clipPathUnitsAttr >- || attrName == SVGNames::filterUnitsAttr >- || attrName == SVGNames::gradientUnitsAttr >- || attrName == SVGNames::maskContentUnitsAttr >- || attrName == SVGNames::maskUnitsAttr >- || attrName == SVGNames::patternContentUnitsAttr >- || attrName == SVGNames::patternUnitsAttr >- || attrName == SVGNames::primitiveUnitsAttr) >- return SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(value); >- >- if (attrName == SVGNames::lengthAdjustAttr) >- return SVGPropertyTraits<SVGLengthAdjustType>::fromString(value); >- if (attrName == SVGNames::markerUnitsAttr) >- return SVGPropertyTraits<SVGMarkerUnitsType>::fromString(value); >- if (attrName == SVGNames::methodAttr) >- return SVGPropertyTraits<SVGTextPathMethodType>::fromString(value); >- if (attrName == SVGNames::spacingAttr) >- return SVGPropertyTraits<SVGTextPathSpacingType>::fromString(value); >- if (attrName == SVGNames::spreadMethodAttr) >- return SVGPropertyTraits<SVGSpreadMethodType>::fromString(value); >- >- if (attrName == SVGNames::edgeModeAttr) >- return SVGPropertyTraits<EdgeModeType>::fromString(value); >- >- if (attrName == SVGNames::operatorAttr) { >- if (targetElement->hasTagName(SVGNames::feCompositeTag)) >- return SVGPropertyTraits<CompositeOperationType>::fromString(value); >- ASSERT(targetElement->hasTagName(SVGNames::feMorphologyTag)); >- return SVGPropertyTraits<MorphologyOperatorType>::fromString(value); >- } >- >- if (attrName == SVGNames::typeAttr) { >- if (targetElement->hasTagName(SVGNames::feColorMatrixTag)) >- return SVGPropertyTraits<ColorMatrixType>::fromString(value); >- if (targetElement->hasTagName(SVGNames::feTurbulenceTag)) >- return static_cast<unsigned>(SVGPropertyTraits<TurbulenceType>::fromString(value)); >- >- ASSERT(targetElement->hasTagName(SVGNames::feFuncATag) >- || targetElement->hasTagName(SVGNames::feFuncBTag) >- || targetElement->hasTagName(SVGNames::feFuncGTag) >- || targetElement->hasTagName(SVGNames::feFuncRTag)); >- return SVGPropertyTraits<ComponentTransferType>::fromString(value); >- } >- >- if (attrName == SVGNames::modeAttr) { >- BlendMode mode = BlendMode::Normal; >- parseBlendMode(value, mode); >- return static_cast<unsigned>(mode); >- } >- if (attrName == SVGNames::stitchTilesAttr) >- return SVGPropertyTraits<SVGStitchOptions>::fromString(value); >- if (attrName == SVGNames::xChannelSelectorAttr) >- return SVGPropertyTraits<ChannelSelectorType>::fromString(value); >- if (attrName == SVGNames::yChannelSelectorAttr) >- return SVGPropertyTraits<ChannelSelectorType>::fromString(value); >- >- ASSERT_NOT_REACHED(); >- return 0; >-} >- >-SVGAnimatedEnumerationAnimator::SVGAnimatedEnumerationAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedEnumeration, animationElement, contextElement) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedEnumerationAnimator::constructFromString(const String& string) >-{ >- ASSERT(m_animationElement); >- return SVGAnimatedType::create(enumerationValueForTargetAttribute(m_animationElement->targetElement(), m_animationElement->attributeName(), string)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedEnumerationAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- return constructFromBaseValue<SVGAnimatedEnumeration>(animatedTypes); >-} >- >-void SVGAnimatedEnumerationAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForType<SVGAnimatedEnumeration>(animatedTypes); >-} >- >-void SVGAnimatedEnumerationAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- resetFromBaseValue<SVGAnimatedEnumeration>(animatedTypes, type); >-} >- >-void SVGAnimatedEnumerationAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForType<SVGAnimatedEnumeration>(animatedTypes); >-} >- >-void SVGAnimatedEnumerationAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForType<SVGAnimatedEnumeration>(animatedTypes); >-} >- >-void SVGAnimatedEnumerationAnimator::addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*) >-{ >- ASSERT_NOT_REACHED(); >-} >- >-void SVGAnimatedEnumerationAnimator::calculateAnimatedValue(float percentage, unsigned, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType*, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- ASSERT(m_contextElement); >- >- const auto fromEnumeration = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<unsigned>(); >- const auto toEnumeration = to->as<unsigned>(); >- auto& animatedEnumeration = animated->as<unsigned>(); >- >- m_animationElement->animateDiscreteType<unsigned>(percentage, fromEnumeration, toEnumeration, animatedEnumeration); >-} >- >-float SVGAnimatedEnumerationAnimator::calculateDistance(const String&, const String&) >-{ >- // No paced animations for enumerations. >- return -1; >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedEnumeration.h b/Source/WebCore/svg/SVGAnimatedEnumeration.h >deleted file mode 100644 >index 488ab897390..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedEnumeration.h >+++ /dev/null >@@ -1,55 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010, 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 "SVGAnimatedEnumerationPropertyTearOff.h" >-#include "SVGAnimatedTypeAnimator.h" >-#include "SVGAttributeAccessor.h" >- >-namespace WebCore { >- >-class SVGAnimationElement; >- >-using SVGAnimatedEnumeration = SVGAnimatedStaticPropertyTearOff<unsigned>; >- >-template<typename EnumType> >-using SVGAnimatedEnumerationAttribute = SVGAnimatedAttribute<SVGAnimatedEnumerationPropertyTearOff<EnumType>>; >- >-template<typename OwnerType, typename EnumType> >-using SVGAnimatedEnumerationAttributeAccessor = SVGAnimatedAttributeAccessor<OwnerType, SVGAnimatedEnumerationAttribute<EnumType>, AnimatedEnumeration>; >- >-class SVGAnimatedEnumerationAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedEnumerationAnimator(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/SVGAnimatedInteger.cpp b/Source/WebCore/svg/SVGAnimatedInteger.cpp >deleted file mode 100644 >index 0f77a21f57e..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedInteger.cpp >+++ /dev/null >@@ -1,101 +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 "SVGAnimatedInteger.h" >- >-#include "SVGAnimateElementBase.h" >-#include "SVGAnimatedNumber.h" >-#include <wtf/MathExtras.h> >- >-namespace WebCore { >- >-SVGAnimatedIntegerAnimator::SVGAnimatedIntegerAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedInteger, animationElement, contextElement) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedIntegerAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGPropertyTraits<int>::fromString(string)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedIntegerAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- return constructFromBaseValue<SVGAnimatedInteger>(animatedTypes); >-} >- >-void SVGAnimatedIntegerAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForType<SVGAnimatedInteger>(animatedTypes); >-} >- >-void SVGAnimatedIntegerAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- resetFromBaseValue<SVGAnimatedInteger>(animatedTypes, type); >-} >- >-void SVGAnimatedIntegerAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForType<SVGAnimatedInteger>(animatedTypes); >-} >- >-void SVGAnimatedIntegerAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForType<SVGAnimatedInteger>(animatedTypes); >-} >- >-void SVGAnimatedIntegerAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to) >-{ >- ASSERT(from->type() == AnimatedInteger); >- ASSERT(from->type() == to->type()); >- >- to->as<int>() += from->as<int>(); >-} >- >-void SVGAnimatedIntegerAnimator::calculateAnimatedInteger(SVGAnimationElement* animationElement, float percentage, unsigned repeatCount, int fromInteger, int toInteger, int toAtEndOfDurationInteger, int& animatedInteger) >-{ >- float animatedNumber = animatedInteger; >- animationElement->animateAdditiveNumber(percentage, repeatCount, fromInteger, toInteger, toAtEndOfDurationInteger, animatedNumber); >- animatedInteger = static_cast<int>(roundf(animatedNumber)); >-} >- >-void SVGAnimatedIntegerAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- ASSERT(m_contextElement); >- >- const auto fromInteger = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<int>(); >- const auto toInteger = to->as<int>(); >- const auto toAtEndOfDurationInteger = toAtEndOfDuration->as<int>(); >- auto& animatedInteger = animated->as<int>(); >- >- calculateAnimatedInteger(m_animationElement, percentage, repeatCount, fromInteger, toInteger, toAtEndOfDurationInteger, animatedInteger); >-} >- >-float SVGAnimatedIntegerAnimator::calculateDistance(const String& fromString, const String& toString) >-{ >- ASSERT(m_contextElement); >- int from = fromString.toIntStrict(); >- int to = toString.toIntStrict(); >- return abs(to - from); >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedInteger.h b/Source/WebCore/svg/SVGAnimatedInteger.h >deleted file mode 100644 >index 1c234876bda..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedInteger.h >+++ /dev/null >@@ -1,58 +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 SVGAnimatedInteger = SVGAnimatedStaticPropertyTearOff<int>; >-using SVGAnimatedIntegerAttribute = SVGAnimatedAttribute<SVGAnimatedInteger>; >- >-template<typename OwnerType> >-using SVGAnimatedIntegerAttributeAccessor = SVGAnimatedAttributeAccessor<OwnerType, SVGAnimatedIntegerAttribute, AnimatedInteger>; >- >-template<typename OwnerType> >-using SVGAnimatedOptionalIntegerAttributeAccessor = SVGAnimatedOptionalAttributeAccessor<OwnerType, SVGAnimatedIntegerAttribute, AnimatedIntegerOptionalInteger>; >- >-class SVGAnimatedIntegerAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedIntegerAnimator(SVGAnimationElement*, SVGElement*); >- >- static void calculateAnimatedInteger(SVGAnimationElement*, float percentage, unsigned repeatCount, int fromInteger, int toInteger, int toAtEndOfDurationInteger, int& animatedInteger); >- >- 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/SVGAnimatedIntegerOptionalInteger.cpp b/Source/WebCore/svg/SVGAnimatedIntegerOptionalInteger.cpp >deleted file mode 100644 >index 5053f112d48..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedIntegerOptionalInteger.cpp >+++ /dev/null >@@ -1,96 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 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 "SVGAnimatedIntegerOptionalInteger.h" >- >-#include "SVGAnimateElementBase.h" >-#include "SVGAnimatedInteger.h" >-#include "SVGParserUtilities.h" >- >-namespace WebCore { >- >-SVGAnimatedIntegerOptionalIntegerAnimator::SVGAnimatedIntegerOptionalIntegerAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedIntegerOptionalInteger, animationElement, contextElement) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedIntegerOptionalIntegerAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGPropertyTraits<std::pair<int, int>>::fromString(string)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedIntegerOptionalIntegerAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- return constructFromBaseValues<SVGAnimatedInteger, SVGAnimatedInteger>(animatedTypes); >-} >- >-void SVGAnimatedIntegerOptionalIntegerAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForTypes<SVGAnimatedInteger, SVGAnimatedInteger>(animatedTypes); >-} >- >-void SVGAnimatedIntegerOptionalIntegerAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- resetFromBaseValues<SVGAnimatedInteger, SVGAnimatedInteger>(animatedTypes, type); >-} >- >-void SVGAnimatedIntegerOptionalIntegerAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForTypes<SVGAnimatedInteger, SVGAnimatedInteger>(animatedTypes); >-} >- >-void SVGAnimatedIntegerOptionalIntegerAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForTypes<SVGAnimatedInteger, SVGAnimatedInteger>(animatedTypes); >-} >- >-void SVGAnimatedIntegerOptionalIntegerAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to) >-{ >- ASSERT(from->type() == AnimatedIntegerOptionalInteger); >- ASSERT(from->type() == to->type()); >- >- const auto& fromIntegerPair = from->as<std::pair<int, int>>(); >- auto& toIntegerPair = to->as<std::pair<int, int>>(); >- >- toIntegerPair.first += fromIntegerPair.first; >- toIntegerPair.second += fromIntegerPair.second; >-} >- >-void SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- ASSERT(m_contextElement); >- >- const auto& fromIntegerPair = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<std::pair<int, int>>(); >- const auto& toIntegerPair = to->as<std::pair<int, int>>(); >- const auto& toAtEndOfDurationIntegerPair = toAtEndOfDuration->as<std::pair<int, int>>(); >- auto& animatedIntegerPair = animated->as<std::pair<int, int>>(); >- >- SVGAnimatedIntegerAnimator::calculateAnimatedInteger(m_animationElement, percentage, repeatCount, fromIntegerPair.first, toIntegerPair.first, toAtEndOfDurationIntegerPair.first, animatedIntegerPair.first); >- SVGAnimatedIntegerAnimator::calculateAnimatedInteger(m_animationElement, percentage, repeatCount, fromIntegerPair.second, toIntegerPair.second, toAtEndOfDurationIntegerPair.second, animatedIntegerPair.second); >-} >- >-float SVGAnimatedIntegerOptionalIntegerAnimator::calculateDistance(const String&, const String&) >-{ >- // FIXME: Distance calculation is not possible for SVGIntegerOptionalInteger right now. We need the distance for every single value. >- return -1; >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedIntegerOptionalInteger.h b/Source/WebCore/svg/SVGAnimatedIntegerOptionalInteger.h >deleted file mode 100644 >index 10f1ea98ad7..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedIntegerOptionalInteger.h >+++ /dev/null >@@ -1,44 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 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. >- */ >- >-#pragma once >- >-#include "SVGAnimatedTypeAnimator.h" >- >-namespace WebCore { >- >-class SVGAnimationElement; >- >-class SVGAnimatedIntegerOptionalIntegerAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedIntegerOptionalIntegerAnimator(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/SVGAnimatedLength.cpp b/Source/WebCore/svg/SVGAnimatedLength.cpp >deleted file mode 100644 >index 0fac3eb238e..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedLength.cpp >+++ /dev/null >@@ -1,117 +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 "SVGAnimatedLength.h" >- >-#include "SVGAnimateElementBase.h" >-#include "SVGAnimatedNumber.h" >- >-namespace WebCore { >- >-SVGAnimatedLengthAnimator::SVGAnimatedLengthAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedLength, animationElement, contextElement) >- , m_lengthMode(SVGLengthValue::lengthModeForAnimatedLengthAttribute(animationElement->attributeName())) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedLengthAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGLengthValue(m_lengthMode, string)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedLengthAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- return constructFromBaseValue<SVGAnimatedLength>(animatedTypes); >-} >- >-void SVGAnimatedLengthAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForType<SVGAnimatedLength>(animatedTypes); >-} >- >-void SVGAnimatedLengthAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- resetFromBaseValue<SVGAnimatedLength>(animatedTypes, type); >-} >- >-void SVGAnimatedLengthAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForType<SVGAnimatedLength>(animatedTypes); >-} >- >-void SVGAnimatedLengthAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForType<SVGAnimatedLength>(animatedTypes); >-} >- >-void SVGAnimatedLengthAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to) >-{ >- ASSERT(from->type() == AnimatedLength); >- ASSERT(from->type() == to->type()); >- >- SVGLengthContext lengthContext(m_contextElement); >- const auto& fromLength = from->as<SVGLengthValue>(); >- auto& toLength = to->as<SVGLengthValue>(); >- >- toLength.setValue(toLength.value(lengthContext) + fromLength.value(lengthContext), lengthContext); >-} >- >-static SVGLengthValue parseLengthFromString(SVGAnimationElement* animationElement, const String& string) >-{ >- SVGLengthValue length; >- length.setValueAsString(string, SVGLengthValue::lengthModeForAnimatedLengthAttribute(animationElement->attributeName())); >- return length; >-} >- >-void SVGAnimatedLengthAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- ASSERT(m_contextElement); >- >- auto fromSVGLength = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<SVGLengthValue>(); >- auto toSVGLength = to->as<SVGLengthValue>(); >- const auto& toAtEndOfDurationSVGLength = toAtEndOfDuration->as<SVGLengthValue>(); >- auto& animatedSVGLength = animated->as<SVGLengthValue>(); >- >- // Apply CSS inheritance rules. >- m_animationElement->adjustForInheritance<SVGLengthValue>(parseLengthFromString, m_animationElement->fromPropertyValueType(), fromSVGLength, m_contextElement); >- m_animationElement->adjustForInheritance<SVGLengthValue>(parseLengthFromString, m_animationElement->toPropertyValueType(), toSVGLength, m_contextElement); >- >- SVGLengthContext lengthContext(m_contextElement); >- float animatedNumber = animatedSVGLength.value(lengthContext); >- SVGLengthType unitType = percentage < 0.5 ? fromSVGLength.unitType() : toSVGLength.unitType(); >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromSVGLength.value(lengthContext), toSVGLength.value(lengthContext), toAtEndOfDurationSVGLength.value(lengthContext), animatedNumber); >- >- animatedSVGLength.setValue(lengthContext, animatedNumber, m_lengthMode, unitType); >-} >- >-float SVGAnimatedLengthAnimator::calculateDistance(const String& fromString, const String& toString) >-{ >- ASSERT(m_animationElement); >- ASSERT(m_contextElement); >- auto lengthMode = SVGLengthValue::lengthModeForAnimatedLengthAttribute(m_animationElement->attributeName()); >- auto from = SVGLengthValue(lengthMode, fromString); >- auto to = SVGLengthValue(lengthMode, toString); >- SVGLengthContext lengthContext(m_contextElement); >- return fabsf(to.value(lengthContext) - from.value(lengthContext)); >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedLength.h b/Source/WebCore/svg/SVGAnimatedLength.h >deleted file mode 100644 >index 1004ec5d9d6..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedLength.h >+++ /dev/null >@@ -1,57 +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 "SVGLength.h" >- >-namespace WebCore { >- >-class SVGAnimationElement; >- >-using SVGAnimatedLength = SVGAnimatedPropertyTearOff<SVGLength>; >-using SVGAnimatedLengthAttribute = SVGAnimatedAttribute<SVGAnimatedLength>; >- >-template<typename OwnerType> >-using SVGAnimatedLengthAttributeAccessor = SVGAnimatedAttributeAccessor<OwnerType, SVGAnimatedLengthAttribute, AnimatedLength>; >- >-class SVGAnimatedLengthAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedLengthAnimator(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: >- SVGLengthMode m_lengthMode; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAnimatedLengthList.cpp b/Source/WebCore/svg/SVGAnimatedLengthList.cpp >deleted file mode 100644 >index d12977d0373..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedLengthList.cpp >+++ /dev/null >@@ -1,132 +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 "SVGAnimatedLengthList.h" >- >-#include "SVGAnimateElementBase.h" >-#include "SVGAnimatedNumber.h" >- >-namespace WebCore { >- >-SVGAnimatedLengthListAnimator::SVGAnimatedLengthListAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedLengthList, animationElement, contextElement) >- , m_lengthMode(SVGLengthValue::lengthModeForAnimatedLengthAttribute(animationElement->attributeName())) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedLengthListAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGPropertyTraits<SVGLengthListValues>::fromString(string, m_lengthMode)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedLengthListAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- return constructFromBaseValue<SVGAnimatedLengthList>(animatedTypes); >-} >- >-void SVGAnimatedLengthListAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForType<SVGAnimatedLengthList>(animatedTypes); >-} >- >-void SVGAnimatedLengthListAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- resetFromBaseValue<SVGAnimatedLengthList>(animatedTypes, type); >-} >- >-void SVGAnimatedLengthListAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForType<SVGAnimatedLengthList>(animatedTypes); >-} >- >-void SVGAnimatedLengthListAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForType<SVGAnimatedLengthList>(animatedTypes); >-} >- >-void SVGAnimatedLengthListAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to) >-{ >- ASSERT(from->type() == AnimatedLengthList); >- ASSERT(from->type() == to->type()); >- >- const auto& fromLengthList = from->as<SVGLengthListValues>(); >- auto& toLengthList = to->as<SVGLengthListValues>(); >- >- unsigned fromLengthListSize = fromLengthList.size(); >- if (!fromLengthListSize || fromLengthListSize != toLengthList.size()) >- return; >- >- SVGLengthContext lengthContext(m_contextElement); >- for (unsigned i = 0; i < fromLengthListSize; ++i) >- toLengthList[i].setValue(toLengthList[i].value(lengthContext) + fromLengthList[i].value(lengthContext), lengthContext); >-} >- >-static SVGLengthListValues parseLengthListFromString(SVGAnimationElement* animationElement, const String& string) >-{ >- SVGLengthListValues lengthList; >- lengthList.parse(string, SVGLengthValue::lengthModeForAnimatedLengthAttribute(animationElement->attributeName())); >- return lengthList; >-} >- >-void SVGAnimatedLengthListAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- ASSERT(m_contextElement); >- >- auto fromLengthList = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<SVGLengthListValues>(); >- auto toLengthList = to->as<SVGLengthListValues>(); >- const auto& toAtEndOfDurationLengthList = toAtEndOfDuration->as<SVGLengthListValues>(); >- auto& animatedLengthList = animated->as<SVGLengthListValues>(); >- >- // Apply CSS inheritance rules. >- m_animationElement->adjustForInheritance<SVGLengthListValues>(parseLengthListFromString, m_animationElement->fromPropertyValueType(), fromLengthList, m_contextElement); >- m_animationElement->adjustForInheritance<SVGLengthListValues>(parseLengthListFromString, m_animationElement->toPropertyValueType(), toLengthList, m_contextElement); >- >- if (!m_animationElement->adjustFromToListValues<SVGLengthListValues>(fromLengthList, toLengthList, animatedLengthList, percentage)) >- return; >- >- unsigned fromLengthListSize = fromLengthList.size(); >- unsigned toLengthListSize = toLengthList.size(); >- unsigned toAtEndOfDurationListSize = toAtEndOfDurationLengthList.size(); >- >- SVGLengthContext lengthContext(m_contextElement); >- for (unsigned i = 0; i < toLengthListSize; ++i) { >- float animatedNumber = animatedLengthList[i].value(lengthContext); >- SVGLengthType unitType = toLengthList[i].unitType(); >- float effectiveFrom = 0; >- if (fromLengthListSize) { >- if (percentage < 0.5) >- unitType = fromLengthList[i].unitType(); >- effectiveFrom = fromLengthList[i].value(lengthContext); >- } >- float effectiveToAtEnd = i < toAtEndOfDurationListSize ? toAtEndOfDurationLengthList[i].value(lengthContext) : 0; >- >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, effectiveFrom, toLengthList[i].value(lengthContext), effectiveToAtEnd, animatedNumber); >- animatedLengthList[i].setValue(lengthContext, animatedNumber, m_lengthMode, unitType); >- } >-} >- >-float SVGAnimatedLengthListAnimator::calculateDistance(const String&, const String&) >-{ >- // FIXME: Distance calculation is not possible for SVGLengthListValues right now. We need the distance for every single value. >- return -1; >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedLengthList.h b/Source/WebCore/svg/SVGAnimatedLengthList.h >deleted file mode 100644 >index 165bc48ae64..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedLengthList.h >+++ /dev/null >@@ -1,58 +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 "SVGAnimatedListPropertyTearOff.h" >-#include "SVGAnimatedTypeAnimator.h" >-#include "SVGAttributeAccessor.h" >-#include "SVGLength.h" >-#include "SVGLengthList.h" >- >-namespace WebCore { >- >-class SVGAnimationElement; >- >-using SVGAnimatedLengthList = SVGAnimatedListPropertyTearOff<SVGLengthListValues>; >-using SVGAnimatedLengthListAttribute = SVGAnimatedAttributeList<SVGAnimatedLengthList>; >- >-template<typename OwnerType> >-using SVGAnimatedLengthListAttributeAccessor = SVGAnimatedAttributeAccessor<OwnerType, SVGAnimatedLengthListAttribute, AnimatedLengthList>; >- >-class SVGAnimatedLengthListAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedLengthListAnimator(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: >- SVGLengthMode m_lengthMode; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAnimatedNumber.cpp b/Source/WebCore/svg/SVGAnimatedNumber.cpp >deleted file mode 100644 >index b56a335bace..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedNumber.cpp >+++ /dev/null >@@ -1,104 +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 "SVGAnimatedNumber.h" >- >-#include "SVGAnimateElementBase.h" >-#include "SVGParserUtilities.h" >- >-namespace WebCore { >- >-SVGAnimatedNumberAnimator::SVGAnimatedNumberAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedNumber, animationElement, contextElement) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGPropertyTraits<float>::fromString(string)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- return constructFromBaseValue<SVGAnimatedNumber>(animatedTypes); >-} >- >-void SVGAnimatedNumberAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForType<SVGAnimatedNumber>(animatedTypes); >-} >- >-void SVGAnimatedNumberAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- resetFromBaseValue<SVGAnimatedNumber>(animatedTypes, type); >-} >- >-void SVGAnimatedNumberAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForType<SVGAnimatedNumber>(animatedTypes); >-} >- >-void SVGAnimatedNumberAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForType<SVGAnimatedNumber>(animatedTypes); >-} >- >-void SVGAnimatedNumberAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to) >-{ >- ASSERT(from->type() == AnimatedNumber); >- ASSERT(from->type() == to->type()); >- >- to->as<float>() += from->as<float>(); >-} >- >-static float parseNumberFromString(SVGAnimationElement*, const String& string) >-{ >- return SVGPropertyTraits<float>::fromString(string); >-} >- >-void SVGAnimatedNumberAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- ASSERT(m_contextElement); >- >- auto fromNumber = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<float>(); >- auto toNumber = to->as<float>(); >- const auto toAtEndOfDurationNumber = toAtEndOfDuration->as<float>(); >- auto& animatedNumber = animated->as<float>(); >- >- // Apply CSS inheritance rules. >- m_animationElement->adjustForInheritance<float>(parseNumberFromString, m_animationElement->fromPropertyValueType(), fromNumber, m_contextElement); >- m_animationElement->adjustForInheritance<float>(parseNumberFromString, m_animationElement->toPropertyValueType(), toNumber, m_contextElement); >- >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromNumber, toNumber, toAtEndOfDurationNumber, animatedNumber); >-} >- >-float SVGAnimatedNumberAnimator::calculateDistance(const String& fromString, const String& toString) >-{ >- ASSERT(m_contextElement); >- float from = 0; >- float to = 0; >- parseNumberFromString(fromString, from); >- parseNumberFromString(toString, to); >- return fabsf(to - from); >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedNumber.h b/Source/WebCore/svg/SVGAnimatedNumber.h >deleted file mode 100644 >index da3d96b4034..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedNumber.h >+++ /dev/null >@@ -1,56 +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 SVGAnimatedNumber = SVGAnimatedStaticPropertyTearOff<float>; >-using SVGAnimatedNumberAttribute = SVGAnimatedAttribute<SVGAnimatedNumber>; >- >-template<typename OwnerType> >-using SVGAnimatedNumberAttributeAccessor = SVGAnimatedAttributeAccessor<OwnerType, SVGAnimatedNumberAttribute, AnimatedNumber>; >- >-template<typename OwnerType> >-using SVGAnimatedOptionalNumberAttributeAccessor = SVGAnimatedOptionalAttributeAccessor<OwnerType, SVGAnimatedNumberAttribute, AnimatedNumberOptionalNumber>; >- >-class SVGAnimatedNumberAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedNumberAnimator(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/SVGAnimatedNumberList.cpp b/Source/WebCore/svg/SVGAnimatedNumberList.cpp >deleted file mode 100644 >index bcb68487d2d..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedNumberList.cpp >+++ /dev/null >@@ -1,108 +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 "SVGAnimatedNumberList.h" >- >-#include "SVGAnimateElementBase.h" >-#include "SVGAnimatedNumber.h" >- >-namespace WebCore { >- >-SVGAnimatedNumberListAnimator::SVGAnimatedNumberListAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedNumberList, animationElement, contextElement) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberListAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGPropertyTraits<SVGNumberListValues>::fromString(string)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberListAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- return constructFromBaseValue<SVGAnimatedNumberList>(animatedTypes); >-} >- >-void SVGAnimatedNumberListAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForType<SVGAnimatedNumberList>(animatedTypes); >-} >- >-void SVGAnimatedNumberListAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- resetFromBaseValue<SVGAnimatedNumberList>(animatedTypes, type); >-} >- >-void SVGAnimatedNumberListAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForType<SVGAnimatedNumberList>(animatedTypes); >-} >- >-void SVGAnimatedNumberListAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForType<SVGAnimatedNumberList>(animatedTypes); >-} >- >-void SVGAnimatedNumberListAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to) >-{ >- ASSERT(from->type() == AnimatedNumberList); >- ASSERT(from->type() == to->type()); >- >- const auto& fromNumberList = from->as<SVGNumberListValues>(); >- auto& toNumberList = to->as<SVGNumberListValues>(); >- >- unsigned fromNumberListSize = fromNumberList.size(); >- if (!fromNumberListSize || fromNumberListSize != toNumberList.size()) >- return; >- >- for (unsigned i = 0; i < fromNumberListSize; ++i) >- toNumberList[i] += fromNumberList[i]; >-} >- >-void SVGAnimatedNumberListAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- >- const auto& fromNumberList = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<SVGNumberListValues>(); >- const auto& toNumberList = to->as<SVGNumberListValues>(); >- const auto& toAtEndOfDurationNumberList = toAtEndOfDuration->as<SVGNumberListValues>(); >- auto& animatedNumberList = animated->as<SVGNumberListValues>(); >- if (!m_animationElement->adjustFromToListValues<SVGNumberListValues>(fromNumberList, toNumberList, animatedNumberList, percentage)) >- return; >- >- unsigned fromNumberListSize = fromNumberList.size(); >- unsigned toNumberListSize = toNumberList.size(); >- unsigned toAtEndOfDurationSize = toAtEndOfDurationNumberList.size(); >- >- for (unsigned i = 0; i < toNumberListSize; ++i) { >- float effectiveFrom = fromNumberListSize ? fromNumberList[i] : 0; >- float effectiveToAtEnd = i < toAtEndOfDurationSize ? toAtEndOfDurationNumberList[i] : 0; >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, effectiveFrom, toNumberList[i], effectiveToAtEnd, animatedNumberList[i]); >- } >-} >- >-float SVGAnimatedNumberListAnimator::calculateDistance(const String&, const String&) >-{ >- // FIXME: Distance calculation is not possible for SVGNumberListValues right now. We need the distance for every single value. >- return -1; >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedNumberList.h b/Source/WebCore/svg/SVGAnimatedNumberList.h >deleted file mode 100644 >index bf7c1fe8eb5..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedNumberList.h >+++ /dev/null >@@ -1,55 +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 "SVGAnimatedListPropertyTearOff.h" >-#include "SVGAnimatedTypeAnimator.h" >-#include "SVGAttributeAccessor.h" >-#include "SVGNumber.h" >-#include "SVGNumberList.h" >- >-namespace WebCore { >- >-class SVGAnimationElement; >- >-using SVGAnimatedNumberList = SVGAnimatedListPropertyTearOff<SVGNumberListValues>; >-using SVGAnimatedNumberListAttribute = SVGAnimatedAttributeList<SVGAnimatedNumberList>; >- >-template<typename OwnerType> >-using SVGAnimatedNumberListAttributeAccessor = SVGAnimatedAttributeAccessor<OwnerType, SVGAnimatedNumberListAttribute, AnimatedNumberList>; >- >-class SVGAnimatedNumberListAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedNumberListAnimator(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/SVGAnimatedNumberOptionalNumber.cpp b/Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.cpp >deleted file mode 100644 >index 1845f196469..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.cpp >+++ /dev/null >@@ -1,96 +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 "SVGAnimatedNumberOptionalNumber.h" >- >-#include "SVGAnimateElementBase.h" >-#include "SVGAnimatedNumber.h" >-#include "SVGParserUtilities.h" >- >-namespace WebCore { >- >-SVGAnimatedNumberOptionalNumberAnimator::SVGAnimatedNumberOptionalNumberAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedNumberOptionalNumber, animationElement, contextElement) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberOptionalNumberAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGPropertyTraits<std::pair<float, float>>::fromString(string)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedNumberOptionalNumberAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- return constructFromBaseValues<SVGAnimatedNumber, SVGAnimatedNumber>(animatedTypes); >-} >- >-void SVGAnimatedNumberOptionalNumberAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForTypes<SVGAnimatedNumber, SVGAnimatedNumber>(animatedTypes); >-} >- >-void SVGAnimatedNumberOptionalNumberAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- resetFromBaseValues<SVGAnimatedNumber, SVGAnimatedNumber>(animatedTypes, type); >-} >- >-void SVGAnimatedNumberOptionalNumberAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForTypes<SVGAnimatedNumber, SVGAnimatedNumber>(animatedTypes); >-} >- >-void SVGAnimatedNumberOptionalNumberAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForTypes<SVGAnimatedNumber, SVGAnimatedNumber>(animatedTypes); >-} >- >-void SVGAnimatedNumberOptionalNumberAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to) >-{ >- ASSERT(from->type() == AnimatedNumberOptionalNumber); >- ASSERT(from->type() == to->type()); >- >- const auto& fromNumberPair = from->as<std::pair<float, float>>(); >- auto& toNumberPair = to->as<std::pair<float, float>>(); >- >- toNumberPair.first += fromNumberPair.first; >- toNumberPair.second += fromNumberPair.second; >-} >- >-void SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- ASSERT(m_contextElement); >- >- const auto& fromNumberPair = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<std::pair<float, float>>(); >- const auto& toNumberPair = to->as<std::pair<float, float>>(); >- const auto& toAtEndOfDurationNumberPair = toAtEndOfDuration->as<std::pair<float, float>>(); >- auto& animatedNumberPair = animated->as<std::pair<float, float>>(); >- >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromNumberPair.first, toNumberPair.first, toAtEndOfDurationNumberPair.first, animatedNumberPair.first); >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromNumberPair.second, toNumberPair.second, toAtEndOfDurationNumberPair.second, animatedNumberPair.second); >-} >- >-float SVGAnimatedNumberOptionalNumberAnimator::calculateDistance(const String&, const String&) >-{ >- // FIXME: Distance calculation is not possible for SVGNumberOptionalNumber right now. We need the distance for every single value. >- return -1; >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.h b/Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.h >deleted file mode 100644 >index 66c4fc0e8d2..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedNumberOptionalNumber.h >+++ /dev/null >@@ -1,44 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010. 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 "SVGAnimatedTypeAnimator.h" >- >-namespace WebCore { >- >-class SVGAnimationElement; >- >-class SVGAnimatedNumberOptionalNumberAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedNumberOptionalNumberAnimator(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/SVGAnimatedRect.cpp b/Source/WebCore/svg/SVGAnimatedRect.cpp >deleted file mode 100644 >index 15e83062747..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedRect.cpp >+++ /dev/null >@@ -1,99 +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 "SVGAnimatedRect.h" >- >-#include "SVGAnimateElementBase.h" >-#include "SVGParserUtilities.h" >- >-namespace WebCore { >- >-SVGAnimatedRectAnimator::SVGAnimatedRectAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedRect, animationElement, contextElement) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedRectAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGPropertyTraits<FloatRect>::fromString(string)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedRectAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- return constructFromBaseValue<SVGAnimatedRect>(animatedTypes); >-} >- >-void SVGAnimatedRectAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForType<SVGAnimatedRect>(animatedTypes); >-} >- >-void SVGAnimatedRectAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- resetFromBaseValue<SVGAnimatedRect>(animatedTypes, type); >-} >- >-void SVGAnimatedRectAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForType<SVGAnimatedRect>(animatedTypes); >-} >- >-void SVGAnimatedRectAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForType<SVGAnimatedRect>(animatedTypes); >-} >- >-void SVGAnimatedRectAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to) >-{ >- ASSERT(from->type() == AnimatedRect); >- ASSERT(from->type() == to->type()); >- >- to->as<FloatRect>() += from->as<FloatRect>(); >-} >- >-void SVGAnimatedRectAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- ASSERT(m_contextElement); >- >- const auto& fromRect = (m_animationElement->animationMode() == ToAnimation ? animated : from)->as<FloatRect>(); >- const auto& toRect = to->as<FloatRect>(); >- const auto& toAtEndOfDurationRect = toAtEndOfDuration->as<FloatRect>(); >- auto& animatedRect = animated->as<FloatRect>(); >- >- float animatedX = animatedRect.x(); >- float animatedY = animatedRect.y(); >- float animatedWidth = animatedRect.width(); >- float animatedHeight = animatedRect.height(); >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect.x(), toRect.x(), toAtEndOfDurationRect.x(), animatedX); >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect.y(), toRect.y(), toAtEndOfDurationRect.y(), animatedY); >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect.width(), toRect.width(), toAtEndOfDurationRect.width(), animatedWidth); >- m_animationElement->animateAdditiveNumber(percentage, repeatCount, fromRect.height(), toRect.height(), toAtEndOfDurationRect.height(), animatedHeight); >- >- animatedRect = FloatRect(animatedX, animatedY, animatedWidth, animatedHeight); >-} >- >-float SVGAnimatedRectAnimator::calculateDistance(const String&, const String&) >-{ >- // FIXME: Distance calculation is not possible for SVGRect right now. We need the distance of for every single value. >- return -1; >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedRect.h b/Source/WebCore/svg/SVGAnimatedRect.h >deleted file mode 100644 >index 8b26dce4f4c..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedRect.h >+++ /dev/null >@@ -1,57 +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 "SVGRect.h" >- >-namespace WebCore { >- >-class SVGAnimationElement; >-class SVGRect; >- >-using SVGAnimatedRect = SVGAnimatedPropertyTearOff<SVGRect>; >-using SVGAnimatedRectAttribute = SVGAnimatedAttribute<SVGAnimatedRect>; >- >-template<typename OwnerType> >-using SVGAnimatedRectAttributeAccessor = SVGAnimatedAttributeAccessor<OwnerType, SVGAnimatedRectAttribute, AnimatedRect>; >- >-class SVGAnimatedRectAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedRectAnimator(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; >- >- static bool parseSVGRect(const String&, FloatRect&); >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAnimatedString.cpp b/Source/WebCore/svg/SVGAnimatedString.cpp >deleted file mode 100644 >index 99c0dac2b86..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedString.cpp >+++ /dev/null >@@ -1,94 +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 "SVGAnimatedString.h" >- >-#include "SVGAnimateElementBase.h" >- >-namespace WebCore { >- >-SVGAnimatedStringAnimator::SVGAnimatedStringAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedString, animationElement, contextElement) >-{ >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedStringAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGPropertyTraits<String>::fromString(string)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedStringAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- return constructFromBaseValue<SVGAnimatedString>(animatedTypes); >-} >- >-void SVGAnimatedStringAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForType<SVGAnimatedString>(animatedTypes); >-} >- >-void SVGAnimatedStringAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- resetFromBaseValue<SVGAnimatedString>(animatedTypes, type); >-} >- >-void SVGAnimatedStringAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForType<SVGAnimatedString>(animatedTypes); >-} >- >-void SVGAnimatedStringAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForType<SVGAnimatedString>(animatedTypes); >-} >- >-void SVGAnimatedStringAnimator::addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*) >-{ >- ASSERT_NOT_REACHED(); >-} >- >-static String parseStringFromString(SVGAnimationElement*, const String& string) >-{ >- return string; >-} >- >-void SVGAnimatedStringAnimator::calculateAnimatedValue(float percentage, unsigned, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType*, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- ASSERT(m_contextElement); >- >- auto fromString = from->as<String>(); >- auto toString = to->as<String>(); >- auto& animatedString = animated->as<String>(); >- >- // Apply CSS inheritance rules. >- m_animationElement->adjustForInheritance<String>(parseStringFromString, m_animationElement->fromPropertyValueType(), fromString, m_contextElement); >- m_animationElement->adjustForInheritance<String>(parseStringFromString, m_animationElement->toPropertyValueType(), toString, m_contextElement); >- >- m_animationElement->animateDiscreteType<String>(percentage, fromString, toString, animatedString); >-} >- >-float SVGAnimatedStringAnimator::calculateDistance(const String&, const String&) >-{ >- // No paced animations for strings. >- return -1; >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedString.h b/Source/WebCore/svg/SVGAnimatedString.h >deleted file mode 100644 >index 10987316f07..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedString.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 SVGAnimatedString = SVGAnimatedStaticPropertyTearOff<String>; >-using SVGAnimatedStringAttribute = SVGAnimatedAttribute<SVGAnimatedString>; >- >-template<typename OwnerType> >-using SVGAnimatedStringAttributeAccessor = SVGAnimatedAttributeAccessor<OwnerType, SVGAnimatedStringAttribute, AnimatedString>; >- >-class SVGAnimatedStringAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedStringAnimator(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/SVGAnimatedTransformList.cpp b/Source/WebCore/svg/SVGAnimatedTransformList.cpp >deleted file mode 100644 >index e6fcd0d6c92..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedTransformList.cpp >+++ /dev/null >@@ -1,147 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> >- * Copyright (C) 2007 Eric Seidel <eric@webkit.org> >- * Copyright (C) 2008 Apple Inc. All rights reserved. >- * Copyright (C) Research In Motion Limited 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 "SVGAnimatedTransformList.h" >- >-#include "SVGAnimateTransformElement.h" >-#include "SVGAnimatedNumber.h" >-#include "SVGNames.h" >-#include "SVGTransformDistance.h" >- >-namespace WebCore { >- >-SVGAnimatedTransformListAnimator::SVGAnimatedTransformListAnimator(SVGAnimationElement* animationElement, SVGElement* contextElement) >- : SVGAnimatedTypeAnimator(AnimatedTransformList, animationElement, contextElement) >- , m_transformTypeString(SVGTransformValue::transformTypePrefixForParsing(downcast<SVGAnimateTransformElement>(animationElement)->transformType())) >-{ >- // Only <animateTransform> uses this animator, as <animate> doesn't allow to animate transform lists directly. >- ASSERT(animationElement->hasTagName(SVGNames::animateTransformTag)); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedTransformListAnimator::constructFromString(const String& string) >-{ >- return SVGAnimatedType::create(SVGPropertyTraits<SVGTransformListValues>::fromString(m_transformTypeString + string + ')')); >-} >- >-std::unique_ptr<SVGAnimatedType> SVGAnimatedTransformListAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- return constructFromBaseValue<SVGAnimatedTransformList>(animatedTypes); >-} >- >-void SVGAnimatedTransformListAnimator::stopAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- stopAnimValAnimationForType<SVGAnimatedTransformList>(animatedTypes); >-} >- >-void SVGAnimatedTransformListAnimator::resetAnimValToBaseVal(const SVGElementAnimatedPropertyList& animatedTypes, SVGAnimatedType& type) >-{ >- resetFromBaseValue<SVGAnimatedTransformList>(animatedTypes, type); >-} >- >-void SVGAnimatedTransformListAnimator::animValWillChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValWillChangeForType<SVGAnimatedTransformList>(animatedTypes); >-} >- >-void SVGAnimatedTransformListAnimator::animValDidChange(const SVGElementAnimatedPropertyList& animatedTypes) >-{ >- animValDidChangeForType<SVGAnimatedTransformList>(animatedTypes); >-} >- >-void SVGAnimatedTransformListAnimator::addAnimatedTypes(SVGAnimatedType* from, SVGAnimatedType* to) >-{ >- ASSERT(from->type() == AnimatedTransformList); >- ASSERT(from->type() == to->type()); >- >- const auto& fromTransformList = from->as<SVGTransformListValues>(); >- auto& toTransformList = to->as<SVGTransformListValues>(); >- auto fromTransformListSize = fromTransformList.size(); >- if (!fromTransformListSize || fromTransformListSize != toTransformList.size()) >- return; >- >- ASSERT(fromTransformListSize == 1); >- const auto& fromTransform = fromTransformList[0]; >- auto& toTransform = toTransformList[0]; >- >- ASSERT(fromTransform.type() == toTransform.type()); >- toTransform = SVGTransformDistance::addSVGTransforms(fromTransform, toTransform); >-} >- >-void SVGAnimatedTransformListAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated) >-{ >- ASSERT(m_animationElement); >- >- // Spec: To animations provide specific functionality to get a smooth change from the underlying value to the >- // ‘to’ attribute value, which conflicts mathematically with the requirement for additive transform animations >- // to be post-multiplied. As a consequence, in SVG 1.1 the behavior of to animations for ‘animateTransform’ is undefined. >- const auto& fromTransformList = from->as<SVGTransformListValues>(); >- const auto& toTransformList = to->as<SVGTransformListValues>(); >- const auto& toAtEndOfDurationTransformList = toAtEndOfDuration->as<SVGTransformListValues>(); >- auto& animatedTransformList = animated->as<SVGTransformListValues>(); >- >- // Pass false to 'resizeAnimatedListIfNeeded' here, as the special post-multiplication behavior of <animateTransform> needs to be respected below. >- if (!m_animationElement->adjustFromToListValues<SVGTransformListValues>(fromTransformList, toTransformList, animatedTransformList, percentage, false)) >- return; >- >- // Never resize the animatedTransformList to the toTransformList size, instead either clear the list or append to it. >- if (!animatedTransformList.isEmpty() && (!m_animationElement->isAdditive() || m_animationElement->animationMode() == ToAnimation)) >- animatedTransformList.clear(); >- >- auto fromTransformListSize = fromTransformList.size(); >- const auto& toTransform = toTransformList[0]; >- const auto effectiveFrom = fromTransformListSize ? fromTransformList[0] : SVGTransformValue(toTransform.type(), SVGTransformValue::ConstructZeroTransform); >- auto currentTransform = SVGTransformDistance(effectiveFrom, toTransform).scaledDistance(percentage).addToSVGTransform(effectiveFrom); >- if (m_animationElement->isAccumulated() && repeatCount) { >- const auto effectiveToAtEnd = toAtEndOfDurationTransformList.size() ? toAtEndOfDurationTransformList[0] : SVGTransformValue(toTransform.type(), SVGTransformValue::ConstructZeroTransform); >- animatedTransformList.append(SVGTransformDistance::addSVGTransforms(currentTransform, effectiveToAtEnd, repeatCount)); >- } else >- animatedTransformList.append(currentTransform); >-} >- >-float SVGAnimatedTransformListAnimator::calculateDistance(const String& fromString, const String& toString) >-{ >- ASSERT(m_animationElement); >- >- // FIXME: This is not correct in all cases. The spec demands that each component (translate x and y for example) >- // is paced separately. To implement this we need to treat each component as individual animation everywhere. >- auto from = constructFromString(fromString); >- auto to = constructFromString(toString); >- >- const auto& fromTransformList = from->as<SVGTransformListValues>(); >- const auto& toTransformList = to->as<SVGTransformListValues>(); >- unsigned itemsCount = fromTransformList.size(); >- if (!itemsCount || itemsCount != toTransformList.size()) >- return -1; >- >- ASSERT(itemsCount == 1); >- if (fromTransformList[0].type() != toTransformList[0].type()) >- return -1; >- >- // Spec: http://www.w3.org/TR/SVG/animate.html#complexDistances >- // Paced animations assume a notion of distance between the various animation values defined by the ‘to’, ‘from’, ‘by’ and ‘values’ attributes. >- // Distance is defined only for scalar types (such as <length>), colors and the subset of transformation types that are supported by ‘animateTransform’. >- return SVGTransformDistance(fromTransformList[0], toTransformList[0]).distance(); >-} >- >-} >diff --git a/Source/WebCore/svg/SVGAnimatedTransformList.h b/Source/WebCore/svg/SVGAnimatedTransformList.h >deleted file mode 100644 >index 0b169f5c9ba..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedTransformList.h >+++ /dev/null >@@ -1,57 +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 "SVGAnimatedTransformListPropertyTearOff.h" >-#include "SVGAnimatedTypeAnimator.h" >-#include "SVGAttributeAccessor.h" >-#include "SVGTransformList.h" >- >-namespace WebCore { >- >-class SVGAnimationElement; >- >-using SVGAnimatedTransformList = SVGAnimatedTransformListPropertyTearOff; >-using SVGAnimatedTransformListAttribute = SVGAnimatedAttributeList<SVGAnimatedTransformList>; >- >-template<typename OwnerType> >-using SVGAnimatedTransformListAttributeAccessor = SVGAnimatedAttributeAccessor<OwnerType, SVGAnimatedTransformListAttribute, AnimatedTransformList>; >- >-class SVGAnimatedTransformListAnimator final : public SVGAnimatedTypeAnimator { >-public: >- SVGAnimatedTransformListAnimator(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: >- const String& m_transformTypeString; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAnimatedType.h b/Source/WebCore/svg/SVGAnimatedType.h >deleted file mode 100644 >index c6d78acc9d7..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedType.h >+++ /dev/null >@@ -1,147 +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 "SVGValue.h" >- >-namespace WebCore { >- >-class SVGAnimatedType { >- WTF_MAKE_FAST_ALLOCATED; >-public: >- template<typename PropertyType> >- static std::unique_ptr<SVGAnimatedType> create() >- { >- return std::make_unique<SVGAnimatedType>(SVGPropertyTraits<PropertyType>::initialValue()); >- } >- >- template<typename PropertyType> >- static std::unique_ptr<SVGAnimatedType> create(const PropertyType& property) >- { >- return std::make_unique<SVGAnimatedType>(property); >- } >- >- template<typename PropertyType> >- static std::unique_ptr<SVGAnimatedType> create(PropertyType&& property) >- { >- return std::make_unique<SVGAnimatedType>(WTFMove(property)); >- } >- >- template<typename PropertyType1, typename PropertyType2> >- static std::unique_ptr<SVGAnimatedType> create() >- { >- return std::make_unique<SVGAnimatedType>(SVGPropertyTraits<std::pair<PropertyType1, PropertyType2>>::initialValue()); >- } >- >- template<typename PropertyType1, typename PropertyType2> >- static std::unique_ptr<SVGAnimatedType> create(const std::pair<PropertyType1, PropertyType2>& properties) >- { >- return std::make_unique<SVGAnimatedType>(properties); >- } >- >- template<typename PropertyType1, typename PropertyType2> >- static std::unique_ptr<SVGAnimatedType> create(std::pair<PropertyType1, PropertyType2>&& properties) >- { >- return std::make_unique<SVGAnimatedType>(WTFMove(properties)); >- } >- >- template<typename PropertyType> >- SVGAnimatedType(const PropertyType& property) >- : m_value(std::make_unique<PropertyType>(property).release()) >- { >- } >- >- template<typename PropertyType> >- SVGAnimatedType(PropertyType&& property) >- : m_value(std::make_unique<PropertyType>(WTFMove(property)).release()) >- { >- } >- >- template<typename PropertyType1, typename PropertyType2> >- SVGAnimatedType(const std::pair<PropertyType1, PropertyType2>& properties) >- : m_value(std::make_unique<std::pair<PropertyType1, PropertyType2>>(properties).release()) >- { >- } >- >- template<typename PropertyType1, typename PropertyType2> >- SVGAnimatedType(std::pair<PropertyType1, PropertyType2>&& properties) >- : m_value(std::make_unique<std::pair<PropertyType1, PropertyType2>>(WTFMove(properties)).release()) >- { >- } >- >- ~SVGAnimatedType() >- { >- WTF::visit([](auto& value) { >- delete value; >- }, m_value); >- } >- >- template <class PropertyType> >- const PropertyType& as() const >- { >- ASSERT(WTF::holds_alternative<PropertyType*>(m_value)); >- return *WTF::get<PropertyType*>(m_value); >- } >- >- template <class PropertyType> >- PropertyType& as() >- { >- ASSERT(WTF::holds_alternative<PropertyType*>(m_value)); >- return *WTF::get<PropertyType*>(m_value); >- } >- >- AnimatedPropertyType type() const >- { >- ASSERT(m_value.index() >= AnimatedPropertyTypeMin && m_value.index() < AnimatedPropertyTypeMax); >- return static_cast<AnimatedPropertyType>(m_value.index()); >- } >- >- String valueAsString() const >- { >- return WTF::visit([](auto& value) { >- using PropertyType = std::decay_t<decltype(*value)>; >- return SVGPropertyTraits<PropertyType>::toString(*value); >- }, m_value); >- } >- >- bool setValueAsString(const QualifiedName& attrName, const String& string) >- { >- return WTF::visit([&](auto& value) { >- using PropertyType = std::decay_t<decltype(*value)>; >- if (auto result = SVGPropertyTraits<PropertyType>::parse(attrName, string)) { >- *value = *result; >- return true; >- } >- return false; >- }, m_value); >- } >- >- static bool supportsAnimVal(AnimatedPropertyType type) >- { >- // AnimatedColor is only used for CSS property animations. >- return type != AnimatedUnknown && type != AnimatedColor; >- } >- >-private: >- SVGValueVariant m_value; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAnimatedTypeAnimator.cpp b/Source/WebCore/svg/SVGAnimatedTypeAnimator.cpp >deleted file mode 100644 >index dcf9c44b6cb..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedTypeAnimator.cpp >+++ /dev/null >@@ -1,86 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGAnimatedTypeAnimator.h" >- >-#include "SVGElement.h" >- >-namespace WebCore { >- >-SVGAnimatedTypeAnimator::SVGAnimatedTypeAnimator(AnimatedPropertyType type, SVGAnimationElement* animationElement, SVGElement* contextElement) >- : m_type(type) >- , m_animationElement(animationElement) >- , m_contextElement(contextElement) >-{ >-} >- >-SVGAnimatedTypeAnimator::~SVGAnimatedTypeAnimator() = default; >- >-void SVGAnimatedTypeAnimator::calculateFromAndToValues(std::unique_ptr<SVGAnimatedType>& from, std::unique_ptr<SVGAnimatedType>& to, const String& fromString, const String& toString) >-{ >- from = constructFromString(fromString); >- to = constructFromString(toString); >-} >- >-void SVGAnimatedTypeAnimator::calculateFromAndByValues(std::unique_ptr<SVGAnimatedType>& from, std::unique_ptr<SVGAnimatedType>& to, const String& fromString, const String& byString) >-{ >- from = constructFromString(fromString); >- to = constructFromString(byString); >- addAnimatedTypes(from.get(), to.get()); >-} >- >-SVGElementAnimatedPropertyList SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName(SVGElement& targetElement, const QualifiedName& attributeName) >-{ >- SVGElementAnimatedPropertyList result; >- >- if (!SVGAnimatedType::supportsAnimVal(m_type)) >- return result; >- >- auto targetProperties = targetElement.lookupOrCreateAnimatedProperties(attributeName); >- if (targetProperties.isEmpty()) >- return result; >- >- result.append(SVGElementAnimatedProperties { &targetElement, WTFMove(targetProperties) }); >- >- for (SVGElement* instance : targetElement.instances()) >- result.append(SVGElementAnimatedProperties { instance, instance->lookupOrCreateAnimatedProperties(attributeName) }); >- >-#if !ASSERT_DISABLED >- for (auto& animatedProperties : result) { >- for (auto& property : animatedProperties.properties) { >- if (property->animatedPropertyType() != m_type) { >- ASSERT(m_type == AnimatedAngle); >- ASSERT(property->animatedPropertyType() == AnimatedEnumeration); >- } >- } >- } >-#endif >- >- return result; >-} >- >-void SVGAnimatedTypeAnimator::setInstanceUpdatesBlocked(SVGElement& element, bool blocked) >-{ >- element.setInstanceUpdatesBlocked(blocked); >-} >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAnimatedTypeAnimator.h b/Source/WebCore/svg/SVGAnimatedTypeAnimator.h >deleted file mode 100644 >index 6b3a4847846..00000000000 >--- a/Source/WebCore/svg/SVGAnimatedTypeAnimator.h >+++ /dev/null >@@ -1,231 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGAnimatedProperty.h" >-#include "SVGAnimatedType.h" >-#include <wtf/StdLibExtras.h> >- >-namespace WebCore { >- >-struct SVGElementAnimatedProperties { >- SVGElement* element; >- Vector<RefPtr<SVGAnimatedProperty>> properties; >-}; >-typedef Vector<SVGElementAnimatedProperties> SVGElementAnimatedPropertyList; >- >-class SVGAnimationElement; >- >-class SVGAnimatedTypeAnimator { >- WTF_MAKE_FAST_ALLOCATED; >-public: >- virtual ~SVGAnimatedTypeAnimator(); >- virtual std::unique_ptr<SVGAnimatedType> constructFromString(const String&) = 0; >- >- virtual std::unique_ptr<SVGAnimatedType> startAnimValAnimation(const SVGElementAnimatedPropertyList&) = 0; >- virtual void stopAnimValAnimation(const SVGElementAnimatedPropertyList&) = 0; >- virtual void resetAnimValToBaseVal(const SVGElementAnimatedPropertyList&, SVGAnimatedType&) = 0; >- virtual void animValWillChange(const SVGElementAnimatedPropertyList&) = 0; >- virtual void animValDidChange(const SVGElementAnimatedPropertyList&) = 0; >- virtual void addAnimatedTypes(SVGAnimatedType*, SVGAnimatedType*) = 0; >- >- virtual void calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*, SVGAnimatedType*) = 0; >- virtual float calculateDistance(const String& fromString, const String& toString) = 0; >- >- void calculateFromAndToValues(std::unique_ptr<SVGAnimatedType>&, std::unique_ptr<SVGAnimatedType>&, const String& fromString, const String& toString); >- void calculateFromAndByValues(std::unique_ptr<SVGAnimatedType>&, std::unique_ptr<SVGAnimatedType>&, const String& fromString, const String& byString); >- >- void setContextElement(SVGElement* contextElement) { m_contextElement = contextElement; } >- AnimatedPropertyType type() const { return m_type; } >- >- SVGElementAnimatedPropertyList findAnimatedPropertiesForAttributeName(SVGElement&, const QualifiedName&); >- >-protected: >- SVGAnimatedTypeAnimator(AnimatedPropertyType, SVGAnimationElement*, SVGElement*); >- >- // Helpers for animators that operate on single types, eg. just one SVGAnimatedInteger. >- template<typename AnimValType> >- std::unique_ptr<SVGAnimatedType> constructFromBaseValue(const SVGElementAnimatedPropertyList& animatedProperties) >- { >- ASSERT(animatedProperties[0].properties.size() == 1); >- const auto* animatedProperty = castAnimatedPropertyToActualType<AnimValType>(animatedProperties[0].properties[0].get()); >- >- auto animatedType = SVGAnimatedType::create(animatedProperty->currentBaseValue()); >- auto& animatedValue = animatedType->template as<typename AnimValType::ContentType>(); >- executeAction<AnimValType>(StartAnimationAction, animatedProperties, 0, &animatedValue); >- return animatedType; >- } >- >- template<typename AnimValType> >- void resetFromBaseValue(const SVGElementAnimatedPropertyList& animatedProperties, SVGAnimatedType& animatedType) >- { >- ASSERT(animatedProperties[0].properties.size() == 1); >- ASSERT(animatedType.type() == m_type); >- auto* animatedProperty = castAnimatedPropertyToActualType<AnimValType>(animatedProperties[0].properties[0].get()); >- animatedProperty->synchronizeWrappersIfNeeded(); >- >- auto& animatedValue = animatedType.as<typename AnimValType::ContentType>(); >- animatedValue = animatedProperty->currentBaseValue(); >- executeAction<AnimValType>(StartAnimationAction, animatedProperties, 0, &animatedValue); >- } >- >- template<typename AnimValType> >- void stopAnimValAnimationForType(const SVGElementAnimatedPropertyList& animatedProperties) >- { >- ASSERT(animatedProperties[0].properties.size() == 1); >- executeAction<AnimValType>(StopAnimationAction, animatedProperties, 0); >- } >- >- template<typename AnimValType> >- void animValDidChangeForType(const SVGElementAnimatedPropertyList& animatedProperties) >- { >- ASSERT(animatedProperties[0].properties.size() == 1); >- executeAction<AnimValType>(AnimValDidChangeAction, animatedProperties, 0); >- } >- >- template<typename AnimValType> >- void animValWillChangeForType(const SVGElementAnimatedPropertyList& animatedProperties) >- { >- ASSERT(animatedProperties[0].properties.size() == 1); >- executeAction<AnimValType>(AnimValWillChangeAction, animatedProperties, 0); >- } >- >- // Helpers for animators that operate on pair types, eg. a pair of SVGAnimatedIntegers. >- template<typename AnimValType1, typename AnimValType2> >- std::unique_ptr<SVGAnimatedType> constructFromBaseValues(const SVGElementAnimatedPropertyList& animatedProperties) >- { >- ASSERT(animatedProperties[0].properties.size() == 2); >- const auto* firstAnimatedProperty = castAnimatedPropertyToActualType<AnimValType1>(animatedProperties[0].properties[0].get()); >- const auto* secondAnimatedProperty = castAnimatedPropertyToActualType<AnimValType2>(animatedProperties[0].properties[1].get()); >- >- auto animatedType = SVGAnimatedType::create(std::make_pair(firstAnimatedProperty->currentBaseValue(), secondAnimatedProperty->currentBaseValue())); >- auto& AnimatedValue = animatedType->template as<std::pair<typename AnimValType1::ContentType, typename AnimValType2::ContentType>>(); >- executeAction<AnimValType1>(StartAnimationAction, animatedProperties, 0, &AnimatedValue.first); >- executeAction<AnimValType2>(StartAnimationAction, animatedProperties, 1, &AnimatedValue.second); >- return animatedType; >- } >- >- template<typename AnimValType1, typename AnimValType2> >- void resetFromBaseValues(const SVGElementAnimatedPropertyList& animatedProperties, SVGAnimatedType& animatedType) >- { >- ASSERT(animatedProperties[0].properties.size() == 2); >- ASSERT(animatedType.type() == m_type); >- auto* firstAnimatedProperty = castAnimatedPropertyToActualType<AnimValType1>(animatedProperties[0].properties[0].get()); >- auto* secondAnimatedProperty = castAnimatedPropertyToActualType<AnimValType2>(animatedProperties[0].properties[1].get()); >- firstAnimatedProperty->synchronizeWrappersIfNeeded(); >- secondAnimatedProperty->synchronizeWrappersIfNeeded(); >- >- auto& animatedValue = animatedType.as<std::pair<typename AnimValType1::ContentType, typename AnimValType2::ContentType>>(); >- animatedValue.first = firstAnimatedProperty->currentBaseValue(); >- animatedValue.second = secondAnimatedProperty->currentBaseValue(); >- executeAction<AnimValType1>(StartAnimationAction, animatedProperties, 0, &animatedValue.first); >- executeAction<AnimValType2>(StartAnimationAction, animatedProperties, 1, &animatedValue.second); >- } >- >- template<typename AnimValType1, typename AnimValType2> >- void stopAnimValAnimationForTypes(const SVGElementAnimatedPropertyList& animatedProperties) >- { >- ASSERT(animatedProperties[0].properties.size() == 2); >- executeAction<AnimValType1>(StopAnimationAction, animatedProperties, 0); >- executeAction<AnimValType2>(StopAnimationAction, animatedProperties, 1); >- } >- >- template<typename AnimValType1, typename AnimValType2> >- void animValDidChangeForTypes(const SVGElementAnimatedPropertyList& animatedProperties) >- { >- ASSERT(animatedProperties[0].properties.size() == 2); >- executeAction<AnimValType1>(AnimValDidChangeAction, animatedProperties, 0); >- executeAction<AnimValType2>(AnimValDidChangeAction, animatedProperties, 1); >- } >- >- template<typename AnimValType1, typename AnimValType2> >- void animValWillChangeForTypes(const SVGElementAnimatedPropertyList& animatedProperties) >- { >- ASSERT(animatedProperties[0].properties.size() == 2); >- executeAction<AnimValType1>(AnimValWillChangeAction, animatedProperties, 0); >- executeAction<AnimValType2>(AnimValWillChangeAction, animatedProperties, 1); >- } >- >- template<typename AnimValType> >- AnimValType* castAnimatedPropertyToActualType(SVGAnimatedProperty* property) >- { >- ASSERT(property); >- ASSERT(property->contextElement()); >- // We can't assert property->animatedPropertyType() == m_type, as there's an exception for SVGMarkerElements orient attribute. >- if (property->animatedPropertyType() != m_type) { >- ASSERT(m_type == AnimatedAngle); >- ASSERT(property->animatedPropertyType() == AnimatedEnumeration); >- } >- return static_cast<AnimValType*>(property); >- } >- >- AnimatedPropertyType m_type; >- SVGAnimationElement* m_animationElement; >- SVGElement* m_contextElement; >- >-private: >- enum AnimationAction { >- StartAnimationAction, >- StopAnimationAction, >- AnimValWillChangeAction, >- AnimValDidChangeAction >- }; >- >- template<typename AnimValType> >- void executeAction(AnimationAction action, const SVGElementAnimatedPropertyList& animatedProperties, unsigned whichProperty, typename AnimValType::ContentType* animatedValue = nullptr) >- { >- // FIXME: Can't use SVGElement::InstanceUpdateBlocker because of circular header dependency. Would be nice to untangle this. >- setInstanceUpdatesBlocked(*animatedProperties[0].element, true); >- >- for (auto& animatedProperty : animatedProperties) { >- RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(whichProperty < animatedProperty.properties.size()); >- AnimValType* property = castAnimatedPropertyToActualType<AnimValType>(animatedProperty.properties[whichProperty].get()); >- >- switch (action) { >- case StartAnimationAction: >- ASSERT(animatedValue); >- if (!property->isAnimating()) >- property->animationStarted(animatedValue); >- break; >- case StopAnimationAction: >- ASSERT(!animatedValue); >- if (property->isAnimating()) >- property->animationEnded(); >- break; >- case AnimValWillChangeAction: >- ASSERT(!animatedValue); >- property->animValWillChange(); >- break; >- case AnimValDidChangeAction: >- ASSERT(!animatedValue); >- property->animValDidChange(); >- break; >- } >- } >- >- setInstanceUpdatesBlocked(*animatedProperties[0].element, false); >- } >- >- static void setInstanceUpdatesBlocked(SVGElement&, bool); >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGAnimationElement.cpp b/Source/WebCore/svg/SVGAnimationElement.cpp >index 3f25808f8c4..65851d0caf6 100644 >--- a/Source/WebCore/svg/SVGAnimationElement.cpp >+++ b/Source/WebCore/svg/SVGAnimationElement.cpp >@@ -26,7 +26,6 @@ > #include "config.h" > #include "SVGAnimationElement.h" > >-#include "CSSComputedStyleDeclaration.h" > #include "CSSPropertyNames.h" > #include "CSSPropertyParser.h" > #include "Document.h" >@@ -268,13 +267,13 @@ void SVGAnimationElement::updateAnimationMode() > { > // http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimFuncValues > if (hasAttribute(SVGNames::valuesAttr)) >- setAnimationMode(ValuesAnimation); >+ setAnimationMode(AnimationMode::Values); > else if (!toValue().isEmpty()) >- setAnimationMode(fromValue().isEmpty() ? ToAnimation : FromToAnimation); >+ setAnimationMode(fromValue().isEmpty() ? AnimationMode::To : AnimationMode::FromTo); > else if (!byValue().isEmpty()) >- setAnimationMode(fromValue().isEmpty() ? ByAnimation : FromByAnimation); >+ setAnimationMode(fromValue().isEmpty() ? AnimationMode::By : AnimationMode::FromBy); > else >- setAnimationMode(NoAnimation); >+ setAnimationMode(AnimationMode::None); > } > > void SVGAnimationElement::setCalcMode(const AtomicString& calcMode) >@@ -305,7 +304,6 @@ void SVGAnimationElement::setAttributeType(const AtomicString& attributeType) > m_attributeType = AttributeType::XML; > else > m_attributeType = AttributeType::Auto; >- checkInvalidCSSAttributeType(targetElement()); > } > > String SVGAnimationElement::toValue() const >@@ -327,49 +325,20 @@ bool SVGAnimationElement::isAdditive() const > { > static NeverDestroyed<const AtomicString> sum("sum", AtomicString::ConstructFromLiteral); > const AtomicString& value = attributeWithoutSynchronization(SVGNames::additiveAttr); >- return value == sum || animationMode() == ByAnimation; >+ return value == sum || animationMode() == AnimationMode::By; > } > > bool SVGAnimationElement::isAccumulated() const > { > static NeverDestroyed<const AtomicString> sum("sum", AtomicString::ConstructFromLiteral); > const AtomicString& value = attributeWithoutSynchronization(SVGNames::accumulateAttr); >- return value == sum && animationMode() != ToAnimation; >-} >- >-bool SVGAnimationElement::isTargetAttributeCSSProperty(SVGElement* element, const QualifiedName& attributeName) >-{ >- if (element->isTextContent() >- && (attributeName == SVGNames::xAttr || attributeName == SVGNames::yAttr)) >- return false; >- >- return SVGElement::isAnimatableCSSProperty(attributeName); >-} >- >-SVGAnimationElement::ShouldApplyAnimation SVGAnimationElement::shouldApplyAnimation(SVGElement* targetElement, const QualifiedName& attributeName) >-{ >- if (!hasValidAttributeType() || !targetElement || attributeName == anyQName()) >- return DontApplyAnimation; >- >- // Always animate CSS properties, using the ApplyCSSAnimation code path, regardless of the attributeType value. >- if (isTargetAttributeCSSProperty(targetElement, attributeName)) { >- if (targetElement->isPresentationAttributeWithSVGDOM(attributeName)) >- return ApplyXMLandCSSAnimation; >- return ApplyCSSAnimation; >- } >- >- >- // If attributeType="CSS" and attributeName doesn't point to a CSS property, ignore the animation. >- if (attributeType() == AttributeType::CSS) >- return DontApplyAnimation; >- >- return ApplyXMLAnimation; >+ return value == sum && animationMode() != AnimationMode::To; > } > > void SVGAnimationElement::calculateKeyTimesForCalcModePaced() > { > ASSERT(calcMode() == CalcMode::Paced); >- ASSERT(animationMode() == ValuesAnimation); >+ ASSERT(animationMode() == AnimationMode::Values); > > unsigned valuesCount = m_values.size(); > ASSERT(valuesCount >= 1); >@@ -492,8 +461,7 @@ void SVGAnimationElement::currentValuesForValuesAnimation(float percent, float& > CalcMode calcMode = this->calcMode(); > if (is<SVGAnimateElement>(*this) || is<SVGAnimateColorElement>(*this)) { > ASSERT(targetElement()); >- AnimatedPropertyType type = downcast<SVGAnimateElementBase>(*this).determineAnimatedPropertyType(*targetElement()); >- if (type == AnimatedBoolean || type == AnimatedEnumeration || type == AnimatedPreserveAspectRatio || type == AnimatedString) >+ if (downcast<SVGAnimateElementBase>(*this).isDiscreteAnimator()) > calcMode = CalcMode::Discrete; > } > if (!m_keyPoints.isEmpty() && calcMode != CalcMode::Paced) >@@ -554,7 +522,7 @@ void SVGAnimationElement::startedActiveInterval() > unsigned splinesCount = m_keySplines.size(); > if (!splinesCount > || (hasAttributeWithoutSynchronization(SVGNames::keyPointsAttr) && m_keyPoints.size() - 1 != splinesCount) >- || (animationMode == ValuesAnimation && m_values.size() - 1 != splinesCount) >+ || (animationMode == AnimationMode::Values && m_values.size() - 1 != splinesCount) > || (hasAttributeWithoutSynchronization(SVGNames::keyTimesAttr) && m_keyTimes.size() - 1 != splinesCount)) > return; > } >@@ -562,22 +530,22 @@ void SVGAnimationElement::startedActiveInterval() > String from = fromValue(); > String to = toValue(); > String by = byValue(); >- if (animationMode == NoAnimation) >+ if (animationMode == AnimationMode::None) > return; >- if ((animationMode == FromToAnimation || animationMode == FromByAnimation || animationMode == ToAnimation || animationMode == ByAnimation) >+ if ((animationMode == AnimationMode::FromTo || animationMode == AnimationMode::FromBy || animationMode == AnimationMode::To || animationMode == AnimationMode::By) > && (hasAttributeWithoutSynchronization(SVGNames::keyPointsAttr) && hasAttributeWithoutSynchronization(SVGNames::keyTimesAttr) && (m_keyTimes.size() < 2 || m_keyTimes.size() != m_keyPoints.size()))) > return; >- if (animationMode == FromToAnimation) >+ if (animationMode == AnimationMode::FromTo) > m_animationValid = calculateFromAndToValues(from, to); >- else if (animationMode == ToAnimation) { >+ else if (animationMode == AnimationMode::To) { > // For to-animations the from value is the current accumulated value from lower priority animations. > // The value is not static and is determined during the animation. > m_animationValid = calculateFromAndToValues(emptyString(), to); >- } else if (animationMode == FromByAnimation) >+ } else if (animationMode == AnimationMode::FromBy) > m_animationValid = calculateFromAndByValues(from, by); >- else if (animationMode == ByAnimation) >+ else if (animationMode == AnimationMode::By) > m_animationValid = calculateFromAndByValues(emptyString(), by); >- else if (animationMode == ValuesAnimation) { >+ else if (animationMode == AnimationMode::Values) { > m_animationValid = m_values.size() >= 1 > && (calcMode == CalcMode::Paced || !hasAttributeWithoutSynchronization(SVGNames::keyTimesAttr) || hasAttributeWithoutSynchronization(SVGNames::keyPointsAttr) || (m_values.size() == m_keyTimes.size())) > && (calcMode == CalcMode::Discrete || !m_keyTimes.size() || m_keyTimes.last() == 1) >@@ -587,7 +555,7 @@ void SVGAnimationElement::startedActiveInterval() > m_animationValid = calculateToAtEndOfDurationValue(m_values.last()); > if (calcMode == CalcMode::Paced && m_animationValid) > calculateKeyTimesForCalcModePaced(); >- } else if (animationMode == PathAnimation) >+ } else if (animationMode == AnimationMode::Path) > m_animationValid = calcMode == CalcMode::Paced || !hasAttributeWithoutSynchronization(SVGNames::keyPointsAttr) || (m_keyTimes.size() > 1 && m_keyTimes.size() == m_keyPoints.size()); > } > >@@ -599,7 +567,7 @@ void SVGAnimationElement::updateAnimation(float percent, unsigned repeatCount, S > float effectivePercent; > CalcMode calcMode = this->calcMode(); > AnimationMode animationMode = this->animationMode(); >- if (animationMode == ValuesAnimation) { >+ if (animationMode == AnimationMode::Values) { > String from; > String to; > currentValuesForValuesAnimation(percent, effectivePercent, from, to); >@@ -614,7 +582,7 @@ void SVGAnimationElement::updateAnimation(float percent, unsigned repeatCount, S > effectivePercent = calculatePercentFromKeyPoints(percent); > else if (m_keyPoints.isEmpty() && calcMode == CalcMode::Spline && m_keyTimes.size() > 1) > effectivePercent = calculatePercentForSpline(percent, calculateKeyTimesIndex(percent)); >- else if (animationMode == FromToAnimation || animationMode == ToAnimation) >+ else if (animationMode == AnimationMode::FromTo || animationMode == AnimationMode::To) > effectivePercent = calculatePercentForFromTo(percent); > else > effectivePercent = percent; >@@ -622,38 +590,13 @@ void SVGAnimationElement::updateAnimation(float percent, unsigned repeatCount, S > calculateAnimatedValue(effectivePercent, repeatCount, resultElement); > } > >-void SVGAnimationElement::computeCSSPropertyValue(SVGElement* element, CSSPropertyID id, String& valueString) >-{ >- ASSERT(element); >- >- // Don't include any properties resulting from CSS Transitions/Animations or SMIL animations, as we want to retrieve the "base value". >- element->setUseOverrideComputedStyle(true); >- RefPtr<CSSValue> value = ComputedStyleExtractor(element).propertyValue(id); >- valueString = value ? value->cssText() : String(); >- element->setUseOverrideComputedStyle(false); >-} >- >-void SVGAnimationElement::adjustForInheritance(SVGElement* targetElement, const QualifiedName& attributeName, String& value) >-{ >- // FIXME: At the moment the computed style gets returned as a String and needs to get parsed again. >- // In the future we might want to work with the value type directly to avoid the String parsing. >- ASSERT(targetElement); >- >- auto parent = makeRefPtr(targetElement->parentElement()); >- if (!parent || !parent->isSVGElement()) >- return; >- >- SVGElement& svgParent = downcast<SVGElement>(*parent); >- computeCSSPropertyValue(&svgParent, cssPropertyID(attributeName.localName()), value); >-} >- >-static bool inheritsFromProperty(SVGElement*, const QualifiedName& attributeName, const String& value) >+static bool inheritsFromProperty(SVGElement* targetElement, const QualifiedName& attributeName, const String& value) > { > static NeverDestroyed<const AtomicString> inherit("inherit", AtomicString::ConstructFromLiteral); > > if (value.isEmpty() || value != inherit) > return false; >- return SVGElement::isAnimatableCSSProperty(attributeName); >+ return targetElement->isAnimatedStyleAttribute(attributeName); > } > > void SVGAnimationElement::determinePropertyValueTypes(const String& from, const String& to) >@@ -667,21 +610,10 @@ void SVGAnimationElement::determinePropertyValueTypes(const String& from, const > if (inheritsFromProperty(targetElement.get(), attributeName, to)) > m_toPropertyValueType = InheritValue; > } >-void SVGAnimationElement::resetAnimatedPropertyType() >+void SVGAnimationElement::resetAnimation() > { > m_lastValuesAnimationFrom = String(); > m_lastValuesAnimationTo = String(); > } > >-void SVGAnimationElement::setTargetElement(SVGElement* target) >-{ >- SVGSMILElement::setTargetElement(target); >- checkInvalidCSSAttributeType(target); >-} >- >-void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) >-{ >- m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attributeType() == AttributeType::CSS && !isTargetAttributeCSSProperty(target, attributeName()); >-} >- > } >diff --git a/Source/WebCore/svg/SVGAnimationElement.h b/Source/WebCore/svg/SVGAnimationElement.h >index bfe230c5df6..769060089dd 100644 >--- a/Source/WebCore/svg/SVGAnimationElement.h >+++ b/Source/WebCore/svg/SVGAnimationElement.h >@@ -24,7 +24,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGSMILElement.h" > #include "SVGTests.h" >@@ -36,22 +35,10 @@ class ConditionEventListener; > class SVGAnimatedType; > class TimeContainer; > >-enum AnimationMode { >- NoAnimation, >- FromToAnimation, >- FromByAnimation, >- ToAnimation, >- ByAnimation, >- ValuesAnimation, >- PathAnimation // Used by AnimateMotion. >-}; >- > // If we have 'currentColor' or 'inherit' as animation value, we need to grab > // the value during the animation since the value can be animated itself. > enum AnimatedPropertyValueType { RegularPropertyValue, CurrentColorValue, InheritValue }; > >-enum class CalcMode { Discrete, Linear, Paced, Spline }; >- > class SVGAnimationElement : public SVGSMILElement, public SVGExternalResourcesRequired, public SVGTests { > WTF_MAKE_ISO_ALLOCATED(SVGAnimationElement); > public: >@@ -64,71 +51,14 @@ public: > void endElement(); > void endElementAt(float offset); > >- static bool isTargetAttributeCSSProperty(SVGElement*, const QualifiedName&); >- > bool isAdditive() const override; > bool isAccumulated() const; > AnimationMode animationMode() const { return m_animationMode; } > CalcMode calcMode() const { return m_calcMode; } > >- enum ShouldApplyAnimation { >- DontApplyAnimation, >- ApplyCSSAnimation, >- ApplyXMLAnimation, >- ApplyXMLandCSSAnimation // For presentation attributes with SVG DOM properties. >- }; >- >- ShouldApplyAnimation shouldApplyAnimation(SVGElement* targetElement, const QualifiedName& attributeName); >- > AnimatedPropertyValueType fromPropertyValueType() const { return m_fromPropertyValueType; } > AnimatedPropertyValueType toPropertyValueType() const { return m_toPropertyValueType; } > >- template<typename AnimatedType> void adjustForInheritance(AnimatedType (*parseTypeFromString)(SVGAnimationElement*, const String&), AnimatedPropertyValueType valueType, AnimatedType& animatedType, SVGElement* contextElement) >- { >- if (valueType != InheritValue) >- return; >- // Replace 'inherit' by its computed property value. >- ASSERT(parseTypeFromString); >- String typeString; >- adjustForInheritance(contextElement, attributeName(), typeString); >- animatedType = (*parseTypeFromString)(this, typeString); >- } >- >- template<typename AnimatedType> bool adjustFromToListValues(const AnimatedType& fromList, const AnimatedType& toList, AnimatedType& animatedList, float percentage, bool resizeAnimatedListIfNeeded = true) >- { >- // If no 'to' value is given, nothing to animate. >- unsigned toListSize = toList.size(); >- if (!toListSize) >- return false; >- >- // If the 'from' value is given and it's length doesn't match the 'to' value list length, fallback to a discrete animation. >- unsigned fromListSize = fromList.size(); >- if (fromListSize != toListSize && fromListSize) { >- if (percentage < 0.5) { >- if (animationMode() != ToAnimation) >- animatedList = AnimatedType(fromList); >- } else >- animatedList = AnimatedType(toList); >- >- return false; >- } >- >- ASSERT(!fromListSize || fromListSize == toListSize); >- if (resizeAnimatedListIfNeeded && animatedList.size() < toListSize) >- animatedList.resize(toListSize); >- >- return true; >- } >- >- template<typename AnimatedType> void animateDiscreteType(float percentage, const AnimatedType& fromType, const AnimatedType& toType, AnimatedType& animatedType) >- { >- if ((animationMode() == FromToAnimation && percentage > 0.5) || animationMode() == ToAnimation || percentage == 1) { >- animatedType = AnimatedType(toType); >- return; >- } >- animatedType = AnimatedType(fromType); >- } >- > void animateAdditiveNumber(float percentage, unsigned repeatCount, float fromNumber, float toNumber, float toAtEndOfDurationNumber, float& animatedNumber) > { > float number; >@@ -140,7 +70,7 @@ public: > if (isAccumulated() && repeatCount) > number += toAtEndOfDurationNumber * repeatCount; > >- if (isAdditive() && animationMode() != ToAnimation) >+ if (isAdditive() && animationMode() != AnimationMode::To) > animatedNumber += number; > else > animatedNumber = number; >@@ -149,13 +79,11 @@ public: > protected: > SVGAnimationElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGAnimationElement, SVGElement, SVGExternalResourcesRequired, SVGTests>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGAnimationElement, SVGElement, SVGExternalResourcesRequired, SVGTests>; >+ const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; } > >- void computeCSSPropertyValue(SVGElement*, CSSPropertyID, String& value); > virtual void determinePropertyValueTypes(const String& from, const String& to); >- virtual void resetAnimatedPropertyType(); >+ virtual void resetAnimation(); > > static bool isSupportedAttribute(const QualifiedName&); > void parseAttribute(const QualifiedName&, const AtomicString&) override; >@@ -177,10 +105,7 @@ protected: > AnimatedPropertyValueType m_fromPropertyValueType { RegularPropertyValue }; > AnimatedPropertyValueType m_toPropertyValueType { RegularPropertyValue }; > >- void setTargetElement(SVGElement*) override; > void setAttributeName(const QualifiedName&) override { } >- bool hasInvalidCSSAttributeType() const { return m_hasInvalidCSSAttributeType; } >- void checkInvalidCSSAttributeType(SVGElement*); > > virtual void updateAnimationMode(); > void setAnimationMode(AnimationMode animationMode) { m_animationMode = animationMode; } >@@ -204,9 +129,6 @@ private: > float calculatePercentForFromTo(float percent) const; > unsigned calculateKeyTimesIndex(float percent) const; > >- void applyAnimatedValue(ShouldApplyAnimation, SVGElement* targetElement, const QualifiedName& attributeName, SVGAnimatedType*); >- void adjustForInheritance(SVGElement* targetElement, const QualifiedName& attributeName, String&); >- > void setCalcMode(const AtomicString&); > > bool m_animationValid { false }; >@@ -218,10 +140,9 @@ private: > Vector<UnitBezier> m_keySplines; > String m_lastValuesAnimationFrom; > String m_lastValuesAnimationTo; >- bool m_hasInvalidCSSAttributeType { false }; > CalcMode m_calcMode { CalcMode::Linear }; >- AnimationMode m_animationMode { NoAnimation }; >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ AnimationMode m_animationMode { AnimationMode::None }; >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGCircleElement.cpp b/Source/WebCore/svg/SVGCircleElement.cpp >index ef3daa6a88f..ce8546a3ccc 100644 >--- a/Source/WebCore/svg/SVGCircleElement.cpp >+++ b/Source/WebCore/svg/SVGCircleElement.cpp >@@ -35,7 +35,13 @@ inline SVGCircleElement::SVGCircleElement(const QualifiedName& tagName, Document > , SVGExternalResourcesRequired(this) > { > ASSERT(hasTagName(SVGNames::circleTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::cxAttr, &SVGCircleElement::m_cx>(); >+ PropertyRegistry::registerProperty<SVGNames::cyAttr, &SVGCircleElement::m_cy>(); >+ PropertyRegistry::registerProperty<SVGNames::rAttr, &SVGCircleElement::m_r>(); >+ }); > } > > Ref<SVGCircleElement> SVGCircleElement::create(const QualifiedName& tagName, Document& document) >@@ -43,26 +49,16 @@ Ref<SVGCircleElement> SVGCircleElement::create(const QualifiedName& tagName, Doc > return adoptRef(*new SVGCircleElement(tagName, document)); > } > >-void SVGCircleElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::cxAttr, &SVGCircleElement::m_cx>(); >- registry.registerAttribute<SVGNames::cyAttr, &SVGCircleElement::m_cy>(); >- registry.registerAttribute<SVGNames::rAttr, &SVGCircleElement::m_r>(); >-} >- > void SVGCircleElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; > > if (name == SVGNames::cxAttr) >- m_cx.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_cx->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::cyAttr) >- m_cy.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_cy->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::rAttr) >- m_r.setValue(SVGLengthValue::construct(LengthModeOther, value, parseError, ForbidNegativeLengths)); >+ m_r->setBaseValInternal(SVGLengthValue::construct(LengthModeOther, value, parseError, ForbidNegativeLengths)); > > reportAttributeParsingError(parseError, name, value); > >@@ -72,7 +68,7 @@ void SVGCircleElement::parseAttribute(const QualifiedName& name, const AtomicStr > > void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidateSVGPresentationAttributeStyle(); > return; >diff --git a/Source/WebCore/svg/SVGCircleElement.h b/Source/WebCore/svg/SVGCircleElement.h >index 65c7b465b51..4cb5d46c804 100644 >--- a/Source/WebCore/svg/SVGCircleElement.h >+++ b/Source/WebCore/svg/SVGCircleElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedLength.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGeometryElement.h" > #include "SVGNames.h" >@@ -33,23 +32,20 @@ class SVGCircleElement final : public SVGGeometryElement, public SVGExternalReso > public: > static Ref<SVGCircleElement> create(const QualifiedName&, Document&); > >- const SVGLengthValue& cx() const { return m_cx.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& cy() const { return m_cy.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& r() const { return m_r.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& cx() const { return m_cx->currentValue(); } >+ const SVGLengthValue& cy() const { return m_cy->currentValue(); } >+ const SVGLengthValue& r() const { return m_r->currentValue(); } > >- RefPtr<SVGAnimatedLength> cxAnimated() { return m_cx.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> cyAnimated() { return m_cy.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> rAnimated() { return m_r.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& cx() { return m_cx; } >+ Ref<SVGAnimatedLength>& cy() { return m_cy; } >+ Ref<SVGAnimatedLength>& r() { return m_r; } > > private: > SVGCircleElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGCircleElement, SVGGeometryElement, SVGExternalResourcesRequired>; >- static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGCircleElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -58,10 +54,10 @@ private: > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_cx { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_cy { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_r { LengthModeOther }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_cx { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_cy { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_r { SVGAnimatedLength::create(this, LengthModeOther) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGClipPathElement.cpp b/Source/WebCore/svg/SVGClipPathElement.cpp >index bdd35d7a808..5974e1bf6f2 100644 >--- a/Source/WebCore/svg/SVGClipPathElement.cpp >+++ b/Source/WebCore/svg/SVGClipPathElement.cpp >@@ -39,7 +39,11 @@ inline SVGClipPathElement::SVGClipPathElement(const QualifiedName& tagName, Docu > , SVGExternalResourcesRequired(this) > { > ASSERT(hasTagName(SVGNames::clipPathTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::clipPathUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGClipPathElement::m_clipPathUnits>(); >+ }); > } > > Ref<SVGClipPathElement> SVGClipPathElement::create(const QualifiedName& tagName, Document& document) >@@ -47,20 +51,12 @@ Ref<SVGClipPathElement> SVGClipPathElement::create(const QualifiedName& tagName, > return adoptRef(*new SVGClipPathElement(tagName, document)); > } > >-void SVGClipPathElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::clipPathUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGClipPathElement::m_clipPathUnits>(); >-} >- > void SVGClipPathElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::clipPathUnitsAttr) { > auto propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(value); > if (propertyValue > 0) >- m_clipPathUnits.setValue(propertyValue); >+ m_clipPathUnits->setBaseValInternal(propertyValue); > return; > } > >@@ -70,7 +66,7 @@ void SVGClipPathElement::parseAttribute(const QualifiedName& name, const AtomicS > > void SVGClipPathElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > > if (RenderObject* object = renderer()) >diff --git a/Source/WebCore/svg/SVGClipPathElement.h b/Source/WebCore/svg/SVGClipPathElement.h >index 63b6bde0e24..3085d46b42d 100644 >--- a/Source/WebCore/svg/SVGClipPathElement.h >+++ b/Source/WebCore/svg/SVGClipPathElement.h >@@ -21,8 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedEnumeration.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGraphicsElement.h" > #include "SVGUnitTypes.h" >@@ -36,18 +34,15 @@ class SVGClipPathElement final : public SVGGraphicsElement, public SVGExternalRe > public: > static Ref<SVGClipPathElement> create(const QualifiedName&, Document&); > >- SVGUnitTypes::SVGUnitType clipPathUnits() const { return m_clipPathUnits.currentValue(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> clipPathUnitsAnimated() { return m_clipPathUnits.animatedProperty(attributeOwnerProxy()); } >+ SVGUnitTypes::SVGUnitType clipPathUnits() const { return m_clipPathUnits->currentValue<SVGUnitTypes::SVGUnitType>(); } >+ Ref<SVGAnimatedEnumeration>& clipPathUnits() { return m_clipPathUnits; } > > private: > SVGClipPathElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGClipPathElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGClipPathElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > void childrenChanged(const ChildChange&) final; >@@ -58,8 +53,8 @@ private: > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedEnumerationAttribute<SVGUnitTypes::SVGUnitType> m_clipPathUnits { SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedEnumeration> m_clipPathUnits { SVGAnimatedEnumeration::create(this, SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp b/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp >index 4e2032bb217..41296edafd5 100644 >--- a/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp >+++ b/Source/WebCore/svg/SVGComponentTransferFunctionElement.cpp >@@ -24,7 +24,6 @@ > > #include "SVGFEComponentTransferElement.h" > #include "SVGNames.h" >-#include "SVGNumberListValues.h" > #include <wtf/IsoMallocInlines.h> > #include <wtf/NeverDestroyed.h> > >@@ -35,21 +34,16 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(SVGComponentTransferFunctionElement); > SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement(const QualifiedName& tagName, Document& document) > : SVGElement(tagName, document) > { >- registerAttributes(); >-} >- >-void SVGComponentTransferFunctionElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::typeAttr, ComponentTransferType, &SVGComponentTransferFunctionElement::m_type>(); >- registry.registerAttribute<SVGNames::tableValuesAttr, &SVGComponentTransferFunctionElement::m_tableValues>(); >- registry.registerAttribute<SVGNames::slopeAttr, &SVGComponentTransferFunctionElement::m_slope>(); >- registry.registerAttribute<SVGNames::interceptAttr, &SVGComponentTransferFunctionElement::m_intercept>(); >- registry.registerAttribute<SVGNames::amplitudeAttr, &SVGComponentTransferFunctionElement::m_amplitude>(); >- registry.registerAttribute<SVGNames::exponentAttr, &SVGComponentTransferFunctionElement::m_exponent>(); >- registry.registerAttribute<SVGNames::offsetAttr, &SVGComponentTransferFunctionElement::m_offset>(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::typeAttr, ComponentTransferType, &SVGComponentTransferFunctionElement::m_type>(); >+ PropertyRegistry::registerProperty<SVGNames::tableValuesAttr, &SVGComponentTransferFunctionElement::m_tableValues>(); >+ PropertyRegistry::registerProperty<SVGNames::slopeAttr, &SVGComponentTransferFunctionElement::m_slope>(); >+ PropertyRegistry::registerProperty<SVGNames::interceptAttr, &SVGComponentTransferFunctionElement::m_intercept>(); >+ PropertyRegistry::registerProperty<SVGNames::amplitudeAttr, &SVGComponentTransferFunctionElement::m_amplitude>(); >+ PropertyRegistry::registerProperty<SVGNames::exponentAttr, &SVGComponentTransferFunctionElement::m_exponent>(); >+ PropertyRegistry::registerProperty<SVGNames::offsetAttr, &SVGComponentTransferFunctionElement::m_offset>(); >+ }); > } > > void SVGComponentTransferFunctionElement::parseAttribute(const QualifiedName& name, const AtomicString& value) >@@ -57,40 +51,37 @@ void SVGComponentTransferFunctionElement::parseAttribute(const QualifiedName& na > if (name == SVGNames::typeAttr) { > ComponentTransferType propertyValue = SVGPropertyTraits<ComponentTransferType>::fromString(value); > if (propertyValue > 0) >- m_type.setValue(propertyValue); >+ m_type->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::tableValuesAttr) { >- SVGNumberListValues newList; >- newList.parse(value); >- m_tableValues.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); >- m_tableValues.setValue(WTFMove(newList)); >+ m_tableValues->baseVal()->parse(value); > return; > } > > if (name == SVGNames::slopeAttr) { >- m_slope.setValue(value.toFloat()); >+ m_slope->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::interceptAttr) { >- m_intercept.setValue(value.toFloat()); >+ m_intercept->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::amplitudeAttr) { >- m_amplitude.setValue(value.toFloat()); >+ m_amplitude->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::exponentAttr) { >- m_exponent.setValue(value.toFloat()); >+ m_exponent->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::offsetAttr) { >- m_offset.setValue(value.toFloat()); >+ m_offset->setBaseValInternal(value.toFloat()); > return; > } > >@@ -99,7 +90,7 @@ void SVGComponentTransferFunctionElement::parseAttribute(const QualifiedName& na > > void SVGComponentTransferFunctionElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidateFilterPrimitiveParent(this); > return; >@@ -110,15 +101,7 @@ void SVGComponentTransferFunctionElement::svgAttributeChanged(const QualifiedNam > > ComponentTransferFunction SVGComponentTransferFunctionElement::transferFunction() const > { >- return { >- type(), >- slope(), >- intercept(), >- amplitude(), >- exponent(), >- offset(), >- tableValues() >- }; >+ return { type(), slope(), intercept(), amplitude(), exponent(), offset(), tableValues() }; > } > > } >diff --git a/Source/WebCore/svg/SVGComponentTransferFunctionElement.h b/Source/WebCore/svg/SVGComponentTransferFunctionElement.h >index 9f46becdfb4..7cd06f4a0c2 100644 >--- a/Source/WebCore/svg/SVGComponentTransferFunctionElement.h >+++ b/Source/WebCore/svg/SVGComponentTransferFunctionElement.h >@@ -22,9 +22,6 @@ > #pragma once > > #include "FEComponentTransfer.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedNumber.h" >-#include "SVGAnimatedNumberList.h" > #include "SVGElement.h" > > namespace WebCore { >@@ -75,45 +72,42 @@ class SVGComponentTransferFunctionElement : public SVGElement { > public: > ComponentTransferFunction transferFunction() const; > >- ComponentTransferType type() const { return m_type.currentValue(attributeOwnerProxy()); } >- const SVGNumberListValues& tableValues() const { return m_tableValues.currentValue(attributeOwnerProxy()); } >- float slope() const { return m_slope.currentValue(attributeOwnerProxy()); } >- float intercept() const { return m_intercept.currentValue(attributeOwnerProxy()); } >- float amplitude() const { return m_amplitude.currentValue(attributeOwnerProxy()); } >- float exponent() const { return m_exponent.currentValue(attributeOwnerProxy()); } >- float offset() const { return m_offset.currentValue(attributeOwnerProxy()); } >+ ComponentTransferType type() const { return m_type->currentValue<ComponentTransferType>(); } >+ const SVGNumberList& tableValues() const { return m_tableValues->currentValue(); } >+ float slope() const { return m_slope->currentValue(); } >+ float intercept() const { return m_intercept->currentValue(); } >+ float amplitude() const { return m_amplitude->currentValue(); } >+ float exponent() const { return m_exponent->currentValue(); } >+ float offset() const { return m_offset->currentValue(); } > >- RefPtr<SVGAnimatedEnumeration> typeAnimated() { return m_type.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumberList> tableValuesAnimated() { return m_tableValues.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> slopeAnimated() { return m_slope.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> interceptAnimated() { return m_intercept.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> amplitudeAnimated() { return m_amplitude.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> exponentAnimated() { return m_exponent.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> offsetAnimated() { return m_offset.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedEnumeration>& type() { return m_type; } >+ Ref<SVGAnimatedNumberList>& tableValues() { return m_tableValues; } >+ Ref<SVGAnimatedNumber>& slope() { return m_slope; } >+ Ref<SVGAnimatedNumber>& intercept() { return m_intercept; } >+ Ref<SVGAnimatedNumber>& amplitude() { return m_amplitude; } >+ Ref<SVGAnimatedNumber>& exponent() { return m_exponent; } >+ Ref<SVGAnimatedNumber>& offset() { return m_offset; } > > protected: > SVGComponentTransferFunctionElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGComponentTransferFunctionElement, SVGElement>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGComponentTransferFunctionElement, SVGElement>; >+ const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > > bool rendererIsNeeded(const RenderStyle&) override { return false; } > > private: >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedEnumerationAttribute<ComponentTransferType> m_type { FECOMPONENTTRANSFER_TYPE_IDENTITY }; >- SVGAnimatedNumberListAttribute m_tableValues; >- SVGAnimatedNumberAttribute m_slope { 1 }; >- SVGAnimatedNumberAttribute m_intercept; >- SVGAnimatedNumberAttribute m_amplitude { 1 }; >- SVGAnimatedNumberAttribute m_exponent { 1 }; >- SVGAnimatedNumberAttribute m_offset; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedEnumeration> m_type { SVGAnimatedEnumeration::create(this, FECOMPONENTTRANSFER_TYPE_IDENTITY) }; >+ Ref<SVGAnimatedNumberList> m_tableValues { SVGAnimatedNumberList::create(this) }; >+ Ref<SVGAnimatedNumber> m_slope { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_intercept { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_amplitude { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_exponent { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_offset { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGCursorElement.cpp b/Source/WebCore/svg/SVGCursorElement.cpp >index cd808c9984b..aab4f2fa126 100644 >--- a/Source/WebCore/svg/SVGCursorElement.cpp >+++ b/Source/WebCore/svg/SVGCursorElement.cpp >@@ -40,7 +40,12 @@ inline SVGCursorElement::SVGCursorElement(const QualifiedName& tagName, Document > , SVGURIReference(this) > { > ASSERT(hasTagName(SVGNames::cursorTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGCursorElement::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGCursorElement::m_y>(); >+ }); > } > > Ref<SVGCursorElement> SVGCursorElement::create(const QualifiedName& tagName, Document& document) >@@ -54,23 +59,14 @@ SVGCursorElement::~SVGCursorElement() > client->cursorElementRemoved(*this); > } > >-void SVGCursorElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::xAttr, &SVGCursorElement::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGCursorElement::m_y>(); >-} >- > void SVGCursorElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; > > if (name == SVGNames::xAttr) >- m_x.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::yAttr) >- m_y.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > > reportAttributeParsingError(parseError, name, value); > >@@ -92,7 +88,7 @@ void SVGCursorElement::removeClient(CSSCursorImageValue& value) > > void SVGCursorElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > for (auto& client : m_clients) > client->cursorElementChanged(*this); >diff --git a/Source/WebCore/svg/SVGCursorElement.h b/Source/WebCore/svg/SVGCursorElement.h >index 2a71c62c0b6..f21cefa3d55 100644 >--- a/Source/WebCore/svg/SVGCursorElement.h >+++ b/Source/WebCore/svg/SVGCursorElement.h >@@ -21,9 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedLength.h" >-#include "SVGAnimatedString.h" > #include "SVGElement.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGTests.h" >@@ -43,21 +40,18 @@ public: > void addClient(CSSCursorImageValue&); > void removeClient(CSSCursorImageValue&); > >- const SVGLengthValue& x() const { return m_x.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& x() const { return m_x->currentValue(); } >+ const SVGLengthValue& y() const { return m_y->currentValue(); } > >- RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& x() { return m_x; } >+ Ref<SVGAnimatedLength>& y() { return m_y; } > > private: > SVGCursorElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGCursorElement, SVGElement, SVGExternalResourcesRequired, SVGTests, SVGURIReference>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGCursorElement, SVGElement, SVGExternalResourcesRequired, SVGTests, SVGURIReference>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -66,9 +60,9 @@ private: > > void addSubresourceAttributeURLs(ListHashSet<URL>&) const final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_x { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_y { LengthModeHeight }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_x { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_y { SVGAnimatedLength::create(this, LengthModeHeight) }; > HashSet<CSSCursorImageValue*> m_clients; > }; > >diff --git a/Source/WebCore/svg/SVGDefsElement.h b/Source/WebCore/svg/SVGDefsElement.h >index df3c0403ecf..4341328e91d 100644 >--- a/Source/WebCore/svg/SVGDefsElement.h >+++ b/Source/WebCore/svg/SVGDefsElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGraphicsElement.h" > >@@ -35,15 +34,15 @@ public: > private: > SVGDefsElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGDefsElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGDefsElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > > bool isValid() const final; > bool supportsFocus() const final { return false; } > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGElement.cpp b/Source/WebCore/svg/SVGElement.cpp >index 025b96bbcb4..ec38febcd61 100644 >--- a/Source/WebCore/svg/SVGElement.cpp >+++ b/Source/WebCore/svg/SVGElement.cpp >@@ -44,6 +44,7 @@ > #include "SVGGraphicsElement.h" > #include "SVGImageElement.h" > #include "SVGNames.h" >+#include "SVGPropertyAnimatorCreator.h" > #include "SVGRenderStyle.h" > #include "SVGRenderSupport.h" > #include "SVGSVGElement.h" >@@ -157,126 +158,15 @@ static NEVER_INLINE HashMap<AtomicStringImpl*, CSSPropertyID> createAttributeNam > return map; > } > >-static NEVER_INLINE HashMap<QualifiedName::QualifiedNameImpl*, AnimatedPropertyType> createAttributeNameToAnimatedPropertyTypeMap() >-{ >- using namespace HTMLNames; >- using namespace SVGNames; >- >- struct TableEntry { >- const QualifiedName& attributeName; >- AnimatedPropertyType type; >- }; >- >- static const TableEntry table[] = { >- { alignment_baselineAttr, AnimatedString }, >- { baseline_shiftAttr, AnimatedString }, >- { buffered_renderingAttr, AnimatedString }, >- { clipAttr, AnimatedRect }, >- { clip_pathAttr, AnimatedString }, >- { clip_ruleAttr, AnimatedString }, >- { SVGNames::colorAttr, AnimatedColor }, >- { color_interpolationAttr, AnimatedString }, >- { color_interpolation_filtersAttr, AnimatedString }, >- { color_profileAttr, AnimatedString }, >- { color_renderingAttr, AnimatedString }, >- { cursorAttr, AnimatedString }, >- { displayAttr, AnimatedString }, >- { dominant_baselineAttr, AnimatedString }, >- { fillAttr, AnimatedColor }, >- { fill_opacityAttr, AnimatedNumber }, >- { fill_ruleAttr, AnimatedString }, >- { filterAttr, AnimatedString }, >- { flood_colorAttr, AnimatedColor }, >- { flood_opacityAttr, AnimatedNumber }, >- { font_familyAttr, AnimatedString }, >- { font_sizeAttr, AnimatedLength }, >- { font_stretchAttr, AnimatedString }, >- { font_styleAttr, AnimatedString }, >- { font_variantAttr, AnimatedString }, >- { font_weightAttr, AnimatedString }, >- { image_renderingAttr, AnimatedString }, >- { kerningAttr, AnimatedLength }, >- { letter_spacingAttr, AnimatedLength }, >- { lighting_colorAttr, AnimatedColor }, >- { marker_endAttr, AnimatedString }, >- { marker_midAttr, AnimatedString }, >- { marker_startAttr, AnimatedString }, >- { maskAttr, AnimatedString }, >- { mask_typeAttr, AnimatedString }, >- { opacityAttr, AnimatedNumber }, >- { overflowAttr, AnimatedString }, >- { paint_orderAttr, AnimatedString }, >- { pointer_eventsAttr, AnimatedString }, >- { shape_renderingAttr, AnimatedString }, >- { stop_colorAttr, AnimatedColor }, >- { stop_opacityAttr, AnimatedNumber }, >- { strokeAttr, AnimatedColor }, >- { stroke_dasharrayAttr, AnimatedLengthList }, >- { stroke_dashoffsetAttr, AnimatedLength }, >- { stroke_linecapAttr, AnimatedString }, >- { stroke_linejoinAttr, AnimatedString }, >- { stroke_miterlimitAttr, AnimatedNumber }, >- { stroke_opacityAttr, AnimatedNumber }, >- { stroke_widthAttr, AnimatedLength }, >- { text_anchorAttr, AnimatedString }, >- { text_decorationAttr, AnimatedString }, >- { text_renderingAttr, AnimatedString }, >- { vector_effectAttr, AnimatedString }, >- { visibilityAttr, AnimatedString }, >- { word_spacingAttr, AnimatedLength }, >- }; >- >- HashMap<QualifiedName::QualifiedNameImpl*, AnimatedPropertyType> map; >- for (auto& entry : table) >- map.add(entry.attributeName.impl(), entry.type); >- return map; >-} >- >-static const HashMap<QualifiedName::QualifiedNameImpl*, AnimatedPropertyType>& attributeNameToAnimatedPropertyTypeMap() >-{ >- static const auto map = makeNeverDestroyed(createAttributeNameToAnimatedPropertyTypeMap()); >- return map; >-} >- >-static NEVER_INLINE HashMap<QualifiedName::QualifiedNameImpl*, AnimatedPropertyType> createCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap() >-{ >- using namespace HTMLNames; >- using namespace SVGNames; >- >- struct TableEntry { >- const QualifiedName& attributeName; >- AnimatedPropertyType type; >- }; >- >- static const TableEntry table[] = { >- { cxAttr, AnimatedLength }, >- { cyAttr, AnimatedLength }, >- { rAttr, AnimatedLength }, >- { rxAttr, AnimatedLength }, >- { ryAttr, AnimatedLength }, >- { SVGNames::heightAttr, AnimatedLength }, >- { SVGNames::widthAttr, AnimatedLength }, >- { xAttr, AnimatedLength }, >- { yAttr, AnimatedLength }, >- }; >- >- HashMap<QualifiedName::QualifiedNameImpl*, AnimatedPropertyType> map; >- for (auto& entry : table) >- map.add(entry.attributeName.impl(), entry.type); >- return map; >-} >- >-static inline const HashMap<QualifiedName::QualifiedNameImpl*, AnimatedPropertyType>& cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap() >-{ >- static const auto map = makeNeverDestroyed(createCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap()); >- return map; >-} >- > SVGElement::SVGElement(const QualifiedName& tagName, Document& document) > : StyledElement(tagName, document, CreateSVGElement) > , SVGLangSpace(this) >+ , m_propertyAnimatorCreator(std::make_unique<SVGPropertyAnimatorCreator>()) > { >- registerAttributes(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<HTMLNames::classAttr, &SVGElement::m_className>(); >+ }); > } > > SVGElement::~SVGElement() >@@ -289,8 +179,14 @@ SVGElement::~SVGElement() > > m_svgRareData = nullptr; > } >+ > document().accessSVGExtensions().rebuildAllElementReferencesForTarget(*this); > document().accessSVGExtensions().removeAllElementReferencesForTarget(this); >+ >+ // Now it is time to detach this SVGElement from all its properties. These properties >+ // may outlive the SVGElement. The only difference after the detach is no commit will >+ // be carried out unless these properties are attached to another owner. >+ propertyRegistry().detachAllProperties(); > } > > int SVGElement::tabIndex() const >@@ -451,18 +347,10 @@ void SVGElement::setCorrespondingElement(SVGElement* correspondingElement) > correspondingElement->ensureSVGRareData().instances().add(this); > } > >-void SVGElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<HTMLNames::classAttr, &SVGElement::m_className>(); >-} >- > void SVGElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == HTMLNames::classAttr) { >- m_className.setValue(value); >+ m_className->setBaseValInternal(value); > return; > } > >@@ -483,34 +371,7 @@ void SVGElement::parseAttribute(const QualifiedName& name, const AtomicString& v > SVGLangSpace::parseAttribute(name, value); > } > >-Vector<AnimatedPropertyType> SVGElement::animatedPropertyTypesForAttribute(const QualifiedName& attributeName) >-{ >- auto types = animatedTypes(attributeName); >- if (!types.isEmpty()) >- return types; >- >- { >- auto& map = attributeNameToAnimatedPropertyTypeMap(); >- auto it = map.find(attributeName.impl()); >- if (it != map.end()) { >- types.append(it->value); >- return types; >- } >- } >- >- { >- auto& map = cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap(); >- auto it = map.find(attributeName.impl()); >- if (it != map.end()) { >- types.append(it->value); >- return types; >- } >- } >- >- return types; >-} >- >-bool SVGElement::haveLoadedRequiredResources() >+bool SVGElement::haveLoadedRequiredResources() const > { > for (auto& child : childrenOfType<SVGElement>(*this)) { > if (!child.haveLoadedRequiredResources()) >@@ -691,25 +552,77 @@ void SVGElement::attributeChanged(const QualifiedName& name, const AtomicString& > svgAttributeChanged(name); > } > >-void SVGElement::synchronizeAllAnimatedSVGAttribute(SVGElement* svgElement) >+void SVGElement::synchronizeAttribute(const QualifiedName& attributeName) > { >- ASSERT(svgElement->elementData()); >- ASSERT(svgElement->elementData()->animatedSVGAttributesAreDirty()); >+ // If the value of the property has changed, serialize the new value to the attribute. >+ if (auto value = propertyRegistry().synchronize(attributeName)) >+ setSynchronizedLazyAttribute(attributeName, *value); >+} > >- svgElement->synchronizeAttributes(); >- svgElement->elementData()->setAnimatedSVGAttributesAreDirty(false); >+void SVGElement::synchronizeAllAttributes() >+{ >+ // SVGPropertyRegistry::synchronizeAllAttributes() returns the new values of >+ // the properties which have changed but not committed yet. >+ auto map = propertyRegistry().synchronizeAllAttributes(); >+ for (const auto& entry : map) >+ setSynchronizedLazyAttribute(entry.key, entry.value); > } > >-void SVGElement::synchronizeAnimatedSVGAttribute(const QualifiedName& name) const >+void SVGElement::commitPropertyChange(const QualifiedName& attributeName) > { >- if (!elementData() || !elementData()->animatedSVGAttributesAreDirty()) >- return; >+ invalidateSVGAttributes(); >+ svgAttributeChanged(attributeName); >+} > >- SVGElement* nonConstThis = const_cast<SVGElement*>(this); >- if (name == anyQName()) >- synchronizeAllAnimatedSVGAttribute(nonConstThis); >+void SVGElement::commitPropertyChange(SVGProperty* property) >+{ >+ commitPropertyChange(propertyRegistry().propertyAttributeName(*property)); >+ >+ // We want to dirty the top-level property when a descendant changes. For example >+ // a change in an SVGLength item in SVGLengthList should set the dirty flag on >+ // SVGLengthList and not the SVGLength. >+ property->setDirty(); >+} >+ >+void SVGElement::commitPropertyChange(SVGAnimatedProperty* animatedProperty) >+{ >+ QualifiedName attributeName = propertyRegistry().animatedPropertyAttributeName(*animatedProperty); >+ commitPropertyChange(attributeName); >+ >+ // A change in a style property, e.g SVGRectElement::x should be serialized to >+ // the attribute immediately. Otherwise it is okay to be lazy in this regard. >+ if (!propertyRegistry().isAnimatedStylePropertyAttribute(attributeName)) >+ animatedProperty->setDirty(); > else >- nonConstThis->synchronizeAttribute(name); >+ setSynchronizedLazyAttribute(attributeName, animatedProperty->baseValAsString()); >+} >+ >+bool SVGElement::isAnimatedPropertyAttribute(const QualifiedName& attributeName) const >+{ >+ return propertyRegistry().isAnimatedPropertyAttribute(attributeName); >+} >+ >+bool SVGElement::isAnimatedAttribute(const QualifiedName& attributeName) const >+{ >+ return SVGPropertyAnimatorCreator::isKnownAttribute(attributeName) || propertyRegistry().isAnimatedPropertyAttribute(attributeName); >+} >+ >+bool SVGElement::isAnimatedStyleAttribute(const QualifiedName& attributeName) const >+{ >+ return SVGPropertyAnimatorCreator::isKnownAttribute(attributeName) || propertyRegistry().isAnimatedStylePropertyAttribute(attributeName); >+} >+ >+RefPtr<SVGAnimator> SVGElement::createAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+{ >+ // Style property >+ if (auto animator = propertyAnimatorCreator().createAnimator(attributeName, animationMode, calcMode, isAccumulated, isAdditive)) >+ return animator; >+ >+ // Animated property >+ auto animator = propertyRegistry().createAnimator(attributeName, animationMode, calcMode, isAccumulated, isAdditive); >+ for (auto* instance : instances()) >+ instance->propertyRegistry().appendAnimatedInstance(attributeName, animator); >+ return animator; > } > > std::optional<ElementStyle> SVGElement::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle*) >@@ -864,22 +777,6 @@ QualifiedName SVGElement::animatableAttributeForName(const AtomicString& localNa > return animatableAttributes.get().get(localName); > } > >-#ifndef NDEBUG >- >-bool SVGElement::isAnimatableAttribute(const QualifiedName& name) const >-{ >- if (animatableAttributeForName(name.localName()) == name) >- return !filterOutAnimatableAttribute(name); >- return false; >-} >- >-bool SVGElement::filterOutAnimatableAttribute(const QualifiedName&) const >-{ >- return false; >-} >- >-#endif >- > String SVGElement::title() const > { > // According to spec, for stand-alone SVG documents we should not return a title when >@@ -913,17 +810,6 @@ CSSPropertyID SVGElement::cssPropertyIdForSVGAttributeName(const QualifiedName& > return properties.get().get(attrName.localName().impl()); > } > >-bool SVGElement::isAnimatableCSSProperty(const QualifiedName& attributeName) >-{ >- return attributeNameToAnimatedPropertyTypeMap().contains(attributeName.impl()) >- || cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap().contains(attributeName.impl()); >-} >- >-bool SVGElement::isPresentationAttributeWithSVGDOM(const QualifiedName& attributeName) >-{ >- return !animatedTypes(attributeName).isEmpty(); >-} >- > bool SVGElement::isPresentationAttribute(const QualifiedName& name) const > { > if (cssPropertyIdForSVGAttributeName(name) > 0) >@@ -947,7 +833,7 @@ void SVGElement::svgAttributeChanged(const QualifiedName& attrName) > } > > if (attrName == HTMLNames::classAttr) { >- classAttributeChanged(className()); >+ classAttributeChanged(className()->currentValue()); > invalidateInstances(); > return; > } >diff --git a/Source/WebCore/svg/SVGElement.h b/Source/WebCore/svg/SVGElement.h >index 34bd9e08743..5d523886215 100644 >--- a/Source/WebCore/svg/SVGElement.h >+++ b/Source/WebCore/svg/SVGElement.h >@@ -22,12 +22,13 @@ > > #pragma once > >-#include "SVGAnimatedString.h" >-#include "SVGAttributeOwnerProxy.h" >+#include "SVGAnimatedPropertyImpl.h" >+#include "SVGAnimator.h" > #include "SVGLangSpace.h" > #include "SVGLocatable.h" > #include "SVGNames.h" > #include "SVGParsingError.h" >+#include "SVGPropertyOwnerRegistry.h" > #include "StyledElement.h" > #include <wtf/HashMap.h> > #include <wtf/HashSet.h> >@@ -35,17 +36,17 @@ > namespace WebCore { > > class AffineTransform; >-class CSSStyleDeclaration; > class DeprecatedCSSOMValue; > class Document; > class SVGDocumentExtensions; > class SVGElementRareData; >+class SVGPropertyAnimatorCreator; > class SVGSVGElement; > class SVGUseElement; > > void mapAttributeToCSSProperty(HashMap<AtomicStringImpl*, CSSPropertyID>* propertyNameToIdMap, const QualifiedName& attrName); > >-class SVGElement : public StyledElement, public SVGLangSpace { >+class SVGElement : public StyledElement, public SVGLangSpace, public SVGPropertyOwner { > WTF_MAKE_ISO_ALLOCATED(SVGElement); > public: > bool isOutermostSVGSVGElement() const; >@@ -54,8 +55,6 @@ public: > SVGElement* viewportElement() const; > > String title() const override; >- static bool isAnimatableCSSProperty(const QualifiedName&); >- bool isPresentationAttributeWithSVGDOM(const QualifiedName&); > RefPtr<DeprecatedCSSOMValue> getPresentationAttribute(const String& name); > virtual bool supportsMarkers() const { return false; } > bool hasRelativeLengths() const { return !m_elementsWithRelativeLengths.isEmpty(); } >@@ -76,8 +75,6 @@ public: > > virtual void svgAttributeChanged(const QualifiedName&); > >- Vector<AnimatedPropertyType> animatedPropertyTypesForAttribute(const QualifiedName&); >- > void sendSVGLoadEventIfPossible(bool sendParentLoadEvents = false); > void sendSVGLoadEventIfPossibleAsynchronously(); > void svgLoadEventTimerFired(); >@@ -103,21 +100,15 @@ public: > > void setCorrespondingElement(SVGElement*); > >- void synchronizeAnimatedSVGAttribute(const QualifiedName&) const; >- static void synchronizeAllAnimatedSVGAttribute(SVGElement*); >- > std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override; > > static QualifiedName animatableAttributeForName(const AtomicString&); >-#ifndef NDEBUG >- bool isAnimatableAttribute(const QualifiedName&) const; >-#endif > > MutableStyleProperties* animatedSMILStyleProperties() const; > MutableStyleProperties& ensureAnimatedSMILStyleProperties(); > void setUseOverrideComputedStyle(bool); > >- virtual bool haveLoadedRequiredResources(); >+ virtual bool haveLoadedRequiredResources() const; > > bool addEventListener(const AtomicString& eventType, Ref<EventListener>&&, const AddEventListenerOptions&) override; > bool removeEventListener(const AtomicString& eventType, EventListener&, const ListenerOptions&) override; >@@ -132,26 +123,27 @@ public: > class InstanceInvalidationGuard; > > // The definition of the owner proxy has to match the class inheritance but we are interested in the SVG objects only. >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGElement, SVGLangSpace>; >- static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >- >- // A super class will override this function to return its owner proxy. The attributes of the super class will >- // be accessible through the registry of the owner proxy. >- virtual const SVGAttributeOwnerProxy& attributeOwnerProxy() const { return m_attributeOwnerProxy; } >- >- // Helper functions which return info for the super class' attributes. >- void synchronizeAttribute(const QualifiedName& name) { attributeOwnerProxy().synchronizeAttribute(name); } >- void synchronizeAttributes() { attributeOwnerProxy().synchronizeAttributes(); } >- Vector<AnimatedPropertyType> animatedTypes(const QualifiedName& attributeName) const { return attributeOwnerProxy().animatedTypes(attributeName); } >- RefPtr<SVGAnimatedProperty> lookupAnimatedProperty(const SVGAttribute& attribute) const { return attributeOwnerProxy().lookupAnimatedProperty(attribute); } >- RefPtr<SVGAnimatedProperty> lookupOrCreateAnimatedProperty(const SVGAttribute& attribute) { return attributeOwnerProxy().lookupOrCreateAnimatedProperty(attribute); } >- Vector<RefPtr<SVGAnimatedProperty>> lookupOrCreateAnimatedProperties(const QualifiedName& name) { return attributeOwnerProxy().lookupOrCreateAnimatedProperties(name); } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGElement>; >+ virtual const SVGPropertyRegistry& propertyRegistry() const { return m_propertyRegistry; } >+ >+ bool isAnimatedPropertyAttribute(const QualifiedName&) const; >+ bool isAnimatedAttribute(const QualifiedName&) const; >+ bool isAnimatedStyleAttribute(const QualifiedName&) const; >+ >+ void synchronizeAttribute(const QualifiedName&); >+ void synchronizeAllAttributes(); >+ >+ void commitPropertyChange(const QualifiedName&); >+ void commitPropertyChange(SVGProperty*) override; >+ void commitPropertyChange(SVGAnimatedProperty*); >+ >+ const SVGElement* attributeContextElement() const override { return this; } >+ SVGPropertyAnimatorCreator& propertyAnimatorCreator() { return *m_propertyAnimatorCreator; } >+ RefPtr<SVGAnimator> createAnimator(const QualifiedName&, AnimationMode, CalcMode, bool isAccumulated, bool isAdditive); > > // These are needed for the RenderTree, animation and DOM. >- const auto& className() const { return m_className.currentValue(attributeOwnerProxy()); } >- auto classNameAnimated() { return m_className.animatedProperty(attributeOwnerProxy()); } >+ String className() const { return m_className->currentValue(); } >+ Ref<SVGAnimatedString>& className() { return m_className; } > > protected: > SVGElement(const QualifiedName&, Document&); >@@ -191,18 +183,16 @@ private: > void buildPendingResourcesIfNeeded(); > void accessKeyAction(bool sendMouseEvents) override; > >-#ifndef NDEBUG >- virtual bool filterOutAnimatableAttribute(const QualifiedName&) const; >-#endif >- > void invalidateInstances(); > > std::unique_ptr<SVGElementRareData> m_svgRareData; > > HashSet<SVGElement*> m_elementsWithRelativeLengths; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_className; >+ std::unique_ptr<SVGPropertyAnimatorCreator> m_propertyAnimatorCreator; >+ >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_className { SVGAnimatedString::create(this) }; > }; > > class SVGElement::InstanceInvalidationGuard { >diff --git a/Source/WebCore/svg/SVGEllipseElement.cpp b/Source/WebCore/svg/SVGEllipseElement.cpp >index 0a54b1875d8..bf87a7d75c0 100644 >--- a/Source/WebCore/svg/SVGEllipseElement.cpp >+++ b/Source/WebCore/svg/SVGEllipseElement.cpp >@@ -35,37 +35,33 @@ inline SVGEllipseElement::SVGEllipseElement(const QualifiedName& tagName, Docume > , SVGExternalResourcesRequired(this) > { > ASSERT(hasTagName(SVGNames::ellipseTag)); >- registerAttributes(); >-} >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::cxAttr, &SVGEllipseElement::m_cx>(); >+ PropertyRegistry::registerProperty<SVGNames::cyAttr, &SVGEllipseElement::m_cy>(); >+ PropertyRegistry::registerProperty<SVGNames::rxAttr, &SVGEllipseElement::m_rx>(); >+ PropertyRegistry::registerProperty<SVGNames::ryAttr, &SVGEllipseElement::m_ry>(); >+ }); >+} > > Ref<SVGEllipseElement> SVGEllipseElement::create(const QualifiedName& tagName, Document& document) > { > return adoptRef(*new SVGEllipseElement(tagName, document)); > } > >-void SVGEllipseElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::cxAttr, &SVGEllipseElement::m_cx>(); >- registry.registerAttribute<SVGNames::cyAttr, &SVGEllipseElement::m_cy>(); >- registry.registerAttribute<SVGNames::rxAttr, &SVGEllipseElement::m_rx>(); >- registry.registerAttribute<SVGNames::ryAttr, &SVGEllipseElement::m_ry>(); >-} >- > void SVGEllipseElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; > > if (name == SVGNames::cxAttr) >- m_cx.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_cx->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::cyAttr) >- m_cy.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_cy->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::rxAttr) >- m_rx.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); >+ m_rx->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); > else if (name == SVGNames::ryAttr) >- m_ry.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); >+ m_ry->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); > > reportAttributeParsingError(parseError, name, value); > >@@ -75,7 +71,7 @@ void SVGEllipseElement::parseAttribute(const QualifiedName& name, const AtomicSt > > void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidateSVGPresentationAttributeStyle(); > return; >diff --git a/Source/WebCore/svg/SVGEllipseElement.h b/Source/WebCore/svg/SVGEllipseElement.h >index 9daaea8cf8b..071bbeafd4c 100644 >--- a/Source/WebCore/svg/SVGEllipseElement.h >+++ b/Source/WebCore/svg/SVGEllipseElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedLength.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGeometryElement.h" > #include "SVGNames.h" >@@ -33,25 +32,22 @@ class SVGEllipseElement final : public SVGGeometryElement, public SVGExternalRes > public: > static Ref<SVGEllipseElement> create(const QualifiedName&, Document&); > >- const SVGLengthValue& cx() const { return m_cx.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& cy() const { return m_cy.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& rx() const { return m_rx.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& ry() const { return m_ry.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& cx() const { return m_cx->currentValue(); } >+ const SVGLengthValue& cy() const { return m_cy->currentValue(); } >+ const SVGLengthValue& rx() const { return m_rx->currentValue(); } >+ const SVGLengthValue& ry() const { return m_ry->currentValue(); } > >- RefPtr<SVGAnimatedLength> cxAnimated() { return m_cx.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> cyAnimated() { return m_cy.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> rxAnimated() { return m_rx.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> ryAnimated() { return m_ry.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& cx() { return m_cx; } >+ Ref<SVGAnimatedLength>& cy() { return m_cy; } >+ Ref<SVGAnimatedLength>& rx() { return m_rx; } >+ Ref<SVGAnimatedLength>& ry() { return m_ry; } > > private: > SVGEllipseElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGEllipseElement, SVGGeometryElement, SVGExternalResourcesRequired>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGEllipseElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -60,11 +56,11 @@ private: > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_cx { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_cy { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_rx { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_ry { LengthModeHeight }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_cx { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_cy { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_rx { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_ry { SVGAnimatedLength::create(this, LengthModeHeight) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGExternalResourcesRequired.cpp b/Source/WebCore/svg/SVGExternalResourcesRequired.cpp >index 3a1e56dd623..a817adfcb27 100644 >--- a/Source/WebCore/svg/SVGExternalResourcesRequired.cpp >+++ b/Source/WebCore/svg/SVGExternalResourcesRequired.cpp >@@ -22,6 +22,8 @@ > #include "config.h" > #include "SVGExternalResourcesRequired.h" > >+#include "RenderSVGResource.h" >+#include "RenderSVGShape.h" > #include "SVGElement.h" > #include "SVGNames.h" > >@@ -29,22 +31,18 @@ namespace WebCore { > > SVGExternalResourcesRequired::SVGExternalResourcesRequired(SVGElement* contextElement) > : m_contextElement(*contextElement) >+ , m_externalResourcesRequired(SVGAnimatedBoolean::create(contextElement)) > { >- registerAttributes(); >-} >- >-void SVGExternalResourcesRequired::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::externalResourcesRequiredAttr, &SVGEllipseElement::m_externalResourcesRequired>(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::externalResourcesRequiredAttr, &SVGExternalResourcesRequired::m_externalResourcesRequired>(); >+ }); > } > > void SVGExternalResourcesRequired::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::externalResourcesRequiredAttr) >- setExternalResourcesRequired(value == "true"); >+ m_externalResourcesRequired->setBaseValInternal(value == "true"); > } > > void SVGExternalResourcesRequired::svgAttributeChanged(const QualifiedName& attrName) >@@ -57,7 +55,7 @@ void SVGExternalResourcesRequired::svgAttributeChanged(const QualifiedName& attr > // Handle dynamic updates of the 'externalResourcesRequired' attribute. Only possible case: changing from 'true' to 'false' > // causes an immediate dispatch of the SVGLoad event. If the attribute value was 'false' before inserting the script element > // in the document, the SVGLoad event has already been dispatched. >- if (!externalResourcesRequired() && !haveFiredLoadEvent() && !isParserInserted()) { >+ if (!m_externalResourcesRequired->currentValue() && !haveFiredLoadEvent() && !isParserInserted()) { > setHaveFiredLoadEvent(true); > > ASSERT(m_contextElement.haveLoadedRequiredResources()); >@@ -79,7 +77,7 @@ void SVGExternalResourcesRequired::addSupportedAttributes(HashSet<QualifiedName> > void SVGExternalResourcesRequired::dispatchLoadEvent() > { > if (isParserInserted()) >- ASSERT(externalResourcesRequired() != haveFiredLoadEvent()); >+ ASSERT(m_externalResourcesRequired->currentValue() != haveFiredLoadEvent()); > else if (haveFiredLoadEvent()) > return; > >@@ -87,7 +85,7 @@ void SVGExternalResourcesRequired::dispatchLoadEvent() > // HTML fires the 'load' event after it sucessfully loaded a remote resource, otherwise an error event. > // SVG fires the SVGLoad event immediately after parsing the <script> element, if externalResourcesRequired > // is set to 'false', otherwise it dispatches the 'SVGLoad' event just after loading the remote resource. >- if (!externalResourcesRequired()) >+ if (!m_externalResourcesRequired->currentValue()) > return; > > ASSERT(!haveFiredLoadEvent()); >@@ -105,7 +103,7 @@ void SVGExternalResourcesRequired::insertedIntoDocument() > return; > > // Eventually send SVGLoad event now for the dynamically inserted script element. >- if (externalResourcesRequired()) >+ if (m_externalResourcesRequired->currentValue()) > return; > setHaveFiredLoadEvent(true); > m_contextElement.sendSVGLoadEventIfPossibleAsynchronously(); >@@ -114,13 +112,13 @@ void SVGExternalResourcesRequired::insertedIntoDocument() > void SVGExternalResourcesRequired::finishParsingChildren() > { > // A SVGLoad event has been fired by SVGElement::finishParsingChildren. >- if (!externalResourcesRequired()) >+ if (!m_externalResourcesRequired->currentValue()) > setHaveFiredLoadEvent(true); > } > > bool SVGExternalResourcesRequired::haveLoadedRequiredResources() const > { >- return !externalResourcesRequired() || haveFiredLoadEvent(); >+ return !m_externalResourcesRequired->currentValue() || haveFiredLoadEvent(); > } > > } >diff --git a/Source/WebCore/svg/SVGExternalResourcesRequired.h b/Source/WebCore/svg/SVGExternalResourcesRequired.h >index d25507ad07e..303edbeadcd 100644 >--- a/Source/WebCore/svg/SVGExternalResourcesRequired.h >+++ b/Source/WebCore/svg/SVGExternalResourcesRequired.h >@@ -22,7 +22,7 @@ > #pragma once > > #include "QualifiedName.h" >-#include "SVGAttributeOwnerProxyImpl.h" >+#include "SVGPropertyOwnerRegistry.h" > #include <wtf/HashSet.h> > > namespace WebCore { >@@ -44,18 +44,15 @@ public: > > static void addSupportedAttributes(HashSet<QualifiedName>&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGExternalResourcesRequired>; >- static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGExternalResourcesRequired>; > >- auto externalResourcesRequiredAnimated() { return m_externalResourcesRequired.animatedProperty(attributeOwnerProxy()); } >- >- bool externalResourcesRequired() const { return m_externalResourcesRequired.value(); } >- void setExternalResourcesRequired(bool externalResourcesRequired) { m_externalResourcesRequired.setValue(externalResourcesRequired); } >+ bool externalResourcesRequired() const { return m_externalResourcesRequired->currentValue(); } >+ Ref<SVGAnimatedBoolean>& externalResourcesRequired() { return m_externalResourcesRequired; } > > protected: > SVGExternalResourcesRequired(SVGElement* contextElement); > >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >+ static bool isKnownAttribute(const QualifiedName& attributeName) { return PropertyRegistry::isKnownAttribute(attributeName); } > > virtual void setHaveFiredLoadEvent(bool) { } > virtual bool isParserInserted() const { return false; } >@@ -67,11 +64,10 @@ protected: > bool haveLoadedRequiredResources() const; > > private: >- static void registerAttributes(); >- AttributeOwnerProxy attributeOwnerProxy() { return { *this, m_contextElement }; } >- > SVGElement& m_contextElement; >- SVGAnimatedBooleanAttribute m_externalResourcesRequired; >+ >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedBoolean> m_externalResourcesRequired; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEBlendElement.cpp b/Source/WebCore/svg/SVGFEBlendElement.cpp >index 8c66d2c2216..683b9d7816e 100644 >--- a/Source/WebCore/svg/SVGFEBlendElement.cpp >+++ b/Source/WebCore/svg/SVGFEBlendElement.cpp >@@ -37,7 +37,13 @@ inline SVGFEBlendElement::SVGFEBlendElement(const QualifiedName& tagName, Docume > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feBlendTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEBlendElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::in2Attr, &SVGFEBlendElement::m_in2>(); >+ PropertyRegistry::registerProperty<SVGNames::modeAttr, BlendMode, &SVGFEBlendElement::m_mode>(); >+ }); > } > > Ref<SVGFEBlendElement> SVGFEBlendElement::create(const QualifiedName& tagName, Document& document) >@@ -45,39 +51,29 @@ Ref<SVGFEBlendElement> SVGFEBlendElement::create(const QualifiedName& tagName, D > return adoptRef(*new SVGFEBlendElement(tagName, document)); > } > >-void SVGFEBlendElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEBlendElement::m_in1>(); >- registry.registerAttribute<SVGNames::in2Attr, &SVGFEBlendElement::m_in2>(); >- registry.registerAttribute<SVGNames::modeAttr, BlendMode, &SVGFEBlendElement::m_mode>(); >-} >- > void SVGFEBlendElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::modeAttr) { > BlendMode mode = BlendMode::Normal; > if (parseBlendMode(value, mode)) >- m_mode.setValue(mode); >+ m_mode->setBaseValInternal(mode); > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::in2Attr) { >- m_in2.setValue(value); >+ m_in2->setBaseValInternal(value); > return; > } > > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFEBlendElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFEBlendElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FEBlend* blend = static_cast<FEBlend*>(effect); > if (attrName == SVGNames::modeAttr) >@@ -104,7 +100,7 @@ void SVGFEBlendElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEBlendElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > auto input2 = filterBuilder->getEffectById(in2()); >diff --git a/Source/WebCore/svg/SVGFEBlendElement.h b/Source/WebCore/svg/SVGFEBlendElement.h >index d67baffcaa9..1199acad86d 100644 >--- a/Source/WebCore/svg/SVGFEBlendElement.h >+++ b/Source/WebCore/svg/SVGFEBlendElement.h >@@ -23,7 +23,6 @@ > #pragma once > > #include "GraphicsTypes.h" >-#include "SVGAnimatedEnumeration.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -31,7 +30,13 @@ namespace WebCore { > template<> > struct SVGPropertyTraits<BlendMode> { > static unsigned highestEnumValue() { return static_cast<unsigned>(BlendMode::Luminosity); } >- >+ static BlendMode fromString(const String& string) >+ { >+ BlendMode mode = BlendMode::Normal; >+ parseBlendMode(string, mode); >+ return mode; >+ } >+ > static String toString(BlendMode type) > { > if (type < BlendMode::PlusDarker) >@@ -46,33 +51,30 @@ class SVGFEBlendElement final : public SVGFilterPrimitiveStandardAttributes { > public: > static Ref<SVGFEBlendElement> create(const QualifiedName&, Document&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- String in2() const { return m_in2.currentValue(attributeOwnerProxy()); } >- BlendMode mode() const { return m_mode.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ String in2() const { return m_in2->currentValue(); } >+ BlendMode mode() const { return m_mode->currentValue<BlendMode>(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> in2Animated() { return m_in2.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> modeAnimated() { return m_mode.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedString>& in2() { return m_in2; } >+ Ref<SVGAnimatedEnumeration>& mode() { return m_mode; } > > private: > SVGFEBlendElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEBlendElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEBlendElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedStringAttribute m_in2; >- SVGAnimatedEnumerationAttribute<BlendMode> m_mode { BlendMode::Normal }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedString> m_in2 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_mode { SVGAnimatedEnumeration::create(this, BlendMode::Normal) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEColorMatrixElement.cpp b/Source/WebCore/svg/SVGFEColorMatrixElement.cpp >index 515d32ffbcd..48828c0d48b 100644 >--- a/Source/WebCore/svg/SVGFEColorMatrixElement.cpp >+++ b/Source/WebCore/svg/SVGFEColorMatrixElement.cpp >@@ -35,7 +35,13 @@ inline SVGFEColorMatrixElement::SVGFEColorMatrixElement(const QualifiedName& tag > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feColorMatrixTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEColorMatrixElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::typeAttr, ColorMatrixType, &SVGFEColorMatrixElement::m_type>(); >+ PropertyRegistry::registerProperty<SVGNames::valuesAttr, &SVGFEColorMatrixElement::m_values>(); >+ }); > } > > Ref<SVGFEColorMatrixElement> SVGFEColorMatrixElement::create(const QualifiedName& tagName, Document& document) >@@ -43,42 +49,29 @@ Ref<SVGFEColorMatrixElement> SVGFEColorMatrixElement::create(const QualifiedName > return adoptRef(*new SVGFEColorMatrixElement(tagName, document)); > } > >-void SVGFEColorMatrixElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEColorMatrixElement::m_in1>(); >- registry.registerAttribute<SVGNames::typeAttr, ColorMatrixType, &SVGFEColorMatrixElement::m_type>(); >- registry.registerAttribute<SVGNames::valuesAttr, &SVGFEColorMatrixElement::m_values>(); >-} >- > void SVGFEColorMatrixElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::typeAttr) { > auto propertyValue = SVGPropertyTraits<ColorMatrixType>::fromString(value); > if (propertyValue > 0) >- m_type.setValue(propertyValue); >+ m_type->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::valuesAttr) { >- SVGNumberListValues newList; >- newList.parse(value); >- m_values.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); >- m_values.setValue(WTFMove(newList)); >+ m_values->baseVal()->parse(value); > return; > } > > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFEColorMatrixElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFEColorMatrixElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FEColorMatrix* colorMatrix = static_cast<FEColorMatrix*>(effect); > if (attrName == SVGNames::typeAttr) >@@ -107,7 +100,7 @@ void SVGFEColorMatrixElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >@@ -134,13 +127,14 @@ RefPtr<FilterEffect> SVGFEColorMatrixElement::build(SVGFilterBuilder* filterBuil > break; > } > } else { >- filterValues = values(); >- unsigned size = filterValues.size(); >+ unsigned size = values().size(); > > if ((filterType == FECOLORMATRIX_TYPE_MATRIX && size != 20) > || (filterType == FECOLORMATRIX_TYPE_HUEROTATE && size != 1) > || (filterType == FECOLORMATRIX_TYPE_SATURATE && size != 1)) > return nullptr; >+ >+ filterValues = values(); > } > > RefPtr<FilterEffect> effect = FEColorMatrix::create(filter, filterType, filterValues); >diff --git a/Source/WebCore/svg/SVGFEColorMatrixElement.h b/Source/WebCore/svg/SVGFEColorMatrixElement.h >index 47688ec869d..00654b23ab1 100644 >--- a/Source/WebCore/svg/SVGFEColorMatrixElement.h >+++ b/Source/WebCore/svg/SVGFEColorMatrixElement.h >@@ -22,8 +22,6 @@ > #pragma once > > #include "FEColorMatrix.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedNumberList.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -70,33 +68,30 @@ class SVGFEColorMatrixElement final : public SVGFilterPrimitiveStandardAttribute > public: > static Ref<SVGFEColorMatrixElement> create(const QualifiedName&, Document&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- ColorMatrixType type() const { return m_type.currentValue(attributeOwnerProxy()); } >- const SVGNumberListValues& values() const { return m_values.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ ColorMatrixType type() const { return m_type->currentValue<ColorMatrixType>(); } >+ const SVGNumberList& values() const { return m_values->currentValue(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> typeAnimated() { return m_type.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumberList> valuesAnimated() { return m_values.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedEnumeration>& type() { return m_type; } >+ Ref<SVGAnimatedNumberList>& values() { return m_values; } > > private: > SVGFEColorMatrixElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEColorMatrixElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEColorMatrixElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedEnumerationAttribute<ColorMatrixType> m_type { FECOLORMATRIX_TYPE_MATRIX }; >- SVGAnimatedNumberListAttribute m_values; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_type { SVGAnimatedEnumeration::create(this, FECOLORMATRIX_TYPE_MATRIX) }; >+ Ref<SVGAnimatedNumberList> m_values { SVGAnimatedNumberList::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEComponentTransferElement.cpp b/Source/WebCore/svg/SVGFEComponentTransferElement.cpp >index 57faf3b4630..5b71dc87809 100644 >--- a/Source/WebCore/svg/SVGFEComponentTransferElement.cpp >+++ b/Source/WebCore/svg/SVGFEComponentTransferElement.cpp >@@ -40,7 +40,11 @@ inline SVGFEComponentTransferElement::SVGFEComponentTransferElement(const Qualif > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feComponentTransferTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEComponentTransferElement::m_in1>(); >+ }); > } > > Ref<SVGFEComponentTransferElement> SVGFEComponentTransferElement::create(const QualifiedName& tagName, Document& document) >@@ -48,25 +52,17 @@ Ref<SVGFEComponentTransferElement> SVGFEComponentTransferElement::create(const Q > return adoptRef(*new SVGFEComponentTransferElement(tagName, document)); > } > >-void SVGFEComponentTransferElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEComponentTransferElement::m_in1>(); >-} >- > void SVGFEComponentTransferElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-RefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEComponentTransferElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >diff --git a/Source/WebCore/svg/SVGFEComponentTransferElement.h b/Source/WebCore/svg/SVGFEComponentTransferElement.h >index bd62b3481c5..0eff451ce23 100644 >--- a/Source/WebCore/svg/SVGFEComponentTransferElement.h >+++ b/Source/WebCore/svg/SVGFEComponentTransferElement.h >@@ -30,24 +30,22 @@ class SVGFEComponentTransferElement final : public SVGFilterPrimitiveStandardAtt > public: > static Ref<SVGFEComponentTransferElement> create(const QualifiedName&, Document&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } > > private: > SVGFEComponentTransferElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEComponentTransferElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEComponentTransferElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > > // FIXME: svgAttributeChanged missing. >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFECompositeElement.cpp b/Source/WebCore/svg/SVGFECompositeElement.cpp >index a10e3a721cf..a36e62f8365 100644 >--- a/Source/WebCore/svg/SVGFECompositeElement.cpp >+++ b/Source/WebCore/svg/SVGFECompositeElement.cpp >@@ -35,7 +35,17 @@ inline SVGFECompositeElement::SVGFECompositeElement(const QualifiedName& tagName > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feCompositeTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFECompositeElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::in2Attr, &SVGFECompositeElement::m_in2>(); >+ PropertyRegistry::registerProperty<SVGNames::operatorAttr, CompositeOperationType, &SVGFECompositeElement::m_svgOperator>(); >+ PropertyRegistry::registerProperty<SVGNames::k1Attr, &SVGFECompositeElement::m_k1>(); >+ PropertyRegistry::registerProperty<SVGNames::k2Attr, &SVGFECompositeElement::m_k2>(); >+ PropertyRegistry::registerProperty<SVGNames::k3Attr, &SVGFECompositeElement::m_k3>(); >+ PropertyRegistry::registerProperty<SVGNames::k4Attr, &SVGFECompositeElement::m_k4>(); >+ }); > } > > Ref<SVGFECompositeElement> SVGFECompositeElement::create(const QualifiedName& tagName, Document& document) >@@ -43,63 +53,49 @@ Ref<SVGFECompositeElement> SVGFECompositeElement::create(const QualifiedName& ta > return adoptRef(*new SVGFECompositeElement(tagName, document)); > } > >-void SVGFECompositeElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFECompositeElement::m_in1>(); >- registry.registerAttribute<SVGNames::in2Attr, &SVGFECompositeElement::m_in2>(); >- registry.registerAttribute<SVGNames::operatorAttr, CompositeOperationType, &SVGFECompositeElement::m_svgOperator>(); >- registry.registerAttribute<SVGNames::k1Attr, &SVGFECompositeElement::m_k1>(); >- registry.registerAttribute<SVGNames::k2Attr, &SVGFECompositeElement::m_k2>(); >- registry.registerAttribute<SVGNames::k3Attr, &SVGFECompositeElement::m_k3>(); >- registry.registerAttribute<SVGNames::k4Attr, &SVGFECompositeElement::m_k4>(); >-} >- > void SVGFECompositeElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::operatorAttr) { > CompositeOperationType propertyValue = SVGPropertyTraits<CompositeOperationType>::fromString(value); > if (propertyValue > 0) >- m_svgOperator.setValue(propertyValue); >+ m_svgOperator->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::in2Attr) { >- m_in2.setValue(value); >+ m_in2->setBaseValInternal(value); > return; > } > > if (name == SVGNames::k1Attr) { >- m_k1.setValue(value.toFloat()); >+ m_k1->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::k2Attr) { >- m_k2.setValue(value.toFloat()); >+ m_k2->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::k3Attr) { >- m_k3.setValue(value.toFloat()); >+ m_k3->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::k4Attr) { >- m_k4.setValue(value.toFloat()); >+ m_k4->setBaseValInternal(value.toFloat()); > return; > } > > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFECompositeElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFECompositeElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FEComposite* composite = static_cast<FEComposite*>(effect); > if (attrName == SVGNames::operatorAttr) >@@ -135,7 +131,7 @@ void SVGFECompositeElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFECompositeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > auto input2 = filterBuilder->getEffectById(in2()); >diff --git a/Source/WebCore/svg/SVGFECompositeElement.h b/Source/WebCore/svg/SVGFECompositeElement.h >index a123cc6a714..b7c2dc22019 100644 >--- a/Source/WebCore/svg/SVGFECompositeElement.h >+++ b/Source/WebCore/svg/SVGFECompositeElement.h >@@ -22,8 +22,6 @@ > #pragma once > > #include "FEComposite.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedNumber.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -85,45 +83,42 @@ class SVGFECompositeElement final : public SVGFilterPrimitiveStandardAttributes > public: > static Ref<SVGFECompositeElement> create(const QualifiedName&, Document&); > >- String in1() { return m_in1.currentValue(attributeOwnerProxy()); } >- String in2() { return m_in2.currentValue(attributeOwnerProxy()); } >- CompositeOperationType svgOperator() const { return m_svgOperator.currentValue(attributeOwnerProxy()); } >- float k1() const { return m_k1.currentValue(attributeOwnerProxy()); } >- float k2() const { return m_k2.currentValue(attributeOwnerProxy()); } >- float k3() const { return m_k3.currentValue(attributeOwnerProxy()); } >- float k4() const { return m_k4.currentValue(attributeOwnerProxy()); } >- >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> in2Animated() { return m_in2.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> svgOperatorAnimated() { return m_svgOperator.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> k1Animated() { return m_k1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> k2Animated() { return m_k2.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> k3Animated() { return m_k3.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> k4Animated() { return m_k4.animatedProperty(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ String in2() const { return m_in2->currentValue(); } >+ CompositeOperationType svgOperator() const { return m_svgOperator->currentValue<CompositeOperationType>(); } >+ float k1() const { return m_k1->currentValue(); } >+ float k2() const { return m_k2->currentValue(); } >+ float k3() const { return m_k3->currentValue(); } >+ float k4() const { return m_k4->currentValue(); } >+ >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedString>& in2() { return m_in2; } >+ Ref<SVGAnimatedEnumeration>& svgOperator() { return m_svgOperator; } >+ Ref<SVGAnimatedNumber>& k1() { return m_k1; } >+ Ref<SVGAnimatedNumber>& k2() { return m_k2; } >+ Ref<SVGAnimatedNumber>& k3() { return m_k3; } >+ Ref<SVGAnimatedNumber>& k4() { return m_k4; } > > private: > SVGFECompositeElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFECompositeElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFECompositeElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedStringAttribute m_in2; >- SVGAnimatedEnumerationAttribute<CompositeOperationType> m_svgOperator { FECOMPOSITE_OPERATOR_OVER }; >- SVGAnimatedNumberAttribute m_k1; >- SVGAnimatedNumberAttribute m_k2; >- SVGAnimatedNumberAttribute m_k3; >- SVGAnimatedNumberAttribute m_k4; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; >+ >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedString> m_in2 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_svgOperator { SVGAnimatedEnumeration::create(this, FECOMPOSITE_OPERATOR_OVER) }; >+ Ref<SVGAnimatedNumber> m_k1 { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_k2 { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_k3 { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_k4 { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp b/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp >index e63b3237a55..5f8c64c5249 100644 >--- a/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp >+++ b/Source/WebCore/svg/SVGFEConvolveMatrixElement.cpp >@@ -27,7 +27,6 @@ > #include "IntSize.h" > #include "SVGFilterBuilder.h" > #include "SVGNames.h" >-#include "SVGNumberListValues.h" > #include "SVGParserUtilities.h" > #include <wtf/IsoMallocInlines.h> > >@@ -39,7 +38,20 @@ inline SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(const QualifiedNam > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feConvolveMatrixTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEConvolveMatrixElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::orderAttr, &SVGFEConvolveMatrixElement::m_orderX, &SVGFEConvolveMatrixElement::m_orderY>(); >+ PropertyRegistry::registerProperty<SVGNames::kernelMatrixAttr, &SVGFEConvolveMatrixElement::m_kernelMatrix>(); >+ PropertyRegistry::registerProperty<SVGNames::divisorAttr, &SVGFEConvolveMatrixElement::m_divisor>(); >+ PropertyRegistry::registerProperty<SVGNames::biasAttr, &SVGFEConvolveMatrixElement::m_bias>(); >+ PropertyRegistry::registerProperty<SVGNames::targetXAttr, &SVGFEConvolveMatrixElement::m_targetX>(); >+ PropertyRegistry::registerProperty<SVGNames::targetYAttr, &SVGFEConvolveMatrixElement::m_targetY>(); >+ PropertyRegistry::registerProperty<SVGNames::edgeModeAttr, EdgeModeType, &SVGFEConvolveMatrixElement::m_edgeMode>(); >+ PropertyRegistry::registerProperty<SVGNames::kernelUnitLengthAttr, &SVGFEConvolveMatrixElement::m_kernelUnitLengthX, &SVGFEConvolveMatrixElement::m_kernelUnitLengthY>(); >+ PropertyRegistry::registerProperty<SVGNames::preserveAlphaAttr, &SVGFEConvolveMatrixElement::m_preserveAlpha>(); >+ }); > } > > Ref<SVGFEConvolveMatrixElement> SVGFEConvolveMatrixElement::create(const QualifiedName& tagName, Document& document) >@@ -47,63 +59,18 @@ Ref<SVGFEConvolveMatrixElement> SVGFEConvolveMatrixElement::create(const Qualifi > return adoptRef(*new SVGFEConvolveMatrixElement(tagName, document)); > } > >-const AtomicString& SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFEConvolveMatrixElement::orderXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGOrderX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFEConvolveMatrixElement::orderYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGOrderY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-void SVGFEConvolveMatrixElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEConvolveMatrixElement::m_in1>(); >- registry.registerAttribute<SVGNames::orderAttr, >- &SVGFEConvolveMatrixElement::orderXIdentifier, &SVGFEConvolveMatrixElement::m_orderX, >- &SVGFEConvolveMatrixElement::orderYIdentifier, &SVGFEConvolveMatrixElement::m_orderY>(); >- registry.registerAttribute<SVGNames::kernelMatrixAttr, &SVGFEConvolveMatrixElement::m_kernelMatrix>(); >- registry.registerAttribute<SVGNames::divisorAttr, &SVGFEConvolveMatrixElement::m_divisor>(); >- registry.registerAttribute<SVGNames::biasAttr, &SVGFEConvolveMatrixElement::m_bias>(); >- registry.registerAttribute<SVGNames::targetXAttr, &SVGFEConvolveMatrixElement::m_targetX>(); >- registry.registerAttribute<SVGNames::targetYAttr, &SVGFEConvolveMatrixElement::m_targetY>(); >- registry.registerAttribute<SVGNames::edgeModeAttr, EdgeModeType, &SVGFEConvolveMatrixElement::m_edgeMode>(); >- registry.registerAttribute<SVGNames::kernelUnitLengthAttr, >- &SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier, &SVGFEConvolveMatrixElement::m_kernelUnitLengthX, >- &SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier, &SVGFEConvolveMatrixElement::m_kernelUnitLengthY>(); >- registry.registerAttribute<SVGNames::preserveAlphaAttr, &SVGFEConvolveMatrixElement::m_preserveAlpha>(); >-} >- > void SVGFEConvolveMatrixElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::orderAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y) && x >= 1 && y >= 1) { >- m_orderX.setValue(x); >- m_orderY.setValue(y); >+ m_orderX->setBaseValInternal(x); >+ m_orderY->setBaseValInternal(y); > } else > document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing order=\"" + value + "\". Filtered element will not be displayed."); > return; >@@ -112,49 +79,46 @@ void SVGFEConvolveMatrixElement::parseAttribute(const QualifiedName& name, const > if (name == SVGNames::edgeModeAttr) { > EdgeModeType propertyValue = SVGPropertyTraits<EdgeModeType>::fromString(value); > if (propertyValue > 0) >- m_edgeMode.setValue(propertyValue); >+ m_edgeMode->setBaseValInternal(propertyValue); > else > document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing edgeMode=\"" + value + "\". Filtered element will not be displayed."); > return; > } > > if (name == SVGNames::kernelMatrixAttr) { >- SVGNumberListValues newList; >- newList.parse(value); >- m_kernelMatrix.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); >- m_kernelMatrix.setValue(WTFMove(newList)); >+ m_kernelMatrix->baseVal()->parse(value); > return; > } > > if (name == SVGNames::divisorAttr) { > float divisor = value.toFloat(); > if (divisor) >- m_divisor.setValue(divisor); >+ m_divisor->setBaseValInternal(divisor); > else > document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing divisor=\"" + value + "\". Filtered element will not be displayed."); > return; > } > > if (name == SVGNames::biasAttr) { >- m_bias.setValue(value.toFloat()); >+ m_bias->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::targetXAttr) { >- m_targetX.setValue(value.string().toUIntStrict()); >+ m_targetX->setBaseValInternal(value.string().toUIntStrict()); > return; > } > > if (name == SVGNames::targetYAttr) { >- m_targetY.setValue(value.string().toUIntStrict()); >+ m_targetY->setBaseValInternal(value.string().toUIntStrict()); > return; > } > > if (name == SVGNames::kernelUnitLengthAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y) && x > 0 && y > 0) { >- m_kernelUnitLengthX.setValue(x); >- m_kernelUnitLengthY.setValue(y); >+ m_kernelUnitLengthX->setBaseValInternal(x); >+ m_kernelUnitLengthY->setBaseValInternal(y); > } else > document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing kernelUnitLength=\"" + value + "\". Filtered element will not be displayed."); > return; >@@ -162,9 +126,9 @@ void SVGFEConvolveMatrixElement::parseAttribute(const QualifiedName& name, const > > if (name == SVGNames::preserveAlphaAttr) { > if (value == "true") >- m_preserveAlpha.setValue(true); >+ m_preserveAlpha->setBaseValInternal(true); > else if (value == "false") >- m_preserveAlpha.setValue(false); >+ m_preserveAlpha->setBaseValInternal(false); > else > document().accessSVGExtensions().reportWarning("feConvolveMatrix: problem parsing preserveAlphaAttr=\"" + value + "\". Filtered element will not be displayed."); > return; >@@ -173,7 +137,7 @@ void SVGFEConvolveMatrixElement::parseAttribute(const QualifiedName& name, const > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFEConvolveMatrixElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFEConvolveMatrixElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FEConvolveMatrix* convolveMatrix = static_cast<FEConvolveMatrix*>(effect); > if (attrName == SVGNames::edgeModeAttr) >@@ -197,15 +161,15 @@ bool SVGFEConvolveMatrixElement::setFilterEffectAttribute(FilterEffect* effect, > > void SVGFEConvolveMatrixElement::setOrder(float x, float y) > { >- m_orderX.setValue(x); >- m_orderY.setValue(y); >+ m_orderX->setBaseValInternal(x); >+ m_orderY->setBaseValInternal(y); > invalidate(); > } > > void SVGFEConvolveMatrixElement::setKernelUnitLength(float x, float y) > { >- m_kernelUnitLengthX.setValue(x); >- m_kernelUnitLengthY.setValue(y); >+ m_kernelUnitLengthX->setBaseValInternal(x); >+ m_kernelUnitLengthY->setBaseValInternal(y); > invalidate(); > } > >@@ -226,7 +190,7 @@ void SVGFEConvolveMatrixElement::svgAttributeChanged(const QualifiedName& attrNa > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >@@ -243,7 +207,7 @@ RefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterB > if (orderXValue < 1 || orderYValue < 1) > return nullptr; > auto& kernelMatrix = this->kernelMatrix(); >- int kernelMatrixSize = kernelMatrix.size(); >+ int kernelMatrixSize = kernelMatrix.items().size(); > // The spec says this is a requirement, and should bail out if fails > if (orderXValue * orderYValue != kernelMatrixSize) > return nullptr; >@@ -276,7 +240,7 @@ RefPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterB > return nullptr; > if (!hasAttribute(SVGNames::divisorAttr)) { > for (int i = 0; i < kernelMatrixSize; ++i) >- divisorValue += kernelMatrix.at(i); >+ divisorValue += kernelMatrix.items()[i]->value(); > if (!divisorValue) > divisorValue = 1; > } >diff --git a/Source/WebCore/svg/SVGFEConvolveMatrixElement.h b/Source/WebCore/svg/SVGFEConvolveMatrixElement.h >index 6f731749a32..88e2aea03ed 100644 >--- a/Source/WebCore/svg/SVGFEConvolveMatrixElement.h >+++ b/Source/WebCore/svg/SVGFEConvolveMatrixElement.h >@@ -21,11 +21,6 @@ > #pragma once > > #include "FEConvolveMatrix.h" >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedInteger.h" >-#include "SVGAnimatedNumber.h" >-#include "SVGAnimatedNumberList.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -72,65 +67,57 @@ public: > void setOrder(float orderX, float orderY); > void setKernelUnitLength(float kernelUnitLengthX, float kernelUnitLengthY); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- int orderX() const { return m_orderX.currentValue(attributeOwnerProxy()); } >- int orderY() const { return m_orderY.currentValue(attributeOwnerProxy()); } >- const SVGNumberListValues& kernelMatrix() const { return m_kernelMatrix.currentValue(attributeOwnerProxy()); } >- float divisor() const { return m_divisor.currentValue(attributeOwnerProxy()); } >- float bias() const { return m_bias.currentValue(attributeOwnerProxy()); } >- int targetX() const { return m_targetX.currentValue(attributeOwnerProxy()); } >- int targetY() const { return m_targetY.currentValue(attributeOwnerProxy()); } >- EdgeModeType edgeMode() const { return m_edgeMode.currentValue(attributeOwnerProxy()); } >- float kernelUnitLengthX() const { return m_kernelUnitLengthX.currentValue(attributeOwnerProxy()); } >- float kernelUnitLengthY() const { return m_kernelUnitLengthY.currentValue(attributeOwnerProxy()); } >- bool preserveAlpha() const { return m_preserveAlpha.currentValue(attributeOwnerProxy()); } >- >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedInteger> orderXAnimated() { return m_orderX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedInteger> orderYAnimated() { return m_orderY.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumberList> kernelMatrixAnimated() { return m_kernelMatrix.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> divisorAnimated() { return m_divisor.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> biasAnimated() { return m_bias.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedInteger> targetXAnimated() { return m_targetX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedInteger> targetYAnimated() { return m_targetY.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> edgeModeAnimated() { return m_edgeMode.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> kernelUnitLengthXAnimated() { return m_kernelUnitLengthX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> kernelUnitLengthYAnimated() { return m_kernelUnitLengthY.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedBoolean> preserveAlphaAnimated() { return m_preserveAlpha.animatedProperty(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ int orderX() const { return m_orderX->currentValue(); } >+ int orderY() const { return m_orderY->currentValue(); } >+ const SVGNumberList& kernelMatrix() const { return m_kernelMatrix->currentValue(); } >+ float divisor() const { return m_divisor->currentValue(); } >+ float bias() const { return m_bias->currentValue(); } >+ int targetX() const { return m_targetX->currentValue(); } >+ int targetY() const { return m_targetY->currentValue(); } >+ EdgeModeType edgeMode() const { return m_edgeMode->currentValue<EdgeModeType>(); } >+ float kernelUnitLengthX() const { return m_kernelUnitLengthX->currentValue(); } >+ float kernelUnitLengthY() const { return m_kernelUnitLengthY->currentValue(); } >+ bool preserveAlpha() const { return m_preserveAlpha->currentValue(); } >+ >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedInteger>& orderX() { return m_orderX; } >+ Ref<SVGAnimatedInteger>& orderY() { return m_orderY; } >+ Ref<SVGAnimatedNumberList>& kernelMatrix() { return m_kernelMatrix; } >+ Ref<SVGAnimatedNumber>& divisor() { return m_divisor; } >+ Ref<SVGAnimatedNumber>& bias() { return m_bias; } >+ Ref<SVGAnimatedInteger>& targetX() { return m_targetX; } >+ Ref<SVGAnimatedInteger>& targetY() { return m_targetY; } >+ Ref<SVGAnimatedEnumeration>& edgeMode() { return m_edgeMode; } >+ Ref<SVGAnimatedNumber>& kernelUnitLengthX() { return m_kernelUnitLengthX; } >+ Ref<SVGAnimatedNumber>& kernelUnitLengthY() { return m_kernelUnitLengthY; } >+ Ref<SVGAnimatedBoolean>& preserveAlpha() { return m_preserveAlpha; } > > private: > SVGFEConvolveMatrixElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEConvolveMatrixElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEConvolveMatrixElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >- >- static const AtomicString& orderXIdentifier(); >- static const AtomicString& orderYIdentifier(); >- static const AtomicString& kernelUnitLengthXIdentifier(); >- static const AtomicString& kernelUnitLengthYIdentifier(); >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedIntegerAttribute m_orderX; >- SVGAnimatedIntegerAttribute m_orderY; >- SVGAnimatedNumberListAttribute m_kernelMatrix; >- SVGAnimatedNumberAttribute m_divisor; >- SVGAnimatedNumberAttribute m_bias; >- SVGAnimatedIntegerAttribute m_targetX; >- SVGAnimatedIntegerAttribute m_targetY; >- SVGAnimatedEnumerationAttribute<EdgeModeType> m_edgeMode { EDGEMODE_DUPLICATE }; >- SVGAnimatedNumberAttribute m_kernelUnitLengthX; >- SVGAnimatedNumberAttribute m_kernelUnitLengthY; >- SVGAnimatedBooleanAttribute m_preserveAlpha; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; >+ >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedInteger> m_orderX { SVGAnimatedInteger::create(this) }; >+ Ref<SVGAnimatedInteger> m_orderY { SVGAnimatedInteger::create(this) }; >+ Ref<SVGAnimatedNumberList> m_kernelMatrix { SVGAnimatedNumberList::create(this) }; >+ Ref<SVGAnimatedNumber> m_divisor { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_bias { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedInteger> m_targetX { SVGAnimatedInteger::create(this) }; >+ Ref<SVGAnimatedInteger> m_targetY { SVGAnimatedInteger::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_edgeMode { SVGAnimatedEnumeration::create(this, EDGEMODE_DUPLICATE) }; >+ Ref<SVGAnimatedNumber> m_kernelUnitLengthX { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_kernelUnitLengthY { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedBoolean> m_preserveAlpha { SVGAnimatedBoolean::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp b/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp >index b9b023ac006..b61b50a0281 100644 >--- a/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp >+++ b/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp >@@ -38,7 +38,14 @@ inline SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement(const QualifiedN > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feDiffuseLightingTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEDiffuseLightingElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::diffuseConstantAttr, &SVGFEDiffuseLightingElement::m_diffuseConstant>(); >+ PropertyRegistry::registerProperty<SVGNames::surfaceScaleAttr, &SVGFEDiffuseLightingElement::m_surfaceScale>(); >+ PropertyRegistry::registerProperty<SVGNames::kernelUnitLengthAttr, &SVGFEDiffuseLightingElement::m_kernelUnitLengthX, &SVGFEDiffuseLightingElement::m_kernelUnitLengthY>(); >+ }); > } > > Ref<SVGFEDiffuseLightingElement> SVGFEDiffuseLightingElement::create(const QualifiedName& tagName, Document& document) >@@ -46,53 +53,28 @@ Ref<SVGFEDiffuseLightingElement> SVGFEDiffuseLightingElement::create(const Quali > return adoptRef(*new SVGFEDiffuseLightingElement(tagName, document)); > } > >-const AtomicString& SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-void SVGFEDiffuseLightingElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEDiffuseLightingElement::m_in1>(); >- registry.registerAttribute<SVGNames::diffuseConstantAttr, &SVGFEDiffuseLightingElement::m_diffuseConstant>(); >- registry.registerAttribute<SVGNames::surfaceScaleAttr, &SVGFEDiffuseLightingElement::m_surfaceScale>(); >- registry.registerAttribute<SVGNames::kernelUnitLengthAttr, >- &SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier, &SVGFEDiffuseLightingElement::m_kernelUnitLengthX, >- &SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier, &SVGFEDiffuseLightingElement::m_kernelUnitLengthY>(); >-} >- > void SVGFEDiffuseLightingElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::surfaceScaleAttr) { >- m_surfaceScale.setValue(value.toFloat()); >+ m_surfaceScale->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::diffuseConstantAttr) { >- m_diffuseConstant.setValue(value.toFloat()); >+ m_diffuseConstant->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::kernelUnitLengthAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y)) { >- m_kernelUnitLengthX.setValue(x); >- m_kernelUnitLengthY.setValue(y); >+ m_kernelUnitLengthX->setBaseValInternal(x); >+ m_kernelUnitLengthY->setBaseValInternal(y); > } > return; > } >@@ -100,7 +82,7 @@ void SVGFEDiffuseLightingElement::parseAttribute(const QualifiedName& name, cons > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFEDiffuseLightingElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFEDiffuseLightingElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FEDiffuseLighting* diffuseLighting = static_cast<FEDiffuseLighting*>(effect); > >@@ -170,7 +152,7 @@ void SVGFEDiffuseLightingElement::lightElementAttributeChanged(const SVGFELightE > primitiveAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >diff --git a/Source/WebCore/svg/SVGFEDiffuseLightingElement.h b/Source/WebCore/svg/SVGFEDiffuseLightingElement.h >index 0b8ae8b01ef..ee78ceea99c 100644 >--- a/Source/WebCore/svg/SVGFEDiffuseLightingElement.h >+++ b/Source/WebCore/svg/SVGFEDiffuseLightingElement.h >@@ -36,42 +36,36 @@ public: > static Ref<SVGFEDiffuseLightingElement> create(const QualifiedName&, Document&); > void lightElementAttributeChanged(const SVGFELightElement*, const QualifiedName&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- float diffuseConstant() const { return m_diffuseConstant.currentValue(attributeOwnerProxy()); } >- float surfaceScale() const { return m_surfaceScale.currentValue(attributeOwnerProxy()); } >- float kernelUnitLengthX() const { return m_kernelUnitLengthX.currentValue(attributeOwnerProxy()); } >- float kernelUnitLengthY() const { return m_kernelUnitLengthY.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ float diffuseConstant() const { return m_diffuseConstant->currentValue(); } >+ float surfaceScale() const { return m_surfaceScale->currentValue(); } >+ float kernelUnitLengthX() const { return m_kernelUnitLengthX->currentValue(); } >+ float kernelUnitLengthY() const { return m_kernelUnitLengthY->currentValue(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> diffuseConstantAnimated() { return m_diffuseConstant.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> surfaceScaleAnimated() { return m_surfaceScale.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> kernelUnitLengthXAnimated() { return m_kernelUnitLengthX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> kernelUnitLengthYAnimated() { return m_kernelUnitLengthY.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedNumber>& diffuseConstant() { return m_diffuseConstant; } >+ Ref<SVGAnimatedNumber>& surfaceScale() { return m_surfaceScale; } >+ Ref<SVGAnimatedNumber>& kernelUnitLengthX() { return m_kernelUnitLengthX; } >+ Ref<SVGAnimatedNumber>& kernelUnitLengthY() { return m_kernelUnitLengthY; } > > private: > SVGFEDiffuseLightingElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEDiffuseLightingElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEDiffuseLightingElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- static const AtomicString& kernelUnitLengthXIdentifier(); >- static const AtomicString& kernelUnitLengthYIdentifier(); >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedNumberAttribute m_diffuseConstant { 1 }; >- SVGAnimatedNumberAttribute m_surfaceScale { 1 }; >- SVGAnimatedNumberAttribute m_kernelUnitLengthX; >- SVGAnimatedNumberAttribute m_kernelUnitLengthY; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedNumber> m_diffuseConstant { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_surfaceScale { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_kernelUnitLengthX { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_kernelUnitLengthY { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp b/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >index 435fc701df6..59ddcaa72ff 100644 >--- a/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >+++ b/Source/WebCore/svg/SVGFEDisplacementMapElement.cpp >@@ -34,7 +34,15 @@ inline SVGFEDisplacementMapElement::SVGFEDisplacementMapElement(const QualifiedN > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feDisplacementMapTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEDisplacementMapElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::in2Attr, &SVGFEDisplacementMapElement::m_in2>(); >+ PropertyRegistry::registerProperty<SVGNames::xChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_xChannelSelector>(); >+ PropertyRegistry::registerProperty<SVGNames::yChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_yChannelSelector>(); >+ PropertyRegistry::registerProperty<SVGNames::scaleAttr, &SVGFEDisplacementMapElement::m_scale>(); >+ }); > } > > Ref<SVGFEDisplacementMapElement> SVGFEDisplacementMapElement::create(const QualifiedName& tagName, Document& document) >@@ -42,53 +50,41 @@ Ref<SVGFEDisplacementMapElement> SVGFEDisplacementMapElement::create(const Quali > return adoptRef(*new SVGFEDisplacementMapElement(tagName, document)); > } > >-void SVGFEDisplacementMapElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEDisplacementMapElement::m_in1>(); >- registry.registerAttribute<SVGNames::in2Attr, &SVGFEDisplacementMapElement::m_in2>(); >- registry.registerAttribute<SVGNames::xChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_xChannelSelector>(); >- registry.registerAttribute<SVGNames::yChannelSelectorAttr, ChannelSelectorType, &SVGFEDisplacementMapElement::m_yChannelSelector>(); >- registry.registerAttribute<SVGNames::scaleAttr, &SVGFEDisplacementMapElement::m_scale>(); >-} >- > void SVGFEDisplacementMapElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::xChannelSelectorAttr) { > auto propertyValue = SVGPropertyTraits<ChannelSelectorType>::fromString(value); > if (propertyValue > 0) >- m_xChannelSelector.setValue(propertyValue); >+ m_xChannelSelector->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::yChannelSelectorAttr) { > auto propertyValue = SVGPropertyTraits<ChannelSelectorType>::fromString(value); > if (propertyValue > 0) >- m_yChannelSelector.setValue(propertyValue); >+ m_yChannelSelector->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::in2Attr) { >- m_in2.setValue(value); >+ m_in2->setBaseValInternal(value); > return; > } > > if (name == SVGNames::scaleAttr) { >- m_scale.setValue(value.toFloat()); >+ m_scale->setBaseValInternal(value.toFloat()); > return; > } > > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFEDisplacementMapElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFEDisplacementMapElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FEDisplacementMap* displacementMap = static_cast<FEDisplacementMap*>(effect); > if (attrName == SVGNames::xChannelSelectorAttr) >@@ -119,7 +115,7 @@ void SVGFEDisplacementMapElement::svgAttributeChanged(const QualifiedName& attrN > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > auto input2 = filterBuilder->getEffectById(in2()); >diff --git a/Source/WebCore/svg/SVGFEDisplacementMapElement.h b/Source/WebCore/svg/SVGFEDisplacementMapElement.h >index 51bed53df66..43b8b40c050 100644 >--- a/Source/WebCore/svg/SVGFEDisplacementMapElement.h >+++ b/Source/WebCore/svg/SVGFEDisplacementMapElement.h >@@ -21,8 +21,6 @@ > #pragma once > > #include "FEDisplacementMap.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedNumber.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -71,39 +69,36 @@ public: > > static ChannelSelectorType stringToChannel(const String&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- String in2() const { return m_in2.currentValue(attributeOwnerProxy()); } >- ChannelSelectorType xChannelSelector() const { return m_xChannelSelector.currentValue(attributeOwnerProxy()); } >- ChannelSelectorType yChannelSelector() const { return m_yChannelSelector.currentValue(attributeOwnerProxy()); } >- float scale() const { return m_scale.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ String in2() const { return m_in2->currentValue(); } >+ ChannelSelectorType xChannelSelector() const { return m_xChannelSelector->currentValue<ChannelSelectorType>(); } >+ ChannelSelectorType yChannelSelector() const { return m_yChannelSelector->currentValue<ChannelSelectorType>(); } >+ float scale() const { return m_scale->currentValue(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> in2Animated() { return m_in2.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> xChannelSelectorAnimated() { return m_xChannelSelector.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> yChannelSelectorAnimated() { return m_yChannelSelector.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> scaleAnimated() { return m_scale.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedString>& in2() { return m_in2; } >+ Ref<SVGAnimatedEnumeration>& xChannelSelector() { return m_xChannelSelector; } >+ Ref<SVGAnimatedEnumeration>& yChannelSelector() { return m_yChannelSelector; } >+ Ref<SVGAnimatedNumber>& scale() { return m_scale; } > > private: > SVGFEDisplacementMapElement(const QualifiedName& tagName, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEDisplacementMapElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEDisplacementMapElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedStringAttribute m_in2; >- SVGAnimatedEnumerationAttribute<ChannelSelectorType> m_xChannelSelector { CHANNEL_A }; >- SVGAnimatedEnumerationAttribute<ChannelSelectorType> m_yChannelSelector { CHANNEL_A }; >- SVGAnimatedNumberAttribute m_scale; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedString> m_in2 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_xChannelSelector { SVGAnimatedEnumeration::create(this, CHANNEL_A) }; >+ Ref<SVGAnimatedEnumeration> m_yChannelSelector { SVGAnimatedEnumeration::create(this, CHANNEL_A) }; >+ Ref<SVGAnimatedNumber> m_scale { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEDropShadowElement.cpp b/Source/WebCore/svg/SVGFEDropShadowElement.cpp >index 550f65e2743..8f8df493b76 100644 >--- a/Source/WebCore/svg/SVGFEDropShadowElement.cpp >+++ b/Source/WebCore/svg/SVGFEDropShadowElement.cpp >@@ -36,7 +36,14 @@ inline SVGFEDropShadowElement::SVGFEDropShadowElement(const QualifiedName& tagNa > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feDropShadowTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEDropShadowElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::dxAttr, &SVGFEDropShadowElement::m_dx>(); >+ PropertyRegistry::registerProperty<SVGNames::dyAttr, &SVGFEDropShadowElement::m_dy>(); >+ PropertyRegistry::registerProperty<SVGNames::stdDeviationAttr, &SVGFEDropShadowElement::m_stdDeviationX, &SVGFEDropShadowElement::m_stdDeviationY>(); >+ }); > } > > Ref<SVGFEDropShadowElement> SVGFEDropShadowElement::create(const QualifiedName& tagName, Document& document) >@@ -44,61 +51,36 @@ Ref<SVGFEDropShadowElement> SVGFEDropShadowElement::create(const QualifiedName& > return adoptRef(*new SVGFEDropShadowElement(tagName, document)); > } > >-const AtomicString& SVGFEDropShadowElement::stdDeviationXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFEDropShadowElement::stdDeviationYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- > void SVGFEDropShadowElement::setStdDeviation(float x, float y) > { >- m_stdDeviationX.setValue(x); >- m_stdDeviationY.setValue(y); >+ m_stdDeviationX->setBaseValInternal(x); >+ m_stdDeviationY->setBaseValInternal(y); > invalidate(); > } > >-void SVGFEDropShadowElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEDropShadowElement::m_in1>(); >- registry.registerAttribute<SVGNames::dxAttr, &SVGFEDropShadowElement::m_dx>(); >- registry.registerAttribute<SVGNames::dyAttr, &SVGFEDropShadowElement::m_dy>(); >- registry.registerAttribute<SVGNames::stdDeviationAttr, >- &SVGFEDropShadowElement::stdDeviationXIdentifier, &SVGFEDropShadowElement::m_stdDeviationX, >- &SVGFEDropShadowElement::stdDeviationYIdentifier, &SVGFEDropShadowElement::m_stdDeviationY>(); >-} >- > void SVGFEDropShadowElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::stdDeviationAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y)) { >- m_stdDeviationX.setValue(x); >- m_stdDeviationY.setValue(y); >+ m_stdDeviationX->setBaseValInternal(x); >+ m_stdDeviationY->setBaseValInternal(y); > } > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::dxAttr) { >- m_dx.setValue(value.toFloat()); >+ m_dx->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::dyAttr) { >- m_dy.setValue(value.toFloat()); >+ m_dy->setBaseValInternal(value.toFloat()); > return; > } > >@@ -107,7 +89,7 @@ void SVGFEDropShadowElement::parseAttribute(const QualifiedName& name, const Ato > > void SVGFEDropShadowElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidate(); > return; >@@ -116,7 +98,7 @@ void SVGFEDropShadowElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > RenderObject* renderer = this->renderer(); > if (!renderer) >diff --git a/Source/WebCore/svg/SVGFEDropShadowElement.h b/Source/WebCore/svg/SVGFEDropShadowElement.h >index 366219e02c6..48a7caf3e71 100644 >--- a/Source/WebCore/svg/SVGFEDropShadowElement.h >+++ b/Source/WebCore/svg/SVGFEDropShadowElement.h >@@ -21,7 +21,6 @@ > #pragma once > > #include "FEDropShadow.h" >-#include "SVGAnimatedNumber.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -33,41 +32,35 @@ public: > > void setStdDeviation(float stdDeviationX, float stdDeviationY); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- float dx() const { return m_dx.currentValue(attributeOwnerProxy()); } >- float dy() const { return m_dy.currentValue(attributeOwnerProxy()); } >- float stdDeviationX() const { return m_stdDeviationX.currentValue(attributeOwnerProxy()); } >- float stdDeviationY() const { return m_stdDeviationY.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ float dx() const { return m_dx->currentValue(); } >+ float dy() const { return m_dy->currentValue(); } >+ float stdDeviationX() const { return m_stdDeviationX->currentValue(); } >+ float stdDeviationY() const { return m_stdDeviationY->currentValue(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> dxAnimated() { return m_dx.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> dyAnimated() { return m_dy.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> stdDeviationXAnimated() { return m_stdDeviationX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> stdDeviationYAnimated() { return m_stdDeviationY.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedNumber>& dx() { return m_dx; } >+ Ref<SVGAnimatedNumber>& dy() { return m_dy; } >+ Ref<SVGAnimatedNumber>& stdDeviationX() { return m_stdDeviationX; } >+ Ref<SVGAnimatedNumber>& stdDeviationY() { return m_stdDeviationY; } > > private: > SVGFEDropShadowElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEDropShadowElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEDropShadowElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- static const AtomicString& stdDeviationXIdentifier(); >- static const AtomicString& stdDeviationYIdentifier(); >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedNumberAttribute m_dx { 2 }; >- SVGAnimatedNumberAttribute m_dy { 2 }; >- SVGAnimatedNumberAttribute m_stdDeviationX { 2 }; >- SVGAnimatedNumberAttribute m_stdDeviationY { 2 }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedNumber> m_dx { SVGAnimatedNumber::create(this, 2) }; >+ Ref<SVGAnimatedNumber> m_dy { SVGAnimatedNumber::create(this, 2) }; >+ Ref<SVGAnimatedNumber> m_stdDeviationX { SVGAnimatedNumber::create(this, 2) }; >+ Ref<SVGAnimatedNumber> m_stdDeviationY { SVGAnimatedNumber::create(this, 2) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEFloodElement.cpp b/Source/WebCore/svg/SVGFEFloodElement.cpp >index cfe642a332f..041ef9561b6 100644 >--- a/Source/WebCore/svg/SVGFEFloodElement.cpp >+++ b/Source/WebCore/svg/SVGFEFloodElement.cpp >@@ -42,7 +42,7 @@ Ref<SVGFEFloodElement> SVGFEFloodElement::create(const QualifiedName& tagName, D > return adoptRef(*new SVGFEFloodElement(tagName, document)); > } > >-bool SVGFEFloodElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFEFloodElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > RenderObject* renderer = this->renderer(); > ASSERT(renderer); >@@ -58,7 +58,7 @@ bool SVGFEFloodElement::setFilterEffectAttribute(FilterEffect* effect, const Qua > return false; > } > >-RefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter& filter) >+RefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter& filter) const > { > RenderObject* renderer = this->renderer(); > if (!renderer) >diff --git a/Source/WebCore/svg/SVGFEFloodElement.h b/Source/WebCore/svg/SVGFEFloodElement.h >index 6447ffc4719..4710cca9a6e 100644 >--- a/Source/WebCore/svg/SVGFEFloodElement.h >+++ b/Source/WebCore/svg/SVGFEFloodElement.h >@@ -32,8 +32,8 @@ public: > private: > SVGFEFloodElement(const QualifiedName&, Document&); > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp b/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp >index 933187e6d04..e80e208b39b 100644 >--- a/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp >+++ b/Source/WebCore/svg/SVGFEGaussianBlurElement.cpp >@@ -36,7 +36,13 @@ inline SVGFEGaussianBlurElement::SVGFEGaussianBlurElement(const QualifiedName& t > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feGaussianBlurTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEGaussianBlurElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::stdDeviationAttr, &SVGFEGaussianBlurElement::m_stdDeviationX, &SVGFEGaussianBlurElement::m_stdDeviationY>(); >+ PropertyRegistry::registerProperty<SVGNames::edgeModeAttr, EdgeModeType, &SVGFEGaussianBlurElement::m_edgeMode>(); >+ }); > } > > Ref<SVGFEGaussianBlurElement> SVGFEGaussianBlurElement::create(const QualifiedName& tagName, Document& document) >@@ -44,57 +50,33 @@ Ref<SVGFEGaussianBlurElement> SVGFEGaussianBlurElement::create(const QualifiedNa > return adoptRef(*new SVGFEGaussianBlurElement(tagName, document)); > } > >-const AtomicString& SVGFEGaussianBlurElement::stdDeviationXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFEGaussianBlurElement::stdDeviationYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGStdDeviationY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- > void SVGFEGaussianBlurElement::setStdDeviation(float x, float y) > { >- m_stdDeviationX.setValue(x); >- m_stdDeviationY.setValue(y); >+ m_stdDeviationX->setBaseValInternal(x); >+ m_stdDeviationY->setBaseValInternal(y); > invalidate(); > } > >-void SVGFEGaussianBlurElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEGaussianBlurElement::m_in1>(); >- registry.registerAttribute<SVGNames::stdDeviationAttr, >- &SVGFEGaussianBlurElement::stdDeviationXIdentifier, &SVGFEGaussianBlurElement::m_stdDeviationX, >- &SVGFEGaussianBlurElement::stdDeviationYIdentifier, &SVGFEGaussianBlurElement::m_stdDeviationY>(); >- registry.registerAttribute<SVGNames::edgeModeAttr, EdgeModeType, &SVGFEGaussianBlurElement::m_edgeMode>(); >-} >- > void SVGFEGaussianBlurElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::stdDeviationAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y)) { >- m_stdDeviationX.setValue(x); >- m_stdDeviationY.setValue(y); >+ m_stdDeviationX->setBaseValInternal(x); >+ m_stdDeviationY->setBaseValInternal(y); > } > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::edgeModeAttr) { > auto propertyValue = SVGPropertyTraits<EdgeModeType>::fromString(value); > if (propertyValue > 0) >- m_edgeMode.setValue(propertyValue); >+ m_edgeMode->setBaseValInternal(propertyValue); > else > document().accessSVGExtensions().reportWarning("feGaussianBlur: problem parsing edgeMode=\"" + value + "\". Filtered element will not be displayed."); > return; >@@ -105,7 +87,7 @@ void SVGFEGaussianBlurElement::parseAttribute(const QualifiedName& name, const A > > void SVGFEGaussianBlurElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidate(); > return; >@@ -114,7 +96,7 @@ void SVGFEGaussianBlurElement::svgAttributeChanged(const QualifiedName& attrName > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEGaussianBlurElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >diff --git a/Source/WebCore/svg/SVGFEGaussianBlurElement.h b/Source/WebCore/svg/SVGFEGaussianBlurElement.h >index 93b61aca46a..a6afc4da2bd 100644 >--- a/Source/WebCore/svg/SVGFEGaussianBlurElement.h >+++ b/Source/WebCore/svg/SVGFEGaussianBlurElement.h >@@ -22,8 +22,6 @@ > #pragma once > > #include "FEGaussianBlur.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedNumber.h" > #include "SVGFEConvolveMatrixElement.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > >@@ -36,38 +34,32 @@ public: > > void setStdDeviation(float stdDeviationX, float stdDeviationY); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- float stdDeviationX() const { return m_stdDeviationX.currentValue(attributeOwnerProxy()); } >- float stdDeviationY() const { return m_stdDeviationY.currentValue(attributeOwnerProxy()); } >- EdgeModeType edgeMode() const { return m_edgeMode.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ float stdDeviationX() const { return m_stdDeviationX->currentValue(); } >+ float stdDeviationY() const { return m_stdDeviationY->currentValue(); } >+ EdgeModeType edgeMode() const { return m_edgeMode->currentValue<EdgeModeType>(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> stdDeviationXAnimated() { return m_stdDeviationX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> stdDeviationYAnimated() { return m_stdDeviationY.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> edgeModeAnimated() { return m_edgeMode.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedNumber>& stdDeviationX() { return m_stdDeviationX; } >+ Ref<SVGAnimatedNumber>& stdDeviationY() { return m_stdDeviationY; } >+ Ref<SVGAnimatedEnumeration>& edgeMode() { return m_edgeMode; } > > private: > SVGFEGaussianBlurElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEGaussianBlurElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEGaussianBlurElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- static const AtomicString& stdDeviationXIdentifier(); >- static const AtomicString& stdDeviationYIdentifier(); >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedNumberAttribute m_stdDeviationX; >- SVGAnimatedNumberAttribute m_stdDeviationY; >- SVGAnimatedEnumerationAttribute<EdgeModeType> m_edgeMode { EDGEMODE_NONE }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedNumber> m_stdDeviationX { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_stdDeviationY { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_edgeMode { SVGAnimatedEnumeration::create(this, EDGEMODE_NONE) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEImageElement.cpp b/Source/WebCore/svg/SVGFEImageElement.cpp >index 65cfde1de77..92c9340e5c3 100644 >--- a/Source/WebCore/svg/SVGFEImageElement.cpp >+++ b/Source/WebCore/svg/SVGFEImageElement.cpp >@@ -44,7 +44,11 @@ inline SVGFEImageElement::SVGFEImageElement(const QualifiedName& tagName, Docume > , SVGURIReference(this) > { > ASSERT(hasTagName(SVGNames::feImageTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::preserveAspectRatioAttr, &SVGFEImageElement::m_preserveAspectRatio>(); >+ }); > } > > Ref<SVGFEImageElement> SVGFEImageElement::create(const QualifiedName& tagName, Document& document) >@@ -80,7 +84,8 @@ void SVGFEImageElement::requestImageResource() > ResourceLoaderOptions options = CachedResourceLoader::defaultCachedResourceOptions(); > options.contentSecurityPolicyImposition = isInUserAgentShadowTree() ? ContentSecurityPolicyImposition::SkipPolicyCheck : ContentSecurityPolicyImposition::DoPolicyCheck; > >- CachedResourceRequest request(ResourceRequest(document().completeURL(href())), options); >+ String href = this->href()->currentValue(); >+ CachedResourceRequest request(ResourceRequest(document().completeURL(href)), options); > request.setInitiator(*this); > m_cachedImage = document().cachedResourceLoader().requestImage(WTFMove(request)).value_or(nullptr); > >@@ -94,7 +99,8 @@ void SVGFEImageElement::buildPendingResource() > if (!isConnected()) > return; > >- auto target = SVGURIReference::targetElementFromIRIString(href(), treeScope()); >+ String href = this->href()->currentValue(); >+ auto target = SVGURIReference::targetElementFromIRIString(href, treeScope()); > if (!target.element) { > if (target.identifier.isEmpty()) > requestImageResource(); >@@ -111,20 +117,12 @@ void SVGFEImageElement::buildPendingResource() > invalidate(); > } > >-void SVGFEImageElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::preserveAspectRatioAttr, &SVGFEImageElement::m_preserveAspectRatio>(); >-} >- > void SVGFEImageElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::preserveAspectRatioAttr) { > SVGPreserveAspectRatioValue preserveAspectRatio; > preserveAspectRatio.parse(value); >- m_preserveAspectRatio.setValue(preserveAspectRatio); >+ m_preserveAspectRatio->setBaseValInternal(preserveAspectRatio); > return; > } > >@@ -185,7 +183,7 @@ void SVGFEImageElement::notifyFinished(CachedResource&) > RenderSVGResource::markForLayoutAndParentResourceInvalidation(*parentRenderer); > } > >-RefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter& filter) >+RefPtr<FilterEffect> SVGFEImageElement::build(SVGFilterBuilder*, Filter& filter) const > { > if (m_cachedImage) > return FEImage::createWithImage(filter, m_cachedImage->imageForRenderer(renderer()), preserveAspectRatio()); >diff --git a/Source/WebCore/svg/SVGFEImageElement.h b/Source/WebCore/svg/SVGFEImageElement.h >index 6c4fd6350b9..8cc89d48b37 100644 >--- a/Source/WebCore/svg/SVGFEImageElement.h >+++ b/Source/WebCore/svg/SVGFEImageElement.h >@@ -23,8 +23,6 @@ > > #include "CachedImageClient.h" > #include "CachedResourceHandle.h" >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedPreserveAspectRatio.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGFEImage.h" > #include "SVGFilterPrimitiveStandardAttributes.h" >@@ -41,18 +39,15 @@ public: > > bool hasSingleSecurityOrigin() const; > >- const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio.currentValue(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatioAnimated() { return m_preserveAspectRatio.animatedProperty(attributeOwnerProxy()); } >+ const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio->currentValue(); } >+ Ref<SVGAnimatedPreserveAspectRatio>& preserveAspectRatio() { return m_preserveAspectRatio; } > > private: > SVGFEImageElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEImageElement, SVGFilterPrimitiveStandardAttributes, SVGExternalResourcesRequired, SVGURIReference>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEImageElement, SVGFilterPrimitiveStandardAttributes, SVGExternalResourcesRequired, SVGURIReference>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >@@ -61,7 +56,7 @@ private: > > void didFinishInsertingNode() override; > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > > void clearResourceReferences(); > void requestImageResource(); >@@ -70,8 +65,8 @@ private: > InsertedIntoAncestorResult insertedIntoAncestor(InsertionType, ContainerNode&) override; > void removedFromAncestor(RemovalType, ContainerNode&) override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedPreserveAspectRatioAttribute m_preserveAspectRatio; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio { SVGAnimatedPreserveAspectRatio::create(this) }; > CachedResourceHandle<CachedImage> m_cachedImage; > }; > >diff --git a/Source/WebCore/svg/SVGFELightElement.cpp b/Source/WebCore/svg/SVGFELightElement.cpp >index 891fedd98d5..97c02b0fe0e 100644 >--- a/Source/WebCore/svg/SVGFELightElement.cpp >+++ b/Source/WebCore/svg/SVGFELightElement.cpp >@@ -43,7 +43,19 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(SVGFELightElement); > SVGFELightElement::SVGFELightElement(const QualifiedName& tagName, Document& document) > : SVGElement(tagName, document) > { >- registerAttributes(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::azimuthAttr, &SVGFELightElement::m_azimuth>(); >+ PropertyRegistry::registerProperty<SVGNames::elevationAttr, &SVGFELightElement::m_elevation>(); >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGFELightElement::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGFELightElement::m_y>(); >+ PropertyRegistry::registerProperty<SVGNames::zAttr, &SVGFELightElement::m_z>(); >+ PropertyRegistry::registerProperty<SVGNames::pointsAtXAttr, &SVGFELightElement::m_pointsAtX>(); >+ PropertyRegistry::registerProperty<SVGNames::pointsAtYAttr, &SVGFELightElement::m_pointsAtY>(); >+ PropertyRegistry::registerProperty<SVGNames::pointsAtZAttr, &SVGFELightElement::m_pointsAtZ>(); >+ PropertyRegistry::registerProperty<SVGNames::specularExponentAttr, &SVGFELightElement::m_specularExponent>(); >+ PropertyRegistry::registerProperty<SVGNames::limitingConeAngleAttr, &SVGFELightElement::m_limitingConeAngle>(); >+ }); > } > > SVGFELightElement* SVGFELightElement::findLightElement(const SVGElement* svgElement) >@@ -55,72 +67,55 @@ SVGFELightElement* SVGFELightElement::findLightElement(const SVGElement* svgElem > return nullptr; > } > >-void SVGFELightElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::azimuthAttr, &SVGFELightElement::m_azimuth>(); >- registry.registerAttribute<SVGNames::elevationAttr, &SVGFELightElement::m_elevation>(); >- registry.registerAttribute<SVGNames::xAttr, &SVGFELightElement::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGFELightElement::m_y>(); >- registry.registerAttribute<SVGNames::zAttr, &SVGFELightElement::m_z>(); >- registry.registerAttribute<SVGNames::pointsAtXAttr, &SVGFELightElement::m_pointsAtX>(); >- registry.registerAttribute<SVGNames::pointsAtYAttr, &SVGFELightElement::m_pointsAtY>(); >- registry.registerAttribute<SVGNames::pointsAtZAttr, &SVGFELightElement::m_pointsAtZ>(); >- registry.registerAttribute<SVGNames::specularExponentAttr, &SVGFELightElement::m_specularExponent>(); >- registry.registerAttribute<SVGNames::limitingConeAngleAttr, &SVGFELightElement::m_limitingConeAngle>(); >-} >- > void SVGFELightElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::azimuthAttr) { >- m_azimuth.setValue(value.toFloat()); >+ m_azimuth->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::elevationAttr) { >- m_elevation.setValue(value.toFloat()); >+ m_elevation->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::xAttr) { >- m_x.setValue(value.toFloat()); >+ m_x->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::yAttr) { >- m_y.setValue(value.toFloat()); >+ m_y->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::zAttr) { >- m_z.setValue(value.toFloat()); >+ m_z->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::pointsAtXAttr) { >- m_pointsAtX.setValue(value.toFloat()); >+ m_pointsAtX->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::pointsAtYAttr) { >- m_pointsAtY.setValue(value.toFloat()); >+ m_pointsAtY->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::pointsAtZAttr) { >- m_pointsAtZ.setValue(value.toFloat()); >+ m_pointsAtZ->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::specularExponentAttr) { >- m_specularExponent.setValue(value.toFloat()); >+ m_specularExponent->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::limitingConeAngleAttr) { >- m_limitingConeAngle.setValue(value.toFloat()); >+ m_limitingConeAngle->setBaseValInternal(value.toFloat()); > return; > } > >@@ -129,7 +124,7 @@ void SVGFELightElement::parseAttribute(const QualifiedName& name, const AtomicSt > > void SVGFELightElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > auto parent = makeRefPtr(parentElement()); > if (!parent) > return; >diff --git a/Source/WebCore/svg/SVGFELightElement.h b/Source/WebCore/svg/SVGFELightElement.h >index 84a678ffb0e..13d2c4818d0 100644 >--- a/Source/WebCore/svg/SVGFELightElement.h >+++ b/Source/WebCore/svg/SVGFELightElement.h >@@ -23,7 +23,6 @@ > #pragma once > > #include "LightSource.h" >-#include "SVGAnimatedNumber.h" > #include "SVGElement.h" > > namespace WebCore { >@@ -36,27 +35,27 @@ public: > virtual Ref<LightSource> lightSource(SVGFilterBuilder&) const = 0; > static SVGFELightElement* findLightElement(const SVGElement*); > >- float azimuth() const { return m_azimuth.currentValue(attributeOwnerProxy()); } >- float elevation() const { return m_elevation.currentValue(attributeOwnerProxy()); } >- float x() const { return m_x.currentValue(attributeOwnerProxy()); } >- float y() const { return m_y.currentValue(attributeOwnerProxy()); } >- float z() const { return m_z.currentValue(attributeOwnerProxy()); } >- float pointsAtX() const { return m_pointsAtX.currentValue(attributeOwnerProxy()); } >- float pointsAtY() const { return m_pointsAtY.currentValue(attributeOwnerProxy()); } >- float pointsAtZ() const { return m_pointsAtZ.currentValue(attributeOwnerProxy()); } >- float specularExponent() const { return m_specularExponent.currentValue(attributeOwnerProxy()); } >- float limitingConeAngle() const { return m_limitingConeAngle.currentValue(attributeOwnerProxy()); } >+ float azimuth() const { return m_azimuth->currentValue(); } >+ float elevation() const { return m_elevation->currentValue(); } >+ float x() const { return m_x->currentValue(); } >+ float y() const { return m_y->currentValue(); } >+ float z() const { return m_z->currentValue(); } >+ float pointsAtX() const { return m_pointsAtX->currentValue(); } >+ float pointsAtY() const { return m_pointsAtY->currentValue(); } >+ float pointsAtZ() const { return m_pointsAtZ->currentValue(); } >+ float specularExponent() const { return m_specularExponent->currentValue(); } >+ float limitingConeAngle() const { return m_limitingConeAngle->currentValue(); } > >- RefPtr<SVGAnimatedNumber> azimuthAnimated() { return m_azimuth.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> elevationAnimated() { return m_elevation.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> zAnimated() { return m_z.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> pointsAtXAnimated() { return m_pointsAtX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> pointsAtYAnimated() { return m_pointsAtY.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> pointsAtZAnimated() { return m_pointsAtZ.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> specularExponentAnimated() { return m_specularExponent.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> limitingConeAngleAnimated() { return m_limitingConeAngle.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedNumber>& azimuth() { return m_azimuth; } >+ Ref<SVGAnimatedNumber>& elevation() { return m_elevation; } >+ Ref<SVGAnimatedNumber>& x() { return m_x; } >+ Ref<SVGAnimatedNumber>& y() { return m_y; } >+ Ref<SVGAnimatedNumber>& z() { return m_z; } >+ Ref<SVGAnimatedNumber>& pointsAtX() { return m_pointsAtX; } >+ Ref<SVGAnimatedNumber>& pointsAtY() { return m_pointsAtY; } >+ Ref<SVGAnimatedNumber>& pointsAtZ() { return m_pointsAtZ; } >+ Ref<SVGAnimatedNumber>& specularExponent() { return m_specularExponent; } >+ Ref<SVGAnimatedNumber>& limitingConeAngle() { return m_limitingConeAngle; } > > protected: > SVGFELightElement(const QualifiedName&, Document&); >@@ -64,27 +63,24 @@ protected: > bool rendererIsNeeded(const RenderStyle&) override { return false; } > > private: >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFELightElement, SVGElement>; >- static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFELightElement, SVGElement>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > void childrenChanged(const ChildChange&) override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedNumberAttribute m_azimuth; >- SVGAnimatedNumberAttribute m_elevation; >- SVGAnimatedNumberAttribute m_x; >- SVGAnimatedNumberAttribute m_y; >- SVGAnimatedNumberAttribute m_z; >- SVGAnimatedNumberAttribute m_pointsAtX; >- SVGAnimatedNumberAttribute m_pointsAtY; >- SVGAnimatedNumberAttribute m_pointsAtZ; >- SVGAnimatedNumberAttribute m_specularExponent { 1 }; >- SVGAnimatedNumberAttribute m_limitingConeAngle; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedNumber> m_azimuth { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_elevation { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_x { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_y { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_z { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_pointsAtX { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_pointsAtY { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_pointsAtZ { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_specularExponent { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_limitingConeAngle { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEMergeElement.cpp b/Source/WebCore/svg/SVGFEMergeElement.cpp >index 502a99193c8..62285f70655 100644 >--- a/Source/WebCore/svg/SVGFEMergeElement.cpp >+++ b/Source/WebCore/svg/SVGFEMergeElement.cpp >@@ -44,7 +44,7 @@ Ref<SVGFEMergeElement> SVGFEMergeElement::create(const QualifiedName& tagName, D > return adoptRef(*new SVGFEMergeElement(tagName, document)); > } > >-RefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEMergeElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > RefPtr<FilterEffect> effect = FEMerge::create(filter); > FilterEffectVector& mergeInputs = effect->inputEffects(); >diff --git a/Source/WebCore/svg/SVGFEMergeElement.h b/Source/WebCore/svg/SVGFEMergeElement.h >index 3e42a748daa..8433c9a481e 100644 >--- a/Source/WebCore/svg/SVGFEMergeElement.h >+++ b/Source/WebCore/svg/SVGFEMergeElement.h >@@ -32,7 +32,7 @@ public: > private: > SVGFEMergeElement(const QualifiedName&, Document&); > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEMergeNodeElement.cpp b/Source/WebCore/svg/SVGFEMergeNodeElement.cpp >index 69cdef0a52b..ae802c286dd 100644 >--- a/Source/WebCore/svg/SVGFEMergeNodeElement.cpp >+++ b/Source/WebCore/svg/SVGFEMergeNodeElement.cpp >@@ -36,7 +36,11 @@ inline SVGFEMergeNodeElement::SVGFEMergeNodeElement(const QualifiedName& tagName > : SVGElement(tagName, document) > { > ASSERT(hasTagName(SVGNames::feMergeNodeTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEMergeNodeElement::m_in1>(); >+ }); > } > > Ref<SVGFEMergeNodeElement> SVGFEMergeNodeElement::create(const QualifiedName& tagName, Document& document) >@@ -44,18 +48,10 @@ Ref<SVGFEMergeNodeElement> SVGFEMergeNodeElement::create(const QualifiedName& ta > return adoptRef(*new SVGFEMergeNodeElement(tagName, document)); > } > >-void SVGFEMergeNodeElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEMergeNodeElement::m_in1>(); >-} >- > void SVGFEMergeNodeElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > >diff --git a/Source/WebCore/svg/SVGFEMergeNodeElement.h b/Source/WebCore/svg/SVGFEMergeNodeElement.h >index 9c554ee1125..8deb1d978b3 100644 >--- a/Source/WebCore/svg/SVGFEMergeNodeElement.h >+++ b/Source/WebCore/svg/SVGFEMergeNodeElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedString.h" > #include "SVGElement.h" > > namespace WebCore { >@@ -31,25 +30,22 @@ class SVGFEMergeNodeElement final : public SVGElement { > public: > static Ref<SVGFEMergeNodeElement> create(const QualifiedName&, Document&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } > > private: > SVGFEMergeNodeElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEMergeNodeElement, SVGElement>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEMergeNodeElement, SVGElement>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > > bool rendererIsNeeded(const RenderStyle&) final { return false; } > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEMorphologyElement.cpp b/Source/WebCore/svg/SVGFEMorphologyElement.cpp >index fcbc63b62e6..796e351cbf8 100644 >--- a/Source/WebCore/svg/SVGFEMorphologyElement.cpp >+++ b/Source/WebCore/svg/SVGFEMorphologyElement.cpp >@@ -35,7 +35,13 @@ inline SVGFEMorphologyElement::SVGFEMorphologyElement(const QualifiedName& tagNa > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feMorphologyTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEMorphologyElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::operatorAttr, MorphologyOperatorType, &SVGFEMorphologyElement::m_svgOperator>(); >+ PropertyRegistry::registerProperty<SVGNames::radiusAttr, &SVGFEMorphologyElement::m_radiusX, &SVGFEMorphologyElement::m_radiusY>(); >+ }); > } > > Ref<SVGFEMorphologyElement> SVGFEMorphologyElement::create(const QualifiedName& tagName, Document& document) >@@ -43,56 +49,32 @@ Ref<SVGFEMorphologyElement> SVGFEMorphologyElement::create(const QualifiedName& > return adoptRef(*new SVGFEMorphologyElement(tagName, document)); > } > >-const AtomicString& SVGFEMorphologyElement::radiusXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGRadiusX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFEMorphologyElement::radiusYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGRadiusY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- > void SVGFEMorphologyElement::setRadius(float x, float y) > { >- m_radiusX.setValue(x); >- m_radiusY.setValue(y); >+ m_radiusX->setBaseValInternal(x); >+ m_radiusY->setBaseValInternal(y); > invalidate(); > } > >-void SVGFEMorphologyElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEMorphologyElement::m_in1>(); >- registry.registerAttribute<SVGNames::operatorAttr, MorphologyOperatorType, &SVGFEMorphologyElement::m_svgOperator>(); >- registry.registerAttribute<SVGNames::radiusAttr, >- &SVGFEMorphologyElement::radiusXIdentifier, &SVGFEMorphologyElement::m_radiusX, >- &SVGFEMorphologyElement::radiusYIdentifier, &SVGFEMorphologyElement::m_radiusY>(); >-} >- > void SVGFEMorphologyElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::operatorAttr) { > MorphologyOperatorType propertyValue = SVGPropertyTraits<MorphologyOperatorType>::fromString(value); > if (propertyValue > 0) >- m_svgOperator.setValue(propertyValue); >+ m_svgOperator->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::radiusAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y)) { >- m_radiusX.setValue(x); >- m_radiusY.setValue(y); >+ m_radiusX->setBaseValInternal(x); >+ m_radiusY->setBaseValInternal(y); > } > return; > } >@@ -100,7 +82,7 @@ void SVGFEMorphologyElement::parseAttribute(const QualifiedName& name, const Ato > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFEMorphologyElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFEMorphologyElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FEMorphology* morphology = static_cast<FEMorphology*>(effect); > if (attrName == SVGNames::operatorAttr) >@@ -133,7 +115,7 @@ void SVGFEMorphologyElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEMorphologyElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > float xRadius = radiusX(); >diff --git a/Source/WebCore/svg/SVGFEMorphologyElement.h b/Source/WebCore/svg/SVGFEMorphologyElement.h >index af6f15e8f73..aeaa5caf46e 100644 >--- a/Source/WebCore/svg/SVGFEMorphologyElement.h >+++ b/Source/WebCore/svg/SVGFEMorphologyElement.h >@@ -21,8 +21,6 @@ > #pragma once > > #include "FEMorphology.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedNumber.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -63,39 +61,33 @@ public: > > void setRadius(float radiusX, float radiusY); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- MorphologyOperatorType svgOperator() const { return m_svgOperator.currentValue(attributeOwnerProxy()); } >- float radiusX() const { return m_radiusX.currentValue(attributeOwnerProxy()); } >- float radiusY() const { return m_radiusY.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ MorphologyOperatorType svgOperator() const { return m_svgOperator->currentValue<MorphologyOperatorType>(); } >+ float radiusX() const { return m_radiusX->currentValue(); } >+ float radiusY() const { return m_radiusY->currentValue(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> svgOperatorAnimated() { return m_svgOperator.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> radiusXAnimated() { return m_radiusX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> radiusYAnimated() { return m_radiusY.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedEnumeration>& svgOperator() { return m_svgOperator; } >+ Ref<SVGAnimatedNumber>& radiusX() { return m_radiusX; } >+ Ref<SVGAnimatedNumber>& radiusY() { return m_radiusY; } > > private: > SVGFEMorphologyElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEMorphologyElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEMorphologyElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- static const AtomicString& radiusXIdentifier(); >- static const AtomicString& radiusYIdentifier(); >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedEnumerationAttribute<MorphologyOperatorType> m_svgOperator { FEMORPHOLOGY_OPERATOR_ERODE }; >- SVGAnimatedNumberAttribute m_radiusX; >- SVGAnimatedNumberAttribute m_radiusY; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_svgOperator { SVGAnimatedEnumeration::create(this, FEMORPHOLOGY_OPERATOR_ERODE) }; >+ Ref<SVGAnimatedNumber> m_radiusX { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_radiusY { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFEOffsetElement.cpp b/Source/WebCore/svg/SVGFEOffsetElement.cpp >index 28236984f41..54bb1414658 100644 >--- a/Source/WebCore/svg/SVGFEOffsetElement.cpp >+++ b/Source/WebCore/svg/SVGFEOffsetElement.cpp >@@ -36,7 +36,13 @@ inline SVGFEOffsetElement::SVGFEOffsetElement(const QualifiedName& tagName, Docu > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feOffsetTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFEOffsetElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::dxAttr, &SVGFEOffsetElement::m_dx>(); >+ PropertyRegistry::registerProperty<SVGNames::dyAttr, &SVGFEOffsetElement::m_dy>(); >+ }); > } > > Ref<SVGFEOffsetElement> SVGFEOffsetElement::create(const QualifiedName& tagName, Document& document) >@@ -44,30 +50,20 @@ Ref<SVGFEOffsetElement> SVGFEOffsetElement::create(const QualifiedName& tagName, > return adoptRef(*new SVGFEOffsetElement(tagName, document)); > } > >-void SVGFEOffsetElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFEOffsetElement::m_in1>(); >- registry.registerAttribute<SVGNames::dxAttr, &SVGFEOffsetElement::m_dx>(); >- registry.registerAttribute<SVGNames::dyAttr, &SVGFEOffsetElement::m_dy>(); >-} >- > void SVGFEOffsetElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::dxAttr) { >- m_dx.setValue(value.toFloat()); >+ m_dx->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::dyAttr) { >- m_dy.setValue(value.toFloat()); >+ m_dy->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > >@@ -76,7 +72,7 @@ void SVGFEOffsetElement::parseAttribute(const QualifiedName& name, const AtomicS > > void SVGFEOffsetElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidate(); > return; >@@ -85,7 +81,7 @@ void SVGFEOffsetElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >diff --git a/Source/WebCore/svg/SVGFEOffsetElement.h b/Source/WebCore/svg/SVGFEOffsetElement.h >index bdb0e4f0b8f..61be10f1b72 100644 >--- a/Source/WebCore/svg/SVGFEOffsetElement.h >+++ b/Source/WebCore/svg/SVGFEOffsetElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedNumber.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -31,32 +30,29 @@ class SVGFEOffsetElement final : public SVGFilterPrimitiveStandardAttributes { > public: > static Ref<SVGFEOffsetElement> create(const QualifiedName&, Document&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- float dx() const { return m_dx.currentValue(attributeOwnerProxy()); } >- float dy() const { return m_dy.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ float dx() const { return m_dx->currentValue(); } >+ float dy() const { return m_dy->currentValue(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> dxAnimated() { return m_dx.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> dyAnimated() { return m_dy.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedNumber>& dx() { return m_dx; } >+ Ref<SVGAnimatedNumber>& dy() { return m_dy; } > > private: > SVGFEOffsetElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFEOffsetElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFEOffsetElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedNumberAttribute m_dx; >- SVGAnimatedNumberAttribute m_dy; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedNumber> m_dx { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_dy { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFESpecularLightingElement.cpp b/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >index 3a2f4d23f97..9ed808bd98a 100644 >--- a/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >+++ b/Source/WebCore/svg/SVGFESpecularLightingElement.cpp >@@ -39,7 +39,15 @@ inline SVGFESpecularLightingElement::SVGFESpecularLightingElement(const Qualifie > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feSpecularLightingTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFESpecularLightingElement::m_in1>(); >+ PropertyRegistry::registerProperty<SVGNames::specularConstantAttr, &SVGFESpecularLightingElement::m_specularConstant>(); >+ PropertyRegistry::registerProperty<SVGNames::specularExponentAttr, &SVGFESpecularLightingElement::m_specularExponent>(); >+ PropertyRegistry::registerProperty<SVGNames::surfaceScaleAttr, &SVGFESpecularLightingElement::m_surfaceScale>(); >+ PropertyRegistry::registerProperty<SVGNames::kernelUnitLengthAttr, &SVGFESpecularLightingElement::m_kernelUnitLengthX, &SVGFESpecularLightingElement::m_kernelUnitLengthY>(); >+ }); > } > > Ref<SVGFESpecularLightingElement> SVGFESpecularLightingElement::create(const QualifiedName& tagName, Document& document) >@@ -47,59 +55,33 @@ Ref<SVGFESpecularLightingElement> SVGFESpecularLightingElement::create(const Qua > return adoptRef(*new SVGFESpecularLightingElement(tagName, document)); > } > >-const AtomicString& SVGFESpecularLightingElement::kernelUnitLengthXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFESpecularLightingElement::kernelUnitLengthYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGKernelUnitLengthY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-void SVGFESpecularLightingElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFESpecularLightingElement::m_in1>(); >- registry.registerAttribute<SVGNames::specularConstantAttr, &SVGFESpecularLightingElement::m_specularConstant>(); >- registry.registerAttribute<SVGNames::specularExponentAttr, &SVGFESpecularLightingElement::m_specularExponent>(); >- registry.registerAttribute<SVGNames::surfaceScaleAttr, &SVGFESpecularLightingElement::m_surfaceScale>(); >- registry.registerAttribute<SVGNames::kernelUnitLengthAttr, >- &SVGFESpecularLightingElement::kernelUnitLengthXIdentifier, &SVGFESpecularLightingElement::m_kernelUnitLengthX, >- &SVGFESpecularLightingElement::kernelUnitLengthYIdentifier, &SVGFESpecularLightingElement::m_kernelUnitLengthY>(); >-} >- > void SVGFESpecularLightingElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > > if (name == SVGNames::surfaceScaleAttr) { >- m_surfaceScale.setValue(value.toFloat()); >+ m_surfaceScale->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::specularConstantAttr) { >- m_specularConstant.setValue(value.toFloat()); >+ m_specularConstant->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::specularExponentAttr) { >- m_specularExponent.setValue(value.toFloat()); >+ m_specularExponent->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::kernelUnitLengthAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y)) { >- m_kernelUnitLengthX.setValue(x); >- m_kernelUnitLengthY.setValue(y); >+ m_kernelUnitLengthX->setBaseValInternal(x); >+ m_kernelUnitLengthY->setBaseValInternal(y); > } > return; > } >@@ -107,7 +89,7 @@ void SVGFESpecularLightingElement::parseAttribute(const QualifiedName& name, con > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFESpecularLightingElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFESpecularLightingElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FESpecularLighting* specularLighting = static_cast<FESpecularLighting*>(effect); > >@@ -179,7 +161,7 @@ void SVGFESpecularLightingElement::lightElementAttributeChanged(const SVGFELight > primitiveAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >diff --git a/Source/WebCore/svg/SVGFESpecularLightingElement.h b/Source/WebCore/svg/SVGFESpecularLightingElement.h >index 7cedaf8599b..0482f0436f6 100644 >--- a/Source/WebCore/svg/SVGFESpecularLightingElement.h >+++ b/Source/WebCore/svg/SVGFESpecularLightingElement.h >@@ -23,7 +23,6 @@ > #pragma once > > #include "FESpecularLighting.h" >-#include "SVGAnimatedNumber.h" > #include "SVGFELightElement.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > >@@ -35,45 +34,39 @@ public: > static Ref<SVGFESpecularLightingElement> create(const QualifiedName&, Document&); > void lightElementAttributeChanged(const SVGFELightElement*, const QualifiedName&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- float specularConstant() const { return m_specularConstant.currentValue(attributeOwnerProxy()); } >- float specularExponent() const { return m_specularExponent.currentValue(attributeOwnerProxy()); } >- float surfaceScale() const { return m_surfaceScale.currentValue(attributeOwnerProxy()); } >- float kernelUnitLengthX() const { return m_kernelUnitLengthX.currentValue(attributeOwnerProxy()); } >- float kernelUnitLengthY() const { return m_kernelUnitLengthY.currentValue(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ float specularConstant() const { return m_specularConstant->currentValue(); } >+ float specularExponent() const { return m_specularExponent->currentValue(); } >+ float surfaceScale() const { return m_surfaceScale->currentValue(); } >+ float kernelUnitLengthX() const { return m_kernelUnitLengthX->currentValue(); } >+ float kernelUnitLengthY() const { return m_kernelUnitLengthY->currentValue(); } > >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> specularConstantAnimated() { return m_specularConstant.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> specularExponentAnimated() { return m_specularExponent.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> surfaceScaleAnimated() { return m_surfaceScale.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> kernelUnitLengthXAnimated() { return m_kernelUnitLengthX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> kernelUnitLengthYAnimated() { return m_kernelUnitLengthY.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } >+ Ref<SVGAnimatedNumber>& specularConstant() { return m_specularConstant; } >+ Ref<SVGAnimatedNumber>& specularExponent() { return m_specularExponent; } >+ Ref<SVGAnimatedNumber>& surfaceScale() { return m_surfaceScale; } >+ Ref<SVGAnimatedNumber>& kernelUnitLengthX() { return m_kernelUnitLengthX; } >+ Ref<SVGAnimatedNumber>& kernelUnitLengthY() { return m_kernelUnitLengthY; } > > private: > SVGFESpecularLightingElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFESpecularLightingElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFESpecularLightingElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- static const AtomicString& kernelUnitLengthXIdentifier(); >- static const AtomicString& kernelUnitLengthYIdentifier(); >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >- SVGAnimatedNumberAttribute m_specularConstant { 1 }; >- SVGAnimatedNumberAttribute m_specularExponent { 1 }; >- SVGAnimatedNumberAttribute m_surfaceScale { 1 }; >- SVGAnimatedNumberAttribute m_kernelUnitLengthX; >- SVGAnimatedNumberAttribute m_kernelUnitLengthY; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; >+ Ref<SVGAnimatedNumber> m_specularConstant { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_specularExponent { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_surfaceScale { SVGAnimatedNumber::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_kernelUnitLengthX { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_kernelUnitLengthY { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFETileElement.cpp b/Source/WebCore/svg/SVGFETileElement.cpp >index 3f3879d7e66..2fb5029cd90 100644 >--- a/Source/WebCore/svg/SVGFETileElement.cpp >+++ b/Source/WebCore/svg/SVGFETileElement.cpp >@@ -37,7 +37,11 @@ inline SVGFETileElement::SVGFETileElement(const QualifiedName& tagName, Document > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feTileTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::inAttr, &SVGFETileElement::m_in1>(); >+ }); > } > > Ref<SVGFETileElement> SVGFETileElement::create(const QualifiedName& tagName, Document& document) >@@ -45,18 +49,10 @@ Ref<SVGFETileElement> SVGFETileElement::create(const QualifiedName& tagName, Doc > return adoptRef(*new SVGFETileElement(tagName, document)); > } > >-void SVGFETileElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::inAttr, &SVGFETileElement::m_in1>(); >-} >- > void SVGFETileElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::inAttr) { >- m_in1.setValue(value); >+ m_in1->setBaseValInternal(value); > return; > } > >@@ -74,7 +70,7 @@ void SVGFETileElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) >+RefPtr<FilterEffect> SVGFETileElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) const > { > auto input1 = filterBuilder->getEffectById(in1()); > >diff --git a/Source/WebCore/svg/SVGFETileElement.h b/Source/WebCore/svg/SVGFETileElement.h >index 754df40991e..5ebe246699b 100644 >--- a/Source/WebCore/svg/SVGFETileElement.h >+++ b/Source/WebCore/svg/SVGFETileElement.h >@@ -30,25 +30,22 @@ class SVGFETileElement final : public SVGFilterPrimitiveStandardAttributes { > public: > static Ref<SVGFETileElement> create(const QualifiedName&, Document&); > >- String in1() const { return m_in1.currentValue(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> in1Animated() { return m_in1.animatedProperty(attributeOwnerProxy()); } >+ String in1() const { return m_in1->currentValue(); } >+ Ref<SVGAnimatedString>& in1() { return m_in1; } > > private: > SVGFETileElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFETileElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFETileElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedStringAttribute m_in1; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_in1 { SVGAnimatedString::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFETurbulenceElement.cpp b/Source/WebCore/svg/SVGFETurbulenceElement.cpp >index 6b76b847935..3f08d45c103 100644 >--- a/Source/WebCore/svg/SVGFETurbulenceElement.cpp >+++ b/Source/WebCore/svg/SVGFETurbulenceElement.cpp >@@ -34,7 +34,15 @@ inline SVGFETurbulenceElement::SVGFETurbulenceElement(const QualifiedName& tagNa > : SVGFilterPrimitiveStandardAttributes(tagName, document) > { > ASSERT(hasTagName(SVGNames::feTurbulenceTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::baseFrequencyAttr, &SVGFETurbulenceElement::m_baseFrequencyX, &SVGFETurbulenceElement::m_baseFrequencyY>(); >+ PropertyRegistry::registerProperty<SVGNames::numOctavesAttr, &SVGFETurbulenceElement::m_numOctaves>(); >+ PropertyRegistry::registerProperty<SVGNames::seedAttr, &SVGFETurbulenceElement::m_seed>(); >+ PropertyRegistry::registerProperty<SVGNames::stitchTilesAttr, SVGStitchOptions, &SVGFETurbulenceElement::m_stitchTiles>(); >+ PropertyRegistry::registerProperty<SVGNames::typeAttr, TurbulenceType, &SVGFETurbulenceElement::m_type>(); >+ }); > } > > Ref<SVGFETurbulenceElement> SVGFETurbulenceElement::create(const QualifiedName& tagName, Document& document) >@@ -42,71 +50,45 @@ Ref<SVGFETurbulenceElement> SVGFETurbulenceElement::create(const QualifiedName& > return adoptRef(*new SVGFETurbulenceElement(tagName, document)); > } > >-const AtomicString& SVGFETurbulenceElement::baseFrequencyXIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGBaseFrequencyX", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGFETurbulenceElement::baseFrequencyYIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGBaseFrequencyY", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-void SVGFETurbulenceElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::baseFrequencyAttr, >- &SVGFETurbulenceElement::baseFrequencyXIdentifier, &SVGFETurbulenceElement::m_baseFrequencyX, >- &SVGFETurbulenceElement::baseFrequencyYIdentifier, &SVGFETurbulenceElement::m_baseFrequencyY>(); >- registry.registerAttribute<SVGNames::numOctavesAttr, &SVGFETurbulenceElement::m_numOctaves>(); >- registry.registerAttribute<SVGNames::seedAttr, &SVGFETurbulenceElement::m_seed>(); >- registry.registerAttribute<SVGNames::stitchTilesAttr, SVGStitchOptions, &SVGFETurbulenceElement::m_stitchTiles>(); >- registry.registerAttribute<SVGNames::typeAttr, TurbulenceType, &SVGFETurbulenceElement::m_type>(); >-} >- > void SVGFETurbulenceElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::typeAttr) { > TurbulenceType propertyValue = SVGPropertyTraits<TurbulenceType>::fromString(value); > if (propertyValue != TurbulenceType::Unknown) >- m_type.setValue(propertyValue); >+ m_type->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::stitchTilesAttr) { > SVGStitchOptions propertyValue = SVGPropertyTraits<SVGStitchOptions>::fromString(value); > if (propertyValue > 0) >- m_stitchTiles.setValue(propertyValue); >+ m_stitchTiles->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::baseFrequencyAttr) { > float x, y; > if (parseNumberOptionalNumber(value, x, y)) { >- m_baseFrequencyX.setValue(x); >- m_baseFrequencyY.setValue(y); >+ m_baseFrequencyX->setBaseValInternal(x); >+ m_baseFrequencyY->setBaseValInternal(y); > } > return; > } > > if (name == SVGNames::seedAttr) { >- m_seed.setValue(value.toFloat()); >+ m_seed->setBaseValInternal(value.toFloat()); > return; > } > > if (name == SVGNames::numOctavesAttr) { >- m_numOctaves.setValue(value.string().toUIntStrict()); >+ m_numOctaves->setBaseValInternal(value.string().toUIntStrict()); > return; > } > > SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); > } > >-bool SVGFETurbulenceElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) >+bool SVGFETurbulenceElement::setFilterEffectAttribute(FilterEffect* effect, const QualifiedName& attrName) const > { > FETurbulence* turbulence = static_cast<FETurbulence*>(effect); > if (attrName == SVGNames::typeAttr) >@@ -126,7 +108,7 @@ bool SVGFETurbulenceElement::setFilterEffectAttribute(FilterEffect* effect, cons > > void SVGFETurbulenceElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > primitiveAttributeChanged(attrName); > return; >@@ -135,7 +117,7 @@ void SVGFETurbulenceElement::svgAttributeChanged(const QualifiedName& attrName) > SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); > } > >-RefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter& filter) >+RefPtr<FilterEffect> SVGFETurbulenceElement::build(SVGFilterBuilder*, Filter& filter) const > { > if (baseFrequencyX() < 0 || baseFrequencyY() < 0) > return nullptr; >diff --git a/Source/WebCore/svg/SVGFETurbulenceElement.h b/Source/WebCore/svg/SVGFETurbulenceElement.h >index a0f5488d600..04db763786c 100644 >--- a/Source/WebCore/svg/SVGFETurbulenceElement.h >+++ b/Source/WebCore/svg/SVGFETurbulenceElement.h >@@ -22,9 +22,6 @@ > #pragma once > > #include "FETurbulence.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedInteger.h" >-#include "SVGAnimatedNumber.h" > #include "SVGFilterPrimitiveStandardAttributes.h" > > namespace WebCore { >@@ -98,45 +95,39 @@ class SVGFETurbulenceElement final : public SVGFilterPrimitiveStandardAttributes > public: > static Ref<SVGFETurbulenceElement> create(const QualifiedName&, Document&); > >- float baseFrequencyX() const { return m_baseFrequencyX.currentValue(attributeOwnerProxy()); } >- float baseFrequencyY() const { return m_baseFrequencyY.currentValue(attributeOwnerProxy()); } >- int numOctaves() const { return m_numOctaves.currentValue(attributeOwnerProxy()); } >- float seed() const { return m_seed.currentValue(attributeOwnerProxy()); } >- SVGStitchOptions stitchTiles() const { return m_stitchTiles.currentValue(attributeOwnerProxy()); } >- TurbulenceType type() const { return m_type.currentValue(attributeOwnerProxy()); } >+ float baseFrequencyX() const { return m_baseFrequencyX->currentValue(); } >+ float baseFrequencyY() const { return m_baseFrequencyY->currentValue(); } >+ int numOctaves() const { return m_numOctaves->currentValue(); } >+ float seed() const { return m_seed->currentValue(); } >+ SVGStitchOptions stitchTiles() const { return m_stitchTiles->currentValue<SVGStitchOptions>(); } >+ TurbulenceType type() const { return m_type->currentValue<TurbulenceType>(); } > >- RefPtr<SVGAnimatedNumber> baseFrequencyXAnimated() { return m_baseFrequencyX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> baseFrequencyYAnimated() { return m_baseFrequencyY.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedInteger> numOctavesAnimated() { return m_numOctaves.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> seedAnimated() { return m_seed.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> stitchTilesAnimated() { return m_stitchTiles.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> typeAnimated() { return m_type.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedNumber>& baseFrequencyX() { return m_baseFrequencyX; } >+ Ref<SVGAnimatedNumber>& baseFrequencyY() { return m_baseFrequencyY; } >+ Ref<SVGAnimatedInteger>& numOctaves() { return m_numOctaves; } >+ Ref<SVGAnimatedNumber>& seed() { return m_seed; } >+ Ref<SVGAnimatedEnumeration>& stitchTiles() { return m_stitchTiles; } >+ Ref<SVGAnimatedEnumeration>& type() { return m_type; } > > private: > SVGFETurbulenceElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFETurbulenceElement, SVGFilterPrimitiveStandardAttributes>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFETurbulenceElement, SVGFilterPrimitiveStandardAttributes>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >- bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) override; >- RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) override; >+ bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName) const override; >+ RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const override; > >- static const AtomicString& baseFrequencyXIdentifier(); >- static const AtomicString& baseFrequencyYIdentifier(); >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedNumberAttribute m_baseFrequencyX; >- SVGAnimatedNumberAttribute m_baseFrequencyY; >- SVGAnimatedIntegerAttribute m_numOctaves { 1 }; >- SVGAnimatedNumberAttribute m_seed; >- SVGAnimatedEnumerationAttribute<SVGStitchOptions> m_stitchTiles { SVG_STITCHTYPE_NOSTITCH }; >- SVGAnimatedEnumerationAttribute<TurbulenceType> m_type { TurbulenceType::Turbulence }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedNumber> m_baseFrequencyX { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedNumber> m_baseFrequencyY { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedInteger> m_numOctaves { SVGAnimatedInteger::create(this, 1) }; >+ Ref<SVGAnimatedNumber> m_seed { SVGAnimatedNumber::create(this) }; >+ Ref<SVGAnimatedEnumeration> m_stitchTiles { SVGAnimatedEnumeration::create(this, SVG_STITCHTYPE_NOSTITCH) }; >+ Ref<SVGAnimatedEnumeration> m_type { SVGAnimatedEnumeration::create(this, TurbulenceType::Turbulence) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFilterElement.cpp b/Source/WebCore/svg/SVGFilterElement.cpp >index cdeaa38df6d..a6edec432f1 100644 >--- a/Source/WebCore/svg/SVGFilterElement.cpp >+++ b/Source/WebCore/svg/SVGFilterElement.cpp >@@ -46,7 +46,16 @@ inline SVGFilterElement::SVGFilterElement(const QualifiedName& tagName, Document > // Spec: If the x/y attribute is not specified, the effect is as if a value of "-10%" were specified. > // Spec: If the width/height attribute is not specified, the effect is as if a value of "120%" were specified. > ASSERT(hasTagName(SVGNames::filterTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::filterUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGFilterElement::m_filterUnits>(); >+ PropertyRegistry::registerProperty<SVGNames::primitiveUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGFilterElement::m_primitiveUnits>(); >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGFilterElement::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGFilterElement::m_y>(); >+ PropertyRegistry::registerProperty<SVGNames::widthAttr, &SVGFilterElement::m_width>(); >+ PropertyRegistry::registerProperty<SVGNames::heightAttr, &SVGFilterElement::m_height>(); >+ }); > } > > Ref<SVGFilterElement> SVGFilterElement::create(const QualifiedName& tagName, Document& document) >@@ -54,19 +63,6 @@ Ref<SVGFilterElement> SVGFilterElement::create(const QualifiedName& tagName, Doc > return adoptRef(*new SVGFilterElement(tagName, document)); > } > >-void SVGFilterElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::filterUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGFilterElement::m_filterUnits>(); >- registry.registerAttribute<SVGNames::primitiveUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGFilterElement::m_primitiveUnits>(); >- registry.registerAttribute<SVGNames::xAttr, &SVGFilterElement::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGFilterElement::m_y>(); >- registry.registerAttribute<SVGNames::widthAttr, &SVGFilterElement::m_width>(); >- registry.registerAttribute<SVGNames::heightAttr, &SVGFilterElement::m_height>(); >-} >- > void SVGFilterElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; >@@ -74,19 +70,19 @@ void SVGFilterElement::parseAttribute(const QualifiedName& name, const AtomicStr > if (name == SVGNames::filterUnitsAttr) { > SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(value); > if (propertyValue > 0) >- m_filterUnits.setValue(propertyValue); >+ m_filterUnits->setBaseValInternal(propertyValue); > } else if (name == SVGNames::primitiveUnitsAttr) { > SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(value); > if (propertyValue > 0) >- m_primitiveUnits.setValue(propertyValue); >+ m_primitiveUnits->setBaseValInternal(propertyValue); > } else if (name == SVGNames::xAttr) >- m_x.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::yAttr) >- m_y.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::widthAttr) >- m_width.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_width->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::heightAttr) >- m_height.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_height->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > > reportAttributeParsingError(parseError, name, value); > >@@ -97,13 +93,13 @@ void SVGFilterElement::parseAttribute(const QualifiedName& name, const AtomicStr > > void SVGFilterElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isAnimatedLengthAttribute(attrName)) { >+ if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidateSVGPresentationAttributeStyle(); > return; > } > >- if (isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) { > if (auto* renderer = this->renderer()) > renderer->setNeedsLayout(); > return; >diff --git a/Source/WebCore/svg/SVGFilterElement.h b/Source/WebCore/svg/SVGFilterElement.h >index 9c2109f4361..bce982148d7 100644 >--- a/Source/WebCore/svg/SVGFilterElement.h >+++ b/Source/WebCore/svg/SVGFilterElement.h >@@ -23,9 +23,6 @@ > > #pragma once > >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedInteger.h" >-#include "SVGAnimatedLength.h" > #include "SVGElement.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGURIReference.h" >@@ -38,30 +35,26 @@ class SVGFilterElement final : public SVGElement, public SVGExternalResourcesReq > public: > static Ref<SVGFilterElement> create(const QualifiedName&, Document&); > >- SVGUnitTypes::SVGUnitType filterUnits() const { return m_filterUnits.currentValue(attributeOwnerProxy()); } >- SVGUnitTypes::SVGUnitType primitiveUnits() const { return m_primitiveUnits.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& x() const { return m_x.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); } >+ SVGUnitTypes::SVGUnitType filterUnits() const { return m_filterUnits->currentValue<SVGUnitTypes::SVGUnitType>(); } >+ SVGUnitTypes::SVGUnitType primitiveUnits() const { return m_primitiveUnits->currentValue<SVGUnitTypes::SVGUnitType>(); } >+ const SVGLengthValue& x() const { return m_x->currentValue(); } >+ const SVGLengthValue& y() const { return m_y->currentValue(); } >+ const SVGLengthValue& width() const { return m_width->currentValue(); } >+ const SVGLengthValue& height() const { return m_height->currentValue(); } > >- RefPtr<SVGAnimatedEnumeration> filterUnitsAnimated() { return m_filterUnits.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> primitiveUnitsAnimated() { return m_primitiveUnits.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedEnumeration>& filterUnits() { return m_filterUnits; } >+ Ref<SVGAnimatedEnumeration>& primitiveUnits() { return m_primitiveUnits; } >+ Ref<SVGAnimatedLength>& x() { return m_x; } >+ Ref<SVGAnimatedLength>& y() { return m_y; } >+ Ref<SVGAnimatedLength>& width() { return m_width; } >+ Ref<SVGAnimatedLength>& height() { return m_height; } > > private: > SVGFilterElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFilterElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static bool isAnimatedLengthAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isAnimatedLengthAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFilterElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > void childrenChanged(const ChildChange&) final; >@@ -73,13 +66,13 @@ private: > > bool selfHasRelativeLengths() const final { return true; } > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedEnumerationAttribute<SVGUnitTypes::SVGUnitType> m_filterUnits { SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX }; >- SVGAnimatedEnumerationAttribute<SVGUnitTypes::SVGUnitType> m_primitiveUnits { SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE }; >- SVGAnimatedLengthAttribute m_x { LengthModeWidth, "-10%" }; >- SVGAnimatedLengthAttribute m_y { LengthModeHeight, "-10%" }; >- SVGAnimatedLengthAttribute m_width { LengthModeWidth, "120%" }; >- SVGAnimatedLengthAttribute m_height { LengthModeHeight, "120%" }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedEnumeration> m_filterUnits { SVGAnimatedEnumeration::create(this, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) }; >+ Ref<SVGAnimatedEnumeration> m_primitiveUnits { SVGAnimatedEnumeration::create(this, SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) }; >+ Ref<SVGAnimatedLength> m_x { SVGAnimatedLength::create(this, LengthModeWidth, "-10%") }; >+ Ref<SVGAnimatedLength> m_y { SVGAnimatedLength::create(this, LengthModeHeight, "-10%") }; >+ Ref<SVGAnimatedLength> m_width { SVGAnimatedLength::create(this, LengthModeWidth, "120%") }; >+ Ref<SVGAnimatedLength> m_height { SVGAnimatedLength::create(this, LengthModeHeight, "120%") }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp >index 88806fb972f..9ab50619de7 100644 >--- a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp >+++ b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.cpp >@@ -36,19 +36,14 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(SVGFilterPrimitiveStandardAttributes); > SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const QualifiedName& tagName, Document& document) > : SVGElement(tagName, document) > { >- registerAttributes(); >-} >- >-void SVGFilterPrimitiveStandardAttributes::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::xAttr, &SVGFilterPrimitiveStandardAttributes::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGFilterPrimitiveStandardAttributes::m_y>(); >- registry.registerAttribute<SVGNames::widthAttr, &SVGFilterPrimitiveStandardAttributes::m_width>(); >- registry.registerAttribute<SVGNames::heightAttr, &SVGFilterPrimitiveStandardAttributes::m_height>(); >- registry.registerAttribute<SVGNames::resultAttr, &SVGFilterPrimitiveStandardAttributes::m_result>(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGFilterPrimitiveStandardAttributes::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGFilterPrimitiveStandardAttributes::m_y>(); >+ PropertyRegistry::registerProperty<SVGNames::widthAttr, &SVGFilterPrimitiveStandardAttributes::m_width>(); >+ PropertyRegistry::registerProperty<SVGNames::heightAttr, &SVGFilterPrimitiveStandardAttributes::m_height>(); >+ PropertyRegistry::registerProperty<SVGNames::resultAttr, &SVGFilterPrimitiveStandardAttributes::m_result>(); >+ }); > } > > void SVGFilterPrimitiveStandardAttributes::parseAttribute(const QualifiedName& name, const AtomicString& value) >@@ -56,22 +51,22 @@ void SVGFilterPrimitiveStandardAttributes::parseAttribute(const QualifiedName& n > SVGParsingError parseError = NoError; > > if (name == SVGNames::xAttr) >- m_x.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::yAttr) >- m_y.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::widthAttr) >- m_width.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_width->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::heightAttr) >- m_height.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_height->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::resultAttr) >- m_result.setValue(value); >+ m_result->setBaseValInternal(value); > > reportAttributeParsingError(parseError, name, value); > > SVGElement::parseAttribute(name, value); > } > >-bool SVGFilterPrimitiveStandardAttributes::setFilterEffectAttribute(FilterEffect*, const QualifiedName&) >+bool SVGFilterPrimitiveStandardAttributes::setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const > { > // When all filters support this method, it will be changed to a pure virtual method. > ASSERT_NOT_REACHED(); >@@ -80,7 +75,7 @@ bool SVGFilterPrimitiveStandardAttributes::setFilterEffectAttribute(FilterEffect > > void SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidate(); > return; >diff --git a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h >index e0946f552ea..ffc88b26bda 100644 >--- a/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h >+++ b/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h >@@ -23,8 +23,6 @@ > > #include "RenderSVGResourceFilter.h" > #include "RenderSVGResourceFilterPrimitive.h" >-#include "SVGAnimatedLength.h" >-#include "SVGAnimatedString.h" > #include "SVGElement.h" > #include "SVGNames.h" > #include <wtf/RefPtr.h> >@@ -40,24 +38,23 @@ class SVGFilterPrimitiveStandardAttributes : public SVGElement { > public: > void setStandardAttributes(FilterEffect*) const; > >- virtual RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) = 0; >+ virtual RefPtr<FilterEffect> build(SVGFilterBuilder*, Filter&) const = 0; > // Returns true, if the new value is different from the old one. >- virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&); >+ virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&) const; > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFilterPrimitiveStandardAttributes, SVGElement>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFilterPrimitiveStandardAttributes, SVGElement>; > >- const SVGLengthValue& x() const { return m_x.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); } >- const String& result() const { return m_result.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& x() const { return m_x->currentValue(); } >+ const SVGLengthValue& y() const { return m_y->currentValue(); } >+ const SVGLengthValue& width() const { return m_width->currentValue(); } >+ const SVGLengthValue& height() const { return m_height->currentValue(); } >+ String result() const { return m_result->currentValue(); } > >- RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedString> resultAnimated() { return m_result.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& x() { return m_x; } >+ Ref<SVGAnimatedLength>& y() { return m_y; } >+ Ref<SVGAnimatedLength>& width() { return m_width; } >+ Ref<SVGAnimatedLength>& height() { return m_height; } >+ Ref<SVGAnimatedString>& result() { return m_result; } > > protected: > SVGFilterPrimitiveStandardAttributes(const QualifiedName&, Document&); >@@ -70,26 +67,22 @@ protected: > void primitiveAttributeChanged(const QualifiedName& attributeName); > > private: >- static void registerAttributes(); >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- > bool isFilterEffect() const override { return true; } > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; > bool rendererIsNeeded(const RenderStyle&) override; > bool childShouldCreateRenderer(const Node&) const override { return false; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; } >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; } > > // Spec: If the x/y attribute is not specified, the effect is as if a value of "0%" were specified. > // Spec: If the width/height attribute is not specified, the effect is as if a value of "100%" were specified. >- SVGAnimatedLengthAttribute m_x { LengthModeWidth, "0%" }; >- SVGAnimatedLengthAttribute m_y { LengthModeHeight, "0%" }; >- SVGAnimatedLengthAttribute m_width { LengthModeWidth, "100%" }; >- SVGAnimatedLengthAttribute m_height { LengthModeHeight, "100%" }; >- SVGAnimatedStringAttribute m_result; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_x { SVGAnimatedLength::create(this, LengthModeWidth, "0%") }; >+ Ref<SVGAnimatedLength> m_y { SVGAnimatedLength::create(this, LengthModeHeight, "0%") }; >+ Ref<SVGAnimatedLength> m_width { SVGAnimatedLength::create(this, LengthModeWidth, "100%") }; >+ Ref<SVGAnimatedLength> m_height { SVGAnimatedLength::create(this, LengthModeHeight, "100%") }; >+ Ref<SVGAnimatedString> m_result { SVGAnimatedString::create(this) }; > }; > > void invalidateFilterPrimitiveParent(SVGElement*); >diff --git a/Source/WebCore/svg/SVGFitToViewBox.cpp b/Source/WebCore/svg/SVGFitToViewBox.cpp >index b769e5b0ccf..d15e3546c12 100644 >--- a/Source/WebCore/svg/SVGFitToViewBox.cpp >+++ b/Source/WebCore/svg/SVGFitToViewBox.cpp >@@ -34,30 +34,26 @@ > > namespace WebCore { > >-SVGFitToViewBox::SVGFitToViewBox(SVGElement* contextElement, AnimatedPropertyState animatedState) >- : m_attributeOwnerProxy(*this, *contextElement, animatedState) >+SVGFitToViewBox::SVGFitToViewBox(SVGElement* contextElement, SVGPropertyAccess access) >+ : m_viewBox(SVGAnimatedRect::create(contextElement, access)) >+ , m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(contextElement, access)) > { >- registerAttributes(); >-} >- >-void SVGFitToViewBox::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::viewBoxAttr, &SVGFitToViewBox::m_viewBox>(); >- registry.registerAttribute<SVGNames::preserveAspectRatioAttr, &SVGFitToViewBox::m_preserveAspectRatio>(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::viewBoxAttr, &SVGFitToViewBox::m_viewBox>(); >+ PropertyRegistry::registerProperty<SVGNames::preserveAspectRatioAttr, &SVGFitToViewBox::m_preserveAspectRatio>(); >+ }); > } > > void SVGFitToViewBox::setViewBox(const FloatRect& viewBox) > { >- m_viewBox.setValue(viewBox); >+ m_viewBox->setBaseValInternal(viewBox); > m_isViewBoxValid = true; > } > > void SVGFitToViewBox::resetViewBox() > { >- m_viewBox.resetValue(); >+ m_viewBox->setBaseValInternal({ }); > m_isViewBoxValid = false; > } > >@@ -108,7 +104,7 @@ bool SVGFitToViewBox::parseViewBox(const UChar*& c, const UChar* end, FloatRect& > bool valid = parseNumber(c, end, x) && parseNumber(c, end, y) && parseNumber(c, end, width) && parseNumber(c, end, height, false); > > if (validate) { >- Document& document = m_attributeOwnerProxy.element().document(); >+ Document& document = m_viewBox->contextElement()->document(); > > if (!valid) { > document.accessSVGExtensions().reportWarning("Problem parsing viewBox=\"" + str + "\""); >diff --git a/Source/WebCore/svg/SVGFitToViewBox.h b/Source/WebCore/svg/SVGFitToViewBox.h >index f51a7e9cada..a4bdd8f31af 100644 >--- a/Source/WebCore/svg/SVGFitToViewBox.h >+++ b/Source/WebCore/svg/SVGFitToViewBox.h >@@ -23,9 +23,9 @@ > > #include "FloatRect.h" > #include "QualifiedName.h" >-#include "SVGAttributeRegistry.h" > #include "SVGNames.h" > #include "SVGPreserveAspectRatio.h" >+#include "SVGPropertyOwnerRegistry.h" > #include <wtf/HashSet.h> > > namespace WebCore { >@@ -37,31 +37,30 @@ class SVGFitToViewBox { > public: > static AffineTransform viewBoxToViewTransform(const FloatRect& viewBoxRect, const SVGPreserveAspectRatioValue&, float viewWidth, float viewHeight); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFitToViewBox>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFitToViewBox>; > >- const FloatRect& viewBox() const { return m_viewBox.currentValue(m_attributeOwnerProxy); } >- const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio.currentValue(m_attributeOwnerProxy); } >+ const FloatRect& viewBox() const { return m_viewBox->currentValue(); } >+ const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio->currentValue(); } > >- RefPtr<SVGAnimatedRect> viewBoxAnimated() { return m_viewBox.animatedProperty(m_attributeOwnerProxy); } >- RefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatioAnimated() { return m_preserveAspectRatio.animatedProperty(m_attributeOwnerProxy); } >+ Ref<SVGAnimatedRect>& viewBox() { return m_viewBox; } >+ Ref<SVGAnimatedPreserveAspectRatio>& preserveAspectRatio() { return m_preserveAspectRatio; } > > void setViewBox(const FloatRect&); > void resetViewBox(); > >- void setPreserveAspectRatio(const SVGPreserveAspectRatioValue& preserveAspectRatio) { m_preserveAspectRatio.setValue(preserveAspectRatio); } >- void resetPreserveAspectRatio() { m_preserveAspectRatio.resetValue(); } >+ void setPreserveAspectRatio(const SVGPreserveAspectRatioValue& preserveAspectRatio) { m_preserveAspectRatio->baseVal()->setValue(preserveAspectRatio); } >+ void resetPreserveAspectRatio() { m_preserveAspectRatio->baseVal()->setValue({ }); } > >- String viewBoxString() const { return m_viewBox.toString(); } >- String preserveAspectRatioString() const { return m_preserveAspectRatio.toString(); } >+ String viewBoxString() const { return SVGPropertyTraits<FloatRect>::toString(viewBox()); } >+ String preserveAspectRatioString() const { return preserveAspectRatio().valueAsString(); } > > bool hasValidViewBox() const { return m_isViewBoxValid; } > bool hasEmptyViewBox() const { return m_isViewBoxValid && viewBox().isEmpty(); } > > protected: >- SVGFitToViewBox(SVGElement* contextElement, AnimatedPropertyState = PropertyIsReadWrite); >+ SVGFitToViewBox(SVGElement* contextElement, SVGPropertyAccess = SVGPropertyAccess::ReadWrite); > >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >+ static bool isKnownAttribute(const QualifiedName& attributeName) { return PropertyRegistry::isKnownAttribute(attributeName); } > > void reset(); > bool parseAttribute(const QualifiedName&, const AtomicString&); >@@ -69,11 +68,9 @@ protected: > bool parseViewBox(const UChar*& start, const UChar* end, FloatRect& viewBox, bool validate = true); > > private: >- static void registerAttributes(); >- >- AttributeOwnerProxy m_attributeOwnerProxy; >- SVGAnimatedRectAttribute m_viewBox; >- SVGAnimatedPreserveAspectRatioAttribute m_preserveAspectRatio; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedRect> m_viewBox; >+ Ref<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio; > bool m_isViewBoxValid { false }; > }; > >diff --git a/Source/WebCore/svg/SVGFontElement.h b/Source/WebCore/svg/SVGFontElement.h >index 82a432abf2f..408cbeef233 100644 >--- a/Source/WebCore/svg/SVGFontElement.h >+++ b/Source/WebCore/svg/SVGFontElement.h >@@ -24,7 +24,6 @@ > > #if ENABLE(SVG_FONTS) > >-#include "SVGAnimatedBoolean.h" > #include "SVGElement.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGParserUtilities.h" >@@ -53,10 +52,10 @@ private: > > bool rendererIsNeeded(const RenderStyle&) final { return false; } > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGFontElement, SVGElement, SVGExternalResourcesRequired>; >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGFontElement, SVGElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGForeignObjectElement.cpp b/Source/WebCore/svg/SVGForeignObjectElement.cpp >index 006a77311a8..8ca29f33354 100644 >--- a/Source/WebCore/svg/SVGForeignObjectElement.cpp >+++ b/Source/WebCore/svg/SVGForeignObjectElement.cpp >@@ -40,7 +40,14 @@ inline SVGForeignObjectElement::SVGForeignObjectElement(const QualifiedName& tag > , SVGExternalResourcesRequired(this) > { > ASSERT(hasTagName(SVGNames::foreignObjectTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGForeignObjectElement::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGForeignObjectElement::m_y>(); >+ PropertyRegistry::registerProperty<SVGNames::widthAttr, &SVGForeignObjectElement::m_width>(); >+ PropertyRegistry::registerProperty<SVGNames::heightAttr, &SVGForeignObjectElement::m_height>(); >+ }); > } > > Ref<SVGForeignObjectElement> SVGForeignObjectElement::create(const QualifiedName& tagName, Document& document) >@@ -48,29 +55,18 @@ Ref<SVGForeignObjectElement> SVGForeignObjectElement::create(const QualifiedName > return adoptRef(*new SVGForeignObjectElement(tagName, document)); > } > >-void SVGForeignObjectElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::xAttr, &SVGForeignObjectElement::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGForeignObjectElement::m_y>(); >- registry.registerAttribute<SVGNames::widthAttr, &SVGForeignObjectElement::m_width>(); >- registry.registerAttribute<SVGNames::heightAttr, &SVGForeignObjectElement::m_height>(); >-} >- > void SVGForeignObjectElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; > > if (name == SVGNames::xAttr) >- m_x.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::yAttr) >- m_y.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::widthAttr) >- m_width.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_width->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::heightAttr) >- m_height.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_height->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > > reportAttributeParsingError(parseError, name, value); > >diff --git a/Source/WebCore/svg/SVGForeignObjectElement.h b/Source/WebCore/svg/SVGForeignObjectElement.h >index 306e1170ef9..971a86cb9fc 100644 >--- a/Source/WebCore/svg/SVGForeignObjectElement.h >+++ b/Source/WebCore/svg/SVGForeignObjectElement.h >@@ -19,8 +19,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedLength.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGraphicsElement.h" > #include "SVGNames.h" >@@ -33,25 +31,22 @@ class SVGForeignObjectElement final : public SVGGraphicsElement, public SVGExter > public: > static Ref<SVGForeignObjectElement> create(const QualifiedName&, Document&); > >- const SVGLengthValue& x() const { return m_x.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& x() const { return m_x->currentValue(); } >+ const SVGLengthValue& y() const { return m_y->currentValue(); } >+ const SVGLengthValue& width() const { return m_width->currentValue(); } >+ const SVGLengthValue& height() const { return m_height->currentValue(); } > >- RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& x() { return m_x; } >+ Ref<SVGAnimatedLength>& y() { return m_y; } >+ Ref<SVGAnimatedLength>& width() { return m_width; } >+ Ref<SVGAnimatedLength>& height() { return m_height; } > > private: > SVGForeignObjectElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGForeignObjectElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGForeignObjectElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -62,11 +57,11 @@ private: > bool isValid() const final { return SVGTests::isValid(); } > bool selfHasRelativeLengths() const final { return true; } > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_x { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_y { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_width { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_height { LengthModeHeight }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_x { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_y { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_width { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_height { SVGAnimatedLength::create(this, LengthModeHeight) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGGElement.h b/Source/WebCore/svg/SVGGElement.h >index ba3acc3c62e..42d6c3f2cd8 100644 >--- a/Source/WebCore/svg/SVGGElement.h >+++ b/Source/WebCore/svg/SVGGElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGraphicsElement.h" > >@@ -38,16 +37,16 @@ private: > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGGElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > > bool isValid() const final { return SVGTests::isValid(); } > bool rendererIsNeeded(const RenderStyle&) final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGGeometryElement.cpp b/Source/WebCore/svg/SVGGeometryElement.cpp >index 72dd3f13598..bdd7a02754a 100644 >--- a/Source/WebCore/svg/SVGGeometryElement.cpp >+++ b/Source/WebCore/svg/SVGGeometryElement.cpp >@@ -24,6 +24,8 @@ > #include "SVGGeometryElement.h" > > #include "DOMPoint.h" >+#include "RenderSVGResource.h" >+#include "RenderSVGShape.h" > #include "SVGDocumentExtensions.h" > #include "SVGPathUtilities.h" > #include "SVGPoint.h" >@@ -36,7 +38,10 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(SVGGeometryElement); > SVGGeometryElement::SVGGeometryElement(const QualifiedName& tagName, Document& document) > : SVGGraphicsElement(tagName, document) > { >- registerAttributes(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::pathLengthAttr, &SVGGeometryElement::m_pathLength>(); >+ }); > } > > float SVGGeometryElement::getTotalLength() const >@@ -87,19 +92,11 @@ bool SVGGeometryElement::isPointInStroke(DOMPointInit&& pointInit) > return renderer->isPointInStroke(point); > } > >-void SVGGeometryElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::pathLengthAttr, &SVGGeometryElement::m_pathLength>(); >-} >- > void SVGGeometryElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::pathLengthAttr) { >- m_pathLength.setValue(value.toFloat()); >- if (m_pathLength.value() < 0) >+ m_pathLength->setBaseValInternal(value.toFloat()); >+ if (m_pathLength->baseVal() < 0) > document().accessSVGExtensions().reportError("A negative value for path attribute <pathLength> is not allowed"); > return; > } >diff --git a/Source/WebCore/svg/SVGGeometryElement.h b/Source/WebCore/svg/SVGGeometryElement.h >index 824fefc50fb..f12e1f3ef26 100644 >--- a/Source/WebCore/svg/SVGGeometryElement.h >+++ b/Source/WebCore/svg/SVGGeometryElement.h >@@ -23,7 +23,6 @@ > #pragma once > > #include "Path.h" >-#include "SVGAnimatedNumber.h" > #include "SVGGraphicsElement.h" > #include "SVGNames.h" > >@@ -42,10 +41,10 @@ public: > bool isPointInFill(DOMPointInit&&); > bool isPointInStroke(DOMPointInit&&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGGeometryElement, SVGGraphicsElement>; >- static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGeometryElement, SVGGraphicsElement>; > >- auto pathLengthAnimated() { return m_pathLength.animatedProperty(attributeOwnerProxy()); } >+ float pathLength() const { return m_pathLength->currentValue(); } >+ Ref<SVGAnimatedNumber>& pathLength() { return m_pathLength; } > > protected: > SVGGeometryElement(const QualifiedName&, Document&); >@@ -55,13 +54,10 @@ protected: > > private: > bool isSVGGeometryElement() const override { return true; } >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; } >+ const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; } > >- static void registerAttributes(); >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedNumberAttribute m_pathLength; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedNumber> m_pathLength { SVGAnimatedNumber::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGGlyphRefElement.h b/Source/WebCore/svg/SVGGlyphRefElement.h >index 8810d5b0926..0a2fb841d39 100644 >--- a/Source/WebCore/svg/SVGGlyphRefElement.h >+++ b/Source/WebCore/svg/SVGGlyphRefElement.h >@@ -46,8 +46,9 @@ public: > private: > SVGGlyphRefElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGGlyphRefElement, SVGElement, SVGURIReference>; >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGlyphRefElement, SVGElement, SVGURIReference>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >+ > void parseAttribute(const QualifiedName&, const AtomicString&) final; > > bool rendererIsNeeded(const RenderStyle&) final { return false; } >@@ -56,7 +57,7 @@ private: > float m_y { 0 }; > float m_dx { 0 }; > float m_dy { 0 }; >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } >diff --git a/Source/WebCore/svg/SVGGradientElement.cpp b/Source/WebCore/svg/SVGGradientElement.cpp >index 8c8c2af08ff..f55b77a05a1 100644 >--- a/Source/WebCore/svg/SVGGradientElement.cpp >+++ b/Source/WebCore/svg/SVGGradientElement.cpp >@@ -24,12 +24,8 @@ > #include "SVGGradientElement.h" > > #include "ElementIterator.h" >-#include "RenderSVGHiddenContainer.h" >-#include "RenderSVGResourceLinearGradient.h" >-#include "RenderSVGResourceRadialGradient.h" > #include "SVGNames.h" > #include "SVGStopElement.h" >-#include "SVGTransformListValues.h" > #include "SVGTransformable.h" > #include "StyleResolver.h" > #include <wtf/IsoMallocInlines.h> >@@ -44,17 +40,12 @@ SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, Document& d > , SVGExternalResourcesRequired(this) > , SVGURIReference(this) > { >- registerAttributes(); >-} >- >-void SVGGradientElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::spreadMethodAttr, SVGSpreadMethodType, &SVGGradientElement::m_spreadMethod>(); >- registry.registerAttribute<SVGNames::gradientUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGGradientElement::m_gradientUnits>(); >- registry.registerAttribute<SVGNames::gradientTransformAttr, &SVGGradientElement::m_gradientTransform>(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::spreadMethodAttr, SVGSpreadMethodType, &SVGGradientElement::m_spreadMethod>(); >+ PropertyRegistry::registerProperty<SVGNames::gradientUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGGradientElement::m_gradientUnits>(); >+ PropertyRegistry::registerProperty<SVGNames::gradientTransformAttr, &SVGGradientElement::m_gradientTransform>(); >+ }); > } > > void SVGGradientElement::parseAttribute(const QualifiedName& name, const AtomicString& value) >@@ -62,22 +53,19 @@ void SVGGradientElement::parseAttribute(const QualifiedName& name, const AtomicS > if (name == SVGNames::gradientUnitsAttr) { > auto propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(value); > if (propertyValue > 0) >- m_gradientUnits.setValue(propertyValue); >+ m_gradientUnits->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::gradientTransformAttr) { >- SVGTransformListValues newList; >- newList.parse(value); >- m_gradientTransform.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); >- m_gradientTransform.setValue(WTFMove(newList)); >+ m_gradientTransform->baseVal()->parse(value); > return; > } > > if (name == SVGNames::spreadMethodAttr) { > auto propertyValue = SVGPropertyTraits<SVGSpreadMethodType>::fromString(value); > if (propertyValue > 0) >- m_spreadMethod.setValue(propertyValue); >+ m_spreadMethod->setBaseValInternal(propertyValue); > return; > } > >@@ -109,12 +97,12 @@ void SVGGradientElement::childrenChanged(const ChildChange& change) > object->setNeedsLayout(); > } > >-Vector<Gradient::ColorStop> SVGGradientElement::buildStops() >+Vector<Gradient::ColorStop> SVGGradientElement::buildStops() const > { > Vector<Gradient::ColorStop> stops; > float previousOffset = 0.0f; > >- for (auto& stop : childrenOfType<SVGStopElement>(*this)) { >+ for (const auto& stop : childrenOfType<SVGStopElement>(*this)) { > const Color& color = stop.stopColorIncludingOpacity(); > > // Figure out right monotonic offset. >diff --git a/Source/WebCore/svg/SVGGradientElement.h b/Source/WebCore/svg/SVGGradientElement.h >index b4c392b3549..b95debf095a 100644 >--- a/Source/WebCore/svg/SVGGradientElement.h >+++ b/Source/WebCore/svg/SVGGradientElement.h >@@ -22,9 +22,6 @@ > #pragma once > > #include "Gradient.h" >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedTransformList.h" > #include "SVGElement.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGNames.h" >@@ -83,23 +80,23 @@ public: > SVG_SPREADMETHOD_REPEAT = SVGSpreadMethodUnknown > }; > >- Vector<Gradient::ColorStop> buildStops(); >+ Vector<Gradient::ColorStop> buildStops() const; > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGGradientElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGradientElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; >+ >+ SVGSpreadMethodType spreadMethod() const { return m_spreadMethod->currentValue<SVGSpreadMethodType>(); } >+ SVGUnitTypes::SVGUnitType gradientUnits() const { return m_gradientUnits->currentValue<SVGUnitTypes::SVGUnitType>(); } >+ const SVGTransformList& gradientTransform() const { return m_gradientTransform->currentValue(); } > >- SVGSpreadMethodType spreadMethod() const { return m_spreadMethod.currentValue(attributeOwnerProxy()); } >- SVGUnitTypes::SVGUnitType gradientUnits() const { return m_gradientUnits.currentValue(attributeOwnerProxy()); } >- const SVGTransformListValues& gradientTransform() const { return m_gradientTransform.currentValue(attributeOwnerProxy()); } >- >- RefPtr<SVGAnimatedEnumeration> spreadMethodAnimated() { return m_spreadMethod.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> gradientUnitsAnimated() { return m_gradientUnits.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedTransformList> gradientTransformAnimated() { return m_gradientTransform.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedEnumeration>& spreadMethod() { return m_spreadMethod; } >+ Ref<SVGAnimatedEnumeration>& gradientUnits() { return m_gradientUnits; } >+ Ref<SVGAnimatedTransformList>& gradientTransform() { return m_gradientTransform; } > > protected: > SVGGradientElement(const QualifiedName&, Document&); > >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >+ static bool isKnownAttribute(const QualifiedName& attributeName) { return PropertyRegistry::isKnownAttribute(attributeName); } >+ > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >@@ -107,13 +104,12 @@ private: > bool needsPendingResourceHandling() const override { return false; } > void childrenChanged(const ChildChange&) override; > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; } >- static void registerAttributes(); >+ const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; } > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedEnumerationAttribute<SVGSpreadMethodType> m_spreadMethod { SVGSpreadMethodPad }; >- SVGAnimatedEnumerationAttribute<SVGUnitTypes::SVGUnitType> m_gradientUnits { SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX }; >- SVGAnimatedTransformListAttribute m_gradientTransform; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedEnumeration> m_spreadMethod { SVGAnimatedEnumeration::create(this, SVGSpreadMethodPad) }; >+ Ref<SVGAnimatedEnumeration> m_gradientUnits { SVGAnimatedEnumeration::create(this, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) }; >+ Ref<SVGAnimatedTransformList> m_gradientTransform { SVGAnimatedTransformList::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGGraphicsElement.cpp b/Source/WebCore/svg/SVGGraphicsElement.cpp >index c59636cf792..fc4ae7157d7 100644 >--- a/Source/WebCore/svg/SVGGraphicsElement.cpp >+++ b/Source/WebCore/svg/SVGGraphicsElement.cpp >@@ -40,9 +40,11 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(SVGGraphicsElement); > SVGGraphicsElement::SVGGraphicsElement(const QualifiedName& tagName, Document& document) > : SVGElement(tagName, document) > , SVGTests(this) >- , m_shouldIsolateBlending(false) > { >- registerAttributes(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::transformAttr, &SVGGraphicsElement::m_transform>(); >+ }); > } > > SVGGraphicsElement::~SVGGraphicsElement() = default; >@@ -120,21 +122,10 @@ AffineTransform* SVGGraphicsElement::supplementalTransform() > return m_supplementalTransform.get(); > } > >-void SVGGraphicsElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::transformAttr, &SVGGraphicsElement::m_transform>(); >-} >- > void SVGGraphicsElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::transformAttr) { >- SVGTransformListValues newList; >- newList.parse(value); >- m_transform.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); >- m_transform.setValue(newList); >+ m_transform->baseVal()->parse(value); > return; > } > >@@ -144,18 +135,14 @@ void SVGGraphicsElement::parseAttribute(const QualifiedName& name, const AtomicS > > void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (attrName == SVGNames::transformAttr) { > InstanceInvalidationGuard guard(*this); > >- auto renderer = this->renderer(); >- if (!renderer) >- return; >- >- if (attrName == SVGNames::transformAttr) { >+ if (auto renderer = this->renderer()) { > renderer->setNeedsTransformUpdate(); > RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >- return; > } >+ return; > } > > SVGElement::svgAttributeChanged(attrName); >@@ -187,7 +174,7 @@ RenderPtr<RenderElement> SVGGraphicsElement::createElementRenderer(RenderStyle&& > return createRenderer<RenderSVGPath>(*this, WTFMove(style)); > } > >-Path SVGGraphicsElement::toClipPath() >+Path SVGGraphicsElement::toClipPath() const > { > Path path = pathFromGraphicsElement(this); > // FIXME: How do we know the element has done a layout? >diff --git a/Source/WebCore/svg/SVGGraphicsElement.h b/Source/WebCore/svg/SVGGraphicsElement.h >index 06ee4b30792..dd78933f7ec 100644 >--- a/Source/WebCore/svg/SVGGraphicsElement.h >+++ b/Source/WebCore/svg/SVGGraphicsElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedTransformList.h" > #include "SVGElement.h" > #include "SVGTests.h" > #include "SVGTransformable.h" >@@ -58,16 +57,15 @@ public: > void setShouldIsolateBlending(bool isolate) { m_shouldIsolateBlending = isolate; } > > // "base class" methods for all the elements which render as paths >- virtual Path toClipPath(); >+ virtual Path toClipPath() const; > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; > > size_t approximateMemoryCost() const override { return sizeof(*this); } > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGGraphicsElement, SVGElement, SVGTests>; >- static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGGraphicsElement, SVGElement, SVGTests>; > >- const auto& transform() const { return m_transform.currentValue(attributeOwnerProxy()); } >- auto transformAnimated() { return m_transform.animatedProperty(attributeOwnerProxy()); } >+ const SVGTransformList& transform() const { return m_transform->currentValue(); } >+ Ref<SVGAnimatedTransformList>& transform() { return m_transform; } > > protected: > SVGGraphicsElement(const QualifiedName&, Document&); >@@ -80,19 +78,16 @@ protected: > private: > bool isSVGGraphicsElement() const override { return true; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; } >- >- static void registerAttributes(); >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >+ const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; } > > // Used by <animateMotion> > std::unique_ptr<AffineTransform> m_supplementalTransform; > > // Used to isolate blend operations caused by masking. >- bool m_shouldIsolateBlending; >+ bool m_shouldIsolateBlending { false }; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedTransformListAttribute m_transform; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedTransformList> m_transform { SVGAnimatedTransformList::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGImageElement.cpp b/Source/WebCore/svg/SVGImageElement.cpp >index 055992764c6..c262659236a 100644 >--- a/Source/WebCore/svg/SVGImageElement.cpp >+++ b/Source/WebCore/svg/SVGImageElement.cpp >@@ -43,7 +43,14 @@ inline SVGImageElement::SVGImageElement(const QualifiedName& tagName, Document& > , SVGURIReference(this) > , m_imageLoader(*this) > { >- registerAttributes(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGImageElement::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGImageElement::m_y>(); >+ PropertyRegistry::registerProperty<SVGNames::widthAttr, &SVGImageElement::m_width>(); >+ PropertyRegistry::registerProperty<SVGNames::heightAttr, &SVGImageElement::m_height>(); >+ PropertyRegistry::registerProperty<SVGNames::preserveAspectRatioAttr, &SVGImageElement::m_preserveAspectRatio>(); >+ }); > } > > Ref<SVGImageElement> SVGImageElement::create(const QualifiedName& tagName, Document& document) >@@ -60,37 +67,25 @@ bool SVGImageElement::hasSingleSecurityOrigin() const > return !image || image->hasSingleSecurityOrigin(); > } > >-void SVGImageElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::xAttr, &SVGImageElement::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGImageElement::m_y>(); >- registry.registerAttribute<SVGNames::widthAttr, &SVGImageElement::m_width>(); >- registry.registerAttribute<SVGNames::heightAttr, &SVGImageElement::m_height>(); >- registry.registerAttribute<SVGNames::preserveAspectRatioAttr, &SVGImageElement::m_preserveAspectRatio>(); >-} >- > void SVGImageElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::preserveAspectRatioAttr) { > SVGPreserveAspectRatioValue preserveAspectRatio; > preserveAspectRatio.parse(value); >- m_preserveAspectRatio.setValue(preserveAspectRatio); >+ m_preserveAspectRatio->setBaseValInternal(preserveAspectRatio); > return; > } > > SVGParsingError parseError = NoError; > > if (name == SVGNames::xAttr) >- m_x.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::yAttr) >- m_y.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::widthAttr) >- m_width.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); >+ m_width->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); > else if (name == SVGNames::heightAttr) >- m_height.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); >+ m_height->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); > > reportAttributeParsingError(parseError, name, value); > >@@ -139,7 +134,7 @@ RenderPtr<RenderElement> SVGImageElement::createElementRenderer(RenderStyle&& st > return createRenderer<RenderSVGImage>(*this, WTFMove(style)); > } > >-bool SVGImageElement::haveLoadedRequiredResources() >+bool SVGImageElement::haveLoadedRequiredResources() const > { > return !externalResourcesRequired() || !m_imageLoader.hasPendingActivity(); > } >diff --git a/Source/WebCore/svg/SVGImageElement.h b/Source/WebCore/svg/SVGImageElement.h >index 523be601217..95c65378581 100644 >--- a/Source/WebCore/svg/SVGImageElement.h >+++ b/Source/WebCore/svg/SVGImageElement.h >@@ -21,8 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedLength.h" >-#include "SVGAnimatedPreserveAspectRatio.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGraphicsElement.h" > #include "SVGImageLoader.h" >@@ -38,27 +36,24 @@ public: > bool hasSingleSecurityOrigin() const; > const AtomicString& imageSourceURL() const final; > >- const SVGLengthValue& x() const { return m_x.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); } >- const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& x() const { return m_x->currentValue(); } >+ const SVGLengthValue& y() const { return m_y->currentValue(); } >+ const SVGLengthValue& width() const { return m_width->currentValue(); } >+ const SVGLengthValue& height() const { return m_height->currentValue(); } >+ const SVGPreserveAspectRatioValue& preserveAspectRatio() const { return m_preserveAspectRatio->currentValue(); } > >- RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedPreserveAspectRatio> preserveAspectRatioAnimated() { return m_preserveAspectRatio.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& x() { return m_x; } >+ Ref<SVGAnimatedLength>& y() { return m_y; } >+ Ref<SVGAnimatedLength>& width() { return m_width; } >+ Ref<SVGAnimatedLength>& height() { return m_height; } >+ Ref<SVGAnimatedPreserveAspectRatio>& preserveAspectRatio() { return m_preserveAspectRatio; } > > private: > SVGImageElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGImageElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGURIReference>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGImageElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGURIReference>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -67,18 +62,18 @@ private: > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > > void addSubresourceAttributeURLs(ListHashSet<URL>&) const final; >- bool haveLoadedRequiredResources() final; >+ bool haveLoadedRequiredResources() const final; > > bool isValid() const final { return SVGTests::isValid(); } > bool selfHasRelativeLengths() const final { return true; } > void didMoveToNewDocument(Document& oldDocument, Document& newDocument) final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_x { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_y { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_width { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_height { LengthModeHeight }; >- SVGAnimatedPreserveAspectRatioAttribute m_preserveAspectRatio; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_x { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_y { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_width { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_height { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedPreserveAspectRatio> m_preserveAspectRatio { SVGAnimatedPreserveAspectRatio::create(this) }; > SVGImageLoader m_imageLoader; > }; > >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/SVGLangSpace.cpp b/Source/WebCore/svg/SVGLangSpace.cpp >index 8b9d80df6f5..0eabe3219d0 100644 >--- a/Source/WebCore/svg/SVGLangSpace.cpp >+++ b/Source/WebCore/svg/SVGLangSpace.cpp >@@ -33,25 +33,20 @@ namespace WebCore { > SVGLangSpace::SVGLangSpace(SVGElement* contextElement) > : m_contextElement(*contextElement) > { >- registerAttributes(); > } >- >-void SVGLangSpace::registerAttributes() >+ >+bool SVGLangSpace::isKnownAttribute(const QualifiedName& attributeName) > { >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute(SVGStringAttributeAccessor::singleton<XMLNames::langAttr, &SVGLangSpace::m_lang>()); >- registry.registerAttribute(SVGStringAttributeAccessor::singleton<XMLNames::spaceAttr, &SVGLangSpace::m_space>()); >+ return attributeName.matches(XMLNames::langAttr) || attributeName.matches(XMLNames::spaceAttr); > } > >-const String& SVGLangSpace::xmlspace() const >+const AtomicString& SVGLangSpace::xmlspace() const > { >- if (!m_space.value()) { >- static NeverDestroyed<String> defaultString("default"); >+ if (!m_space) { >+ static NeverDestroyed<const AtomicString> defaultString("default", AtomicString::ConstructFromLiteral); > return defaultString; > } >- return m_space.value(); >+ return m_space; > } > > void SVGLangSpace::parseAttribute(const QualifiedName& name, const AtomicString& value) >@@ -62,9 +57,9 @@ void SVGLangSpace::parseAttribute(const QualifiedName& name, const AtomicString& > setXmlspace(value); > } > >-void SVGLangSpace::svgAttributeChanged(const QualifiedName& attrName) >+void SVGLangSpace::svgAttributeChanged(const QualifiedName& attributeName) > { >- if (!isKnownAttribute(attrName)) >+ if (!isKnownAttribute(attributeName)) > return; > > auto* renderer = m_contextElement.renderer(); >diff --git a/Source/WebCore/svg/SVGLangSpace.h b/Source/WebCore/svg/SVGLangSpace.h >index 8775822221e..06977b3a1b7 100644 >--- a/Source/WebCore/svg/SVGLangSpace.h >+++ b/Source/WebCore/svg/SVGLangSpace.h >@@ -22,7 +22,6 @@ > #pragma once > > #include "QualifiedName.h" >-#include "SVGAttributeOwnerProxyImpl.h" > #include <wtf/HashSet.h> > > namespace WebCore { >@@ -31,32 +30,25 @@ class SVGElement; > > class SVGLangSpace { > public: >- const String& xmllang() const { return m_lang.value(); } >- void setXmllang(const AtomicString& xmlLang) { m_lang.setValue(xmlLang); } >+ static bool isKnownAttribute(const QualifiedName& attributeName); >+ >+ const AtomicString& xmllang() const { return m_lang; } >+ void setXmllang(const AtomicString& xmlLang) { m_lang = xmlLang; } > >- const String& xmlspace() const; >- void setXmlspace(const AtomicString& xmlSpace) { m_space.setValue(xmlSpace); } >+ const AtomicString& xmlspace() const; >+ void setXmlspace(const AtomicString& xmlSpace) { m_space = xmlSpace; } > > void parseAttribute(const QualifiedName&, const AtomicString&); > > void svgAttributeChanged(const QualifiedName&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGLangSpace>; >- using AttributeRegistry = SVGAttributeRegistry<SVGLangSpace>; >- static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return attributeRegistry().isKnownAttribute(attributeName); } >- > protected: > SVGLangSpace(SVGElement* contextElement); > > private: >- using SVGStringAttribute = SVGPropertyAttribute<String>; >- using SVGStringAttributeAccessor = SVGPropertyAttributeAccessor<SVGLangSpace, SVGStringAttribute>; >- static void registerAttributes(); >- > SVGElement& m_contextElement; >- SVGStringAttribute m_lang; >- SVGStringAttribute m_space; >+ AtomicString m_lang; >+ AtomicString m_space; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGLength.h b/Source/WebCore/svg/SVGLength.h >index 94529d24e6c..f09a19412f5 100644 >--- a/Source/WebCore/svg/SVGLength.h >+++ b/Source/WebCore/svg/SVGLength.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -26,11 +26,15 @@ > #pragma once > > #include "SVGLengthValue.h" >-#include "SVGPropertyTearOff.h" >+#include "SVGValueProperty.h" > > namespace WebCore { > >-class SVGLength : public SVGPropertyTearOff<SVGLengthValue> { >+class SVGLength : public SVGValueProperty<SVGLengthValue> { >+ using Base = SVGValueProperty<SVGLengthValue>; >+ using Base::Base; >+ using Base::m_value; >+ > public: > // Forward declare these enums in the w3c naming scheme, for IDL generation > enum { >@@ -47,31 +51,37 @@ public: > SVG_LENGTHTYPE_PC = LengthTypePC > }; > >- static Ref<SVGLength> create(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGLengthValue& value) >+ static Ref<SVGLength> create(const SVGLengthValue& value = { }) > { >- return adoptRef(*new SVGLength(animatedProperty, role, value)); >+ return adoptRef(*new SVGLength(value)); > } > >- static Ref<SVGLength> create(const SVGLengthValue& initialValue = { }) >+ static Ref<SVGLength> create(SVGPropertyOwner* owner, SVGPropertyAccess access, const SVGLengthValue& value = { }) > { >- return adoptRef(*new SVGLength(initialValue)); >+ return adoptRef(*new SVGLength(owner, access, value)); > } > >- template<typename T> static ExceptionOr<Ref<SVGLength>> create(ExceptionOr<T>&& initialValue) >+ template<typename T> >+ static ExceptionOr<Ref<SVGLength>> create(ExceptionOr<T>&& value) > { >- if (initialValue.hasException()) >- return initialValue.releaseException(); >- return create(initialValue.releaseReturnValue()); >+ if (value.hasException()) >+ return value.releaseException(); >+ return adoptRef(*new SVGLength(value.releaseReturnValue())); > } > >+ Ref<SVGLength> clone() const >+ { >+ return SVGLength::create(m_value); >+ } >+ > unsigned short unitType() > { >- return propertyReference().unitType(); >+ return m_value.unitType(); > } > > ExceptionOr<float> valueForBindings() > { >- return propertyReference().valueForBindings(SVGLengthContext { contextElement() }); >+ return m_value.valueForBindings(SVGLengthContext { contextElement() }); > } > > ExceptionOr<void> setValueForBindings(float value) >@@ -79,7 +89,7 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- auto result = propertyReference().setValue(value, SVGLengthContext { contextElement() }); >+ auto result = m_value.setValue(value, SVGLengthContext { contextElement() }); > if (result.hasException()) > return result; > >@@ -89,7 +99,7 @@ public: > > float valueInSpecifiedUnits() > { >- return propertyReference().valueInSpecifiedUnits(); >+ return m_value.valueInSpecifiedUnits(); > } > > ExceptionOr<void> setValueInSpecifiedUnits(float valueInSpecifiedUnits) >@@ -97,15 +107,14 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setValueInSpecifiedUnits(valueInSpecifiedUnits); >+ m_value.setValueInSpecifiedUnits(valueInSpecifiedUnits); > commitChange(); >- > return { }; > } > >- String valueAsString() >+ String valueAsString() const override > { >- return propertyReference().valueAsString(); >+ return m_value.valueAsString(); > } > > ExceptionOr<void> setValueAsString(const String& value) >@@ -113,10 +122,10 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- auto result = propertyReference().setValueAsString(value); >+ auto result = m_value.setValueAsString(value); > if (result.hasException()) > return result; >- >+ > commitChange(); > return result; > } >@@ -126,7 +135,7 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- auto result = propertyReference().newValueSpecifiedUnits(unitType, valueInSpecifiedUnits); >+ auto result = m_value.newValueSpecifiedUnits(unitType, valueInSpecifiedUnits); > if (result.hasException()) > return result; > >@@ -139,24 +148,13 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- auto result = propertyReference().convertToSpecifiedUnits(unitType, SVGLengthContext { contextElement() }); >+ auto result = m_value.convertToSpecifiedUnits(unitType, SVGLengthContext { contextElement() }); > if (result.hasException()) > return result; > > commitChange(); > return result; > } >- >-private: >- SVGLength(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGLengthValue& value) >- : SVGPropertyTearOff<SVGLengthValue>(&animatedProperty, role, value) >- { >- } >- >- explicit SVGLength(const SVGLengthValue& initialValue) >- : SVGPropertyTearOff<SVGLengthValue>(initialValue) >- { >- } > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGLengthList.h b/Source/WebCore/svg/SVGLengthList.h >index 9abaa4ffe83..f2a1d068c4d 100644 >--- a/Source/WebCore/svg/SVGLengthList.h >+++ b/Source/WebCore/svg/SVGLengthList.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -25,27 +25,92 @@ > > #pragma once > >-#include "SVGAnimatedListPropertyTearOff.h" >-#include "SVGLengthListValues.h" >-#include "SVGListPropertyTearOff.h" >+#include "SVGLength.h" >+#include "SVGValuePropertyList.h" > > namespace WebCore { > >-class SVGLengthList : public SVGListPropertyTearOff<SVGLengthListValues> { >+class SVGLengthList : public SVGValuePropertyList<SVGLength> { >+ using Base = SVGValuePropertyList<SVGLength>; >+ using Base::Base; >+ > public: >- using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<SVGLengthListValues>; >- using ListWrapperCache = AnimatedListPropertyTearOff::ListWrapperCache; >+ static Ref<SVGLengthList> create(SVGLengthMode lengthMode = LengthModeOther) >+ { >+ return adoptRef(*new SVGLengthList(lengthMode)); >+ } >+ >+ static Ref<SVGLengthList> create(SVGPropertyOwner* owner, SVGPropertyAccess access, SVGLengthMode lengthMode) >+ { >+ return adoptRef(*new SVGLengthList(owner, access, lengthMode)); >+ } > >- static Ref<SVGLengthList> create(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGLengthListValues& values, ListWrapperCache& wrappers) >+ static Ref<SVGLengthList> create(const SVGLengthList& other, SVGPropertyAccess access) > { >- return adoptRef(*new SVGLengthList(animatedProperty, role, values, wrappers)); >+ return adoptRef(*new SVGLengthList(other, access)); >+ } >+ >+ SVGLengthMode lengthMode() const { return m_lengthMode; } >+ >+ bool parse(const String& value) >+ { >+ clearItems(); >+ >+ auto upconvertedCharacters = StringView(value).upconvertedCharacters(); >+ const UChar* ptr = upconvertedCharacters; >+ const UChar* end = ptr + value.length(); >+ while (ptr < end) { >+ const UChar* start = ptr; >+ while (ptr < end && *ptr != ',' && !isSVGSpace(*ptr)) >+ ptr++; >+ if (ptr == start) >+ break; >+ >+ String valueString(start, ptr - start); >+ SVGLengthValue value(m_lengthMode); >+ if (value.setValueAsString(valueString).hasException()) >+ break; >+ >+ append(SVGLength::create(value)); >+ skipOptionalSVGSpacesOrDelimiter(ptr, end); >+ } >+ >+ return ptr == end; >+ } >+ >+ String valueAsString() const override >+ { >+ StringBuilder builder; >+ >+ for (const auto& length : m_items) { >+ if (builder.length()) >+ builder.append(' '); >+ >+ builder.append(length->value().valueAsString()); >+ } >+ >+ return builder.toString(); > } > > private: >- SVGLengthList(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGLengthListValues& values, ListWrapperCache& wrappers) >- : SVGListPropertyTearOff<SVGLengthListValues>(animatedProperty, role, values, wrappers) >+ SVGLengthList(SVGLengthMode lengthMode) >+ : m_lengthMode(lengthMode) > { > } >+ >+ SVGLengthList(SVGPropertyOwner* owner, SVGPropertyAccess access, SVGLengthMode lengthMode) >+ : Base(owner, access) >+ , m_lengthMode(lengthMode) >+ { >+ } >+ >+ SVGLengthList(const SVGLengthList& other, SVGPropertyAccess access) >+ : Base(other, access) >+ , m_lengthMode(other.lengthMode()) >+ { >+ } >+ >+ SVGLengthMode m_lengthMode { LengthModeOther }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGLengthListValues.cpp b/Source/WebCore/svg/SVGLengthListValues.cpp >deleted file mode 100644 >index ba2064823a2..00000000000 >--- a/Source/WebCore/svg/SVGLengthListValues.cpp >+++ /dev/null >@@ -1,69 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> >- * >- * 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 "SVGLengthListValues.h" >- >-#include "SVGParserUtilities.h" >-#include <wtf/text/StringBuilder.h> >- >-namespace WebCore { >- >-void SVGLengthListValues::parse(const String& value, SVGLengthMode mode) >-{ >- clear(); >- >- auto upconvertedCharacters = StringView(value).upconvertedCharacters(); >- const UChar* ptr = upconvertedCharacters; >- const UChar* end = ptr + value.length(); >- while (ptr < end) { >- const UChar* start = ptr; >- while (ptr < end && *ptr != ',' && !isSVGSpace(*ptr)) >- ptr++; >- if (ptr == start) >- break; >- >- SVGLengthValue length(mode); >- String valueString(start, ptr - start); >- if (valueString.isEmpty()) >- return; >- if (length.setValueAsString(valueString).hasException()) >- return; >- append(length); >- skipOptionalSVGSpacesOrDelimiter(ptr, end); >- } >-} >- >-String SVGLengthListValues::valueAsString() const >-{ >- StringBuilder builder; >- >- unsigned size = this->size(); >- for (unsigned i = 0; i < size; ++i) { >- if (i > 0) >- builder.append(' '); >- >- builder.append(at(i).valueAsString()); >- } >- >- return builder.toString(); >-} >- >-} >diff --git a/Source/WebCore/svg/SVGLengthListValues.h b/Source/WebCore/svg/SVGLengthListValues.h >deleted file mode 100644 >index b0728606443..00000000000 >--- a/Source/WebCore/svg/SVGLengthListValues.h >+++ /dev/null >@@ -1,59 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> >- * >- * 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 "SVGLengthValue.h" >-#include <wtf/Vector.h> >- >-namespace WebCore { >- >-class SVGLength; >-class SVGLengthList; >- >-class SVGLengthListValues final : public Vector<SVGLengthValue> { >-public: >- void parse(const String& value, SVGLengthMode); >- String valueAsString() const; >-}; >- >-template<> >-struct SVGPropertyTraits<SVGLengthListValues> { >- static SVGLengthListValues initialValue() { return { }; } >- static SVGLengthListValues fromString(const String& string, SVGLengthMode lengthMode) >- { >- SVGLengthListValues list; >- list.parse(string, lengthMode); >- return list; >- } >- static std::optional<SVGLengthListValues> parse(const QualifiedName& attrName, const String& string) >- { >- SVGLengthListValues list; >- list.parse(string, SVGLengthValue::lengthModeForAnimatedLengthAttribute(attrName)); >- return list; >- } >- static String toString(const SVGLengthListValues& type) { return type.valueAsString(); } >- >- using ListItemType = SVGLengthValue; >- using ListItemTearOff = SVGLength; >- using ListPropertyTearOff = SVGLengthList; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGLineElement.cpp b/Source/WebCore/svg/SVGLineElement.cpp >index da54067b405..bdf3a0e51b6 100644 >--- a/Source/WebCore/svg/SVGLineElement.cpp >+++ b/Source/WebCore/svg/SVGLineElement.cpp >@@ -35,7 +35,14 @@ inline SVGLineElement::SVGLineElement(const QualifiedName& tagName, Document& do > , SVGExternalResourcesRequired(this) > { > ASSERT(hasTagName(SVGNames::lineTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::x1Attr, &SVGLineElement::m_x1>(); >+ PropertyRegistry::registerProperty<SVGNames::y1Attr, &SVGLineElement::m_y1>(); >+ PropertyRegistry::registerProperty<SVGNames::x2Attr, &SVGLineElement::m_x2>(); >+ PropertyRegistry::registerProperty<SVGNames::y2Attr, &SVGLineElement::m_y2>(); >+ }); > } > > Ref<SVGLineElement> SVGLineElement::create(const QualifiedName& tagName, Document& document) >@@ -43,29 +50,18 @@ Ref<SVGLineElement> SVGLineElement::create(const QualifiedName& tagName, Documen > return adoptRef(*new SVGLineElement(tagName, document)); > } > >-void SVGLineElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::x1Attr, &SVGLineElement::m_x1>(); >- registry.registerAttribute<SVGNames::y1Attr, &SVGLineElement::m_y1>(); >- registry.registerAttribute<SVGNames::x2Attr, &SVGLineElement::m_x2>(); >- registry.registerAttribute<SVGNames::y2Attr, &SVGLineElement::m_y2>(); >-} >- > void SVGLineElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; > > if (name == SVGNames::x1Attr) >- m_x1.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x1->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::y1Attr) >- m_y1.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y1->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::x2Attr) >- m_x2.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x2->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::y2Attr) >- m_y2.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y2->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > > reportAttributeParsingError(parseError, name, value); > >@@ -75,7 +71,7 @@ void SVGLineElement::parseAttribute(const QualifiedName& name, const AtomicStrin > > void SVGLineElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > updateRelativeLengthsInformation(); > >diff --git a/Source/WebCore/svg/SVGLineElement.h b/Source/WebCore/svg/SVGLineElement.h >index f1ebc4ecbf7..50789384090 100644 >--- a/Source/WebCore/svg/SVGLineElement.h >+++ b/Source/WebCore/svg/SVGLineElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedLength.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGeometryElement.h" > #include "SVGNames.h" >@@ -33,25 +32,22 @@ class SVGLineElement final : public SVGGeometryElement, public SVGExternalResour > public: > static Ref<SVGLineElement> create(const QualifiedName&, Document&); > >- const SVGLengthValue& x1() const { return m_x1.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y1() const { return m_y1.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& x2() const { return m_x2.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y2() const { return m_y2.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& x1() const { return m_x1->currentValue(); } >+ const SVGLengthValue& y1() const { return m_y1->currentValue(); } >+ const SVGLengthValue& x2() const { return m_x2->currentValue(); } >+ const SVGLengthValue& y2() const { return m_y2->currentValue(); } > >- RefPtr<SVGAnimatedLength> x1Animated() { return m_x1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> y1Animated() { return m_y1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> x2Animated() { return m_x2.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> y2Animated() { return m_y2.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& x1() { return m_x1; } >+ Ref<SVGAnimatedLength>& y1() { return m_y1; } >+ Ref<SVGAnimatedLength>& x2() { return m_x2; } >+ Ref<SVGAnimatedLength>& y2() { return m_y2; } > > private: > SVGLineElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGLineElement, SVGGeometryElement, SVGExternalResourcesRequired>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGLineElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -59,11 +55,11 @@ private: > bool supportsMarkers() const final { return true; } > bool selfHasRelativeLengths() const final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_x1 { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_y1 { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_x2 { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_y2 { LengthModeHeight }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_x1 { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_y1 { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_x2 { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_y2 { SVGAnimatedLength::create(this, LengthModeHeight) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGLinearGradientElement.cpp b/Source/WebCore/svg/SVGLinearGradientElement.cpp >index eefdfb542b8..ecef3fc23d3 100644 >--- a/Source/WebCore/svg/SVGLinearGradientElement.cpp >+++ b/Source/WebCore/svg/SVGLinearGradientElement.cpp >@@ -44,7 +44,14 @@ inline SVGLinearGradientElement::SVGLinearGradientElement(const QualifiedName& t > { > // Spec: If the x2 attribute is not specified, the effect is as if a value of "100%" were specified. > ASSERT(hasTagName(SVGNames::linearGradientTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::x1Attr, &SVGLinearGradientElement::m_x1>(); >+ PropertyRegistry::registerProperty<SVGNames::y1Attr, &SVGLinearGradientElement::m_y1>(); >+ PropertyRegistry::registerProperty<SVGNames::x2Attr, &SVGLinearGradientElement::m_x2>(); >+ PropertyRegistry::registerProperty<SVGNames::y2Attr, &SVGLinearGradientElement::m_y2>(); >+ }); > } > > Ref<SVGLinearGradientElement> SVGLinearGradientElement::create(const QualifiedName& tagName, Document& document) >@@ -52,29 +59,18 @@ Ref<SVGLinearGradientElement> SVGLinearGradientElement::create(const QualifiedNa > return adoptRef(*new SVGLinearGradientElement(tagName, document)); > } > >-void SVGLinearGradientElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::x1Attr, &SVGLinearGradientElement::m_x1>(); >- registry.registerAttribute<SVGNames::y1Attr, &SVGLinearGradientElement::m_y1>(); >- registry.registerAttribute<SVGNames::x2Attr, &SVGLinearGradientElement::m_x2>(); >- registry.registerAttribute<SVGNames::y2Attr, &SVGLinearGradientElement::m_y2>(); >-} >- > void SVGLinearGradientElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; > > if (name == SVGNames::x1Attr) >- m_x1.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x1->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::y1Attr) >- m_y1.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y1->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::x2Attr) >- m_x2.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x2->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::y2Attr) >- m_y2.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y2->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > > reportAttributeParsingError(parseError, name, value); > >@@ -83,7 +79,7 @@ void SVGLinearGradientElement::parseAttribute(const QualifiedName& name, const A > > void SVGLinearGradientElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > updateRelativeLengthsInformation(); > if (RenderObject* object = renderer()) >@@ -99,7 +95,7 @@ RenderPtr<RenderElement> SVGLinearGradientElement::createElementRenderer(RenderS > return createRenderer<RenderSVGResourceLinearGradient>(*this, WTFMove(style)); > } > >-static void setGradientAttributes(SVGGradientElement& element, LinearGradientAttributes& attributes, bool isLinear = true) >+static void setGradientAttributes(const SVGGradientElement& element, LinearGradientAttributes& attributes, bool isLinear = true) > { > if (!attributes.hasSpreadMethod() && element.hasAttribute(SVGNames::spreadMethodAttr)) > attributes.setSpreadMethod(element.spreadMethod()); >@@ -120,7 +116,7 @@ static void setGradientAttributes(SVGGradientElement& element, LinearGradientAtt > } > > if (isLinear) { >- SVGLinearGradientElement& linear = downcast<SVGLinearGradientElement>(element); >+ const SVGLinearGradientElement& linear = downcast<SVGLinearGradientElement>(element); > > if (!attributes.hasX1() && element.hasAttribute(SVGNames::x1Attr)) > attributes.setX1(linear.x1()); >@@ -149,21 +145,22 @@ bool SVGLinearGradientElement::collectGradientAttributes(LinearGradientAttribute > > while (true) { > // Respect xlink:href, take attributes from referenced element >- auto target = SVGURIReference::targetElementFromIRIString(current->href(), treeScope()); >- if (is<SVGGradientElement>(target.element)) { >- current = downcast<SVGGradientElement>(*target.element); >- >- // Cycle detection >- if (processedGradients.contains(current)) >- return true; >+ String href = current->href()->currentValue(); >+ auto target = SVGURIReference::targetElementFromIRIString(href, treeScope()); >+ if (!is<SVGGradientElement>(target.element)) >+ return true; > >- if (!current->renderer()) >- return false; >+ current = downcast<SVGGradientElement>(*target.element); > >- setGradientAttributes(current.get(), attributes, current->hasTagName(SVGNames::linearGradientTag)); >- processedGradients.add(current.copyRef()); >- } else >+ // Cycle detection >+ if (processedGradients.contains(current)) > return true; >+ >+ if (!current->renderer()) >+ return false; >+ >+ setGradientAttributes(current.get(), attributes, current->hasTagName(SVGNames::linearGradientTag)); >+ processedGradients.add(current.copyRef()); > } > > ASSERT_NOT_REACHED(); >diff --git a/Source/WebCore/svg/SVGLinearGradientElement.h b/Source/WebCore/svg/SVGLinearGradientElement.h >index 9f670c9daa4..95e3c51aab3 100644 >--- a/Source/WebCore/svg/SVGLinearGradientElement.h >+++ b/Source/WebCore/svg/SVGLinearGradientElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedLength.h" > #include "SVGGradientElement.h" > #include "SVGNames.h" > >@@ -36,25 +35,22 @@ public: > > bool collectGradientAttributes(LinearGradientAttributes&); > >- const SVGLengthValue& x1() const { return m_x1.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y1() const { return m_y1.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& x2() const { return m_x2.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y2() const { return m_y2.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& x1() const { return m_x1->currentValue(); } >+ const SVGLengthValue& y1() const { return m_y1->currentValue(); } >+ const SVGLengthValue& x2() const { return m_x2->currentValue(); } >+ const SVGLengthValue& y2() const { return m_y2->currentValue(); } > >- RefPtr<SVGAnimatedLength> x1Animated() { return m_x1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> y1Animated() { return m_y1.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> x2Animated() { return m_x2.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> y2Animated() { return m_y2.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& x1() { return m_x1; } >+ Ref<SVGAnimatedLength>& y1() { return m_y1; } >+ Ref<SVGAnimatedLength>& x2() { return m_x2; } >+ Ref<SVGAnimatedLength>& y2() { return m_y2; } > > private: > SVGLinearGradientElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGLinearGradientElement, SVGGradientElement>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGLinearGradientElement, SVGGradientElement>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >@@ -62,11 +58,11 @@ private: > > bool selfHasRelativeLengths() const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_x1 { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_y1 { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_x2 { LengthModeWidth, "100%" }; >- SVGAnimatedLengthAttribute m_y2 { LengthModeHeight }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_x1 { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_y1 { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_x2 { SVGAnimatedLength::create(this, LengthModeWidth, "100%") }; >+ Ref<SVGAnimatedLength> m_y2 { SVGAnimatedLength::create(this, LengthModeHeight) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGMPathElement.cpp b/Source/WebCore/svg/SVGMPathElement.cpp >index 18e9dd516f3..af729f20dc7 100644 >--- a/Source/WebCore/svg/SVGMPathElement.cpp >+++ b/Source/WebCore/svg/SVGMPathElement.cpp >@@ -26,6 +26,7 @@ > #include "SVGDocumentExtensions.h" > #include "SVGNames.h" > #include "SVGPathElement.h" >+#include <wtf/IsoMallocInlines.h> > > namespace WebCore { > >@@ -55,7 +56,8 @@ void SVGMPathElement::buildPendingResource() > if (!isConnected()) > return; > >- auto target = SVGURIReference::targetElementFromIRIString(href(), treeScope()); >+ String href = this->href()->currentValue(); >+ auto target = SVGURIReference::targetElementFromIRIString(href, treeScope()); > if (!target.element) { > // Do not register as pending if we are already pending this resource. > if (document().accessSVGExtensions().isPendingResource(this, target.identifier)) >@@ -119,7 +121,7 @@ void SVGMPathElement::svgAttributeChanged(const QualifiedName& attrName) > SVGExternalResourcesRequired::svgAttributeChanged(attrName); > } > >-RefPtr<SVGPathElement> SVGMPathElement::pathElement() >+RefPtr<SVGPathElement> SVGMPathElement::pathElement() const > { > auto target = targetElementFromIRIString(href(), treeScope()); > if (is<SVGPathElement>(target.element)) >diff --git a/Source/WebCore/svg/SVGMPathElement.h b/Source/WebCore/svg/SVGMPathElement.h >index 39c9ea04518..f4a729d9952 100644 >--- a/Source/WebCore/svg/SVGMPathElement.h >+++ b/Source/WebCore/svg/SVGMPathElement.h >@@ -20,8 +20,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedString.h" > #include "SVGElement.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGNames.h" >@@ -38,16 +36,16 @@ public: > > virtual ~SVGMPathElement(); > >- RefPtr<SVGPathElement> pathElement(); >+ RefPtr<SVGPathElement> pathElement() const; > > void targetPathChanged(); > > private: > SVGMPathElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGMPathElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGMPathElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -61,7 +59,7 @@ private: > > void notifyParentOfPathChange(ContainerNode*); > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGMarkerElement.cpp b/Source/WebCore/svg/SVGMarkerElement.cpp >index 6ab2b7ff22c..5b75a5a0f6d 100644 >--- a/Source/WebCore/svg/SVGMarkerElement.cpp >+++ b/Source/WebCore/svg/SVGMarkerElement.cpp >@@ -40,7 +40,16 @@ inline SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document > { > // Spec: If the markerWidth/markerHeight attribute is not specified, the effect is as if a value of "3" were specified. > ASSERT(hasTagName(SVGNames::markerTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::refXAttr, &SVGMarkerElement::m_refX>(); >+ PropertyRegistry::registerProperty<SVGNames::refYAttr, &SVGMarkerElement::m_refY>(); >+ PropertyRegistry::registerProperty<SVGNames::markerWidthAttr, &SVGMarkerElement::m_markerWidth>(); >+ PropertyRegistry::registerProperty<SVGNames::markerHeightAttr, &SVGMarkerElement::m_markerHeight>(); >+ PropertyRegistry::registerProperty<SVGNames::markerUnitsAttr, SVGMarkerUnitsType, &SVGMarkerElement::m_markerUnits>(); >+ PropertyRegistry::registerProperty<SVGNames::orientAttr, &SVGMarkerElement::m_orientAngle, &SVGMarkerElement::m_orientType>(); >+ }); > } > > Ref<SVGMarkerElement> SVGMarkerElement::create(const QualifiedName& tagName, Document& document) >@@ -48,67 +57,37 @@ Ref<SVGMarkerElement> SVGMarkerElement::create(const QualifiedName& tagName, Doc > return adoptRef(*new SVGMarkerElement(tagName, document)); > } > >-const AtomicString& SVGMarkerElement::orientTypeIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGOrientType", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- >-const AtomicString& SVGMarkerElement::orientAngleIdentifier() >-{ >- static NeverDestroyed<AtomicString> s_identifier("SVGOrientAngle", AtomicString::ConstructFromLiteral); >- return s_identifier; >-} >- > AffineTransform SVGMarkerElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const > { > return SVGFitToViewBox::viewBoxToViewTransform(viewBox(), preserveAspectRatio(), viewWidth, viewHeight); > } > >-void SVGMarkerElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::refXAttr, &SVGMarkerElement::m_refX>(); >- registry.registerAttribute<SVGNames::refYAttr, &SVGMarkerElement::m_refY>(); >- registry.registerAttribute<SVGNames::markerWidthAttr, &SVGMarkerElement::m_markerWidth>(); >- registry.registerAttribute<SVGNames::markerHeightAttr, &SVGMarkerElement::m_markerHeight>(); >- registry.registerAttribute<SVGNames::markerUnitsAttr, SVGMarkerUnitsType, &SVGMarkerElement::m_markerUnits>(); >- registry.registerAttribute(SVGAnimatedCustomAngleAttributeAccessor::singleton<SVGNames::orientAttr, >- &SVGMarkerElement::orientAngleIdentifier, &SVGMarkerElement::m_orientAngle, >- &SVGMarkerElement::orientTypeIdentifier, &SVGMarkerElement::m_orientType>()); >-} >- > void SVGMarkerElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::markerUnitsAttr) { > auto propertyValue = SVGPropertyTraits<SVGMarkerUnitsType>::fromString(value); > if (propertyValue > 0) >- m_markerUnits.setValue(propertyValue); >+ m_markerUnits->setBaseValInternal(propertyValue); > return; > } > > if (name == SVGNames::orientAttr) { >- SVGAngleValue angle; >- auto orientType = SVGPropertyTraits<SVGMarkerOrientType>::fromString(value, angle); >- if (orientType > 0) >- m_orientType.setValue(orientType); >- if (orientType == SVGMarkerOrientAngle) >- m_orientAngle.setValue(angle); >+ auto pair = SVGPropertyTraits<std::pair<SVGAngleValue, SVGMarkerOrientType>>::fromString(value); >+ m_orientAngle->setBaseValInternal(pair.first); >+ m_orientType->setBaseValInternal(pair.second); > return; > } > > SVGParsingError parseError = NoError; > > if (name == SVGNames::refXAttr) >- m_refX.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_refX->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::refYAttr) >- m_refY.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_refY->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::markerWidthAttr) >- m_markerWidth.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_markerWidth->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::markerHeightAttr) >- m_markerHeight.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_markerHeight->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > > reportAttributeParsingError(parseError, name, value); > >@@ -119,9 +98,9 @@ void SVGMarkerElement::parseAttribute(const QualifiedName& name, const AtomicStr > > void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); >- if (isAnimatedLengthAttribute(attrName)) >+ if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) > updateRelativeLengthsInformation(); > if (RenderObject* object = renderer()) > object->setNeedsLayout(); >@@ -151,14 +130,9 @@ void SVGMarkerElement::childrenChanged(const ChildChange& change) > > void SVGMarkerElement::setOrient(SVGMarkerOrientType orientType, const SVGAngleValue& angle) > { >- m_orientType.setValue(orientType); >- m_orientAngle.setValue(angle); >- >- // Mark orientAttr dirty - the next XML DOM access of that attribute kicks in synchronization. >- m_orientAngle.setShouldSynchronize(true); >- m_orientType.setShouldSynchronize(true); >- invalidateSVGAttributes(); >- svgAttributeChanged(SVGNames::orientAttr); >+ m_orientType->setBaseValInternal(orientType); >+ m_orientAngle->setBaseValInternal(angle); >+ m_orientAngle->baseVal()->commitChange(); > } > > void SVGMarkerElement::setOrientToAuto() >@@ -168,7 +142,7 @@ void SVGMarkerElement::setOrientToAuto() > > void SVGMarkerElement::setOrientToAngle(SVGAngle& angle) > { >- setOrient(SVGMarkerOrientAngle, angle.propertyReference()); >+ setOrient(SVGMarkerOrientAngle, angle.value()); > } > > RenderPtr<RenderElement> SVGMarkerElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) >diff --git a/Source/WebCore/svg/SVGMarkerElement.h b/Source/WebCore/svg/SVGMarkerElement.h >index 37c180a01fa..1d35087690f 100644 >--- a/Source/WebCore/svg/SVGMarkerElement.h >+++ b/Source/WebCore/svg/SVGMarkerElement.h >@@ -21,12 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedAngle.h" >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedLength.h" >-#include "SVGAnimatedPreserveAspectRatio.h" >-#include "SVGAnimatedRect.h" > #include "SVGElement.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGFitToViewBox.h" >@@ -58,32 +52,28 @@ public: > void setOrientToAuto(); > void setOrientToAngle(SVGAngle&); > >- const SVGLengthValue& refX() const { return m_refX.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& refY() const { return m_refY.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& markerWidth() const { return m_markerWidth.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& markerHeight() const { return m_markerHeight.currentValue(attributeOwnerProxy()); } >- SVGMarkerUnitsType markerUnits() const { return m_markerUnits.currentValue(attributeOwnerProxy()); } >- const SVGAngleValue& orientAngle() const { return m_orientAngle.currentValue(attributeOwnerProxy()); } >- SVGMarkerOrientType orientType() const { return m_orientType.currentValue(attributeOwnerProxy()); } >- >- RefPtr<SVGAnimatedLength> refXAnimated() { return m_refX.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> refYAnimated() { return m_refY.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> markerWidthAnimated() { return m_markerWidth.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> markerHeightAnimated() { return m_markerHeight.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> markerUnitsAnimated() { return m_markerUnits.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedAngle> orientAngleAnimated() { return m_orientAngle.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> orientTypeAnimated() { return m_orientType.animatedProperty(attributeOwnerProxy()); } >+ const SVGLengthValue& refX() const { return m_refX->currentValue(); } >+ const SVGLengthValue& refY() const { return m_refY->currentValue(); } >+ const SVGLengthValue& markerWidth() const { return m_markerWidth->currentValue(); } >+ const SVGLengthValue& markerHeight() const { return m_markerHeight->currentValue(); } >+ SVGMarkerUnitsType markerUnits() const { return m_markerUnits->currentValue<SVGMarkerUnitsType>(); } >+ const SVGAngleValue& orientAngle() const { return m_orientAngle->currentValue(); } >+ SVGMarkerOrientType orientType() const { return m_orientType->currentValue<SVGMarkerOrientType>(); } >+ >+ Ref<SVGAnimatedLength>& refX() { return m_refX; } >+ Ref<SVGAnimatedLength>& refY() { return m_refY; } >+ Ref<SVGAnimatedLength>& markerWidth() { return m_markerWidth; } >+ Ref<SVGAnimatedLength>& markerHeight() { return m_markerHeight; } >+ Ref<SVGAnimatedEnumeration>& markerUnits() { return m_markerUnits; } >+ Ref<SVGAnimatedAngle>& orientAngle() { return m_orientAngle; } >+ Ref<SVGAnimatedEnumeration> orientType() { return m_orientType.copyRef(); } > > private: > SVGMarkerElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGMarkerElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static bool isAnimatedLengthAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isAnimatedLengthAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGMarkerElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > void childrenChanged(const ChildChange&) override; >@@ -97,42 +87,14 @@ private: > > void setOrient(SVGMarkerOrientType, const SVGAngleValue&); > >- static const AtomicString& orientTypeIdentifier(); >- static const AtomicString& orientAngleIdentifier(); >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- >- class SVGAnimatedCustomOrientTypeAttribute : public SVGAnimatedEnumerationAttribute<SVGMarkerOrientType> { >- public: >- using Base = SVGAnimatedEnumerationAttribute<SVGMarkerOrientType>; >- >- SVGAnimatedCustomOrientTypeAttribute(SVGMarkerOrientType baseValue) >- : Base(baseValue) >- { >- } >- void synchronize(Element& element, const QualifiedName& attributeName) >- { >- static const NeverDestroyed<String> autoString = MAKE_STATIC_STRING_IMPL("auto"); >- static const NeverDestroyed<String> autoStartReverseString = MAKE_STATIC_STRING_IMPL("auto-start-reverse"); >- >- if (!shouldSynchronize()) >- return; >- if (value() == SVGMarkerOrientAuto) >- element.setSynchronizedLazyAttribute(attributeName, autoString.get()); >- else if (value() == SVGMarkerOrientAutoStartReverse) >- element.setSynchronizedLazyAttribute(attributeName, autoStartReverseString.get()); >- } >- }; >- >- using SVGAnimatedCustomAngleAttributeAccessor = SVGAnimatedPairAttributeAccessor<SVGMarkerElement, SVGAnimatedAngleAttribute, AnimatedAngle, SVGAnimatedCustomOrientTypeAttribute, AnimatedEnumeration>; >- >- SVGAnimatedLengthAttribute m_refX { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_refY { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_markerWidth { LengthModeWidth, "3" }; >- SVGAnimatedLengthAttribute m_markerHeight { LengthModeHeight, "3" }; >- SVGAnimatedEnumerationAttribute<SVGMarkerUnitsType> m_markerUnits { SVGMarkerUnitsStrokeWidth }; >- SVGAnimatedAngleAttribute m_orientAngle; >- SVGAnimatedCustomOrientTypeAttribute m_orientType { SVGMarkerOrientAngle }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_refX { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_refY { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_markerWidth { SVGAnimatedLength::create(this, LengthModeWidth, "3") }; >+ Ref<SVGAnimatedLength> m_markerHeight { SVGAnimatedLength::create(this, LengthModeHeight, "3") }; >+ Ref<SVGAnimatedEnumeration> m_markerUnits { SVGAnimatedEnumeration::create(this, SVGMarkerUnitsStrokeWidth) }; >+ Ref<SVGAnimatedAngle> m_orientAngle { SVGAnimatedAngle::create(this) }; >+ Ref<SVGAnimatedOrientType> m_orientType { SVGAnimatedOrientType::create(this, SVGMarkerOrientAngle) }; > }; > > } // namespace WebCore >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/SVGMaskElement.cpp b/Source/WebCore/svg/SVGMaskElement.cpp >index cd43fa630e2..7d53a977a76 100644 >--- a/Source/WebCore/svg/SVGMaskElement.cpp >+++ b/Source/WebCore/svg/SVGMaskElement.cpp >@@ -47,7 +47,16 @@ inline SVGMaskElement::SVGMaskElement(const QualifiedName& tagName, Document& do > // Spec: If the x/y attribute is not specified, the effect is as if a value of "-10%" were specified. > // Spec: If the width/height attribute is not specified, the effect is as if a value of "120%" were specified. > ASSERT(hasTagName(SVGNames::maskTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGMaskElement::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGMaskElement::m_y>(); >+ PropertyRegistry::registerProperty<SVGNames::widthAttr, &SVGMaskElement::m_width>(); >+ PropertyRegistry::registerProperty<SVGNames::heightAttr, &SVGMaskElement::m_height>(); >+ PropertyRegistry::registerProperty<SVGNames::maskUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGMaskElement::m_maskUnits>(); >+ PropertyRegistry::registerProperty<SVGNames::maskContentUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGMaskElement::m_maskContentUnits>(); >+ }); > } > > Ref<SVGMaskElement> SVGMaskElement::create(const QualifiedName& tagName, Document& document) >@@ -55,44 +64,31 @@ Ref<SVGMaskElement> SVGMaskElement::create(const QualifiedName& tagName, Documen > return adoptRef(*new SVGMaskElement(tagName, document)); > } > >-void SVGMaskElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::xAttr, &SVGMaskElement::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGMaskElement::m_y>(); >- registry.registerAttribute<SVGNames::widthAttr, &SVGMaskElement::m_width>(); >- registry.registerAttribute<SVGNames::heightAttr, &SVGMaskElement::m_height>(); >- registry.registerAttribute<SVGNames::maskUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGMaskElement::m_maskUnits>(); >- registry.registerAttribute<SVGNames::maskContentUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGMaskElement::m_maskContentUnits>(); >-} >- > void SVGMaskElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::maskUnitsAttr) { > auto propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(value); > if (propertyValue > 0) >- m_maskUnits.setValue(propertyValue); >+ m_maskUnits->setBaseValInternal(propertyValue); > return; > } > if (name == SVGNames::maskContentUnitsAttr) { > auto propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(value); > if (propertyValue > 0) >- m_maskContentUnits.setValue(propertyValue); >+ m_maskContentUnits->setBaseValInternal(propertyValue); > return; > } > > SVGParsingError parseError = NoError; > > if (name == SVGNames::xAttr) >- m_x.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::yAttr) >- m_y.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::widthAttr) >- m_width.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_width->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::heightAttr) >- m_height.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_height->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > > reportAttributeParsingError(parseError, name, value); > >@@ -103,13 +99,13 @@ void SVGMaskElement::parseAttribute(const QualifiedName& name, const AtomicStrin > > void SVGMaskElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isAnimatedLengthAttribute(attrName)) { >+ if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidateSVGPresentationAttributeStyle(); > return; > } > >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > if (auto* renderer = this->renderer()) > renderer->setNeedsLayout(); > return; >diff --git a/Source/WebCore/svg/SVGMaskElement.h b/Source/WebCore/svg/SVGMaskElement.h >index 30be77e80ae..1c26249e500 100644 >--- a/Source/WebCore/svg/SVGMaskElement.h >+++ b/Source/WebCore/svg/SVGMaskElement.h >@@ -20,9 +20,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedLength.h" > #include "SVGElement.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGNames.h" >@@ -36,30 +33,26 @@ class SVGMaskElement final : public SVGElement, public SVGExternalResourcesRequi > public: > static Ref<SVGMaskElement> create(const QualifiedName&, Document&); > >- const SVGLengthValue& x() const { return m_x.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); } >- SVGUnitTypes::SVGUnitType maskUnits() const { return m_maskUnits.currentValue(attributeOwnerProxy()); } >- SVGUnitTypes::SVGUnitType maskContentUnits() const { return m_maskContentUnits.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& x() const { return m_x->currentValue(); } >+ const SVGLengthValue& y() const { return m_y->currentValue(); } >+ const SVGLengthValue& width() const { return m_width->currentValue(); } >+ const SVGLengthValue& height() const { return m_height->currentValue(); } >+ SVGUnitTypes::SVGUnitType maskUnits() const { return m_maskUnits->currentValue<SVGUnitTypes::SVGUnitType>(); } >+ SVGUnitTypes::SVGUnitType maskContentUnits() const { return m_maskContentUnits->currentValue<SVGUnitTypes::SVGUnitType>(); } > >- RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> maskUnitsAnimated() { return m_maskUnits.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> maskContentUnitsAnimated() { return m_maskContentUnits.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& x() { return m_x; } >+ Ref<SVGAnimatedLength>& y() { return m_y; } >+ Ref<SVGAnimatedLength>& width() { return m_width; } >+ Ref<SVGAnimatedLength>& height() { return m_height; } >+ Ref<SVGAnimatedEnumeration>& maskUnits() { return m_maskUnits; } >+ Ref<SVGAnimatedEnumeration>& maskContentUnits() { return m_maskContentUnits; } > > private: > SVGMaskElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGMaskElement, SVGElement, SVGExternalResourcesRequired, SVGTests>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static bool isAnimatedLengthAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isAnimatedLengthAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGMaskElement, SVGElement, SVGExternalResourcesRequired, SVGTests>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > void childrenChanged(const ChildChange&) final; >@@ -70,13 +63,13 @@ private: > bool needsPendingResourceHandling() const final { return false; } > bool selfHasRelativeLengths() const final { return true; } > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_x { LengthModeWidth, "-10%" }; >- SVGAnimatedLengthAttribute m_y { LengthModeHeight, "-10%" }; >- SVGAnimatedLengthAttribute m_width { LengthModeWidth, "120%" }; >- SVGAnimatedLengthAttribute m_height { LengthModeHeight, "120%" }; >- SVGAnimatedEnumerationAttribute<SVGUnitTypes::SVGUnitType> m_maskUnits { SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX }; >- SVGAnimatedEnumerationAttribute<SVGUnitTypes::SVGUnitType> m_maskContentUnits { SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_x { SVGAnimatedLength::create(this, LengthModeWidth, "-10%") }; >+ Ref<SVGAnimatedLength> m_y { SVGAnimatedLength::create(this, LengthModeHeight, "-10%") }; >+ Ref<SVGAnimatedLength> m_width { SVGAnimatedLength::create(this, LengthModeWidth, "120%") }; >+ Ref<SVGAnimatedLength> m_height { SVGAnimatedLength::create(this, LengthModeHeight, "120%") }; >+ Ref<SVGAnimatedEnumeration> m_maskUnits { SVGAnimatedEnumeration::create(this, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) }; >+ Ref<SVGAnimatedEnumeration> m_maskContentUnits { SVGAnimatedEnumeration::create(this, SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGMatrix.h b/Source/WebCore/svg/SVGMatrix.h >index 772ee5843c0..f3d37b824e4 100644 >--- a/Source/WebCore/svg/SVGMatrix.h >+++ b/Source/WebCore/svg/SVGMatrix.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -25,266 +25,180 @@ > > #pragma once > >-#include "SVGMatrixValue.h" >-#include "SVGPropertyTearOff.h" >+#include "AffineTransform.h" >+#include "SVGValueProperty.h" > > namespace WebCore { > > // FIXME: Remove this class once SVGMatrix becomes an alias to DOMMatrix. >-class SVGMatrix : public SVGPropertyTearOff<SVGMatrixValue> { >+class SVGMatrix : public SVGValueProperty<AffineTransform> { > public: >- static Ref<SVGMatrix> create(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGMatrixValue& value) >- { >- return adoptRef(*new SVGMatrix(animatedProperty, role, value)); >- } >+ using Base = SVGValueProperty<AffineTransform>; >+ using Base::Base; > >- static Ref<SVGMatrix> create(const SVGMatrixValue& initialValue = { }) >+ static Ref<SVGMatrix> create(const AffineTransform& value = { }) > { >- return adoptRef(*new SVGMatrix(initialValue)); >+ return adoptRef(*new SVGMatrix(value)); > } > >- template<typename T> static ExceptionOr<Ref<SVGMatrix>> create(ExceptionOr<T>&& initialValue) >+ static Ref<SVGMatrix> create(SVGPropertyOwner* owner, SVGPropertyAccess access, const AffineTransform& value = { }) > { >- if (initialValue.hasException()) >- return initialValue.releaseException(); >- return create(initialValue.releaseReturnValue()); >+ return adoptRef(*new SVGMatrix(owner, access, value)); > } > >- double a() >+ template<typename T> static ExceptionOr<Ref<SVGMatrix>> create(ExceptionOr<T>&& value) > { >- return propertyReference().a(); >+ if (value.hasException()) >+ return value.releaseException(); >+ return create(value.releaseReturnValue()); > } > >- ExceptionOr<void> setA(double value) >+ double a() { return m_value.a(); } >+ ExceptionOr<void> setA(double a) > { > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setA(value); >+ m_value.setA(a); > commitChange(); >- > return { }; > } > >- double b() >- { >- return propertyReference().b(); >- } >- >- ExceptionOr<void> setB(double value) >+ double b() { return m_value.b(); } >+ ExceptionOr<void> setB(double b) > { > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setB(value); >+ m_value.setB(b); > commitChange(); >- > return { }; > } > >- double c() >- { >- return propertyReference().c(); >- } >- >- ExceptionOr<void> setC(double value) >+ double c() { return m_value.c(); } >+ ExceptionOr<void> setC(double c) > { > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setC(value); >+ m_value.setC(c); > commitChange(); >- > return { }; > } > >- double d() >- { >- return propertyReference().d(); >- } >- >- ExceptionOr<void> setD(double value) >+ double d() { return m_value.d(); } >+ ExceptionOr<void> setD(double d) > { > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setD(value); >+ m_value.setD(d); > commitChange(); >- > return { }; > } > >- double e() >- { >- return propertyReference().e(); >- } >- >- ExceptionOr<void> setE(double value) >+ double e() { return m_value.e(); } >+ ExceptionOr<void> setE(double e) > { > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setE(value); >+ m_value.setE(e); > commitChange(); >- > return { }; > } > >- double f() >- { >- return propertyReference().f(); >- } >- >- ExceptionOr<void> setF(double value) >+ double f() { return m_value.f(); } >+ ExceptionOr<void> setF(double f) > { > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setF(value); >+ m_value.setF(f); > commitChange(); >- > return { }; > } > >- ExceptionOr<Ref<SVGMatrix>> multiply(SVGMatrix& secondMatrix) >+ Ref<SVGMatrix> multiply(SVGMatrix& secondMatrix) const > { >- if (isReadOnly()) >- return Exception { NoModificationAllowedError }; >- >- auto result = propertyReference().multiply(secondMatrix.propertyReference()); >- commitChange(); >- >- return SVGMatrix::create(result); >+ auto copy = m_value; >+ copy.multiply(secondMatrix.value()); >+ return SVGMatrix::create(copy); > } > >- ExceptionOr<Ref<SVGMatrix>> inverse() >+ ExceptionOr<Ref<SVGMatrix>> inverse() const > { >- if (isReadOnly()) >- return Exception { NoModificationAllowedError }; >- >- auto result = propertyReference().inverse(); >- if (result.hasException()) >- return result.releaseException(); >+ auto inverse = m_value.inverse(); >+ if (!inverse) >+ return Exception { InvalidStateError, "Matrix is not invertible"_s }; > >- commitChange(); >- return SVGMatrix::create(result.releaseReturnValue()); >+ return SVGMatrix::create(*inverse); > } > >- ExceptionOr<Ref<SVGMatrix>> translate(float x, float y) >+ Ref<SVGMatrix> translate(float x, float y) const > { >- if (isReadOnly()) >- return Exception { NoModificationAllowedError }; >- >- auto result = propertyReference().translate(x, y); >- commitChange(); >- >- return SVGMatrix::create(result); >+ auto copy = m_value; >+ copy.translate(x, y); >+ return SVGMatrix::create(copy); > } > >- ExceptionOr<Ref<SVGMatrix>> scale(float scaleFactor) >+ Ref<SVGMatrix> scale(float scaleFactor) const > { >- if (isReadOnly()) >- return Exception { NoModificationAllowedError }; >- >- auto result = propertyReference().scale(scaleFactor); >- commitChange(); >- >- return SVGMatrix::create(result); >+ auto copy = m_value; >+ copy.scale(scaleFactor, scaleFactor); >+ return SVGMatrix::create(copy); > } > >- ExceptionOr<Ref<SVGMatrix>> scaleNonUniform(float scaleFactorX, float scaleFactorY) >+ Ref<SVGMatrix> scaleNonUniform(float scaleFactorX, float scaleFactorY) const > { >- if (isReadOnly()) >- return Exception { NoModificationAllowedError }; >- >- auto result = propertyReference().scaleNonUniform(scaleFactorX, scaleFactorY); >- commitChange(); >- >- return SVGMatrix::create(result); >+ auto copy = m_value; >+ copy.scale(scaleFactorX, scaleFactorY); >+ return SVGMatrix::create(copy); > } > >- ExceptionOr<Ref<SVGMatrix>> rotate(float angle) >+ Ref<SVGMatrix> rotate(float angle) const > { >- if (isReadOnly()) >- return Exception { NoModificationAllowedError }; >- >- auto result = propertyReference().rotate(angle); >- commitChange(); >- >- return SVGMatrix::create(result); >+ auto copy = m_value; >+ copy.rotate(angle); >+ return SVGMatrix::create(copy); > } > >- ExceptionOr<Ref<SVGMatrix>> rotateFromVector(float x, float y) >+ ExceptionOr<Ref<SVGMatrix>> rotateFromVector(float x, float y) const > { >- if (isReadOnly()) >- return Exception { NoModificationAllowedError }; >- >- auto result = propertyReference().rotateFromVector(x, y); >- if (result.hasException()) >- return result.releaseException(); >+ if (!x || !y) >+ return Exception { TypeError }; > >- commitChange(); >- return SVGMatrix::create(result.releaseReturnValue()); >- } >- >- ExceptionOr<Ref<SVGMatrix>> flipX() >- { >- if (isReadOnly()) >- return Exception { NoModificationAllowedError }; >- >- auto result = propertyReference().flipX(); >- commitChange(); >- >- return SVGMatrix::create(result); >+ auto copy = m_value; >+ copy.rotateFromVector(x, y); >+ return SVGMatrix::create(copy); > } > >- ExceptionOr<Ref<SVGMatrix>> flipY() >+ Ref<SVGMatrix> flipX() const > { >- if (isReadOnly()) >- return Exception { NoModificationAllowedError }; >- >- auto result = propertyReference().flipY(); >- commitChange(); >- >- return SVGMatrix::create(result); >- } >- >- ExceptionOr<Ref<SVGMatrix>> skewX(float angle) >- { >- if (isReadOnly()) >- return Exception { NoModificationAllowedError }; >- >- auto result = propertyReference().skewX(angle); >- commitChange(); >- >- return SVGMatrix::create(result); >- } >- >- ExceptionOr<Ref<SVGMatrix>> skewY(float angle) >- { >- if (isReadOnly()) >- return Exception { NoModificationAllowedError }; >- >- auto result = propertyReference().skewY(angle); >- commitChange(); >- >- return SVGMatrix::create(result); >+ auto copy = m_value; >+ copy.flipX(); >+ return SVGMatrix::create(copy); > } > >-protected: >- SVGMatrix(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGMatrixValue& value) >- : SVGPropertyTearOff<SVGMatrixValue>(&animatedProperty, role, value) >+ Ref<SVGMatrix> flipY() const > { >+ auto copy = m_value; >+ copy.flipY(); >+ return SVGMatrix::create(copy); > } > >- explicit SVGMatrix(const SVGMatrixValue& initialValue) >- : SVGPropertyTearOff<SVGMatrixValue>(initialValue) >+ Ref<SVGMatrix> skewX(float angle) const > { >+ auto copy = m_value; >+ copy.skewX(angle); >+ return SVGMatrix::create(copy); > } > >- explicit SVGMatrix(const SVGMatrixValue* initialValue) >- : SVGPropertyTearOff<SVGMatrixValue>(initialValue) >+ Ref<SVGMatrix> skewY(float angle) const > { >+ auto copy = m_value; >+ copy.skewY(angle); >+ return SVGMatrix::create(copy); > } > }; > >diff --git a/Source/WebCore/svg/SVGMatrix.idl b/Source/WebCore/svg/SVGMatrix.idl >index deff0563ec4..6fa637e14cb 100644 >--- a/Source/WebCore/svg/SVGMatrix.idl >+++ b/Source/WebCore/svg/SVGMatrix.idl >@@ -33,15 +33,15 @@ > attribute unrestricted double e; > attribute unrestricted double f; > >- [MayThrowException] SVGMatrix multiply(SVGMatrix secondMatrix); >- [MayThrowException] SVGMatrix inverse(); >- [MayThrowException] SVGMatrix translate(unrestricted float x, unrestricted float y); >- [MayThrowException] SVGMatrix scale(unrestricted float scaleFactor); >- [MayThrowException] SVGMatrix scaleNonUniform(unrestricted float scaleFactorX, unrestricted float scaleFactorY); >- [MayThrowException] SVGMatrix rotate(unrestricted float angle); >- [MayThrowException] SVGMatrix rotateFromVector(unrestricted float x, unrestricted float y); >- [MayThrowException] SVGMatrix flipX(); >- [MayThrowException] SVGMatrix flipY(); >- [MayThrowException] SVGMatrix skewX(unrestricted float angle); >- [MayThrowException] SVGMatrix skewY(unrestricted float angle); >+ [NewObject] SVGMatrix multiply(SVGMatrix secondMatrix); >+ [MayThrowException, NewObject] SVGMatrix inverse(); >+ [NewObject] SVGMatrix translate(unrestricted float x, unrestricted float y); >+ [NewObject] SVGMatrix scale(unrestricted float scaleFactor); >+ [NewObject] SVGMatrix scaleNonUniform(unrestricted float scaleFactorX, unrestricted float scaleFactorY); >+ [NewObject] SVGMatrix rotate(unrestricted float angle); >+ [MayThrowException, NewObject] SVGMatrix rotateFromVector(unrestricted float x, unrestricted float y); >+ [NewObject] SVGMatrix flipX(); >+ [NewObject] SVGMatrix flipY(); >+ [NewObject] SVGMatrix skewX(unrestricted float angle); >+ [NewObject] SVGMatrix skewY(unrestricted float angle); > }; >diff --git a/Source/WebCore/svg/SVGMatrixValue.h b/Source/WebCore/svg/SVGMatrixValue.h >deleted file mode 100644 >index 1842c650ba4..00000000000 >--- a/Source/WebCore/svg/SVGMatrixValue.h >+++ /dev/null >@@ -1,124 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010. 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 "AffineTransform.h" >-#include "ExceptionOr.h" >- >-namespace WebCore { >- >-class SVGMatrixValue final : public AffineTransform { >-public: >- SVGMatrixValue() = default; >- >- SVGMatrixValue(const AffineTransform& other) >- : AffineTransform(other) >- { >- } >- >- SVGMatrixValue(double a, double b, double c, double d, double e, double f) >- : AffineTransform(a, b, c, d, e, f) >- { >- } >- >- SVGMatrixValue translate(double tx, double ty) >- { >- AffineTransform copy { *this }; >- copy.translate(tx, ty); >- return SVGMatrixValue { copy }; >- } >- >- SVGMatrixValue scale(double s) >- { >- AffineTransform copy { *this }; >- copy.scale(s, s); >- return SVGMatrixValue { copy }; >- } >- >- SVGMatrixValue scaleNonUniform(double sx, double sy) >- { >- AffineTransform copy { *this }; >- copy.scale(sx, sy); >- return SVGMatrixValue { copy }; >- } >- >- SVGMatrixValue rotate(double d) >- { >- AffineTransform copy { *this }; >- copy.rotate(d); >- return SVGMatrixValue { copy }; >- } >- >- SVGMatrixValue flipX() >- { >- AffineTransform copy { *this }; >- copy.flipX(); >- return SVGMatrixValue { copy }; >- } >- >- SVGMatrixValue flipY() >- { >- AffineTransform copy { *this }; >- copy.flipY(); >- return SVGMatrixValue { copy }; >- } >- >- SVGMatrixValue skewX(double angle) >- { >- AffineTransform copy { *this }; >- copy.skewX(angle); >- return SVGMatrixValue { copy }; >- } >- >- SVGMatrixValue skewY(double angle) >- { >- AffineTransform copy { *this }; >- copy.skewY(angle); >- return SVGMatrixValue { copy }; >- } >- >- SVGMatrixValue multiply(const SVGMatrixValue& other) >- { >- AffineTransform copy { *this }; >- copy *= static_cast<const AffineTransform&>(other); >- return SVGMatrixValue { copy }; >- } >- >- ExceptionOr<SVGMatrixValue> inverse() const >- { >- if (auto inverse = AffineTransform::inverse()) >- return SVGMatrixValue { inverse.value() }; >- >- return Exception { InvalidStateError, "Matrix is not invertible"_s }; >- } >- >- ExceptionOr<SVGMatrixValue> rotateFromVector(double x, double y) >- { >- if (!x || !y) >- return Exception { TypeError }; >- >- AffineTransform copy { *this }; >- copy.rotateFromVector(x, y); >- return SVGMatrixValue { copy }; >- } >- >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGNumber.h b/Source/WebCore/svg/SVGNumber.h >index d57801491e8..2e018daa9bf 100644 >--- a/Source/WebCore/svg/SVGNumber.h >+++ b/Source/WebCore/svg/SVGNumber.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -25,32 +25,42 @@ > > #pragma once > >-#include "SVGPropertyTearOff.h" >+#include "SVGValueProperty.h" > > namespace WebCore { > >-class SVGNumber : public SVGPropertyTearOff<float> { >+class SVGNumber : public SVGValueProperty<float> { >+ using Base = SVGValueProperty<float>; >+ using Base::Base; >+ using Base::m_value; >+ > public: >- static Ref<SVGNumber> create(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, float& value) >+ static Ref<SVGNumber> create(float value = 0) > { >- return adoptRef(*new SVGNumber(animatedProperty, role, value)); >+ return adoptRef(*new SVGNumber(value)); > } > >- static Ref<SVGNumber> create(const float& initialValue = { }) >+ static Ref<SVGNumber> create(SVGPropertyOwner* owner, SVGPropertyAccess access, float value = 0) > { >- return adoptRef(*new SVGNumber(initialValue)); >+ return adoptRef(*new SVGNumber(owner, access, value)); > } > >- template<typename T> static ExceptionOr<Ref<SVGNumber>> create(ExceptionOr<T>&& initialValue) >+ template<typename T> >+ static ExceptionOr<Ref<SVGNumber>> create(ExceptionOr<T>&& value) > { >- if (initialValue.hasException()) >- return initialValue.releaseException(); >- return create(initialValue.releaseReturnValue()); >+ if (value.hasException()) >+ return value.releaseException(); >+ return adoptRef(*new SVGNumber(value.releaseReturnValue())); >+ } >+ >+ Ref<SVGNumber> clone() const >+ { >+ return SVGNumber::create(m_value); > } > > float valueForBindings() > { >- return propertyReference(); >+ return m_value; > } > > ExceptionOr<void> setValueForBindings(float value) >@@ -58,21 +68,14 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference() = value; >+ m_value = value; > commitChange(); >- > return { }; > } >- >-private: >- SVGNumber(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, float& value) >- : SVGPropertyTearOff<float>(&animatedProperty, role, value) >- { >- } >- >- explicit SVGNumber(const float& initialValue) >- : SVGPropertyTearOff<float>(initialValue) >+ >+ String valueAsString() const override > { >+ return SVGPropertyTraits<float>::toString(m_value); > } > }; > >diff --git a/Source/WebCore/svg/SVGNumberList.h b/Source/WebCore/svg/SVGNumberList.h >index 1e5cf8b5a0b..239602ca374 100644 >--- a/Source/WebCore/svg/SVGNumberList.h >+++ b/Source/WebCore/svg/SVGNumberList.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -25,26 +25,63 @@ > > #pragma once > >-#include "SVGAnimatedListPropertyTearOff.h" >-#include "SVGListPropertyTearOff.h" >-#include "SVGNumberListValues.h" >+#include "SVGNumber.h" >+#include "SVGValuePropertyList.h" > > namespace WebCore { > >-class SVGNumberList : public SVGListPropertyTearOff<SVGNumberListValues> { >+class SVGNumberList : public SVGValuePropertyList<SVGNumber> { >+ using Base = SVGValuePropertyList<SVGNumber>; >+ using Base::Base; >+ > public: >- using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<SVGNumberListValues>; >- using ListWrapperCache = AnimatedListPropertyTearOff::ListWrapperCache; >+ static Ref<SVGNumberList> create() >+ { >+ return adoptRef(*new SVGNumberList()); >+ } >+ >+ static Ref<SVGNumberList> create(SVGPropertyOwner* owner, SVGPropertyAccess access) >+ { >+ return adoptRef(*new SVGNumberList(owner, access)); >+ } > >- static Ref<SVGNumberList> create(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGNumberListValues& values, ListWrapperCache& wrappers) >+ static Ref<SVGNumberList> create(const SVGNumberList& other, SVGPropertyAccess access) >+ { >+ return adoptRef(*new SVGNumberList(other, access)); >+ } >+ >+ bool parse(const String& value) > { >- return adoptRef(*new SVGNumberList(animatedProperty, role, values, wrappers)); >+ clearItems(); >+ >+ float number = 0; >+ auto upconvertedCharacters = StringView(value).upconvertedCharacters(); >+ const UChar* ptr = upconvertedCharacters; >+ const UChar* end = ptr + value.length(); >+ >+ // The spec (section 4.1) strangely doesn't allow leading whitespace. >+ // We might choose to violate that intentionally. >+ while (ptr < end) { >+ if (!parseNumber(ptr, end, number)) >+ break; >+ append(SVGNumber::create(number)); >+ } >+ >+ return ptr == end; > } > >-private: >- SVGNumberList(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGNumberListValues& values, ListWrapperCache& wrappers) >- : SVGListPropertyTearOff<SVGNumberListValues>(animatedProperty, role, values, wrappers) >+ String valueAsString() const override > { >+ StringBuilder builder; >+ >+ for (const auto& number : m_items) { >+ if (builder.length()) >+ builder.append(' '); >+ >+ builder.appendNumber(number->value()); >+ } >+ >+ return builder.toString(); > } > }; > >diff --git a/Source/WebCore/svg/SVGNumberListValues.cpp b/Source/WebCore/svg/SVGNumberListValues.cpp >deleted file mode 100644 >index 6dfd993b2b4..00000000000 >--- a/Source/WebCore/svg/SVGNumberListValues.cpp >+++ /dev/null >@@ -1,61 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> >- * >- * 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 "SVGNumberListValues.h" >- >-#include "SVGParserUtilities.h" >-#include <wtf/text/StringBuilder.h> >- >-namespace WebCore { >- >-void SVGNumberListValues::parse(const String& value) >-{ >- clear(); >- >- float number = 0; >- auto upconvertedCharacters = StringView(value).upconvertedCharacters(); >- const UChar* ptr = upconvertedCharacters; >- const UChar* end = ptr + value.length(); >- >- // The spec (section 4.1) strangely doesn't allow leading whitespace. We might choose to violate that intentionally. >- while (ptr < end) { >- if (!parseNumber(ptr, end, number)) >- return; >- append(number); >- } >-} >- >-String SVGNumberListValues::valueAsString() const >-{ >- StringBuilder builder; >- >- unsigned size = this->size(); >- for (unsigned i = 0; i < size; ++i) { >- if (i > 0) >- builder.append(' '); >- >- builder.appendNumber(at(i)); >- } >- >- return builder.toString(); >-} >- >-} >diff --git a/Source/WebCore/svg/SVGNumberListValues.h b/Source/WebCore/svg/SVGNumberListValues.h >deleted file mode 100644 >index 30c2db3f988..00000000000 >--- a/Source/WebCore/svg/SVGNumberListValues.h >+++ /dev/null >@@ -1,53 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> >- * >- * 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 "SVGPropertyTraits.h" >-#include <wtf/Vector.h> >- >-namespace WebCore { >- >-class SVGNumber; >-class SVGNumberList; >- >-class SVGNumberListValues final : public Vector<float> { >-public: >- void parse(const String&); >- String valueAsString() const; >-}; >- >-template<> struct SVGPropertyTraits<SVGNumberListValues> { >- static SVGNumberListValues initialValue() { return { }; } >- static SVGNumberListValues fromString(const String& string) >- { >- SVGNumberListValues list; >- list.parse(string); >- return list; >- } >- static std::optional<SVGNumberListValues> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >- static String toString(const SVGNumberListValues& list) { return list.valueAsString(); } >- >- using ListItemType = float; >- using ListItemTearOff = SVGNumber; >- using ListPropertyTearOff = SVGNumberList; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGParserUtilities.cpp b/Source/WebCore/svg/SVGParserUtilities.cpp >index 14069ece903..98243fdc182 100644 >--- a/Source/WebCore/svg/SVGParserUtilities.cpp >+++ b/Source/WebCore/svg/SVGParserUtilities.cpp >@@ -25,7 +25,6 @@ > > #include "Document.h" > #include "FloatRect.h" >-#include "SVGPointListValues.h" > #include <limits> > #include <wtf/ASCIICType.h> > #include <wtf/text/StringView.h> >@@ -260,40 +259,6 @@ bool parseRect(const String& string, FloatRect& rect) > return valid; > } > >-bool pointsListFromSVGData(SVGPointListValues& pointsList, const String& points) >-{ >- if (points.isEmpty()) >- return true; >- auto upconvertedCharacters = StringView(points).upconvertedCharacters(); >- const UChar* cur = upconvertedCharacters; >- const UChar* end = cur + points.length(); >- >- skipOptionalSVGSpaces(cur, end); >- >- bool delimParsed = false; >- while (cur < end) { >- delimParsed = false; >- float xPos = 0.0f; >- if (!parseNumber(cur, end, xPos)) >- return false; >- >- float yPos = 0.0f; >- if (!parseNumber(cur, end, yPos, false)) >- return false; >- >- skipOptionalSVGSpaces(cur, end); >- >- if (cur < end && *cur == ',') { >- delimParsed = true; >- cur++; >- } >- skipOptionalSVGSpaces(cur, end); >- >- pointsList.append(FloatPoint(xPos, yPos)); >- } >- return cur == end && !delimParsed; >-} >- > bool parseGlyphName(const String& input, HashSet<String>& values) > { > // FIXME: Parsing error detection is missing. >diff --git a/Source/WebCore/svg/SVGPathElement.cpp b/Source/WebCore/svg/SVGPathElement.cpp >index f9391b7d388..e35508246d9 100644 >--- a/Source/WebCore/svg/SVGPathElement.cpp >+++ b/Source/WebCore/svg/SVGPathElement.cpp >@@ -27,30 +27,9 @@ > #include "SVGDocumentExtensions.h" > #include "SVGMPathElement.h" > #include "SVGNames.h" >-#include "SVGPathSegArcAbs.h" >-#include "SVGPathSegArcRel.h" >-#include "SVGPathSegClosePath.h" >-#include "SVGPathSegCurvetoCubicAbs.h" >-#include "SVGPathSegCurvetoCubicRel.h" >-#include "SVGPathSegCurvetoCubicSmoothAbs.h" >-#include "SVGPathSegCurvetoCubicSmoothRel.h" >-#include "SVGPathSegCurvetoQuadraticAbs.h" >-#include "SVGPathSegCurvetoQuadraticRel.h" >-#include "SVGPathSegCurvetoQuadraticSmoothAbs.h" >-#include "SVGPathSegCurvetoQuadraticSmoothRel.h" >-#include "SVGPathSegLinetoAbs.h" >-#include "SVGPathSegLinetoHorizontalAbs.h" >-#include "SVGPathSegLinetoHorizontalRel.h" >-#include "SVGPathSegLinetoRel.h" >-#include "SVGPathSegLinetoVerticalAbs.h" >-#include "SVGPathSegLinetoVerticalRel.h" >-#include "SVGPathSegList.h" >-#include "SVGPathSegMovetoAbs.h" >-#include "SVGPathSegMovetoRel.h" > #include "SVGPathUtilities.h" > #include "SVGPoint.h" > #include <wtf/IsoMallocInlines.h> >-#include <wtf/NeverDestroyed.h> > > namespace WebCore { > >@@ -61,7 +40,11 @@ inline SVGPathElement::SVGPathElement(const QualifiedName& tagName, Document& do > , SVGExternalResourcesRequired(this) > { > ASSERT(hasTagName(SVGNames::pathTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::dAttr, &SVGPathElement::m_pathSegList>(); >+ }); > } > > Ref<SVGPathElement> SVGPathElement::create(const QualifiedName& tagName, Document& document) >@@ -90,115 +73,11 @@ unsigned SVGPathElement::getPathSegAtLength(float length) const > return pathSeg; > } > >-Ref<SVGPathSegClosePath> SVGPathElement::createSVGPathSegClosePath(SVGPathSegRole role) >-{ >- return SVGPathSegClosePath::create(*this, role); >-} >- >-Ref<SVGPathSegMovetoAbs> SVGPathElement::createSVGPathSegMovetoAbs(float x, float y, SVGPathSegRole role) >-{ >- return SVGPathSegMovetoAbs::create(*this, role, x, y); >-} >- >-Ref<SVGPathSegMovetoRel> SVGPathElement::createSVGPathSegMovetoRel(float x, float y, SVGPathSegRole role) >-{ >- return SVGPathSegMovetoRel::create(*this, role, x, y); >-} >- >-Ref<SVGPathSegLinetoAbs> SVGPathElement::createSVGPathSegLinetoAbs(float x, float y, SVGPathSegRole role) >-{ >- return SVGPathSegLinetoAbs::create(*this, role, x, y); >-} >- >-Ref<SVGPathSegLinetoRel> SVGPathElement::createSVGPathSegLinetoRel(float x, float y, SVGPathSegRole role) >-{ >- return SVGPathSegLinetoRel::create(*this, role, x, y); >-} >- >-Ref<SVGPathSegCurvetoCubicAbs> SVGPathElement::createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoCubicAbs::create(*this, role, x, y, x1, y1, x2, y2); >-} >- >-Ref<SVGPathSegCurvetoCubicRel> SVGPathElement::createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoCubicRel::create(*this, role, x, y, x1, y1, x2, y2); >-} >- >-Ref<SVGPathSegCurvetoQuadraticAbs> SVGPathElement::createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoQuadraticAbs::create(*this, role, x, y, x1, y1); >-} >- >-Ref<SVGPathSegCurvetoQuadraticRel> SVGPathElement::createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoQuadraticRel::create(*this, role, x, y, x1, y1); >-} >- >-Ref<SVGPathSegArcAbs> SVGPathElement::createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, SVGPathSegRole role) >-{ >- return SVGPathSegArcAbs::create(*this, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag); >-} >- >-Ref<SVGPathSegArcRel> SVGPathElement::createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, SVGPathSegRole role) >-{ >- return SVGPathSegArcRel::create(*this, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag); >-} >- >-Ref<SVGPathSegLinetoHorizontalAbs> SVGPathElement::createSVGPathSegLinetoHorizontalAbs(float x, SVGPathSegRole role) >-{ >- return SVGPathSegLinetoHorizontalAbs::create(*this, role, x); >-} >- >-Ref<SVGPathSegLinetoHorizontalRel> SVGPathElement::createSVGPathSegLinetoHorizontalRel(float x, SVGPathSegRole role) >-{ >- return SVGPathSegLinetoHorizontalRel::create(*this, role, x); >-} >- >-Ref<SVGPathSegLinetoVerticalAbs> SVGPathElement::createSVGPathSegLinetoVerticalAbs(float y, SVGPathSegRole role) >-{ >- return SVGPathSegLinetoVerticalAbs::create(*this, role, y); >-} >- >-Ref<SVGPathSegLinetoVerticalRel> SVGPathElement::createSVGPathSegLinetoVerticalRel(float y, SVGPathSegRole role) >-{ >- return SVGPathSegLinetoVerticalRel::create(*this, role, y); >-} >- >-Ref<SVGPathSegCurvetoCubicSmoothAbs> SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoCubicSmoothAbs::create(*this, role, x, y, x2, y2); >-} >- >-Ref<SVGPathSegCurvetoCubicSmoothRel> SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoCubicSmoothRel::create(*this, role, x, y, x2, y2); >-} >- >-Ref<SVGPathSegCurvetoQuadraticSmoothAbs> SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoQuadraticSmoothAbs::create(*this, role, x, y); >-} >- >-Ref<SVGPathSegCurvetoQuadraticSmoothRel> SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y, SVGPathSegRole role) >-{ >- return SVGPathSegCurvetoQuadraticSmoothRel::create(*this, role, x, y); >-} >- >-void SVGPathElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute(SVGAnimatedCustomPathSegListAttributeAccessor::singleton<SVGNames::dAttr, &SVGPathElement::m_pathSegList>()); >-} >- > void SVGPathElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::dAttr) { >- if (!buildSVGPathByteStreamFromString(value, m_pathByteStream, UnalteredParsing)) >+ if (!m_pathSegList->baseVal()->parse(value)) > document().accessSVGExtensions().reportError("Problem parsing d=\"" + value + "\""); >- m_cachedPath = std::nullopt; > return; > } > >@@ -208,24 +87,14 @@ void SVGPathElement::parseAttribute(const QualifiedName& name, const AtomicStrin > > void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (attrName == SVGNames::dAttr) { > InstanceInvalidationGuard guard(*this); >+ invalidateMPathDependencies(); > >- RenderSVGPath* renderer = downcast<RenderSVGPath>(this->renderer()); >- if (attrName == SVGNames::dAttr) { >- if (m_pathSegList.shouldSynchronize() && !lookupAnimatedProperty(m_pathSegList)->isAnimating()) { >- SVGPathSegListValues newList(PathSegUnalteredRole); >- buildSVGPathSegListValuesFromByteStream(m_pathByteStream, *this, newList, UnalteredParsing); >- m_pathSegList.setValue(WTFMove(newList)); >- } >- >- if (renderer) >- renderer->setNeedsShapeUpdate(); >- invalidateMPathDependencies(); >- } >- >- if (renderer) >+ if (auto* renderer = downcast<RenderSVGPath>(this->renderer())) { >+ renderer->setNeedsShapeUpdate(); > RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >+ } > return; > } > >@@ -258,106 +127,6 @@ void SVGPathElement::removedFromAncestor(RemovalType removalType, ContainerNode& > invalidateMPathDependencies(); > } > >-const SVGPathByteStream& SVGPathElement::pathByteStream() const >-{ >- auto property = lookupAnimatedProperty(m_pathSegList); >- if (!property || !property->isAnimating()) >- return m_pathByteStream; >- >- if (auto* animatedPathByteStream = static_cast<SVGAnimatedPathSegListPropertyTearOff*>(property.get())->animatedPathByteStream()) >- return *animatedPathByteStream; >- >- return m_pathByteStream; >-} >- >-Path SVGPathElement::pathForByteStream() const >-{ >- const auto& pathByteStreamToUse = pathByteStream(); >- >- if (&pathByteStreamToUse == &m_pathByteStream) { >- if (!m_cachedPath) >- m_cachedPath = buildPathFromByteStream(m_pathByteStream); >- return *m_cachedPath; >- } >- >- return buildPathFromByteStream(pathByteStreamToUse); >-} >- >-RefPtr<SVGAnimatedProperty> SVGPathElement::lookupOrCreateDWrapper() >-{ >- return m_pathSegList.animatedProperty(attributeOwnerProxy()); >-} >- >-void SVGPathElement::animatedPropertyWillBeDeleted() >-{ >- // m_pathSegList.shouldSynchronize is set to true when the 'd' wrapper for m_pathSegList >- // is created and cached. We need to reset it back to false when this wrapper is deleted >- // so we can be sure if shouldSynchronize is true, SVGAttributeAccessor::lookupAnimatedProperty() >- // will return a valid cached 'd' wrapper for the m_pathSegList. >- m_pathSegList.setShouldSynchronize(false); >-} >- >-Ref<SVGPathSegList> SVGPathElement::pathSegList() >-{ >- return static_pointer_cast<SVGAnimatedPathSegListPropertyTearOff>(lookupOrCreateDWrapper())->baseVal(); >-} >- >-RefPtr<SVGPathSegList> SVGPathElement::normalizedPathSegList() >-{ >- // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists! >- return nullptr; >-} >- >-Ref<SVGPathSegList> SVGPathElement::animatedPathSegList() >-{ >- m_isAnimValObserved = true; >- return static_pointer_cast<SVGAnimatedPathSegListPropertyTearOff>(lookupOrCreateDWrapper())->animVal(); >-} >- >-RefPtr<SVGPathSegList> SVGPathElement::animatedNormalizedPathSegList() >-{ >- // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists! >- return nullptr; >-} >- >-size_t SVGPathElement::approximateMemoryCost() const >-{ >- // This is an approximation for path memory cost since the path is parsed on demand. >- size_t pathMemoryCost = (m_pathByteStream.size() / 10) * sizeof(FloatPoint); >- // We need to account for the memory which is allocated by the RenderSVGPath::m_path. >- return sizeof(*this) + (renderer() ? pathMemoryCost * 2 + sizeof(RenderSVGPath) : pathMemoryCost); >-} >- >-void SVGPathElement::pathSegListChanged(SVGPathSegRole role, ListModification listModification) >-{ >- switch (role) { >- case PathSegNormalizedRole: >- // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists! >- break; >- case PathSegUnalteredRole: { >- auto& pathSegList = m_pathSegList.value(false); >- if (listModification == ListModificationAppend) { >- ASSERT(!pathSegList.isEmpty()); >- appendSVGPathByteStreamFromSVGPathSeg(pathSegList.last().copyRef(), m_pathByteStream, UnalteredParsing); >- } else >- buildSVGPathByteStreamFromSVGPathSegListValues(pathSegList, m_pathByteStream, UnalteredParsing); >- m_cachedPath = std::nullopt; >- break; >- } >- case PathSegUndefinedRole: >- return; >- } >- >- invalidateSVGAttributes(); >- >- RenderSVGPath* renderer = downcast<RenderSVGPath>(this->renderer()); >- if (!renderer) >- return; >- >- renderer->setNeedsShapeUpdate(); >- RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); >-} >- > FloatRect SVGPathElement::getBBox(StyleUpdateStrategy styleUpdateStrategy) > { > if (styleUpdateStrategy == AllowStyleUpdate) >diff --git a/Source/WebCore/svg/SVGPathElement.h b/Source/WebCore/svg/SVGPathElement.h >index 6c45a1bd0e4..2606900600e 100644 >--- a/Source/WebCore/svg/SVGPathElement.h >+++ b/Source/WebCore/svg/SVGPathElement.h >@@ -22,36 +22,14 @@ > #pragma once > > #include "Path.h" >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedNumber.h" >-#include "SVGAnimatedPath.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGeometryElement.h" > #include "SVGNames.h" > #include "SVGPathByteStream.h" >-#include "SVGPathSegListValues.h" >+#include "SVGPathSegImpl.h" > > namespace WebCore { > >-class SVGPathSegArcAbs; >-class SVGPathSegArcRel; >-class SVGPathSegClosePath; >-class SVGPathSegLinetoAbs; >-class SVGPathSegLinetoRel; >-class SVGPathSegMovetoAbs; >-class SVGPathSegMovetoRel; >-class SVGPathSegCurvetoCubicAbs; >-class SVGPathSegCurvetoCubicRel; >-class SVGPathSegLinetoVerticalAbs; >-class SVGPathSegLinetoVerticalRel; >-class SVGPathSegLinetoHorizontalAbs; >-class SVGPathSegLinetoHorizontalRel; >-class SVGPathSegCurvetoQuadraticAbs; >-class SVGPathSegCurvetoQuadraticRel; >-class SVGPathSegCurvetoCubicSmoothAbs; >-class SVGPathSegCurvetoCubicSmoothRel; >-class SVGPathSegCurvetoQuadraticSmoothAbs; >-class SVGPathSegCurvetoQuadraticSmoothRel; > class SVGPathSegList; > class SVGPoint; > >@@ -60,67 +38,85 @@ class SVGPathElement final : public SVGGeometryElement, public SVGExternalResour > public: > static Ref<SVGPathElement> create(const QualifiedName&, Document&); > >+ static Ref<SVGPathSegClosePath> createSVGPathSegClosePath() { return SVGPathSegClosePath::create(); } >+ static Ref<SVGPathSegMovetoAbs> createSVGPathSegMovetoAbs(float x, float y) { return SVGPathSegMovetoAbs::create(x, y); } >+ static Ref<SVGPathSegMovetoRel> createSVGPathSegMovetoRel(float x, float y) { return SVGPathSegMovetoRel::create(x, y); } >+ static Ref<SVGPathSegLinetoAbs> createSVGPathSegLinetoAbs(float x, float y) { return SVGPathSegLinetoAbs::create(x, y); } >+ static Ref<SVGPathSegLinetoRel> createSVGPathSegLinetoRel(float x, float y) { return SVGPathSegLinetoRel::create(x, y); } >+ static Ref<SVGPathSegCurvetoCubicAbs> createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2) >+ { >+ return SVGPathSegCurvetoCubicAbs::create(x, y, x1, y1, x2, y2); >+ } >+ static Ref<SVGPathSegCurvetoCubicRel> createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2) >+ { >+ return SVGPathSegCurvetoCubicRel::create(x, y, x1, y1, x2, y2); >+ } >+ static Ref<SVGPathSegCurvetoQuadraticAbs> createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1) >+ { >+ return SVGPathSegCurvetoQuadraticAbs::create(x, y, x1, y1); >+ } >+ static Ref<SVGPathSegCurvetoQuadraticRel> createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1) >+ { >+ return SVGPathSegCurvetoQuadraticRel::create(x, y, x1, y1); >+ } >+ static Ref<SVGPathSegArcAbs> createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) >+ { >+ return SVGPathSegArcAbs::create(x, y, r1, r2, angle, largeArcFlag, sweepFlag); >+ } >+ static Ref<SVGPathSegArcRel> createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) >+ { >+ return SVGPathSegArcRel::create(x, y, r1, r2, angle, largeArcFlag, sweepFlag); >+ } >+ static Ref<SVGPathSegLinetoHorizontalAbs> createSVGPathSegLinetoHorizontalAbs(float x) { return SVGPathSegLinetoHorizontalAbs::create(x); } >+ static Ref<SVGPathSegLinetoHorizontalRel> createSVGPathSegLinetoHorizontalRel(float x) { return SVGPathSegLinetoHorizontalRel::create(x); } >+ static Ref<SVGPathSegLinetoVerticalAbs> createSVGPathSegLinetoVerticalAbs(float y) { return SVGPathSegLinetoVerticalAbs::create(y); } >+ static Ref<SVGPathSegLinetoVerticalRel> createSVGPathSegLinetoVerticalRel(float y) { return SVGPathSegLinetoVerticalRel::create(y); } >+ static Ref<SVGPathSegCurvetoCubicSmoothAbs> createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2) >+ { >+ return SVGPathSegCurvetoCubicSmoothAbs::create(x, y, x2, y2); >+ } >+ static Ref<SVGPathSegCurvetoCubicSmoothRel> createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2) >+ { >+ return SVGPathSegCurvetoCubicSmoothRel::create(x, y, x2, y2); >+ } >+ static Ref<SVGPathSegCurvetoQuadraticSmoothAbs> createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y) >+ { >+ return SVGPathSegCurvetoQuadraticSmoothAbs::create(x, y); >+ } >+ static Ref<SVGPathSegCurvetoQuadraticSmoothRel> createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y) >+ { >+ return SVGPathSegCurvetoQuadraticSmoothRel::create(x, y); >+ } >+ > float getTotalLength() const final; > Ref<SVGPoint> getPointAtLength(float distance) const final; > unsigned getPathSegAtLength(float distance) const; >- >- Ref<SVGPathSegClosePath> createSVGPathSegClosePath(SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegMovetoAbs> createSVGPathSegMovetoAbs(float x, float y, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegMovetoRel> createSVGPathSegMovetoRel(float x, float y, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegLinetoAbs> createSVGPathSegLinetoAbs(float x, float y, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegLinetoRel> createSVGPathSegLinetoRel(float x, float y, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoCubicAbs> createSVGPathSegCurvetoCubicAbs(float x, float y, float x1, float y1, float x2, float y2, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoCubicRel> createSVGPathSegCurvetoCubicRel(float x, float y, float x1, float y1, float x2, float y2, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoQuadraticAbs> createSVGPathSegCurvetoQuadraticAbs(float x, float y, float x1, float y1, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoQuadraticRel> createSVGPathSegCurvetoQuadraticRel(float x, float y, float x1, float y1, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegArcAbs> createSVGPathSegArcAbs(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegArcRel> createSVGPathSegArcRel(float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegLinetoHorizontalAbs> createSVGPathSegLinetoHorizontalAbs(float x, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegLinetoHorizontalRel> createSVGPathSegLinetoHorizontalRel(float x, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegLinetoVerticalAbs> createSVGPathSegLinetoVerticalAbs(float y, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegLinetoVerticalRel> createSVGPathSegLinetoVerticalRel(float y, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoCubicSmoothAbs> createSVGPathSegCurvetoCubicSmoothAbs(float x, float y, float x2, float y2, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoCubicSmoothRel> createSVGPathSegCurvetoCubicSmoothRel(float x, float y, float x2, float y2, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoQuadraticSmoothAbs> createSVGPathSegCurvetoQuadraticSmoothAbs(float x, float y, SVGPathSegRole = PathSegUndefinedRole); >- Ref<SVGPathSegCurvetoQuadraticSmoothRel> createSVGPathSegCurvetoQuadraticSmoothRel(float x, float y, SVGPathSegRole = PathSegUndefinedRole); >- >- // Used in the bindings only. >- Ref<SVGPathSegList> pathSegList(); >- Ref<SVGPathSegList> animatedPathSegList(); >- RefPtr<SVGPathSegList> normalizedPathSegList(); >- RefPtr<SVGPathSegList> animatedNormalizedPathSegList(); >- >- const SVGPathByteStream& pathByteStream() const; >- Path pathForByteStream() const; >- >- void pathSegListChanged(SVGPathSegRole, ListModification = ListModificationUnknown); >- > FloatRect getBBox(StyleUpdateStrategy = AllowStyleUpdate) final; >+ >+ Ref<SVGPathSegList>& pathSegList() { return m_pathSegList->baseVal(); } >+ RefPtr<SVGPathSegList>& animatedPathSegList() { return m_pathSegList->animVal(); } > >- bool isAnimValObserved() const { return m_isAnimValObserved; } >- >- void animatedPropertyWillBeDeleted(); >- >- size_t approximateMemoryCost() const final; >+ // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists! >+ RefPtr<SVGPathSegList> normalizedPathSegList() { return nullptr; } >+ RefPtr<SVGPathSegList> animatedNormalizedPathSegList() { return nullptr; } > >- const SVGPathSegListValues& pathSegList() const { return m_pathSegList.currentValue(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedPathSegList> pathSegListAnimated() { return m_pathSegList.animatedProperty(attributeOwnerProxy()); } >+ const SVGPathByteStream& pathByteStream() const { return m_pathSegList->currentPathByteStream(); } >+ Path path() const { return m_pathSegList->currentPath(); } >+ size_t approximateMemoryCost() const final { return m_pathSegList->approximateMemoryCost(); } > > private: > SVGPathElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGPathElement, SVGGeometryElement, SVGExternalResourcesRequired>; >- static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGPathElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >+ >+ static bool isKnownAttribute(const QualifiedName& attributeName) { return PropertyRegistry::isKnownAttribute(attributeName); } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > > bool isValid() const final { return SVGTests::isValid(); } > bool supportsMarkers() const final { return true; } >- RefPtr<SVGAnimatedProperty> lookupOrCreateDWrapper(); > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > >@@ -129,34 +125,8 @@ private: > > void invalidateMPathDependencies(); > >-private: >- SVGPathByteStream m_pathByteStream; >- mutable std::optional<Path> m_cachedPath; >- bool m_isAnimValObserved { false }; >- >- class SVGAnimatedCustomPathSegListAttribute : public SVGAnimatedPathSegListAttribute { >- public: >- SVGAnimatedCustomPathSegListAttribute(SVGPathElement& element) >- : SVGAnimatedPathSegListAttribute(PathSegUnalteredRole) >- , m_element(element) >- { >- } >- >- SVGPathSegListValues& value(bool shouldBuildSegListValues = true) >- { >- if (shouldBuildSegListValues && m_property.isEmpty()) >- buildSVGPathSegListValuesFromByteStream(m_element.m_pathByteStream, m_element, m_property, UnalteredParsing); >- return m_property; >- } >- >- private: >- SVGPathElement& m_element; >- }; >- >- using SVGAnimatedCustomPathSegListAttributeAccessor = SVGAnimatedAttributeAccessor<SVGPathElement, SVGAnimatedCustomPathSegListAttribute, AnimatedPath>; >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedCustomPathSegListAttribute m_pathSegList { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedPathSegList> m_pathSegList { SVGAnimatedPathSegList::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSeg.h b/Source/WebCore/svg/SVGPathSeg.h >index 22a4958b6ae..9c133700bac 100644 >--- a/Source/WebCore/svg/SVGPathSeg.h >+++ b/Source/WebCore/svg/SVGPathSeg.h >@@ -1,6 +1,7 @@ > /* > * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >+ * 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 >@@ -20,7 +21,7 @@ > > #pragma once > >-#include <wtf/RefCounted.h> >+#include "SVGProperty.h" > #include <wtf/text/WTFString.h> > > namespace WebCore { >@@ -48,15 +49,8 @@ enum SVGPathSegType { > PathSegCurveToQuadraticSmoothRel = 19 > }; > >-enum SVGPathSegRole { >- PathSegUnalteredRole = 0, >- PathSegNormalizedRole = 1, >- PathSegUndefinedRole = 2 >-}; >- >-class SVGPathSeg : public RefCounted<SVGPathSeg> { >+class SVGPathSeg : public SVGProperty { > public: >- SVGPathSeg() = default; > virtual ~SVGPathSeg() = default; > > // Forward declare these enums in the w3c naming scheme, for IDL generation >@@ -85,6 +79,10 @@ public: > > virtual unsigned short pathSegType() const = 0; > virtual String pathSegTypeAsLetter() const = 0; >+ virtual Ref<SVGPathSeg> clone() const = 0; >+ >+protected: >+ using SVGProperty::SVGProperty; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegArc.h b/Source/WebCore/svg/SVGPathSegArc.h >deleted file mode 100644 >index a99b2a800f6..00000000000 >--- a/Source/WebCore/svg/SVGPathSegArc.h >+++ /dev/null >@@ -1,101 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * >- * 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 "SVGPathSegWithContext.h" >- >-namespace WebCore { >- >-class SVGPathSegArc : public SVGPathSegWithContext { >-public: >- SVGPathSegArc(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) >- : SVGPathSegWithContext(element, role) >- , m_x(x) >- , m_y(y) >- , m_r1(r1) >- , m_r2(r2) >- , m_angle(angle) >- , m_largeArcFlag(largeArcFlag) >- , m_sweepFlag(sweepFlag) >- { >- } >- >- float x() const { return m_x; } >- void setX(float x) >- { >- m_x = x; >- commitChange(); >- } >- >- float y() const { return m_y; } >- void setY(float y) >- { >- m_y = y; >- commitChange(); >- } >- >- float r1() const { return m_r1; } >- void setR1(float r1) >- { >- m_r1 = r1; >- commitChange(); >- } >- >- float r2() const { return m_r2; } >- void setR2(float r2) >- { >- m_r2 = r2; >- commitChange(); >- } >- >- float angle() const { return m_angle; } >- void setAngle(float angle) >- { >- m_angle = angle; >- commitChange(); >- } >- >- bool largeArcFlag() const { return m_largeArcFlag; } >- void setLargeArcFlag(bool largeArcFlag) >- { >- m_largeArcFlag = largeArcFlag; >- commitChange(); >- } >- >- bool sweepFlag() const { return m_sweepFlag; } >- void setSweepFlag(bool sweepFlag) >- { >- m_sweepFlag = sweepFlag; >- commitChange(); >- } >- >-private: >- float m_x; >- float m_y; >- float m_r1; >- float m_r2; >- float m_angle; >- >- bool m_largeArcFlag : 1; >- bool m_sweepFlag : 1; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegArcAbs.h b/Source/WebCore/svg/SVGPathSegArcAbs.h >deleted file mode 100644 >index a3f755ece92..00000000000 >--- a/Source/WebCore/svg/SVGPathSegArcAbs.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegArc.h" >- >-namespace WebCore { >- >-class SVGPathSegArcAbs final : public SVGPathSegArc { >-public: >- static Ref<SVGPathSegArcAbs> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) >- { >- return adoptRef(*new SVGPathSegArcAbs(element, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag)); >- } >- >-private: >- SVGPathSegArcAbs(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) >- : SVGPathSegArc(element, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_ARC_ABS; } >- String pathSegTypeAsLetter() const final { return "A"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegArcRel.h b/Source/WebCore/svg/SVGPathSegArcRel.h >deleted file mode 100644 >index 5feec6799e7..00000000000 >--- a/Source/WebCore/svg/SVGPathSegArcRel.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegArc.h" >- >-namespace WebCore { >- >-class SVGPathSegArcRel final : public SVGPathSegArc { >-public: >- static Ref<SVGPathSegArcRel> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) >- { >- return adoptRef(*new SVGPathSegArcRel(element, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag)); >- } >- >-private: >- SVGPathSegArcRel(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag) >- : SVGPathSegArc(element, role, x, y, r1, r2, angle, largeArcFlag, sweepFlag) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_ARC_REL; } >- String pathSegTypeAsLetter() const final { return "a"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegClosePath.h b/Source/WebCore/svg/SVGPathSegClosePath.h >deleted file mode 100644 >index 917d72b68d9..00000000000 >--- a/Source/WebCore/svg/SVGPathSegClosePath.h >+++ /dev/null >@@ -1,44 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> >- * >- * 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 "SVGPathSegWithContext.h" >- >-namespace WebCore { >- >-class SVGPathSegClosePath final : public SVGPathSegWithContext { >-public: >- static Ref<SVGPathSegClosePath> create(const SVGPathElement& element, SVGPathSegRole role) >- { >- return adoptRef(*new SVGPathSegClosePath(element, role)); >- } >- >-private: >- SVGPathSegClosePath(const SVGPathElement& element, SVGPathSegRole role) >- : SVGPathSegWithContext(element, role) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_CLOSEPATH; } >- String pathSegTypeAsLetter() const final { return "Z"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegCurvetoCubic.h b/Source/WebCore/svg/SVGPathSegCurvetoCubic.h >deleted file mode 100644 >index d6b853cf229..00000000000 >--- a/Source/WebCore/svg/SVGPathSegCurvetoCubic.h >+++ /dev/null >@@ -1,91 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * >- * 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 "SVGPathSegWithContext.h" >- >-namespace WebCore { >- >-class SVGPathSegCurvetoCubic : public SVGPathSegWithContext { >-public: >- SVGPathSegCurvetoCubic(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1, float x2, float y2) >- : SVGPathSegWithContext(element, role) >- , m_x(x) >- , m_y(y) >- , m_x1(x1) >- , m_y1(y1) >- , m_x2(x2) >- , m_y2(y2) >- { >- } >- >- float x() const { return m_x; } >- void setX(float x) >- { >- m_x = x; >- commitChange(); >- } >- >- float y() const { return m_y; } >- void setY(float y) >- { >- m_y = y; >- commitChange(); >- } >- >- float x1() const { return m_x1; } >- void setX1(float x1) >- { >- m_x1 = x1; >- commitChange(); >- } >- >- float y1() const { return m_y1; } >- void setY1(float y1) >- { >- m_y1 = y1; >- commitChange(); >- } >- >- float x2() const { return m_x2; } >- void setX2(float x2) >- { >- m_x2 = x2; >- commitChange(); >- } >- >- float y2() const { return m_y2; } >- void setY2(float y2) >- { >- m_y2 = y2; >- commitChange(); >- } >- >-private: >- float m_x; >- float m_y; >- float m_x1; >- float m_y1; >- float m_x2; >- float m_y2; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegCurvetoCubicAbs.h b/Source/WebCore/svg/SVGPathSegCurvetoCubicAbs.h >deleted file mode 100644 >index d4ff54c12c1..00000000000 >--- a/Source/WebCore/svg/SVGPathSegCurvetoCubicAbs.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegCurvetoCubic.h" >- >-namespace WebCore { >- >-class SVGPathSegCurvetoCubicAbs final : public SVGPathSegCurvetoCubic { >-public: >- static Ref<SVGPathSegCurvetoCubicAbs> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1, float x2, float y2) >- { >- return adoptRef(*new SVGPathSegCurvetoCubicAbs(element, role, x, y, x1, y1, x2, y2)); >- } >- >-private: >- SVGPathSegCurvetoCubicAbs(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1, float x2, float y2) >- : SVGPathSegCurvetoCubic(element, role, x, y, x1, y1, x2, y2) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_CURVETO_CUBIC_ABS; } >- String pathSegTypeAsLetter() const final { return "C"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegCurvetoCubicRel.h b/Source/WebCore/svg/SVGPathSegCurvetoCubicRel.h >deleted file mode 100644 >index 78a2d4129b9..00000000000 >--- a/Source/WebCore/svg/SVGPathSegCurvetoCubicRel.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegCurvetoCubic.h" >- >-namespace WebCore { >- >-class SVGPathSegCurvetoCubicRel final : public SVGPathSegCurvetoCubic { >-public: >- static Ref<SVGPathSegCurvetoCubicRel> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1, float x2, float y2) >- { >- return adoptRef(*new SVGPathSegCurvetoCubicRel(element, role, x, y, x1, y1, x2, y2)); >- } >- >-private: >- SVGPathSegCurvetoCubicRel(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1, float x2, float y2) >- : SVGPathSegCurvetoCubic(element, role, x, y, x1, y1, x2, y2) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_CURVETO_CUBIC_REL; } >- String pathSegTypeAsLetter() const final { return "c"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h b/Source/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h >deleted file mode 100644 >index 4e6053280b3..00000000000 >--- a/Source/WebCore/svg/SVGPathSegCurvetoCubicSmooth.h >+++ /dev/null >@@ -1,73 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * >- * 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 "SVGPathSegWithContext.h" >- >-namespace WebCore { >- >-class SVGPathSegCurvetoCubicSmooth : public SVGPathSegWithContext { >-public: >- SVGPathSegCurvetoCubicSmooth(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x2, float y2) >- : SVGPathSegWithContext(element, role) >- , m_x(x) >- , m_y(y) >- , m_x2(x2) >- , m_y2(y2) >- { >- } >- >- float x() const { return m_x; } >- void setX(float x) >- { >- m_x = x; >- commitChange(); >- } >- >- float y() const { return m_y; } >- void setY(float y) >- { >- m_y = y; >- commitChange(); >- } >- >- float x2() const { return m_x2; } >- void setX2(float x2) >- { >- m_x2 = x2; >- commitChange(); >- } >- >- float y2() const { return m_y2; } >- void setY2(float y2) >- { >- m_y2 = y2; >- commitChange(); >- } >- >-private: >- float m_x; >- float m_y; >- float m_x2; >- float m_y2; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegCurvetoCubicSmoothAbs.h b/Source/WebCore/svg/SVGPathSegCurvetoCubicSmoothAbs.h >deleted file mode 100644 >index 98dd74c3477..00000000000 >--- a/Source/WebCore/svg/SVGPathSegCurvetoCubicSmoothAbs.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegCurvetoCubicSmooth.h" >- >-namespace WebCore { >- >-class SVGPathSegCurvetoCubicSmoothAbs final : public SVGPathSegCurvetoCubicSmooth { >-public: >- static Ref<SVGPathSegCurvetoCubicSmoothAbs> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x2, float y2) >- { >- return adoptRef(*new SVGPathSegCurvetoCubicSmoothAbs(element, role, x, y, x2, y2)); >- } >- >-private: >- SVGPathSegCurvetoCubicSmoothAbs(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x2, float y2) >- : SVGPathSegCurvetoCubicSmooth(element, role, x, y, x2, y2) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_CURVETO_CUBIC_SMOOTH_ABS; } >- String pathSegTypeAsLetter() const final { return "S"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegCurvetoCubicSmoothRel.h b/Source/WebCore/svg/SVGPathSegCurvetoCubicSmoothRel.h >deleted file mode 100644 >index 1b5d0886101..00000000000 >--- a/Source/WebCore/svg/SVGPathSegCurvetoCubicSmoothRel.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegCurvetoCubicSmooth.h" >- >-namespace WebCore { >- >-class SVGPathSegCurvetoCubicSmoothRel final : public SVGPathSegCurvetoCubicSmooth { >-public: >- static Ref<SVGPathSegCurvetoCubicSmoothRel> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x2, float y2) >- { >- return adoptRef(*new SVGPathSegCurvetoCubicSmoothRel(element, role, x, y, x2, y2)); >- } >- >-private: >- SVGPathSegCurvetoCubicSmoothRel(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x2, float y2) >- : SVGPathSegCurvetoCubicSmooth(element, role, x, y, x2, y2) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_CURVETO_CUBIC_SMOOTH_REL; } >- String pathSegTypeAsLetter() const final { return "s"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegCurvetoQuadratic.h b/Source/WebCore/svg/SVGPathSegCurvetoQuadratic.h >deleted file mode 100644 >index 99435e0a963..00000000000 >--- a/Source/WebCore/svg/SVGPathSegCurvetoQuadratic.h >+++ /dev/null >@@ -1,73 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * >- * 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 "SVGPathSegWithContext.h" >- >-namespace WebCore { >- >-class SVGPathSegCurvetoQuadratic : public SVGPathSegWithContext { >-public: >- SVGPathSegCurvetoQuadratic(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1) >- : SVGPathSegWithContext(element, role) >- , m_x(x) >- , m_y(y) >- , m_x1(x1) >- , m_y1(y1) >- { >- } >- >- float x() const { return m_x; } >- void setX(float x) >- { >- m_x = x; >- commitChange(); >- } >- >- float y() const { return m_y; } >- void setY(float y) >- { >- m_y = y; >- commitChange(); >- } >- >- float x1() const { return m_x1; } >- void setX1(float x1) >- { >- m_x1 = x1; >- commitChange(); >- } >- >- float y1() const { return m_y1; } >- void setY1(float y1) >- { >- m_y1 = y1; >- commitChange(); >- } >- >-private: >- float m_x; >- float m_y; >- float m_x1; >- float m_y1; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegCurvetoQuadraticAbs.h b/Source/WebCore/svg/SVGPathSegCurvetoQuadraticAbs.h >deleted file mode 100644 >index dec36dbd06b..00000000000 >--- a/Source/WebCore/svg/SVGPathSegCurvetoQuadraticAbs.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegCurvetoQuadratic.h" >- >-namespace WebCore { >- >-class SVGPathSegCurvetoQuadraticAbs final : public SVGPathSegCurvetoQuadratic { >-public: >- static Ref<SVGPathSegCurvetoQuadraticAbs> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1) >- { >- return adoptRef(*new SVGPathSegCurvetoQuadraticAbs(element, role, x, y, x1, y1)); >- } >- >-private: >- SVGPathSegCurvetoQuadraticAbs(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1) >- : SVGPathSegCurvetoQuadratic(element, role, x, y, x1, y1) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_CURVETO_QUADRATIC_ABS; } >- String pathSegTypeAsLetter() const final { return "Q"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegCurvetoQuadraticRel.h b/Source/WebCore/svg/SVGPathSegCurvetoQuadraticRel.h >deleted file mode 100644 >index 7a0ca059d86..00000000000 >--- a/Source/WebCore/svg/SVGPathSegCurvetoQuadraticRel.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegCurvetoQuadratic.h" >- >-namespace WebCore { >- >-class SVGPathSegCurvetoQuadraticRel final : public SVGPathSegCurvetoQuadratic { >-public: >- static Ref<SVGPathSegCurvetoQuadraticRel> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1) >- { >- return adoptRef(*new SVGPathSegCurvetoQuadraticRel(element, role, x, y, x1, y1)); >- } >- >-private: >- SVGPathSegCurvetoQuadraticRel(const SVGPathElement& element, SVGPathSegRole role, float x, float y, float x1, float y1) >- : SVGPathSegCurvetoQuadratic(element, role, x, y, x1, y1) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_CURVETO_QUADRATIC_REL; } >- String pathSegTypeAsLetter() const final { return "q"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegCurvetoQuadraticSmoothAbs.h b/Source/WebCore/svg/SVGPathSegCurvetoQuadraticSmoothAbs.h >deleted file mode 100644 >index 898fabb19f2..00000000000 >--- a/Source/WebCore/svg/SVGPathSegCurvetoQuadraticSmoothAbs.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegWithContext.h" >- >-namespace WebCore { >- >-class SVGPathSegCurvetoQuadraticSmoothAbs final : public SVGPathSegSingleCoordinate { >-public: >- static Ref<SVGPathSegCurvetoQuadraticSmoothAbs> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y) >- { >- return adoptRef(*new SVGPathSegCurvetoQuadraticSmoothAbs(element, role, x, y)); >- } >- >-private: >- SVGPathSegCurvetoQuadraticSmoothAbs(const SVGPathElement& element, SVGPathSegRole role, float x, float y) >- : SVGPathSegSingleCoordinate(element, role, x, y) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS; } >- String pathSegTypeAsLetter() const final { return "T"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegCurvetoQuadraticSmoothRel.h b/Source/WebCore/svg/SVGPathSegCurvetoQuadraticSmoothRel.h >deleted file mode 100644 >index e97a10d2b6d..00000000000 >--- a/Source/WebCore/svg/SVGPathSegCurvetoQuadraticSmoothRel.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegWithContext.h" >- >-namespace WebCore { >- >-class SVGPathSegCurvetoQuadraticSmoothRel final : public SVGPathSegSingleCoordinate { >-public: >- static Ref<SVGPathSegCurvetoQuadraticSmoothRel> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y) >- { >- return adoptRef(*new SVGPathSegCurvetoQuadraticSmoothRel(element, role, x, y)); >- } >- >-private: >- SVGPathSegCurvetoQuadraticSmoothRel(const SVGPathElement& element, SVGPathSegRole role, float x, float y) >- : SVGPathSegSingleCoordinate(element, role, x, y) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL; } >- String pathSegTypeAsLetter() const final { return "t"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegImpl.h b/Source/WebCore/svg/SVGPathSegImpl.h >new file mode 100644 >index 00000000000..2fa225a32de >--- /dev/null >+++ b/Source/WebCore/svg/SVGPathSegImpl.h >@@ -0,0 +1,223 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGPathSegValue.h" >+ >+namespace WebCore { >+ >+class SVGPathSegClosePath final : public SVGPathSeg { >+public: >+ static Ref<SVGPathSegClosePath> create() { return adoptRef(*new SVGPathSegClosePath()); } >+private: >+ using SVGPathSeg::SVGPathSeg; >+ unsigned short pathSegType() const final { return PATHSEG_CLOSEPATH; } >+ String pathSegTypeAsLetter() const final { return "Z"; } >+ Ref<SVGPathSeg> clone() const final { return adoptRef(*new SVGPathSegClosePath()); } >+}; >+ >+class SVGPathSegLinetoHorizontalAbs final : public SVGPathSegLinetoHorizontal { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegLinetoHorizontalAbs>; >+private: >+ using SVGPathSegLinetoHorizontal::SVGPathSegLinetoHorizontal; >+ unsigned short pathSegType() const final { return PATHSEG_LINETO_HORIZONTAL_ABS; } >+ String pathSegTypeAsLetter() const final { return "H"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegLinetoHorizontalAbs>(); } >+}; >+ >+class SVGPathSegLinetoHorizontalRel final : public SVGPathSegLinetoHorizontal { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegLinetoHorizontalRel>; >+private: >+ using SVGPathSegLinetoHorizontal::SVGPathSegLinetoHorizontal; >+ unsigned short pathSegType() const final { return PATHSEG_LINETO_HORIZONTAL_REL; } >+ String pathSegTypeAsLetter() const final { return "h"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegLinetoHorizontalRel>(); } >+}; >+ >+class SVGPathSegLinetoVerticalAbs final : public SVGPathSegLinetoVertical { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegLinetoVerticalAbs>; >+private: >+ using SVGPathSegLinetoVertical::SVGPathSegLinetoVertical; >+ unsigned short pathSegType() const final { return PATHSEG_LINETO_VERTICAL_ABS; } >+ String pathSegTypeAsLetter() const final { return "V"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegLinetoVerticalAbs>(); } >+}; >+ >+ >+class SVGPathSegLinetoVerticalRel final : public SVGPathSegLinetoVertical { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegLinetoVerticalRel>; >+private: >+ using SVGPathSegLinetoVertical::SVGPathSegLinetoVertical; >+ unsigned short pathSegType() const final { return PATHSEG_LINETO_VERTICAL_REL; } >+ String pathSegTypeAsLetter() const final { return "v"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegLinetoVerticalRel>(); } >+}; >+ >+class SVGPathSegMovetoAbs final : public SVGPathSegSingleCoordinate { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegMovetoAbs>; >+private: >+ using SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate; >+ unsigned short pathSegType() const final { return PATHSEG_MOVETO_ABS; } >+ String pathSegTypeAsLetter() const final { return "M"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegMovetoAbs>(); } >+}; >+ >+class SVGPathSegMovetoRel final : public SVGPathSegSingleCoordinate { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegMovetoRel>; >+private: >+ using SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate; >+ unsigned short pathSegType() const final { return PATHSEG_MOVETO_REL; } >+ String pathSegTypeAsLetter() const final { return "m"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegMovetoRel>(); } >+}; >+ >+class SVGPathSegLinetoAbs final : public SVGPathSegSingleCoordinate { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegLinetoAbs>; >+private: >+ using SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate; >+ unsigned short pathSegType() const final { return PATHSEG_LINETO_ABS; } >+ String pathSegTypeAsLetter() const final { return "L"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegLinetoAbs>(); } >+}; >+ >+class SVGPathSegLinetoRel final : public SVGPathSegSingleCoordinate { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegLinetoRel>; >+private: >+ using SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate; >+ unsigned short pathSegType() const final { return PATHSEG_LINETO_REL; } >+ String pathSegTypeAsLetter() const final { return "l"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegLinetoRel>(); } >+}; >+ >+class SVGPathSegCurvetoQuadraticAbs final : public SVGPathSegCurvetoQuadratic { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegCurvetoQuadraticAbs>; >+private: >+ using SVGPathSegCurvetoQuadratic::SVGPathSegCurvetoQuadratic; >+ unsigned short pathSegType() const final { return PATHSEG_CURVETO_QUADRATIC_ABS; } >+ String pathSegTypeAsLetter() const final { return "Q"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegCurvetoQuadraticAbs>(); } >+}; >+ >+class SVGPathSegCurvetoQuadraticRel final : public SVGPathSegCurvetoQuadratic { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegCurvetoQuadraticRel>; >+private: >+ using SVGPathSegCurvetoQuadratic::SVGPathSegCurvetoQuadratic; >+ unsigned short pathSegType() const final { return PATHSEG_CURVETO_QUADRATIC_REL; } >+ String pathSegTypeAsLetter() const final { return "q"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegCurvetoQuadraticRel>(); } >+}; >+ >+class SVGPathSegCurvetoCubicAbs final : public SVGPathSegCurvetoCubic { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegCurvetoCubicAbs>; >+private: >+ using SVGPathSegCurvetoCubic::SVGPathSegCurvetoCubic; >+ unsigned short pathSegType() const final { return PATHSEG_CURVETO_CUBIC_ABS; } >+ String pathSegTypeAsLetter() const final { return "C"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegCurvetoCubicAbs>(); } >+}; >+ >+class SVGPathSegCurvetoCubicRel final : public SVGPathSegCurvetoCubic { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegCurvetoCubicRel>; >+private: >+ using SVGPathSegCurvetoCubic::SVGPathSegCurvetoCubic; >+ unsigned short pathSegType() const final { return PATHSEG_CURVETO_CUBIC_REL; } >+ String pathSegTypeAsLetter() const final { return "c"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegCurvetoCubicRel>(); } >+}; >+ >+class SVGPathSegArcAbs final : public SVGPathSegArc { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegArcAbs>; >+private: >+ using SVGPathSegArc::SVGPathSegArc; >+ unsigned short pathSegType() const final { return PATHSEG_ARC_ABS; } >+ String pathSegTypeAsLetter() const final { return "A"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegArcAbs>(); } >+}; >+ >+class SVGPathSegArcRel final : public SVGPathSegArc { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegArcRel>; >+private: >+ using SVGPathSegArc::SVGPathSegArc; >+ unsigned short pathSegType() const final { return PATHSEG_ARC_REL; } >+ String pathSegTypeAsLetter() const final { return "a"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegArcRel>(); } >+}; >+ >+class SVGPathSegCurvetoQuadraticSmoothAbs final : public SVGPathSegSingleCoordinate { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegCurvetoQuadraticSmoothAbs>; >+private: >+ using SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate; >+ unsigned short pathSegType() const final { return PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS; } >+ String pathSegTypeAsLetter() const final { return "T"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegCurvetoQuadraticSmoothAbs>(); } >+}; >+ >+class SVGPathSegCurvetoQuadraticSmoothRel final : public SVGPathSegSingleCoordinate { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegCurvetoQuadraticSmoothRel>; >+private: >+ using SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate; >+ unsigned short pathSegType() const final { return PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL; } >+ String pathSegTypeAsLetter() const final { return "t"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegCurvetoQuadraticSmoothRel>(); } >+}; >+ >+class SVGPathSegCurvetoCubicSmoothAbs final : public SVGPathSegCurvetoCubicSmooth { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegCurvetoCubicSmoothAbs>; >+private: >+ using SVGPathSegCurvetoCubicSmooth::SVGPathSegCurvetoCubicSmooth; >+ unsigned short pathSegType() const final { return PATHSEG_CURVETO_CUBIC_SMOOTH_ABS; } >+ String pathSegTypeAsLetter() const final { return "S"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegCurvetoCubicSmoothAbs>(); } >+}; >+ >+class SVGPathSegCurvetoCubicSmoothRel final : public SVGPathSegCurvetoCubicSmooth { >+public: >+ constexpr static auto create = SVGPathSegValue::create<SVGPathSegCurvetoCubicSmoothRel>; >+private: >+ using SVGPathSegCurvetoCubicSmooth::SVGPathSegCurvetoCubicSmooth; >+ unsigned short pathSegType() const final { return PATHSEG_CURVETO_CUBIC_SMOOTH_REL; } >+ String pathSegTypeAsLetter() const final { return "s"; } >+ Ref<SVGPathSeg> clone() const final { return SVGPathSegValue::clone<SVGPathSegCurvetoCubicSmoothRel>(); } >+}; >+ >+} >diff --git a/Source/WebCore/svg/SVGPathSegLinetoAbs.h b/Source/WebCore/svg/SVGPathSegLinetoAbs.h >deleted file mode 100644 >index 2addfaaffc1..00000000000 >--- a/Source/WebCore/svg/SVGPathSegLinetoAbs.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegWithContext.h" >- >-namespace WebCore { >- >-class SVGPathSegLinetoAbs final : public SVGPathSegSingleCoordinate { >-public: >- static Ref<SVGPathSegLinetoAbs> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y) >- { >- return adoptRef(*new SVGPathSegLinetoAbs(element, role, x, y)); >- } >- >-private: >- SVGPathSegLinetoAbs(const SVGPathElement& element, SVGPathSegRole role, float x, float y) >- : SVGPathSegSingleCoordinate(element, role, x, y) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_LINETO_ABS; } >- String pathSegTypeAsLetter() const final { return "L"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegLinetoHorizontal.h b/Source/WebCore/svg/SVGPathSegLinetoHorizontal.h >deleted file mode 100644 >index 479845d5dfb..00000000000 >--- a/Source/WebCore/svg/SVGPathSegLinetoHorizontal.h >+++ /dev/null >@@ -1,46 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * >- * 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 "SVGPathSegWithContext.h" >- >-namespace WebCore { >- >-class SVGPathSegLinetoHorizontal : public SVGPathSegWithContext { >-public: >- SVGPathSegLinetoHorizontal(const SVGPathElement& element, SVGPathSegRole role, float x) >- : SVGPathSegWithContext(element, role) >- , m_x(x) >- { >- } >- >- float x() const { return m_x; } >- void setX(float x) >- { >- m_x = x; >- commitChange(); >- } >- >-private: >- float m_x; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegLinetoHorizontalAbs.h b/Source/WebCore/svg/SVGPathSegLinetoHorizontalAbs.h >deleted file mode 100644 >index f0457c11f25..00000000000 >--- a/Source/WebCore/svg/SVGPathSegLinetoHorizontalAbs.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegLinetoHorizontal.h" >- >-namespace WebCore { >- >-class SVGPathSegLinetoHorizontalAbs final : public SVGPathSegLinetoHorizontal { >-public: >- static Ref<SVGPathSegLinetoHorizontalAbs> create(const SVGPathElement& element, SVGPathSegRole role, float x) >- { >- return adoptRef(*new SVGPathSegLinetoHorizontalAbs(element, role, x)); >- } >- >-private: >- SVGPathSegLinetoHorizontalAbs(const SVGPathElement& element, SVGPathSegRole role, float x) >- : SVGPathSegLinetoHorizontal(element, role, x) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_LINETO_HORIZONTAL_ABS; } >- String pathSegTypeAsLetter() const final { return "H"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegLinetoHorizontalRel.h b/Source/WebCore/svg/SVGPathSegLinetoHorizontalRel.h >deleted file mode 100644 >index c0622ac0391..00000000000 >--- a/Source/WebCore/svg/SVGPathSegLinetoHorizontalRel.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegLinetoHorizontal.h" >- >-namespace WebCore { >- >-class SVGPathSegLinetoHorizontalRel final : public SVGPathSegLinetoHorizontal { >-public: >- static Ref<SVGPathSegLinetoHorizontalRel> create(const SVGPathElement& element, SVGPathSegRole role, float x) >- { >- return adoptRef(*new SVGPathSegLinetoHorizontalRel(element, role, x)); >- } >- >-private: >- SVGPathSegLinetoHorizontalRel(const SVGPathElement& element, SVGPathSegRole role, float x) >- : SVGPathSegLinetoHorizontal(element, role, x) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_LINETO_HORIZONTAL_REL; } >- String pathSegTypeAsLetter() const final { return "h"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegLinetoRel.h b/Source/WebCore/svg/SVGPathSegLinetoRel.h >deleted file mode 100644 >index dcdf4838ac3..00000000000 >--- a/Source/WebCore/svg/SVGPathSegLinetoRel.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegWithContext.h" >- >-namespace WebCore { >- >-class SVGPathSegLinetoRel final : public SVGPathSegSingleCoordinate { >-public: >- static Ref<SVGPathSegLinetoRel> create(const SVGPathElement& element, SVGPathSegRole role, float x, float y) >- { >- return adoptRef(*new SVGPathSegLinetoRel(element, role, x, y)); >- } >- >-private: >- SVGPathSegLinetoRel(const SVGPathElement& element, SVGPathSegRole role, float x, float y) >- : SVGPathSegSingleCoordinate(element, role, x, y) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_LINETO_REL; } >- String pathSegTypeAsLetter() const final { return "l"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegLinetoVertical.h b/Source/WebCore/svg/SVGPathSegLinetoVertical.h >deleted file mode 100644 >index 9d24d77dfb0..00000000000 >--- a/Source/WebCore/svg/SVGPathSegLinetoVertical.h >+++ /dev/null >@@ -1,46 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * >- * 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 "SVGPathSegWithContext.h" >- >-namespace WebCore { >- >-class SVGPathSegLinetoVertical : public SVGPathSegWithContext { >-public: >- SVGPathSegLinetoVertical(const SVGPathElement& element, SVGPathSegRole role, float y) >- : SVGPathSegWithContext(element, role) >- , m_y(y) >- { >- } >- >- float y() const { return m_y; } >- void setY(float y) >- { >- m_y = y; >- commitChange(); >- } >- >-private: >- float m_y; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegLinetoVerticalAbs.h b/Source/WebCore/svg/SVGPathSegLinetoVerticalAbs.h >deleted file mode 100644 >index d859a51edfa..00000000000 >--- a/Source/WebCore/svg/SVGPathSegLinetoVerticalAbs.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegLinetoVertical.h" >- >-namespace WebCore { >- >-class SVGPathSegLinetoVerticalAbs final : public SVGPathSegLinetoVertical { >-public: >- static Ref<SVGPathSegLinetoVerticalAbs> create(const SVGPathElement& element, SVGPathSegRole role, float y) >- { >- return adoptRef(*new SVGPathSegLinetoVerticalAbs(element, role, y)); >- } >- >-private: >- SVGPathSegLinetoVerticalAbs(const SVGPathElement& element, SVGPathSegRole role, float y) >- : SVGPathSegLinetoVertical(element, role, y) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_LINETO_VERTICAL_ABS; } >- String pathSegTypeAsLetter() const final { return "V"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegLinetoVerticalRel.h b/Source/WebCore/svg/SVGPathSegLinetoVerticalRel.h >deleted file mode 100644 >index c180c7eda4b..00000000000 >--- a/Source/WebCore/svg/SVGPathSegLinetoVerticalRel.h >+++ /dev/null >@@ -1,45 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >- * Copyright (C) 2013 Samsung Electronics. 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 "SVGPathSegLinetoVertical.h" >- >-namespace WebCore { >- >-class SVGPathSegLinetoVerticalRel final : public SVGPathSegLinetoVertical { >-public: >- static Ref<SVGPathSegLinetoVerticalRel> create(const SVGPathElement& element, SVGPathSegRole role, float y) >- { >- return adoptRef(*new SVGPathSegLinetoVerticalRel(element, role, y)); >- } >- >-private: >- SVGPathSegLinetoVerticalRel(const SVGPathElement& element, SVGPathSegRole role, float y) >- : SVGPathSegLinetoVertical(element, role, y) >- { >- } >- >- unsigned short pathSegType() const final { return PATHSEG_LINETO_VERTICAL_REL; } >- String pathSegTypeAsLetter() const final { return "v"; } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegList.cpp b/Source/WebCore/svg/SVGPathSegList.cpp >deleted file mode 100644 >index 6a0ce90eaed..00000000000 >--- a/Source/WebCore/svg/SVGPathSegList.cpp >+++ /dev/null >@@ -1,110 +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. >- */ >- >-#include "config.h" >-#include "SVGPathSegList.h" >- >-#include "SVGAnimatedPathSegListPropertyTearOff.h" >-#include "SVGPathElement.h" >-#include "SVGPathSegWithContext.h" >- >-namespace WebCore { >- >-ExceptionOr<void> SVGPathSegList::clear() >-{ >- ASSERT(m_values); >- if (m_values->isEmpty()) >- return { }; >- return Base::clearValues(); >-} >- >-ExceptionOr<RefPtr<SVGPathSeg>> SVGPathSegList::getItem(unsigned index) >-{ >- return Base::getItemValues(index); >-} >- >-ExceptionOr<RefPtr<SVGPathSeg>> SVGPathSegList::replaceItem(Ref<SVGPathSeg>&& newItem, unsigned index) >-{ >- if (index < m_values->size()) >- m_values->clearItemContextAndRole(index); >- return Base::replaceItemValues(WTFMove(newItem), index); >-} >- >-ExceptionOr<RefPtr<SVGPathSeg>> SVGPathSegList::removeItem(unsigned index) >-{ >- if (index < m_values->size()) >- m_values->clearItemContextAndRole(index); >- auto result = Base::removeItemValues(index); >- if (result.hasException()) >- return result; >- return result.releaseReturnValue(); >-} >- >-SVGPathElement* SVGPathSegList::contextElement() const >-{ >- SVGElement* contextElement = m_animatedProperty->contextElement(); >- ASSERT(contextElement); >- return downcast<SVGPathElement>(contextElement); >-} >- >-bool SVGPathSegList::processIncomingListItemValue(const ListItemType& newItem, unsigned* indexToModify) >-{ >- SVGPathSegWithContext* newItemWithContext = static_cast<SVGPathSegWithContext*>(newItem.get()); >- RefPtr<SVGAnimatedProperty> animatedPropertyOfItem = newItemWithContext->animatedProperty(); >- >- // Alter the role, after calling animatedProperty(), as that may influence the returned animated property. >- newItemWithContext->setContextAndRole(contextElement(), m_pathSegRole); >- >- if (!animatedPropertyOfItem) >- return true; >- >- // newItem belongs to a SVGPathElement, but its associated SVGAnimatedProperty is not an animated list tear off. >- // (for example: "pathElement.pathSegList.appendItem(pathElement.createSVGPathSegClosepath())") >- if (!animatedPropertyOfItem->isAnimatedListTearOff()) >- return true; >- >- // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list. >- // 'newItem' is already living in another list. If it's not our list, synchronize the other lists wrappers after the removal. >- bool livesInOtherList = animatedPropertyOfItem != m_animatedProperty; >- RefPtr<SVGAnimatedPathSegListPropertyTearOff> propertyTearOff = static_pointer_cast<SVGAnimatedPathSegListPropertyTearOff>(animatedPropertyOfItem); >- int indexToRemove = propertyTearOff->findItem(newItem.get()); >- ASSERT(indexToRemove != -1); >- >- // Do not remove newItem if already in this list at the target index. >- if (!livesInOtherList && indexToModify && static_cast<unsigned>(indexToRemove) == *indexToModify) >- return false; >- >- propertyTearOff->removeItemFromList(indexToRemove, livesInOtherList); >- >- if (!indexToModify) >- return true; >- >- // If the item lived in our list, adjust the insertion index. >- if (!livesInOtherList) { >- unsigned& index = *indexToModify; >- // Spec: If the item is already in this list, note that the index of the item to (replace|insert before) is before the removal of the item. >- if (static_cast<unsigned>(indexToRemove) < index) >- --index; >- } >- >- return true; >-} >- >-} >diff --git a/Source/WebCore/svg/SVGPathSegList.h b/Source/WebCore/svg/SVGPathSegList.h >index a29d01c6209..6291c46c3ec 100644 >--- a/Source/WebCore/svg/SVGPathSegList.h >+++ b/Source/WebCore/svg/SVGPathSegList.h >@@ -20,120 +20,202 @@ > > #pragma once > >-#include "SVGAnimatedListPropertyTearOff.h" >-#include "SVGPathSegListValues.h" >+#include "Path.h" >+#include "SVGPathByteStream.h" >+#include "SVGPathSeg.h" >+#include "SVGPropertyList.h" > > namespace WebCore { > > class SVGPathElement; > >-class SVGPathSegList final : public SVGListProperty<SVGPathSegListValues> { >+class SVGPathSegList final : public SVGPropertyList<SVGPathSeg> { >+ friend class SVGAnimatedPathSegListAnimator; >+ friend class SVGPathSegListBuilder; >+ friend class SVGPathSegListSource; >+ >+ using Base = SVGPropertyList<SVGPathSeg>; >+ using Base::Base; >+ > public: >- using Base = SVGListProperty<SVGPathSegListValues>; >- using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<SVGPathSegListValues>; >- using ListItemType = SVGPropertyTraits<SVGPathSegListValues>::ListItemType; >+ static Ref<SVGPathSegList> create(SVGPropertyOwner* owner, SVGPropertyAccess access) >+ { >+ return adoptRef(*new SVGPathSegList(owner, access)); >+ } > >- static Ref<SVGPathSegList> create(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGPathSegRole pathSegRole, SVGPathSegListValues& values, ListWrapperCache& wrappers) >+ static Ref<SVGPathSegList> create(const SVGPathSegList& other, SVGPropertyAccess access) > { >- return adoptRef(*new SVGPathSegList(animatedProperty, role, pathSegRole, values, wrappers)); >+ return adoptRef(*new SVGPathSegList(other, access)); > } > >- static Ref<SVGPathSegList> create(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGPathSegListValues& values, ListWrapperCache& wrappers) >+ static Ref<SVGPathSegList> create(Ref<SVGPathSeg>&& newItem) > { >- ASSERT_NOT_REACHED(); >- return adoptRef(*new SVGPathSegList(animatedProperty, role, PathSegUndefinedRole, values, wrappers)); >+ return adoptRef(*new SVGPathSegList(WTFMove(newItem))); > } > >- int findItem(const ListItemType& item) const >+ SVGPathSegList& operator=(const SVGPathSegList& other) > { >- ASSERT(m_values); >+ pathByteStreamWillChange(); >+ m_pathByteStream = other.pathByteStream(); >+ return *this; >+ } > >- unsigned size = m_values->size(); >- for (size_t i = 0; i < size; ++i) { >- if (item == m_values->at(i)) >- return i; >- } >+ unsigned numberOfItems() const >+ { >+ const_cast<SVGPathSegList*>(this)->ensureItems(); >+ return Base::numberOfItems(); >+ } >+ >+ ExceptionOr<void> clear() >+ { >+ itemsWillChange(); >+ return Base::clear(); >+ } > >- return -1; >+ ExceptionOr<Ref<SVGPathSeg>> getItem(unsigned index) >+ { >+ ensureItems(); >+ return Base::getItem(index); > } > >- void removeItemFromList(size_t itemIndex, bool shouldSynchronizeWrappers) >+ ExceptionOr<Ref<SVGPathSeg>> initialize(Ref<SVGPathSeg>&& newItem) > { >- ASSERT(m_values); >- ASSERT_WITH_SECURITY_IMPLICATION(itemIndex < m_values->size()); >+ itemsWillChange(); >+ return Base::initialize(WTFMove(newItem)); >+ } > >- m_values->remove(itemIndex); >+ ExceptionOr<Ref<SVGPathSeg>> insertItemBefore(Ref<SVGPathSeg>&& newItem, unsigned index) >+ { >+ ensureItems(); >+ itemsWillChange(); >+ return Base::insertItemBefore(WTFMove(newItem), index); >+ } > >- if (shouldSynchronizeWrappers) >- commitChange(); >+ ExceptionOr<Ref<SVGPathSeg>> replaceItem(Ref<SVGPathSeg>&& newItem, unsigned index) >+ { >+ ensureItems(); >+ itemsWillChange(); >+ return Base::replaceItem(WTFMove(newItem), index); > } > >- // SVGList API >- ExceptionOr<void> clear(); >+ ExceptionOr<Ref<SVGPathSeg>> removeItem(unsigned index) >+ { >+ ensureItems(); >+ itemsWillChange(); >+ return Base::removeItem(index); >+ } > >- ExceptionOr<RefPtr<SVGPathSeg>> initialize(Ref<SVGPathSeg>&& newItem) >+ ExceptionOr<Ref<SVGPathSeg>> appendItem(Ref<SVGPathSeg>&& newItem) > { >- return Base::initializeValues(WTFMove(newItem)); >+ ensureItems(); >+ appendPathSegToPathByteStream(newItem); >+ clearPath(); >+ return Base::appendItem(WTFMove(newItem)); > } > >- ExceptionOr<RefPtr<SVGPathSeg>> getItem(unsigned index); >+ const SVGPathByteStream& pathByteStream() const { return const_cast<SVGPathSegList*>(this)->pathByteStream(); } >+ SVGPathByteStream& pathByteStream() >+ { >+ ensurePathByteStream(); >+ return m_pathByteStream; >+ } > >- ExceptionOr<RefPtr<SVGPathSeg>> insertItemBefore(Ref<SVGPathSeg>&& newItem, unsigned index) >+ bool parse(const String& value) > { >- return Base::insertItemBeforeValues(WTFMove(newItem), index); >+ pathByteStreamWillChange(); >+ return buildSVGPathByteStreamFromString(value, m_pathByteStream, UnalteredParsing); > } > >- ExceptionOr<RefPtr<SVGPathSeg>> replaceItem(Ref<SVGPathSeg>&&, unsigned index); >+ Path path() const >+ { >+ if (!m_path) >+ m_path = buildPathFromByteStream(pathByteStream()); >+ return *m_path; >+ } > >- ExceptionOr<RefPtr<SVGPathSeg>> removeItem(unsigned index); >+ size_t approximateMemoryCost() const >+ { >+ // This is an approximation for path memory cost since the path is parsed on demand. >+ size_t pathMemoryCost = (m_pathByteStream.size() / 10) * sizeof(FloatPoint); >+ // We need to account for the memory which is allocated by the m_path. >+ return m_path ? pathMemoryCost + sizeof(*m_path) : pathMemoryCost; >+ } > >- ExceptionOr<RefPtr<SVGPathSeg>> appendItem(Ref<SVGPathSeg>&& newItem) >+ String valueAsString() const override > { >- return Base::appendItemValues(WTFMove(newItem)); >+ String value; >+ buildStringFromByteStream(pathByteStream(), value, UnalteredParsing); >+ return value; > } > > private: >- SVGPathSegList(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGPathSegRole pathSegRole, SVGPathSegListValues& values, ListWrapperCache& wrappers) >- : SVGListProperty<SVGPathSegListValues>(role, values, &wrappers) >- , m_animatedProperty(&animatedProperty) >- , m_pathSegRole(pathSegRole) >+ SVGPathSegList(const SVGPathSegList& other, SVGPropertyAccess access) >+ : Base(other.owner(), access) >+ , m_pathByteStream(other.pathByteStream()) >+ { >+ } >+ >+ // Used by appendPathSegToPathByteStream() to create a temporary SVGPathSegList with one item. >+ SVGPathSegList(Ref<SVGPathSeg>&& newItem) >+ { >+ append(WTFMove(newItem)); >+ } >+ >+ // Called when changing an item in the list. >+ void commitPropertyChange(SVGProperty* property) override > { >+ itemsWillChange(); >+ Base::commitPropertyChange(property); > } > >- SVGPathElement* contextElement() const; >- using Base::m_role; >+ void ensureItems() >+ { >+ if (!m_items.isEmpty() || m_pathByteStream.isEmpty()) >+ return; >+ buildSVGPathSegListFromByteStream(m_pathByteStream, *this, UnalteredParsing); >+ } > >- bool isReadOnly() const final >+ void ensurePathByteStream() > { >- if (m_role == AnimValRole) >- return true; >- if (m_animatedProperty && m_animatedProperty->isReadOnly()) >- return true; >- return false; >+ if (!m_pathByteStream.isEmpty() || m_items.isEmpty()) >+ return; >+ buildSVGPathByteStreamFromSVGPathSegList(*this, m_pathByteStream, UnalteredParsing); > } > >- void commitChange() final >+ // Optimize appending an SVGPathSeg to the list. Instead of creating the whole >+ // byte stream, a temporary byte stream will be creating just for the new item >+ // and this temporary byte stream will be appended to m_pathByteStream. >+ void appendPathSegToPathByteStream(const Ref<SVGPathSeg>& item) > { >- ASSERT(m_values); >- m_values->commitChange(*m_animatedProperty->contextElement(), ListModificationUnknown); >+ if (m_pathByteStream.isEmpty()) >+ return; >+ >+ Ref<SVGPathSegList> pathSegList = SVGPathSegList::create(item.copyRef()); >+ SVGPathByteStream pathSegStream; >+ >+ if (!buildSVGPathByteStreamFromSVGPathSegList(pathSegList, pathSegStream, UnalteredParsing, false)) >+ return; >+ >+ m_pathByteStream.append(pathSegStream); > } > >- void commitChange(ListModification listModification) final >+ void clearPathByteStream() { m_pathByteStream.clear(); } >+ void clearPath() { m_path = std::nullopt; } >+ >+ void pathByteStreamWillChange() > { >- ASSERT(m_values); >- m_values->commitChange(*m_animatedProperty->contextElement(), listModification); >+ clearItems(); >+ clearPath(); > } > >- bool processIncomingListItemValue(const ListItemType& newItem, unsigned* indexToModify) final; >- bool processIncomingListItemWrapper(Ref<ListItemTearOff>&, unsigned*) final >+ void itemsWillChange() > { >- ASSERT_NOT_REACHED(); >- return true; >+ clearPathByteStream(); >+ clearPath(); > } > >-private: >- RefPtr<AnimatedListPropertyTearOff> m_animatedProperty; >- SVGPathSegRole m_pathSegRole; >+ SVGPathByteStream m_pathByteStream; >+ mutable std::optional<Path> m_path; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegListBuilder.cpp b/Source/WebCore/svg/SVGPathSegListBuilder.cpp >index 1558f808a4e..b8b1e47d0ef 100644 >--- a/Source/WebCore/svg/SVGPathSegListBuilder.cpp >+++ b/Source/WebCore/svg/SVGPathSegListBuilder.cpp >@@ -4,6 +4,7 @@ > * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> > * Copyright (C) 2007, 2009, 2015 Apple Inc. All rights reserved. > * 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 >@@ -24,112 +25,91 @@ > #include "config.h" > #include "SVGPathSegListBuilder.h" > >-#include "SVGPathElement.h" >-#include "SVGPathSegArcAbs.h" >-#include "SVGPathSegArcRel.h" >-#include "SVGPathSegClosePath.h" >-#include "SVGPathSegCurvetoCubicAbs.h" >-#include "SVGPathSegCurvetoCubicRel.h" >-#include "SVGPathSegCurvetoCubicSmoothAbs.h" >-#include "SVGPathSegCurvetoCubicSmoothRel.h" >-#include "SVGPathSegCurvetoQuadraticAbs.h" >-#include "SVGPathSegCurvetoQuadraticRel.h" >-#include "SVGPathSegCurvetoQuadraticSmoothAbs.h" >-#include "SVGPathSegCurvetoQuadraticSmoothRel.h" >-#include "SVGPathSegLinetoAbs.h" >-#include "SVGPathSegLinetoHorizontalAbs.h" >-#include "SVGPathSegLinetoHorizontalRel.h" >-#include "SVGPathSegLinetoRel.h" >-#include "SVGPathSegLinetoVerticalAbs.h" >-#include "SVGPathSegLinetoVerticalRel.h" >-#include "SVGPathSegListValues.h" >-#include "SVGPathSegMovetoAbs.h" >-#include "SVGPathSegMovetoRel.h" >+#include "SVGPathSegImpl.h" >+#include "SVGPathSegList.h" > > namespace WebCore { > >-SVGPathSegListBuilder::SVGPathSegListBuilder(SVGPathElement& pathElement, SVGPathSegListValues& pathSegList, SVGPathSegRole role) >- : m_pathElement(pathElement) >- , m_pathSegList(pathSegList) >- , m_pathSegRole(role) >+SVGPathSegListBuilder::SVGPathSegListBuilder(SVGPathSegList& pathSegList) >+ : m_pathSegList(pathSegList) > { > } > >-void SVGPathSegListBuilder::moveTo(const FloatPoint& targetPoint, bool, PathCoordinateMode mode) >+void SVGPathSegListBuilder::moveTo(const FloatPoint& point, bool, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegMovetoAbs(targetPoint.x(), targetPoint.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegMovetoAbs::create(point.x(), point.y())); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegMovetoRel(targetPoint.x(), targetPoint.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegMovetoRel::create(point.x(), point.y())); > } > >-void SVGPathSegListBuilder::lineTo(const FloatPoint& targetPoint, PathCoordinateMode mode) >+void SVGPathSegListBuilder::lineTo(const FloatPoint& point, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegLinetoAbs(targetPoint.x(), targetPoint.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegLinetoAbs::create(point.x(), point.y())); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegLinetoRel(targetPoint.x(), targetPoint.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegLinetoRel::create(point.x(), point.y())); > } > > void SVGPathSegListBuilder::lineToHorizontal(float x, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegLinetoHorizontalAbs(x, m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegLinetoHorizontalAbs::create(x)); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegLinetoHorizontalRel(x, m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegLinetoHorizontalRel::create(x)); > } > > void SVGPathSegListBuilder::lineToVertical(float y, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegLinetoVerticalAbs(y, m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegLinetoVerticalAbs::create(y)); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegLinetoVerticalRel(y, m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegLinetoVerticalRel::create(y)); > } > >-void SVGPathSegListBuilder::curveToCubic(const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& targetPoint, PathCoordinateMode mode) >+void SVGPathSegListBuilder::curveToCubic(const FloatPoint& point1, const FloatPoint& point2, const FloatPoint& point, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoCubicAbs(targetPoint.x(), targetPoint.y(), point1.x(), point1.y(), point2.x(), point2.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoCubicAbs::create(point.x(), point.y(), point1.x(), point1.y(), point2.x(), point2.y())); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoCubicRel(targetPoint.x(), targetPoint.y(), point1.x(), point1.y(), point2.x(), point2.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoCubicRel::create(point.x(), point.y(), point1.x(), point1.y(), point2.x(), point2.y())); > } > >-void SVGPathSegListBuilder::curveToCubicSmooth(const FloatPoint& point2, const FloatPoint& targetPoint, PathCoordinateMode mode) >+void SVGPathSegListBuilder::curveToCubicSmooth(const FloatPoint& point2, const FloatPoint& point, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoCubicSmoothAbs(targetPoint.x(), targetPoint.y(), point2.x(), point2.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoCubicSmoothAbs::create(point.x(), point.y(), point2.x(), point2.y())); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoCubicSmoothRel(targetPoint.x(), targetPoint.y(), point2.x(), point2.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoCubicSmoothRel::create(point.x(), point.y(), point2.x(), point2.y())); > } > >-void SVGPathSegListBuilder::curveToQuadratic(const FloatPoint& point1, const FloatPoint& targetPoint, PathCoordinateMode mode) >+void SVGPathSegListBuilder::curveToQuadratic(const FloatPoint& point1, const FloatPoint& point, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoQuadraticAbs(targetPoint.x(), targetPoint.y(), point1.x(), point1.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoQuadraticAbs::create(point.x(), point.y(), point1.x(), point1.y())); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoQuadraticRel(targetPoint.x(), targetPoint.y(), point1.x(), point1.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoQuadraticRel::create(point.x(), point.y(), point1.x(), point1.y())); > } > >-void SVGPathSegListBuilder::curveToQuadraticSmooth(const FloatPoint& targetPoint, PathCoordinateMode mode) >+void SVGPathSegListBuilder::curveToQuadraticSmooth(const FloatPoint& point, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoQuadraticSmoothAbs(targetPoint.x(), targetPoint.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoQuadraticSmoothAbs::create(point.x(), point.y())); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegCurvetoQuadraticSmoothRel(targetPoint.x(), targetPoint.y(), m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegCurvetoQuadraticSmoothRel::create(point.x(), point.y())); > } > >-void SVGPathSegListBuilder::arcTo(float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, const FloatPoint& targetPoint, PathCoordinateMode mode) >+void SVGPathSegListBuilder::arcTo(float r1, float r2, float angle, bool largeArcFlag, bool sweepFlag, const FloatPoint& point, PathCoordinateMode mode) > { > if (mode == AbsoluteCoordinates) >- m_pathSegList.append(m_pathElement.createSVGPathSegArcAbs(targetPoint.x(), targetPoint.y(), r1, r2, angle, largeArcFlag, sweepFlag, m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegArcAbs::create(point.x(), point.y(), r1, r2, angle, largeArcFlag, sweepFlag)); > else >- m_pathSegList.append(m_pathElement.createSVGPathSegArcRel(targetPoint.x(), targetPoint.y(), r1, r2, angle, largeArcFlag, sweepFlag, m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegArcRel::create(point.x(), point.y(), r1, r2, angle, largeArcFlag, sweepFlag)); > } > > void SVGPathSegListBuilder::closePath() > { >- m_pathSegList.append(m_pathElement.createSVGPathSegClosePath(m_pathSegRole)); >+ m_pathSegList.append(SVGPathSegClosePath::create()); > } > > } >diff --git a/Source/WebCore/svg/SVGPathSegListBuilder.h b/Source/WebCore/svg/SVGPathSegListBuilder.h >index eb1ab8b18be..394eb4f2988 100644 >--- a/Source/WebCore/svg/SVGPathSegListBuilder.h >+++ b/Source/WebCore/svg/SVGPathSegListBuilder.h >@@ -4,6 +4,7 @@ > * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> > * Copyright (C) 2007, 2009, 2015 Apple Inc. All rights reserved. > * 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 >@@ -25,15 +26,14 @@ > > #include "FloatPoint.h" > #include "SVGPathConsumer.h" >-#include "SVGPathSegListValues.h" > > namespace WebCore { > >-class SVGPathElement; >+class SVGPathSegList; > > class SVGPathSegListBuilder final : public SVGPathConsumer { > public: >- SVGPathSegListBuilder(SVGPathElement&, SVGPathSegListValues&, SVGPathSegRole); >+ SVGPathSegListBuilder(SVGPathSegList&); > > private: > void incrementPathSegmentCount() final { } >@@ -53,9 +53,7 @@ private: > void curveToQuadraticSmooth(const FloatPoint&, PathCoordinateMode) final; > void arcTo(float, float, float, bool largeArcFlag, bool sweepFlag, const FloatPoint&, PathCoordinateMode) final; > >- SVGPathElement& m_pathElement; >- SVGPathSegListValues& m_pathSegList; >- SVGPathSegRole m_pathSegRole { PathSegUndefinedRole }; >+ SVGPathSegList& m_pathSegList; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegListSource.cpp b/Source/WebCore/svg/SVGPathSegListSource.cpp >index 0cdd8afed67..03463f3da3c 100644 >--- a/Source/WebCore/svg/SVGPathSegListSource.cpp >+++ b/Source/WebCore/svg/SVGPathSegListSource.cpp >@@ -1,5 +1,6 @@ > /* > * 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 >@@ -20,16 +21,12 @@ > #include "config.h" > #include "SVGPathSegListSource.h" > >-#include "SVGPathSegArc.h" >-#include "SVGPathSegCurvetoCubic.h" >-#include "SVGPathSegCurvetoCubicSmooth.h" >-#include "SVGPathSegCurvetoQuadratic.h" >-#include "SVGPathSegLinetoHorizontal.h" >-#include "SVGPathSegLinetoVertical.h" >+#include "SVGPathSeg.h" >+#include "SVGPathSegList.h" > > namespace WebCore { > >-SVGPathSegListSource::SVGPathSegListSource(const SVGPathSegListValues& pathSegList) >+SVGPathSegListSource::SVGPathSegListSource(const SVGPathSegList& pathSegList) > : m_pathSegList(pathSegList) > { > m_itemCurrent = 0; >diff --git a/Source/WebCore/svg/SVGPathSegListSource.h b/Source/WebCore/svg/SVGPathSegListSource.h >index 506e7c044fd..5fba1b6fb49 100644 >--- a/Source/WebCore/svg/SVGPathSegListSource.h >+++ b/Source/WebCore/svg/SVGPathSegListSource.h >@@ -1,5 +1,6 @@ > /* > * 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 >@@ -21,15 +22,16 @@ > > #include "FloatPoint.h" > #include "SVGPathSeg.h" >-#include "SVGPathSegListValues.h" > #include "SVGPathSource.h" > #include <wtf/RefPtr.h> > > namespace WebCore { >+ >+class SVGPathSegList; > > class SVGPathSegListSource final : public SVGPathSource { > public: >- explicit SVGPathSegListSource(const SVGPathSegListValues&); >+ explicit SVGPathSegListSource(const SVGPathSegList&); > > private: > bool hasMoreData() const final; >@@ -47,10 +49,10 @@ private: > bool parseCurveToQuadraticSmoothSegment(FloatPoint&) final; > bool parseArcToSegment(float&, float&, float&, bool&, bool&, FloatPoint&) final; > >- const SVGPathSegListValues& m_pathSegList; >+ const SVGPathSegList& m_pathSegList; > RefPtr<SVGPathSeg> m_segment; >- int m_itemCurrent; >- int m_itemEnd; >+ size_t m_itemCurrent; >+ size_t m_itemEnd; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegListValues.cpp b/Source/WebCore/svg/SVGPathSegListValues.cpp >deleted file mode 100644 >index 476d225b689..00000000000 >--- a/Source/WebCore/svg/SVGPathSegListValues.cpp >+++ /dev/null >@@ -1,57 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> >- * Copyright (C) 2007 Eric Seidel <eric@webkit.org> >- * 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. >- */ >- >-#include "config.h" >-#include "SVGPathSegListValues.h" >- >-#include "SVGPathElement.h" >-#include "SVGPathUtilities.h" >- >-namespace WebCore { >- >-String SVGPathSegListValues::valueAsString() const >-{ >- String pathString; >- buildStringFromSVGPathSegListValues(*this, pathString, UnalteredParsing); >- return pathString; >-} >- >-void SVGPathSegListValues::commitChange(SVGElement& contextElement, ListModification listModification) >-{ >- downcast<SVGPathElement>(contextElement).pathSegListChanged(m_role, listModification); >-} >- >-void SVGPathSegListValues::clearItemContextAndRole(unsigned index) >-{ >- auto& item = at(index); >- static_cast<SVGPathSegWithContext&>(*item).setContextAndRole(nullptr, PathSegUndefinedRole); >-} >- >-void SVGPathSegListValues::clearContextAndRoles() >-{ >- auto count = size(); >- while (count--) >- clearItemContextAndRole(count); >-} >- >-} >diff --git a/Source/WebCore/svg/SVGPathSegListValues.h b/Source/WebCore/svg/SVGPathSegListValues.h >deleted file mode 100644 >index 8681e31ff94..00000000000 >--- a/Source/WebCore/svg/SVGPathSegListValues.h >+++ /dev/null >@@ -1,87 +0,0 @@ >-/* >- * Copyright (C) 2007 Eric Seidel <eric@webkit.org> >- * 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 "SVGListProperty.h" >-#include "SVGPathSeg.h" >-#include "SVGPropertyTraits.h" >-#include <wtf/Vector.h> >-#include <wtf/text/WTFString.h> >- >-namespace WebCore { >- >-class SVGElement; >-class SVGPathSegList; >- >-template<typename T> >-class SVGPropertyTearOff; >- >-class SVGPathSegListValues : public Vector<RefPtr<SVGPathSeg>> { >-public: >- using Base = Vector<RefPtr<SVGPathSeg>>; >- >- explicit SVGPathSegListValues(SVGPathSegRole role) >- : m_role(role) >- { >- } >- >- SVGPathSegListValues(const SVGPathSegListValues&) = default; >- SVGPathSegListValues(SVGPathSegListValues&&) = default; >- >- SVGPathSegListValues& operator=(const SVGPathSegListValues& other) >- { >- clearContextAndRoles(); >- return static_cast<SVGPathSegListValues&>(Base::operator=(other)); >- } >- >- SVGPathSegListValues& operator=(SVGPathSegListValues&& other) >- { >- clearContextAndRoles(); >- return static_cast<SVGPathSegListValues&>(Base::operator=(WTFMove(other))); >- } >- >- void clear() >- { >- clearContextAndRoles(); >- Base::clear(); >- } >- >- String valueAsString() const; >- >- void commitChange(SVGElement& contextElement, ListModification); >- void clearItemContextAndRole(unsigned index); >- >-private: >- void clearContextAndRoles(); >- >- SVGPathSegRole m_role; >-}; >- >-template<> struct SVGPropertyTraits<SVGPathSegListValues> { >- static SVGPathSegListValues initialValue() { return SVGPathSegListValues(PathSegUndefinedRole); } >- static String toString(const SVGPathSegListValues& list) { return list.valueAsString(); } >- >- using ListItemType = RefPtr<SVGPathSeg>; >- using ListItemTearOff = SVGPropertyTearOff<RefPtr<SVGPathSeg>>; >- using ListPropertyTearOff = SVGPathSegList; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathSegValue.h b/Source/WebCore/svg/SVGPathSegValue.h >new file mode 100644 >index 00000000000..4f77faef620 >--- /dev/null >+++ b/Source/WebCore/svg/SVGPathSegValue.h >@@ -0,0 +1,191 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGPathSeg.h" >+ >+namespace WebCore { >+ >+template<class... Arguments> >+class SVGPathSegValue : public SVGPathSeg { >+public: >+ template<typename PathSegType> >+ static Ref<PathSegType> create(Arguments... arguments) >+ { >+ return adoptRef(*new PathSegType(std::forward<Arguments>(arguments)...)); >+ } >+ >+ template<typename PathSegType> >+ Ref<PathSegType> clone() const >+ { >+ return adoptRef(*new PathSegType(m_arguments)); >+ } >+ >+ SVGPathSegValue(Arguments... arguments) >+ : m_arguments(std::forward<Arguments>(arguments)...) >+ { >+ } >+ >+ SVGPathSegValue(const std::tuple<Arguments...>& arguments) >+ : m_arguments(arguments) >+ { >+ } >+ >+protected: >+ template<size_t I> >+ const auto& argument() const >+ { >+ return std::get<I>(m_arguments); >+ } >+ >+ template<size_t I, typename ArgumentValue> >+ void setArgument(ArgumentValue value) >+ { >+ std::get<I>(m_arguments) = value; >+ commitChange(); >+ } >+ >+ std::tuple<Arguments...> m_arguments; >+}; >+ >+class SVGPathSegLinetoHorizontal : public SVGPathSegValue<float> { >+public: >+ float x() const { return argument<0>(); } >+ void setX(float x) { setArgument<0>(x); } >+ >+private: >+ using SVGPathSegValue::SVGPathSegValue; >+}; >+ >+class SVGPathSegLinetoVertical : public SVGPathSegValue<float> { >+public: >+ float y() const { return argument<0>(); } >+ void setY(float x) { setArgument<0>(x); } >+ >+private: >+ using SVGPathSegValue::SVGPathSegValue; >+}; >+ >+class SVGPathSegSingleCoordinate : public SVGPathSegValue<float, float> { >+public: >+ float x() const { return argument<0>(); } >+ void setX(float x) { setArgument<0>(x); } >+ >+ float y() const { return argument<1>(); } >+ void setY(float y) { setArgument<1>(y); } >+ >+private: >+ using SVGPathSegValue::SVGPathSegValue; >+}; >+ >+class SVGPathSegCurvetoQuadratic : public SVGPathSegValue<float, float, float, float> { >+public: >+ float x() const { return argument<0>(); } >+ void setX(float x) { setArgument<0>(x); } >+ >+ float y() const { return argument<1>(); } >+ void setY(float y) { setArgument<1>(y); } >+ >+ float x1() const { return argument<2>(); } >+ void setX1(float x) { setArgument<2>(x); } >+ >+ float y1() const { return argument<3>(); } >+ void setY1(float y) { setArgument<3>(y); } >+ >+private: >+ using SVGPathSegValue::SVGPathSegValue; >+}; >+ >+class SVGPathSegCurvetoCubicSmooth : public SVGPathSegValue<float, float, float, float> { >+public: >+ float x() const { return argument<0>(); } >+ void setX(float x) { setArgument<0>(x); } >+ >+ float y() const { return argument<1>(); } >+ void setY(float y) { setArgument<1>(y); } >+ >+ float x2() const { return argument<2>(); } >+ void setX2(float x) { setArgument<2>(x); } >+ >+ float y2() const { return argument<3>(); } >+ void setY2(float y) { setArgument<3>(y); } >+ >+private: >+ using SVGPathSegValue::SVGPathSegValue; >+}; >+ >+class SVGPathSegCurvetoCubic : public SVGPathSegValue<float, float, float, float, float, float> { >+public: >+ float x() const { return argument<0>(); } >+ void setX(float x) { setArgument<0>(x); } >+ >+ float y() const { return argument<1>(); } >+ void setY(float y) { setArgument<1>(y); } >+ >+ float x1() const { return argument<2>(); } >+ void setX1(float x) { setArgument<2>(x); } >+ >+ float y1() const { return argument<3>(); } >+ void setY1(float y) { setArgument<3>(y); } >+ >+ float x2() const { return argument<4>(); } >+ void setX2(float x) { setArgument<4>(x); } >+ >+ float y2() const { return argument<5>(); } >+ void setY2(float y) { setArgument<5>(y); } >+ >+private: >+ using SVGPathSegValue::SVGPathSegValue; >+}; >+ >+class SVGPathSegArc : public SVGPathSegValue<float, float, float, float, float, bool, bool> { >+public: >+ float x() const { return argument<0>(); } >+ void setX(float x) { setArgument<0>(x); } >+ >+ float y() const { return argument<1>(); } >+ void setY(float y) { setArgument<1>(y); } >+ >+ float r1() const { return argument<2>(); } >+ void setR1(float r1) { setArgument<2>(r1); } >+ >+ float r2() const { return argument<3>(); } >+ void setR2(float r2) { setArgument<3>(r2); } >+ >+ float angle() const { return argument<4>(); } >+ void setAngle(float angle) { setArgument<4>(angle); } >+ >+ bool largeArcFlag() const { return argument<5>(); } >+ void setLargeArcFlag(bool largeArcFlag) { setArgument<5>(largeArcFlag); } >+ >+ bool sweepFlag() const { return argument<6>(); } >+ void setSweepFlag(bool sweepFlag) { setArgument<6>(sweepFlag); } >+ >+private: >+ using SVGPathSegValue::SVGPathSegValue; >+}; >+ >+} >diff --git a/Source/WebCore/svg/SVGPathSegWithContext.h b/Source/WebCore/svg/SVGPathSegWithContext.h >deleted file mode 100644 >index 0a7a0e825bb..00000000000 >--- a/Source/WebCore/svg/SVGPathSegWithContext.h >+++ /dev/null >@@ -1,103 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010. 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 "SVGPathElement.h" >- >-namespace WebCore { >- >-class SVGPathSegWithContext : public SVGPathSeg { >-public: >- SVGPathSegWithContext(const SVGPathElement& element, SVGPathSegRole role) >- : m_role(role) >- , m_element(makeWeakPtr(const_cast<SVGPathElement&>(element))) >- { >- } >- >- RefPtr<SVGAnimatedProperty> animatedProperty() const >- { >- if (!m_element) >- return nullptr; >- >- switch (m_role) { >- case PathSegUndefinedRole: >- return nullptr; >- case PathSegUnalteredRole: >- return m_element->pathSegListAnimated(); >- case PathSegNormalizedRole: >- // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists! >- return nullptr; >- }; >- >- return nullptr; >- } >- >- SVGPathElement* contextElement() const { return m_element.get(); } >- SVGPathSegRole role() const { return m_role; } >- >- void setContextAndRole(SVGPathElement* element, SVGPathSegRole role) >- { >- m_role = role; >- m_element = makeWeakPtr(element); >- } >- >-protected: >- void commitChange() >- { >- if (!m_element || m_role == PathSegUndefinedRole) >- return; >- m_element->pathSegListChanged(m_role); >- } >- >-private: >- SVGPathSegRole m_role; >- WeakPtr<SVGPathElement> m_element; >-}; >- >-class SVGPathSegSingleCoordinate : public SVGPathSegWithContext { >-public: >- float x() const { return m_x; } >- void setX(float x) >- { >- m_x = x; >- commitChange(); >- } >- >- float y() const { return m_y; } >- void setY(float y) >- { >- m_y = y; >- commitChange(); >- } >- >-protected: >- SVGPathSegSingleCoordinate(const SVGPathElement& element, SVGPathSegRole role, float x, float y) >- : SVGPathSegWithContext(element, role) >- , m_x(x) >- , m_y(y) >- { >- } >- >-private: >- float m_x; >- float m_y; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPathUtilities.cpp b/Source/WebCore/svg/SVGPathUtilities.cpp >index cf9f01427e1..e5746ca2048 100644 >--- a/Source/WebCore/svg/SVGPathUtilities.cpp >+++ b/Source/WebCore/svg/SVGPathUtilities.cpp >@@ -104,32 +104,14 @@ String buildStringFromPath(const Path& path) > return builder.toString(); > } > >-bool buildSVGPathByteStreamFromSVGPathSegListValues(const SVGPathSegListValues& list, SVGPathByteStream& result, PathParsingMode parsingMode) >+bool buildSVGPathByteStreamFromSVGPathSegList(const SVGPathSegList& list, SVGPathByteStream& stream, PathParsingMode parsingMode, bool checkForInitialMoveTo) > { >- result.clear(); >+ stream.clear(); > if (list.isEmpty()) > return true; > > SVGPathSegListSource source(list); >- return SVGPathParser::parseToByteStream(source, result, parsingMode); >-} >- >-bool appendSVGPathByteStreamFromSVGPathSeg(RefPtr<SVGPathSeg>&& pathSeg, SVGPathByteStream& result, PathParsingMode parsingMode) >-{ >- // FIXME: https://bugs.webkit.org/show_bug.cgi?id=15412 - Implement normalized path segment lists! >- ASSERT(parsingMode == UnalteredParsing); >- >- SVGPathSegListValues appendedItemList(PathSegUnalteredRole); >- appendedItemList.append(WTFMove(pathSeg)); >- >- SVGPathByteStream appendedByteStream; >- SVGPathSegListSource source(appendedItemList); >- bool ok = SVGPathParser::parseToByteStream(source, result, parsingMode, false); >- >- if (ok) >- result.append(appendedByteStream); >- >- return ok; >+ return SVGPathParser::parseToByteStream(source, stream, parsingMode, checkForInitialMoveTo); > } > > Path buildPathFromByteStream(const SVGPathByteStream& stream) >@@ -144,33 +126,23 @@ Path buildPathFromByteStream(const SVGPathByteStream& stream) > return path; > } > >-bool buildSVGPathSegListValuesFromByteStream(const SVGPathByteStream& stream, SVGPathElement& element, SVGPathSegListValues& result, PathParsingMode parsingMode) >+bool buildSVGPathSegListFromByteStream(const SVGPathByteStream& stream, SVGPathSegList& list, PathParsingMode mode) > { > if (stream.isEmpty()) > return true; > >- SVGPathSegListBuilder builder(element, result, parsingMode == NormalizedParsing ? PathSegNormalizedRole : PathSegUnalteredRole); >+ SVGPathSegListBuilder builder(list); > SVGPathByteStreamSource source(stream); >- return SVGPathParser::parse(source, builder, parsingMode); >+ return SVGPathParser::parse(source, builder, mode); > } > >-bool buildStringFromByteStream(const SVGPathByteStream& stream, String& result, PathParsingMode parsingMode) >+bool buildStringFromByteStream(const SVGPathByteStream& stream, String& result, PathParsingMode parsingMode, bool checkForInitialMoveTo) > { > if (stream.isEmpty()) > return true; > > SVGPathByteStreamSource source(stream); >- return SVGPathParser::parseToString(source, result, parsingMode); >-} >- >-bool buildStringFromSVGPathSegListValues(const SVGPathSegListValues& list, String& result, PathParsingMode parsingMode) >-{ >- result = String(); >- if (list.isEmpty()) >- return true; >- >- SVGPathSegListSource source(list); >- return SVGPathParser::parseToString(source, result, parsingMode); >+ return SVGPathParser::parseToString(source, result, parsingMode, checkForInitialMoveTo); > } > > bool buildSVGPathByteStreamFromString(const String& d, SVGPathByteStream& result, PathParsingMode parsingMode) >diff --git a/Source/WebCore/svg/SVGPathUtilities.h b/Source/WebCore/svg/SVGPathUtilities.h >index 216766ee2d8..ae4a474cedc 100644 >--- a/Source/WebCore/svg/SVGPathUtilities.h >+++ b/Source/WebCore/svg/SVGPathUtilities.h >@@ -30,7 +30,7 @@ class Path; > class SVGPathByteStream; > class SVGPathElement; > class SVGPathSeg; >-class SVGPathSegListValues; >+class SVGPathSegList; > > // String/SVGPathByteStream -> Path > Path buildPathFromString(const String&); >@@ -39,17 +39,15 @@ Path buildPathFromByteStream(const SVGPathByteStream&); > // Path -> String > String buildStringFromPath(const Path&); > >-// SVGPathSegListValues/String -> SVGPathByteStream >-bool buildSVGPathByteStreamFromSVGPathSegListValues(const SVGPathSegListValues&, SVGPathByteStream& result, PathParsingMode); >-bool appendSVGPathByteStreamFromSVGPathSeg(RefPtr<SVGPathSeg>&&, SVGPathByteStream&, PathParsingMode); >+// SVGPathSegList/String -> SVGPathByteStream >+bool buildSVGPathByteStreamFromSVGPathSegList(const SVGPathSegList&, SVGPathByteStream& result, PathParsingMode, bool checkForInitialMoveTo = true); > bool buildSVGPathByteStreamFromString(const String&, SVGPathByteStream&, PathParsingMode); > >-// SVGPathByteStream/SVGPathSegListValues -> String >-bool buildStringFromByteStream(const SVGPathByteStream&, String&, PathParsingMode); >-bool buildStringFromSVGPathSegListValues(const SVGPathSegListValues&, String&, PathParsingMode); >+// SVGPathByteStream -> String >+bool buildStringFromByteStream(const SVGPathByteStream&, String&, PathParsingMode, bool checkForInitialMoveTo = true); > >-// SVGPathByteStream -> SVGPathSegListValues >-bool buildSVGPathSegListValuesFromByteStream(const SVGPathByteStream&, SVGPathElement&, SVGPathSegListValues&, PathParsingMode); >+// SVGPathByteStream -> SVGPathSegList >+bool buildSVGPathSegListFromByteStream(const SVGPathByteStream&, SVGPathSegList&, PathParsingMode); > > bool canBlendSVGPathByteStreams(const SVGPathByteStream& from, const SVGPathByteStream& to); > >diff --git a/Source/WebCore/svg/SVGPatternElement.cpp b/Source/WebCore/svg/SVGPatternElement.cpp >index 700f26b6a1a..91d0bb81e7d 100644 >--- a/Source/WebCore/svg/SVGPatternElement.cpp >+++ b/Source/WebCore/svg/SVGPatternElement.cpp >@@ -53,7 +53,17 @@ inline SVGPatternElement::SVGPatternElement(const QualifiedName& tagName, Docume > , SVGURIReference(this) > { > ASSERT(hasTagName(SVGNames::patternTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGPatternElement::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGPatternElement::m_y>(); >+ PropertyRegistry::registerProperty<SVGNames::widthAttr, &SVGPatternElement::m_width>(); >+ PropertyRegistry::registerProperty<SVGNames::heightAttr, &SVGPatternElement::m_height>(); >+ PropertyRegistry::registerProperty<SVGNames::patternUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGPatternElement::m_patternUnits>(); >+ PropertyRegistry::registerProperty<SVGNames::patternContentUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGPatternElement::m_patternContentUnits>(); >+ PropertyRegistry::registerProperty<SVGNames::patternTransformAttr, &SVGPatternElement::m_patternTransform>(); >+ }); > } > > Ref<SVGPatternElement> SVGPatternElement::create(const QualifiedName& tagName, Document& document) >@@ -61,52 +71,35 @@ Ref<SVGPatternElement> SVGPatternElement::create(const QualifiedName& tagName, D > return adoptRef(*new SVGPatternElement(tagName, document)); > } > >-void SVGPatternElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::xAttr, &SVGPatternElement::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGPatternElement::m_y>(); >- registry.registerAttribute<SVGNames::widthAttr, &SVGPatternElement::m_width>(); >- registry.registerAttribute<SVGNames::heightAttr, &SVGPatternElement::m_height>(); >- registry.registerAttribute<SVGNames::patternUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGPatternElement::m_patternUnits>(); >- registry.registerAttribute<SVGNames::patternContentUnitsAttr, SVGUnitTypes::SVGUnitType, &SVGPatternElement::m_patternContentUnits>(); >- registry.registerAttribute<SVGNames::patternTransformAttr, &SVGPatternElement::m_patternTransform>(); >-} >- > void SVGPatternElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::patternUnitsAttr) { > auto propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(value); > if (propertyValue > 0) >- m_patternUnits.setValue(propertyValue); >+ m_patternUnits->setBaseValInternal(propertyValue); > return; > } > if (name == SVGNames::patternContentUnitsAttr) { > auto propertyValue = SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::fromString(value); > if (propertyValue > 0) >- m_patternContentUnits.setValue(propertyValue); >+ m_patternContentUnits->setBaseValInternal(propertyValue); > return; > } > if (name == SVGNames::patternTransformAttr) { >- SVGTransformListValues newList; >- newList.parse(value); >- m_patternTransform.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); >- m_patternTransform.setValue(WTFMove(newList)); >+ m_patternTransform->baseVal()->parse(value); > return; > } > > SVGParsingError parseError = NoError; > > if (name == SVGNames::xAttr) >- m_x.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::yAttr) >- m_y.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::widthAttr) >- m_width.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); >+ m_width->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); > else if (name == SVGNames::heightAttr) >- m_height.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); >+ m_height->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); > > reportAttributeParsingError(parseError, name, value); > >@@ -119,13 +112,13 @@ void SVGPatternElement::parseAttribute(const QualifiedName& name, const AtomicSt > > void SVGPatternElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isAnimatedLengthAttribute(attrName)) { >+ if (PropertyRegistry::isAnimatedLengthAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidateSVGPresentationAttributeStyle(); > return; > } > >- if (isKnownAttribute(attrName) || SVGFitToViewBox::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName) || SVGFitToViewBox::isKnownAttribute(attrName) || SVGURIReference::isKnownAttribute(attrName)) { > if (RenderObject* object = renderer()) > object->setNeedsLayout(); > return; >diff --git a/Source/WebCore/svg/SVGPatternElement.h b/Source/WebCore/svg/SVGPatternElement.h >index 03a606f0a05..e512aa58cb6 100644 >--- a/Source/WebCore/svg/SVGPatternElement.h >+++ b/Source/WebCore/svg/SVGPatternElement.h >@@ -21,12 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedLength.h" >-#include "SVGAnimatedPreserveAspectRatio.h" >-#include "SVGAnimatedRect.h" >-#include "SVGAnimatedTransformList.h" > #include "SVGElement.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGFitToViewBox.h" >@@ -48,32 +42,28 @@ public: > > AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const final; > >- const SVGLengthValue& x() const { return m_x.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); } >- SVGUnitTypes::SVGUnitType patternUnits() const { return m_patternUnits.currentValue(attributeOwnerProxy()); } >- SVGUnitTypes::SVGUnitType patternContentUnits() const { return m_patternContentUnits.currentValue(attributeOwnerProxy()); } >- const SVGTransformListValues& patternTransform() const { return m_patternTransform.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& x() const { return m_x->currentValue(); } >+ const SVGLengthValue& y() const { return m_y->currentValue(); } >+ const SVGLengthValue& width() const { return m_width->currentValue(); } >+ const SVGLengthValue& height() const { return m_height->currentValue(); } >+ SVGUnitTypes::SVGUnitType patternUnits() const { return m_patternUnits->currentValue<SVGUnitTypes::SVGUnitType>(); } >+ SVGUnitTypes::SVGUnitType patternContentUnits() const { return m_patternContentUnits->currentValue<SVGUnitTypes::SVGUnitType>(); } >+ const SVGTransformList& patternTransform() const { return m_patternTransform->currentValue(); } > >- RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> patternUnitsAnimated() { return m_patternUnits.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> patternContentUnitsAnimated() { return m_patternContentUnits.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedTransformList> patternTransformAnimated() { return m_patternTransform.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& x() { return m_x; } >+ Ref<SVGAnimatedLength>& y() { return m_y; } >+ Ref<SVGAnimatedLength>& width() { return m_width; } >+ Ref<SVGAnimatedLength>& height() { return m_height; } >+ Ref<SVGAnimatedEnumeration>& patternUnits() { return m_patternUnits; } >+ Ref<SVGAnimatedEnumeration>& patternContentUnits() { return m_patternContentUnits; } >+ Ref<SVGAnimatedTransformList>& patternTransform() { return m_patternTransform; } > > private: > SVGPatternElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGPatternElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGTests, SVGURIReference>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static bool isAnimatedLengthAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isAnimatedLengthAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGPatternElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGTests, SVGURIReference>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > void childrenChanged(const ChildChange&) final; >@@ -84,14 +74,14 @@ private: > bool needsPendingResourceHandling() const final { return false; } > bool selfHasRelativeLengths() const final { return true; } > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_x { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_y { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_width { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_height { LengthModeHeight }; >- SVGAnimatedEnumerationAttribute<SVGUnitTypes::SVGUnitType> m_patternUnits { SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX }; >- SVGAnimatedEnumerationAttribute<SVGUnitTypes::SVGUnitType> m_patternContentUnits { SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE }; >- SVGAnimatedTransformListAttribute m_patternTransform; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_x { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_y { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_width { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_height { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedEnumeration> m_patternUnits { SVGAnimatedEnumeration::create(this, SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) }; >+ Ref<SVGAnimatedEnumeration> m_patternContentUnits { SVGAnimatedEnumeration::create(this, SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) }; >+ Ref<SVGAnimatedTransformList> m_patternTransform { SVGAnimatedTransformList::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPoint.h b/Source/WebCore/svg/SVGPoint.h >index 926c8cb2ddf..4f2949a79ad 100644 >--- a/Source/WebCore/svg/SVGPoint.h >+++ b/Source/WebCore/svg/SVGPoint.h >@@ -28,86 +28,68 @@ > > #include "FloatPoint.h" > #include "SVGMatrix.h" >-#include "SVGPropertyTearOff.h" >+#include "SVGValueProperty.h" > > namespace WebCore { > >-class SVGPoint : public SVGPropertyTearOff<FloatPoint> { >+class SVGPoint : public SVGValueProperty<FloatPoint> { >+ using Base = SVGValueProperty<FloatPoint>; >+ using Base::Base; >+ using Base::m_value; >+ > public: >- static Ref<SVGPoint> create(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, FloatPoint& value) >+ static Ref<SVGPoint> create(const FloatPoint& value = { }) > { >- return adoptRef(*new SVGPoint(animatedProperty, role, value)); >+ return adoptRef(*new SVGPoint(value)); > } > >- static Ref<SVGPoint> create(const FloatPoint& initialValue = { }) >+ template<typename T> >+ static ExceptionOr<Ref<SVGPoint>> create(ExceptionOr<T>&& value) > { >- return adoptRef(*new SVGPoint(initialValue)); >+ if (value.hasException()) >+ return value.releaseException(); >+ return adoptRef(*new SVGPoint(value.releaseReturnValue())); > } > >- template<typename T> static ExceptionOr<Ref<SVGPoint>> create(ExceptionOr<T>&& initialValue) >+ Ref<SVGPoint> clone() const > { >- if (initialValue.hasException()) >- return initialValue.releaseException(); >- return create(initialValue.releaseReturnValue()); >+ return SVGPoint::create(m_value); > } > >- float x() >- { >- return propertyReference().x(); >- } >+ float x() { return m_value.x(); } > >- ExceptionOr<void> setX(float xValue) >+ ExceptionOr<void> setX(float x) > { > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setX(xValue); >+ m_value.setX(x); > commitChange(); >- > return { }; > } > >- float y() >- { >- return propertyReference().y(); >- } >+ float y() { return m_value.y(); } > >- ExceptionOr<void> setY(float xValue) >+ ExceptionOr<void> setY(float y) > { > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setY(xValue); >+ m_value.setY(y); > commitChange(); >- > return { }; > } > >- ExceptionOr<Ref<SVGPoint>> matrixTransform(SVGMatrix& matrix) >- { >- if (isReadOnly()) >- return Exception { NoModificationAllowedError }; >- >- auto newPoint = propertyReference().matrixTransform(matrix.propertyReference()); >- commitChange(); >- >- return SVGPoint::create(newPoint); >- } >- >-protected: >- SVGPoint(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, FloatPoint& value) >- : SVGPropertyTearOff<FloatPoint>(&animatedProperty, role, value) >- { >- } >- >- SVGPoint(SVGPropertyRole role, FloatPoint& value) >- : SVGPropertyTearOff<FloatPoint>(nullptr, role, value) >+ Ref<SVGPoint> matrixTransform(SVGMatrix& matrix) const > { >+ auto newPoint = m_value.matrixTransform(matrix.value()); >+ return adoptRef(*new SVGPoint(newPoint)); > } > >- explicit SVGPoint(const FloatPoint& initialValue) >- : SVGPropertyTearOff<FloatPoint>(initialValue) >+private: >+ String valueAsString() const override > { >+ return SVGPropertyTraits<FloatPoint>::toString(m_value); > } > }; > >diff --git a/Source/WebCore/svg/SVGPoint.idl b/Source/WebCore/svg/SVGPoint.idl >index 7c84515b5aa..5d822490dbb 100644 >--- a/Source/WebCore/svg/SVGPoint.idl >+++ b/Source/WebCore/svg/SVGPoint.idl >@@ -26,6 +26,6 @@ > attribute unrestricted float x; > attribute unrestricted float y; > >- [MayThrowException, NewObject] SVGPoint matrixTransform(SVGMatrix matrix); >+ [NewObject] SVGPoint matrixTransform(SVGMatrix matrix); > }; > >diff --git a/Source/WebCore/svg/SVGPointList.h b/Source/WebCore/svg/SVGPointList.h >index b0c2a10311e..248476e2ac3 100644 >--- a/Source/WebCore/svg/SVGPointList.h >+++ b/Source/WebCore/svg/SVGPointList.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -25,27 +25,80 @@ > > #pragma once > >-#include "SVGAnimatedListPropertyTearOff.h" >-#include "SVGListPropertyTearOff.h" > #include "SVGPoint.h" >-#include "SVGPointListValues.h" >+#include "SVGValuePropertyList.h" > > namespace WebCore { > >-class SVGPointList : public SVGListPropertyTearOff<SVGPointListValues> { >+class SVGPointList : public SVGValuePropertyList<SVGPoint> { >+ using Base = SVGValuePropertyList<SVGPoint>; >+ using Base::Base; >+ > public: >- using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<SVGPointListValues>; >- using ListWrapperCache = AnimatedListPropertyTearOff::ListWrapperCache; >+ static Ref<SVGPointList> create() >+ { >+ return adoptRef(*new SVGPointList()); >+ } > >- static Ref<SVGPointList> create(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGPointListValues& values, ListWrapperCache& wrappers) >+ static Ref<SVGPointList> create(SVGPropertyOwner* owner, SVGPropertyAccess access) > { >- return adoptRef(*new SVGPointList(animatedProperty, role, values, wrappers)); >+ return adoptRef(*new SVGPointList(owner, access)); > } > >-private: >- SVGPointList(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGPointListValues& values, ListWrapperCache& wrappers) >- : SVGListPropertyTearOff<SVGPointListValues>(animatedProperty, role, values, wrappers) >+ static Ref<SVGPointList> create(const SVGPointList& other, SVGPropertyAccess access) > { >+ return adoptRef(*new SVGPointList(other, access)); >+ } >+ >+ bool parse(const String& value) >+ { >+ clearItems(); >+ >+ auto upconvertedCharacters = StringView(value).upconvertedCharacters(); >+ const UChar* cur = upconvertedCharacters; >+ const UChar* end = cur + value.length(); >+ >+ skipOptionalSVGSpaces(cur, end); >+ >+ bool delimParsed = false; >+ while (cur < end) { >+ delimParsed = false; >+ float xPos = 0.0f; >+ if (!parseNumber(cur, end, xPos)) >+ return false; >+ >+ float yPos = 0.0f; >+ if (!parseNumber(cur, end, yPos, false)) >+ return false; >+ >+ skipOptionalSVGSpaces(cur, end); >+ >+ if (cur < end && *cur == ',') { >+ delimParsed = true; >+ cur++; >+ } >+ skipOptionalSVGSpaces(cur, end); >+ >+ append(SVGPoint::create(FloatPoint(xPos, yPos))); >+ } >+ >+ return !delimParsed; >+ } >+ >+ String valueAsString() const override >+ { >+ StringBuilder builder; >+ >+ for (const auto& point : m_items) { >+ if (builder.length()) >+ builder.append(' '); >+ >+ builder.appendNumber(point->x()); >+ builder.append(' '); >+ builder.appendNumber(point->y()); >+ } >+ >+ return builder.toString(); > } > }; > >diff --git a/Source/WebCore/svg/SVGPointListValues.cpp b/Source/WebCore/svg/SVGPointListValues.cpp >deleted file mode 100644 >index d81e6a2376e..00000000000 >--- a/Source/WebCore/svg/SVGPointListValues.cpp >+++ /dev/null >@@ -1,47 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> >- * >- * 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 "SVGPointListValues.h" >- >-#include <wtf/text/StringBuilder.h> >-#include <wtf/text/WTFString.h> >- >-namespace WebCore { >- >-String SVGPointListValues::valueAsString() const >-{ >- StringBuilder builder; >- >- unsigned size = this->size(); >- for (unsigned i = 0; i < size; ++i) { >- if (i > 0) >- builder.append(' '); // FIXME: Shouldn't we use commas to seperate? >- >- const auto& point = at(i); >- builder.appendNumber(point.x()); >- builder.append(' '); >- builder.appendNumber(point.y()); >- } >- >- return builder.toString(); >-} >- >-} >diff --git a/Source/WebCore/svg/SVGPointListValues.h b/Source/WebCore/svg/SVGPointListValues.h >deleted file mode 100644 >index 362fdcc5d7d..00000000000 >--- a/Source/WebCore/svg/SVGPointListValues.h >+++ /dev/null >@@ -1,55 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> >- * 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 "FloatPoint.h" >-#include "SVGPropertyTraits.h" >-#include <wtf/Vector.h> >- >-namespace WebCore { >- >-class SVGPoint; >-class SVGPointList; >- >-class SVGPointListValues final : public Vector<FloatPoint> { >-public: >- String valueAsString() const; >-}; >- >-template<> >-struct SVGPropertyTraits<SVGPointListValues> { >- static SVGPointListValues initialValue() { return { }; } >- static SVGPointListValues fromString(const String& string) >- { >- SVGPointListValues list; >- pointsListFromSVGData(list, string); >- return list; >- } >- static std::optional<SVGPointListValues> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return { }; } >- static String toString(const SVGPointListValues& list) { return list.valueAsString(); } >- >- using ListItemType = FloatPoint; >- using ListItemTearOff = SVGPoint; >- using ListPropertyTearOff = SVGPointList; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPolyElement.cpp b/Source/WebCore/svg/SVGPolyElement.cpp >index af6db56bcb0..6a66e7bcfb7 100644 >--- a/Source/WebCore/svg/SVGPolyElement.cpp >+++ b/Source/WebCore/svg/SVGPolyElement.cpp >@@ -37,28 +37,17 @@ SVGPolyElement::SVGPolyElement(const QualifiedName& tagName, Document& document) > : SVGGeometryElement(tagName, document) > , SVGExternalResourcesRequired(this) > { >- registerAttributes(); >-} >- >-void SVGPolyElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::pointsAttr, &SVGPolyElement::m_points>(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::pointsAttr, &SVGPolyElement::m_points>(); >+ }); > } > > void SVGPolyElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::pointsAttr) { >- SVGPointListValues newList; >- if (!pointsListFromSVGData(newList, value)) >+ if (!m_points->baseVal()->parse(value)) > document().accessSVGExtensions().reportError("Problem parsing points=\"" + value + "\""); >- >- if (auto wrapper = static_pointer_cast<SVGAnimatedPointList>(lookupAnimatedProperty(m_points))) >- wrapper->detachListWrappers(newList.size()); >- >- m_points.setValue(WTFMove(newList)); > return; > } > >@@ -81,21 +70,9 @@ void SVGPolyElement::svgAttributeChanged(const QualifiedName& attrName) > SVGExternalResourcesRequired::svgAttributeChanged(attrName); > } > >-Ref<SVGPointList> SVGPolyElement::points() >-{ >- m_points.setShouldSynchronize(true); >- return static_pointer_cast<SVGAnimatedPointList>(lookupOrCreateAnimatedProperty(m_points))->baseVal(); >-} >- >-Ref<SVGPointList> SVGPolyElement::animatedPoints() >-{ >- m_points.setShouldSynchronize(true); >- return static_pointer_cast<SVGAnimatedPointList>(lookupOrCreateAnimatedProperty(m_points))->animVal(); >-} >- > size_t SVGPolyElement::approximateMemoryCost() const > { >- size_t pointsCost = pointList().size() * sizeof(FloatPoint); >+ size_t pointsCost = m_points->baseVal()->items().size() * sizeof(FloatPoint); > // We need to account for the memory which is allocated by the RenderSVGPath::m_path. > return sizeof(*this) + (renderer() ? pointsCost * 2 + sizeof(RenderSVGPath) : pointsCost); > } >diff --git a/Source/WebCore/svg/SVGPolyElement.h b/Source/WebCore/svg/SVGPolyElement.h >index 0320c047808..423f9cacf0b 100644 >--- a/Source/WebCore/svg/SVGPolyElement.h >+++ b/Source/WebCore/svg/SVGPolyElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedPointList.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGeometryElement.h" > #include "SVGNames.h" >@@ -31,10 +30,10 @@ namespace WebCore { > class SVGPolyElement : public SVGGeometryElement, public SVGExternalResourcesRequired { > WTF_MAKE_ISO_ALLOCATED(SVGPolyElement); > public: >- Ref<SVGPointList> points(); >- Ref<SVGPointList> animatedPoints(); >- >- const SVGPointListValues& pointList() const { return m_points.value(); } >+ const SVGPointList& points() const { return m_points->currentValue(); } >+ >+ Ref<SVGPointList>& points() { return m_points->baseVal(); } >+ RefPtr<SVGPointList>& animatedPoints() { return m_points->animVal(); } > > size_t approximateMemoryCost() const override; > >@@ -42,20 +41,17 @@ protected: > SVGPolyElement(const QualifiedName&, Document&); > > private: >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGPolyElement, SVGGeometryElement, SVGExternalResourcesRequired>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGPolyElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > > bool isValid() const override { return SVGTests::isValid(); } > bool supportsMarkers() const override { return true; } > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedPointListAttribute m_points; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedPointList> m_points { SVGAnimatedPointList::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGPreserveAspectRatio.h b/Source/WebCore/svg/SVGPreserveAspectRatio.h >index 8839f85792b..da293a1d3aa 100644 >--- a/Source/WebCore/svg/SVGPreserveAspectRatio.h >+++ b/Source/WebCore/svg/SVGPreserveAspectRatio.h >@@ -26,32 +26,32 @@ > #pragma once > > #include "SVGPreserveAspectRatioValue.h" >-#include "SVGPropertyTearOff.h" >+#include "SVGValueProperty.h" > > namespace WebCore { > >-class SVGPreserveAspectRatio : public SVGPropertyTearOff<SVGPreserveAspectRatioValue> { >+class SVGPreserveAspectRatio : public SVGValueProperty<SVGPreserveAspectRatioValue> { > public: >- static Ref<SVGPreserveAspectRatio> create(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGPreserveAspectRatioValue& value) >- { >- return adoptRef(*new SVGPreserveAspectRatio(animatedProperty, role, value)); >- } >+ using Base = SVGValueProperty<SVGPreserveAspectRatioValue>; >+ using Base::Base; >+ using Base::m_value; > >- static Ref<SVGPreserveAspectRatio> create(const SVGPreserveAspectRatioValue& initialValue = { }) >+ static Ref<SVGPreserveAspectRatio> create(SVGPropertyOwner* owner, SVGPropertyAccess access, const SVGPreserveAspectRatioValue& value = { }) > { >- return adoptRef(*new SVGPreserveAspectRatio(initialValue)); >+ return adoptRef(*new SVGPreserveAspectRatio(owner, access, value)); > } > >- template<typename T> static ExceptionOr<Ref<SVGPreserveAspectRatio>> create(ExceptionOr<T>&& initialValue) >+ template<typename T> >+ static ExceptionOr<Ref<SVGPreserveAspectRatio>> create(ExceptionOr<T>&& value) > { >- if (initialValue.hasException()) >- return initialValue.releaseException(); >- return create(initialValue.releaseReturnValue()); >+ if (value.hasException()) >+ return value.releaseException(); >+ return adoptRef(*new SVGPreserveAspectRatio(value.releaseReturnValue())); > } > > unsigned short align() > { >- return propertyReference().align(); >+ return m_value.align(); > } > > ExceptionOr<void> setAlign(float value) >@@ -59,7 +59,7 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- auto result = propertyReference().setAlign(value); >+ auto result = m_value.setAlign(value); > if (result.hasException()) > return result; > >@@ -69,7 +69,7 @@ public: > > unsigned short meetOrSlice() > { >- return propertyReference().meetOrSlice(); >+ return m_value.meetOrSlice(); > } > > ExceptionOr<void> setMeetOrSlice(float value) >@@ -77,23 +77,17 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- auto result = propertyReference().setMeetOrSlice(value); >+ auto result = m_value.setMeetOrSlice(value); > if (result.hasException()) > return result; > > commitChange(); > return result; > } >- >-private: >- SVGPreserveAspectRatio(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGPreserveAspectRatioValue& value) >- : SVGPropertyTearOff<SVGPreserveAspectRatioValue>(&animatedProperty, role, value) >- { >- } >- >- explicit SVGPreserveAspectRatio(const SVGPreserveAspectRatioValue& initialValue) >- : SVGPropertyTearOff<SVGPreserveAspectRatioValue>(initialValue) >+ >+ String valueAsString() const override > { >+ return m_value.valueAsString(); > } > }; > >diff --git a/Source/WebCore/svg/SVGPreserveAspectRatioValue.h b/Source/WebCore/svg/SVGPreserveAspectRatioValue.h >index 6a7fca24a4d..59c837123f2 100644 >--- a/Source/WebCore/svg/SVGPreserveAspectRatioValue.h >+++ b/Source/WebCore/svg/SVGPreserveAspectRatioValue.h >@@ -76,11 +76,4 @@ private: > bool parseInternal(const UChar*& currParam, const UChar* end, bool validate); > }; > >-template<> struct SVGPropertyTraits<SVGPreserveAspectRatioValue> { >- static SVGPreserveAspectRatioValue initialValue() { return SVGPreserveAspectRatioValue(); } >- static SVGPreserveAspectRatioValue fromString(const String& string) { return SVGPreserveAspectRatioValue(string); } >- static std::optional<SVGPreserveAspectRatioValue> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >- static String toString(const SVGPreserveAspectRatioValue& type) { return type.valueAsString(); } >-}; >- > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGRadialGradientElement.cpp b/Source/WebCore/svg/SVGRadialGradientElement.cpp >index b88dd56bbd0..42f31113f6b 100644 >--- a/Source/WebCore/svg/SVGRadialGradientElement.cpp >+++ b/Source/WebCore/svg/SVGRadialGradientElement.cpp >@@ -44,7 +44,16 @@ inline SVGRadialGradientElement::SVGRadialGradientElement(const QualifiedName& t > { > // Spec: If the cx/cy/r/fr attribute is not specified, the effect is as if a value of "50%" were specified. > ASSERT(hasTagName(SVGNames::radialGradientTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::cxAttr, &SVGRadialGradientElement::m_cx>(); >+ PropertyRegistry::registerProperty<SVGNames::cyAttr, &SVGRadialGradientElement::m_cy>(); >+ PropertyRegistry::registerProperty<SVGNames::rAttr, &SVGRadialGradientElement::m_r>(); >+ PropertyRegistry::registerProperty<SVGNames::fxAttr, &SVGRadialGradientElement::m_fx>(); >+ PropertyRegistry::registerProperty<SVGNames::fyAttr, &SVGRadialGradientElement::m_fy>(); >+ PropertyRegistry::registerProperty<SVGNames::frAttr, &SVGRadialGradientElement::m_fr>(); >+ }); > } > > Ref<SVGRadialGradientElement> SVGRadialGradientElement::create(const QualifiedName& tagName, Document& document) >@@ -52,35 +61,22 @@ Ref<SVGRadialGradientElement> SVGRadialGradientElement::create(const QualifiedNa > return adoptRef(*new SVGRadialGradientElement(tagName, document)); > } > >-void SVGRadialGradientElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::cxAttr, &SVGRadialGradientElement::m_cx>(); >- registry.registerAttribute<SVGNames::cyAttr, &SVGRadialGradientElement::m_cy>(); >- registry.registerAttribute<SVGNames::rAttr, &SVGRadialGradientElement::m_r>(); >- registry.registerAttribute<SVGNames::fxAttr, &SVGRadialGradientElement::m_fx>(); >- registry.registerAttribute<SVGNames::fyAttr, &SVGRadialGradientElement::m_fy>(); >- registry.registerAttribute<SVGNames::frAttr, &SVGRadialGradientElement::m_fr>(); >-} >- > void SVGRadialGradientElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; > > if (name == SVGNames::cxAttr) >- m_cx.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_cx->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::cyAttr) >- m_cy.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_cy->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::rAttr) >- m_r.setValue(SVGLengthValue::construct(LengthModeOther, value, parseError, ForbidNegativeLengths)); >+ m_r->setBaseValInternal(SVGLengthValue::construct(LengthModeOther, value, parseError, ForbidNegativeLengths)); > else if (name == SVGNames::fxAttr) >- m_fx.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_fx->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::fyAttr) >- m_fy.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_fy->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::frAttr) >- m_fr.setValue(SVGLengthValue::construct(LengthModeOther, value, parseError, ForbidNegativeLengths)); >+ m_fr->setBaseValInternal(SVGLengthValue::construct(LengthModeOther, value, parseError, ForbidNegativeLengths)); > > reportAttributeParsingError(parseError, name, value); > >@@ -105,7 +101,7 @@ RenderPtr<RenderElement> SVGRadialGradientElement::createElementRenderer(RenderS > return createRenderer<RenderSVGResourceRadialGradient>(*this, WTFMove(style)); > } > >-static void setGradientAttributes(SVGGradientElement& element, RadialGradientAttributes& attributes, bool isRadial = true) >+static void setGradientAttributes(const SVGGradientElement& element, RadialGradientAttributes& attributes, bool isRadial = true) > { > if (!attributes.hasSpreadMethod() && element.hasAttribute(SVGNames::spreadMethodAttr)) > attributes.setSpreadMethod(element.spreadMethod()); >@@ -126,7 +122,7 @@ static void setGradientAttributes(SVGGradientElement& element, RadialGradientAtt > } > > if (isRadial) { >- SVGRadialGradientElement& radial = downcast<SVGRadialGradientElement>(element); >+ const SVGRadialGradientElement& radial = downcast<SVGRadialGradientElement>(element); > > if (!attributes.hasCx() && element.hasAttribute(SVGNames::cxAttr)) > attributes.setCx(radial.cx()); >@@ -148,13 +144,13 @@ static void setGradientAttributes(SVGGradientElement& element, RadialGradientAtt > } > } > >-bool SVGRadialGradientElement::collectGradientAttributes(RadialGradientAttributes& attributes) >+bool SVGRadialGradientElement::collectGradientAttributes(RadialGradientAttributes& attributes) const > { > if (!renderer()) > return false; > >- HashSet<SVGGradientElement*> processedGradients; >- SVGGradientElement* current = this; >+ HashSet<const SVGGradientElement*> processedGradients; >+ const SVGGradientElement* current = this; > > setGradientAttributes(*current, attributes); > processedGradients.add(current); >diff --git a/Source/WebCore/svg/SVGRadialGradientElement.h b/Source/WebCore/svg/SVGRadialGradientElement.h >index f991f3d02d9..85a88abe117 100644 >--- a/Source/WebCore/svg/SVGRadialGradientElement.h >+++ b/Source/WebCore/svg/SVGRadialGradientElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedLength.h" > #include "SVGGradientElement.h" > #include "SVGNames.h" > >@@ -34,30 +33,28 @@ class SVGRadialGradientElement final : public SVGGradientElement { > public: > static Ref<SVGRadialGradientElement> create(const QualifiedName&, Document&); > >- bool collectGradientAttributes(RadialGradientAttributes&); >+ bool collectGradientAttributes(RadialGradientAttributes&) const; > >- const SVGLengthValue& cx() const { return m_cx.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& cy() const { return m_cy.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& r() const { return m_r.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& fx() const { return m_fx.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& fy() const { return m_fy.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& fr() const { return m_fr.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& cx() const { return m_cx->currentValue(); } >+ const SVGLengthValue& cy() const { return m_cy->currentValue(); } >+ const SVGLengthValue& r() const { return m_r->currentValue(); } >+ const SVGLengthValue& fx() const { return m_fx->currentValue(); } >+ const SVGLengthValue& fy() const { return m_fy->currentValue(); } >+ const SVGLengthValue& fr() const { return m_fr->currentValue(); } > >- RefPtr<SVGAnimatedLength> cxAnimated() { return m_cx.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> cyAnimated() { return m_cy.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> rAnimated() { return m_r.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> fxAnimated() { return m_fx.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> fyAnimated() { return m_fy.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> frAnimated() { return m_fr.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& cx() { return m_cx; } >+ Ref<SVGAnimatedLength>& cy() { return m_cy; } >+ Ref<SVGAnimatedLength>& r() { return m_r; } >+ Ref<SVGAnimatedLength>& fx() { return m_fx; } >+ Ref<SVGAnimatedLength>& fy() { return m_fy; } >+ Ref<SVGAnimatedLength>& fr() { return m_fr; } > > private: > SVGRadialGradientElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGRadialGradientElement, SVGGradientElement>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGRadialGradientElement, SVGGradientElement>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >@@ -65,13 +62,13 @@ private: > > bool selfHasRelativeLengths() const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_cx { LengthModeWidth, "50%" }; >- SVGAnimatedLengthAttribute m_cy { LengthModeHeight, "50%" }; >- SVGAnimatedLengthAttribute m_r { LengthModeOther, "50%" }; >- SVGAnimatedLengthAttribute m_fx { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_fy { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_fr { LengthModeOther, "0%" }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_cx { SVGAnimatedLength::create(this, LengthModeWidth, "50%") }; >+ Ref<SVGAnimatedLength> m_cy { SVGAnimatedLength::create(this, LengthModeHeight, "50%") }; >+ Ref<SVGAnimatedLength> m_r { SVGAnimatedLength::create(this, LengthModeOther, "50%") }; >+ Ref<SVGAnimatedLength> m_fx { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_fy { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_fr { SVGAnimatedLength::create(this, LengthModeOther, "0%") }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGRect.h b/Source/WebCore/svg/SVGRect.h >index 5412005de9e..f5bf58cc69f 100644 >--- a/Source/WebCore/svg/SVGRect.h >+++ b/Source/WebCore/svg/SVGRect.h >@@ -20,105 +20,87 @@ > > #pragma once > >-#include "SVGPropertyTearOff.h" > #include "SVGPropertyTraits.h" >+#include "SVGValueProperty.h" > > namespace WebCore { > >-class SVGRect : public SVGPropertyTearOff<FloatRect> { >+class SVGRect : public SVGValueProperty<FloatRect> { >+ using Base = SVGValueProperty<FloatRect>; >+ using Base::Base; >+ using Base::m_value; >+ > public: >- static Ref<SVGRect> create(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, FloatRect& value) >+ static Ref<SVGRect> create(const FloatRect& value = { }) > { >- return adoptRef(*new SVGRect(animatedProperty, role, value)); >+ return adoptRef(*new SVGRect(value)); > } > >- static Ref<SVGRect> create(const FloatRect& initialValue = { }) >+ static Ref<SVGRect> create(SVGPropertyOwner* owner, SVGPropertyAccess access, const FloatRect& value = { }) > { >- return adoptRef(*new SVGRect(initialValue)); >+ return adoptRef(*new SVGRect(owner, access, value)); > } > >- template<typename T> static ExceptionOr<Ref<SVGRect>> create(ExceptionOr<T>&& initialValue) >+ template<typename T> >+ static ExceptionOr<Ref<SVGRect>> create(ExceptionOr<T>&& value) > { >- if (initialValue.hasException()) >- return initialValue.releaseException(); >- return create(initialValue.releaseReturnValue()); >+ if (value.hasException()) >+ return value.releaseException(); >+ return adoptRef(*new SVGRect(value.releaseReturnValue())); > } > >- float x() >- { >- return propertyReference().x(); >- } >+ float x() { return m_value.x(); } > > ExceptionOr<void> setX(float xValue) > { > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setX(xValue); >+ m_value.setX(xValue); > commitChange(); >- > return { }; > } > >- float y() >- { >- return propertyReference().y(); >- } >+ float y() { return m_value.y(); } > > ExceptionOr<void> setY(float xValue) > { > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setY(xValue); >+ m_value.setY(xValue); > commitChange(); >- > return { }; > } > >- float width() >- { >- return propertyReference().width(); >- } >+ float width() { return m_value.width(); } > > ExceptionOr<void> setWidth(float widthValue) > { > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setWidth(widthValue); >+ m_value.setWidth(widthValue); > commitChange(); >- > return { }; > } > >- float height() >- { >- return propertyReference().height(); >- } >+ float height() { return m_value.height(); } > > ExceptionOr<void> setHeight(float heightValue) > { > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setHeight(heightValue); >+ m_value.setHeight(heightValue); > commitChange(); >- > return { }; > } > >-private: >- SVGRect(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, FloatRect& value) >- : SVGPropertyTearOff<FloatRect>(&animatedProperty, role, value) >- { >- } >- >- explicit SVGRect(const FloatRect& initialValue) >- : SVGPropertyTearOff<FloatRect>(initialValue) >+ String valueAsString() const override > { >+ return SVGPropertyTraits<FloatRect>::toString(m_value); > } > }; > >- > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGRectElement.cpp b/Source/WebCore/svg/SVGRectElement.cpp >index cfdf196d035..68e189fac2e 100644 >--- a/Source/WebCore/svg/SVGRectElement.cpp >+++ b/Source/WebCore/svg/SVGRectElement.cpp >@@ -36,7 +36,16 @@ inline SVGRectElement::SVGRectElement(const QualifiedName& tagName, Document& do > , SVGExternalResourcesRequired(this) > { > ASSERT(hasTagName(SVGNames::rectTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGRectElement::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGRectElement::m_y>(); >+ PropertyRegistry::registerProperty<SVGNames::widthAttr, &SVGRectElement::m_width>(); >+ PropertyRegistry::registerProperty<SVGNames::heightAttr, &SVGRectElement::m_height>(); >+ PropertyRegistry::registerProperty<SVGNames::rxAttr, &SVGRectElement::m_rx>(); >+ PropertyRegistry::registerProperty<SVGNames::ryAttr, &SVGRectElement::m_ry>(); >+ }); > } > > Ref<SVGRectElement> SVGRectElement::create(const QualifiedName& tagName, Document& document) >@@ -44,35 +53,22 @@ Ref<SVGRectElement> SVGRectElement::create(const QualifiedName& tagName, Documen > return adoptRef(*new SVGRectElement(tagName, document)); > } > >-void SVGRectElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::xAttr, &SVGRectElement::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGRectElement::m_y>(); >- registry.registerAttribute<SVGNames::widthAttr, &SVGRectElement::m_width>(); >- registry.registerAttribute<SVGNames::heightAttr, &SVGRectElement::m_height>(); >- registry.registerAttribute<SVGNames::rxAttr, &SVGRectElement::m_rx>(); >- registry.registerAttribute<SVGNames::ryAttr, &SVGRectElement::m_ry>(); >-} >- > void SVGRectElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; > > if (name == SVGNames::xAttr) >- m_x.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::yAttr) >- m_y.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::rxAttr) >- m_rx.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); >+ m_rx->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); > else if (name == SVGNames::ryAttr) >- m_ry.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); >+ m_ry->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); > else if (name == SVGNames::widthAttr) >- m_width.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); >+ m_width->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); > else if (name == SVGNames::heightAttr) >- m_height.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); >+ m_height->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); > > reportAttributeParsingError(parseError, name, value); > >@@ -82,7 +78,7 @@ void SVGRectElement::parseAttribute(const QualifiedName& name, const AtomicStrin > > void SVGRectElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidateSVGPresentationAttributeStyle(); > return; >diff --git a/Source/WebCore/svg/SVGRectElement.h b/Source/WebCore/svg/SVGRectElement.h >index e4cdab1affa..dcafca08014 100644 >--- a/Source/WebCore/svg/SVGRectElement.h >+++ b/Source/WebCore/svg/SVGRectElement.h >@@ -21,8 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedLength.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGeometryElement.h" > #include "SVGNames.h" >@@ -34,29 +32,26 @@ class SVGRectElement final : public SVGGeometryElement, public SVGExternalResour > public: > static Ref<SVGRectElement> create(const QualifiedName&, Document&); > >- const SVGLengthValue& x() const { return m_x.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& rx() const { return m_rx.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& ry() const { return m_ry.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& x() const { return m_x->currentValue(); } >+ const SVGLengthValue& y() const { return m_y->currentValue(); } >+ const SVGLengthValue& width() const { return m_width->currentValue(); } >+ const SVGLengthValue& height() const { return m_height->currentValue(); } >+ const SVGLengthValue& rx() const { return m_rx->currentValue(); } >+ const SVGLengthValue& ry() const { return m_ry->currentValue(); } > >- RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> rxAnimated() { return m_rx.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> ryAnimated() { return m_ry.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& x() { return m_x; } >+ Ref<SVGAnimatedLength>& y() { return m_y; } >+ Ref<SVGAnimatedLength>& width() { return m_width; } >+ Ref<SVGAnimatedLength>& height() { return m_height; } >+ Ref<SVGAnimatedLength>& rx() { return m_rx; } >+ Ref<SVGAnimatedLength>& ry() { return m_ry; } > > private: > SVGRectElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGRectElement, SVGGeometryElement, SVGExternalResourcesRequired>; >- static auto& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGRectElement, SVGGeometryElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -65,13 +60,13 @@ private: > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_x { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_y { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_width { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_height { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_rx { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_ry { LengthModeHeight}; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_x { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_y { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_width { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_height { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_rx { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_ry { SVGAnimatedLength::create(this, LengthModeHeight) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGSVGElement.cpp b/Source/WebCore/svg/SVGSVGElement.cpp >index 16171a305ed..a0d910929c7 100644 >--- a/Source/WebCore/svg/SVGSVGElement.cpp >+++ b/Source/WebCore/svg/SVGSVGElement.cpp >@@ -41,7 +41,6 @@ > #include "SVGNumber.h" > #include "SVGPoint.h" > #include "SVGRect.h" >-#include "SVGStaticPropertyTearOff.h" > #include "SVGTransform.h" > #include "SVGViewElement.h" > #include "SVGViewSpec.h" >@@ -59,8 +58,15 @@ inline SVGSVGElement::SVGSVGElement(const QualifiedName& tagName, Document& docu > , m_timeContainer(SMILTimeContainer::create(*this)) > { > ASSERT(hasTagName(SVGNames::svgTag)); >- registerAttributes(); > document.registerForDocumentSuspensionCallbacks(this); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGSVGElement::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGSVGElement::m_y>(); >+ PropertyRegistry::registerProperty<SVGNames::widthAttr, &SVGSVGElement::m_width>(); >+ PropertyRegistry::registerProperty<SVGNames::heightAttr, &SVGSVGElement::m_height>(); >+ }); > } > > Ref<SVGSVGElement> SVGSVGElement::create(const QualifiedName& tagName, Document& document) >@@ -171,16 +177,11 @@ void SVGSVGElement::setCurrentScale(float scale) > frame->setPageZoomFactor(scale); > } > >-Ref<SVGPoint> SVGSVGElement::currentTranslate() >-{ >- return SVGStaticPropertyTearOff<SVGSVGElement, SVGPoint>::create(*this, m_currentTranslate, &SVGSVGElement::updateCurrentTranslate); >-} >- > void SVGSVGElement::setCurrentTranslate(const FloatPoint& translation) > { >- if (m_currentTranslate == translation) >+ if (m_currentTranslate->value() == translation) > return; >- m_currentTranslate = translation; >+ m_currentTranslate->setValue(translation); > updateCurrentTranslate(); > } > >@@ -192,17 +193,6 @@ void SVGSVGElement::updateCurrentTranslate() > document().renderView()->repaint(); > } > >-void SVGSVGElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::xAttr, &SVGSVGElement::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGSVGElement::m_y>(); >- registry.registerAttribute<SVGNames::widthAttr, &SVGSVGElement::m_width>(); >- registry.registerAttribute<SVGNames::heightAttr, &SVGSVGElement::m_height>(); >-} >- > void SVGSVGElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (!nearestViewportElement()) { >@@ -241,9 +231,9 @@ void SVGSVGElement::parseAttribute(const QualifiedName& name, const AtomicString > SVGParsingError parseError = NoError; > > if (name == SVGNames::xAttr) >- m_x.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::yAttr) >- m_y.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::widthAttr) { > auto length = SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths); > if (parseError != NoError || value.isEmpty()) { >@@ -251,7 +241,7 @@ void SVGSVGElement::parseAttribute(const QualifiedName& name, const AtomicString > // Not sure it's correct for the empty string or for something that can't be parsed. > length = SVGLengthValue(LengthModeWidth, "100%"_s); > } >- m_width.setValue(length); >+ m_width->setBaseValInternal(length); > } else if (name == SVGNames::heightAttr) { > auto length = SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths); > if (parseError != NoError || value.isEmpty()) { >@@ -259,7 +249,7 @@ void SVGSVGElement::parseAttribute(const QualifiedName& name, const AtomicString > // Not sure it's correct for the empty string or for something that can't be parsed. > length = SVGLengthValue(LengthModeHeight, "100%"_s); > } >- m_height.setValue(length); >+ m_height->setBaseValInternal(length); > } > > reportAttributeParsingError(parseError, name, value); >@@ -272,7 +262,7 @@ void SVGSVGElement::parseAttribute(const QualifiedName& name, const AtomicString > > void SVGSVGElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > invalidateSVGPresentationAttributeStyle(); > >@@ -322,12 +312,12 @@ Ref<NodeList> SVGSVGElement::collectIntersectionOrEnclosureList(SVGRect& rect, S > > static bool checkIntersectionWithoutUpdatingLayout(SVGElement& element, SVGRect& rect) > { >- return RenderSVGModelObject::checkIntersection(element.renderer(), rect.propertyReference()); >+ return RenderSVGModelObject::checkIntersection(element.renderer(), rect.value()); > } > > static bool checkEnclosureWithoutUpdatingLayout(SVGElement& element, SVGRect& rect) > { >- return RenderSVGModelObject::checkEnclosure(element.renderer(), rect.propertyReference()); >+ return RenderSVGModelObject::checkEnclosure(element.renderer(), rect.value()); > } > > Ref<NodeList> SVGSVGElement::getIntersectionList(SVGRect& rect, SVGElement* referenceElement) >@@ -396,12 +386,12 @@ Ref<SVGRect> SVGSVGElement::createSVGRect() > > Ref<SVGTransform> SVGSVGElement::createSVGTransform() > { >- return SVGTransform::create(SVGTransformValue { SVGTransformValue::SVG_TRANSFORM_MATRIX }); >+ return SVGTransform::create(SVGTransformValue::SVG_TRANSFORM_MATRIX); > } > > Ref<SVGTransform> SVGSVGElement::createSVGTransformFromMatrix(SVGMatrix& matrix) > { >- return SVGTransform::create(SVGTransformValue { matrix.propertyReference() }); >+ return SVGTransform::create(matrix.value()); > } > > AffineTransform SVGSVGElement::localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const >@@ -542,7 +532,7 @@ bool SVGSVGElement::selfHasRelativeLengths() const > FloatRect SVGSVGElement::currentViewBoxRect() const > { > if (m_useCurrentView) >- return m_viewSpec ? m_viewSpec->viewBox() : FloatRect(); >+ return m_viewSpec ? m_viewSpec->viewBox()->currentValue() : FloatRect(); > > FloatRect viewBox = this->viewBox(); > if (!viewBox.isEmpty()) >@@ -617,8 +607,8 @@ AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float vie > if (!m_useCurrentView || !m_viewSpec) > return SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), preserveAspectRatio(), viewWidth, viewHeight); > >- AffineTransform transform = SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), m_viewSpec->preserveAspectRatio(), viewWidth, viewHeight); >- m_viewSpec->transformValue().concatenate(transform); >+ AffineTransform transform = SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), m_viewSpec->preserveAspectRatio()->currentValue(), viewWidth, viewHeight); >+ m_viewSpec->transform()->concatenate(transform); > return transform; > } > >@@ -700,8 +690,8 @@ void SVGSVGElement::resetScrollAnchor() > if (!m_currentViewFragmentIdentifier.isEmpty()) { > if (auto* rootElement = findRootAnchor(m_currentViewFragmentIdentifier)) { > SVGViewSpec& view = rootElement->currentView(); >- view.setViewBox(viewBox()); >- view.setPreserveAspectRatio(preserveAspectRatio()); >+ view.setViewBox(viewBox()->currentValue()); >+ view.setPreserveAspectRatio(preserveAspectRatio()->currentValue()); > view.setZoomAndPan(zoomAndPan()); > m_currentViewFragmentIdentifier = { }; > } >@@ -720,12 +710,12 @@ void SVGSVGElement::inheritViewAttributes(const SVGViewElement& viewElement) > if (viewElement.hasAttribute(SVGNames::viewBoxAttr)) > view.setViewBox(viewElement.viewBox()); > else >- view.setViewBox(viewBox()); >+ view.setViewBox(viewBox()->currentValue()); > > if (viewElement.hasAttribute(SVGNames::preserveAspectRatioAttr)) > view.setPreserveAspectRatio(viewElement.preserveAspectRatio()); > else >- view.setPreserveAspectRatio(preserveAspectRatio()); >+ view.setPreserveAspectRatio(preserveAspectRatio()->currentValue()); > > if (viewElement.hasAttribute(SVGNames::zoomAndPanAttr)) > view.setZoomAndPan(viewElement.zoomAndPan()); >diff --git a/Source/WebCore/svg/SVGSVGElement.h b/Source/WebCore/svg/SVGSVGElement.h >index 9bcf2868564..cb79fb083b7 100644 >--- a/Source/WebCore/svg/SVGSVGElement.h >+++ b/Source/WebCore/svg/SVGSVGElement.h >@@ -22,10 +22,6 @@ > #pragma once > > #include "FloatPoint.h" >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedLength.h" >-#include "SVGAnimatedPreserveAspectRatio.h" >-#include "SVGAnimatedRect.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGFitToViewBox.h" > #include "SVGGraphicsElement.h" >@@ -64,8 +60,8 @@ public: // DOM > float currentScale() const; > void setCurrentScale(float); > >- Ref<SVGPoint> currentTranslate(); >- FloatPoint currentTranslateValue() { return m_currentTranslate; } >+ Ref<SVGPoint>& currentTranslate() { return m_currentTranslate; } >+ FloatPoint currentTranslateValue() const { return m_currentTranslate->value(); } > > unsigned suspendRedraw(unsigned maxWaitMilliseconds); > void unsuspendRedraw(unsigned suspendHandleId); >@@ -109,7 +105,7 @@ public: > SMILTimeContainer& timeContainer() { return m_timeContainer.get(); } > > void setCurrentTranslate(const FloatPoint&); // Used to pan. >- void updateCurrentTranslate(); // Used from DOM bindings to create an SVGStaticPropertyTearOff for currentTranslate. >+ void updateCurrentTranslate(); > > bool hasIntrinsicWidth() const; > bool hasIntrinsicHeight() const; >@@ -121,28 +117,26 @@ public: > > AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) const; > >- const SVGLengthValue& x() const { return m_x.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& x() const { return m_x->currentValue(); } >+ const SVGLengthValue& y() const { return m_y->currentValue(); } >+ const SVGLengthValue& width() const { return m_width->currentValue(); } >+ const SVGLengthValue& height() const { return m_height->currentValue(); } > >- RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& x() { return m_x; } >+ Ref<SVGAnimatedLength>& y() { return m_y; } >+ Ref<SVGAnimatedLength>& width() { return m_width; } >+ Ref<SVGAnimatedLength>& height() { return m_height; } > > private: > SVGSVGElement(const QualifiedName&, Document&); > virtual ~SVGSVGElement(); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGSVGElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGSVGElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGFitToViewBox>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; >+ > bool selfHasRelativeLengths() const override; > bool isValid() const override; > >@@ -165,15 +159,16 @@ private: > > bool m_useCurrentView { false }; > Ref<SMILTimeContainer> m_timeContainer; >- FloatPoint m_currentTranslate; > RefPtr<SVGViewSpec> m_viewSpec; > String m_currentViewFragmentIdentifier; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_x { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_y { LengthModeHeight}; >- SVGAnimatedLengthAttribute m_width { LengthModeWidth, "100%"_s }; >- SVGAnimatedLengthAttribute m_height { LengthModeHeight, "100%"_s }; >+ Ref<SVGPoint> m_currentTranslate { SVGPoint::create() }; >+ >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_x { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_y { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_width { SVGAnimatedLength::create(this, LengthModeWidth, "100%"_s) }; >+ Ref<SVGAnimatedLength> m_height { SVGAnimatedLength::create(this, LengthModeHeight, "100%"_s) }; > }; > > } // 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/SVGScriptElement.cpp b/Source/WebCore/svg/SVGScriptElement.cpp >index 9c333ed1906..11867139d67 100644 >--- a/Source/WebCore/svg/SVGScriptElement.cpp >+++ b/Source/WebCore/svg/SVGScriptElement.cpp >@@ -24,7 +24,6 @@ > > #include "Document.h" > #include "Event.h" >-#include "SVGAnimatedStaticPropertyTearOff.h" > #include <wtf/IsoMallocInlines.h> > > namespace WebCore { >@@ -58,7 +57,7 @@ void SVGScriptElement::svgAttributeChanged(const QualifiedName& attrName) > InstanceInvalidationGuard guard(*this); > > if (SVGURIReference::isKnownAttribute(attrName)) { >- handleSourceAttribute(href()); >+ handleSourceAttribute(href()->currentValue()); > return; > } > >diff --git a/Source/WebCore/svg/SVGScriptElement.h b/Source/WebCore/svg/SVGScriptElement.h >index f8ced22a327..d7f66ec421e 100644 >--- a/Source/WebCore/svg/SVGScriptElement.h >+++ b/Source/WebCore/svg/SVGScriptElement.h >@@ -21,8 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedString.h" > #include "SVGElement.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGURIReference.h" >@@ -42,9 +40,9 @@ public: > private: > SVGScriptElement(const QualifiedName&, Document&, bool wasInsertedByParser, bool alreadyStarted); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGScriptElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGScriptElement, SVGElement, SVGExternalResourcesRequired, SVGURIReference>; > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -56,7 +54,7 @@ private: > void finishParsingChildren() final; > void addSubresourceAttributeURLs(ListHashSet<URL>&) const final; > >- bool haveLoadedRequiredResources() final { return SVGExternalResourcesRequired::haveLoadedRequiredResources(); } >+ bool haveLoadedRequiredResources() const final { return SVGExternalResourcesRequired::haveLoadedRequiredResources(); } > > String sourceAttributeValue() const final { return href(); } > String charsetAttributeValue() const final { return String(); } >@@ -80,11 +78,7 @@ private: > bool haveFiredLoadEvent() const final { return ScriptElement::haveFiredLoadEvent(); } > Timer* svgLoadEventTimer() final { return &m_svgLoadEventTimer; } > >-#ifndef NDEBUG >- bool filterOutAnimatableAttribute(const QualifiedName& name) const final { return name == SVGNames::typeAttr; } >-#endif >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; > Timer m_svgLoadEventTimer; > }; > >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/SVGStopElement.cpp b/Source/WebCore/svg/SVGStopElement.cpp >index 660112190db..3da3576f60d 100644 >--- a/Source/WebCore/svg/SVGStopElement.cpp >+++ b/Source/WebCore/svg/SVGStopElement.cpp >@@ -37,7 +37,11 @@ inline SVGStopElement::SVGStopElement(const QualifiedName& tagName, Document& do > : SVGElement(tagName, document) > { > ASSERT(hasTagName(SVGNames::stopTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::offsetAttr, &SVGStopElement::m_offset>(); >+ }); > } > > Ref<SVGStopElement> SVGStopElement::create(const QualifiedName& tagName, Document& document) >@@ -45,21 +49,13 @@ Ref<SVGStopElement> SVGStopElement::create(const QualifiedName& tagName, Documen > return adoptRef(*new SVGStopElement(tagName, document)); > } > >-void SVGStopElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::offsetAttr, &SVGStopElement::m_offset>(); >-} >- > void SVGStopElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::offsetAttr) { > if (value.endsWith('%')) >- m_offset.setValue(value.string().left(value.length() - 1).toFloat() / 100.0f); >+ m_offset->setBaseValInternal(value.string().left(value.length() - 1).toFloat() / 100.0f); > else >- m_offset.setValue(value.toFloat()); >+ m_offset->setBaseValInternal(value.toFloat()); > return; > } > >diff --git a/Source/WebCore/svg/SVGStopElement.h b/Source/WebCore/svg/SVGStopElement.h >index d843b76afed..f0120aaabe1 100644 >--- a/Source/WebCore/svg/SVGStopElement.h >+++ b/Source/WebCore/svg/SVGStopElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedNumber.h" > #include "SVGElement.h" > > namespace WebCore { >@@ -33,18 +32,15 @@ public: > > Color stopColorIncludingOpacity() const; > >- float offset() { return m_offset.currentValue(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumber> offsetAnimated() { return m_offset.animatedProperty(attributeOwnerProxy()); } >+ float offset() const { return m_offset->currentValue(); } >+ Ref<SVGAnimatedNumber>& offset() { return m_offset; } > > private: > SVGStopElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGStopElement, SVGElement>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGStopElement, SVGElement>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > void svgAttributeChanged(const QualifiedName&) final; > >@@ -53,8 +49,8 @@ private: > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > bool rendererIsNeeded(const RenderStyle&) final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedNumberAttribute m_offset { 0 }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedNumber> m_offset { SVGAnimatedNumber::create(0) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGStringList.h b/Source/WebCore/svg/SVGStringList.h >index 7fe7f00fc52..999ac695973 100644 >--- a/Source/WebCore/svg/SVGStringList.h >+++ b/Source/WebCore/svg/SVGStringList.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions >@@ -25,33 +25,62 @@ > > #pragma once > >-#include "SVGAnimatedListPropertyTearOff.h" >-#include "SVGListPropertyTearOff.h" >-#include "SVGStringListValues.h" >+#include "SVGPrimitiveList.h" > > namespace WebCore { > >-class SVGStringList final : public SVGStaticListPropertyTearOff<SVGStringListValues> { >+class SVGStringList final : public SVGPrimitiveList<String> { >+ using Base = SVGPrimitiveList<String>; >+ using Base::Base; >+ using Base::m_items; >+ > public: >- using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<SVGStringListValues>; >- using ListWrapperCache = AnimatedListPropertyTearOff::ListWrapperCache; >+ static Ref<SVGStringList> create(SVGPropertyOwner* owner) >+ { >+ return adoptRef(*new SVGStringList(owner)); >+ } > >- static Ref<SVGStringList> create(SVGElement& contextElement, SVGStringListValues& values) >+ void reset(const String& string) > { >- return adoptRef(*new SVGStringList(&contextElement, values)); >+ parse(string, ' '); >+ >+ // Add empty string, if list is empty. >+ if (m_items.isEmpty()) >+ m_items.append(emptyString()); > } > >- static Ref<SVGStringList> create(AnimatedListPropertyTearOff&, SVGPropertyRole, SVGStringListValues& values, ListWrapperCache&) >+ bool parse(const String& data, UChar delimiter) > { >- // FIXME: Find a way to remove this. It's only needed to keep Windows compiling. >- ASSERT_NOT_REACHED(); >- return adoptRef(*new SVGStringList(nullptr, values)); >+ clearItems(); >+ >+ auto upconvertedCharacters = StringView(data).upconvertedCharacters(); >+ const UChar* ptr = upconvertedCharacters; >+ const UChar* end = ptr + data.length(); >+ while (ptr < end) { >+ const UChar* start = ptr; >+ while (ptr < end && *ptr != delimiter && !isSVGSpace(*ptr)) >+ ptr++; >+ if (ptr == start) >+ break; >+ m_items.append(String(start, ptr - start)); >+ skipOptionalSVGSpacesOrDelimiter(ptr, end, delimiter); >+ } >+ >+ return ptr == end; > } > >-private: >- SVGStringList(SVGElement* contextElement, SVGStringListValues& values) >- : SVGStaticListPropertyTearOff<SVGStringListValues>(contextElement, values) >+ String valueAsString() const override > { >+ StringBuilder builder; >+ >+ for (auto string : m_items) { >+ if (builder.length()) >+ builder.append(' '); >+ >+ builder.append(string); >+ } >+ >+ return builder.toString(); > } > }; > >diff --git a/Source/WebCore/svg/SVGStringListValues.cpp b/Source/WebCore/svg/SVGStringListValues.cpp >deleted file mode 100644 >index 3ff898a912b..00000000000 >--- a/Source/WebCore/svg/SVGStringListValues.cpp >+++ /dev/null >@@ -1,79 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> >- * >- * 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 "SVGStringListValues.h" >- >-#include "SVGElement.h" >-#include "SVGParserUtilities.h" >-#include <wtf/text/StringBuilder.h> >- >-namespace WebCore { >- >-void SVGStringListValues::commitChange(SVGElement& contextElement) >-{ >- contextElement.invalidateSVGAttributes(); >- contextElement.svgAttributeChanged(m_attributeName); >-} >- >-void SVGStringListValues::reset(const String& string) >-{ >- parse(string, ' '); >- >- // Add empty string, if list is empty. >- if (isEmpty()) >- append(emptyString()); >-} >- >-void SVGStringListValues::parse(const String& data, UChar delimiter) >-{ >- // TODO : more error checking/reporting >- clear(); >- >- auto upconvertedCharacters = StringView(data).upconvertedCharacters(); >- const UChar* ptr = upconvertedCharacters; >- const UChar* end = ptr + data.length(); >- while (ptr < end) { >- const UChar* start = ptr; >- while (ptr < end && *ptr != delimiter && !isSVGSpace(*ptr)) >- ptr++; >- if (ptr == start) >- break; >- append(String(start, ptr - start)); >- skipOptionalSVGSpacesOrDelimiter(ptr, end, delimiter); >- } >-} >- >-String SVGStringListValues::valueAsString() const >-{ >- StringBuilder builder; >- >- unsigned size = this->size(); >- for (unsigned i = 0; i < size; ++i) { >- if (i > 0) >- builder.append(' '); >- >- builder.append(at(i)); >- } >- >- return builder.toString(); >-} >- >-} >diff --git a/Source/WebCore/svg/SVGStringListValues.h b/Source/WebCore/svg/SVGStringListValues.h >deleted file mode 100644 >index ff9a2742219..00000000000 >--- a/Source/WebCore/svg/SVGStringListValues.h >+++ /dev/null >@@ -1,71 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> >- * 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 "QualifiedName.h" >-#include "SVGAttributeAccessor.h" >-#include "SVGPropertyTraits.h" >- >-#include <wtf/Vector.h> >- >-namespace WebCore { >- >-class SVGElement; >-class SVGStringList; >-class SVGStringListValues; >- >-template<typename T> >-class SVGPropertyTearOff; >- >-using SVGStringListValuesAttribute = SVGPropertyAttribute<SVGStringListValues>; >- >-template<typename OwnerType> >-using SVGStringListValuesAttributeAccessor = SVGPropertyAttributeAccessor<OwnerType, SVGStringListValuesAttribute>; >- >-class SVGStringListValues final : public Vector<String> { >-public: >- SVGStringListValues(const QualifiedName& attributeName) >- : m_attributeName(attributeName) >- { >- } >- >- void reset(const String&); >- void parse(const String&, UChar delimiter = ','); >- >- // Only used by SVGStringList. >- void commitChange(SVGElement& contextElement); >- >- String valueAsString() const; >- >-private: >- const QualifiedName& m_attributeName; >-}; >- >-template<> struct SVGPropertyTraits<SVGStringListValues> { >- static String toString(const SVGStringListValues& list) { return list.valueAsString(); } >- >- using ListItemType = String; >- using ListItemTearOff = SVGPropertyTearOff<String>; >- using ListPropertyTearOff = SVGStringList; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGSwitchElement.h b/Source/WebCore/svg/SVGSwitchElement.h >index 1e44667db4e..4d6cec36bbe 100644 >--- a/Source/WebCore/svg/SVGSwitchElement.h >+++ b/Source/WebCore/svg/SVGSwitchElement.h >@@ -21,7 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGraphicsElement.h" > >@@ -35,15 +34,15 @@ public: > private: > SVGSwitchElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGSwitchElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGSwitchElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > > bool isValid() const final { return SVGTests::isValid(); } > > bool childShouldCreateRenderer(const Node&) const final; > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGSymbolElement.h b/Source/WebCore/svg/SVGSymbolElement.h >index d7683e19238..d800f6fa4ac 100644 >--- a/Source/WebCore/svg/SVGSymbolElement.h >+++ b/Source/WebCore/svg/SVGSymbolElement.h >@@ -21,9 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedPreserveAspectRatio.h" >-#include "SVGAnimatedRect.h" > #include "SVGElement.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGFitToViewBox.h" >@@ -38,8 +35,8 @@ public: > private: > SVGSymbolElement(const QualifiedName&, Document&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGSymbolElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox>; >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGSymbolElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; >@@ -47,7 +44,7 @@ private: > > bool selfHasRelativeLengths() const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGTRefElement.cpp b/Source/WebCore/svg/SVGTRefElement.cpp >index b73f3cf878f..74df34562b0 100644 >--- a/Source/WebCore/svg/SVGTRefElement.cpp >+++ b/Source/WebCore/svg/SVGTRefElement.cpp >@@ -167,7 +167,8 @@ void SVGTRefElement::detachTarget() > return; > > // Mark the referenced ID as pending. >- auto target = SVGURIReference::targetElementFromIRIString(href(), document()); >+ String href = this->href()->currentValue(); >+ auto target = SVGURIReference::targetElementFromIRIString(href, document()); > if (!target.identifier.isEmpty()) > document().accessSVGExtensions().addPendingResource(target.identifier, this); > } >@@ -230,7 +231,8 @@ void SVGTRefElement::buildPendingResource() > if (!isConnected()) > return; > >- auto target = SVGURIReference::targetElementFromIRIString(href(), treeScope()); >+ String href = this->href()->currentValue(); >+ auto target = SVGURIReference::targetElementFromIRIString(href, treeScope()); > if (!target.element) { > if (target.identifier.isEmpty()) > return; >diff --git a/Source/WebCore/svg/SVGTRefElement.h b/Source/WebCore/svg/SVGTRefElement.h >index ba17ccaae7e..83d3220ad12 100644 >--- a/Source/WebCore/svg/SVGTRefElement.h >+++ b/Source/WebCore/svg/SVGTRefElement.h >@@ -39,9 +39,9 @@ private: > SVGTRefElement(const QualifiedName&, Document&); > virtual ~SVGTRefElement(); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGTRefElement, SVGTextPositioningElement, SVGURIReference>; >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTRefElement, SVGTextPositioningElement, SVGURIReference>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >@@ -58,7 +58,7 @@ private: > void detachTarget(); > void buildPendingResource() override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >+ PropertyRegistry m_propertyRegistry { *this }; > Ref<SVGTRefTargetEventListener> m_targetListener; > }; > >diff --git a/Source/WebCore/svg/SVGTests.cpp b/Source/WebCore/svg/SVGTests.cpp >index 7134ce7b8e6..a343b9f2774 100644 >--- a/Source/WebCore/svg/SVGTests.cpp >+++ b/Source/WebCore/svg/SVGTests.cpp >@@ -24,9 +24,9 @@ > > #include "DOMImplementation.h" > #include "HTMLNames.h" >-#include "SVGAttributeOwnerProxy.h" > #include "SVGElement.h" > #include "SVGNames.h" >+#include "SVGPropertyOwnerRegistry.h" > #include "SVGStringList.h" > #include <wtf/Language.h> > #include <wtf/NeverDestroyed.h> >@@ -109,28 +109,21 @@ static const HashSet<String, ASCIICaseInsensitiveHash>& supportedSVGFeatures() > > SVGTests::SVGTests(SVGElement* contextElement) > : m_contextElement(*contextElement) >+ , m_requiredFeatures(SVGStringList::create(contextElement)) >+ , m_requiredExtensions(SVGStringList::create(contextElement)) >+ , m_systemLanguage(SVGStringList::create(contextElement)) > { >- registerAttributes(); >-} >- >-void SVGTests::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::requiredFeaturesAttr, &SVGTests::m_requiredFeatures>(); >- registry.registerAttribute<SVGNames::requiredExtensionsAttr, &SVGTests::m_requiredExtensions>(); >- registry.registerAttribute<SVGNames::systemLanguageAttr, &SVGTests::m_systemLanguage>(); >-} >- >-SVGTests::AttributeRegistry& SVGTests::attributeRegistry() >-{ >- return AttributeOwnerProxy::attributeRegistry(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::requiredFeaturesAttr, &SVGTests::m_requiredFeatures>(); >+ PropertyRegistry::registerProperty<SVGNames::requiredExtensionsAttr, &SVGTests::m_requiredExtensions>(); >+ PropertyRegistry::registerProperty<SVGNames::systemLanguageAttr, &SVGTests::m_systemLanguage>(); >+ }); > } > > bool SVGTests::isKnownAttribute(const QualifiedName& attributeName) > { >- return AttributeOwnerProxy::isKnownAttribute(attributeName); >+ return PropertyRegistry::isKnownAttribute(attributeName); > } > > bool SVGTests::hasExtension(const String& extension) >@@ -145,15 +138,15 @@ bool SVGTests::hasExtension(const String& extension) > > bool SVGTests::isValid() const > { >- for (auto& feature : m_requiredFeatures.value()) { >+ for (auto& feature : m_requiredFeatures->items()) { > if (feature.isEmpty() || !supportedSVGFeatures().contains(feature)) > return false; > } >- for (auto& language : m_systemLanguage.value()) { >+ for (auto& language : m_systemLanguage->items()) { > if (language != defaultLanguage().substring(0, 2)) > return false; > } >- for (auto& extension : m_requiredExtensions.value()) { >+ for (auto& extension : m_requiredExtensions->items()) { > if (!hasExtension(extension)) > return false; > } >@@ -163,11 +156,11 @@ bool SVGTests::isValid() const > void SVGTests::parseAttribute(const QualifiedName& attributeName, const AtomicString& value) > { > if (attributeName == requiredFeaturesAttr) >- m_requiredFeatures.value().reset(value); >+ m_requiredFeatures->reset(value); > if (attributeName == requiredExtensionsAttr) >- m_requiredExtensions.value().reset(value); >+ m_requiredExtensions->reset(value); > if (attributeName == systemLanguageAttr) >- m_systemLanguage.value().reset(value); >+ m_systemLanguage->reset(value); > } > > void SVGTests::svgAttributeChanged(const QualifiedName& attrName) >@@ -187,24 +180,6 @@ void SVGTests::addSupportedAttributes(HashSet<QualifiedName>& supportedAttribute > supportedAttributes.add(systemLanguageAttr); > } > >-Ref<SVGStringList> SVGTests::requiredFeatures() >-{ >- m_requiredFeatures.setShouldSynchronize(true); >- return SVGStringList::create(m_contextElement, m_requiredFeatures.value()); >-} >- >-Ref<SVGStringList> SVGTests::requiredExtensions() >-{ >- m_requiredExtensions.setShouldSynchronize(true); >- return SVGStringList::create(m_contextElement, m_requiredExtensions.value()); >-} >- >-Ref<SVGStringList> SVGTests::systemLanguage() >-{ >- m_systemLanguage.setShouldSynchronize(true); >- return SVGStringList::create(m_contextElement, m_systemLanguage.value()); >-} >- > bool SVGTests::hasFeatureForLegacyBindings(const String& feature, const String& version) > { > // FIXME: This function is here only to be exposed in the Objective-C and GObject bindings for both Node and DOMImplementation. >diff --git a/Source/WebCore/svg/SVGTests.h b/Source/WebCore/svg/SVGTests.h >index 79dde9b60a4..3e34cf04136 100644 >--- a/Source/WebCore/svg/SVGTests.h >+++ b/Source/WebCore/svg/SVGTests.h >@@ -21,8 +21,7 @@ > > #pragma once > >-#include "SVGAttribute.h" >-#include "SVGStringListValues.h" >+#include "SVGStringList.h" > > namespace WebCore { > >@@ -30,10 +29,7 @@ class SVGElement; > class SVGStringList; > > template<typename OwnerType, typename... BaseTypes> >-class SVGAttributeRegistry; >- >-template<typename OwnerType, typename... BaseTypes> >-class SVGAttributeOwnerProxyImpl; >+class SVGPropertyOwnerRegistry; > > class SVGTests { > WTF_MAKE_NONCOPYABLE(SVGTests); >@@ -41,9 +37,8 @@ public: > static bool hasExtension(const String&); > bool isValid() const; > >- using AttributeRegistry = SVGAttributeRegistry<SVGTests>; >- static AttributeRegistry& attributeRegistry(); >- static bool isKnownAttribute(const QualifiedName& attributeName); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTests>; >+ static bool isKnownAttribute(const QualifiedName&); > > void parseAttribute(const QualifiedName&, const AtomicString&); > void svgAttributeChanged(const QualifiedName&); >@@ -53,21 +48,18 @@ public: > WEBCORE_EXPORT static bool hasFeatureForLegacyBindings(const String& feature, const String& version); > > // These methods are called from DOM through the super classes. >- Ref<SVGStringList> requiredFeatures(); >- Ref<SVGStringList> requiredExtensions(); >- Ref<SVGStringList> systemLanguage(); >+ const Ref<SVGStringList>& requiredFeatures() { return m_requiredFeatures; } >+ const Ref<SVGStringList>& requiredExtensions() { return m_requiredExtensions; } >+ const Ref<SVGStringList>& systemLanguage() { return m_systemLanguage; } > > protected: > SVGTests(SVGElement* contextElement); > > private: >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGTests>; >- static void registerAttributes(); >- > SVGElement& m_contextElement; >- SVGStringListValuesAttribute m_requiredFeatures { SVGNames::requiredFeaturesAttr }; >- SVGStringListValuesAttribute m_requiredExtensions { SVGNames::requiredExtensionsAttr }; >- SVGStringListValuesAttribute m_systemLanguage { SVGNames::systemLanguageAttr }; >+ Ref<SVGStringList> m_requiredFeatures; >+ Ref<SVGStringList> m_requiredExtensions; >+ Ref<SVGStringList> m_systemLanguage; > }; > > } // namespace WebCore >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/SVGTextContentElement.cpp b/Source/WebCore/svg/SVGTextContentElement.cpp >index 8be560528de..d3d5b988fd1 100644 >--- a/Source/WebCore/svg/SVGTextContentElement.cpp >+++ b/Source/WebCore/svg/SVGTextContentElement.cpp >@@ -47,7 +47,11 @@ SVGTextContentElement::SVGTextContentElement(const QualifiedName& tagName, Docum > : SVGGraphicsElement(tagName, document) > , SVGExternalResourcesRequired(this) > { >- registerAttributes(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::textLengthAttr, &SVGTextContentElement::m_textLength>(); >+ PropertyRegistry::registerProperty<SVGNames::lengthAdjustAttr, SVGLengthAdjustType, &SVGTextContentElement::m_lengthAdjust>(); >+ }); > } > > unsigned SVGTextContentElement::getNumberOfChars() >@@ -158,15 +162,6 @@ void SVGTextContentElement::collectStyleForPresentationAttribute(const Qualified > SVGGraphicsElement::collectStyleForPresentationAttribute(name, value, style); > } > >-void SVGTextContentElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute(SVGAnimatedCustomLengthAttributeAccessor::singleton<SVGNames::textLengthAttr, &SVGTextContentElement::m_textLength>()); >- registry.registerAttribute<SVGNames::lengthAdjustAttr, SVGLengthAdjustType, &SVGTextContentElement::m_lengthAdjust>(); >-} >- > void SVGTextContentElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; >@@ -174,9 +169,9 @@ void SVGTextContentElement::parseAttribute(const QualifiedName& name, const Atom > if (name == SVGNames::lengthAdjustAttr) { > auto propertyValue = SVGPropertyTraits<SVGLengthAdjustType>::fromString(value); > if (propertyValue > 0) >- m_lengthAdjust.setValue(propertyValue); >+ m_lengthAdjust->setBaseValInternal<SVGLengthAdjustType>(propertyValue); > } else if (name == SVGNames::textLengthAttr) >- m_textLength.setValue(SVGLengthValue::construct(LengthModeOther, value, parseError, ForbidNegativeLengths)); >+ m_textLength->setBaseValInternal(SVGLengthValue::construct(LengthModeOther, value, parseError, ForbidNegativeLengths)); > > reportAttributeParsingError(parseError, name, value); > >@@ -186,9 +181,9 @@ void SVGTextContentElement::parseAttribute(const QualifiedName& name, const Atom > > void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > if (attrName == SVGNames::textLengthAttr) >- m_specifiedTextLength = m_textLength.value(); >+ m_specifiedTextLength = m_textLength->baseVal()->value(); > > if (auto renderer = this->renderer()) { > InstanceInvalidationGuard guard(*this); >@@ -200,6 +195,14 @@ void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName) > SVGGraphicsElement::svgAttributeChanged(attrName); > SVGExternalResourcesRequired::svgAttributeChanged(attrName); > } >+ >+Ref<SVGAnimatedLength>& SVGTextContentElement::textLength() >+{ >+ static NeverDestroyed<SVGLengthValue> defaultTextLength(LengthModeOther); >+ if (m_textLength->baseVal()->value() == defaultTextLength) >+ m_textLength->baseVal()->value().newValueSpecifiedUnits(LengthTypeNumber, getComputedTextLength()); >+ return m_textLength; >+} > > bool SVGTextContentElement::selfHasRelativeLengths() const > { >diff --git a/Source/WebCore/svg/SVGTextContentElement.h b/Source/WebCore/svg/SVGTextContentElement.h >index 157c3d7a786..8d16fe2a0e8 100644 >--- a/Source/WebCore/svg/SVGTextContentElement.h >+++ b/Source/WebCore/svg/SVGTextContentElement.h >@@ -21,9 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedLength.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGraphicsElement.h" > >@@ -85,16 +82,15 @@ public: > ExceptionOr<void> selectSubString(unsigned charnum, unsigned nchars); > > static SVGTextContentElement* elementFromRenderer(RenderObject*); >- const SVGLengthValue& specifiedTextLength() { return m_specifiedTextLength; } > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGTextContentElement, SVGGraphicsElement, SVGExternalResourcesRequired>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTextContentElement, SVGGraphicsElement, SVGExternalResourcesRequired>; > >- const SVGLengthValue& textLength() const { return m_textLength.currentValue(attributeOwnerProxy()); } >- SVGLengthAdjustType lengthAdjust() const { return m_lengthAdjust.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& specifiedTextLength() const { return m_specifiedTextLength; } >+ const SVGLengthValue& textLength() const { return m_textLength->currentValue(); } >+ SVGLengthAdjustType lengthAdjust() const { return m_lengthAdjust->currentValue<SVGLengthAdjustType>(); } > >- RefPtr<SVGAnimatedLength> textLengthAnimated() { return m_textLength.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> lengthAdjustAnimated() { return m_lengthAdjust.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& textLength(); >+ Ref<SVGAnimatedEnumeration>& lengthAdjust() { return m_lengthAdjust; } > > protected: > SVGTextContentElement(const QualifiedName&, Document&); >@@ -110,48 +106,12 @@ protected: > > private: > bool isTextContent() const final { return true; } >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; } > >- static void registerAttributes(); >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >+ const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; } > >- class SVGAnimatedCustomLengthAttribute : public SVGAnimatedLengthAttribute { >- public: >- using SVGAnimatedLengthAttribute::operator=; >- >- SVGAnimatedCustomLengthAttribute(SVGTextContentElement& element, SVGLengthMode lengthMode) >- : SVGAnimatedLengthAttribute(lengthMode) >- , m_element(element) >- { >- } >- >- void synchronize(Element&, const QualifiedName& attributeName) >- { >- if (!shouldSynchronize()) >- return; >- String string(SVGPropertyTraits<SVGLengthValue>::toString(m_element.m_specifiedTextLength)); >- static_cast<Element&>(m_element).setSynchronizedLazyAttribute(attributeName, string); >- } >- >- RefPtr<SVGAnimatedLength> animatedProperty(const SVGAttributeOwnerProxy& attributeOwnerProxy) >- { >- static NeverDestroyed<SVGLengthValue> defaultTextLength(LengthModeOther); >- if (m_element.m_specifiedTextLength == defaultTextLength) >- m_element.m_textLength.value().newValueSpecifiedUnits(LengthTypeNumber, m_element.getComputedTextLength()); >- >- setShouldSynchronize(true); >- return static_reference_cast<SVGAnimatedLength>(attributeOwnerProxy.lookupOrCreateAnimatedProperty(*this).releaseNonNull()); >- } >- >- private: >- SVGTextContentElement& m_element; >- }; >- >- using SVGAnimatedCustomLengthAttributeAccessor = SVGAnimatedAttributeAccessor<SVGTextContentElement, SVGAnimatedCustomLengthAttribute, AnimatedLength>; >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedCustomLengthAttribute m_textLength { *this, LengthModeOther }; >- SVGAnimatedEnumerationAttribute<SVGLengthAdjustType> m_lengthAdjust { SVGLengthAdjustSpacing }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_textLength { SVGAnimatedLength::create(this, LengthModeOther) }; >+ Ref<SVGAnimatedEnumeration> m_lengthAdjust { SVGAnimatedEnumeration::create(this, SVGLengthAdjustSpacing) }; > SVGLengthValue m_specifiedTextLength { LengthModeOther }; > }; > >diff --git a/Source/WebCore/svg/SVGTextElement.cpp b/Source/WebCore/svg/SVGTextElement.cpp >index 6d205e3cf9a..5e59f61cecd 100644 >--- a/Source/WebCore/svg/SVGTextElement.cpp >+++ b/Source/WebCore/svg/SVGTextElement.cpp >@@ -1,6 +1,7 @@ > /* > * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> >+ * 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 >diff --git a/Source/WebCore/svg/SVGTextPathElement.cpp b/Source/WebCore/svg/SVGTextPathElement.cpp >index a1191f901a3..3d624cf117b 100644 >--- a/Source/WebCore/svg/SVGTextPathElement.cpp >+++ b/Source/WebCore/svg/SVGTextPathElement.cpp >@@ -38,7 +38,13 @@ inline SVGTextPathElement::SVGTextPathElement(const QualifiedName& tagName, Docu > , SVGURIReference(this) > { > ASSERT(hasTagName(SVGNames::textPathTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::startOffsetAttr, &SVGTextPathElement::m_startOffset>(); >+ PropertyRegistry::registerProperty<SVGNames::methodAttr, SVGTextPathMethodType, &SVGTextPathElement::m_method>(); >+ PropertyRegistry::registerProperty<SVGNames::spacingAttr, SVGTextPathSpacingType, &SVGTextPathElement::m_spacing>(); >+ }); > } > > Ref<SVGTextPathElement> SVGTextPathElement::create(const QualifiedName& tagName, Document& document) >@@ -56,30 +62,20 @@ void SVGTextPathElement::clearResourceReferences() > document().accessSVGExtensions().removeAllTargetReferencesForElement(this); > } > >-void SVGTextPathElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::startOffsetAttr, &SVGTextPathElement::m_startOffset>(); >- registry.registerAttribute<SVGNames::methodAttr, SVGTextPathMethodType, &SVGTextPathElement::m_method>(); >- registry.registerAttribute<SVGNames::spacingAttr, SVGTextPathSpacingType, &SVGTextPathElement::m_spacing>(); >-} >- > void SVGTextPathElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; > > if (name == SVGNames::startOffsetAttr) >- m_startOffset.setValue(SVGLengthValue::construct(LengthModeOther, value, parseError)); >+ m_startOffset->setBaseValInternal(SVGLengthValue::construct(LengthModeOther, value, parseError)); > else if (name == SVGNames::methodAttr) { > SVGTextPathMethodType propertyValue = SVGPropertyTraits<SVGTextPathMethodType>::fromString(value); > if (propertyValue > 0) >- m_method.setValue(propertyValue); >+ m_method->setBaseValInternal<SVGTextPathMethodType>(propertyValue); > } else if (name == SVGNames::spacingAttr) { > SVGTextPathSpacingType propertyValue = SVGPropertyTraits<SVGTextPathSpacingType>::fromString(value); > if (propertyValue > 0) >- m_spacing.setValue(propertyValue); >+ m_spacing->setBaseValInternal<SVGTextPathSpacingType>(propertyValue); > } > > reportAttributeParsingError(parseError, name, value); >@@ -90,7 +86,7 @@ void SVGTextPathElement::parseAttribute(const QualifiedName& name, const AtomicS > > void SVGTextPathElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > > if (attrName == SVGNames::startOffsetAttr) >@@ -143,7 +139,8 @@ void SVGTextPathElement::buildPendingResource() > if (!isConnected()) > return; > >- auto target = SVGURIReference::targetElementFromIRIString(href(), treeScope()); >+ String href = this->href()->currentValue(); >+ auto target = SVGURIReference::targetElementFromIRIString(href, treeScope()); > if (!target.element) { > // Do not register as pending if we are already pending this resource. > if (document().accessSVGExtensions().isPendingResource(this, target.identifier)) >diff --git a/Source/WebCore/svg/SVGTextPathElement.h b/Source/WebCore/svg/SVGTextPathElement.h >index 69b3855d633..a3d2bc9f2ff 100644 >--- a/Source/WebCore/svg/SVGTextPathElement.h >+++ b/Source/WebCore/svg/SVGTextPathElement.h >@@ -111,13 +111,13 @@ public: > > static Ref<SVGTextPathElement> create(const QualifiedName&, Document&); > >- const SVGLengthValue& startOffset() const { return m_startOffset.currentValue(attributeOwnerProxy()); } >- SVGTextPathMethodType method() const { return m_method.currentValue(attributeOwnerProxy()); } >- SVGTextPathSpacingType spacing() const { return m_spacing.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& startOffset() const { return m_startOffset->currentValue(); } >+ SVGTextPathMethodType method() const { return m_method->currentValue<SVGTextPathMethodType>(); } >+ SVGTextPathSpacingType spacing() const { return m_spacing->currentValue<SVGTextPathSpacingType>(); } > >- RefPtr<SVGAnimatedLength> startOffsetAnimated() { return m_startOffset.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> methodAnimated() { return m_method.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedEnumeration> spacingAnimated() { return m_spacing.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& startOffset() { return m_startOffset; } >+ Ref<SVGAnimatedEnumeration>& method() { return m_method; } >+ Ref<SVGAnimatedEnumeration>& spacing() { return m_spacing; } > > protected: > void didFinishInsertingNode() override; >@@ -126,12 +126,9 @@ private: > SVGTextPathElement(const QualifiedName&, Document&); > virtual ~SVGTextPathElement(); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGTextPathElement, SVGTextContentElement, SVGURIReference>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTextPathElement, SVGTextContentElement, SVGURIReference>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > >@@ -146,10 +143,10 @@ private: > > bool selfHasRelativeLengths() const override; > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_startOffset { LengthModeOther }; >- SVGAnimatedEnumerationAttribute<SVGTextPathMethodType> m_method { SVGTextPathMethodAlign }; >- SVGAnimatedEnumerationAttribute<SVGTextPathSpacingType> m_spacing { SVGTextPathSpacingExact }; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_startOffset { SVGAnimatedLength::create(this, LengthModeOther) }; >+ Ref<SVGAnimatedEnumeration> m_method { SVGAnimatedEnumeration::create(this, SVGTextPathMethodAlign) }; >+ Ref<SVGAnimatedEnumeration> m_spacing { SVGAnimatedEnumeration::create(this, SVGTextPathSpacingExact) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGTextPositioningElement.cpp b/Source/WebCore/svg/SVGTextPositioningElement.cpp >index 75c4bfe343c..01936503d52 100644 >--- a/Source/WebCore/svg/SVGTextPositioningElement.cpp >+++ b/Source/WebCore/svg/SVGTextPositioningElement.cpp >@@ -27,9 +27,7 @@ > #include "RenderSVGResource.h" > #include "RenderSVGText.h" > #include "SVGAltGlyphElement.h" >-#include "SVGLengthListValues.h" > #include "SVGNames.h" >-#include "SVGNumberListValues.h" > #include "SVGTRefElement.h" > #include "SVGTSpanElement.h" > #include "SVGTextElement.h" >@@ -42,60 +40,40 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(SVGTextPositioningElement); > SVGTextPositioningElement::SVGTextPositioningElement(const QualifiedName& tagName, Document& document) > : SVGTextContentElement(tagName, document) > { >- registerAttributes(); >-} >- >-void SVGTextPositioningElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::xAttr, &SVGTextPositioningElement::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGTextPositioningElement::m_y>(); >- registry.registerAttribute<SVGNames::dxAttr, &SVGTextPositioningElement::m_dx>(); >- registry.registerAttribute<SVGNames::dyAttr, &SVGTextPositioningElement::m_dy>(); >- registry.registerAttribute<SVGNames::rotateAttr, &SVGTextPositioningElement::m_rotate>(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGTextPositioningElement::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGTextPositioningElement::m_y>(); >+ PropertyRegistry::registerProperty<SVGNames::dxAttr, &SVGTextPositioningElement::m_dx>(); >+ PropertyRegistry::registerProperty<SVGNames::dyAttr, &SVGTextPositioningElement::m_dy>(); >+ PropertyRegistry::registerProperty<SVGNames::rotateAttr, &SVGTextPositioningElement::m_rotate>(); >+ }); > } > > void SVGTextPositioningElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (name == SVGNames::xAttr) { >- SVGLengthListValues newList; >- newList.parse(value, LengthModeWidth); >- m_x.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); >- m_x.setValue(WTFMove(newList)); >+ m_x->baseVal()->parse(value); > return; > } > > if (name == SVGNames::yAttr) { >- SVGLengthListValues newList; >- newList.parse(value, LengthModeHeight); >- m_y.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); >- m_y.setValue(WTFMove(newList)); >+ m_y->baseVal()->parse(value); > return; > } > > if (name == SVGNames::dxAttr) { >- SVGLengthListValues newList; >- newList.parse(value, LengthModeWidth); >- m_dx.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); >- m_dx.setValue(WTFMove(newList)); >+ m_dx->baseVal()->parse(value); > return; > } > > if (name == SVGNames::dyAttr) { >- SVGLengthListValues newList; >- newList.parse(value, LengthModeHeight); >- m_dy.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); >- m_dy.setValue(WTFMove(newList)); >+ m_dy->baseVal()->parse(value); > return; > } > > if (name == SVGNames::rotateAttr) { >- SVGNumberListValues newList; >- newList.parse(value); >- m_rotate.detachAnimatedListWrappers(attributeOwnerProxy(), newList.size()); >- m_rotate.setValue(WTFMove(newList)); >+ m_rotate->baseVal()->parse(value); > return; > } > >@@ -118,7 +96,7 @@ bool SVGTextPositioningElement::isPresentationAttribute(const QualifiedName& nam > > void SVGTextPositioningElement::svgAttributeChanged(const QualifiedName& attrName) > { >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > InstanceInvalidationGuard guard(*this); > > if (attrName != SVGNames::rotateAttr) >diff --git a/Source/WebCore/svg/SVGTextPositioningElement.h b/Source/WebCore/svg/SVGTextPositioningElement.h >index 1b1b81bb289..7616f68457a 100644 >--- a/Source/WebCore/svg/SVGTextPositioningElement.h >+++ b/Source/WebCore/svg/SVGTextPositioningElement.h >@@ -21,8 +21,6 @@ > > #pragma once > >-#include "SVGAnimatedLengthList.h" >-#include "SVGAnimatedNumberList.h" > #include "SVGTextContentElement.h" > > namespace WebCore { >@@ -32,20 +30,19 @@ class SVGTextPositioningElement : public SVGTextContentElement { > public: > static SVGTextPositioningElement* elementFromRenderer(RenderBoxModelObject&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGTextPositioningElement, SVGTextContentElement>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGTextPositioningElement, SVGTextContentElement>; > >- const SVGLengthListValues& x() const { return m_x.currentValue(attributeOwnerProxy()); } >- const SVGLengthListValues& y() const { return m_y.currentValue(attributeOwnerProxy()); } >- const SVGLengthListValues& dx() const { return m_dx.currentValue(attributeOwnerProxy()); } >- const SVGLengthListValues& dy() const { return m_dy.currentValue(attributeOwnerProxy()); } >- const SVGNumberListValues& rotate() const { return m_rotate.currentValue(attributeOwnerProxy()); } >+ const SVGLengthList& x() const { return m_x->currentValue(); } >+ const SVGLengthList& y() const { return m_y->currentValue(); } >+ const SVGLengthList& dx() const { return m_dx->currentValue(); } >+ const SVGLengthList& dy() const { return m_dy->currentValue(); } >+ const SVGNumberList& rotate() const { return m_rotate->currentValue(); } > >- RefPtr<SVGAnimatedLengthList> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLengthList> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLengthList> dxAnimated() { return m_dx.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLengthList> dyAnimated() { return m_dy.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedNumberList> rotateAnimated() { return m_rotate.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLengthList>& x() { return m_x; } >+ Ref<SVGAnimatedLengthList>& y() { return m_y; } >+ Ref<SVGAnimatedLengthList>& dx() { return m_dx; } >+ Ref<SVGAnimatedLengthList>& dy() { return m_dy; } >+ Ref<SVGAnimatedNumberList>& rotate() { return m_rotate; } > > protected: > SVGTextPositioningElement(const QualifiedName&, Document&); >@@ -57,17 +54,14 @@ private: > bool isPresentationAttribute(const QualifiedName&) const final; > void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) final; > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; } >+ const SVGPropertyRegistry& propertyRegistry() const override { return m_propertyRegistry; } > >- static void registerAttributes(); >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthListAttribute m_x; >- SVGAnimatedLengthListAttribute m_y; >- SVGAnimatedLengthListAttribute m_dx; >- SVGAnimatedLengthListAttribute m_dy; >- SVGAnimatedNumberListAttribute m_rotate; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLengthList> m_x { SVGAnimatedLengthList::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLengthList> m_y { SVGAnimatedLengthList::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLengthList> m_dx { SVGAnimatedLengthList::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLengthList> m_dy { SVGAnimatedLengthList::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedNumberList> m_rotate { SVGAnimatedNumberList::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGTransform.cpp b/Source/WebCore/svg/SVGTransform.cpp >deleted file mode 100644 >index 59037945ab7..00000000000 >--- a/Source/WebCore/svg/SVGTransform.cpp >+++ /dev/null >@@ -1,38 +0,0 @@ >-/* >- * Copyright (C) 2016 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >- * THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#include "config.h" >-#include "SVGTransform.h" >- >-#include "SVGMatrixTearOff.h" >- >-namespace WebCore { >- >-Ref<SVGMatrix> SVGTransform::matrix() >-{ >- return SVGMatrixTearOff::create(*this, propertyReference().svgMatrix()); >-} >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGTransform.h b/Source/WebCore/svg/SVGTransform.h >index eff8dbcbd90..11e13d7007a 100644 >--- a/Source/WebCore/svg/SVGTransform.h >+++ b/Source/WebCore/svg/SVGTransform.h >@@ -26,50 +26,57 @@ > #pragma once > > #include "SVGMatrix.h" >-#include "SVGPropertyTearOff.h" > #include "SVGTransformValue.h" >+#include "SVGValueProperty.h" > > namespace WebCore { > >-class SVGTransform : public SVGPropertyTearOff<SVGTransformValue> { >+class SVGTransform : public SVGValueProperty<SVGTransformValue>, public SVGPropertyOwner { > public: >- static Ref<SVGTransform> create(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGTransformValue& value) >+ static Ref<SVGTransform> create(SVGTransformValue::SVGTransformType type) > { >- return adoptRef(*new SVGTransform(animatedProperty, role, value)); >+ return adoptRef(*new SVGTransform(type)); > } > >- static Ref<SVGTransform> create(const SVGTransformValue& initialValue = { }) >+ static Ref<SVGTransform> create(const AffineTransform& transform = { }) > { >- return adoptRef(*new SVGTransform(initialValue)); >+ return adoptRef(*new SVGTransform(SVGTransformValue::SVG_TRANSFORM_MATRIX, transform)); > } > >- template<typename T> static ExceptionOr<Ref<SVGTransform>> create(ExceptionOr<T>&& initialValue) >+ static Ref<SVGTransform> create(const SVGTransformValue& value) > { >- if (initialValue.hasException()) >- return initialValue.releaseException(); >- return create(initialValue.releaseReturnValue()); >+ return adoptRef(*new SVGTransform(value.type(), value.matrix()->value(), value.angle(), value.rotationCenter())); > } > >- unsigned short type() >+ template<typename T> >+ static ExceptionOr<Ref<SVGTransform>> create(ExceptionOr<T>&& value) > { >- return propertyReference().type(); >+ if (value.hasException()) >+ return value.releaseException(); >+ return create(value.releaseReturnValue()); > } > >- Ref<SVGMatrix> matrix(); >+ ~SVGTransform() >+ { >+ m_value.matrix()->detach(); >+ } > >- float angle() >+ Ref<SVGTransform> clone() const > { >- return propertyReference().angle(); >+ return SVGTransform::create(m_value); > } > >+ unsigned short type() { return m_value.type(); } >+ float angle() { return m_value.angle(); } >+ const Ref<SVGMatrix>& matrix() { return m_value.matrix(); } >+ > ExceptionOr<void> setMatrix(SVGMatrix& matrix) > { > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setMatrix(matrix.propertyReference()); >+ m_value.setMatrix(matrix.value()); > commitChange(); >- > return { }; > } > >@@ -78,9 +85,8 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setTranslate(tx, ty); >+ m_value.setTranslate(tx, ty); > commitChange(); >- > return { }; > } > >@@ -89,9 +95,8 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setScale(sx, sy); >+ m_value.setScale(sx, sy); > commitChange(); >- > return { }; > } > >@@ -100,9 +105,8 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setRotate(angle, cx, cy); >+ m_value.setRotate(angle, cx, cy); > commitChange(); >- > return { }; > } > >@@ -111,9 +115,8 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setSkewX(angle); >+ m_value.setSkewX(angle); > commitChange(); >- > return { }; > } > >@@ -122,21 +125,32 @@ public: > if (isReadOnly()) > return Exception { NoModificationAllowedError }; > >- propertyReference().setSkewY(angle); >+ m_value.setSkewY(angle); > commitChange(); >- > return { }; > } > > private: >- SVGTransform(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, SVGTransformValue& value) >- : SVGPropertyTearOff<SVGTransformValue>(&animatedProperty, role, value) >+ using Base = SVGValueProperty<SVGTransformValue>; >+ >+ SVGTransform(SVGTransformValue::SVGTransformType type, const AffineTransform& transform = { }, float angle = 0, const FloatPoint& rotationCenter = { }) >+ : Base(SVGTransformValue(type, SVGMatrix::create(this, SVGPropertyAccess::ReadWrite, transform), angle, rotationCenter)) >+ { >+ } >+ >+ SVGPropertyOwner* owner() const override { return m_owner; } >+ >+ void commitPropertyChange(SVGProperty* property) override > { >+ ASSERT_UNUSED(property, property == m_value.matrix().ptr()); >+ if (owner()) >+ owner()->commitPropertyChange(this); >+ m_value.matrixDidChange(); > } > >- explicit SVGTransform(const SVGTransformValue& initialValue) >- : SVGPropertyTearOff<SVGTransformValue>(initialValue) >+ String valueAsString() const override > { >+ return m_value.valueAsString(); > } > }; > >diff --git a/Source/WebCore/svg/SVGTransform.idl b/Source/WebCore/svg/SVGTransform.idl >index 11974059398..529b0ed50ad 100644 >--- a/Source/WebCore/svg/SVGTransform.idl >+++ b/Source/WebCore/svg/SVGTransform.idl >@@ -32,7 +32,7 @@ > const unsigned short SVG_TRANSFORM_SKEWY = 6; > > readonly attribute unsigned short type; >- [NewObject] readonly attribute SVGMatrix matrix; >+ readonly attribute SVGMatrix matrix; > readonly attribute unrestricted float angle; > > [MayThrowException] void setMatrix(SVGMatrix matrix); >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/SVGTransformList.h b/Source/WebCore/svg/SVGTransformList.h >index c872fca5276..a8fd42c0565 100644 >--- a/Source/WebCore/svg/SVGTransformList.h >+++ b/Source/WebCore/svg/SVGTransformList.h >@@ -1,6 +1,7 @@ > /* > * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> >+ * 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 >@@ -20,57 +21,124 @@ > > #pragma once > >-#include "SVGAnimatedListPropertyTearOff.h" >-#include "SVGListPropertyTearOff.h" >-#include "SVGTransformListValues.h" >+#include "SVGTransform.h" >+#include "SVGTransformable.h" >+#include "SVGValuePropertyList.h" > > namespace WebCore { > >-class SVGTransformList final : public SVGListPropertyTearOff<SVGTransformListValues> { >+class SVGTransformList final : public SVGValuePropertyList<SVGTransform> { >+ friend class SVGViewSpec; >+ using Base = SVGValuePropertyList<SVGTransform>; >+ using Base::Base; >+ > public: >- using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<SVGTransformListValues>; >- using ListWrapperCache = AnimatedListPropertyTearOff::ListWrapperCache; >+ static Ref<SVGTransformList> create() >+ { >+ return adoptRef(*new SVGTransformList()); >+ } > >- static Ref<SVGTransformList> create(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGTransformListValues& values, ListWrapperCache& wrappers) >+ static Ref<SVGTransformList> create(SVGPropertyOwner* owner, SVGPropertyAccess access) > { >- return adoptRef(*new SVGTransformList(animatedProperty, role, values, wrappers)); >+ return adoptRef(*new SVGTransformList(owner, access)); > } > >- ExceptionOr<Ref<SVGTransform>> createSVGTransformFromMatrix(SVGMatrix& matrix) >+ static Ref<SVGTransformList> create(const SVGTransformList& other, SVGPropertyAccess access) > { >- ASSERT(m_values); >- return m_values->createSVGTransformFromMatrix(matrix); >+ return adoptRef(*new SVGTransformList(other, access)); >+ } >+ >+ ExceptionOr<Ref<SVGTransform>> createSVGTransformFromMatrix(const Ref<SVGMatrix>& matrix) >+ { >+ return SVGTransform::create(matrix->value()); > } > > ExceptionOr<RefPtr<SVGTransform>> consolidate() > { >- ASSERT(m_values); >- ASSERT(m_wrappers); >- > auto result = canAlterList(); > if (result.hasException()) > return result.releaseException(); > ASSERT(result.releaseReturnValue()); > >- ASSERT(m_values->size() == m_wrappers->size()); >- > // Spec: If the list was empty, then a value of null is returned. >- if (m_values->isEmpty()) >+ if (m_items.isEmpty()) > return nullptr; > >- detachListWrappers(0); >+ if (m_items.size() == 1) >+ return makeRefPtr(at(0).get()); >+ >+ auto newItem = concatenate(); >+ clearItems(); > >- RefPtr<SVGTransform> wrapper = m_values->consolidate(); >- m_wrappers->append(makeWeakPtr(*wrapper)); >+ auto item = append(WTFMove(newItem)); >+ commitChange(); >+ return makeRefPtr(item.get()); >+ } >+ >+ void parse(const String& value) >+ { >+ clearItems(); >+ >+ auto upconvertedCharacters = StringView(value).upconvertedCharacters(); >+ const UChar* start = upconvertedCharacters; >+ if (!parse(start, start + value.length())) >+ clearItems(); >+ } > >- ASSERT(m_values->size() == m_wrappers->size()); >- return WTFMove(wrapper); >+ bool concatenate(AffineTransform &result) const >+ { >+ if (m_items.isEmpty()) >+ return false; >+ for (const auto& transform : m_items) >+ result *= transform->matrix()->value(); >+ return true; >+ } >+ >+ String valueAsString() const override >+ { >+ StringBuilder builder; >+ for (const auto& transfrom : m_items) { >+ if (builder.length()) >+ builder.append(' '); >+ >+ builder.append(transfrom->value().valueAsString()); >+ } >+ return builder.toString(); > } > > private: >- SVGTransformList(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, SVGTransformListValues& values, ListWrapperCache& wrappers) >- : SVGListPropertyTearOff<SVGTransformListValues>(animatedProperty, role, values, wrappers) >+ bool parse(const UChar*& start, const UChar* end) >+ { >+ bool delimParsed = false; >+ while (start < end) { >+ delimParsed = false; >+ SVGTransformValue::SVGTransformType type = SVGTransformValue::SVG_TRANSFORM_UNKNOWN; >+ skipOptionalSVGSpaces(start, end); >+ >+ if (!SVGTransformable::parseAndSkipType(start, end, type)) >+ return false; >+ >+ Ref<SVGTransform> transform = SVGTransform::create(type); >+ if (!SVGTransformable::parseTransformValue(type, start, end, transform->value())) >+ return false; >+ >+ append(WTFMove(transform)); >+ skipOptionalSVGSpaces(start, end); >+ if (start < end && *start == ',') { >+ delimParsed = true; >+ ++start; >+ } >+ >+ skipOptionalSVGSpaces(start, end); >+ } >+ return !delimParsed; >+ } >+ >+ Ref<SVGTransform> concatenate() const > { >+ AffineTransform result; >+ concatenate(result); >+ return SVGTransform::create(result); > } > }; > >diff --git a/Source/WebCore/svg/SVGTransformList.idl b/Source/WebCore/svg/SVGTransformList.idl >index 3e81d62a35a..25630528de9 100644 >--- a/Source/WebCore/svg/SVGTransformList.idl >+++ b/Source/WebCore/svg/SVGTransformList.idl >@@ -36,5 +36,5 @@ interface SVGTransformList { > [MayThrowException] SVGTransform appendItem(SVGTransform item); > > [MayThrowException, NewObject] SVGTransform createSVGTransformFromMatrix(SVGMatrix matrix); >- [MayThrowException, NewObject] SVGTransform consolidate(); >+ [MayThrowException] SVGTransform consolidate(); > }; >diff --git a/Source/WebCore/svg/SVGTransformListValues.cpp b/Source/WebCore/svg/SVGTransformListValues.cpp >deleted file mode 100644 >index 25b3c316f2e..00000000000 >--- a/Source/WebCore/svg/SVGTransformListValues.cpp >+++ /dev/null >@@ -1,82 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> >- * >- * 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 "SVGTransformListValues.h" >- >-#include "AffineTransform.h" >-#include "SVGSVGElement.h" >-#include "SVGTransformable.h" >-#include <wtf/text/StringBuilder.h> >- >-namespace WebCore { >- >-Ref<SVGTransform> SVGTransformListValues::createSVGTransformFromMatrix(SVGMatrix& matrix) const >-{ >- return SVGSVGElement::createSVGTransformFromMatrix(matrix); >-} >- >-Ref<SVGTransform> SVGTransformListValues::consolidate() >-{ >- AffineTransform matrix; >- if (!concatenate(matrix)) >- return SVGTransform::create(); >- >- SVGTransformValue transform(matrix); >- clear(); >- append(transform); >- return SVGTransform::create(transform); >-} >- >-bool SVGTransformListValues::concatenate(AffineTransform& result) const >-{ >- unsigned size = this->size(); >- if (!size) >- return false; >- >- for (unsigned i = 0; i < size; ++i) >- result *= at(i).matrix(); >- >- return true; >-} >- >-String SVGTransformListValues::valueAsString() const >-{ >- StringBuilder builder; >- unsigned size = this->size(); >- for (unsigned i = 0; i < size; ++i) { >- if (i > 0) >- builder.append(' '); >- >- builder.append(at(i).valueAsString()); >- } >- >- return builder.toString(); >-} >- >-void SVGTransformListValues::parse(const String& transform) >-{ >- auto upconvertedCharacters = StringView(transform).upconvertedCharacters(); >- const UChar* start = upconvertedCharacters; >- if (!SVGTransformable::parseTransformAttribute(*this, start, start + transform.length())) >- clear(); >-} >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGTransformListValues.h b/Source/WebCore/svg/SVGTransformListValues.h >deleted file mode 100644 >index 2f32951e4be..00000000000 >--- a/Source/WebCore/svg/SVGTransformListValues.h >+++ /dev/null >@@ -1,61 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> >- * >- * 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 "SVGPropertyTraits.h" >-#include "SVGTransform.h" >-#include <wtf/Vector.h> >- >-namespace WebCore { >- >-template<typename T> >-class SVGListPropertyTearOff; >- >-class SVGTransformList; >- >-class SVGTransformListValues final : public Vector<SVGTransformValue, 0, CrashOnOverflow, 2> { >-public: >- Ref<SVGTransform> createSVGTransformFromMatrix(SVGMatrix&) const; >- Ref<SVGTransform> consolidate(); >- >- bool concatenate(AffineTransform& result) const; >- >- String valueAsString() const; >- void parse(const String&); >-}; >- >-template<> struct SVGPropertyTraits<SVGTransformListValues> { >- static SVGTransformListValues initialValue() { return { }; } >- static SVGTransformListValues fromString(const String& string) >- { >- SVGTransformListValues values; >- values.parse(string); >- return values; >- } >- static std::optional<SVGTransformListValues> parse(const QualifiedName&, const String&) { ASSERT_NOT_REACHED(); return initialValue(); } >- static String toString(const SVGTransformListValues& list) { return list.valueAsString(); } >- >- using ListItemType = SVGTransformValue; >- using ListItemTearOff = SVGTransform; >- using ListPropertyTearOff = SVGTransformList; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGTransformValue.cpp b/Source/WebCore/svg/SVGTransformValue.cpp >deleted file mode 100644 >index 63d45a5c64f..00000000000 >--- a/Source/WebCore/svg/SVGTransformValue.cpp >+++ /dev/null >@@ -1,234 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> >- * Copyright (C) 2017 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 "SVGTransformValue.h" >- >-#include "FloatConversion.h" >-#include "FloatPoint.h" >-#include "FloatSize.h" >-#include <wtf/MathExtras.h> >-#include <wtf/NeverDestroyed.h> >-#include <wtf/text/StringBuilder.h> >-#include <wtf/text/WTFString.h> >- >-namespace WebCore { >- >-SVGTransformValue::SVGTransformValue() = default; >- >-SVGTransformValue::SVGTransformValue(SVGTransformType type, ConstructionMode mode) >- : m_type(type) >-{ >- if (mode == ConstructZeroTransform) >- m_matrix = AffineTransform(0, 0, 0, 0, 0, 0); >-} >- >-SVGTransformValue::SVGTransformValue(const AffineTransform& matrix) >- : m_type(SVG_TRANSFORM_MATRIX) >- , m_matrix(matrix) >-{ >-} >- >-void SVGTransformValue::setMatrix(const AffineTransform& matrix) >-{ >- m_type = SVG_TRANSFORM_MATRIX; >- m_angle = 0; >- m_matrix = matrix; >-} >- >-void SVGTransformValue::updateSVGMatrix() >-{ >- // The underlying matrix has been changed, alter the transformation type. >- // Spec: In case the matrix object is changed directly (i.e., without using the methods on the SVGTransform interface itself) >- // then the type of the SVGTransform changes to SVG_TRANSFORM_MATRIX. >- m_type = SVG_TRANSFORM_MATRIX; >- m_angle = 0; >-} >- >-void SVGTransformValue::setTranslate(float tx, float ty) >-{ >- m_type = SVG_TRANSFORM_TRANSLATE; >- m_angle = 0; >- >- m_matrix.makeIdentity(); >- m_matrix.translate(tx, ty); >-} >- >-FloatPoint SVGTransformValue::translate() const >-{ >- return FloatPoint::narrowPrecision(m_matrix.e(), m_matrix.f()); >-} >- >-void SVGTransformValue::setScale(float sx, float sy) >-{ >- m_type = SVG_TRANSFORM_SCALE; >- m_angle = 0; >- m_center = FloatPoint(); >- >- m_matrix.makeIdentity(); >- m_matrix.scaleNonUniform(sx, sy); >-} >- >-FloatSize SVGTransformValue::scale() const >-{ >- return FloatSize::narrowPrecision(m_matrix.a(), m_matrix.d()); >-} >- >-void SVGTransformValue::setRotate(float angle, float cx, float cy) >-{ >- m_type = SVG_TRANSFORM_ROTATE; >- m_angle = angle; >- m_center = FloatPoint(cx, cy); >- >- // TODO: toString() implementation, which can show cx, cy (need to be stored?) >- m_matrix.makeIdentity(); >- m_matrix.translate(cx, cy); >- m_matrix.rotate(angle); >- m_matrix.translate(-cx, -cy); >-} >- >-void SVGTransformValue::setSkewX(float angle) >-{ >- m_type = SVG_TRANSFORM_SKEWX; >- m_angle = angle; >- >- m_matrix.makeIdentity(); >- m_matrix.skewX(angle); >-} >- >-void SVGTransformValue::setSkewY(float angle) >-{ >- m_type = SVG_TRANSFORM_SKEWY; >- m_angle = angle; >- >- m_matrix.makeIdentity(); >- m_matrix.skewY(angle); >-} >- >-const String& SVGTransformValue::transformTypePrefixForParsing(SVGTransformType type) >-{ >- switch (type) { >- case SVG_TRANSFORM_UNKNOWN: >- return emptyString(); >- case SVG_TRANSFORM_MATRIX: { >- static NeverDestroyed<String> matrixString(MAKE_STATIC_STRING_IMPL("matrix(")); >- return matrixString; >- } >- case SVG_TRANSFORM_TRANSLATE: { >- static NeverDestroyed<String> translateString(MAKE_STATIC_STRING_IMPL("translate(")); >- return translateString; >- } >- case SVG_TRANSFORM_SCALE: { >- static NeverDestroyed<String> scaleString(MAKE_STATIC_STRING_IMPL("scale(")); >- return scaleString; >- } >- case SVG_TRANSFORM_ROTATE: { >- static NeverDestroyed<String> rotateString(MAKE_STATIC_STRING_IMPL("rotate(")); >- return rotateString; >- } >- case SVG_TRANSFORM_SKEWX: { >- static NeverDestroyed<String> skewXString(MAKE_STATIC_STRING_IMPL("skewX(")); >- return skewXString; >- } >- case SVG_TRANSFORM_SKEWY: { >- static NeverDestroyed<String> skewYString(MAKE_STATIC_STRING_IMPL("skewY(")); >- return skewYString; >- } >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >-} >- >-String SVGTransformValue::valueAsString() const >-{ >- const String& prefix = transformTypePrefixForParsing(m_type); >- switch (m_type) { >- case SVG_TRANSFORM_UNKNOWN: >- return prefix; >- case SVG_TRANSFORM_MATRIX: { >- StringBuilder builder; >- builder.append(prefix); >- builder.appendNumber(m_matrix.a()); >- builder.append(' '); >- builder.appendNumber(m_matrix.b()); >- builder.append(' '); >- builder.appendNumber(m_matrix.c()); >- builder.append(' '); >- builder.appendNumber(m_matrix.d()); >- builder.append(' '); >- builder.appendNumber(m_matrix.e()); >- builder.append(' '); >- builder.appendNumber(m_matrix.f()); >- builder.append(')'); >- return builder.toString(); >- } >- case SVG_TRANSFORM_TRANSLATE: { >- StringBuilder builder; >- builder.append(prefix); >- builder.appendNumber(m_matrix.e()); >- builder.append(' '); >- builder.appendNumber(m_matrix.f()); >- builder.append(')'); >- return builder.toString(); >- } >- case SVG_TRANSFORM_SCALE: { >- StringBuilder builder; >- builder.append(prefix); >- builder.appendNumber(m_matrix.xScale()); >- builder.append(' '); >- builder.appendNumber(m_matrix.yScale()); >- builder.append(')'); >- return builder.toString(); >- } >- case SVG_TRANSFORM_ROTATE: { >- double angleInRad = deg2rad(m_angle); >- double cosAngle = std::cos(angleInRad); >- double sinAngle = std::sin(angleInRad); >- float cx = narrowPrecisionToFloat(cosAngle != 1 ? (m_matrix.e() * (1 - cosAngle) - m_matrix.f() * sinAngle) / (1 - cosAngle) / 2 : 0); >- float cy = narrowPrecisionToFloat(cosAngle != 1 ? (m_matrix.e() * sinAngle / (1 - cosAngle) + m_matrix.f()) / 2 : 0); >- StringBuilder builder; >- builder.append(prefix); >- builder.appendNumber(m_angle); >- if (cx || cy) { >- builder.append(' '); >- builder.appendNumber(cx); >- builder.append(' '); >- builder.appendNumber(cy); >- } >- builder.append(')'); >- return builder.toString(); >- } >- case SVG_TRANSFORM_SKEWX: >- case SVG_TRANSFORM_SKEWY: { >- StringBuilder builder; >- builder.append(prefix); >- builder.appendNumber(m_angle); >- builder.append(')'); >- return builder.toString(); >- } >- } >- >- ASSERT_NOT_REACHED(); >- return emptyString(); >-} >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/SVGTransformValue.h b/Source/WebCore/svg/SVGTransformValue.h >index fadd03a23a1..55285f0a1fa 100644 >--- a/Source/WebCore/svg/SVGTransformValue.h >+++ b/Source/WebCore/svg/SVGTransformValue.h >@@ -1,6 +1,7 @@ > /* > * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> > * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> >+ * 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 >@@ -20,8 +21,13 @@ > > #pragma once > >+#include "FloatConversion.h" > #include "FloatPoint.h" >-#include "SVGMatrixValue.h" >+#include "FloatSize.h" >+#include "SVGMatrix.h" >+#include <wtf/HashMap.h> >+#include <wtf/NeverDestroyed.h> >+#include <wtf/text/StringBuilder.h> > > namespace WebCore { > >@@ -39,56 +45,243 @@ public: > SVG_TRANSFORM_SKEWY = 6 > }; > >- enum ConstructionMode { >- ConstructIdentityTransform, >- ConstructZeroTransform >- }; >+ SVGTransformValue(SVGTransformType type = SVG_TRANSFORM_MATRIX, const AffineTransform& transform = { }) >+ : m_type(type) >+ , m_matrix(SVGMatrix::create(transform)) >+ { >+ } > >- SVGTransformValue(); >- SVGTransformValue(SVGTransformType, ConstructionMode = ConstructIdentityTransform); >- explicit SVGTransformValue(const AffineTransform&); >+ SVGTransformValue(const SVGTransformValue& other) >+ : m_type(other.m_type) >+ , m_matrix(SVGMatrix::create(other.matrix()->value())) >+ , m_angle(other.m_angle) >+ , m_rotationCenter(other.m_rotationCenter) >+ { >+ } > >- SVGTransformType type() const { return m_type; } >+ SVGTransformValue(SVGTransformType type, Ref<SVGMatrix>&& matrix, float angle, const FloatPoint& rotationCenter) >+ : m_type(type) >+ , m_matrix(WTFMove(matrix)) >+ , m_angle(angle) >+ , m_rotationCenter(rotationCenter) >+ { >+ } > >- SVGMatrixValue& svgMatrix() { return static_cast<SVGMatrixValue&>(m_matrix); } >- AffineTransform matrix() const { return m_matrix; } >- void updateSVGMatrix(); >+ SVGTransformValue(SVGTransformValue&& other) >+ : m_type(other.m_type) >+ , m_matrix(other.m_matrix.copyRef()) >+ , m_angle(other.m_angle) >+ , m_rotationCenter(other.m_rotationCenter) >+ { >+ } > >+ SVGTransformValue& operator=(const SVGTransformValue& other) >+ { >+ m_type = other.m_type; >+ m_matrix->setValue(other.m_matrix->value()); >+ m_angle = other.m_angle; >+ m_rotationCenter = other.m_rotationCenter; >+ return *this; >+ } >+ >+ SVGTransformType type() const { return m_type; } >+ const Ref<SVGMatrix>& matrix() const { return m_matrix; } > float angle() const { return m_angle; } >- FloatPoint rotationCenter() const { return m_center; } >- >- void setMatrix(const AffineTransform&); >- void setTranslate(float tx, float ty); >- void setScale(float sx, float sy); >- void setRotate(float angle, float cx, float cy); >- void setSkewX(float angle); >- void setSkewY(float angle); >- >- FloatPoint translate() const; >- FloatSize scale() const; >+ FloatPoint rotationCenter() const { return m_rotationCenter; } > > bool isValid() const { return m_type != SVG_TRANSFORM_UNKNOWN; } >- String valueAsString() const; > >- static const String& transformTypePrefixForParsing(SVGTransformType); >+ void setMatrix(const AffineTransform& matrix) >+ { >+ m_type = SVG_TRANSFORM_MATRIX; >+ m_angle = 0; >+ m_rotationCenter = FloatPoint(); >+ m_matrix->setValue(matrix); >+ } >+ >+ void matrixDidChange() >+ { >+ // The underlying matrix has been changed, alter the transformation type. >+ // Spec: In case the matrix object is changed directly (i.e., without using the methods on the SVGTransform interface itself) >+ // then the type of the SVGTransform changes to SVG_TRANSFORM_MATRIX. >+ m_type = SVG_TRANSFORM_MATRIX; >+ m_angle = 0; >+ m_rotationCenter = FloatPoint(); >+ } >+ >+ FloatPoint translate() const >+ { >+ return FloatPoint::narrowPrecision(m_matrix->e(), m_matrix->f()); >+ } >+ >+ void setTranslate(float tx, float ty) >+ { >+ m_type = SVG_TRANSFORM_TRANSLATE; >+ m_angle = 0; >+ m_rotationCenter = FloatPoint(); >+ >+ m_matrix->value().makeIdentity(); >+ m_matrix->value().translate(tx, ty); >+ } >+ >+ FloatSize scale() const >+ { >+ return FloatSize::narrowPrecision(m_matrix->a(), m_matrix->d()); >+ } >+ >+ void setScale(float sx, float sy) >+ { >+ m_type = SVG_TRANSFORM_SCALE; >+ m_angle = 0; >+ m_rotationCenter = FloatPoint(); >+ >+ m_matrix->value().makeIdentity(); >+ m_matrix->value().scaleNonUniform(sx, sy); >+ } >+ >+ void setRotate(float angle, float cx, float cy) >+ { >+ m_type = SVG_TRANSFORM_ROTATE; >+ m_angle = angle; >+ m_rotationCenter = FloatPoint(cx, cy); >+ >+ // TODO: toString() implementation, which can show cx, cy (need to be stored?) >+ m_matrix->value().makeIdentity(); >+ m_matrix->value().translate(cx, cy); >+ m_matrix->value().rotate(angle); >+ m_matrix->value().translate(-cx, -cy); >+ } >+ >+ void setSkewX(float angle) >+ { >+ m_type = SVG_TRANSFORM_SKEWX; >+ m_angle = angle; >+ m_rotationCenter = FloatPoint(); >+ >+ m_matrix->value().makeIdentity(); >+ m_matrix->value().skewX(angle); >+ } >+ >+ void setSkewY(float angle) >+ { >+ m_type = SVG_TRANSFORM_SKEWY; >+ m_angle = angle; >+ m_rotationCenter = FloatPoint(); >+ >+ m_matrix->value().makeIdentity(); >+ m_matrix->value().skewY(angle); >+ } >+ >+ String valueAsString() const >+ { >+ StringBuilder builder; >+ builder.append(prefixForTransfromType(m_type)); >+ switch (m_type) { >+ case SVG_TRANSFORM_UNKNOWN: >+ break; >+ case SVG_TRANSFORM_MATRIX: >+ appendMatrix(builder); >+ break; >+ case SVG_TRANSFORM_TRANSLATE: >+ appendTranslate(builder); >+ break; >+ case SVG_TRANSFORM_SCALE: >+ appendScale(builder); >+ break; >+ case SVG_TRANSFORM_ROTATE: >+ appendRotate(builder); >+ break; >+ case SVG_TRANSFORM_SKEWX: >+ appendSkewX(builder); >+ break; >+ case SVG_TRANSFORM_SKEWY: >+ appendSkewY(builder); >+ break; >+ } >+ return builder.toString(); >+ } >+ >+ static String prefixForTransfromType(SVGTransformType type) >+ { >+ switch (type) { >+ case SVG_TRANSFORM_UNKNOWN: >+ return emptyString(); >+ case SVG_TRANSFORM_MATRIX: >+ return "matrix("_s; >+ case SVG_TRANSFORM_TRANSLATE: >+ return "translate("_s; >+ case SVG_TRANSFORM_SCALE: >+ return "scale("_s; >+ case SVG_TRANSFORM_ROTATE: >+ return "rotate("_s; >+ case SVG_TRANSFORM_SKEWX: >+ return "skewX("_s; >+ case SVG_TRANSFORM_SKEWY: >+ return "skewY("_s; >+ } >+ ASSERT_NOT_REACHED(); >+ return emptyString(); >+ } > > private: >- friend bool operator==(const SVGTransformValue&, const SVGTransformValue&); >+ void appendNumbers(StringBuilder& builder) const >+ { >+ builder.append(')'); >+ } >+ >+ template<typename Number, typename... Numbers> >+ void appendNumbers(StringBuilder& builder, Number number, Numbers... numbers) const >+ { >+ if (builder.length() && builder[builder.length() - 1] != '(') >+ builder.append(' '); >+ builder.appendNumber(number); >+ appendNumbers(builder, numbers...); >+ } >+ >+ void appendMatrix(StringBuilder& builder) const >+ { >+ appendNumbers(builder, m_matrix->a(), m_matrix->b(), m_matrix->c(), m_matrix->d(), m_matrix->e(), m_matrix->f()); >+ } >+ >+ void appendTranslate(StringBuilder& builder) const >+ { >+ appendNumbers(builder, m_matrix->e(), m_matrix->f()); >+ } >+ >+ void appendScale(StringBuilder& builder) const >+ { >+ appendNumbers(builder, m_matrix->value().xScale(), m_matrix->value().yScale()); >+ } >+ >+ void appendRotate(StringBuilder& builder) const >+ { >+ double angleInRad = deg2rad(m_angle); >+ double cosAngle = std::cos(angleInRad); >+ double sinAngle = std::sin(angleInRad); >+ >+ float cx = narrowPrecisionToFloat(cosAngle != 1 ? (m_matrix->e() * (1 - cosAngle) - m_matrix->f() * sinAngle) / (1 - cosAngle) / 2 : 0); >+ float cy = narrowPrecisionToFloat(cosAngle != 1 ? (m_matrix->e() * sinAngle / (1 - cosAngle) + m_matrix->f()) / 2 : 0); >+ >+ if (cx || cy) >+ appendNumbers(builder, m_angle, cx, cy); >+ else >+ appendNumbers(builder, m_angle); >+ } >+ >+ void appendSkewX(StringBuilder& builder) const >+ { >+ appendNumbers(builder, m_angle); >+ } >+ >+ void appendSkewY(StringBuilder& builder) const >+ { >+ appendNumbers(builder, m_angle); >+ } > > SVGTransformType m_type { SVG_TRANSFORM_UNKNOWN }; >+ Ref<SVGMatrix> m_matrix; > float m_angle { 0 }; >- FloatPoint m_center; >- AffineTransform m_matrix; >+ FloatPoint m_rotationCenter; > }; > >-inline bool operator==(const SVGTransformValue& a, const SVGTransformValue& b) >-{ >- return a.m_type == b.m_type && a.m_angle == b.m_angle && a.m_matrix == b.m_matrix; >-} >- >-inline bool operator!=(const SVGTransformValue& a, const SVGTransformValue& b) >-{ >- return !(a == b); >-} >- > } // namespace WebCore >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/SVGURIReference.cpp b/Source/WebCore/svg/SVGURIReference.cpp >index 2373cb4978d..85fe0e7f802 100644 >--- a/Source/WebCore/svg/SVGURIReference.cpp >+++ b/Source/WebCore/svg/SVGURIReference.cpp >@@ -24,51 +24,25 @@ > > #include "Document.h" > #include "Element.h" >-#include "SVGAttributeOwnerProxy.h" > #include <wtf/URL.h> > #include "XLinkNames.h" > > namespace WebCore { > > SVGURIReference::SVGURIReference(SVGElement* contextElement) >- : m_attributeOwnerProxy(std::make_unique<AttributeOwnerProxy>(*this, *contextElement)) >+ : m_href(SVGAnimatedString::create(contextElement)) > { >- registerAttributes(); >-} >- >-void SVGURIReference::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::hrefAttr, &SVGURIReference::m_href>(); >- registry.registerAttribute<XLinkNames::hrefAttr, &SVGURIReference::m_href>(); >-} >- >-SVGURIReference::AttributeRegistry& SVGURIReference::attributeRegistry() >-{ >- return AttributeOwnerProxy::attributeRegistry(); >-} >- >-bool SVGURIReference::isKnownAttribute(const QualifiedName& attributeName) >-{ >- return AttributeOwnerProxy::isKnownAttribute(attributeName); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::hrefAttr, &SVGURIReference::m_href>(); >+ PropertyRegistry::registerProperty<XLinkNames::hrefAttr, &SVGURIReference::m_href>(); >+ }); > } > > void SVGURIReference::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > if (isKnownAttribute(name)) >- m_href.setValue(value); >-} >- >-const String& SVGURIReference::href() const >-{ >- return m_href.currentValue(*m_attributeOwnerProxy); >-} >- >-RefPtr<SVGAnimatedString> SVGURIReference::hrefAnimated() >-{ >- return m_href.animatedProperty(*m_attributeOwnerProxy); >+ m_href->setBaseValInternal(value); > } > > String SVGURIReference::fragmentIdentifierFromIRIString(const String& url, const Document& document) >diff --git a/Source/WebCore/svg/SVGURIReference.h b/Source/WebCore/svg/SVGURIReference.h >index f4629e05e0c..7218affba15 100644 >--- a/Source/WebCore/svg/SVGURIReference.h >+++ b/Source/WebCore/svg/SVGURIReference.h >@@ -23,16 +23,11 @@ > > #include "Document.h" > #include "QualifiedName.h" >-#include "SVGAnimatedString.h" >+#include "SVGAnimatedPropertyImpl.h" >+#include "SVGPropertyOwnerRegistry.h" > > namespace WebCore { > >-template<typename OwnerType, typename... BaseTypes> >-class SVGAttributeRegistry; >- >-template<typename OwnerType, typename... BaseTypes> >-class SVGAttributeOwnerProxyImpl; >- > class SVGURIReference { > WTF_MAKE_NONCOPYABLE(SVGURIReference); > public: >@@ -60,23 +55,19 @@ public: > return !equalIgnoringFragmentIdentifier(url, document.url()); > } > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGURIReference>; >- using AttributeRegistry = SVGAttributeRegistry<SVGURIReference>; >- static AttributeRegistry& attributeRegistry(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGURIReference>; > >- const String& href() const; >- RefPtr<SVGAnimatedString> hrefAnimated(); >+ String href() const { return m_href->currentValue(); } >+ Ref<SVGAnimatedString>& href() { return m_href; } > > protected: > SVGURIReference(SVGElement* contextElement); > >- static bool isKnownAttribute(const QualifiedName& attributeName); >+ static bool isKnownAttribute(const QualifiedName& attributeName) { return PropertyRegistry::isKnownAttribute(attributeName); } > > private: >- static void registerAttributes(); >- >- std::unique_ptr<AttributeOwnerProxy> m_attributeOwnerProxy; >- SVGAnimatedStringAttribute m_href; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedString> m_href; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGUseElement.cpp b/Source/WebCore/svg/SVGUseElement.cpp >index 1fd88c91d80..4d345de9f7c 100644 >--- a/Source/WebCore/svg/SVGUseElement.cpp >+++ b/Source/WebCore/svg/SVGUseElement.cpp >@@ -54,7 +54,14 @@ inline SVGUseElement::SVGUseElement(const QualifiedName& tagName, Document& docu > { > ASSERT(hasCustomStyleResolveCallbacks()); > ASSERT(hasTagName(SVGNames::useTag)); >- registerAttributes(); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::xAttr, &SVGUseElement::m_x>(); >+ PropertyRegistry::registerProperty<SVGNames::yAttr, &SVGUseElement::m_y>(); >+ PropertyRegistry::registerProperty<SVGNames::widthAttr, &SVGUseElement::m_width>(); >+ PropertyRegistry::registerProperty<SVGNames::heightAttr, &SVGUseElement::m_height>(); >+ }); > } > > Ref<SVGUseElement> SVGUseElement::create(const QualifiedName& tagName, Document& document) >@@ -68,29 +75,18 @@ SVGUseElement::~SVGUseElement() > m_externalDocument->removeClient(*this); > } > >-void SVGUseElement::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::xAttr, &SVGUseElement::m_x>(); >- registry.registerAttribute<SVGNames::yAttr, &SVGUseElement::m_y>(); >- registry.registerAttribute<SVGNames::widthAttr, &SVGUseElement::m_width>(); >- registry.registerAttribute<SVGNames::heightAttr, &SVGUseElement::m_height>(); >-} >- > void SVGUseElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { > SVGParsingError parseError = NoError; > > if (name == SVGNames::xAttr) >- m_x.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError)); >+ m_x->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError)); > else if (name == SVGNames::yAttr) >- m_y.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError)); >+ m_y->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError)); > else if (name == SVGNames::widthAttr) >- m_width.setValue(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); >+ m_width->setBaseValInternal(SVGLengthValue::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths)); > else if (name == SVGNames::heightAttr) >- m_height.setValue(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); >+ m_height->setBaseValInternal(SVGLengthValue::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths)); > > reportAttributeParsingError(parseError, name, value); > >@@ -163,7 +159,7 @@ void SVGUseElement::svgAttributeChanged(const QualifiedName& attrName) > { > InstanceInvalidationGuard guard(*this); > >- if (isKnownAttribute(attrName)) { >+ if (PropertyRegistry::isKnownAttribute(attrName)) { > updateRelativeLengthsInformation(); > if (attrName == SVGNames::widthAttr || attrName == SVGNames::heightAttr) { > // FIXME: It's unnecessarily inefficient to update both width and height each time either is changed. >@@ -292,7 +288,7 @@ static bool isDirectReference(const SVGElement& element) > || element.hasTagName(textTag); > } > >-Path SVGUseElement::toClipPath() >+Path SVGUseElement::toClipPath() const > { > auto targetClone = this->targetClone(); > if (!is<SVGGraphicsElement>(targetClone)) >@@ -403,8 +399,8 @@ static void associateReplacementClonesWithOriginals(SVGElement& replacementClone > > SVGElement* SVGUseElement::findTarget(String* targetID) const > { >- auto* correspondingElement = this->correspondingElement(); >- auto& original = correspondingElement ? downcast<SVGUseElement>(*correspondingElement) : *this; >+ const auto* correspondingElement = this->correspondingElement(); >+ const auto& original = correspondingElement ? downcast<SVGUseElement>(*correspondingElement) : *this; > > auto targetResult = targetElementFromIRIString(original.href(), original.treeScope(), original.externalDocument()); > if (targetID) { >@@ -570,8 +566,9 @@ void SVGUseElement::finishParsingChildren() > void SVGUseElement::updateExternalDocument() > { > URL externalDocumentURL; >- if (isConnected() && isExternalURIReference(href(), document())) { >- externalDocumentURL = document().completeURL(href()); >+ String href = this->href()->currentValue(); >+ if (isConnected() && isExternalURIReference(href, document())) { >+ externalDocumentURL = document().completeURL(href); > if (!externalDocumentURL.hasFragmentIdentifier()) > externalDocumentURL = URL(); > } >@@ -603,7 +600,7 @@ bool SVGUseElement::isValid() const > return SVGTests::isValid(); > } > >-bool SVGUseElement::haveLoadedRequiredResources() >+bool SVGUseElement::haveLoadedRequiredResources() const > { > return SVGExternalResourcesRequired::haveLoadedRequiredResources(); > } >diff --git a/Source/WebCore/svg/SVGUseElement.h b/Source/WebCore/svg/SVGUseElement.h >index 31e0c09fb8c..ade900fff77 100644 >--- a/Source/WebCore/svg/SVGUseElement.h >+++ b/Source/WebCore/svg/SVGUseElement.h >@@ -23,8 +23,6 @@ > > #include "CachedResourceHandle.h" > #include "CachedSVGDocumentClient.h" >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedLength.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGGraphicsElement.h" > #include "SVGURIReference.h" >@@ -46,15 +44,15 @@ public: > > RenderElement* rendererClipChild() const; > >- const SVGLengthValue& x() const { return m_x.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& y() const { return m_y.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& width() const { return m_width.currentValue(attributeOwnerProxy()); } >- const SVGLengthValue& height() const { return m_height.currentValue(attributeOwnerProxy()); } >+ const SVGLengthValue& x() const { return m_x->currentValue(); } >+ const SVGLengthValue& y() const { return m_y->currentValue(); } >+ const SVGLengthValue& width() const { return m_width->currentValue(); } >+ const SVGLengthValue& height() const { return m_height->currentValue(); } > >- RefPtr<SVGAnimatedLength> xAnimated() { return m_x.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> yAnimated() { return m_y.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> widthAnimated() { return m_width.animatedProperty(attributeOwnerProxy()); } >- RefPtr<SVGAnimatedLength> heightAnimated() { return m_height.animatedProperty(attributeOwnerProxy()); } >+ Ref<SVGAnimatedLength>& x() { return m_x; } >+ Ref<SVGAnimatedLength>& y() { return m_y; } >+ Ref<SVGAnimatedLength>& width() { return m_width; } >+ Ref<SVGAnimatedLength>& height() { return m_height; } > > private: > SVGUseElement(const QualifiedName&, Document&); >@@ -65,18 +63,15 @@ private: > void removedFromAncestor(RemovalType, ContainerNode&) override; > void buildPendingResource() override; > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGUseElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGURIReference>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- static void registerAttributes(); >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGUseElement, SVGGraphicsElement, SVGExternalResourcesRequired, SVGURIReference>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } > >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) override; > void svgAttributeChanged(const QualifiedName&) override; > > RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override; >- Path toClipPath() override; >- bool haveLoadedRequiredResources() override; >+ Path toClipPath() const override; >+ bool haveLoadedRequiredResources() const override; > void finishParsingChildren() override; > bool selfHasRelativeLengths() const override; > void setHaveFiredLoadEvent(bool) override; >@@ -100,16 +95,16 @@ private: > void clearShadowTree(); > void invalidateDependentShadowTrees(); > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGAnimatedLengthAttribute m_x { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_y { LengthModeHeight }; >- SVGAnimatedLengthAttribute m_width { LengthModeWidth }; >- SVGAnimatedLengthAttribute m_height { LengthModeHeight }; >- > bool m_haveFiredLoadEvent { false }; > bool m_shadowTreeNeedsUpdate { true }; > CachedResourceHandle<CachedSVGDocument> m_externalDocument; > Timer m_svgLoadEventTimer; >+ >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGAnimatedLength> m_x { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_y { SVGAnimatedLength::create(this, LengthModeHeight) }; >+ Ref<SVGAnimatedLength> m_width { SVGAnimatedLength::create(this, LengthModeWidth) }; >+ Ref<SVGAnimatedLength> m_height { SVGAnimatedLength::create(this, LengthModeHeight) }; > }; > > } >diff --git a/Source/WebCore/svg/SVGViewElement.cpp b/Source/WebCore/svg/SVGViewElement.cpp >index 53bf4a34ff1..1f6695382d1 100644 >--- a/Source/WebCore/svg/SVGViewElement.cpp >+++ b/Source/WebCore/svg/SVGViewElement.cpp >@@ -34,25 +34,26 @@ inline SVGViewElement::SVGViewElement(const QualifiedName& tagName, Document& do > : SVGElement(tagName, document) > , SVGExternalResourcesRequired(this) > , SVGFitToViewBox(this) >- , m_viewTarget(SVGNames::viewTargetAttr) > { > ASSERT(hasTagName(SVGNames::viewTag)); >+ >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::viewTargetAttr, &SVGViewElement::m_viewTarget>(); >+ }); > } > > Ref<SVGViewElement> SVGViewElement::create(const QualifiedName& tagName, Document& document) > { > return adoptRef(*new SVGViewElement(tagName, document)); > } >- >-Ref<SVGStringList> SVGViewElement::viewTarget() >-{ >- return SVGStringList::create(*this, m_viewTarget); >-} >- >+ > void SVGViewElement::parseAttribute(const QualifiedName& name, const AtomicString& value) > { >- if (name == SVGNames::viewTargetAttr) >- m_viewTarget.reset(value); >+ if (name == SVGNames::viewTargetAttr) { >+ m_viewTarget->reset(value); >+ return; >+ } > > SVGElement::parseAttribute(name, value); > SVGExternalResourcesRequired::parseAttribute(name, value); >diff --git a/Source/WebCore/svg/SVGViewElement.h b/Source/WebCore/svg/SVGViewElement.h >index a5773104dca..be40fdc34aa 100644 >--- a/Source/WebCore/svg/SVGViewElement.h >+++ b/Source/WebCore/svg/SVGViewElement.h >@@ -24,34 +24,31 @@ > #include "SVGElement.h" > #include "SVGExternalResourcesRequired.h" > #include "SVGFitToViewBox.h" >+#include "SVGStringList.h" > #include "SVGZoomAndPan.h" > > namespace WebCore { > >-class SVGStringList; >- > class SVGViewElement final : public SVGElement, public SVGExternalResourcesRequired, public SVGFitToViewBox, public SVGZoomAndPan { > WTF_MAKE_ISO_ALLOCATED(SVGViewElement); > public: > static Ref<SVGViewElement> create(const QualifiedName&, Document&); > >- using SVGElement::ref; >- using SVGElement::deref; >- >- Ref<SVGStringList> viewTarget(); >+ Ref<SVGStringList> viewTarget() { return m_viewTarget.copyRef(); } > > private: > SVGViewElement(const QualifiedName&, Document&); > >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGViewElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox>; >+ const SVGPropertyRegistry& propertyRegistry() const final { return m_propertyRegistry; } >+ > // FIXME: svgAttributeChanged missing. >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGViewElement, SVGElement, SVGExternalResourcesRequired, SVGFitToViewBox, SVGZoomAndPan>; >- const SVGAttributeOwnerProxy& attributeOwnerProxy() const final { return m_attributeOwnerProxy; } > void parseAttribute(const QualifiedName&, const AtomicString&) final; > > bool rendererIsNeeded(const RenderStyle&) final { return false; } > >- AttributeOwnerProxy m_attributeOwnerProxy { *this }; >- SVGStringListValues m_viewTarget; >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGStringList> m_viewTarget { SVGStringList::create(this) }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGViewSpec.cpp b/Source/WebCore/svg/SVGViewSpec.cpp >index caea7cace28..1d4d47dfb3a 100644 >--- a/Source/WebCore/svg/SVGViewSpec.cpp >+++ b/Source/WebCore/svg/SVGViewSpec.cpp >@@ -22,7 +22,6 @@ > #include "SVGViewSpec.h" > > #include "Document.h" >-#include "SVGAnimatedTransformList.h" > #include "SVGElement.h" > #include "SVGFitToViewBox.h" > #include "SVGNames.h" >@@ -33,19 +32,14 @@ > namespace WebCore { > > SVGViewSpec::SVGViewSpec(SVGElement& contextElement) >- : SVGFitToViewBox(&contextElement, PropertyIsReadOnly) >+ : SVGFitToViewBox(&contextElement, SVGPropertyAccess::ReadOnly) > , m_contextElement(&contextElement) >- , m_attributeOwnerProxy(*this, contextElement) >+ , m_transform(SVGTransformList::create(&contextElement, SVGPropertyAccess::ReadOnly)) > { >- registerAttributes(); >-} >- >-void SVGViewSpec::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::transformAttr, &SVGViewSpec::m_transform>(); >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [] { >+ PropertyRegistry::registerProperty<SVGNames::transformAttr, &SVGViewSpec::m_transform>(); >+ }); > } > > SVGElement* SVGViewSpec::viewTarget() const >@@ -58,18 +52,10 @@ SVGElement* SVGViewSpec::viewTarget() const > return downcast<SVGElement>(element); > } > >-RefPtr<SVGTransformList> SVGViewSpec::transform() >-{ >- if (!m_contextElement) >- return nullptr; >- // Return the animVal here, as its readonly by default - which is exactly what we want here. >- return m_transform.animatedProperty(m_attributeOwnerProxy)->animVal(); >-} >- > void SVGViewSpec::reset() > { > m_viewTargetString = emptyString(); >- m_transform.resetValue(); >+ m_transform->clearItems(); > SVGFitToViewBox::reset(); > SVGZoomAndPan::reset(); > } >@@ -152,7 +138,7 @@ bool SVGViewSpec::parseViewSpec(const String& viewSpec) > if (currViewSpec >= end || *currViewSpec != '(') > return false; > currViewSpec++; >- SVGTransformable::parseTransformAttribute(m_transform.value(), currViewSpec, end, SVGTransformable::DoNotClearList); >+ m_transform->parse(currViewSpec, end); > if (currViewSpec >= end || *currViewSpec != ')') > return false; > currViewSpec++; >diff --git a/Source/WebCore/svg/SVGViewSpec.h b/Source/WebCore/svg/SVGViewSpec.h >index b8849961893..f41fbf5c207 100644 >--- a/Source/WebCore/svg/SVGViewSpec.h >+++ b/Source/WebCore/svg/SVGViewSpec.h >@@ -20,10 +20,8 @@ > > #pragma once > >-#include "SVGAnimatedPreserveAspectRatio.h" >-#include "SVGAnimatedRect.h" > #include "SVGFitToViewBox.h" >-#include "SVGTransformListValues.h" >+#include "SVGTransformList.h" > #include "SVGZoomAndPan.h" > > namespace WebCore { >@@ -45,23 +43,19 @@ public: > SVGElement* viewTarget() const; > const String& viewTargetString() const { return m_viewTargetString; } > >- String transformString() const { return m_transform.toString(); } >- RefPtr<SVGTransformList> transform(); >- SVGTransformListValues transformValue() const { return m_transform.value(); } >+ String transformString() const { return m_transform->valueAsString(); } >+ Ref<SVGTransformList>& transform() { return m_transform; } > > private: > explicit SVGViewSpec(SVGElement&); > >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGViewSpec, SVGFitToViewBox, SVGZoomAndPan>; >- static void registerAttributes(); >- >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } >- >+ using PropertyRegistry = SVGPropertyOwnerRegistry<SVGViewSpec, SVGFitToViewBox>; >+ > SVGElement* m_contextElement; > String m_viewTargetString; >- AttributeOwnerProxy m_attributeOwnerProxy; >- SVGAnimatedTransformListAttribute m_transform; >+ >+ PropertyRegistry m_propertyRegistry { *this }; >+ Ref<SVGTransformList> m_transform; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/SVGZoomAndPan.cpp b/Source/WebCore/svg/SVGZoomAndPan.cpp >index efadd4b2251..fd8187a1b89 100644 >--- a/Source/WebCore/svg/SVGZoomAndPan.cpp >+++ b/Source/WebCore/svg/SVGZoomAndPan.cpp >@@ -24,30 +24,17 @@ > > namespace WebCore { > >-SVGZoomAndPan::SVGZoomAndPan() >-{ >- registerAttributes(); >-} >- >-void SVGZoomAndPan::registerAttributes() >-{ >- auto& registry = attributeRegistry(); >- if (!registry.isEmpty()) >- return; >- registry.registerAttribute<SVGNames::zoomAndPanAttr, &SVGZoomAndPan::m_zoomAndPan>(); >-} >- > bool SVGZoomAndPan::parseZoomAndPan(const UChar*& start, const UChar* end) > { > static const UChar disable[] = { 'd', 'i', 's', 'a', 'b', 'l', 'e' }; > if (skipString(start, end, disable, WTF_ARRAY_LENGTH(disable))) { >- m_zoomAndPan.setValue(SVGZoomAndPanDisable); >+ m_zoomAndPan = SVGZoomAndPanDisable; > return true; > } > > static const UChar magnify[] = { 'm', 'a', 'g', 'n', 'i', 'f', 'y' }; > if (skipString(start, end, magnify, WTF_ARRAY_LENGTH(magnify))) { >- m_zoomAndPan.setValue(SVGZoomAndPanMagnify); >+ m_zoomAndPan = SVGZoomAndPanMagnify; > return true; > } > >@@ -58,7 +45,7 @@ void SVGZoomAndPan::parseAttribute(const QualifiedName& attributeName, const Ato > { > if (attributeName != SVGNames::zoomAndPanAttr) > return; >- m_zoomAndPan.setValue(SVGPropertyTraits<SVGZoomAndPanType>::fromString(value)); >+ m_zoomAndPan = SVGPropertyTraits<SVGZoomAndPanType>::fromString(value); > } > > } >diff --git a/Source/WebCore/svg/SVGZoomAndPan.h b/Source/WebCore/svg/SVGZoomAndPan.h >index 35d8828ec57..7a846e73c37 100644 >--- a/Source/WebCore/svg/SVGZoomAndPan.h >+++ b/Source/WebCore/svg/SVGZoomAndPan.h >@@ -37,26 +37,22 @@ public: > SVG_ZOOMANDPAN_MAGNIFY = SVGZoomAndPanMagnify > }; > >- SVGZoomAndPanType zoomAndPan() const { return m_zoomAndPan.value(); } >- void setZoomAndPan(SVGZoomAndPanType zoomAndPan) { m_zoomAndPan.setValue(zoomAndPan); } >+ SVGZoomAndPanType zoomAndPan() const { return m_zoomAndPan; } >+ void setZoomAndPan(SVGZoomAndPanType zoomAndPan) { m_zoomAndPan = zoomAndPan; } > ExceptionOr<void> setZoomAndPan(unsigned) { return Exception { NoModificationAllowedError }; } >- void reset() { m_zoomAndPan.setValue(SVGZoomAndPanMagnify); } >- >- using AttributeOwnerProxy = SVGAttributeOwnerProxyImpl<SVGZoomAndPan>; >- static AttributeOwnerProxy::AttributeRegistry& attributeRegistry() { return AttributeOwnerProxy::attributeRegistry(); } >+ void reset() { m_zoomAndPan = SVGPropertyTraits<SVGZoomAndPanType>::initialValue(); } > > void parseAttribute(const QualifiedName&, const AtomicString&); > > protected: >- SVGZoomAndPan(); >+ SVGZoomAndPan() = default; > >- static bool isKnownAttribute(const QualifiedName& attributeName) { return AttributeOwnerProxy::isKnownAttribute(attributeName); } > bool parseZoomAndPan(const UChar*&, const UChar*); > > private: >- static void registerAttributes(); >+ static void registerProperties(); > >- SVGPropertyAttribute<SVGZoomAndPanType> m_zoomAndPan; >+ SVGZoomAndPanType m_zoomAndPan { SVGPropertyTraits<SVGZoomAndPanType>::initialValue() }; > }; > > } // namespace WebCore >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; > >diff --git a/Source/WebCore/svg/properties/SVGAccessor.h b/Source/WebCore/svg/properties/SVGAccessor.h >new file mode 100644 >index 00000000000..ccb8035df74 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAccessor.h >@@ -0,0 +1,57 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "QualifiedName.h" >+#include "SVGAnimator.h" >+ >+namespace WebCore { >+ >+class SVGAnimatedProperty; >+class SVGProperty; >+ >+template<typename OwnerType> >+class SVGAccessor { >+ WTF_MAKE_FAST_ALLOCATED; >+public: >+ virtual ~SVGAccessor() = default; >+ >+ virtual void detach(const OwnerType&) const { } >+ virtual bool isAnimatedProperty() const { return false; } >+ virtual bool isAnimatedLength() const { return false; } >+ >+ virtual bool matches(const OwnerType&, const SVGProperty&) const { return false; } >+ virtual bool matches(const OwnerType&, const SVGAnimatedProperty&) const { return false; } >+ virtual std::optional<String> synchronize(const OwnerType&) const { return std::nullopt; } >+ >+ virtual RefPtr<SVGAnimator> createAnimator(OwnerType&, const QualifiedName&, AnimationMode, CalcMode, bool, bool) const { return nullptr; } >+ virtual void appendAnimatedInstance(OwnerType&, const RefPtr<SVGAnimator>&) const { } >+ >+protected: >+ SVGAccessor() = default; >+}; >+ >+} // namespace WebCore >diff --git a/Source/WebCore/svg/properties/SVGAccessorPtr.h b/Source/WebCore/svg/properties/SVGAccessorPtr.h >new file mode 100644 >index 00000000000..561eeb322d1 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAccessorPtr.h >@@ -0,0 +1,66 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAccessor.h" >+ >+namespace WebCore { >+ >+template<typename OwnerType, typename PropertyType> >+class SVGAccessorPtr : public SVGAccessor<OwnerType> { >+ using Base = SVGAccessor<OwnerType>; >+ >+public: >+ SVGAccessorPtr(Ref<PropertyType> OwnerType::*property) >+ : m_property(property) >+ { >+ } >+ >+ Ref<PropertyType>& property(OwnerType& owner) const { return owner.*m_property; } >+ const Ref<PropertyType>& property(const OwnerType& owner) const { return owner.*m_property; } >+ >+ void detach(const OwnerType& owner) const override >+ { >+ property(owner)->detach(); >+ } >+ >+ std::optional<String> synchronize(const OwnerType& owner) const override >+ { >+ return property(owner)->synchronize(); >+ } >+ >+protected: >+ template<typename AccessorType, Ref<PropertyType> OwnerType::*property> >+ static const SVGAccessor<OwnerType>& singleton() >+ { >+ static NeverDestroyed<AccessorType> propertyAccessor { property }; >+ return propertyAccessor; >+ } >+ >+ Ref<PropertyType> OwnerType::*m_property; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedDecoratedProperty.h b/Source/WebCore/svg/properties/SVGAnimatedDecoratedProperty.h >new file mode 100644 >index 00000000000..803ada72bd5 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimatedDecoratedProperty.h >@@ -0,0 +1,139 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimatedProperty.h" >+#include "SVGDecoratedProperty.h" >+ >+namespace WebCore { >+ >+template<template <typename, typename> class DecoratedProperty, typename DecorationType> >+class SVGAnimatedDecoratedProperty : public SVGAnimatedProperty { >+public: >+ template<typename PropertyType, typename AnimatedProperty = SVGAnimatedDecoratedProperty> >+ static Ref<AnimatedProperty> create(SVGElement* contextElement) >+ { >+ return adoptRef(*new AnimatedProperty(contextElement, std::make_unique<DecoratedProperty<DecorationType, PropertyType>>())); >+ } >+ >+ template<typename PropertyType, typename AnimatedProperty = SVGAnimatedDecoratedProperty> >+ static Ref<AnimatedProperty> create(SVGElement* contextElement, const PropertyType& value) >+ { >+ return adoptRef(*new AnimatedProperty(contextElement, DecoratedProperty<DecorationType, PropertyType>::create(value))); >+ } >+ >+ SVGAnimatedDecoratedProperty(SVGElement* contextElement, std::unique_ptr<SVGDecoratedProperty<DecorationType>>&& baseVal) >+ : SVGAnimatedProperty(contextElement) >+ , m_baseVal(WTFMove(baseVal)) >+ { >+ } >+ >+ // Used by the DOM. >+ ExceptionOr<void> setBaseVal(const DecorationType& baseVal) >+ { >+ if (!m_baseVal->setValue(baseVal)) >+ return Exception { TypeError }; >+ commitPropertyChange(nullptr); >+ return { }; >+ } >+ >+ // Used by SVGElement::parseAttribute(). >+ template<typename PropertyType> >+ void setBaseValInternal(const PropertyType& baseVal) >+ { >+ m_baseVal->setValueInternal(static_cast<DecorationType>(baseVal)); >+ if (m_animVal) >+ m_animVal->setValueInternal(static_cast<DecorationType>(baseVal)); >+ } >+ >+ DecorationType baseVal() const { return m_baseVal->value(); } >+ >+ // Used by SVGAnimator::progress. >+ template<typename PropertyType> >+ void setAnimVal(const PropertyType& animVal) >+ { >+ ASSERT(isAnimating() && m_animVal); >+ m_animVal->setValueInternal(static_cast<DecorationType>(animVal)); >+ } >+ >+ template<typename PropertyType = DecorationType> >+ PropertyType animVal() const >+ { >+ ASSERT_IMPLIES(isAnimating(), m_animVal); >+ return static_cast<PropertyType>((isAnimating() ? m_animVal : m_baseVal)->value()); >+ } >+ >+ // Used when committing a change from the SVGAnimatedProperty to the attribute. >+ String baseValAsString() const override { return m_baseVal->valueAsString(); } >+ >+ // Used to apply the SVGAnimator change to the target element. >+ String animValAsString() const override >+ { >+ ASSERT(isAnimating() && !!m_animVal); >+ return m_animVal->valueAsString(); >+ } >+ >+ // Managing the relationship with the owner. >+ void setDirty() override { m_state = SVGPropertyState::Dirty; } >+ bool isDirty() const override { return m_state == SVGPropertyState::Dirty; } >+ std::optional<String> synchronize() override >+ { >+ if (m_state == SVGPropertyState::Clean) >+ return std::nullopt; >+ m_state = SVGPropertyState::Clean; >+ return baseValAsString(); >+ } >+ >+ // Used by RenderSVGElements and DumpRenderTree. >+ template<typename PropertyType> >+ PropertyType currentValue() const >+ { >+ return static_cast<PropertyType>((isAnimating() ? m_animVal : m_baseVal)->valueInternal()); >+ } >+ >+ // Controlling the animation. >+ void startAnimation() override >+ { >+ if (isAnimating()) >+ return; >+ m_animVal = m_baseVal->clone(); >+ SVGAnimatedProperty::startAnimation(); >+ } >+ void stopAnimation() override >+ { >+ if (!isAnimating()) >+ return; >+ m_animVal = nullptr; >+ SVGAnimatedProperty::stopAnimation(); >+ } >+ >+protected: >+ std::unique_ptr<SVGDecoratedProperty<DecorationType>> m_baseVal; >+ std::unique_ptr<SVGDecoratedProperty<DecorationType>> m_animVal; >+ SVGPropertyState m_state { SVGPropertyState::Clean }; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedEnumerationPropertyTearOff.h b/Source/WebCore/svg/properties/SVGAnimatedEnumerationPropertyTearOff.h >deleted file mode 100644 >index 5683af899b7..00000000000 >--- a/Source/WebCore/svg/properties/SVGAnimatedEnumerationPropertyTearOff.h >+++ /dev/null >@@ -1,86 +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. >- */ >- >-#pragma once >- >-#include "SVGAnimatedStaticPropertyTearOff.h" >-#include "SVGPropertyTraits.h" >- >-namespace WebCore { >- >-template<typename EnumType> >-class SVGAnimatedEnumerationPropertyTearOff final : public SVGAnimatedStaticPropertyTearOff<unsigned> { >-public: >- using ContentType = EnumType; >- >- const unsigned& baseVal() final >- { >- const unsigned& baseVal = SVGAnimatedStaticPropertyTearOff::baseVal(); >- >- if (baseVal > SVGIDLEnumLimits<EnumType>::highestExposedEnumValue()) >- return m_outOfRangeEnumValue; >- >- return baseVal; >- } >- >- const unsigned& animVal() final >- { >- const unsigned& animVal = SVGAnimatedStaticPropertyTearOff::animVal(); >- >- if (animVal > SVGIDLEnumLimits<EnumType>::highestExposedEnumValue()) >- return m_outOfRangeEnumValue; >- >- return animVal; >- } >- >- ExceptionOr<void> setBaseVal(const unsigned& property) final >- { >- // All SVG enumeration values, that are allowed to be set via SVG DOM start with 1, 0 corresponds to unknown and is not settable through SVG DOM. >- if (!property || property > SVGIDLEnumLimits<EnumType>::highestExposedEnumValue()) >- return Exception { TypeError }; >- return SVGAnimatedStaticPropertyTearOff<unsigned>::setBaseVal(property); >- } >- >- static Ref<SVGAnimatedEnumerationPropertyTearOff<EnumType>> create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, EnumType& property) >- { >- ASSERT(contextElement); >- return adoptRef(*new SVGAnimatedEnumerationPropertyTearOff<EnumType>(contextElement, attributeName, animatedPropertyType, reinterpret_cast<unsigned&>(property))); >- } >- >- EnumType& currentAnimatedValue() >- { >- unsigned& animatedValue = SVGAnimatedStaticPropertyTearOff<unsigned>::currentAnimatedValue(); >- ASSERT(animatedValue <= SVGPropertyTraits<EnumType>::highestEnumValue()); >- return reinterpret_cast<EnumType&>(animatedValue); >- } >- >-private: >- SVGAnimatedEnumerationPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, unsigned& property) >- : SVGAnimatedStaticPropertyTearOff<unsigned>(contextElement, attributeName, animatedPropertyType, property) >- { >- } >- >- static unsigned m_outOfRangeEnumValue; >-}; >- >-// By convention, all enum values that represent UNKNOWN in SVG are equal to zero. >-template<typename EnumType> >-unsigned SVGAnimatedEnumerationPropertyTearOff<EnumType>::m_outOfRangeEnumValue = 0; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h b/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h >deleted file mode 100644 >index 4298c6eb15c..00000000000 >--- a/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h >+++ /dev/null >@@ -1,186 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010. All rights reserved. >- * Copyright (C) 2016 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 "SVGAnimatedProperty.h" >-#include "SVGListPropertyTearOff.h" >-#include "SVGStaticListPropertyTearOff.h" >- >-namespace WebCore { >- >-template<typename PropertyType> >-class SVGPropertyTearOff; >- >-template<typename PropertyType> >-class SVGAnimatedListPropertyTearOff : public SVGAnimatedProperty { >-public: >- using ListItemType = typename SVGPropertyTraits<PropertyType>::ListItemType; >- using ListItemTearOff = typename SVGPropertyTraits<PropertyType>::ListItemTearOff; >- using ListWrapperCache = Vector<WeakPtr<SVGPropertyTearOff<ListItemType>>>; >- using ListProperty = SVGListProperty<PropertyType>; >- using ListPropertyTearOff = typename SVGPropertyTraits<PropertyType>::ListPropertyTearOff; >- using ContentType = PropertyType; >- >- static Ref<SVGAnimatedListPropertyTearOff<PropertyType>> create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& values) >- { >- ASSERT(contextElement); >- return adoptRef(*new SVGAnimatedListPropertyTearOff<PropertyType>(contextElement, attributeName, animatedPropertyType, values)); >- } >- >- virtual Ref<ListPropertyTearOff> baseVal() >- { >- if (m_baseVal) >- return *static_cast<ListPropertyTearOff*>(m_baseVal.get()); >- >- auto property = ListPropertyTearOff::create(*this, BaseValRole, m_values, m_wrappers); >- m_baseVal = makeWeakPtr(property.get()); >- return property; >- } >- >- virtual Ref<ListPropertyTearOff> animVal() >- { >- if (m_animVal) >- return *static_cast<ListPropertyTearOff*>(m_animVal.get()); >- >- auto property = ListPropertyTearOff::create(*this, AnimValRole, m_values, m_wrappers); >- m_animVal = makeWeakPtr(property.get()); >- return property; >- } >- >- bool isAnimating() const override { return m_animatedProperty; } >- bool isAnimatedListTearOff() const override { return true; } >- >- int findItem(SVGProperty* property) >- { >- // This should ever be called for our baseVal, as animVal can't modify the list. >- return baseVal()->findItem(static_cast<ListItemTearOff*>(property)); >- } >- >- void removeItemFromList(size_t itemIndex, bool shouldSynchronizeWrappers) >- { >- // This should ever be called for our baseVal, as animVal can't modify the list. >- baseVal()->removeItemFromList(itemIndex, shouldSynchronizeWrappers); >- } >- >- void detachListWrappers(unsigned newListSize) >- { >- ListProperty::detachListWrappersAndResize(&m_wrappers, newListSize); >- } >- >- PropertyType& currentAnimatedValue() >- { >- ASSERT(isAnimating()); >- return m_animatedProperty->values(); >- } >- >- const PropertyType& currentBaseValue() const >- { >- return m_values; >- } >- >- void animationStarted(PropertyType* newAnimVal, bool shouldOwnValues = false) >- { >- ASSERT(!isAnimating()); >- ASSERT(newAnimVal); >- ASSERT(m_values.size() == m_wrappers.size()); >- ASSERT(m_animatedWrappers.isEmpty()); >- >- // Switch to new passed in value type & new wrappers list. The new wrappers list must be created for the new value. >- if (!newAnimVal->isEmpty()) >- m_animatedWrappers.fill(0, newAnimVal->size()); >- >- m_animatedProperty = animVal(); >- m_animatedProperty->setValuesAndWrappers(newAnimVal, &m_animatedWrappers, shouldOwnValues); >- ASSERT(m_animatedProperty->values().size() == m_animatedProperty->wrappers().size()); >- ASSERT(m_animatedProperty->wrappers().size() == m_animatedWrappers.size()); >- } >- >- void animationEnded() >- { >- ASSERT(isAnimating()); >- ASSERT(m_values.size() == m_wrappers.size()); >- >- ASSERT(m_animatedProperty->values().size() == m_animatedProperty->wrappers().size()); >- ASSERT(m_animatedProperty->wrappers().size() == m_animatedWrappers.size()); >- >- m_animatedProperty->setValuesAndWrappers(&m_values, &m_wrappers, false); >- ASSERT(m_animatedProperty->values().size() == m_animatedProperty->wrappers().size()); >- ASSERT(m_animatedProperty->wrappers().size() == m_wrappers.size()); >- >- m_animatedWrappers.clear(); >- m_animatedProperty = nullptr; >- } >- >- void synchronizeWrappersIfNeeded() >- { >- if (!isAnimating()) { >- // This should never happen, but we've seen it in the field. Please comment in bug #181316 if you hit this. >- ASSERT_NOT_REACHED(); >- return; >- } >- >- // Eventually the wrapper list needs synchronization because any SVGAnimateLengthList::calculateAnimatedValue() call may >- // mutate the length of our values() list, and thus the wrapper() cache needs synchronization, to have the same size. >- // Also existing wrappers which point directly at elements in the existing SVGLengthListValues have to be detached (so a copy >- // of them is created, so existing animVal variables in JS are kept-alive). If we'd detach them later the underlying >- // SVGLengthListValues was already mutated, and our list item wrapper tear offs would point nowhere. Assertions would fire. >- m_animatedProperty->detachListWrappers(m_animatedProperty->values().size()); >- >- ASSERT(m_animatedProperty->values().size() == m_animatedProperty->wrappers().size()); >- ASSERT(m_animatedProperty->wrappers().size() == m_animatedWrappers.size()); >- } >- >- void animValWillChange() >- { >- ASSERT(m_values.size() == m_wrappers.size()); >- synchronizeWrappersIfNeeded(); >- } >- >- void animValDidChange() >- { >- ASSERT(m_values.size() == m_wrappers.size()); >- synchronizeWrappersIfNeeded(); >- } >- >-protected: >- SVGAnimatedListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& values) >- : SVGAnimatedProperty(contextElement, attributeName, animatedPropertyType) >- , m_values(values) >- { >- if (!values.isEmpty()) >- m_wrappers.fill(0, values.size()); >- } >- >- PropertyType& m_values; >- >- ListWrapperCache m_wrappers; >- ListWrapperCache m_animatedWrappers; >- >- // Cache weak pointers but return Ref pointers. This will break the cyclic reference >- // between SVGListPropertyTearOff and SVGAnimatedListPropertyTearOff once the property >- // pointer is not needed. >- WeakPtr<SVGListProperty<PropertyType>> m_baseVal; >- WeakPtr<SVGListProperty<PropertyType>> m_animVal; >- >- RefPtr<ListProperty> m_animatedProperty; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h b/Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h >deleted file mode 100644 >index ba859937436..00000000000 >--- a/Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h >+++ /dev/null >@@ -1,101 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010, 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 "SVGAnimatedListPropertyTearOff.h" >-#include "SVGPathByteStream.h" >-#include "SVGPathSegList.h" >-#include "SVGPathUtilities.h" >- >-namespace WebCore { >- >-class SVGAnimatedPathSegListPropertyTearOff final : public SVGAnimatedListPropertyTearOff<SVGPathSegListValues> { >-public: >- using Base = SVGAnimatedListPropertyTearOff<SVGPathSegListValues>; >- >- static Ref<SVGAnimatedPathSegListPropertyTearOff> create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGPathSegListValues& values) >- { >- ASSERT(contextElement); >- return adoptRef(*new SVGAnimatedPathSegListPropertyTearOff(contextElement, attributeName, animatedPropertyType, values)); >- } >- >- Ref<ListPropertyTearOff> baseVal() final >- { >- if (m_baseVal) >- return *static_cast<ListPropertyTearOff*>(m_baseVal.get()); >- >- auto property = SVGPathSegList::create(*this, BaseValRole, PathSegUnalteredRole, m_values, m_wrappers); >- m_baseVal = makeWeakPtr(property.get()); >- return property; >- } >- >- Ref<ListPropertyTearOff> animVal() final >- { >- if (m_animVal) >- return *static_cast<ListPropertyTearOff*>(m_animVal.get()); >- >- auto property = SVGPathSegList::create(*this, AnimValRole, PathSegUnalteredRole, m_values, m_wrappers); >- m_animVal = makeWeakPtr(property.get()); >- return property; >- } >- >- int findItem(const RefPtr<SVGPathSeg>& segment) >- { >- return baseVal()->findItem(segment); >- } >- >- void removeItemFromList(size_t itemIndex, bool shouldSynchronizeWrappers) >- { >- baseVal()->removeItemFromList(itemIndex, shouldSynchronizeWrappers); >- } >- >- using Base::animationStarted; >- void animationStarted(SVGPathByteStream* byteStream, const SVGPathSegListValues* baseValue) >- { >- ASSERT(byteStream); >- ASSERT(baseValue); >- ASSERT(!m_animatedPathByteStream); >- m_animatedPathByteStream = byteStream; >- >- // Pass shouldOwnValues=true, as the SVGPathSegListValues lifetime is solely managed by its tear off class. >- auto* copy = new SVGPathSegListValues(*baseValue); >- Base::animationStarted(copy, true); >- } >- >- void animationEnded() >- { >- ASSERT(m_animatedPathByteStream); >- m_animatedPathByteStream = nullptr; >- Base::animationEnded(); >- } >- >- void animValDidChange(); >- >- SVGPathByteStream* animatedPathByteStream() const { return m_animatedPathByteStream; } >- >-private: >- SVGAnimatedPathSegListPropertyTearOff(SVGElement*, const QualifiedName&, AnimatedPropertyType, SVGPathSegListValues&); >- virtual ~SVGAnimatedPathSegListPropertyTearOff(); >- >- SVGPathByteStream* m_animatedPathByteStream { nullptr }; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPrimitiveProperty.h b/Source/WebCore/svg/properties/SVGAnimatedPrimitiveProperty.h >new file mode 100644 >index 00000000000..7a9cc63771d >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimatedPrimitiveProperty.h >@@ -0,0 +1,140 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimatedProperty.h" >+ >+namespace WebCore { >+ >+template<typename PropertyType> >+class SVGAnimatedPrimitiveProperty : public SVGAnimatedProperty { >+public: >+ using ValueType = PropertyType; >+ >+ static Ref<SVGAnimatedPrimitiveProperty> create(SVGElement* contextElement) >+ { >+ return adoptRef(*new SVGAnimatedPrimitiveProperty(contextElement)); >+ } >+ >+ static Ref<SVGAnimatedPrimitiveProperty> create(SVGElement* contextElement, const PropertyType& value) >+ { >+ return adoptRef(*new SVGAnimatedPrimitiveProperty(contextElement, value)); >+ } >+ >+ // Used by the DOM. >+ ExceptionOr<void> setBaseVal(const PropertyType& baseVal) >+ { >+ m_baseVal = baseVal; >+ commitPropertyChange(nullptr); >+ return { }; >+ } >+ >+ // Used by SVGElement::parseAttribute(). >+ void setBaseValInternal(const PropertyType& baseVal) { m_baseVal = baseVal; } >+ const PropertyType& baseVal() const { return m_baseVal; } >+ >+ // Used by SVGAnimator::progress. >+ void setAnimVal(const PropertyType& animVal) >+ { >+ ASSERT(isAnimating()); >+ m_animVal = animVal; >+ } >+ >+ const PropertyType& animVal() const >+ { >+ ASSERT_IMPLIES(isAnimating(), m_animVal); >+ return isAnimating() ? *m_animVal : m_baseVal; >+ } >+ >+ PropertyType& animVal() >+ { >+ ASSERT_IMPLIES(isAnimating(), m_animVal); >+ return isAnimating() ? *m_animVal : m_baseVal; >+ } >+ >+ // Used when committing a change from the SVGAnimatedProperty to the attribute. >+ String baseValAsString() const override { return SVGPropertyTraits<PropertyType>::toString(m_baseVal); } >+ >+ // Used to apply the SVGAnimator change to the target element. >+ String animValAsString() const override >+ { >+ ASSERT(isAnimating() && !!m_animVal); >+ return SVGPropertyTraits<PropertyType>::toString(*m_animVal); >+ } >+ >+ // Managing the relationship with the owner. >+ void setDirty() override { m_state = SVGPropertyState::Dirty; } >+ bool isDirty() const override { return m_state == SVGPropertyState::Dirty; } >+ std::optional<String> synchronize() override >+ { >+ if (m_state == SVGPropertyState::Clean) >+ return std::nullopt; >+ m_state = SVGPropertyState::Clean; >+ return baseValAsString(); >+ } >+ >+ // Used by RenderSVGElements and DumpRenderTree. >+ const PropertyType& currentValue() const >+ { >+ ASSERT_IMPLIES(isAnimating(), m_animVal); >+ return isAnimating() ? *m_animVal : m_baseVal; >+ } >+ >+ // Controlling the animation. >+ void startAnimation() override >+ { >+ if (isAnimating()) >+ return; >+ m_animVal = m_baseVal; >+ SVGAnimatedProperty::startAnimation(); >+ } >+ void stopAnimation() override >+ { >+ if (!isAnimating()) >+ return; >+ m_animVal = std::nullopt; >+ SVGAnimatedProperty::stopAnimation(); >+ } >+ >+protected: >+ SVGAnimatedPrimitiveProperty(SVGElement* contextElement) >+ : SVGAnimatedProperty(contextElement) >+ , m_baseVal(SVGPropertyTraits<PropertyType>::initialValue()) >+ { >+ } >+ >+ SVGAnimatedPrimitiveProperty(SVGElement* contextElement, const PropertyType& value) >+ : SVGAnimatedProperty(contextElement) >+ , m_baseVal(value) >+ { >+ } >+ >+ PropertyType m_baseVal; >+ mutable std::optional<PropertyType> m_animVal; >+ SVGPropertyState m_state { SVGPropertyState::Clean }; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp b/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp >index e4eec385bfe..58d1c3bd9d8 100644 >--- a/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp >+++ b/Source/WebCore/svg/properties/SVGAnimatedProperty.cpp >@@ -26,37 +26,16 @@ > > namespace WebCore { > >-SVGAnimatedProperty::SVGAnimatedProperty(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType) >- : m_contextElement(contextElement) >- , m_attributeName(attributeName) >- , m_animatedPropertyType(animatedPropertyType) >+SVGPropertyOwner* SVGAnimatedProperty::owner() const > { >+ // Casting from SVGElement to SVGPropertyOwner requires SVGElement.h. >+ return m_contextElement; > } > >-SVGAnimatedProperty::~SVGAnimatedProperty() >+void SVGAnimatedProperty::commitPropertyChange(SVGProperty*) > { >- // Assure that animationEnded() was called, if animationStarted() was called before. >- ASSERT(!isAnimating()); >- >- // Remove wrapper from cache. >- for (auto& cache : animatedPropertyCache()) { >- if (cache.value == this) { >- animatedPropertyCache().remove(cache.key); >- return; >- } >- } >- >- RELEASE_ASSERT_NOT_REACHED(); >+ if (m_contextElement) >+ m_contextElement->commitPropertyChange(this); > } > >-void SVGAnimatedProperty::commitChange() >-{ >- ASSERT(m_contextElement); >- ASSERT(!m_contextElement->m_deletionHasBegun); >- m_contextElement->invalidateSVGAttributes(); >- m_contextElement->svgAttributeChanged(m_attributeName); >- // Needed to synchronize with CSSOM for presentation attributes with SVG DOM. >- m_contextElement->synchronizeAnimatedSVGAttribute(m_attributeName); > } >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/properties/SVGAnimatedProperty.h b/Source/WebCore/svg/properties/SVGAnimatedProperty.h >index 8dc52dd11ed..c00ca91ea4c 100644 >--- a/Source/WebCore/svg/properties/SVGAnimatedProperty.h >+++ b/Source/WebCore/svg/properties/SVGAnimatedProperty.h >@@ -21,73 +21,48 @@ > > #pragma once > >-#include "QualifiedName.h" >-#include "SVGAnimatedPropertyDescription.h" >-#include "SVGAnimatedPropertyType.h" >-#include <wtf/RefCounted.h> >+#include "ExceptionOr.h" >+#include "SVGProperty.h" > > namespace WebCore { > >-class SVGElement; >-class SVGProperty; >- >-class SVGAnimatedProperty : public RefCounted<SVGAnimatedProperty> { >+class SVGAnimatedProperty : public RefCounted<SVGAnimatedProperty>, public SVGPropertyOwner { > public: >- virtual ~SVGAnimatedProperty(); >- virtual bool isAnimating() const { return false; } >- virtual bool isAnimatedListTearOff() const { return false; } >+ virtual ~SVGAnimatedProperty() = default; > >- SVGElement* contextElement() const { return m_contextElement.get(); } >- const QualifiedName& attributeName() const { return m_attributeName; } >- AnimatedPropertyType animatedPropertyType() const { return m_animatedPropertyType; } >- bool isReadOnly() const { return m_isReadOnly; } >- void setIsReadOnly() { m_isReadOnly = true; } >+ // Manage the relationship with the owner. >+ bool isAttached() const { return m_contextElement; } >+ void detach() { m_contextElement = nullptr; } >+ SVGElement* contextElement() const { return m_contextElement; } > >- void commitChange(); >+ virtual String baseValAsString() const { return emptyString(); } >+ virtual String animValAsString() const { return emptyString(); } > >- template<typename TearOffType, typename PropertyType, AnimatedPropertyType animatedType> >- static RefPtr<SVGAnimatedProperty> lookupOrCreateAnimatedProperty(SVGElement& element, const QualifiedName& attributeName, const AtomicString& identifier, PropertyType& property, AnimatedPropertyState animatedState) >- { >- SVGAnimatedPropertyDescription key(&element, identifier); >+ // Control the synchronization between the attribute and its reflection in baseVal. >+ virtual bool isDirty() const { return false; } >+ virtual void setDirty() { } >+ virtual std::optional<String> synchronize() { return std::nullopt; } > >- auto result = animatedPropertyCache().add(key, nullptr); >- if (!result.isNewEntry) >- return result.iterator->value; >+ // Control the animation life cycle. >+ bool isAnimating() const { return m_isAnimating; } >+ virtual void startAnimation() { m_isAnimating = true; } >+ virtual void stopAnimation() { m_isAnimating = false; } > >- auto wrapper = TearOffType::create(&element, attributeName, animatedType, property); >- if (animatedState == PropertyIsReadOnly) >- wrapper->setIsReadOnly(); >- >- // Cache the raw pointer but return a RefPtr<>. This will break the cyclic reference >- // between SVGAnimatedProperty and SVGElement once the property pointer is not needed. >- result.iterator->value = wrapper.ptr(); >- return static_reference_cast<SVGAnimatedProperty>(wrapper); >- } >- >- static RefPtr<SVGAnimatedProperty> lookupAnimatedProperty(const SVGElement& element, const AtomicString& identifier) >- { >- SVGAnimatedPropertyDescription key(const_cast<SVGElement*>(&element), identifier); >- return animatedPropertyCache().get(key); >- } >+ // Attach/Detach the animVal of the traget element's property by the instance element's property. >+ virtual void instanceStartAnimation(SVGAnimatedProperty&) { m_isAnimating = true; } >+ virtual void instanceStopAnimation() { m_isAnimating = false; } > > protected: >- SVGAnimatedProperty(SVGElement*, const QualifiedName&, AnimatedPropertyType); >- >-private: >- // Caching facilities. >- using Cache = HashMap<SVGAnimatedPropertyDescription, SVGAnimatedProperty*, SVGAnimatedPropertyDescriptionHash, SVGAnimatedPropertyDescriptionHashTraits>; >- static Cache& animatedPropertyCache() >+ SVGAnimatedProperty(SVGElement* contextElement) >+ : m_contextElement(contextElement) > { >- static NeverDestroyed<Cache> cache; >- return cache; > } > >- RefPtr<SVGElement> m_contextElement; >- const QualifiedName& m_attributeName; >- AnimatedPropertyType m_animatedPropertyType; >+ SVGPropertyOwner* owner() const override; >+ void commitPropertyChange(SVGProperty*) override; > >-protected: >- bool m_isReadOnly { false }; >+ SVGElement* m_contextElement { nullptr }; >+ bool m_isAnimating { false }; > }; > >-} // namespace WebCore >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyType.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessor.h >similarity index 68% >rename from Source/WebCore/svg/properties/SVGAnimatedPropertyType.h >rename to Source/WebCore/svg/properties/SVGAnimatedPropertyAccessor.h >index f8bad439e32..fc52a5e046e 100644 >--- a/Source/WebCore/svg/properties/SVGAnimatedPropertyType.h >+++ b/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessor.h >@@ -25,34 +25,27 @@ > > #pragma once > >+#include "SVGAccessorPtr.h" >+ > namespace WebCore { > >-enum AnimatedPropertyState { >- PropertyIsReadWrite, >- PropertyIsReadOnly >-}; >+template<typename OwnerType, typename AnimatedPropertyType> >+class SVGAnimatedPropertyAccessor : public SVGAccessorPtr<OwnerType, AnimatedPropertyType> { >+ using Base = SVGAccessorPtr<OwnerType, AnimatedPropertyType>; >+ >+public: >+ using Base::Base; >+ using Base::singleton; >+ using Base::property; >+ using AnimatedProperty = AnimatedPropertyType; >+ >+ bool matches(const OwnerType& owner, const SVGAnimatedProperty& animatedProperty) const override >+ { >+ return property(owner).ptr() == &animatedProperty; >+ } > >-enum AnimatedPropertyType { >- AnimatedPropertyTypeMin = 0, >- AnimatedAngle = AnimatedPropertyTypeMin, >- AnimatedBoolean, >- AnimatedColor, >- AnimatedEnumeration, >- AnimatedInteger, >- AnimatedIntegerOptionalInteger, >- AnimatedLength, >- AnimatedLengthList, >- AnimatedNumber, >- AnimatedNumberList, >- AnimatedNumberOptionalNumber, >- AnimatedPath, >- AnimatedPoints, >- AnimatedPreserveAspectRatio, >- AnimatedRect, >- AnimatedString, >- AnimatedTransformList, >- AnimatedPropertyTypeMax, >- AnimatedUnknown = AnimatedPropertyTypeMax >+private: >+ bool isAnimatedProperty() const override { return true; } > }; > > } >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h >new file mode 100644 >index 00000000000..caa95a56601 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimatedPropertyAccessorImpl.h >@@ -0,0 +1,344 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimatedPropertyAccessor.h" >+#include "SVGAnimatedPropertyAnimatorImpl.h" >+#include "SVGAnimatedPropertyImpl.h" >+#include "SVGNames.h" >+ >+namespace WebCore { >+ >+template<typename OwnerType> >+class SVGAnimatedBooleanAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedBoolean> { >+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedBoolean>; >+ using Base::property; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedBoolean> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedBooleanAccessor, property>(); } >+ >+private: >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ return SVGAnimatedBooleanAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedBooleanAnimator>(animator)->appendAnimatedInstance(property(owner)); >+ } >+}; >+ >+template<typename OwnerType, typename EnumType> >+class SVGAnimatedEnumerationAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedEnumeration> { >+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedEnumeration>; >+ using Base::property; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedEnumeration> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedEnumerationAccessor, property>(); } >+ >+private: >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ return SVGAnimatedEnumerationAnimator<EnumType>::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedEnumerationAnimator<EnumType>>(animator)->appendAnimatedInstance(property(owner)); >+ } >+}; >+ >+template<typename OwnerType> >+class SVGAnimatedOrientTypeAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedOrientType> { >+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedOrientType>; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedOrientType> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() {return Base::template singleton<SVGAnimatedOrientTypeAccessor, property>(); } >+}; >+ >+template<typename OwnerType> >+class SVGAnimatedIntegerAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedInteger> { >+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedInteger>; >+ >+public: >+ using Base::Base; >+ using Base::property; >+ template<Ref<SVGAnimatedInteger> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedIntegerAccessor, property>(); } >+ >+private: >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ return SVGAnimatedIntegerAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedIntegerAnimator>(animator)->appendAnimatedInstance(property(owner)); >+ } >+}; >+ >+template<typename OwnerType> >+class SVGAnimatedNumberAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedNumber> { >+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedNumber>; >+ >+public: >+ using Base::Base; >+ using Base::property; >+ template<Ref<SVGAnimatedNumber> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedNumberAccessor, property>(); } >+ >+private: >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ return SVGAnimatedNumberAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedNumberAnimator>(animator)->appendAnimatedInstance(property(owner)); >+ } >+}; >+ >+template<typename OwnerType> >+class SVGAnimatedRectAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedRect> { >+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedRect>; >+ using Base::property; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedRect> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedRectAccessor, property>(); } >+ >+private: >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ return SVGAnimatedRectAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedRectAnimator>(animator)->appendAnimatedInstance(property(owner)); >+ } >+}; >+ >+template<typename OwnerType> >+class SVGAnimatedStringAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedString> { >+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedString>; >+ using Base::property; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedString> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedStringAccessor, property>(); } >+ >+private: >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ return SVGAnimatedStringAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedStringAnimator>(animator)->appendAnimatedInstance(property(owner)); >+ } >+}; >+ >+template<typename OwnerType> >+class SVGAnimatedAngleAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedAngle> { >+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedAngle>; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedAngle> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedAngleAccessor, property>(); } >+}; >+ >+template<typename OwnerType> >+class SVGAnimatedLengthAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedLength> { >+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedLength>; >+ using Base::property; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedLength> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedLengthAccessor, property>(); } >+ >+private: >+ bool isAnimatedLength() const override { return true; } >+ >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ SVGLengthMode lengthMode = property(owner)->baseVal()->value().unitMode(); >+ return SVGAnimatedLengthAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive, lengthMode); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedLengthAnimator>(animator)->appendAnimatedInstance(property(owner)); >+ } >+}; >+ >+template<typename OwnerType> >+class SVGAnimatedPreserveAspectRatioAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPreserveAspectRatio> { >+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPreserveAspectRatio>; >+ using Base::property; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedPreserveAspectRatio> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedPreserveAspectRatioAccessor, property>(); } >+ >+private: >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ return SVGAnimatedPreserveAspectRatioAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedPreserveAspectRatioAnimator>(animator)->appendAnimatedInstance(property(owner)); >+ } >+}; >+ >+template<typename OwnerType> >+class SVGAnimatedLengthListAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedLengthList> { >+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedLengthList>; >+ using Base::property; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedLengthList> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedLengthListAccessor, property>(); } >+ >+private: >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ return SVGAnimatedLengthListAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive, LengthModeWidth); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedLengthListAnimator>(animator)->appendAnimatedInstance(property(owner)); >+ } >+}; >+ >+template<typename OwnerType> >+class SVGAnimatedNumberListAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedNumberList> { >+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedNumberList>; >+ using Base::property; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedNumberList> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedNumberListAccessor, property>(); } >+ >+private: >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ return SVGAnimatedNumberListAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedNumberListAnimator>(animator)->appendAnimatedInstance(property(owner)); >+ } >+}; >+ >+template<typename OwnerType> >+class SVGAnimatedPathSegListAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPathSegList> { >+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPathSegList>; >+ using Base::property; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedPathSegList> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedPathSegListAccessor, property>(); } >+ >+private: >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ return SVGAnimatedPathSegListAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedPathSegListAnimator>(animator)->appendAnimatedInstance(property(owner)); >+ } >+}; >+ >+template<typename OwnerType> >+class SVGAnimatedPointListAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPointList> { >+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedPointList>; >+ using Base::property; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedPointList> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedPointListAccessor, property>(); } >+ >+private: >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ return SVGAnimatedPointListAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedPointListAnimator>(animator)->appendAnimatedInstance(property(owner)); >+ } >+}; >+ >+template<typename OwnerType> >+class SVGAnimatedTransformListAccessor final : public SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedTransformList> { >+ using Base = SVGAnimatedPropertyAccessor<OwnerType, SVGAnimatedTransformList>; >+ using Base::property; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedTransformList> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedTransformListAccessor, property>(); } >+ >+private: >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ return SVGAnimatedTransformListAnimator::create(attributeName, property(owner), animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedTransformListAnimator>(animator)->appendAnimatedInstance(property(owner)); >+ } >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimator.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimator.h >new file mode 100644 >index 00000000000..c62209e9d2a >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimator.h >@@ -0,0 +1,109 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimator.h" >+ >+namespace WebCore { >+ >+class SVGElement; >+ >+template<typename AnimatedProperty, typename AnimationFunction> >+class SVGAnimatedPropertyAnimator : public SVGAnimator { >+public: >+ using AnimatorAnimatedProperty = AnimatedProperty; >+ >+ void appendAnimatedInstance(Ref<AnimatedProperty>& animated) >+ { >+ m_animatedInstances.append(animated.copyRef()); >+ } >+ >+ bool isDiscrete() const override { return m_function.isDiscrete(); } >+ >+ void setFromAndToValues(SVGElement* targetElement, const String& from, const String& to) override >+ { >+ m_function.setFromAndToValues(targetElement, from, to); >+ } >+ >+ void setFromAndByValues(SVGElement* targetElement, const String& from, const String& by) override >+ { >+ m_function.setFromAndByValues(targetElement, from, by); >+ } >+ >+ void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override >+ { >+ m_function.setToAtEndOfDurationValue(toAtEndOfDuration); >+ } >+ >+ void start(SVGElement*) override >+ { >+ m_animated->startAnimation(); >+ for (auto& instance : m_animatedInstances) >+ instance->instanceStartAnimation(m_animated); >+ } >+ >+ void apply(SVGElement* targetElement) override >+ { >+ if (isAnimatedStylePropertyAniamtor(targetElement)) >+ applyAnimatedStylePropertyChange(targetElement, m_animated->animValAsString()); >+ >+ applyAnimatedPropertyChange(targetElement); >+ } >+ >+ void stop(SVGElement* targetElement) override >+ { >+ if (!m_animated->isAnimating()) >+ return; >+ >+ m_animated->stopAnimation(); >+ for (auto& instance : m_animatedInstances) >+ instance->instanceStopAnimation(); >+ >+ applyAnimatedPropertyChange(targetElement); >+ if (isAnimatedStylePropertyAniamtor(targetElement)) >+ removeAnimatedStyleProperty(targetElement); >+ } >+ >+ float calculateDistance(SVGElement* targetElement, const String& from, const String& to) const override >+ { >+ return m_function.calculateDistance(targetElement, from, to); >+ } >+ >+protected: >+ template<typename... Arguments> >+ SVGAnimatedPropertyAnimator(const QualifiedName& attributeName, Ref<AnimatedProperty>& animated, Arguments&&... arguments) >+ : SVGAnimator(attributeName) >+ , m_animated(animated.copyRef()) >+ , m_function(std::forward<Arguments>(arguments)...) >+ { >+ } >+ >+ Ref<AnimatedProperty> m_animated; >+ Vector<Ref<AnimatedProperty>> m_animatedInstances; >+ AnimationFunction m_function; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h >new file mode 100644 >index 00000000000..5b08087a00b >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimatedPropertyAnimatorImpl.h >@@ -0,0 +1,329 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimatedPropertyAnimator.h" >+#include "SVGAnimatedPropertyImpl.h" >+#include "SVGAnimationAdditiveListFunctionImpl.h" >+#include "SVGAnimationAdditiveValueFunctionImpl.h" >+#include "SVGAnimationDiscreteFunctionImpl.h" >+#include "SVGMarkerTypes.h" >+#include "SVGPathByteStream.h" >+ >+namespace WebCore { >+ >+class SVGAnimatedAngleAnimator; >+class SVGAnimatedIntegerPairAnimator; >+class SVGAnimatedNumberPairAnimator; >+class SVGAnimatedOrientTypeAnimator; >+ >+template<typename AnimatedPropertyAnimator1, typename AnimatedPropertyAnimator2> >+class SVGAnimatedPropertyPairAnimator; >+ >+class SVGAnimatedBooleanAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedBoolean, SVGAnimationBooleanFunction> { >+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedBoolean, SVGAnimationBooleanFunction>; >+ using Base::Base; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedBoolean>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedBooleanAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ bool& animated = m_animated->animVal(); >+ m_function.progress(targetElement, percentage, repeatCount, animated); >+ } >+}; >+ >+template<typename EnumType> >+class SVGAnimatedEnumerationAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedEnumeration, SVGAnimationEnumerationFunction<EnumType>> { >+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedEnumeration, SVGAnimationEnumerationFunction<EnumType>>; >+ using Base::Base; >+ using Base::m_animated; >+ using Base::m_function; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedEnumeration>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedEnumerationAnimator<EnumType>(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ EnumType animated; >+ m_function.progress(targetElement, percentage, repeatCount, animated); >+ m_animated->template setAnimVal<EnumType>(animated); >+ } >+}; >+ >+class SVGAnimatedPreserveAspectRatioAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction> { >+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedPreserveAspectRatio, SVGAnimationPreserveAspectRatioFunction>; >+ using Base::Base; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedPreserveAspectRatio>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedPreserveAspectRatioAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ SVGPreserveAspectRatioValue& animated = m_animated->animVal()->value(); >+ m_function.progress(targetElement, percentage, repeatCount, animated); >+ } >+}; >+ >+class SVGAnimatedStringAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedString, SVGAnimationStringFunction> { >+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedString, SVGAnimationStringFunction>; >+ using Base::Base; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedString>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedStringAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ String& animated = m_animated->animVal(); >+ m_function.progress(targetElement, percentage, repeatCount, animated); >+ } >+}; >+ >+class SVGAnimatedOrientTypeAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedOrientType, SVGAnimationOrientTypeFunction> { >+ friend class SVGAnimatedPropertyPairAnimator<SVGAnimatedAngleAnimator, SVGAnimatedOrientTypeAnimator>; >+ friend class SVGAnimatedAngleOrientAnimator; >+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedOrientType, SVGAnimationOrientTypeFunction>; >+ using Base::Base; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedOrientType>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedOrientTypeAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ SVGMarkerOrientType animated; >+ m_function.progress(targetElement, percentage, repeatCount, animated); >+ m_animated->setAnimVal(animated); >+ } >+}; >+ >+class SVGAnimatedNumberAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedNumber, SVGAnimationNumberFunction> { >+ friend class SVGAnimatedPropertyPairAnimator<SVGAnimatedNumberAnimator, SVGAnimatedNumberAnimator>; >+ friend class SVGAnimatedNumberPairAnimator; >+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedNumber, SVGAnimationNumberFunction>; >+ using Base::Base; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedNumber>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedNumberAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal()); >+ } >+}; >+ >+class SVGAnimatedIntegerAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedInteger, SVGAnimationIntegerFunction> { >+ friend class SVGAnimatedPropertyPairAnimator<SVGAnimatedIntegerAnimator, SVGAnimatedIntegerAnimator>; >+ friend class SVGAnimatedIntegerPairAnimator; >+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedInteger, SVGAnimationIntegerFunction>; >+ using Base::Base; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedInteger>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedIntegerAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal()); >+ } >+}; >+ >+class SVGAnimatedRectAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedRect, SVGAnimationRectFunction> { >+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedRect, SVGAnimationRectFunction>; >+ using Base::Base; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedRect>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedRectAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal()->value()); >+ } >+}; >+ >+class SVGAnimatedAngleAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedAngle, SVGAnimationAngleFunction> { >+ friend class SVGAnimatedPropertyPairAnimator<SVGAnimatedAngleAnimator, SVGAnimatedOrientTypeAnimator>; >+ friend class SVGAnimatedAngleOrientAnimator; >+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedAngle, SVGAnimationAngleFunction>; >+ using Base::Base; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedAngle>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedAngleAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal()->value()); >+ } >+}; >+ >+class SVGAnimatedLengthAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedLength, SVGAnimationLengthFunction> { >+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedLength, SVGAnimationLengthFunction>; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedLength>& animated, AnimationMode animationMode, >+ CalcMode calcMode, bool isAccumulated, bool isAdditive, SVGLengthMode lengthMode) >+ { >+ return adoptRef(*new SVGAnimatedLengthAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive, lengthMode)); >+ } >+private: >+ SVGAnimatedLengthAnimator(const QualifiedName& attributeName, Ref<SVGAnimatedLength>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive, SVGLengthMode lengthMode) >+ : Base(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive, lengthMode) >+ { >+ } >+ >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal()->value()); >+ } >+}; >+ >+class SVGAnimatedLengthListAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedLengthList, SVGAnimationLengthListFunction> { >+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedLengthList, SVGAnimationLengthListFunction>; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedLengthList>& animated, AnimationMode animationMode, >+ CalcMode calcMode, bool isAccumulated, bool isAdditive, SVGLengthMode lengthMode) >+ { >+ return adoptRef(*new SVGAnimatedLengthListAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive, lengthMode)); >+ } >+ >+private: >+ SVGAnimatedLengthListAnimator(const QualifiedName& attributeName, Ref<SVGAnimatedLengthList>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive, SVGLengthMode lengthMode) >+ : Base(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive, lengthMode) >+ { >+ } >+ >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal()); >+ } >+}; >+ >+class SVGAnimatedNumberListAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedNumberList, SVGAnimationNumberListFunction> { >+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedNumberList, SVGAnimationNumberListFunction>; >+ using Base::Base; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedNumberList>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedNumberListAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal()); >+ } >+}; >+ >+class SVGAnimatedPointListAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedPointList, SVGAnimationPointListFunction> { >+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedPointList, SVGAnimationPointListFunction>; >+ using Base::Base; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedPointList>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedPointListAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal()); >+ } >+}; >+ >+class SVGAnimatedTransformListAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedTransformList, SVGAnimationTransformListFunction> { >+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedTransformList, SVGAnimationTransformListFunction>; >+ using Base::Base; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedTransformList>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedTransformListAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal()); >+ } >+}; >+ >+class SVGAnimatedPathSegListAnimator final : public SVGAnimatedPropertyAnimator<SVGAnimatedPathSegList, SVGAnimationPathSegListFunction> { >+ using Base = SVGAnimatedPropertyAnimator<SVGAnimatedPathSegList, SVGAnimationPathSegListFunction>; >+ using Base::Base; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedPathSegList>& animated, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedPathSegListAnimator(attributeName, animated, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ m_animated->animVal()->pathByteStreamWillChange(); >+ m_function.progress(targetElement, percentage, repeatCount, m_animated->animVal()->pathByteStream()); >+ } >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyDescription.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyDescription.h >deleted file mode 100644 >index f1d9a04b0ff..00000000000 >--- a/Source/WebCore/svg/properties/SVGAnimatedPropertyDescription.h >+++ /dev/null >@@ -1,83 +0,0 @@ >-/* >- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> >- * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> >- * Copyright (C) Research In Motion Limited 2010. 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 <wtf/HashMap.h> >-#include <wtf/text/AtomicString.h> >- >-namespace WebCore { >- >-class SVGElement; >- >-struct SVGAnimatedPropertyDescription { >- // Empty value >- SVGAnimatedPropertyDescription() >- : m_element(nullptr) >- , m_attributeName(nullptr) >- { >- } >- >- // Deleted value >- SVGAnimatedPropertyDescription(WTF::HashTableDeletedValueType) >- : m_element(reinterpret_cast<SVGElement*>(-1)) >- { >- } >- >- bool isHashTableDeletedValue() const >- { >- return m_element == reinterpret_cast<SVGElement*>(-1); >- } >- >- SVGAnimatedPropertyDescription(SVGElement* element, const AtomicString& attributeName) >- : m_element(element) >- , m_attributeName(attributeName.impl()) >- { >- ASSERT(m_element); >- ASSERT(m_attributeName); >- } >- >- bool operator==(const SVGAnimatedPropertyDescription& other) const >- { >- return m_element == other.m_element && m_attributeName == other.m_attributeName; >- } >- >- SVGElement* m_element; >- AtomicStringImpl* m_attributeName; >-}; >- >-struct SVGAnimatedPropertyDescriptionHash { >- static unsigned hash(const SVGAnimatedPropertyDescription& key) >- { >- return StringHasher::hashMemory<sizeof(SVGAnimatedPropertyDescription)>(&key); >- } >- >- static bool equal(const SVGAnimatedPropertyDescription& a, const SVGAnimatedPropertyDescription& b) >- { >- return a == b; >- } >- >- static const bool safeToCompareToEmptyOrDeleted = true; >-}; >- >-struct SVGAnimatedPropertyDescriptionHashTraits : WTF::SimpleClassHashTraits<SVGAnimatedPropertyDescription> { }; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h >new file mode 100644 >index 00000000000..8764475de30 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimatedPropertyImpl.h >@@ -0,0 +1,101 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAngle.h" >+#include "SVGAnimatedDecoratedProperty.h" >+#include "SVGAnimatedPrimitiveProperty.h" >+#include "SVGAnimatedPropertyList.h" >+#include "SVGAnimatedValueProperty.h" >+#include "SVGDecoratedEnumeration.h" >+#include "SVGLength.h" >+#include "SVGLengthList.h" >+#include "SVGMarkerTypes.h" >+#include "SVGNumberList.h" >+#include "SVGPathSegList.h" >+#include "SVGPointList.h" >+#include "SVGPreserveAspectRatio.h" >+#include "SVGRect.h" >+#include "SVGTransformList.h" >+ >+namespace WebCore { >+ >+using SVGAnimatedBoolean = SVGAnimatedPrimitiveProperty<bool>; >+using SVGAnimatedInteger = SVGAnimatedPrimitiveProperty<int>; >+using SVGAnimatedNumber = SVGAnimatedPrimitiveProperty<float>; >+using SVGAnimatedString = SVGAnimatedPrimitiveProperty<String>; >+ >+using SVGAnimatedEnumeration = SVGAnimatedDecoratedProperty<SVGDecoratedEnumeration, unsigned>; >+ >+using SVGAnimatedRect = SVGAnimatedValueProperty<SVGRect>; >+using SVGAnimatedAngle = SVGAnimatedValueProperty<SVGAngle>; >+using SVGAnimatedLength = SVGAnimatedValueProperty<SVGLength>; >+using SVGAnimatedPreserveAspectRatio = SVGAnimatedValueProperty<SVGPreserveAspectRatio>; >+ >+using SVGAnimatedLengthList = SVGAnimatedPropertyList<SVGLengthList>; >+using SVGAnimatedNumberList = SVGAnimatedPropertyList<SVGNumberList>; >+using SVGAnimatedPointList = SVGAnimatedPropertyList<SVGPointList>; >+using SVGAnimatedTransformList = SVGAnimatedPropertyList<SVGTransformList>; >+ >+class SVGAnimatedOrientType : public SVGAnimatedEnumeration { >+public: >+ using SVGAnimatedEnumeration::SVGAnimatedEnumeration; >+ >+ static Ref<SVGAnimatedOrientType> create(SVGElement* contextElement, SVGMarkerOrientType baseValue) >+ { >+ return SVGAnimatedEnumeration::create<SVGMarkerOrientType, SVGAnimatedOrientType>(contextElement, baseValue); >+ } >+}; >+ >+class SVGAnimatedPathSegList : public SVGAnimatedPropertyList<SVGPathSegList> { >+ using Base = SVGAnimatedPropertyList<SVGPathSegList>; >+ using Base::Base; >+ >+public: >+ static Ref<SVGAnimatedPathSegList> create(SVGElement* contextElement) >+ { >+ return adoptRef(*new SVGAnimatedPathSegList(contextElement)); >+ } >+ >+ SVGPathByteStream& currentPathByteStream() >+ { >+ return isAnimating() ? animVal()->pathByteStream() : baseVal()->pathByteStream(); >+ } >+ >+ Path currentPath() >+ { >+ return isAnimating() ? animVal()->path() : baseVal()->path(); >+ } >+ >+ size_t approximateMemoryCost() const >+ { >+ if (isAnimating()) >+ return baseVal()->approximateMemoryCost() + animVal()->approximateMemoryCost(); >+ return baseVal()->approximateMemoryCost(); >+ } >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyList.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyList.h >new file mode 100644 >index 00000000000..a66df06bb7f >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimatedPropertyList.h >@@ -0,0 +1,137 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimatedProperty.h" >+ >+namespace WebCore { >+ >+template<typename ListType> >+class SVGAnimatedPropertyList : public SVGAnimatedProperty { >+public: >+ template<typename... Arguments> >+ static Ref<SVGAnimatedPropertyList> create(SVGElement* contextElement, Arguments&&... arguments) >+ { >+ return adoptRef(*new SVGAnimatedPropertyList(contextElement, std::forward<Arguments>(arguments)...)); >+ } >+ >+ ~SVGAnimatedPropertyList() >+ { >+ m_baseVal->detach(); >+ if (m_animVal) >+ m_animVal->detach(); >+ } >+ >+ // Used by the DOM. >+ const Ref<ListType>& baseVal() const { return m_baseVal; } >+ >+ // Used by SVGElement::parseAttribute(). >+ Ref<ListType>& baseVal() { return m_baseVal; } >+ >+ // Used by the DOM. >+ const RefPtr<ListType>& animVal() const { return const_cast<SVGAnimatedPropertyList*>(this)->ensureAnimVal(); } >+ >+ // Called by SVGAnimatedPropertyAnimator to pass the animVal to the SVGAnimationFunction::progress. >+ RefPtr<ListType>& animVal() { return ensureAnimVal(); } >+ >+ // Used when committing a change from the SVGAnimatedProperty to the attribute. >+ String baseValAsString() const override { return m_baseVal->valueAsString(); } >+ >+ // Used to apply the SVGAnimator change to the target element. >+ String animValAsString() const override >+ { >+ ASSERT(isAnimating()); >+ return m_animVal->valueAsString(); >+ } >+ >+ // Managing the relationship with the owner. >+ void setDirty() override { m_baseVal->setDirty(); } >+ bool isDirty() const override { return m_baseVal->isDirty(); } >+ std::optional<String> synchronize() override { return m_baseVal->synchronize(); } >+ >+ // Used by RenderSVGElements and DumpRenderTree. >+ const ListType& currentValue() const >+ { >+ ASSERT_IMPLIES(isAnimating(), m_animVal); >+ return isAnimating() ? *m_animVal : m_baseVal.get(); >+ } >+ >+ // Controlling the animation. >+ void startAnimation() override >+ { >+ if (m_animVal) >+ *m_animVal = m_baseVal; >+ else >+ ensureAnimVal(); >+ SVGAnimatedProperty::startAnimation(); >+ } >+ void stopAnimation() override >+ { >+ if (m_animVal) >+ *m_animVal = m_baseVal; >+ SVGAnimatedProperty::stopAnimation(); >+ } >+ >+ // Controlling the instance animation. >+ void instanceStartAnimation(SVGAnimatedProperty& animated) override >+ { >+ m_animVal = static_cast<SVGAnimatedPropertyList&>(animated).animVal(); >+ SVGAnimatedProperty::instanceStartAnimation(animated); >+ } >+ void instanceStopAnimation() override >+ { >+ m_animVal = nullptr; >+ SVGAnimatedProperty::instanceStopAnimation(); >+ } >+ >+protected: >+ template<typename... Arguments> >+ SVGAnimatedPropertyList(SVGElement* contextElement, Arguments&&... arguments) >+ : SVGAnimatedProperty(contextElement) >+ , m_baseVal(ListType::create(this, SVGPropertyAccess::ReadWrite, std::forward<Arguments>(arguments)...)) >+ { >+ } >+ >+ RefPtr<ListType>& ensureAnimVal() >+ { >+ if (!m_animVal) >+ m_animVal = ListType::create(m_baseVal, SVGPropertyAccess::ReadOnly); >+ return m_animVal; >+ } >+ >+ // Called when m_baseVal changes or an item in m_baseVal changes. >+ void commitPropertyChange(SVGProperty* property) override >+ { >+ if (m_animVal) >+ *m_animVal = m_baseVal; >+ SVGAnimatedProperty::commitPropertyChange(property); >+ } >+ >+ Ref<ListType> m_baseVal; >+ mutable RefPtr<ListType> m_animVal; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessor.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessor.h >new file mode 100644 >index 00000000000..026b085c6d4 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessor.h >@@ -0,0 +1,70 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAccessor.h" >+ >+namespace WebCore { >+ >+template<typename OwnerType, typename AccessorType1, typename AccessorType2> >+class SVGAnimatedPropertyPairAccessor : public SVGAccessor<OwnerType> { >+ using AnimatedPropertyType1 = typename AccessorType1::AnimatedProperty; >+ using AnimatedPropertyType2 = typename AccessorType2::AnimatedProperty; >+ using Base = SVGAccessor<OwnerType>; >+ >+public: >+ SVGAnimatedPropertyPairAccessor(Ref<AnimatedPropertyType1> OwnerType::*property1, Ref<AnimatedPropertyType2> OwnerType::*property2) >+ : m_accessor1(property1) >+ , m_accessor2(property2) >+ { >+ } >+ >+protected: >+ template<typename AccessorType, Ref<AnimatedPropertyType1> OwnerType::*property1, Ref<AnimatedPropertyType2> OwnerType::*property2> >+ static SVGAccessor<OwnerType>& singleton() >+ { >+ static NeverDestroyed<AccessorType> propertyAccessor { property1, property2 }; >+ return propertyAccessor; >+ } >+ >+ bool isAnimatedProperty() const override { return true; } >+ >+ Ref<AnimatedPropertyType1>& property1(OwnerType& owner) const { return m_accessor1.property(owner); } >+ const Ref<AnimatedPropertyType1>& property1(const OwnerType& owner) const { return m_accessor1.property(owner); } >+ >+ Ref<AnimatedPropertyType2>& property2(OwnerType& owner) const { return m_accessor2.property(owner); } >+ const Ref<AnimatedPropertyType2>& property2(const OwnerType& owner) const { return m_accessor2.property(owner); } >+ >+ bool matches(const OwnerType& owner, const SVGAnimatedProperty& animatedProperty) const override >+ { >+ return m_accessor1.matches(owner, animatedProperty) || m_accessor2.matches(owner, animatedProperty); >+ } >+ >+ AccessorType1 m_accessor1; >+ AccessorType2 m_accessor2; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessorImpl.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessorImpl.h >new file mode 100644 >index 00000000000..2e50e5db14d >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAccessorImpl.h >@@ -0,0 +1,144 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimatedPropertyAccessorImpl.h" >+#include "SVGAnimatedPropertyAnimatorImpl.h" >+#include "SVGAnimatedPropertyImpl.h" >+#include "SVGAnimatedPropertyPairAccessor.h" >+#include "SVGAnimatedPropertyPairAnimatorImpl.h" >+#include "SVGNames.h" >+ >+namespace WebCore { >+ >+template<typename OwnerType> >+class SVGAnimatedIntegerPairAccessor final : public SVGAnimatedPropertyPairAccessor<OwnerType, SVGAnimatedIntegerAccessor<OwnerType>, SVGAnimatedIntegerAccessor<OwnerType>> { >+ using Base = SVGAnimatedPropertyPairAccessor<OwnerType, SVGAnimatedIntegerAccessor<OwnerType>, SVGAnimatedIntegerAccessor<OwnerType>>; >+ using Base::property1; >+ using Base::property2; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedInteger> OwnerType::*property1, Ref<SVGAnimatedInteger> OwnerType::*property2> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedIntegerPairAccessor, property1, property2>(); } >+ >+private: >+ std::optional<String> synchronize(const OwnerType& owner) const final >+ { >+ bool dirty1 = property1(owner)->isDirty(); >+ bool dirty2 = property2(owner)->isDirty(); >+ if (!(dirty1 || dirty2)) >+ return std::nullopt; >+ >+ String string1 = dirty1 ? *property1(owner)->synchronize() : property1(owner)->baseValAsString(); >+ String string2 = dirty2 ? *property2(owner)->synchronize() : property2(owner)->baseValAsString(); >+ return string1 == string2 ? string1 : string1 + ", " + string2; >+ } >+ >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ return SVGAnimatedIntegerPairAnimator::create(attributeName, property1(owner), property2(owner), animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedIntegerPairAnimator>(animator)->appendAnimatedInstance(property1(owner), property2(owner)); >+ } >+}; >+ >+template<typename OwnerType> >+class SVGAnimatedNumberPairAccessor final : public SVGAnimatedPropertyPairAccessor<OwnerType, SVGAnimatedNumberAccessor<OwnerType>, SVGAnimatedNumberAccessor<OwnerType>> { >+ using Base = SVGAnimatedPropertyPairAccessor<OwnerType, SVGAnimatedNumberAccessor<OwnerType>, SVGAnimatedNumberAccessor<OwnerType>>; >+ using Base::property1; >+ using Base::property2; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedNumber> OwnerType::*property1, Ref<SVGAnimatedNumber> OwnerType::*property2 > >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedNumberPairAccessor, property1, property2>(); } >+ >+private: >+ std::optional<String> synchronize(const OwnerType& owner) const final >+ { >+ bool dirty1 = property1(owner)->isDirty(); >+ bool dirty2 = property2(owner)->isDirty(); >+ if (!(dirty1 || dirty2)) >+ return std::nullopt; >+ >+ String string1 = dirty1 ? *property1(owner)->synchronize() : property1(owner)->baseValAsString(); >+ String string2 = dirty2 ? *property2(owner)->synchronize() : property2(owner)->baseValAsString(); >+ return string1 == string2 ? string1 : string1 + ", " + string2; >+ } >+ >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ return SVGAnimatedNumberPairAnimator::create(attributeName, property1(owner), property2(owner), animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedNumberPairAnimator>(animator)->appendAnimatedInstance(property1(owner), property2(owner)); >+ } >+}; >+ >+template<typename OwnerType> >+class SVGAnimatedAngleOrientAccessor final : public SVGAnimatedPropertyPairAccessor<OwnerType, SVGAnimatedAngleAccessor<OwnerType>, SVGAnimatedOrientTypeAccessor<OwnerType>> { >+ using Base = SVGAnimatedPropertyPairAccessor<OwnerType, SVGAnimatedAngleAccessor<OwnerType>, SVGAnimatedOrientTypeAccessor<OwnerType>>; >+ using Base::property1; >+ using Base::property2; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGAnimatedAngle> OwnerType::*property1, Ref<SVGAnimatedOrientType> OwnerType::*property2> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGAnimatedAngleOrientAccessor, property1, property2>(); } >+ >+private: >+ std::optional<String> synchronize(const OwnerType& owner) const final >+ { >+ bool dirty1 = property1(owner)->isDirty(); >+ bool dirty2 = property2(owner)->isDirty(); >+ if (!(dirty1 || dirty2)) >+ return std::nullopt; >+ >+ auto type = property2(owner)->baseVal(); >+ >+ String string1 = dirty1 ? *property1(owner)->synchronize() : property1(owner)->baseValAsString(); >+ String string2 = dirty2 ? *property2(owner)->synchronize() : property2(owner)->baseValAsString(); >+ return type == SVGMarkerOrientAuto || type == SVGMarkerOrientAutoStartReverse ? string2 : string1; >+ } >+ >+ RefPtr<SVGAnimator> createAnimator(OwnerType& owner, const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const final >+ { >+ return SVGAnimatedAngleOrientAnimator::create(attributeName, property1(owner), property2(owner), animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ void appendAnimatedInstance(OwnerType& owner, const RefPtr<SVGAnimator>& animator) const final >+ { >+ static_pointer_cast<SVGAnimatedAngleOrientAnimator>(animator)->appendAnimatedInstance(property1(owner), property2(owner)); >+ } >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAnimator.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAnimator.h >new file mode 100644 >index 00000000000..e1436bce4c3 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAnimator.h >@@ -0,0 +1,81 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimator.h" >+ >+namespace WebCore { >+ >+class SVGElement; >+ >+template<typename AnimatedPropertyAnimator1, typename AnimatedPropertyAnimator2> >+class SVGAnimatedPropertyPairAnimator : public SVGAnimator { >+public: >+ using AnimatedProperty1 = typename AnimatedPropertyAnimator1::AnimatorAnimatedProperty; >+ using AnimatedProperty2 = typename AnimatedPropertyAnimator2::AnimatorAnimatedProperty; >+ >+ void appendAnimatedInstance(Ref<AnimatedProperty1>& animated1, Ref<AnimatedProperty2>& animated2) >+ { >+ m_animatedPropertyAnimator1->appendAnimatedInstance(animated1); >+ m_animatedPropertyAnimator2->appendAnimatedInstance(animated2); >+ } >+ >+protected: >+ SVGAnimatedPropertyPairAnimator(const QualifiedName& attributeName, Ref<AnimatedProperty1>& animated1, Ref<AnimatedProperty2>& animated2, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ : SVGAnimator(attributeName) >+ , m_animatedPropertyAnimator1(AnimatedPropertyAnimator1::create(attributeName, animated1, animationMode, calcMode, isAccumulated, isAdditive)) >+ , m_animatedPropertyAnimator2(AnimatedPropertyAnimator2::create(attributeName, animated2, animationMode, calcMode, isAccumulated, isAdditive)) >+ { >+ } >+ >+ void start(SVGElement* targetElement) override >+ { >+ m_animatedPropertyAnimator1->start(targetElement); >+ m_animatedPropertyAnimator2->start(targetElement); >+ } >+ >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) override >+ { >+ m_animatedPropertyAnimator1->progress(targetElement, percentage, repeatCount); >+ m_animatedPropertyAnimator2->progress(targetElement, percentage, repeatCount); >+ } >+ >+ void apply(SVGElement* targetElement) override >+ { >+ applyAnimatedPropertyChange(targetElement); >+ } >+ >+ void stop(SVGElement* targetElement) override >+ { >+ m_animatedPropertyAnimator1->stop(targetElement); >+ m_animatedPropertyAnimator2->stop(targetElement); >+ } >+ >+ Ref<AnimatedPropertyAnimator1> m_animatedPropertyAnimator1; >+ Ref<AnimatedPropertyAnimator2> m_animatedPropertyAnimator2; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h >new file mode 100644 >index 00000000000..85e84b314d6 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h >@@ -0,0 +1,195 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimatedPropertyImpl.h" >+#include "SVGAnimatedPropertyPairAnimator.h" >+#include "SVGMarkerTypes.h" >+ >+namespace WebCore { >+ >+class SVGElement; >+ >+class SVGAnimatedIntegerPairAnimator final : public SVGAnimatedPropertyPairAnimator<SVGAnimatedIntegerAnimator, SVGAnimatedIntegerAnimator> { >+ using Base = SVGAnimatedPropertyPairAnimator<SVGAnimatedIntegerAnimator, SVGAnimatedIntegerAnimator>; >+ using Base::Base; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedInteger>& animated1, Ref<SVGAnimatedInteger>& animated2, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedIntegerPairAnimator(attributeName, animated1, animated2, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) final >+ { >+ auto pairFrom = SVGPropertyTraits<std::pair<int, int>>::fromString(from); >+ auto pairTo = SVGPropertyTraits<std::pair<int, int>>::fromString(to); >+ >+ m_animatedPropertyAnimator1->m_function.m_from = pairFrom.first; >+ m_animatedPropertyAnimator1->m_function.m_to = pairTo.first; >+ >+ m_animatedPropertyAnimator2->m_function.m_from = pairFrom.second; >+ m_animatedPropertyAnimator2->m_function.m_to = pairTo.second; >+ } >+ >+ void setFromAndByValues(SVGElement*, const String& from, const String& by) final >+ { >+ auto pairFrom = SVGPropertyTraits<std::pair<int, int>>::fromString(from); >+ auto pairBy = SVGPropertyTraits<std::pair<int, int>>::fromString(by); >+ >+ m_animatedPropertyAnimator1->m_function.m_from = pairFrom.first; >+ m_animatedPropertyAnimator1->m_function.m_to = pairFrom.first + pairBy.first; >+ >+ m_animatedPropertyAnimator2->m_function.m_from = pairFrom.second; >+ m_animatedPropertyAnimator2->m_function.m_to = pairFrom.second + pairBy.second; >+ } >+ >+ void setToAtEndOfDurationValue(const String& toAtEndOfDuration) final >+ { >+ auto pairToAtEndOfDuration = SVGPropertyTraits<std::pair<int, int>>::fromString(toAtEndOfDuration); >+ m_animatedPropertyAnimator1->m_function.m_toAtEndOfDuration = pairToAtEndOfDuration.first; >+ m_animatedPropertyAnimator2->m_function.m_toAtEndOfDuration = pairToAtEndOfDuration.second; >+ } >+}; >+ >+class SVGAnimatedNumberPairAnimator final : public SVGAnimatedPropertyPairAnimator<SVGAnimatedNumberAnimator, SVGAnimatedNumberAnimator> { >+ using Base = SVGAnimatedPropertyPairAnimator<SVGAnimatedNumberAnimator, SVGAnimatedNumberAnimator>; >+ using Base::Base; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedNumber>& animated1, Ref<SVGAnimatedNumber>& animated2, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedNumberPairAnimator(attributeName, animated1, animated2, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) final >+ { >+ auto pairFrom = SVGPropertyTraits<std::pair<float, float>>::fromString(from); >+ auto pairTo = SVGPropertyTraits<std::pair<float, float>>::fromString(to); >+ >+ m_animatedPropertyAnimator1->m_function.m_from = pairFrom.first; >+ m_animatedPropertyAnimator1->m_function.m_to = pairTo.first; >+ >+ m_animatedPropertyAnimator2->m_function.m_from = pairFrom.second; >+ m_animatedPropertyAnimator2->m_function.m_to = pairTo.second; >+ } >+ >+ void setFromAndByValues(SVGElement*, const String& from, const String& by) final >+ { >+ auto pairFrom = SVGPropertyTraits<std::pair<float, float>>::fromString(from); >+ auto pairBy = SVGPropertyTraits<std::pair<float, float>>::fromString(by); >+ >+ m_animatedPropertyAnimator1->m_function.m_from = pairFrom.first; >+ m_animatedPropertyAnimator1->m_function.m_to = pairFrom.first + pairBy.first; >+ >+ m_animatedPropertyAnimator2->m_function.m_from = pairFrom.second; >+ m_animatedPropertyAnimator2->m_function.m_to = pairFrom.second + pairBy.second; >+ } >+ >+ void setToAtEndOfDurationValue(const String& toAtEndOfDuration) final >+ { >+ auto pairToAtEndOfDuration = SVGPropertyTraits<std::pair<float, float>>::fromString(toAtEndOfDuration); >+ m_animatedPropertyAnimator1->m_function.m_toAtEndOfDuration = pairToAtEndOfDuration.first; >+ m_animatedPropertyAnimator2->m_function.m_toAtEndOfDuration = pairToAtEndOfDuration.second; >+ } >+}; >+ >+class SVGAnimatedAngleOrientAnimator final : public SVGAnimatedPropertyPairAnimator<SVGAnimatedAngleAnimator, SVGAnimatedOrientTypeAnimator> { >+ using Base = SVGAnimatedPropertyPairAnimator<SVGAnimatedAngleAnimator, SVGAnimatedOrientTypeAnimator>; >+ using Base::Base; >+ >+public: >+ static auto create(const QualifiedName& attributeName, Ref<SVGAnimatedAngle>& animated1, Ref<SVGAnimatedOrientType>& animated2, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGAnimatedAngleOrientAnimator(attributeName, animated1, animated2, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) final >+ { >+ auto pairFrom = SVGPropertyTraits<std::pair<SVGAngleValue, SVGMarkerOrientType>>::fromString(from); >+ auto pairTo = SVGPropertyTraits<std::pair<SVGAngleValue, SVGMarkerOrientType>>::fromString(to); >+ >+ m_animatedPropertyAnimator1->m_function.m_from = pairFrom.first; >+ m_animatedPropertyAnimator1->m_function.m_to = pairTo.first; >+ >+ m_animatedPropertyAnimator2->m_function.m_from = pairFrom.second; >+ m_animatedPropertyAnimator2->m_function.m_to = pairTo.second; >+ } >+ >+ void setFromAndByValues(SVGElement* targetElement, const String& from, const String& by) final >+ { >+ setFromAndToValues(targetElement, from, by); >+ if (m_animatedPropertyAnimator2->m_function.m_from != SVGMarkerOrientAngle || m_animatedPropertyAnimator2->m_function.m_to != SVGMarkerOrientAngle) >+ return; >+ m_animatedPropertyAnimator1->m_function.addFromAndToValues(targetElement); >+ } >+ >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) final >+ { >+ if (m_animatedPropertyAnimator2->m_function.m_from != m_animatedPropertyAnimator2->m_function.m_to) { >+ // Discrete animation - no linear interpolation possible between values (e.g. auto to angle). >+ m_animatedPropertyAnimator2->progress(targetElement, percentage, repeatCount); >+ >+ SVGAngleValue animatedAngle; >+ if (percentage < 0.5f && m_animatedPropertyAnimator2->m_function.m_from == SVGMarkerOrientAngle) >+ animatedAngle = m_animatedPropertyAnimator1->m_function.m_from; >+ else if (percentage >= 0.5f && m_animatedPropertyAnimator2->m_function.m_to == SVGMarkerOrientAngle) >+ animatedAngle = m_animatedPropertyAnimator1->m_function.m_to; >+ >+ m_animatedPropertyAnimator1->m_animated->setAnimVal(animatedAngle); >+ return; >+ } >+ >+ if (m_animatedPropertyAnimator2->m_function.m_from == SVGMarkerOrientAngle) { >+ // Regular from- toangle animation, with support for smooth interpolation, and additive and accumulated animation. >+ m_animatedPropertyAnimator2->m_animated->setAnimVal(SVGMarkerOrientAngle); >+ >+ m_animatedPropertyAnimator1->progress(targetElement, percentage, repeatCount); >+ return; >+ } >+ >+ // auto, auto-start-reverse, or unknown. >+ m_animatedPropertyAnimator1->m_animated->animVal()->value().setValue(0); >+ >+ if (m_animatedPropertyAnimator2->m_function.m_from == SVGMarkerOrientAuto || m_animatedPropertyAnimator2->m_function.m_from == SVGMarkerOrientAutoStartReverse) >+ m_animatedPropertyAnimator2->m_animated->setAnimVal(m_animatedPropertyAnimator2->m_function.m_from); >+ else >+ m_animatedPropertyAnimator2->m_animated->setAnimVal(SVGMarkerOrientUnknown); >+ } >+ >+ void stop(SVGElement* targetElement) final >+ { >+ if (!m_animatedPropertyAnimator1->m_animated->isAnimating()) >+ return; >+ apply(targetElement); >+ Base::stop(targetElement); >+ } >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h b/Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h >deleted file mode 100644 >index 20ce5e58315..00000000000 >--- a/Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h >+++ /dev/null >@@ -1,120 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010. All rights reserved. >- * Copyright (C) 2016 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 "SVGAnimatedProperty.h" >-#include "SVGPropertyTearOff.h" >- >-namespace WebCore { >- >-template<typename T> >-class SVGAnimatedPropertyTearOff final : public SVGAnimatedProperty { >-public: >- using PropertyTearOff = T; >- using PropertyType = typename PropertyTearOff::PropertyType; >- using ContentType = PropertyType; >- >- static Ref<SVGAnimatedPropertyTearOff<PropertyTearOff>> create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& property) >- { >- ASSERT(contextElement); >- return adoptRef(*new SVGAnimatedPropertyTearOff<PropertyTearOff>(contextElement, attributeName, animatedPropertyType, property)); >- } >- >- Ref<PropertyTearOff> baseVal() >- { >- if (m_baseVal) >- return *static_cast<PropertyTearOff*>(m_baseVal.get()); >- >- auto property = PropertyTearOff::create(*this, BaseValRole, m_property); >- m_baseVal = makeWeakPtr(property.get()); >- return property; >- } >- >- Ref<PropertyTearOff> animVal() >- { >- if (m_animVal) >- return *static_cast<PropertyTearOff*>(m_animVal.get()); >- >- auto property = PropertyTearOff::create(*this, AnimValRole, m_property); >- m_animVal = makeWeakPtr(property.get()); >- return property; >- } >- >- bool isAnimating() const final { return m_animatedProperty; } >- >- PropertyType& currentAnimatedValue() >- { >- ASSERT(isAnimating()); >- return m_animatedProperty->propertyReference(); >- } >- >- const PropertyType& currentBaseValue() const >- { >- return m_property; >- } >- >- void animationStarted(PropertyType* newAnimVal) >- { >- ASSERT(!isAnimating()); >- ASSERT(newAnimVal); >- m_animatedProperty = animVal(); >- m_animatedProperty->setValue(*newAnimVal); >- } >- >- void animationEnded() >- { >- ASSERT(isAnimating()); >- m_animatedProperty->setValue(m_property); >- m_animatedProperty = nullptr; >- } >- >- void animValWillChange() >- { >- // no-op for non list types. >- ASSERT(isAnimating()); >- } >- >- void animValDidChange() >- { >- // no-op for non list types. >- ASSERT(isAnimating()); >- } >- >- void synchronizeWrappersIfNeeded() >- { >- // no-op >- } >- >-private: >- SVGAnimatedPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& property) >- : SVGAnimatedProperty(contextElement, attributeName, animatedPropertyType) >- , m_property(property) >- { >- } >- >- PropertyType& m_property; >- WeakPtr<SVGPropertyTearOff<PropertyType>> m_baseVal; >- WeakPtr<SVGPropertyTearOff<PropertyType>> m_animVal; >- >- RefPtr<PropertyTearOff> m_animatedProperty; >-}; >- >-} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h b/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h >deleted file mode 100644 >index 27faa7c3c18..00000000000 >--- a/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h >+++ /dev/null >@@ -1,114 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. >- * Copyright (C) 2016 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 "ExceptionOr.h" >-#include "SVGAnimatedProperty.h" >- >-namespace WebCore { >- >-template<typename PropertyType> >-class SVGAnimatedStaticPropertyTearOff : public SVGAnimatedProperty { >-public: >- typedef PropertyType ContentType; >- >- virtual const PropertyType& baseVal() >- { >- return m_property; >- } >- >- virtual const PropertyType& animVal() >- { >- if (m_animatedProperty) >- return *m_animatedProperty; >- return m_property; >- } >- >- virtual ExceptionOr<void> setBaseVal(const PropertyType& property) >- { >- m_property = property; >- commitChange(); >- return { }; >- } >- >- bool isAnimating() const override { return m_animatedProperty; } >- >- static Ref<SVGAnimatedStaticPropertyTearOff<PropertyType>> create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& property) >- { >- ASSERT(contextElement); >- return adoptRef(*new SVGAnimatedStaticPropertyTearOff<PropertyType>(contextElement, attributeName, animatedPropertyType, property)); >- } >- >- PropertyType& currentAnimatedValue() >- { >- ASSERT(isAnimating()); >- return *m_animatedProperty; >- } >- >- const PropertyType& currentBaseValue() const >- { >- return m_property; >- } >- >- void animationStarted(PropertyType* newAnimVal) >- { >- ASSERT(!isAnimating()); >- ASSERT(newAnimVal); >- m_animatedProperty = newAnimVal; >- } >- >- void animationEnded() >- { >- ASSERT(isAnimating()); >- m_animatedProperty = nullptr; >- } >- >- void animValWillChange() >- { >- // no-op for non list types. >- ASSERT(isAnimating()); >- } >- >- void animValDidChange() >- { >- // no-op for non list types. >- ASSERT(isAnimating()); >- } >- >- void synchronizeWrappersIfNeeded() >- { >- // no-op >- } >- >-protected: >- SVGAnimatedStaticPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& property) >- : SVGAnimatedProperty(contextElement, attributeName, animatedPropertyType) >- , m_property(property) >- , m_animatedProperty(nullptr) >- { >- } >- >-private: >- PropertyType& m_property; >- PropertyType* m_animatedProperty; >-}; >- >-} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedTransformListPropertyTearOff.h b/Source/WebCore/svg/properties/SVGAnimatedTransformListPropertyTearOff.h >deleted file mode 100644 >index 33972024691..00000000000 >--- a/Source/WebCore/svg/properties/SVGAnimatedTransformListPropertyTearOff.h >+++ /dev/null >@@ -1,62 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010. 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 "SVGTransformList.h" >- >-namespace WebCore { >- >-class SVGAnimatedTransformListPropertyTearOff final : public SVGAnimatedListPropertyTearOff<SVGTransformListValues> { >-public: >- static Ref<SVGAnimatedTransformListPropertyTearOff> create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGTransformListValues& values) >- { >- ASSERT(contextElement); >- return adoptRef(*new SVGAnimatedTransformListPropertyTearOff(contextElement, attributeName, animatedPropertyType, values)); >- } >- >- Ref<ListPropertyTearOff> baseVal() final >- { >- if (m_baseVal) >- return *static_cast<ListPropertyTearOff*>(m_baseVal.get()); >- >- auto property = SVGTransformList::create(*this, BaseValRole, m_values, m_wrappers); >- m_baseVal = makeWeakPtr(property.get()); >- return property; >- } >- >- Ref<ListPropertyTearOff> animVal() final >- { >- if (m_animVal) >- return *static_cast<ListPropertyTearOff*>(m_animVal.get()); >- >- auto property = SVGTransformList::create(*this, AnimValRole, m_values, m_wrappers); >- m_animVal = makeWeakPtr(property.get()); >- return property; >- } >- >-private: >- SVGAnimatedTransformListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGTransformListValues& values) >- : SVGAnimatedListPropertyTearOff<SVGTransformListValues>(contextElement, attributeName, animatedPropertyType, values) >- { >- } >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/properties/SVGAnimatedValueProperty.h b/Source/WebCore/svg/properties/SVGAnimatedValueProperty.h >new file mode 100644 >index 00000000000..8b78b095201 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimatedValueProperty.h >@@ -0,0 +1,162 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimatedProperty.h" >+ >+namespace WebCore { >+ >+template<typename PropertyType> >+class SVGAnimatedValueProperty : public SVGAnimatedProperty { >+public: >+ using ValueType = typename PropertyType::ValueType; >+ >+ template<typename... Arguments> >+ static Ref<SVGAnimatedValueProperty> create(SVGElement* contextElement, Arguments&&... arguments) >+ { >+ return adoptRef(*new SVGAnimatedValueProperty(contextElement, std::forward<Arguments>(arguments)...)); >+ } >+ >+ ~SVGAnimatedValueProperty() >+ { >+ m_baseVal->detach(); >+ if (m_animVal) >+ m_animVal->detach(); >+ } >+ >+ // Used by SVGElement::parseAttribute(). >+ void setBaseValInternal(const ValueType& baseVal) >+ { >+ m_baseVal->setValue(baseVal); >+ if (m_animVal) >+ m_animVal->setValue(baseVal); >+ } >+ >+ // Used by the DOM. >+ const Ref<PropertyType>& baseVal() const { return m_baseVal; } >+ >+ Ref<PropertyType>& baseVal() { return m_baseVal; } >+ >+ // Used by SVGAnimator::progress. >+ void setAnimVal(const ValueType& animVal) >+ { >+ ASSERT(isAnimating() && m_animVal); >+ m_animVal->setValue(animVal); >+ } >+ >+ // Used by the DOM. >+ const RefPtr<PropertyType>& animVal() const { return const_cast<SVGAnimatedValueProperty*>(this)->ensureAnimVal(); } >+ >+ // Called by SVGAnimatedPropertyAnimator to pass the animVal to the SVGAnimationFunction::progress. >+ RefPtr<PropertyType>& animVal() { return ensureAnimVal(); } >+ >+ // Used when committing a change from the SVGAnimatedProperty to the attribute. >+ String baseValAsString() const override { return m_baseVal->valueAsString(); } >+ >+ // Used to apply the SVGAnimator change to the target element. >+ String animValAsString() const override >+ { >+ ASSERT(isAnimating() && m_animVal); >+ return m_animVal->valueAsString(); >+ } >+ >+ // Managing the relationship with the owner. >+ void setDirty() override { m_baseVal->setDirty(); } >+ bool isDirty() const override { return m_baseVal->isDirty(); } >+ std::optional<String> synchronize() override { return m_baseVal->synchronize(); } >+ >+ // Used by RenderSVGElements and DumpRenderTree. >+ const ValueType& currentValue() const >+ { >+ ASSERT_IMPLIES(isAnimating(), m_animVal); >+ return (isAnimating() ? *m_animVal : m_baseVal.get()).value(); >+ } >+ >+ // Controlling the animation. >+ void startAnimation() override >+ { >+ if (m_animVal) >+ m_animVal->setValue(m_baseVal->value()); >+ else >+ ensureAnimVal(); >+ SVGAnimatedProperty::startAnimation(); >+ } >+ void stopAnimation() override >+ { >+ if (m_animVal) >+ m_animVal->setValue(m_baseVal->value()); >+ SVGAnimatedProperty::stopAnimation(); >+ } >+ >+ // Controlling the instance animation. >+ void instanceStartAnimation(SVGAnimatedProperty& animated) override >+ { >+ m_animVal = static_cast<SVGAnimatedValueProperty&>(animated).animVal(); >+ SVGAnimatedProperty::instanceStartAnimation(animated); >+ } >+ void instanceStopAnimation() override >+ { >+ m_animVal = nullptr; >+ SVGAnimatedProperty::instanceStopAnimation(); >+ } >+ >+protected: >+ // The packed arguments are used in PropertyType creation, for example passing >+ // SVGLengthMode to SVGLength. >+ template<typename... Arguments> >+ SVGAnimatedValueProperty(SVGElement* contextElement, Arguments&&... arguments) >+ : SVGAnimatedProperty(contextElement) >+ , m_baseVal(PropertyType::create(this, SVGPropertyAccess::ReadWrite, ValueType(std::forward<Arguments>(arguments)...))) >+ { >+ } >+ >+ template<typename... Arguments> >+ SVGAnimatedValueProperty(SVGElement* contextElement, SVGPropertyAccess access, Arguments&&... arguments) >+ : SVGAnimatedProperty(contextElement) >+ , m_baseVal(PropertyType::create(this, access, ValueType(std::forward<Arguments>(arguments)...))) >+ { >+ } >+ >+ RefPtr<PropertyType>& ensureAnimVal() >+ { >+ if (!m_animVal) >+ m_animVal = PropertyType::create(this, SVGPropertyAccess::ReadOnly, m_baseVal->value()); >+ return m_animVal; >+ } >+ >+ // Called when m_baseVal changes. >+ void commitPropertyChange(SVGProperty* property) override >+ { >+ if (m_animVal) >+ m_animVal->setValue(m_baseVal->value()); >+ SVGAnimatedProperty::commitPropertyChange(property); >+ } >+ >+ Ref<PropertyType> m_baseVal; >+ mutable RefPtr<PropertyType> m_animVal; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimationAdditiveFunction.h b/Source/WebCore/svg/properties/SVGAnimationAdditiveFunction.h >new file mode 100644 >index 00000000000..d47ffd518fb >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimationAdditiveFunction.h >@@ -0,0 +1,76 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimationFunction.h" >+ >+namespace WebCore { >+ >+class SVGAnimationAdditiveFunction : public SVGAnimationFunction { >+public: >+ SVGAnimationAdditiveFunction(AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ : SVGAnimationFunction(animationMode) >+ , m_calcMode(calcMode) >+ , m_isAccumulated(isAccumulated) >+ , m_isAdditive(isAdditive) >+ { >+ } >+ >+ void setFromAndByValues(SVGElement* targetElement, const String& from, const String& by) override >+ { >+ setFromAndToValues(targetElement, from, by); >+ addFromAndToValues(targetElement); >+ } >+ >+ void setToAtEndOfDurationValue(const String&) override >+ { >+ ASSERT_NOT_REACHED(); >+ } >+ >+protected: >+ float progress(float percentage, unsigned repeatCount, float from, float to, float toAtEndOfDuration, float animated) >+ { >+ float number; >+ if (m_calcMode == CalcMode::Discrete) >+ number = percentage < 0.5 ? from : to; >+ else >+ number = (to - from) * percentage + from; >+ >+ if (m_isAccumulated && repeatCount) >+ number += toAtEndOfDuration * repeatCount; >+ >+ if (m_isAdditive && m_animationMode != AnimationMode::To) >+ number += animated; >+ >+ return number; >+ } >+ >+ CalcMode m_calcMode; >+ bool m_isAccumulated; >+ bool m_isAdditive; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimationAdditiveListFunction.h b/Source/WebCore/svg/properties/SVGAnimationAdditiveListFunction.h >new file mode 100644 >index 00000000000..164b9e27619 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimationAdditiveListFunction.h >@@ -0,0 +1,70 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimationAdditiveFunction.h" >+ >+namespace WebCore { >+ >+template<typename ListType> >+class SVGAnimationAdditiveListFunction : public SVGAnimationAdditiveFunction { >+public: >+ template<typename... Arguments> >+ SVGAnimationAdditiveListFunction(AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive, Arguments&&... arguments) >+ : SVGAnimationAdditiveFunction(animationMode, calcMode, isAccumulated, isAdditive) >+ , m_from(ListType::create(std::forward<Arguments>(arguments)...)) >+ , m_to(ListType::create(std::forward<Arguments>(arguments)...)) >+ , m_toAtEndOfDuration(ListType::create(std::forward<Arguments>(arguments)...)) >+ { >+ } >+ >+protected: >+ const Ref<ListType>& toAtEndOfDuration() const { return !m_toAtEndOfDuration->isEmpty() ? m_toAtEndOfDuration : m_to; } >+ >+ bool adjustAnimatedList(AnimationMode animationMode, float percentage, RefPtr<ListType>& animated, bool resizeAnimatedIfNeeded = true) >+ { >+ if (!m_to->numberOfItems()) >+ return false; >+ >+ if (m_from->numberOfItems() && m_from->size() != m_to->size()) { >+ if (percentage >= 0.5) >+ *animated = m_to; >+ else if (animationMode != AnimationMode::To) >+ *animated = m_from; >+ return false; >+ } >+ >+ if (resizeAnimatedIfNeeded && animated->size() < m_to->size()) >+ animated->resize(m_to->size()); >+ return true; >+ } >+ >+ Ref<ListType> m_from; >+ Ref<ListType> m_to; >+ Ref<ListType> m_toAtEndOfDuration; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimationAdditiveListFunctionImpl.h b/Source/WebCore/svg/properties/SVGAnimationAdditiveListFunctionImpl.h >new file mode 100644 >index 00000000000..5948cd8ee1b >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimationAdditiveListFunctionImpl.h >@@ -0,0 +1,277 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAngleValue.h" >+#include "SVGAnimationAdditiveListFunction.h" >+#include "SVGLengthContext.h" >+#include "SVGLengthList.h" >+#include "SVGLengthValue.h" >+#include "SVGNumberList.h" >+#include "SVGPointList.h" >+#include "SVGTransformDistance.h" >+#include "SVGTransformList.h" >+ >+namespace WebCore { >+ >+class SVGElement; >+ >+class SVGAnimationLengthListFunction : public SVGAnimationAdditiveListFunction<SVGLengthList> { >+ using Base = SVGAnimationAdditiveListFunction<SVGLengthList>; >+ >+public: >+ SVGAnimationLengthListFunction(AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive, SVGLengthMode lengthMode) >+ : Base(animationMode, calcMode, isAccumulated, isAdditive, lengthMode) >+ { >+ } >+ >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) override >+ { >+ m_from->parse(from); >+ m_to->parse(to); >+ } >+ >+ void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override >+ { >+ m_toAtEndOfDuration->parse(toAtEndOfDuration); >+ } >+ >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount, RefPtr<SVGLengthList>& animated) >+ { >+ if (!adjustAnimatedList(m_animationMode, percentage, animated)) >+ return; >+ >+ const Vector<Ref<SVGLength>>& fromItems = m_animationMode == AnimationMode::To ? animated->items() : m_from->items(); >+ const Vector<Ref<SVGLength>>& toItems = m_to->items(); >+ const Vector<Ref<SVGLength>>& toAtEndOfDurationItems = toAtEndOfDuration()->items(); >+ Vector<Ref<SVGLength>>& animatedItems = animated->items(); >+ SVGLengthMode lengthMode = animated->lengthMode(); >+ >+ SVGLengthContext lengthContext(targetElement); >+ for (unsigned i = 0; i < toItems.size(); ++i) { >+ SVGLengthType unitType = (i < fromItems.size() && percentage < 0.5 ? fromItems : toItems)[i]->value().unitType(); >+ >+ float from = i < fromItems.size() ? fromItems[i]->value().value(lengthContext) : 0; >+ float to = toItems[i]->value().value(lengthContext); >+ float toAtEndOfDuration = i < toAtEndOfDurationItems.size() ? toAtEndOfDurationItems[i]->value().value(lengthContext) : 0; >+ float value = animatedItems[i]->value().value(lengthContext); >+ >+ value = Base::progress(percentage, repeatCount, from, to, toAtEndOfDuration, value); >+ animatedItems[i]->value().setValue(lengthContext, value, lengthMode, unitType); >+ } >+ } >+ >+private: >+ void addFromAndToValues(SVGElement* targetElement) override >+ { >+ const Vector<Ref<SVGLength>>& fromItems = m_from->items(); >+ const Vector<Ref<SVGLength>>& toItems = m_to->items(); >+ >+ if (!fromItems.size() || fromItems.size() != toItems.size()) >+ return; >+ >+ SVGLengthContext lengthContext(targetElement); >+ for (unsigned i = 0; i < fromItems.size(); ++i) { >+ const SVGLengthValue& fromValue = fromItems[i]->value(); >+ SVGLengthValue& toValue = toItems[i]->value(); >+ toValue.setValue(toValue.value(lengthContext) + fromValue.value(lengthContext), lengthContext); >+ } >+ } >+}; >+ >+class SVGAnimationNumberListFunction : public SVGAnimationAdditiveListFunction<SVGNumberList> { >+public: >+ using Base = SVGAnimationAdditiveListFunction<SVGNumberList>; >+ using Base::Base; >+ >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) override >+ { >+ m_from->parse(from); >+ m_to->parse(to); >+ } >+ >+ void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override >+ { >+ m_toAtEndOfDuration->parse(toAtEndOfDuration); >+ } >+ >+ void progress(SVGElement*, float percentage, unsigned repeatCount, RefPtr<SVGNumberList>& animated) >+ { >+ if (!adjustAnimatedList(m_animationMode, percentage, animated)) >+ return; >+ >+ const Vector<Ref<SVGNumber>>& fromItems = m_animationMode == AnimationMode::To ? animated->items() : m_from->items(); >+ const Vector<Ref<SVGNumber>>& toItems = m_to->items(); >+ const Vector<Ref<SVGNumber>>& toAtEndOfDurationItems = toAtEndOfDuration()->items(); >+ Vector<Ref<SVGNumber>>& animatedItems = animated->items(); >+ >+ for (unsigned i = 0; i < toItems.size(); ++i) { >+ float from = i < fromItems.size() ? fromItems[i]->value() : 0; >+ float to = toItems[i]->value(); >+ float toAtEndOfDuration = i < toAtEndOfDurationItems.size() ? toAtEndOfDurationItems[i]->value() : 0; >+ >+ float& value = animatedItems[i]->value(); >+ value = Base::progress(percentage, repeatCount, from, to, toAtEndOfDuration, value); >+ } >+ } >+ >+private: >+ void addFromAndToValues(SVGElement*) override >+ { >+ const Vector<Ref<SVGNumber>>& fromItems = m_from->items(); >+ Vector<Ref<SVGNumber>>& toItems = m_to->items(); >+ >+ if (!fromItems.size() || fromItems.size() != toItems.size()) >+ return; >+ >+ for (unsigned i = 0; i < fromItems.size(); ++i) >+ toItems[i]->setValue(fromItems[i]->value() + toItems[i]->value()); >+ } >+}; >+ >+class SVGAnimationPointListFunction : public SVGAnimationAdditiveListFunction<SVGPointList> { >+public: >+ using Base = SVGAnimationAdditiveListFunction<SVGPointList>; >+ using Base::Base; >+ >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) override >+ { >+ m_from->parse(from); >+ m_to->parse(to); >+ } >+ >+ void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override >+ { >+ m_toAtEndOfDuration->parse(toAtEndOfDuration); >+ } >+ >+ void progress(SVGElement*, float percentage, unsigned repeatCount, RefPtr<SVGPointList>& animated) >+ { >+ if (!adjustAnimatedList(m_animationMode, percentage, animated)) >+ return; >+ >+ const Vector<Ref<SVGPoint>>& fromItems = m_animationMode == AnimationMode::To ? animated->items() : m_from->items(); >+ const Vector<Ref<SVGPoint>>& toItems = m_to->items(); >+ const Vector<Ref<SVGPoint>>& toAtEndOfDurationItems = toAtEndOfDuration()->items(); >+ Vector<Ref<SVGPoint>>& animatedItems = animated->items(); >+ >+ for (unsigned i = 0; i < toItems.size(); ++i) { >+ FloatPoint from = i < fromItems.size() ? fromItems[i]->value() : FloatPoint(); >+ FloatPoint to = toItems[i]->value(); >+ FloatPoint toAtEndOfDuration = i < toAtEndOfDurationItems.size() ? toAtEndOfDurationItems[i]->value() : FloatPoint(); >+ FloatPoint& animated = animatedItems[i]->value(); >+ >+ float animatedX = Base::progress(percentage, repeatCount, from.x(), to.x(), toAtEndOfDuration.x(), animated.x()); >+ float animatedY = Base::progress(percentage, repeatCount, from.y(), to.y(), toAtEndOfDuration.y(), animated.y()); >+ >+ animated = { animatedX, animatedY }; >+ } >+ } >+ >+private: >+ void addFromAndToValues(SVGElement*) override >+ { >+ const Vector<Ref<SVGPoint>>& fromItems = m_from->items(); >+ Vector<Ref<SVGPoint>>& toItems = m_to->items(); >+ >+ if (!fromItems.size() || fromItems.size() != toItems.size()) >+ return; >+ >+ for (unsigned i = 0; i < fromItems.size(); ++i) >+ toItems[i]->setValue(fromItems[i]->value() + toItems[i]->value()); >+ } >+}; >+ >+class SVGAnimationTransformListFunction : public SVGAnimationAdditiveListFunction<SVGTransformList> { >+public: >+ using Base = SVGAnimationAdditiveListFunction<SVGTransformList>; >+ using Base::Base; >+ >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) override >+ { >+ m_from->parse(from); >+ m_to->parse(to); >+ } >+ >+ void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override >+ { >+ m_toAtEndOfDuration->parse(toAtEndOfDuration); >+ } >+ >+ void progress(SVGElement*, float percentage, unsigned repeatCount, RefPtr<SVGTransformList>& animated) >+ { >+ // Pass false to 'resizeAnimatedIfNeeded', as the special post-multiplication behavior of <animateTransform> needs to be respected below. >+ if (!adjustAnimatedList(m_animationMode, percentage, animated, false)) >+ return; >+ >+ // Spec: To animations provide specific functionality to get a smooth change from the underlying >+ // value to the ‘to’ attribute value, which conflicts mathematically with the requirement for >+ // additive transform animations to be post-multiplied. As a consequence, in SVG 1.1 the behavior >+ // of to animations for ‘animateTransform’ is undefined. >+ const Vector<Ref<SVGTransform>>& fromItems = m_from->items(); >+ const Vector<Ref<SVGTransform>>& toItems = m_to->items(); >+ const Vector<Ref<SVGTransform>>& toAtEndOfDurationItems = toAtEndOfDuration()->items(); >+ Vector<Ref<SVGTransform>>& animatedItems = animated->items(); >+ >+ // Never resize the animatedList to the m_to size, instead either clear the list >+ // or append to it. >+ if (!animatedItems.isEmpty() && (!m_isAdditive || m_animationMode == AnimationMode::To)) >+ animatedItems.clear(); >+ >+ auto fromItemsSize = fromItems.size(); >+ >+ static const AffineTransform zerosAffineTransform = { 0, 0, 0, 0, 0, 0 }; >+ const SVGTransformValue& to = toItems[0]->value(); >+ const SVGTransformValue zerosTransform = SVGTransformValue(to.type(), zerosAffineTransform); >+ >+ const SVGTransformValue& from = fromItemsSize ? fromItems[0]->value() : zerosTransform; >+ SVGTransformValue current = SVGTransformDistance(from, to).scaledDistance(percentage).addToSVGTransform(from); >+ >+ if (m_isAccumulated && repeatCount) { >+ const SVGTransformValue& toAtEndOfDuration = toAtEndOfDurationItems.size() ? toAtEndOfDurationItems[0]->value() : zerosTransform; >+ animatedItems.append(SVGTransform::create(SVGTransformDistance::addSVGTransforms(current, toAtEndOfDuration, repeatCount))); >+ } else >+ animatedItems.append(SVGTransform::create(current)); >+ } >+ >+private: >+ void addFromAndToValues(SVGElement*) override >+ { >+ const Vector<Ref<SVGTransform>>& fromItems = m_from->items(); >+ Vector<Ref<SVGTransform>>& toItems = m_to->items(); >+ >+ if (!fromItems.size() || fromItems.size() != toItems.size()) >+ return; >+ >+ ASSERT(fromItems.size() == 1); >+ const Ref<SVGTransform>& from = fromItems[0]; >+ Ref<SVGTransform>& to = toItems[0]; >+ >+ to->setValue(SVGTransformDistance::addSVGTransforms(from->value(), to->value())); >+ } >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunction.h b/Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunction.h >new file mode 100644 >index 00000000000..8709bcc81dc >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunction.h >@@ -0,0 +1,45 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimationAdditiveFunction.h" >+ >+namespace WebCore { >+ >+template<typename ValueType> >+class SVGAnimationAdditiveValueFunction : public SVGAnimationAdditiveFunction { >+public: >+ using SVGAnimationAdditiveFunction::SVGAnimationAdditiveFunction; >+ >+protected: >+ ValueType toAtEndOfDuration() const { return m_toAtEndOfDuration ? *m_toAtEndOfDuration : m_to; } >+ >+ ValueType m_from; >+ ValueType m_to; >+ std::optional<ValueType> m_toAtEndOfDuration; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp b/Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp >similarity index 51% >rename from Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp >rename to Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp >index fd6e1f203a5..26fc77093d3 100644 >--- a/Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp >+++ b/Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp >@@ -24,38 +24,21 @@ > */ > > #include "config.h" >-#include "SVGAnimatedPathSegListPropertyTearOff.h" >- >-#include "SVGPathElement.h" >+#include "SVGAnimationAdditiveValueFunctionImpl.h" > > namespace WebCore { > >-SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGPathSegListValues& values) >- : Base(contextElement, attributeName, animatedPropertyType, values) >+Color SVGAnimationColorFunction::colorFromString(SVGElement* targetElement, const String& string) > { >- ASSERT(contextElement); >- ASSERT(is<SVGPathElement>(contextElement)); >-} >+ static NeverDestroyed<const AtomicString> currentColor("currentColor", AtomicString::ConstructFromLiteral); > >-SVGAnimatedPathSegListPropertyTearOff::~SVGAnimatedPathSegListPropertyTearOff() >-{ >- downcast<SVGPathElement>(contextElement())->animatedPropertyWillBeDeleted(); >-} >+ if (string != currentColor.get()) >+ return SVGPropertyTraits<Color>::fromString(string); > >-void SVGAnimatedPathSegListPropertyTearOff::animValDidChange() >-{ >- ASSERT(m_animatedPathByteStream); >- auto pathElement = makeRefPtr(downcast<SVGPathElement>(contextElement())); >- >- // If the animVal is observed from JS, we have to update it on each animation step. >- // This is an expensive operation and only done if someone actually observes the animatedPathSegList() while an animation is running. >- if (pathElement->isAnimValObserved()) { >- auto& animatedList = currentAnimatedValue(); >- animatedList.clear(); >- buildSVGPathSegListValuesFromByteStream(*m_animatedPathByteStream, *pathElement, animatedList, UnalteredParsing); >- } >+ if (auto* renderer = targetElement->renderer()) >+ return renderer->style().visitedDependentColor(CSSPropertyColor); > >- Base::animValDidChange(); >+ return { }; > } >- >+ > } >diff --git a/Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.h b/Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.h >new file mode 100644 >index 00000000000..4b8a8705f69 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimationAdditiveValueFunctionImpl.h >@@ -0,0 +1,331 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimationAdditiveValueFunction.h" >+#include "SVGLengthContext.h" >+#include "SVGLengthList.h" >+#include "SVGPathByteStream.h" >+#include "SVGPropertyTraits.h" >+ >+namespace WebCore { >+ >+class SVGAnimationNumberFunction : public SVGAnimationAdditiveValueFunction<float> { >+ friend class SVGAnimatedNumberPairAnimator; >+ >+public: >+ using Base = SVGAnimationAdditiveValueFunction<float>; >+ using Base::Base; >+ >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) override >+ { >+ m_from = SVGPropertyTraits<float>::fromString(from); >+ m_to = SVGPropertyTraits<float>::fromString(to); >+ } >+ >+ void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override >+ { >+ m_toAtEndOfDuration = SVGPropertyTraits<float>::fromString(toAtEndOfDuration); >+ } >+ >+ void progress(SVGElement*, float percentage, unsigned repeatCount, float& animated) >+ { >+ float from = m_animationMode == AnimationMode::To ? animated : m_from; >+ animated = Base::progress(percentage, repeatCount, from, m_to, toAtEndOfDuration(), animated); >+ } >+ >+ float calculateDistance(SVGElement*, const String& from, const String& to) const override >+ { >+ float fromNumber = 0; >+ float toNumber = 0; >+ parseNumberFromString(from, fromNumber); >+ parseNumberFromString(to, toNumber); >+ return fabsf(toNumber - fromNumber); >+ } >+ >+private: >+ void addFromAndToValues(SVGElement*) override >+ { >+ m_to += m_from; >+ } >+}; >+ >+class SVGAnimationIntegerFunction : public SVGAnimationAdditiveValueFunction<int> { >+ friend class SVGAnimatedIntegerPairAnimator; >+ >+public: >+ using Base = SVGAnimationAdditiveValueFunction<int>; >+ using Base::Base; >+ >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) override >+ { >+ m_from = SVGPropertyTraits<int>::fromString(from); >+ m_to = SVGPropertyTraits<int>::fromString(to); >+ } >+ >+ void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override >+ { >+ m_toAtEndOfDuration = SVGPropertyTraits<int>::fromString(toAtEndOfDuration); >+ } >+ >+ void progress(SVGElement*, float percentage, unsigned repeatCount, int& animated) >+ { >+ animated = static_cast<int>(roundf(Base::progress(percentage, repeatCount, m_from, m_to, toAtEndOfDuration(), animated))); >+ } >+ >+ float calculateDistance(SVGElement*, const String& from, const String& to) const override >+ { >+ return std::abs(to.toIntStrict() - from.toIntStrict()); >+ } >+ >+private: >+ void addFromAndToValues(SVGElement*) override >+ { >+ m_to += m_from; >+ } >+}; >+ >+class SVGAnimationRectFunction : public SVGAnimationAdditiveValueFunction<FloatRect> { >+public: >+ using Base = SVGAnimationAdditiveValueFunction<FloatRect>; >+ using Base::Base; >+ >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) override >+ { >+ m_from = SVGPropertyTraits<FloatRect>::fromString(from); >+ m_to = SVGPropertyTraits<FloatRect>::fromString(to); >+ } >+ >+ void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override >+ { >+ m_toAtEndOfDuration = SVGPropertyTraits<FloatRect>::fromString(toAtEndOfDuration); >+ } >+ >+ void progress(SVGElement*, float percentage, unsigned repeatCount, FloatRect& animated) >+ { >+ FloatRect from = m_animationMode == AnimationMode::To ? animated : m_from; >+ >+ float x = Base::progress(percentage, repeatCount, from.x(), m_to.x(), toAtEndOfDuration().x(), animated.x()); >+ float y = Base::progress(percentage, repeatCount, from.y(), m_to.y(), toAtEndOfDuration().y(), animated.y()); >+ float width = Base::progress(percentage, repeatCount, from.width(), m_to.width(), toAtEndOfDuration().width(), animated.width()); >+ float height = Base::progress(percentage, repeatCount, from.height(), m_to.height(), toAtEndOfDuration().height(), animated.height()); >+ >+ animated = { x, y, width, height }; >+ } >+ >+private: >+ void addFromAndToValues(SVGElement*) override >+ { >+ m_to += m_from; >+ } >+}; >+ >+class SVGAnimationColorFunction : public SVGAnimationAdditiveValueFunction<Color> { >+public: >+ using Base = SVGAnimationAdditiveValueFunction<Color>; >+ using Base::Base; >+ >+ void setFromAndToValues(SVGElement* targetElement, const String& from, const String& to) override >+ { >+ m_from = colorFromString(targetElement, from); >+ m_to = colorFromString(targetElement, to); >+ } >+ >+ void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override >+ { >+ m_toAtEndOfDuration = SVGPropertyTraits<Color>::fromString(toAtEndOfDuration); >+ } >+ >+ void progress(SVGElement*, float percentage, unsigned repeatCount, Color& animated) >+ { >+ Color from = m_animationMode == AnimationMode::To ? animated : m_from; >+ >+ float red = Base::progress(percentage, repeatCount, from.red(), m_to.red(), toAtEndOfDuration().red(), animated.red()); >+ float green = Base::progress(percentage, repeatCount, from.green(), m_to.green(), toAtEndOfDuration().green(), animated.green()); >+ float blue = Base::progress(percentage, repeatCount, from.blue(), m_to.blue(), toAtEndOfDuration().blue(), animated.blue()); >+ float alpha = Base::progress(percentage, repeatCount, from.alpha(), m_to.alpha(), toAtEndOfDuration().alpha(), animated.alpha()); >+ >+ animated = { roundAndClampColorChannel(red), roundAndClampColorChannel(green), roundAndClampColorChannel(blue), roundAndClampColorChannel(alpha) }; >+ } >+ >+ float calculateDistance(SVGElement*, const String& from, const String& to) const override >+ { >+ Color fromColor = CSSParser::parseColor(from.stripWhiteSpace()); >+ if (!fromColor.isValid()) >+ return -1; >+ Color toColor = CSSParser::parseColor(to.stripWhiteSpace()); >+ if (!toColor.isValid()) >+ return -1; >+ float red = fromColor.red() - toColor.red(); >+ float green = fromColor.green() - toColor.green(); >+ float blue = fromColor.blue() - toColor.blue(); >+ return sqrtf(red * red + green * green + blue * blue); >+ } >+ >+private: >+ void addFromAndToValues(SVGElement*) override >+ { >+ // Ignores any alpha and sets alpha on result to 100% opaque. >+ m_to = { >+ roundAndClampColorChannel(m_to.red() + m_from.red()), >+ roundAndClampColorChannel(m_to.green() + m_from.green()), >+ roundAndClampColorChannel(m_to.blue() + m_from.blue()) >+ }; >+ } >+ >+ static Color colorFromString(SVGElement*, const String&); >+}; >+ >+class SVGAnimationAngleFunction : public SVGAnimationAdditiveValueFunction<SVGAngleValue> { >+public: >+ using Base = SVGAnimationAdditiveValueFunction<SVGAngleValue>; >+ using Base::Base; >+ >+ void setFromAndToValues(SVGElement*, const String&, const String&) override >+ { >+ // Values will be set by SVGAnimatedAngleOrientAnimator. >+ ASSERT_NOT_REACHED(); >+ } >+ >+ void progress(SVGElement*, float percentage, unsigned repeatCount, SVGAngleValue& animated) >+ { >+ float number = animated.value(); >+ number = Base::progress(percentage, repeatCount, m_from.value(), m_to.value(), toAtEndOfDuration().value(), number); >+ animated.setValue(number); >+ } >+ >+private: >+ friend class SVGAnimatedAngleOrientAnimator; >+ >+ void addFromAndToValues(SVGElement*) override >+ { >+ m_to.setValue(m_to.value() + m_from.value()); >+ } >+}; >+ >+class SVGAnimationLengthFunction : public SVGAnimationAdditiveValueFunction<SVGLengthValue> { >+ using Base = SVGAnimationAdditiveValueFunction<SVGLengthValue>; >+ >+public: >+ SVGAnimationLengthFunction(AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive, SVGLengthMode lengthMode) >+ : Base(animationMode, calcMode, isAccumulated, isAdditive) >+ , m_lengthMode(lengthMode) >+ { >+ } >+ >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) override >+ { >+ m_from = SVGLengthValue(m_lengthMode, from); >+ m_to = SVGLengthValue(m_lengthMode, to); >+ } >+ >+ void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override >+ { >+ m_toAtEndOfDuration = SVGLengthValue(m_lengthMode, toAtEndOfDuration); >+ } >+ >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount, SVGLengthValue& animated) >+ { >+ SVGLengthContext lengthContext(targetElement); >+ SVGLengthType unitType = percentage < 0.5 ? m_from.unitType() : m_to.unitType(); >+ >+ float from = (m_animationMode == AnimationMode::To ? animated : m_from).value(lengthContext); >+ float to = m_to.value(lengthContext); >+ float toAtEndOfDuration = this->toAtEndOfDuration().value(lengthContext); >+ float value = animated.value(lengthContext); >+ >+ value = Base::progress(percentage, repeatCount, from, to, toAtEndOfDuration, value); >+ animated = { lengthContext, value, m_lengthMode, unitType }; >+ } >+ >+ float calculateDistance(SVGElement* targetElement, const String& from, const String& to) const override >+ { >+ SVGLengthContext lengthContext(targetElement); >+ auto fromLength = SVGLengthValue(m_lengthMode, from); >+ auto toLength = SVGLengthValue(m_lengthMode, to); >+ return fabsf(toLength.value(lengthContext) - fromLength.value(lengthContext)); >+ } >+ >+private: >+ void addFromAndToValues(SVGElement* targetElement) override >+ { >+ SVGLengthContext lengthContext(targetElement); >+ m_to.setValue(m_to.value(lengthContext) + m_from.value(lengthContext), lengthContext); >+ } >+ >+ SVGLengthMode m_lengthMode; >+}; >+ >+class SVGAnimationPathSegListFunction : public SVGAnimationAdditiveValueFunction<SVGPathByteStream> { >+public: >+ using Base = SVGAnimationAdditiveValueFunction<SVGPathByteStream>; >+ using Base::Base; >+ >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) override >+ { >+ m_from = SVGPropertyTraits<SVGPathByteStream>::fromString(from); >+ m_to = SVGPropertyTraits<SVGPathByteStream>::fromString(to); >+ } >+ >+ void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override >+ { >+ m_toAtEndOfDuration = SVGPropertyTraits<SVGPathByteStream>::fromString(toAtEndOfDuration); >+ } >+ >+ void progress(SVGElement*, float percentage, unsigned repeatCount, SVGPathByteStream& animated) >+ { >+ SVGPathByteStream underlyingPath; >+ if (m_animationMode == AnimationMode::To) >+ underlyingPath = animated; >+ >+ const SVGPathByteStream& from = m_animationMode == AnimationMode::To ? underlyingPath : m_from; >+ >+ // Cache the current animated value before the buildAnimatedSVGPathByteStream() clears animatedPath. >+ SVGPathByteStream lastAnimated; >+ if (!from.size() || (m_isAdditive && m_animationMode != AnimationMode::To)) >+ lastAnimated = animated; >+ >+ buildAnimatedSVGPathByteStream(from, m_to, animated, percentage); >+ >+ // Handle additive='sum'. >+ if (!lastAnimated.isEmpty()) >+ addToSVGPathByteStream(animated, lastAnimated); >+ >+ // Handle accumulate='sum'. >+ if (m_isAccumulated && repeatCount) >+ addToSVGPathByteStream(animated, toAtEndOfDuration(), repeatCount); >+ } >+ >+private: >+ void addFromAndToValues(SVGElement*) override >+ { >+ if (!m_from.size() || m_from.size() != m_to.size()) >+ return; >+ addToSVGPathByteStream(m_to, m_from); >+ } >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimationDiscreteFunction.h b/Source/WebCore/svg/properties/SVGAnimationDiscreteFunction.h >new file mode 100644 >index 00000000000..f1dd15bde1f >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimationDiscreteFunction.h >@@ -0,0 +1,63 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+namespace WebCore { >+ >+template<typename ValueType> >+class SVGAnimationDiscreteFunction : public SVGAnimationFunction { >+public: >+ SVGAnimationDiscreteFunction(AnimationMode animationMode, CalcMode, bool, bool) >+ : SVGAnimationFunction(animationMode) >+ { >+ } >+ >+ bool isDiscrete() const override { return true; } >+ >+ void setToAtEndOfDurationValue(const String&) override >+ { >+ ASSERT_NOT_REACHED(); >+ } >+ >+ void setFromAndByValues(SVGElement*, const String&, const String&) override >+ { >+ ASSERT_NOT_REACHED(); >+ } >+ >+ void progress(SVGElement*, float percentage, unsigned, ValueType& animated) >+ { >+ if ((m_animationMode == AnimationMode::FromTo && percentage > 0.5) || m_animationMode == AnimationMode::To || percentage == 1) >+ animated = m_to; >+ else >+ animated = m_from; >+ } >+ >+protected: >+ ValueType m_from; >+ ValueType m_to; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimationDiscreteFunctionImpl.h b/Source/WebCore/svg/properties/SVGAnimationDiscreteFunctionImpl.h >new file mode 100644 >index 00000000000..7c840963c15 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimationDiscreteFunctionImpl.h >@@ -0,0 +1,101 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimationDiscreteFunction.h" >+#include "SVGMarkerTypes.h" >+#include "SVGPropertyTraits.h" >+ >+namespace WebCore { >+ >+class SVGAnimationBooleanFunction : public SVGAnimationDiscreteFunction<bool> { >+public: >+ using Base = SVGAnimationDiscreteFunction<bool>; >+ using Base::Base; >+ >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) override >+ { >+ m_from = SVGPropertyTraits<bool>::fromString(from); >+ m_to = SVGPropertyTraits<bool>::fromString(to); >+ } >+}; >+ >+template<typename EnumType> >+class SVGAnimationEnumerationFunction : public SVGAnimationDiscreteFunction<EnumType> { >+ using Base = SVGAnimationDiscreteFunction<EnumType>; >+ using Base::m_from; >+ using Base::m_to; >+ >+public: >+ using Base::Base; >+ >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) override >+ { >+ m_from = SVGPropertyTraits<EnumType>::fromString(from); >+ m_to = SVGPropertyTraits<EnumType>::fromString(to); >+ } >+}; >+ >+class SVGAnimationPreserveAspectRatioFunction : public SVGAnimationDiscreteFunction<SVGPreserveAspectRatioValue> { >+public: >+ using Base = SVGAnimationDiscreteFunction<SVGPreserveAspectRatioValue>; >+ using Base::Base; >+ >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) override >+ { >+ m_from = SVGPreserveAspectRatioValue(from); >+ m_to = SVGPreserveAspectRatioValue(to); >+ } >+}; >+ >+class SVGAnimationStringFunction : public SVGAnimationDiscreteFunction<String> { >+public: >+ using Base = SVGAnimationDiscreteFunction<String>; >+ using Base::Base; >+ >+ void setFromAndToValues(SVGElement*, const String& from, const String& to) override >+ { >+ m_from = from; >+ m_to = to; >+ } >+}; >+ >+class SVGAnimationOrientTypeFunction : public SVGAnimationDiscreteFunction<SVGMarkerOrientType> { >+public: >+ using Base = SVGAnimationDiscreteFunction<SVGMarkerOrientType>; >+ using Base::Base; >+ >+ void setFromAndToValues(SVGElement*, const String&, const String&) override >+ { >+ // Values will be set by SVGAnimatedAngleOrientAnimator. >+ ASSERT_NOT_REACHED(); >+ } >+ >+private: >+ friend class SVGAnimatedAngleOrientAnimator; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimationFunction.h b/Source/WebCore/svg/properties/SVGAnimationFunction.h >new file mode 100644 >index 00000000000..61f7ab2657b >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimationFunction.h >@@ -0,0 +1,55 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+namespace WebCore { >+ >+class SVGElement; >+ >+class SVGAnimationFunction { >+public: >+ virtual ~SVGAnimationFunction() = default; >+ >+ virtual bool isDiscrete() const { return false; } >+ >+ virtual void setFromAndToValues(SVGElement* targetElement, const String&, const String&) = 0; >+ virtual void setFromAndByValues(SVGElement* targetElement, const String&, const String&) = 0; >+ virtual void setToAtEndOfDurationValue(const String&) = 0; >+ >+ virtual float calculateDistance(SVGElement*, const String&, const String&) const { return -1; } >+ >+protected: >+ SVGAnimationFunction(AnimationMode animationMode) >+ : m_animationMode(animationMode) >+ { >+ } >+ >+ virtual void addFromAndToValues(SVGElement*) { } >+ >+ AnimationMode m_animationMode; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimator.cpp b/Source/WebCore/svg/properties/SVGAnimator.cpp >new file mode 100644 >index 00000000000..bfa40b95d3b >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimator.cpp >@@ -0,0 +1,120 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "SVGAnimator.h" >+ >+#include "CSSComputedStyleDeclaration.h" >+#include "CSSPropertyParser.h" >+#include "SVGElement.h" >+ >+namespace WebCore { >+ >+bool SVGAnimator::isAnimatedStylePropertyAniamtor(const SVGElement* targetElement) const >+{ >+ return targetElement->isAnimatedStyleAttribute(m_attributeName); >+} >+ >+void SVGAnimator::applyAnimatedStylePropertyChange(SVGElement* element, CSSPropertyID id, const String& value) >+{ >+ ASSERT(element); >+ ASSERT(!element->m_deletionHasBegun); >+ >+ if (!element->ensureAnimatedSMILStyleProperties().setProperty(id, value, false)) >+ return; >+ element->invalidateStyleAndLayerComposition(); >+} >+ >+void SVGAnimator::applyAnimatedStylePropertyChange(SVGElement* targetElement, const String& value) >+{ >+ ASSERT(targetElement); >+ ASSERT(m_attributeName != anyQName()); >+ >+ // FIXME: Do we really need to check both isConnected and !parentNode? >+ if (!targetElement->isConnected() || !targetElement->parentNode()) >+ return; >+ >+ CSSPropertyID id = cssPropertyID(m_attributeName.localName()); >+ >+ SVGElement::InstanceUpdateBlocker blocker(*targetElement); >+ applyAnimatedStylePropertyChange(targetElement, id, value); >+ >+ // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. >+ for (auto* instance : targetElement->instances()) >+ applyAnimatedStylePropertyChange(instance, id, value); >+} >+ >+void SVGAnimator::removeAnimatedStyleProperty(SVGElement* element, CSSPropertyID id) >+{ >+ ASSERT(element); >+ ASSERT(!element->m_deletionHasBegun); >+ >+ element->ensureAnimatedSMILStyleProperties().removeProperty(id); >+ element->invalidateStyleAndLayerComposition(); >+} >+ >+void SVGAnimator::removeAnimatedStyleProperty(SVGElement* targetElement) >+{ >+ ASSERT(targetElement); >+ ASSERT(m_attributeName != anyQName()); >+ >+ // FIXME: Do we really need to check both isConnected and !parentNode? >+ if (!targetElement->isConnected() || !targetElement->parentNode()) >+ return; >+ >+ CSSPropertyID id = cssPropertyID(m_attributeName.localName()); >+ >+ SVGElement::InstanceUpdateBlocker blocker(*targetElement); >+ removeAnimatedStyleProperty(targetElement, id); >+ >+ // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. >+ for (auto* instance : targetElement->instances()) >+ removeAnimatedStyleProperty(instance, id); >+} >+ >+void SVGAnimator::applyAnimatedPropertyChange(SVGElement* element, const QualifiedName& attributeName) >+{ >+ ASSERT(!element->m_deletionHasBegun); >+ element->svgAttributeChanged(attributeName); >+} >+ >+void SVGAnimator::applyAnimatedPropertyChange(SVGElement* targetElement) >+{ >+ ASSERT(targetElement); >+ ASSERT(m_attributeName != anyQName()); >+ >+ // FIXME: Do we really need to check both isConnected and !parentNode? >+ if (!targetElement->isConnected() || !targetElement->parentNode()) >+ return; >+ >+ SVGElement::InstanceUpdateBlocker blocker(*targetElement); >+ applyAnimatedPropertyChange(targetElement, m_attributeName); >+ >+ // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. >+ for (auto* instance : targetElement->instances()) >+ applyAnimatedPropertyChange(instance, m_attributeName); >+} >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAnimator.h b/Source/WebCore/svg/properties/SVGAnimator.h >new file mode 100644 >index 00000000000..f177495d209 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGAnimator.h >@@ -0,0 +1,77 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "CSSPropertyNames.h" >+#include "QualifiedName.h" >+#include <wtf/RefCounted.h> >+#include <wtf/StdLibExtras.h> >+ >+namespace WebCore { >+ >+class SVGElement; >+ >+enum class AnimationMode : uint8_t { None, FromTo, FromBy, To, By, Values, Path }; >+enum class CalcMode : uint8_t { Discrete, Linear, Paced, Spline }; >+ >+class SVGAnimator : public RefCounted<SVGAnimator> { >+public: >+ SVGAnimator(const QualifiedName& attributeName) >+ : m_attributeName(attributeName) >+ { >+ } >+ >+ virtual ~SVGAnimator() = default; >+ >+ virtual bool isDiscrete() const { return false; } >+ >+ virtual void setFromAndToValues(SVGElement*, const String&, const String&) { } >+ virtual void setFromAndByValues(SVGElement*, const String&, const String&) { } >+ virtual void setToAtEndOfDurationValue(const String&) { } >+ >+ virtual void start(SVGElement*) = 0; >+ virtual void progress(SVGElement*, float, unsigned) = 0; >+ virtual void apply(SVGElement*) = 0; >+ virtual void stop(SVGElement* targetElement) = 0; >+ >+ virtual float calculateDistance(SVGElement*, const String&, const String&) const { return -1; } >+ virtual RefPtr<SVGAnimator> createSibling(AnimationMode, CalcMode, bool, bool) { return nullptr; } >+ >+protected: >+ bool isAnimatedStylePropertyAniamtor(const SVGElement*) const; >+ >+ static void applyAnimatedStylePropertyChange(SVGElement*, CSSPropertyID, const String& value); >+ static void removeAnimatedStyleProperty(SVGElement*, CSSPropertyID); >+ static void applyAnimatedPropertyChange(SVGElement*, const QualifiedName&); >+ >+ void applyAnimatedStylePropertyChange(SVGElement*, const String& value); >+ void removeAnimatedStyleProperty(SVGElement*); >+ void applyAnimatedPropertyChange(SVGElement*); >+ >+ const QualifiedName& m_attributeName; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAttribute.h b/Source/WebCore/svg/properties/SVGAttribute.h >deleted file mode 100644 >index 8711ac8cc16..00000000000 >--- a/Source/WebCore/svg/properties/SVGAttribute.h >+++ /dev/null >@@ -1,131 +0,0 @@ >-/* >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#include "Element.h" >-#include "SVGAttributeOwnerProxy.h" >-#include "SVGPropertyTraits.h" >- >-namespace WebCore { >- >-class SVGAttribute { }; >- >-template<typename PropertyType> >-class SVGPropertyAttribute : public SVGAttribute { >-public: >- SVGPropertyAttribute() >- : m_property(SVGPropertyTraits<PropertyType>::initialValue()) >- { >- } >- >- template<typename... Arguments> >- SVGPropertyAttribute(Arguments&&... arguments) >- : m_property(std::forward<Arguments>(arguments)...) >- { >- } >- >- PropertyType& value() { return m_property; } >- const PropertyType& value() const { return m_property; } >- >- void setValue(const PropertyType& property) { m_property = property; } >- void setValue(PropertyType&& property) { m_property = WTFMove(property); } >- void resetValue() { m_property = SVGPropertyTraits<PropertyType>::initialValue(); } >- >- String toString() const { return SVGPropertyTraits<PropertyType>::toString(m_property); } >- >- void setShouldSynchronize(bool shouldSynchronize) { m_shouldSynchronize = shouldSynchronize; } >- bool shouldSynchronize() const { return m_shouldSynchronize; } >- void synchronize(Element& element, const QualifiedName& attributeName) >- { >- if (!m_shouldSynchronize) >- return; >- element.setSynchronizedLazyAttribute(attributeName, toString()); >- } >- >-protected: >- PropertyType m_property; >- bool m_shouldSynchronize { false }; >-}; >- >-template<typename TearOffType> >-class SVGAnimatedAttribute : public SVGPropertyAttribute<typename TearOffType::ContentType> { >-public: >- using PropertyTearOffType = TearOffType; >- using PropertyType = typename PropertyTearOffType::ContentType; >- using Base = SVGPropertyAttribute<PropertyType>; >- using Base::m_property; >- using Base::m_shouldSynchronize; >- >- SVGAnimatedAttribute() = default; >- >- template<typename... Arguments> >- SVGAnimatedAttribute(Arguments&&... arguments) >- : Base(std::forward<Arguments>(arguments)...) >- { >- } >- >- const PropertyType& currentValue(const SVGAttributeOwnerProxy& attributeOwnerProxy) const >- { >- if (auto wrapper = attributeOwnerProxy.lookupAnimatedProperty(*this)) { >- if (wrapper->isAnimating()) >- return static_pointer_cast<PropertyTearOffType>(wrapper)->currentAnimatedValue(); >- } >- return m_property; >- } >- >- RefPtr<PropertyTearOffType> animatedProperty(const SVGAttributeOwnerProxy& attributeOwnerProxy) >- { >- m_shouldSynchronize = true; >- if (auto wrapper = attributeOwnerProxy.lookupOrCreateAnimatedProperty(*this)) >- return static_pointer_cast<PropertyTearOffType>(wrapper); >- RELEASE_ASSERT_NOT_REACHED(); >- return nullptr; >- } >-}; >- >-template<typename TearOffType> >-class SVGAnimatedAttributeList : public SVGAnimatedAttribute<TearOffType> { >-public: >- using PropertyTearOffType = TearOffType; >- using PropertyType = typename PropertyTearOffType::ContentType; >- using Base = SVGAnimatedAttribute<PropertyTearOffType>; >- >- SVGAnimatedAttributeList() = default; >- >- template<typename... Arguments> >- SVGAnimatedAttributeList(Arguments&&... arguments) >- : Base(std::forward<Arguments>(arguments)...) >- { >- } >- >- void detachAnimatedListWrappers(const SVGAttributeOwnerProxy& attributeOwnerProxy, unsigned newListSize) >- { >- if (auto wrapper = attributeOwnerProxy.lookupAnimatedProperty(*this)) >- static_pointer_cast<PropertyTearOffType>(wrapper)->detachListWrappers(newListSize); >- } >-}; >- >-} >diff --git a/Source/WebCore/svg/properties/SVGAttributeAccessor.h b/Source/WebCore/svg/properties/SVGAttributeAccessor.h >deleted file mode 100644 >index c5c0f8f6648..00000000000 >--- a/Source/WebCore/svg/properties/SVGAttributeAccessor.h >+++ /dev/null >@@ -1,248 +0,0 @@ >-/* >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#include "Element.h" >-#include "QualifiedName.h" >-#include "SVGAnimatedProperty.h" >-#include "SVGAnimatedPropertyType.h" >-#include "SVGAttribute.h" >-#include "SVGLengthValue.h" >-#include "SVGNames.h" >-#include "SVGPropertyTraits.h" >- >-namespace WebCore { >- >-class SVGAttribute; >-class SVGElement; >- >-template<typename OwnerType> >-class SVGAttributeAccessor { >- WTF_MAKE_FAST_ALLOCATED; >-public: >- SVGAttributeAccessor(const QualifiedName& attributeName) >- : m_attributeName(attributeName) >- { >- } >- virtual ~SVGAttributeAccessor() = default; >- >- const QualifiedName& attributeName() const { return m_attributeName; } >- >- virtual bool isMatched(const OwnerType&, const SVGAttribute&) const = 0; >- virtual void synchronizeProperty(OwnerType&, Element&) const = 0; >- >- virtual bool isAnimatedLengthAttribute() const { return false; } >- virtual AnimatedPropertyType animatedType() const { return AnimatedUnknown; } >- virtual Vector<AnimatedPropertyType> animatedTypes() const { return { animatedType() }; } >- >- virtual RefPtr<SVGAnimatedProperty> lookupOrCreateAnimatedProperty(OwnerType&, SVGElement&, const SVGAttribute&, AnimatedPropertyState) const { return nullptr; }; >- virtual RefPtr<SVGAnimatedProperty> lookupAnimatedProperty(const OwnerType&, const SVGElement&, const SVGAttribute&) const { return nullptr; }; >- virtual Vector<RefPtr<SVGAnimatedProperty>> lookupOrCreateAnimatedProperties(OwnerType&, SVGElement&, AnimatedPropertyState) const { return { }; } >- >-protected: >- const QualifiedName m_attributeName; >-}; >- >-template<typename OwnerType, typename AttributeType> >-class SVGPropertyAttributeAccessor : public SVGAttributeAccessor<OwnerType> { >-public: >- using Base = SVGAttributeAccessor<OwnerType>; >- using Base::m_attributeName; >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, AttributeType OwnerType::*attribute> >- static SVGAttributeAccessor<OwnerType>& singleton() >- { >- static NeverDestroyed<SVGPropertyAttributeAccessor> attributeAccessor { attributeName, attributeName->localName(), attribute }; >- return attributeAccessor; >- } >- >- SVGPropertyAttributeAccessor(const QualifiedName& attributeName, const AtomicString& identifier, AttributeType OwnerType::*attribute) >- : Base(attributeName) >- , m_identifier(identifier) >- , m_attribute(attribute) >- { >- } >- >-protected: >- auto& attribute(OwnerType& owner) const { return owner.*m_attribute; } >- const auto& attribute(const OwnerType& owner) const { return owner.*m_attribute; } >- >- bool isMatched(const OwnerType& owner, const SVGAttribute& attribute) const override >- { >- return &this->attribute(owner) == &attribute; >- } >- >- void synchronizeProperty(OwnerType& owner, Element& element) const override >- { >- attribute(owner).synchronize(element, m_attributeName); >- } >- >- const AtomicString& m_identifier; >- AttributeType OwnerType::*m_attribute; >-}; >- >-template<typename OwnerType, typename AnimatedAttributeType, AnimatedPropertyType type> >-class SVGAnimatedAttributeAccessor : public SVGPropertyAttributeAccessor<OwnerType, AnimatedAttributeType> { >-public: >- using PropertyTearOffType = typename AnimatedAttributeType::PropertyTearOffType; >- using PropertyType = typename AnimatedAttributeType::PropertyType; >- using Base = SVGPropertyAttributeAccessor<OwnerType, AnimatedAttributeType>; >- using Base::attribute; >- using Base::isMatched; >- using Base::m_attributeName; >- using Base::m_identifier; >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, AnimatedAttributeType OwnerType::*attribute> >- static SVGAttributeAccessor<OwnerType>& singleton() >- { >- static NeverDestroyed<SVGAnimatedAttributeAccessor> attributeAccessor { attributeName, attributeName->localName(), attribute }; >- return attributeAccessor; >- } >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, const AtomicString& (*identifier)(), AnimatedAttributeType OwnerType::*attribute> >- static SVGAttributeAccessor<OwnerType>& singleton() >- { >- static NeverDestroyed<SVGAnimatedAttributeAccessor> attributeAccessor { attributeName, identifier(), attribute }; >- return attributeAccessor; >- } >- >- SVGAnimatedAttributeAccessor(const QualifiedName& attributeName, const AtomicString& identifier, AnimatedAttributeType OwnerType::*attribute) >- : Base(attributeName, identifier, attribute) >- { >- } >- >-protected: >- template<typename PropertyTearOff = PropertyTearOffType, typename Property = PropertyType, AnimatedPropertyType animatedType = type> >- static RefPtr<SVGAnimatedProperty> lookupOrCreateAnimatedProperty(SVGElement& element, const QualifiedName& attributeName, const AtomicString& identifier, Property& property, AnimatedPropertyState animatedState) >- { >- return SVGAnimatedProperty::lookupOrCreateAnimatedProperty<PropertyTearOff, Property, animatedType>(element, attributeName, identifier, property, animatedState); >- } >- >- static RefPtr<SVGAnimatedProperty> lookupAnimatedProperty(const SVGElement& element, const AtomicString& identifier) >- { >- return SVGAnimatedProperty::lookupAnimatedProperty(element, identifier); >- } >- >- bool isAnimatedLengthAttribute() const override { return std::is_same<PropertyType, SVGLengthValue>::value; } >- AnimatedPropertyType animatedType() const override { return type; } >- >- RefPtr<SVGAnimatedProperty> lookupOrCreateAnimatedProperty(OwnerType& owner, SVGElement& element, const SVGAttribute& attribute, AnimatedPropertyState animatedState) const override >- { >- ASSERT_UNUSED(attribute, isMatched(owner, attribute)); >- return lookupOrCreateAnimatedProperty(element, m_attributeName, m_identifier, this->attribute(owner).value(), animatedState); >- } >- >- RefPtr<SVGAnimatedProperty> lookupAnimatedProperty(const OwnerType&, const SVGElement& element, const SVGAttribute&) const override >- { >- return lookupAnimatedProperty(element, m_identifier); >- } >- >- Vector<RefPtr<SVGAnimatedProperty>> lookupOrCreateAnimatedProperties(OwnerType& owner, SVGElement& element, AnimatedPropertyState animatedState) const override >- { >- return { lookupOrCreateAnimatedProperty(element, m_attributeName, m_identifier, attribute(owner).value(), animatedState) }; >- } >-}; >- >-template<typename OwnerType, typename AnimatedAttributeType, AnimatedPropertyType type, typename SecondAnimatedAttributeType, AnimatedPropertyType secondType> >-class SVGAnimatedPairAttributeAccessor : public SVGAnimatedAttributeAccessor<OwnerType, AnimatedAttributeType, type> { >-public: >- using PropertyTearOffType = typename AnimatedAttributeType::PropertyTearOffType; >- using SecondPropertyTearOffType = typename SecondAnimatedAttributeType::PropertyTearOffType; >- using SecondPropertyType = typename SecondAnimatedAttributeType::PropertyType; >- using Base = SVGAnimatedAttributeAccessor<OwnerType, AnimatedAttributeType, type>; >- using Base::attribute; >- using Base::lookupOrCreateAnimatedProperty; >- using Base::lookupAnimatedProperty; >- using Base::m_attributeName; >- using Base::m_identifier; >- >- template< >- const LazyNeverDestroyed<const QualifiedName>& attributeName, >- const AtomicString& (*identifier)(), AnimatedAttributeType OwnerType::*attribute, >- const AtomicString& (*secondIdentifier)(), SecondAnimatedAttributeType OwnerType::*secondAttribute >- > >- static SVGAttributeAccessor<OwnerType>& singleton() >- { >- static NeverDestroyed<SVGAnimatedPairAttributeAccessor> attributeAccessor { attributeName, identifier(), attribute, secondIdentifier(), secondAttribute }; >- return attributeAccessor; >- } >- >- SVGAnimatedPairAttributeAccessor(const QualifiedName& attributeName, const AtomicString& identifier, AnimatedAttributeType OwnerType::*attribute, const AtomicString& secondIdentifier, SecondAnimatedAttributeType OwnerType::*secondAttribute) >- : Base(attributeName, identifier, attribute) >- , m_secondIdentifier(secondIdentifier) >- , m_secondAttribute(secondAttribute) >- { >- } >- >-private: >- auto& secondAttribute(OwnerType& owner) const { return owner.*m_secondAttribute; } >- const auto& secondAttribute(const OwnerType& owner) const { return owner.*m_secondAttribute; } >- >- bool isMatched(const OwnerType& owner, const SVGAttribute& attribute) const override >- { >- return Base::isMatched(owner, attribute) || &secondAttribute(owner) == &attribute; >- } >- >- void synchronizeProperty(OwnerType& owner, Element& element) const override >- { >- attribute(owner).synchronize(element, m_attributeName); >- secondAttribute(owner).synchronize(element, m_attributeName); >- } >- >- Vector<AnimatedPropertyType> animatedTypes() const override { return { type, secondType }; } >- >- RefPtr<SVGAnimatedProperty> lookupOrCreateAnimatedProperty(OwnerType& owner, SVGElement& element, const SVGAttribute& attribute, AnimatedPropertyState animatedState) const override >- { >- if (Base::isMatched(owner, attribute)) >- return lookupOrCreateAnimatedProperty(element, m_attributeName, m_identifier, this->attribute(owner).value(), animatedState); >- ASSERT(&secondAttribute(owner) == &attribute); >- return Base::template lookupOrCreateAnimatedProperty<SecondPropertyTearOffType, SecondPropertyType, secondType>(element, m_attributeName, m_secondIdentifier, secondAttribute(owner).value(), animatedState); >- } >- >- RefPtr<SVGAnimatedProperty> lookupAnimatedProperty(const OwnerType& owner, const SVGElement& element, const SVGAttribute& attribute) const override >- { >- if (Base::isMatched(owner, attribute)) >- return lookupAnimatedProperty(element, m_identifier); >- ASSERT(&secondAttribute(owner) == &attribute); >- return lookupAnimatedProperty(element, m_secondIdentifier); >- } >- >- Vector<RefPtr<SVGAnimatedProperty>> lookupOrCreateAnimatedProperties(OwnerType& owner, SVGElement& element, AnimatedPropertyState animatedState) const override >- { >- return { >- lookupOrCreateAnimatedProperty(element, m_attributeName, m_identifier, attribute(owner).value(), animatedState), >- Base::template lookupOrCreateAnimatedProperty<SecondPropertyTearOffType, SecondPropertyType, secondType>(element, m_attributeName, m_secondIdentifier, secondAttribute(owner).value(), animatedState) >- }; >- } >- >- const AtomicString& m_secondIdentifier; >- SecondAnimatedAttributeType OwnerType::*m_secondAttribute; >-}; >- >-template<typename OwnerType, typename AnimatedAttributeType, AnimatedPropertyType type> >-using SVGAnimatedOptionalAttributeAccessor = SVGAnimatedPairAttributeAccessor<OwnerType, AnimatedAttributeType, type, AnimatedAttributeType, type>; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/properties/SVGAttributeOwnerProxyImpl.h b/Source/WebCore/svg/properties/SVGAttributeOwnerProxyImpl.h >deleted file mode 100644 >index 51d21ec07d7..00000000000 >--- a/Source/WebCore/svg/properties/SVGAttributeOwnerProxyImpl.h >+++ /dev/null >@@ -1,103 +0,0 @@ >-/* >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#include "SVGAttributeOwnerProxy.h" >-#include "SVGAttributeRegistry.h" >- >-namespace WebCore { >- >-template<typename OwnerType, typename... BaseTypes> >-class SVGAttributeOwnerProxyImpl : public SVGAttributeOwnerProxy { >-public: >- using AttributeRegistry = SVGAttributeRegistry<OwnerType, BaseTypes...>; >- >- SVGAttributeOwnerProxyImpl(OwnerType& owner, SVGElement& element, AnimatedPropertyState animatedState = PropertyIsReadWrite) >- : SVGAttributeOwnerProxy(element) >- , m_owner(owner) >- , m_animatedState(animatedState) >- { >- // This is the OwnerProxy constructor for the non SVGElement based owners, e.g. SVGTests. >- } >- >- SVGAttributeOwnerProxyImpl(OwnerType& owner) >- : SVGAttributeOwnerProxy(owner) >- , m_owner(owner) >- { >- static_assert(std::is_base_of<SVGElement, OwnerType>::value, "The owner of SVGAttributeOwnerProxy should be derived from SVGElement."); >- } >- >- static AttributeRegistry& attributeRegistry() >- { >- return AttributeRegistry::singleton(); >- } >- >- static bool isKnownAttribute(const QualifiedName& attributeName) >- { >- return attributeRegistry().isKnownAttribute(attributeName); >- } >- >- static bool isAnimatedLengthAttribute(const QualifiedName& attributeName) >- { >- return attributeRegistry().isAnimatedLengthAttribute(attributeName); >- } >- >-private: >- void synchronizeAttributes() const override >- { >- attributeRegistry().synchronizeAttributes(m_owner, m_element); >- } >- >- void synchronizeAttribute(const QualifiedName& attributeName) const override >- { >- attributeRegistry().synchronizeAttribute(m_owner, m_element, attributeName); >- } >- >- Vector<AnimatedPropertyType> animatedTypes(const QualifiedName& attributeName) const override >- { >- return attributeRegistry().animatedTypes(attributeName); >- } >- >- RefPtr<SVGAnimatedProperty> lookupOrCreateAnimatedProperty(const SVGAttribute& attribute) const override >- { >- return attributeRegistry().lookupOrCreateAnimatedProperty(m_owner, m_element, attribute, m_animatedState); >- } >- >- RefPtr<SVGAnimatedProperty> lookupAnimatedProperty(const SVGAttribute& attribute) const override >- { >- return attributeRegistry().lookupAnimatedProperty(m_owner, m_element, attribute); >- } >- >- Vector<RefPtr<SVGAnimatedProperty>> lookupOrCreateAnimatedProperties(const QualifiedName& attributeName) const override >- { >- return attributeRegistry().lookupOrCreateAnimatedProperties(m_owner, m_element, attributeName, m_animatedState); >- } >- >- OwnerType& m_owner; >- AnimatedPropertyState m_animatedState { PropertyIsReadWrite }; >-}; >- >-} >diff --git a/Source/WebCore/svg/properties/SVGAttributeRegistry.h b/Source/WebCore/svg/properties/SVGAttributeRegistry.h >deleted file mode 100644 >index 3022280063b..00000000000 >--- a/Source/WebCore/svg/properties/SVGAttributeRegistry.h >+++ /dev/null >@@ -1,330 +0,0 @@ >-/* >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#include "SVGAnimatedBoolean.h" >-#include "SVGAnimatedEnumeration.h" >-#include "SVGAnimatedInteger.h" >-#include "SVGAnimatedLength.h" >-#include "SVGAnimatedLengthList.h" >-#include "SVGAnimatedNumber.h" >-#include "SVGAnimatedNumberList.h" >-#include "SVGAnimatedPointList.h" >-#include "SVGAnimatedPreserveAspectRatio.h" >-#include "SVGAnimatedProperty.h" >-#include "SVGAnimatedRect.h" >-#include "SVGAnimatedString.h" >-#include "SVGAnimatedTransformList.h" >-#include "SVGAttributeAccessor.h" >-#include "SVGStringListValues.h" >-#include "SVGZoomAndPanType.h" >-#include <wtf/HashMap.h> >- >-namespace WebCore { >- >-template<typename OwnerType, typename... BaseTypes> >-class SVGAttributeRegistry { >-public: >- static SVGAttributeRegistry<OwnerType, BaseTypes...>& singleton() >- { >- static NeverDestroyed<SVGAttributeRegistry<OwnerType, BaseTypes...>> map; >- return map; >- } >- >- // Non animatable attributes >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGStringListValuesAttribute OwnerType::*attribute> >- void registerAttribute() >- { >- registerAttribute(SVGStringListValuesAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); >- } >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGZoomAndPanTypeAttribute OwnerType::*attribute> >- void registerAttribute() >- { >- registerAttribute(SVGZoomAndPanTypeAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); >- } >- >- // Animatable attributes >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedBooleanAttribute OwnerType::*attribute> >- void registerAttribute() >- { >- registerAttribute(SVGAnimatedBooleanAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); >- } >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, typename EnumType, SVGAnimatedEnumerationAttribute<EnumType> OwnerType::*attribute> >- void registerAttribute() >- { >- registerAttribute(SVGAnimatedEnumerationAttributeAccessor<OwnerType, EnumType>::template singleton<attributeName, attribute>()); >- } >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedIntegerAttribute OwnerType::*attribute> >- void registerAttribute() >- { >- registerAttribute(SVGAnimatedIntegerAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); >- } >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, >- const AtomicString& (*identifier)(), SVGAnimatedIntegerAttribute OwnerType::*attribute, >- const AtomicString& (*optionalIdentifier)(), SVGAnimatedIntegerAttribute OwnerType::*optionalAttribute> >- void registerAttribute() >- { >- registerAttribute(SVGAnimatedOptionalIntegerAttributeAccessor<OwnerType>::template singleton<attributeName, identifier, attribute, optionalIdentifier, optionalAttribute>()); >- } >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedLengthAttribute OwnerType::*attribute> >- void registerAttribute() >- { >- registerAttribute(SVGAnimatedLengthAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); >- } >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedLengthListAttribute OwnerType::*attribute> >- void registerAttribute() >- { >- registerAttribute(SVGAnimatedLengthListAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); >- } >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedNumberAttribute OwnerType::*attribute> >- void registerAttribute() >- { >- registerAttribute(SVGAnimatedNumberAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); >- } >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedNumberListAttribute OwnerType::*attribute> >- void registerAttribute() >- { >- registerAttribute(SVGAnimatedNumberListAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); >- } >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, >- const AtomicString& (*identifier)(), SVGAnimatedNumberAttribute OwnerType::*attribute, >- const AtomicString& (*optionalIdentifier)(), SVGAnimatedNumberAttribute OwnerType::*optionalAttribute> >- void registerAttribute() >- { >- registerAttribute(SVGAnimatedOptionalNumberAttributeAccessor<OwnerType>::template singleton<attributeName, identifier, attribute, optionalIdentifier, optionalAttribute>()); >- } >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedPointListAttribute OwnerType::*attribute> >- void registerAttribute() >- { >- registerAttribute(SVGAnimatedPointListAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); >- } >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedPreserveAspectRatioAttribute OwnerType::*attribute> >- void registerAttribute() >- { >- registerAttribute(SVGAnimatedPreserveAspectRatioAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); >- } >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedRectAttribute OwnerType::*attribute> >- void registerAttribute() >- { >- registerAttribute(SVGAnimatedRectAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); >- } >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedStringAttribute OwnerType::*attribute> >- void registerAttribute() >- { >- registerAttribute(SVGAnimatedStringAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); >- } >- >- template<const LazyNeverDestroyed<const QualifiedName>& attributeName, SVGAnimatedTransformListAttribute OwnerType::*attribute> >- void registerAttribute() >- { >- registerAttribute(SVGAnimatedTransformListAttributeAccessor<OwnerType>::template singleton<attributeName, attribute>()); >- } >- >- bool isEmpty() const { return m_map.isEmpty(); } >- >- bool isKnownAttribute(const QualifiedName& attributeName) const >- { >- // Here we need to loop through the entries in the map and use matches() to compare them with attributeName. >- // m_map.contains() uses QualifiedName::operator==() which compares the impl pointers only while matches() >- // compares the contents if the impl pointers differ. >- auto it = std::find_if(m_map.begin(), m_map.end(), [&attributeName](const auto& entry) -> bool { >- return entry.key.matches(attributeName); >- }); >- return it != m_map.end(); >- } >- >- bool isAnimatedLengthAttribute(const QualifiedName& attributeName) const >- { >- if (const auto* attributeAccessor = findAttributeAccessor(attributeName)) >- return attributeAccessor->isAnimatedLengthAttribute(); >- return false; >- } >- >- Vector<AnimatedPropertyType> animatedTypes(const QualifiedName& attributeName) const >- { >- // If this registry has an accessor for attributeName, return animatedTypes() of this accessor. >- if (const auto* attributeAccessor = findAttributeAccessor(attributeName)) >- return attributeAccessor->animatedTypes(); >- // Otherwise loop through BaeTypes and see if any of them knows attributeName. >- return animatedTypesBaseTypes(attributeName); >- } >- >- void synchronizeAttributes(OwnerType& owner, SVGElement& element) const >- { >- for (auto* attributeAccessor : m_map.values()) >- attributeAccessor->synchronizeProperty(owner, element); >- synchronizeAttributesBaseTypes(owner, element); >- } >- >- bool synchronizeAttribute(OwnerType& owner, SVGElement& element, const QualifiedName& attributeName) const >- { >- if (const auto* attributeAccessor = findAttributeAccessor(attributeName)) { >- attributeAccessor->synchronizeProperty(owner, element); >- return true; >- } >- return synchronizeAttributeBaseTypes(owner, element, attributeName); >- } >- >- RefPtr<SVGAnimatedProperty> lookupOrCreateAnimatedProperty(OwnerType& owner, SVGElement& element, const SVGAttribute& attribute, AnimatedPropertyState animatedState) const >- { >- if (const auto* attributeAccessor = findAttributeAccessor(owner, attribute)) >- return attributeAccessor->lookupOrCreateAnimatedProperty(owner, element, attribute, animatedState); >- return lookupOrCreateAnimatedPropertyBaseTypes(owner, element, attribute, animatedState); >- } >- >- RefPtr<SVGAnimatedProperty> lookupAnimatedProperty(const OwnerType& owner, const SVGElement& element, const SVGAttribute& attribute) const >- { >- if (const auto* attributeAccessor = findAttributeAccessor(owner, attribute)) >- return attributeAccessor->lookupAnimatedProperty(owner, element, attribute); >- return lookupAnimatedPropertyBaseTypes(owner, element, attribute); >- } >- >- Vector<RefPtr<SVGAnimatedProperty>> lookupOrCreateAnimatedProperties(OwnerType& owner, SVGElement& element, const QualifiedName& attributeName, AnimatedPropertyState animatedState) const >- { >- if (const auto* attributeAccessor = findAttributeAccessor(attributeName)) >- return attributeAccessor->lookupOrCreateAnimatedProperties(owner, element, animatedState); >- return lookupOrCreateAnimatedPropertiesBaseTypes(owner, element, attributeName, animatedState); >- } >- >- void registerAttribute(const SVGAttributeAccessor<OwnerType>& attributeAccessor) >- { >- m_map.add(attributeAccessor.attributeName(), &attributeAccessor); >- } >- >-private: >- // This is a template function with parameter 'I' whose default value = 0. So you can call it without any parameter from animatedTypes(). >- // It returns Vector<AnimatedPropertyType> and is enable_if<I == sizeof...(BaseTypes)>. So it is mainly for breaking the recursion. If >- // it is called, this means no attribute was found in this registry for this QualifiedName. So return an empty Vector<AnimatedPropertyType>. >- template<size_t I = 0> >- static typename std::enable_if<I == sizeof...(BaseTypes), Vector<AnimatedPropertyType>>::type animatedTypesBaseTypes(const QualifiedName&) { return { }; } >- >- // This version of animatedTypesBaseTypes() is enable_if<I < sizeof...(BaseTypes)>. >- template<size_t I = 0> >- static typename std::enable_if<I < sizeof...(BaseTypes), Vector<AnimatedPropertyType>>::type animatedTypesBaseTypes(const QualifiedName& attributeName) >- { >- // Get the base type at index 'I' using std::tuple and std::tuple_element. >- using BaseType = typename std::tuple_element<I, typename std::tuple<BaseTypes...>>::type; >- >- // Get the SVGAttributeRegistry of BaseType. If it knows attributeName break the recursion. >- auto animatedTypes = BaseType::attributeRegistry().animatedTypes(attributeName); >- if (!animatedTypes.isEmpty()) >- return animatedTypes; >- >- // SVGAttributeRegistry of BaseType does not know attributeName. Recurse to the next BaseType. >- return animatedTypesBaseTypes<I + 1>(attributeName); >- } >- >- template<size_t I = 0> >- static typename std::enable_if<I == sizeof...(BaseTypes), void>::type synchronizeAttributesBaseTypes(OwnerType&, Element&) { } >- >- template<size_t I = 0> >- static typename std::enable_if<I < sizeof...(BaseTypes), void>::type synchronizeAttributesBaseTypes(OwnerType& owner, SVGElement& element) >- { >- using BaseType = typename std::tuple_element<I, typename std::tuple<BaseTypes...>>::type; >- BaseType::attributeRegistry().synchronizeAttributes(owner, element); >- synchronizeAttributesBaseTypes<I + 1>(owner, element); >- } >- >- template<size_t I = 0> >- static typename std::enable_if<I == sizeof...(BaseTypes), bool>::type synchronizeAttributeBaseTypes(OwnerType&, Element&, const QualifiedName&) { return false; } >- >- template<size_t I = 0> >- static typename std::enable_if<I < sizeof...(BaseTypes), bool>::type synchronizeAttributeBaseTypes(OwnerType& owner, SVGElement& element, const QualifiedName& attributeName) >- { >- using BaseType = typename std::tuple_element<I, typename std::tuple<BaseTypes...>>::type; >- if (BaseType::attributeRegistry().synchronizeAttribute(owner, element, attributeName)) >- return true; >- return synchronizeAttributeBaseTypes<I + 1>(owner, element, attributeName); >- } >- >- template<size_t I = 0> >- static typename std::enable_if<I == sizeof...(BaseTypes), RefPtr<SVGAnimatedProperty>>::type lookupOrCreateAnimatedPropertyBaseTypes(OwnerType&, SVGElement&, const SVGAttribute&, AnimatedPropertyState) { return nullptr; } >- >- template<size_t I = 0> >- static typename std::enable_if<I < sizeof...(BaseTypes), RefPtr<SVGAnimatedProperty>>::type lookupOrCreateAnimatedPropertyBaseTypes(OwnerType& owner, SVGElement& element, const SVGAttribute& attribute, AnimatedPropertyState animatedState) >- { >- using BaseType = typename std::tuple_element<I, typename std::tuple<BaseTypes...>>::type; >- if (auto animatedProperty = BaseType::attributeRegistry().lookupOrCreateAnimatedProperty(owner, element, attribute, animatedState)) >- return animatedProperty; >- return lookupOrCreateAnimatedPropertyBaseTypes<I + 1>(owner, element, attribute, animatedState); >- } >- >- template<size_t I = 0> >- static typename std::enable_if<I == sizeof...(BaseTypes), RefPtr<SVGAnimatedProperty>>::type lookupAnimatedPropertyBaseTypes(const OwnerType&, const SVGElement&, const SVGAttribute&) { return nullptr; } >- >- template<size_t I = 0> >- static typename std::enable_if<I < sizeof...(BaseTypes), RefPtr<SVGAnimatedProperty>>::type lookupAnimatedPropertyBaseTypes(const OwnerType& owner, const SVGElement& element, const SVGAttribute& attribute) >- { >- using BaseType = typename std::tuple_element<I, typename std::tuple<BaseTypes...>>::type; >- if (auto animatedProperty = BaseType::attributeRegistry().lookupAnimatedProperty(owner, element, attribute)) >- return animatedProperty; >- return lookupAnimatedPropertyBaseTypes<I + 1>(owner, element, attribute); >- } >- >- template<size_t I = 0> >- static typename std::enable_if<I == sizeof...(BaseTypes), Vector<RefPtr<SVGAnimatedProperty>>>::type lookupOrCreateAnimatedPropertiesBaseTypes(OwnerType&, SVGElement&, const QualifiedName&, AnimatedPropertyState) { return { }; } >- >- template<size_t I = 0> >- static typename std::enable_if<I < sizeof...(BaseTypes), Vector<RefPtr<SVGAnimatedProperty>>>::type lookupOrCreateAnimatedPropertiesBaseTypes(OwnerType& owner, SVGElement& element, const QualifiedName& attributeName, AnimatedPropertyState animatedState) >- { >- using BaseType = typename std::tuple_element<I, typename std::tuple<BaseTypes...>>::type; >- auto animatedProperties = BaseType::attributeRegistry().lookupOrCreateAnimatedProperties(owner, element, attributeName, animatedState); >- if (!animatedProperties.isEmpty()) >- return animatedProperties; >- return lookupOrCreateAnimatedPropertiesBaseTypes<I + 1>(owner, element, attributeName, animatedState); >- } >- >- const SVGAttributeAccessor<OwnerType>* findAttributeAccessor(const OwnerType& owner, const SVGAttribute& attribute) const >- { >- for (auto* attributeAccessor : m_map.values()) { >- if (attributeAccessor->isMatched(owner, attribute)) >- return attributeAccessor; >- } >- return nullptr; >- } >- >- const SVGAttributeAccessor<OwnerType>* findAttributeAccessor(const QualifiedName& attributeName) const >- { >- return m_map.get(attributeName); >- } >- >- HashMap<QualifiedName, const SVGAttributeAccessor<OwnerType>*> m_map; >-}; >- >-} >diff --git a/Source/WebCore/svg/properties/SVGDecoratedEnumeration.h b/Source/WebCore/svg/properties/SVGDecoratedEnumeration.h >new file mode 100644 >index 00000000000..b12807672e6 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGDecoratedEnumeration.h >@@ -0,0 +1,69 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGDecoratedPrimitive.h" >+ >+namespace WebCore { >+ >+template<typename DecorationType, typename EnumType> >+class SVGDecoratedEnumeration : public SVGDecoratedPrimitive<DecorationType, EnumType> { >+ using Base = SVGDecoratedPrimitive<DecorationType, EnumType>; >+ using Base::Base; >+ using Base::m_value; >+ >+public: >+ static auto create(const EnumType& value) >+ { >+ static_assert(std::is_integral<DecorationType>::value, "DecorationType form enum should be integral."); >+ return std::make_unique<SVGDecoratedEnumeration>(value); >+ } >+ >+private: >+ bool setValue(const DecorationType& value) override >+ { >+ if (!value || value > SVGIDLEnumLimits<EnumType>::highestExposedEnumValue()) >+ return false; >+ Base::setValueInternal(value); >+ return true; >+ } >+ >+ DecorationType value() const override >+ { >+ if (Base::value() > SVGIDLEnumLimits<EnumType>::highestExposedEnumValue()) >+ return m_outOfRangeEnumValue; >+ return Base::value(); >+ } >+ >+ std::unique_ptr<SVGDecoratedProperty<DecorationType>> clone() override >+ { >+ return create(m_value); >+ } >+ >+ static const DecorationType m_outOfRangeEnumValue = 0; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGDecoratedPrimitive.h b/Source/WebCore/svg/properties/SVGDecoratedPrimitive.h >new file mode 100644 >index 00000000000..1252c16b89d >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGDecoratedPrimitive.h >@@ -0,0 +1,53 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGDecoratedProperty.h" >+ >+namespace WebCore { >+ >+template<typename DecorationType, typename PropertyType> >+class SVGDecoratedPrimitive : public SVGDecoratedProperty<DecorationType> { >+ using Base = SVGDecoratedProperty<DecorationType>; >+ >+public: >+ SVGDecoratedPrimitive(const PropertyType& value) >+ : m_value(value) >+ { >+ } >+ >+protected: >+ using Base::Base; >+ >+ void setValueInternal(const DecorationType& value) override { m_value = static_cast<PropertyType>(value); } >+ DecorationType valueInternal() const override { return static_cast<DecorationType>(m_value); } >+ >+ String valueAsString() const override { return SVGPropertyTraits<PropertyType>::toString(m_value); } >+ >+ PropertyType m_value; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGDecoratedProperty.h b/Source/WebCore/svg/properties/SVGDecoratedProperty.h >new file mode 100644 >index 00000000000..b3ba6268af5 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGDecoratedProperty.h >@@ -0,0 +1,53 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+namespace WebCore { >+ >+template<typename DecorationType> >+class SVGDecoratedProperty { >+public: >+ SVGDecoratedProperty() = default; >+ virtual ~SVGDecoratedProperty() = default; >+ >+ virtual void setValueInternal(const DecorationType&) = 0; >+ virtual bool setValue(const DecorationType& value) >+ { >+ setValueInternal(value); >+ return true; >+ } >+ >+ // Used internally. It doesn't check for highestExposedEnumValue for example. >+ virtual DecorationType valueInternal() const = 0; >+ >+ // Used by the DOM APIs. >+ virtual DecorationType value() const { return valueInternal(); } >+ >+ virtual String valueAsString() const = 0; >+ virtual std::unique_ptr<SVGDecoratedProperty<DecorationType>> clone() = 0; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGList.h b/Source/WebCore/svg/properties/SVGList.h >new file mode 100644 >index 00000000000..19ef67b5d7e >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGList.h >@@ -0,0 +1,193 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "ExceptionOr.h" >+#include "SVGProperty.h" >+ >+namespace WebCore { >+ >+template<typename ItemType> >+class SVGList : public SVGProperty { >+public: >+ unsigned numberOfItems() const >+ { >+ return m_items.size(); >+ } >+ >+ ExceptionOr<void> clear() >+ { >+ auto result = canAlterList(); >+ if (result.hasException()) >+ return result.releaseException(); >+ ASSERT(result.releaseReturnValue()); >+ >+ clearItems(); >+ commitChange(); >+ return { }; >+ } >+ >+ ExceptionOr<ItemType> getItem(unsigned index) >+ { >+ auto result = canGetItem(index); >+ if (result.hasException()) >+ return result.releaseException(); >+ ASSERT(result.releaseReturnValue()); >+ >+ return at(index); >+ } >+ >+ ExceptionOr<ItemType> initialize(ItemType&& newItem) >+ { >+ auto result = canAlterList(); >+ if (result.hasException()) >+ return result.releaseException(); >+ >+ // Spec: Clears all existing current items from the list. >+ clearItems(); >+ >+ auto item = append(WTFMove(newItem)); >+ commitChange(); >+ return WTFMove(item); >+ } >+ >+ ExceptionOr<ItemType> insertItemBefore(ItemType&& newItem, unsigned index) >+ { >+ auto result = canAlterList(); >+ if (result.hasException()) >+ return result.releaseException(); >+ ASSERT(result.releaseReturnValue()); >+ >+ // Spec: If the index is greater than or equal to numberOfItems, >+ // then the new item is appended to the end of the list. >+ if (index > numberOfItems()) >+ index = numberOfItems(); >+ >+ auto item = insert(index, WTFMove(newItem)); >+ commitChange(); >+ return WTFMove(item); >+ } >+ >+ ExceptionOr<ItemType> replaceItem(ItemType&& newItem, unsigned index) >+ { >+ auto result = canReplaceItem(index); >+ if (result.hasException()) >+ return result.releaseException(); >+ ASSERT(result.releaseReturnValue()); >+ >+ auto item = replace(index, WTFMove(newItem)); >+ commitChange(); >+ return WTFMove(item); >+ } >+ >+ ExceptionOr<ItemType> removeItem(unsigned index) >+ { >+ auto result = canRemoveItem(index); >+ if (result.hasException()) >+ return result.releaseException(); >+ ASSERT(result.releaseReturnValue()); >+ >+ auto item = remove(index); >+ commitChange(); >+ return WTFMove(item); >+ } >+ >+ ExceptionOr<ItemType> appendItem(ItemType&& newItem) >+ { >+ auto result = canAlterList(); >+ if (result.hasException()) >+ return result.releaseException(); >+ ASSERT(result.releaseReturnValue()); >+ >+ auto item = append(WTFMove(newItem)); >+ commitChange(); >+ return WTFMove(item); >+ } >+ >+ // Parsers and animators need to have a direct access to the items. >+ Vector<ItemType>& items() { return m_items; } >+ const Vector<ItemType>& items() const { return m_items; } >+ size_t size() const { return m_items.size(); } >+ bool isEmpty() const { return m_items.isEmpty(); } >+ >+ void clearItems() >+ { >+ detachItems(); >+ m_items.clear(); >+ } >+ >+protected: >+ using SVGProperty::SVGProperty; >+ >+ ExceptionOr<bool> canAlterList() const >+ { >+ if (isReadOnly()) >+ return Exception { NoModificationAllowedError }; >+ return true; >+ } >+ >+ ExceptionOr<bool> canGetItem(unsigned index) >+ { >+ if (index >= m_items.size()) >+ return Exception { IndexSizeError }; >+ return true; >+ } >+ >+ ExceptionOr<bool> canReplaceItem(unsigned index) >+ { >+ auto result = canAlterList(); >+ if (result.hasException()) >+ return result.releaseException(); >+ ASSERT(result.releaseReturnValue()); >+ >+ if (index >= m_items.size()) >+ return Exception { IndexSizeError }; >+ return true; >+ } >+ >+ ExceptionOr<bool> canRemoveItem(unsigned index) >+ { >+ auto result = canAlterList(); >+ if (result.hasException()) >+ return result.releaseException(); >+ ASSERT(result.releaseReturnValue()); >+ >+ if (index >= m_items.size()) >+ return Exception { IndexSizeError }; >+ return true; >+ } >+ >+ virtual void detachItems() { } >+ virtual ItemType at(unsigned index) const = 0; >+ virtual ItemType insert(unsigned index, ItemType&&) = 0; >+ virtual ItemType replace(unsigned index, ItemType&&) = 0; >+ virtual ItemType remove(unsigned index) = 0; >+ virtual ItemType append(ItemType&&) = 0; >+ >+ Vector<ItemType> m_items; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGListProperty.h b/Source/WebCore/svg/properties/SVGListProperty.h >deleted file mode 100644 >index a00072d8ff5..00000000000 >--- a/Source/WebCore/svg/properties/SVGListProperty.h >+++ /dev/null >@@ -1,486 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010. 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 "SVGPropertyTearOff.h" >-#include "SVGPropertyTraits.h" >-#include <wtf/Ref.h> >- >-namespace WebCore { >- >-enum ListModification { >- ListModificationUnknown = 0, >- ListModificationInsert = 1, >- ListModificationReplace = 2, >- ListModificationRemove = 3, >- ListModificationAppend = 4 >-}; >- >-template<typename PropertyType> >-class SVGAnimatedListPropertyTearOff; >- >-template<typename PropertyType> >-class SVGListProperty : public SVGProperty, public CanMakeWeakPtr<SVGListProperty<PropertyType>> { >-public: >- typedef SVGListProperty<PropertyType> Self; >- >- using ListItemType = typename SVGPropertyTraits<PropertyType>::ListItemType; >- using ListItemTearOff = typename SVGPropertyTraits<PropertyType>::ListItemTearOff; >- using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<PropertyType>; >- using ListWrapperCache = typename AnimatedListPropertyTearOff::ListWrapperCache; >- >- ExceptionOr<bool> canAlterList() const >- { >- if (m_role == AnimValRole) >- return Exception { NoModificationAllowedError }; >- >- return true; >- } >- >- static void detachListWrappersAndResize(ListWrapperCache* wrappers, unsigned newListSize = 0) >- { >- // See SVGPropertyTearOff::detachWrapper() for an explanation about what's happening here. >- ASSERT(wrappers); >- for (auto& item : *wrappers) { >- if (item) >- item->detachWrapper(); >- } >- >- // Reinitialize the wrapper cache to be equal to the new values size, after the XML DOM changed the list. >- if (newListSize) >- wrappers->fill(0, newListSize); >- else >- wrappers->clear(); >- } >- >- void detachListWrappers(unsigned newListSize) >- { >- detachListWrappersAndResize(m_wrappers, newListSize); >- } >- >- void setValuesAndWrappers(PropertyType* values, ListWrapperCache* wrappers, bool shouldOwnValues) >- { >- // This is only used for animVal support, to switch the underlying values & wrappers >- // to the current animated values, once animation for a list starts. >- ASSERT(m_values); >- ASSERT(m_wrappers); >- ASSERT(m_role == AnimValRole); >- if (m_ownsValues) >- delete m_values; >- m_values = values; >- m_ownsValues = shouldOwnValues; >- m_wrappers = wrappers; >- ASSERT(m_values->size() == m_wrappers->size()); >- } >- >- // SVGList::clear() >- ExceptionOr<void> clearValues() >- { >- auto result = canAlterList(); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- m_values->clear(); >- commitChange(); >- return { }; >- } >- >- ExceptionOr<void> clearValuesAndWrappers() >- { >- auto result = canAlterList(); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- detachListWrappers(0); >- m_values->clear(); >- commitChange(); >- return { }; >- } >- >- // SVGList::numberOfItems() >- unsigned numberOfItems() const >- { >- return m_values->size(); >- } >- >- // SVGList::initialize() >- ExceptionOr<ListItemType> initializeValues(const ListItemType& newItem) >- { >- auto result = canAlterList(); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- // Spec: If the inserted item is already in a list, it is removed from its previous list before it is inserted into this list. >- processIncomingListItemValue(newItem, 0); >- >- // Spec: Clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter. >- m_values->clear(); >- m_values->append(newItem); >- >- commitChange(); >- return ListItemType { newItem }; >- } >- >- ExceptionOr<Ref<ListItemTearOff>> initializeValuesAndWrappers(ListItemTearOff& item) >- { >- ASSERT(m_wrappers); >- >- auto result = canAlterList(); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- ASSERT(m_values->size() == m_wrappers->size()); >- >- Ref<ListItemTearOff> newItem(item); >- >- // Spec: If the inserted item is already in a list, it is removed from its previous list before it is inserted into this list. >- processIncomingListItemWrapper(newItem, 0); >- >- // Spec: Clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter. >- detachListWrappers(0); >- m_values->clear(); >- >- m_values->append(newItem->propertyReference()); >- m_wrappers->append(makeWeakPtr(newItem.get())); >- >- commitChange(); >- return WTFMove(newItem); >- } >- >- // SVGList::getItem() >- ExceptionOr<bool> canGetItem(unsigned index) >- { >- if (index >= m_values->size()) >- return Exception { IndexSizeError }; >- >- return true; >- } >- >- ExceptionOr<ListItemType> getItemValues(unsigned index) >- { >- auto result = canGetItem(index); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- // Spec: Returns the specified item from the list. The returned item is the item itself and not a copy. >- return ListItemType { m_values->at(index) }; >- } >- >- ExceptionOr<Ref<ListItemTearOff>> getItemValuesAndWrappers(AnimatedListPropertyTearOff& animatedList, unsigned index) >- { >- ASSERT(m_wrappers); >- >- auto result = canGetItem(index); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- // Spec: Returns the specified item from the list. The returned item is the item itself and not a copy. >- // Any changes made to the item are immediately reflected in the list. >- ASSERT(m_values->size() == m_wrappers->size()); >- RefPtr<ListItemTearOff> wrapper = static_cast<ListItemTearOff*>(m_wrappers->at(index).get()); >- if (!wrapper) { >- // Create new wrapper, which is allowed to directly modify the item in the list, w/o copying and cache the wrapper in our map. >- // It is also associated with our animated property, so it can notify the SVG Element which holds the SVGAnimated*List >- // that it has been modified (and thus can call svgAttributeChanged(associatedAttributeName)). >- wrapper = ListItemTearOff::create(animatedList, UndefinedRole, m_values->at(index)); >- m_wrappers->at(index) = makeWeakPtr(*wrapper); >- } >- >- return wrapper.releaseNonNull(); >- } >- >- // SVGList::insertItemBefore() >- ExceptionOr<ListItemType> insertItemBeforeValues(const ListItemType& newItem, unsigned index) >- { >- auto result = canAlterList(); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- // Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list. >- if (index > m_values->size()) >- index = m_values->size(); >- >- // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list. >- if (!processIncomingListItemValue(newItem, &index)) { >- // Inserting the item before itself is a no-op. >- return ListItemType { newItem }; >- } >- >- // Spec: Inserts a new item into the list at the specified position. The index of the item before which the new item is to be >- // inserted. The first item is number 0. If the index is equal to 0, then the new item is inserted at the front of the list. >- m_values->insert(index, newItem); >- >- commitChange(); >- return ListItemType { newItem }; >- } >- >- ExceptionOr<Ref<ListItemTearOff>> insertItemBeforeValuesAndWrappers(ListItemTearOff& item, unsigned index) >- { >- ASSERT(m_wrappers); >- >- auto result = canAlterList(); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- // Spec: If the index is greater than or equal to numberOfItems, then the new item is appended to the end of the list. >- if (index > m_values->size()) >- index = m_values->size(); >- >- ASSERT(m_values->size() == m_wrappers->size()); >- >- Ref<ListItemTearOff> newItem(item); >- >- // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list. >- if (!processIncomingListItemWrapper(newItem, &index)) >- return WTFMove(newItem); >- >- // Spec: Inserts a new item into the list at the specified position. The index of the item before which the new item is to be >- // inserted. The first item is number 0. If the index is equal to 0, then the new item is inserted at the front of the list. >- m_values->insert(index, newItem->propertyReference()); >- >- // Store new wrapper at position 'index', change its underlying value, so mutations of newItem, directly affect the item in the list. >- m_wrappers->insert(index, makeWeakPtr(newItem.get())); >- >- commitChange(); >- return WTFMove(newItem); >- } >- >- // SVGList::replaceItem() >- ExceptionOr<bool> canReplaceItem(unsigned index) >- { >- auto result = canAlterList(); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- if (index >= m_values->size()) >- return Exception { IndexSizeError }; >- >- return true; >- } >- >- ExceptionOr<ListItemType> replaceItemValues(const ListItemType& newItem, unsigned index) >- { >- auto result = canReplaceItem(index); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list. >- // Spec: If the item is already in this list, note that the index of the item to replace is before the removal of the item. >- if (!processIncomingListItemValue(newItem, &index)) { >- // Replacing the item with itself is a no-op. >- return ListItemType { newItem }; >- } >- >- if (m_values->isEmpty()) { >- // 'newItem' already lived in our list, we removed it, and now we're empty, which means there's nothing to replace. >- return Exception { IndexSizeError }; >- } >- >- // Update the value at the desired position 'index'. >- m_values->at(index) = newItem; >- >- commitChange(); >- return ListItemType { newItem }; >- } >- >- ExceptionOr<Ref<ListItemTearOff>> replaceItemValuesAndWrappers(ListItemTearOff& item, unsigned index) >- { >- ASSERT(m_wrappers); >- >- auto result = canReplaceItem(index); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- ASSERT(m_values->size() == m_wrappers->size()); >- >- Ref<ListItemTearOff> newItem(item); >- >- // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list. >- // Spec: If the item is already in this list, note that the index of the item to replace is before the removal of the item. >- if (!processIncomingListItemWrapper(newItem, &index)) >- return WTFMove(newItem); >- >- if (m_values->isEmpty()) { >- ASSERT(m_wrappers->isEmpty()); >- // 'newItem' already lived in our list, we removed it, and now we're empty, which means there's nothing to replace. >- return Exception { IndexSizeError }; >- } >- >- // Detach the existing wrapper. >- RefPtr<ListItemTearOff> oldItem = static_cast<ListItemTearOff*>(m_wrappers->at(index).get()); >- if (oldItem) >- oldItem->detachWrapper(); >- >- // Update the value and the wrapper at the desired position 'index'. >- m_values->at(index) = newItem->propertyReference(); >- m_wrappers->at(index) = makeWeakPtr(newItem.get()); >- >- commitChange(); >- return WTFMove(newItem); >- } >- >- // SVGList::removeItem() >- ExceptionOr<bool> canRemoveItem(unsigned index) >- { >- auto result = canAlterList(); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- if (index >= m_values->size()) >- return Exception { IndexSizeError }; >- >- return true; >- } >- >- ExceptionOr<ListItemType> removeItemValues(unsigned index) >- { >- auto result = canRemoveItem(index); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- ListItemType oldItem = m_values->at(index); >- m_values->remove(index); >- >- commitChange(); >- return WTFMove(oldItem); >- } >- >- ExceptionOr<Ref<ListItemTearOff>> removeItemValuesAndWrappers(AnimatedListPropertyTearOff& animatedList, unsigned index) >- { >- ASSERT(m_wrappers); >- >- auto result = canRemoveItem(index); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- ASSERT(m_values->size() == m_wrappers->size()); >- >- // Detach the existing wrapper. >- RefPtr<ListItemTearOff> oldItem = static_cast<ListItemTearOff*>(m_wrappers->at(index).get()); >- if (!oldItem) >- oldItem = ListItemTearOff::create(animatedList, UndefinedRole, m_values->at(index)); >- >- oldItem->detachWrapper(); >- m_wrappers->remove(index); >- m_values->remove(index); >- >- commitChange(); >- return oldItem.releaseNonNull(); >- } >- >- // SVGList::appendItem() >- ExceptionOr<ListItemType> appendItemValues(const ListItemType& newItem) >- { >- auto result = canAlterList(); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list. >- processIncomingListItemValue(newItem, 0); >- >- // Append the value at the end of the list. >- m_values->append(newItem); >- >- commitChange(ListModificationAppend); >- return ListItemType { newItem }; >- } >- >- ExceptionOr<Ref<ListItemTearOff>> appendItemValuesAndWrappers(ListItemTearOff& item) >- { >- ASSERT(m_wrappers); >- >- auto result = canAlterList(); >- if (result.hasException()) >- return result.releaseException(); >- ASSERT(result.releaseReturnValue()); >- >- ASSERT(m_values->size() == m_wrappers->size()); >- >- Ref<ListItemTearOff> newItem(item); >- >- // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list. >- processIncomingListItemWrapper(newItem, 0); >- >- // Append the value and wrapper at the end of the list. >- m_values->append(newItem->propertyReference()); >- m_wrappers->append(makeWeakPtr(newItem.get())); >- >- commitChange(ListModificationAppend); >- return WTFMove(newItem); >- } >- >- PropertyType& values() >- { >- ASSERT(m_values); >- return *m_values; >- } >- >- ListWrapperCache& wrappers() const >- { >- ASSERT(m_wrappers); >- return *m_wrappers; >- } >- >-protected: >- SVGListProperty(SVGPropertyRole role, PropertyType& values, ListWrapperCache* wrappers) >- : m_role(role) >- , m_ownsValues(false) >- , m_values(&values) >- , m_wrappers(wrappers) >- { >- } >- >- virtual ~SVGListProperty() >- { >- if (m_ownsValues) >- delete m_values; >- } >- >- void commitChange() override = 0; >- virtual void commitChange(ListModification) >- { >- commitChange(); >- } >- >- virtual bool processIncomingListItemValue(const ListItemType& newItem, unsigned* indexToModify) = 0; >- virtual bool processIncomingListItemWrapper(Ref<ListItemTearOff>& newItem, unsigned* indexToModify) = 0; >- >- SVGPropertyRole m_role; >- bool m_ownsValues; >- PropertyType* m_values; >- ListWrapperCache* m_wrappers; >-}; >- >-} >diff --git a/Source/WebCore/svg/properties/SVGListPropertyTearOff.h b/Source/WebCore/svg/properties/SVGListPropertyTearOff.h >deleted file mode 100644 >index 1e049de1305..00000000000 >--- a/Source/WebCore/svg/properties/SVGListPropertyTearOff.h >+++ /dev/null >@@ -1,208 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010. 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 "SVGListProperty.h" >- >-namespace WebCore { >- >-template<typename PropertyType> >-class SVGListPropertyTearOff : public SVGListProperty<PropertyType> { >-public: >- using Base = SVGListProperty<PropertyType>; >- using Self = SVGListPropertyTearOff<PropertyType>; >- >- using ListItemType = typename SVGPropertyTraits<PropertyType>::ListItemType; >- using ListItemTearOff = typename SVGPropertyTraits<PropertyType>::ListItemTearOff; >- using PtrListItemTearOff = RefPtr<ListItemTearOff>; >- using AnimatedListPropertyTearOff = SVGAnimatedListPropertyTearOff<PropertyType>; >- using ListWrapperCache = typename SVGAnimatedListPropertyTearOff<PropertyType>::ListWrapperCache; >- >- using Base::m_role; >- using Base::m_values; >- using Base::m_wrappers; >- >- static Ref<Self> create(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, PropertyType& values, ListWrapperCache& wrappers) >- { >- return adoptRef(*new Self(animatedProperty, role, values, wrappers)); >- } >- >- int findItem(ListItemTearOff* item) const >- { >- ASSERT(m_values); >- ASSERT(m_wrappers); >- >- unsigned size = m_wrappers->size(); >- ASSERT(size == m_values->size()); >- for (size_t i = 0; i < size; ++i) { >- if (item == m_wrappers->at(i)) >- return i; >- } >- >- return -1; >- } >- >- void removeItemFromList(size_t itemIndex, bool shouldSynchronizeWrappers) >- { >- ASSERT(m_values); >- ASSERT(m_wrappers); >- ASSERT(m_values->size() == m_wrappers->size()); >- ASSERT_WITH_SECURITY_IMPLICATION(itemIndex < m_wrappers->size()); >- >- auto item = m_wrappers->at(itemIndex); >- item->detachWrapper(); >- m_wrappers->remove(itemIndex); >- m_values->remove(itemIndex); >- >- if (shouldSynchronizeWrappers) >- commitChange(); >- } >- >- // SVGList API >- ExceptionOr<void> clear() >- { >- return Base::clearValuesAndWrappers(); >- } >- >- ExceptionOr<Ref<ListItemTearOff>> initialize(ListItemTearOff& newItem) >- { >- return Base::initializeValuesAndWrappers(newItem); >- } >- >- ExceptionOr<Ref<ListItemTearOff>> getItem(unsigned index) >- { >- return Base::getItemValuesAndWrappers(m_animatedProperty.get(), index); >- } >- >- ExceptionOr<Ref<ListItemTearOff>> insertItemBefore(ListItemTearOff& newItem, unsigned index) >- { >- return Base::insertItemBeforeValuesAndWrappers(newItem, index); >- } >- >- ExceptionOr<Ref<ListItemTearOff>> replaceItem(ListItemTearOff& newItem, unsigned index) >- { >- return Base::replaceItemValuesAndWrappers(newItem, index); >- } >- >- ExceptionOr<Ref<ListItemTearOff>> removeItem(unsigned index) >- { >- return Base::removeItemValuesAndWrappers(m_animatedProperty.get(), index); >- } >- >- ExceptionOr<Ref<ListItemTearOff>> appendItem(ListItemTearOff& newItem) >- { >- return Base::appendItemValuesAndWrappers(newItem); >- } >- >-protected: >- SVGListPropertyTearOff(AnimatedListPropertyTearOff& animatedProperty, SVGPropertyRole role, PropertyType& values, ListWrapperCache& wrappers) >- : SVGListProperty<PropertyType>(role, values, &wrappers) >- , m_animatedProperty(animatedProperty) >- { >- } >- >- bool isReadOnly() const override >- { >- if (m_role == AnimValRole) >- return true; >- if (m_animatedProperty->isReadOnly()) >- return true; >- return false; >- } >- >- void commitChange() override >- { >- ASSERT(m_values); >- ASSERT(m_wrappers); >- >- // Update existing wrappers, as the index in the values list has changed. >- unsigned size = m_wrappers->size(); >- ASSERT(size == m_values->size()); >- for (unsigned i = 0; i < size; ++i) { >- auto item = m_wrappers->at(i); >- if (!item) >- continue; >- item->setAnimatedProperty(m_animatedProperty.ptr()); >- item->setValue(m_values->at(i)); >- } >- >- m_animatedProperty->commitChange(); >- } >- >- bool processIncomingListItemValue(const ListItemType&, unsigned*) override >- { >- ASSERT_NOT_REACHED(); >- return true; >- } >- >- bool processIncomingListItemWrapper(Ref<ListItemTearOff>& newItem, unsigned* indexToModify) override >- { >- auto animatedPropertyOfItem = makeRefPtr(newItem->animatedProperty()); >- >- // newItem has been created manually, it doesn't belong to any SVGElement. >- // (for example: "textElement.x.baseVal.appendItem(svgsvgElement.createSVGLength())") >- if (!animatedPropertyOfItem) >- return true; >- >- // newItem belongs to a SVGElement, but its associated SVGAnimatedProperty is not an animated list tear off. >- // (for example: "textElement.x.baseVal.appendItem(rectElement.width.baseVal)") >- if (!animatedPropertyOfItem->isAnimatedListTearOff()) { >- // We have to copy the incoming newItem, as we're not allowed to insert this tear off as is into our wrapper cache. >- // Otherwhise we'll end up having two SVGAnimatedPropertys that operate on the same SVGPropertyTearOff. Consider the example above: >- // SVGRectElements SVGAnimatedLength 'width' property baseVal points to the same tear off object >- // that's inserted into SVGTextElements SVGAnimatedLengthList 'x'. textElement.x.baseVal.getItem(0).value += 150 would >- // mutate the rectElement width _and_ the textElement x list. That's obviously wrong, take care of that. >- newItem = ListItemTearOff::create(newItem->propertyReference()); >- return true; >- } >- >- // Spec: If newItem is already in a list, it is removed from its previous list before it is inserted into this list. >- // 'newItem' is already living in another list. If it's not our list, synchronize the other lists wrappers after the removal. >- bool livesInOtherList = animatedPropertyOfItem != m_animatedProperty.ptr(); >- AnimatedListPropertyTearOff* propertyTearOff = static_cast<AnimatedListPropertyTearOff*>(animatedPropertyOfItem.get()); >- int indexToRemove = propertyTearOff->findItem(newItem.ptr()); >- ASSERT(indexToRemove != -1); >- >- // Do not remove newItem if already in this list at the target index. >- if (!livesInOtherList && indexToModify && static_cast<unsigned>(indexToRemove) == *indexToModify) >- return false; >- >- propertyTearOff->removeItemFromList(indexToRemove, true); >- >- if (!indexToModify) >- return true; >- >- // If the item lived in our list, adjust the insertion index. >- if (!livesInOtherList) { >- unsigned& index = *indexToModify; >- // Spec: If the item is already in this list, note that the index of the item to (replace|insert before) is before the removal of the item. >- if (static_cast<unsigned>(indexToRemove) < index) >- --index; >- } >- >- return true; >- } >- >- // Back pointer to the animated property that created us >- // For example (text.x.baseVal): m_animatedProperty points to the 'x' SVGAnimatedLengthList object >- Ref<AnimatedListPropertyTearOff> m_animatedProperty; >-}; >- >-} >diff --git a/Source/WebCore/svg/properties/SVGMatrixTearOff.h b/Source/WebCore/svg/properties/SVGMatrixTearOff.h >deleted file mode 100644 >index 332260a630d..00000000000 >--- a/Source/WebCore/svg/properties/SVGMatrixTearOff.h >+++ /dev/null >@@ -1,57 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010. 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 "SVGMatrix.h" >-#include "SVGTransform.h" >- >-namespace WebCore { >- >-class SVGMatrixTearOff final : public SVGMatrix { >-public: >- static Ref<SVGMatrixTearOff> create(SVGTransform& parent, SVGMatrixValue& value) >- { >- ASSERT_UNUSED(value, &parent.propertyReference().svgMatrix() == &value); >- auto result = adoptRef(*new SVGMatrixTearOff(parent)); >- parent.addChild(makeWeakPtr(result.get())); >- return result; >- } >- >- SVGMatrixValue& propertyReference() final { return m_parent->propertyReference().svgMatrix(); } >- >- void setValue(SVGMatrixValue& value) final { m_parent->propertyReference().setMatrix(value); } >- >- void commitChange() final >- { >- m_parent->propertyReference().updateSVGMatrix(); >- m_parent->commitChange(); >- } >- >-private: >- SVGMatrixTearOff(SVGTransform& parent) >- : SVGMatrix(nullptr) >- , m_parent(&parent) >- { >- } >- >- RefPtr<SVGTransform> m_parent; >-}; >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/properties/SVGPrimitiveList.h b/Source/WebCore/svg/properties/SVGPrimitiveList.h >new file mode 100644 >index 00000000000..971aa1f4bf9 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGPrimitiveList.h >@@ -0,0 +1,75 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGList.h" >+ >+namespace WebCore { >+ >+template<typename PropertyType> >+class SVGPrimitiveList : public SVGList<PropertyType> { >+protected: >+ using Base = SVGList<PropertyType>; >+ using Base::Base; >+ using Base::size; >+ using Base::m_items; >+ >+ PropertyType at(unsigned index) const override >+ { >+ ASSERT(index < size()); >+ return m_items.at(index); >+ } >+ >+ PropertyType insert(unsigned index, PropertyType&& newItem) override >+ { >+ ASSERT(index <= size()); >+ m_items.insert(index, WTFMove(newItem)); >+ return at(index); >+ } >+ >+ PropertyType replace(unsigned index, PropertyType&& newItem) override >+ { >+ ASSERT(index < size()); >+ m_items.at(index) = WTFMove(newItem); >+ return at(index); >+ } >+ >+ PropertyType remove(unsigned index) override >+ { >+ ASSERT(index < size()); >+ PropertyType item = at(index); >+ m_items.remove(index); >+ return WTFMove(item); >+ } >+ >+ PropertyType append(PropertyType&& newItem) override >+ { >+ m_items.append(WTFMove(newItem)); >+ return at(size() - 1); >+ } >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGPrimitivePropertyAnimator.h b/Source/WebCore/svg/properties/SVGPrimitivePropertyAnimator.h >new file mode 100644 >index 00000000000..fdccd13bad5 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGPrimitivePropertyAnimator.h >@@ -0,0 +1,80 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGPropertyAnimator.h" >+#include "SVGPropertyTraits.h" >+ >+namespace WebCore { >+ >+template<typename PropertyType, typename AnimationFunction> >+class SVGPrimitivePropertyAnimator : public SVGPropertyAnimator<AnimationFunction> { >+ using Base = SVGPropertyAnimator<AnimationFunction>; >+ using Base::Base; >+ using Base::applyAnimatedStylePropertyChange; >+ using Base::computeCSSPropertyValue; >+ using Base::m_function; >+ >+public: >+ void start(SVGElement* targetElement) override >+ { >+ String baseValue = computeCSSPropertyValue(targetElement, cssPropertyID(m_attributeName.localName())); >+ m_property->setValue(SVGPropertyTraits<PropertyType>::fromString(baseValue)); >+ } >+ >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) override >+ { >+ PropertyType& animated = m_property->value(); >+ m_function.progress(targetElement, percentage, repeatCount, animated); >+ } >+ >+ void apply(SVGElement* targetElement) override >+ { >+ applyAnimatedStylePropertyChange(targetElement, SVGPropertyTraits<PropertyType>::toString(m_property->value())); >+ } >+ >+protected: >+ using ValuePropertyType = SVGValueProperty<PropertyType>; >+ using Base::m_attributeName; >+ >+ template<typename... Arguments> >+ SVGPrimitivePropertyAnimator(const QualifiedName& attributeName, Arguments&&... arguments) >+ : Base(attributeName, std::forward<Arguments>(arguments)...) >+ , m_property(ValuePropertyType::create()) >+ { >+ } >+ >+ template<typename... Arguments> >+ SVGPrimitivePropertyAnimator(const QualifiedName& attributeName, Ref<ValuePropertyType>&& property, Arguments&&... arguments) >+ : Base(attributeName, std::forward<Arguments>(arguments)...) >+ , m_property(WTFMove(property)) >+ { >+ } >+ >+ Ref<ValuePropertyType> m_property; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGPrimitivePropertyAnimatorImpl.h b/Source/WebCore/svg/properties/SVGPrimitivePropertyAnimatorImpl.h >new file mode 100644 >index 00000000000..16b76c852c8 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGPrimitivePropertyAnimatorImpl.h >@@ -0,0 +1,101 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimationFunction.h" >+#include "SVGPrimitivePropertyAnimator.h" >+ >+namespace WebCore { >+ >+class SVGColorAnimator final : public SVGPrimitivePropertyAnimator<Color, SVGAnimationColorFunction> { >+ using Base = SVGPrimitivePropertyAnimator<Color, SVGAnimationColorFunction>; >+ using Base::Base; >+ >+public: >+ static Ref<SVGAnimator> create(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGColorAnimator(attributeName, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ RefPtr<SVGAnimator> createSibling(AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) final >+ { >+ return adoptRef(*new SVGColorAnimator(m_attributeName, m_property.copyRef(), animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+}; >+ >+class SVGNumberAnimator : public SVGPrimitivePropertyAnimator<float, SVGAnimationNumberFunction> { >+ using Base = SVGPrimitivePropertyAnimator<float, SVGAnimationNumberFunction>; >+ using Base::Base; >+ >+public: >+ static Ref<SVGAnimator> create(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGNumberAnimator(attributeName, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ RefPtr<SVGAnimator> createSibling(AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) final >+ { >+ return adoptRef(*new SVGNumberAnimator(m_attributeName, m_property.copyRef(), animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+}; >+ >+class SVGRectAnimator : public SVGPrimitivePropertyAnimator<FloatRect, SVGAnimationRectFunction> { >+ using Base = SVGPrimitivePropertyAnimator<FloatRect, SVGAnimationRectFunction>; >+ using Base::Base; >+ >+public: >+ static Ref<SVGAnimator> create(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGRectAnimator(attributeName, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ RefPtr<SVGAnimator> createSibling(AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) final >+ { >+ return adoptRef(*new SVGRectAnimator(m_attributeName, m_property.copyRef(), animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+}; >+ >+class SVGStringAnimator : public SVGPrimitivePropertyAnimator<String, SVGAnimationStringFunction> { >+ using Base = SVGPrimitivePropertyAnimator<String, SVGAnimationStringFunction>; >+ using Base::Base; >+ >+public: >+ static Ref<SVGAnimator> create(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGStringAnimator(attributeName, animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+ >+private: >+ RefPtr<SVGAnimator> createSibling(AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) final >+ { >+ return adoptRef(*new SVGStringAnimator(m_attributeName, m_property.copyRef(), animationMode, calcMode, isAccumulated, isAdditive)); >+ } >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGProperty.h b/Source/WebCore/svg/properties/SVGProperty.h >index 54b6457df4e..bdb7e913217 100644 >--- a/Source/WebCore/svg/properties/SVGProperty.h >+++ b/Source/WebCore/svg/properties/SVGProperty.h >@@ -1,5 +1,6 @@ > /* > * 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 >@@ -19,22 +20,77 @@ > > #pragma once > >+#include "SVGPropertyOwner.h" >+#include "SVGPropertyTraits.h" > #include <wtf/RefCounted.h> > > namespace WebCore { > >-enum SVGPropertyRole { >- UndefinedRole, >- BaseValRole, >- AnimValRole >-}; >+class SVGElement; >+ >+enum class SVGPropertyAccess : uint8_t { ReadWrite, ReadOnly }; >+enum class SVGPropertyState : uint8_t { Clean, Dirty }; > > class SVGProperty : public RefCounted<SVGProperty> { > public: > virtual ~SVGProperty() = default; > >- virtual bool isReadOnly() const = 0; >- virtual void commitChange() = 0; >+ // Managing the relationship with the owner. >+ bool isAttached() const { return m_owner; } >+ void attach(SVGPropertyOwner* owner, SVGPropertyAccess access) >+ { >+ ASSERT(!m_owner); >+ ASSERT(m_state == SVGPropertyState::Clean); >+ m_owner = owner; >+ m_access = access; >+ } >+ void detach() >+ { >+ m_owner = nullptr; >+ m_access = SVGPropertyAccess::ReadWrite; >+ m_state = SVGPropertyState::Clean; >+ } >+ const SVGElement* contextElement() const >+ { >+ if (!m_owner) >+ return nullptr; >+ return m_owner->attributeContextElement(); >+ } >+ void commitChange() >+ { >+ if (!m_owner) >+ return; >+ m_owner->commitPropertyChange(this); >+ } >+ >+ // DOM access. >+ SVGPropertyAccess access() const { return m_access; } >+ bool isReadOnly() const { return m_access == SVGPropertyAccess::ReadOnly; } >+ >+ // Synchronizing the SVG attribute and its reflection here. >+ bool isDirty() const { return m_state == SVGPropertyState::Dirty; } >+ void setDirty() { m_state = SVGPropertyState::Dirty; } >+ std::optional<String> synchronize() >+ { >+ if (m_state == SVGPropertyState::Clean) >+ return std::nullopt; >+ m_state = SVGPropertyState::Clean; >+ return valueAsString(); >+ } >+ >+ // This is used when calling setAttribute(). >+ virtual String valueAsString() const { return emptyString(); } >+ >+protected: >+ SVGProperty(SVGPropertyOwner* owner = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite) >+ : m_owner(owner) >+ , m_access(access) >+ { >+ } >+ >+ SVGPropertyOwner* m_owner { nullptr }; >+ SVGPropertyAccess m_access { SVGPropertyAccess::ReadWrite }; >+ SVGPropertyState m_state { SVGPropertyState::Clean }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/svg/properties/SVGPropertyAccessor.h b/Source/WebCore/svg/properties/SVGPropertyAccessor.h >new file mode 100644 >index 00000000000..4696b1f4a3a >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGPropertyAccessor.h >@@ -0,0 +1,49 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAccessorPtr.h" >+ >+namespace WebCore { >+ >+template<typename OwnerType, typename PropertyType> >+class SVGPropertyAccessor : public SVGAccessorPtr<OwnerType, PropertyType> { >+ using Base = SVGAccessorPtr<OwnerType, PropertyType>; >+ >+public: >+ using Base::Base; >+ >+protected: >+ using Base::property; >+ using Base::singleton; >+ >+ bool matches(const OwnerType& owner, const SVGProperty& property) const override >+ { >+ return this->property(owner).ptr() == &property; >+ } >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGPropertyAccessorImpl.h b/Source/WebCore/svg/properties/SVGPropertyAccessorImpl.h >new file mode 100644 >index 00000000000..4b182ba553c >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGPropertyAccessorImpl.h >@@ -0,0 +1,54 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGPropertyAccessor.h" >+#include "SVGStringList.h" >+#include "SVGTransformList.h" >+ >+namespace WebCore { >+ >+template<typename OwnerType> >+class SVGStringListAccessor final : public SVGPropertyAccessor<OwnerType, SVGStringList> { >+ using Base = SVGPropertyAccessor<OwnerType, SVGStringList>; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGStringList> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGStringListAccessor, property>(); } >+}; >+ >+template<typename OwnerType> >+class SVGTransformListAccessor final : public SVGPropertyAccessor<OwnerType, SVGTransformList> { >+ using Base = SVGPropertyAccessor<OwnerType, SVGTransformList>; >+ >+public: >+ using Base::Base; >+ template<Ref<SVGTransformList> OwnerType::*property> >+ constexpr static const SVGAccessor<OwnerType>& singleton() { return Base::template singleton<SVGTransformListAccessor, property>(); } >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGPropertyAnimator.h b/Source/WebCore/svg/properties/SVGPropertyAnimator.h >new file mode 100644 >index 00000000000..ee8cb252484 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGPropertyAnimator.h >@@ -0,0 +1,104 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "CSSComputedStyleDeclaration.h" >+#include "CSSPropertyParser.h" >+#include "SVGAnimator.h" >+#include "SVGElement.h" >+ >+namespace WebCore { >+ >+template<typename AnimationFunction> >+class SVGPropertyAnimator : public SVGAnimator { >+public: >+ bool isDiscrete() const override { return m_function.isDiscrete(); } >+ >+ void setFromAndToValues(SVGElement* targetElement, const String& from, const String& to) override >+ { >+ m_function.setFromAndToValues(targetElement, adjustForInheritance(targetElement, from), adjustForInheritance(targetElement, to)); >+ } >+ >+ void setFromAndByValues(SVGElement* targetElement, const String& from, const String& by) override >+ { >+ m_function.setFromAndByValues(targetElement, from, by); >+ } >+ >+ void setToAtEndOfDurationValue(const String& toAtEndOfDuration) override >+ { >+ m_function.setToAtEndOfDurationValue(toAtEndOfDuration); >+ } >+ >+protected: >+ template<typename... Arguments> >+ SVGPropertyAnimator(const QualifiedName& attributeName, Arguments&&... arguments) >+ : SVGAnimator(attributeName) >+ , m_function(std::forward<Arguments>(arguments)...) >+ { >+ } >+ >+ void stop(SVGElement* targetElement) override >+ { >+ removeAnimatedStyleProperty(targetElement); >+ } >+ >+ float calculateDistance(SVGElement* targetElement, const String& from, const String& to) const override >+ { >+ return m_function.calculateDistance(targetElement, from, to); >+ } >+ >+ String adjustForInheritance(SVGElement* targetElement, const String& value) const >+ { >+ static NeverDestroyed<const AtomicString> inherit("inherit", AtomicString::ConstructFromLiteral); >+ return value == inherit ? computeInheritedCSSPropertyValue(targetElement) : value; >+ } >+ >+ String computeCSSPropertyValue(SVGElement* targetElement, CSSPropertyID id) const >+ { >+ ASSERT(targetElement); >+ >+ // Don't include any properties resulting from CSS Transitions/Animations or SMIL animations, as we want to retrieve the "base value". >+ targetElement->setUseOverrideComputedStyle(true); >+ RefPtr<CSSValue> value = ComputedStyleExtractor(targetElement).propertyValue(id); >+ targetElement->setUseOverrideComputedStyle(false); >+ return value ? value->cssText() : String(); >+ } >+ >+ String computeInheritedCSSPropertyValue(SVGElement* targetElement) const >+ { >+ ASSERT(targetElement); >+ auto parent = makeRefPtr(targetElement->parentElement()); >+ if (!parent || !parent->isSVGElement()) >+ return emptyString(); >+ >+ SVGElement& svgParent = downcast<SVGElement>(*parent); >+ return computeCSSPropertyValue(&svgParent, cssPropertyID(m_attributeName.localName())); >+ } >+ >+ AnimationFunction m_function; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGPropertyAnimatorCreator.h b/Source/WebCore/svg/properties/SVGPropertyAnimatorCreator.h >new file mode 100644 >index 00000000000..533c859ab1d >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGPropertyAnimatorCreator.h >@@ -0,0 +1,173 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGNames.h" >+#include "SVGPrimitivePropertyAnimatorImpl.h" >+#include "SVGValuePropertyAnimatorImpl.h" >+#include "SVGValuePropertyListAnimatorImpl.h" >+ >+namespace WebCore { >+ >+class SVGPropertyAnimatorCreator { >+public: >+ SVGPropertyAnimatorCreator() = default; >+ >+ static bool isKnownAttribute(const QualifiedName& attributeName) >+ { >+ return attributeAnimatorCreator().contains(attributeName.impl()); >+ } >+ >+ RefPtr<SVGAnimator> createAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ auto creatorIterator = attributeAnimatorCreator().find(attributeName.impl()); >+ if (creatorIterator == attributeAnimatorCreator().end()) >+ return nullptr; >+ >+ auto addResult = m_attributeAnimator.ensure(attributeName, [&creatorIterator, &attributeName, animationMode, calcMode, isAccumulated, isAdditive]() { >+ return creatorIterator->value(attributeName, animationMode, calcMode, isAccumulated, isAdditive); >+ }); >+ >+ if (addResult.isNewEntry) >+ return addResult.iterator->value.copyRef(); >+ >+ return addResult.iterator->value->createSibling(animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ void animatorWillBeDeleted(const Ref<SVGAnimator>&) >+ { >+ // FIXME: Delete the entry of SVGAnimator from m_attributeAnimator. >+ } >+ >+private: >+ using AttributeAnimatorCreator = HashMap< >+ QualifiedName::QualifiedNameImpl*, >+ std::function<Ref<SVGAnimator>(const QualifiedName&, AnimationMode, CalcMode, bool, bool)> >+ >; >+ >+ static const AttributeAnimatorCreator& attributeAnimatorCreator() >+ { >+ static NeverDestroyed<AttributeAnimatorCreator> map = AttributeAnimatorCreator({ >+ { SVGNames::colorAttr->impl(), SVGPropertyAnimatorCreator::createColorAnimator }, >+ { SVGNames::fillAttr->impl(), SVGPropertyAnimatorCreator::createColorAnimator }, >+ { SVGNames::flood_colorAttr->impl(), SVGPropertyAnimatorCreator::createColorAnimator }, >+ { SVGNames::lighting_colorAttr->impl(), SVGPropertyAnimatorCreator::createColorAnimator }, >+ { SVGNames::stop_colorAttr->impl(), SVGPropertyAnimatorCreator::createColorAnimator }, >+ { SVGNames::strokeAttr->impl(), SVGPropertyAnimatorCreator::createColorAnimator }, >+ >+ { SVGNames::font_sizeAttr->impl(), SVGPropertyAnimatorCreator::createLengthAnimator }, >+ { SVGNames::kerningAttr->impl(), SVGPropertyAnimatorCreator::createLengthAnimator }, >+ { SVGNames::letter_spacingAttr->impl(), SVGPropertyAnimatorCreator::createLengthAnimator }, >+ { SVGNames::stroke_dashoffsetAttr->impl(), SVGPropertyAnimatorCreator::createLengthAnimator }, >+ { SVGNames::stroke_widthAttr->impl(), SVGPropertyAnimatorCreator::createLengthAnimator }, >+ { SVGNames::word_spacingAttr->impl(), SVGPropertyAnimatorCreator::createLengthAnimator }, >+ >+ { SVGNames::stroke_dasharrayAttr->impl(), SVGPropertyAnimatorCreator::createLengthListAnimator }, >+ >+ { SVGNames::fill_opacityAttr->impl(), SVGPropertyAnimatorCreator::createNumberAnimator }, >+ { SVGNames::flood_opacityAttr->impl(), SVGPropertyAnimatorCreator::createNumberAnimator }, >+ { SVGNames::opacityAttr->impl(), SVGPropertyAnimatorCreator::createNumberAnimator }, >+ { SVGNames::stop_opacityAttr->impl(), SVGPropertyAnimatorCreator::createNumberAnimator }, >+ { SVGNames::stroke_miterlimitAttr->impl(), SVGPropertyAnimatorCreator::createNumberAnimator }, >+ { SVGNames::stroke_opacityAttr->impl(), SVGPropertyAnimatorCreator::createNumberAnimator }, >+ >+ { SVGNames::clipAttr->impl(), SVGPropertyAnimatorCreator::createRectAnimator }, >+ >+ { SVGNames::alignment_baselineAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::baseline_shiftAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::buffered_renderingAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::clip_pathAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::clip_ruleAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::color_interpolationAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::color_interpolation_filtersAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::color_profileAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::color_renderingAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::cursorAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::displayAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::dominant_baselineAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::fill_ruleAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::filterAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::font_familyAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::font_stretchAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::font_styleAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::font_variantAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::font_weightAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::image_renderingAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::marker_endAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::marker_midAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::marker_startAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::maskAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::mask_typeAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::overflowAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::paint_orderAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::pointer_eventsAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::shape_renderingAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::stroke_linecapAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::stroke_linejoinAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::text_anchorAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::text_decorationAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::text_renderingAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::vector_effectAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator }, >+ { SVGNames::visibilityAttr->impl(), SVGPropertyAnimatorCreator::createStringAnimator } >+ }); >+ return map; >+ } >+ >+ static Ref<SVGAnimator> createColorAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return SVGColorAnimator::create(attributeName, animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ static Ref<SVGAnimator> createLengthAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return SVGLengthAnimator::create(attributeName, animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ static Ref<SVGAnimator> createLengthListAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return SVGLengthListAnimator::create(attributeName, animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ static Ref<SVGAnimator> createNumberAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return SVGNumberAnimator::create(attributeName, animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ static Ref<SVGAnimator> createRectAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return SVGRectAnimator::create(attributeName, animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ static Ref<SVGAnimator> createStringAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return SVGStringAnimator::create(attributeName, animationMode, calcMode, isAccumulated, isAdditive); >+ } >+ >+ using AttributeAnimator = HashMap<QualifiedName, Ref<SVGAnimator>>; >+ AttributeAnimator m_attributeAnimator; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGPropertyList.h b/Source/WebCore/svg/properties/SVGPropertyList.h >new file mode 100644 >index 00000000000..c69e24613c6 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGPropertyList.h >@@ -0,0 +1,137 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGList.h" >+ >+namespace WebCore { >+ >+template<typename PropertyType> >+class SVGPropertyList : public SVGList<Ref<PropertyType>>, public SVGPropertyOwner { >+public: >+ using BaseList = SVGList<Ref<PropertyType>>; >+ using BaseList::isEmpty; >+ using BaseList::size; >+ using BaseList::append; >+ >+protected: >+ using SVGPropertyOwner::SVGPropertyOwner; >+ using BaseList::m_items; >+ using BaseList::m_access; >+ using BaseList::m_owner; >+ >+ SVGPropertyList(SVGPropertyOwner* owner = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite) >+ : BaseList(owner, access) >+ { >+ } >+ >+ ~SVGPropertyList() >+ { >+ // Detach the items from the list before it is deleted. >+ detachItems(); >+ } >+ >+ void detachItems() override >+ { >+ for (auto& item : m_items) >+ item->detach(); >+ } >+ >+ SVGPropertyOwner* owner() const override { return m_owner; } >+ >+ void commitPropertyChange(SVGProperty*) override >+ { >+ if (owner()) >+ owner()->commitPropertyChange(this); >+ } >+ >+ Ref<PropertyType> at(unsigned index) const override >+ { >+ ASSERT(index < size()); >+ return m_items.at(index).copyRef(); >+ } >+ >+ Ref<PropertyType> insert(unsigned index, Ref<PropertyType>&& newItem) override >+ { >+ ASSERT(index <= size()); >+ >+ // Spec: if newItem is not a detached object, then set newItem to be >+ // a clone object of newItem. >+ if (newItem->isAttached()) >+ newItem = newItem->clone(); >+ >+ // Spec: Attach newItem to the list object. >+ newItem->attach(this, m_access); >+ m_items.insert(index, WTFMove(newItem)); >+ return at(index); >+ } >+ >+ Ref<PropertyType> replace(unsigned index, Ref<PropertyType>&& newItem) override >+ { >+ ASSERT(index < size()); >+ Ref<PropertyType>& item = m_items[index]; >+ >+ // Spec: Detach item. >+ item->detach(); >+ >+ // Spec: if newItem is not a detached object, then set newItem to be >+ // a clone object of newItem. >+ if (newItem->isAttached()) >+ item = newItem->clone(); >+ else >+ item = WTFMove(newItem); >+ >+ // Spec: Attach newItem to the list object. >+ item->attach(this, m_access); >+ return at(index); >+ } >+ >+ Ref<PropertyType> remove(unsigned index) override >+ { >+ ASSERT(index < size()); >+ Ref<PropertyType> item = at(index); >+ >+ // Spec: Detach item. >+ item->detach(); >+ m_items.remove(index); >+ return WTFMove(item); >+ } >+ >+ Ref<PropertyType> append(Ref<PropertyType>&& newItem) override >+ { >+ // Spec: if newItem is not a detached object, then set newItem to be >+ // a clone object of newItem. >+ if (newItem->isAttached()) >+ newItem = newItem->clone(); >+ >+ // Spec: Attach newItem to the list object. >+ newItem->attach(this, m_access); >+ m_items.append(WTFMove(newItem)); >+ return at(size() - 1); >+ } >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h b/Source/WebCore/svg/properties/SVGPropertyOwner.h >similarity index 62% >rename from Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h >rename to Source/WebCore/svg/properties/SVGPropertyOwner.h >index 00d03b01edc..db6f09df977 100644 >--- a/Source/WebCore/svg/properties/SVGAttributeOwnerProxy.h >+++ b/Source/WebCore/svg/properties/SVGPropertyOwner.h >@@ -25,36 +25,35 @@ > > #pragma once > >-#include "SVGAnimatedPropertyType.h" >+#include "QualifiedName.h" > > namespace WebCore { >- >-class SVGAnimatedProperty; >-class SVGAttribute; >+ > class SVGElement; >+class SVGProperty; > >-class SVGAttributeOwnerProxy { >+class SVGPropertyOwner { > public: >- SVGAttributeOwnerProxy(SVGElement& element) >- : m_element(element) >+ virtual ~SVGPropertyOwner() = default; >+ >+ virtual SVGPropertyOwner* owner() const { return nullptr; } >+ >+ virtual const SVGElement* attributeContextElement() const > { >+ if (!owner()) >+ return nullptr; >+ return owner()->attributeContextElement(); > } > >- virtual ~SVGAttributeOwnerProxy() = default; >- >- SVGElement& element() const { return m_element; } >- >- virtual void synchronizeAttributes() const = 0; >- virtual void synchronizeAttribute(const QualifiedName&) const = 0; >- >- virtual Vector<AnimatedPropertyType> animatedTypes(const QualifiedName&) const = 0; >- >- virtual RefPtr<SVGAnimatedProperty> lookupOrCreateAnimatedProperty(const SVGAttribute&) const = 0; >- virtual RefPtr<SVGAnimatedProperty> lookupAnimatedProperty(const SVGAttribute&) const = 0; >- virtual Vector<RefPtr<SVGAnimatedProperty>> lookupOrCreateAnimatedProperties(const QualifiedName&) const = 0; >+ virtual void commitPropertyChange(SVGProperty* property) >+ { >+ if (!owner()) >+ return; >+ owner()->commitPropertyChange(property); >+ } > > protected: >- SVGElement& m_element; >+ SVGPropertyOwner() = default; > }; > > } >diff --git a/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h b/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h >new file mode 100644 >index 00000000000..85fbf01f161 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGPropertyOwnerRegistry.h >@@ -0,0 +1,339 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimatedPropertyAccessorImpl.h" >+#include "SVGAnimatedPropertyPairAccessorImpl.h" >+#include "SVGPropertyAccessorImpl.h" >+#include "SVGPropertyRegistry.h" >+#include <wtf/HashMap.h> >+ >+namespace WebCore { >+ >+class SVGAnimator; >+ >+template<typename OwnerType, typename... BaseTypes> >+class SVGPropertyOwnerRegistry : public SVGPropertyRegistry { >+public: >+ SVGPropertyOwnerRegistry(OwnerType& owner) >+ : m_owner(owner) >+ { >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGStringList> OwnerType::*property> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGStringListAccessor<OwnerType>::template singleton<property>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGTransformList> OwnerType::*property> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGTransformListAccessor<OwnerType>::template singleton<property>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedBoolean> OwnerType::*property> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedBooleanAccessor<OwnerType>::template singleton<property>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, typename EnumType, Ref<SVGAnimatedEnumeration> OwnerType::*property> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedEnumerationAccessor<OwnerType, EnumType>::template singleton<property>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedInteger> OwnerType::*property> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedIntegerAccessor<OwnerType>::template singleton<property>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedNumber> OwnerType::*property> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedNumberAccessor<OwnerType>::template singleton<property>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedRect> OwnerType::*property> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedRectAccessor<OwnerType>::template singleton<property>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedString> OwnerType::*property> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedStringAccessor<OwnerType>::template singleton<property>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedLength> OwnerType::*property> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedLengthAccessor<OwnerType>::template singleton<property>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedPreserveAspectRatio> OwnerType::*property> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedPreserveAspectRatioAccessor<OwnerType>::template singleton<property>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedLengthList> OwnerType::*property> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedLengthListAccessor<OwnerType>::template singleton<property>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedNumberList> OwnerType::*property> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedNumberListAccessor<OwnerType>::template singleton<property>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedPathSegList> OwnerType::*property> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedPathSegListAccessor<OwnerType>::template singleton<property>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedPointList> OwnerType::*property> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedPointListAccessor<OwnerType>::template singleton<property>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedTransformList> OwnerType::*property> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedTransformListAccessor<OwnerType>::template singleton<property>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedInteger> OwnerType::*property1, Ref<SVGAnimatedInteger> OwnerType::*property2> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedIntegerPairAccessor<OwnerType>::template singleton<property1, property2>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedNumber> OwnerType::*property1, Ref<SVGAnimatedNumber> OwnerType::*property2> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedNumberPairAccessor<OwnerType>::template singleton<property1, property2>()); >+ } >+ >+ template<const LazyNeverDestroyed<const QualifiedName>& attributeName, Ref<SVGAnimatedAngle> OwnerType::*property1, Ref<SVGAnimatedOrientType> OwnerType::*property2> >+ static void registerProperty() >+ { >+ registerProperty(attributeName, SVGAnimatedAngleOrientAccessor<OwnerType>::template singleton<property1, property2>()); >+ } >+ >+ // Enumrate all the SVGAccessors recursively. The functor will be called and will >+ // be given the pair<QualifiedName, SVGAccessor> till the functor returns false. >+ template<typename Functor> >+ static bool enumerateRecursively(const Functor& functor) >+ { >+ for (const auto& entry : attributeNameToAccessorMap()) { >+ if (!functor(entry)) >+ return false; >+ } >+ return enumerateRecursivelyBaseTypes(functor); >+ } >+ >+ // Returns true if OwnerType owns a property whose name is attributeName. >+ static bool isKnownAttribute(const QualifiedName& attributeName) >+ { >+ return findAccessor(attributeName); >+ } >+ >+ // Returns true if OwnerType owns a property whose name is attributeName >+ // and its type is SVGAnimatedLength. >+ static bool isAnimatedLengthAttribute(const QualifiedName& attributeName) >+ { >+ if (const auto* accessor = findAccessor(attributeName)) >+ return accessor->isAnimatedLength(); >+ return false; >+ } >+ >+ QualifiedName propertyAttributeName(const SVGProperty& property) const override >+ { >+ QualifiedName attributeName = nullQName(); >+ enumerateRecursively([&](const auto& entry) -> bool { >+ if (!entry.value->matches(m_owner, property)) >+ return true; >+ attributeName = entry.key; >+ return false; >+ }); >+ return attributeName; >+ } >+ >+ QualifiedName animatedPropertyAttributeName(const SVGAnimatedProperty& animatedProperty) const override >+ { >+ QualifiedName attributeName = nullQName(); >+ enumerateRecursively([&](const auto& entry) -> bool { >+ if (!entry.value->matches(m_owner, animatedProperty)) >+ return true; >+ attributeName = entry.key; >+ return false; >+ }); >+ return attributeName; >+ } >+ >+ // Detach all the properties recursively from their OwnerTypes. >+ void detachAllProperties() const override >+ { >+ enumerateRecursively([&](const auto& entry) -> bool { >+ entry.value->detach(m_owner); >+ return true; >+ }); >+ } >+ >+ // Finds the property whose name is attributeName and returns the synchronize >+ // string through the associated SVGAccessor. >+ std::optional<String> synchronize(const QualifiedName& attributeName) const override >+ { >+ std::optional<String> value; >+ enumerateRecursively([&](const auto& entry) -> bool { >+ if (!entry.key.matches(attributeName)) >+ return true; >+ value = entry.value->synchronize(m_owner); >+ return false; >+ }); >+ return value; >+ } >+ >+ // Enumerate recursively the SVGAccessors of the OwnerType and all its BaseTypes. >+ // Collect all the pairs <AttributeName, String> only for the dirty properties. >+ HashMap<QualifiedName, String> synchronizeAllAttributes() const override >+ { >+ HashMap<QualifiedName, String> map; >+ enumerateRecursively([&](const auto& entry) -> bool { >+ if (auto string = entry.value->synchronize(m_owner)) >+ map.add(entry.key, *string); >+ return true; >+ }); >+ return map; >+ } >+ >+ // This is a virtual function because SVGElement will access it through the base class. >+ bool isAnimatedPropertyAttribute(const QualifiedName& attributeName) const override >+ { >+ bool isAnimatedPropertyAttribute = false; >+ enumerateRecursively([&attributeName, &isAnimatedPropertyAttribute](const auto& entry) -> bool { >+ if (!entry.key.matches(attributeName)) >+ return true; >+ isAnimatedPropertyAttribute = entry.value->isAnimatedProperty(); >+ return false; >+ }); >+ return isAnimatedPropertyAttribute; >+ } >+ >+ // This is a virtual function because SVGElement will access it through the base class. >+ bool isAnimatedStylePropertyAttribute(const QualifiedName& attributeName) const override >+ { >+ static NeverDestroyed<HashSet<QualifiedName::QualifiedNameImpl*>> animatedStyleAttributes = std::initializer_list<QualifiedName::QualifiedNameImpl*> { >+ SVGNames::cxAttr->impl(), >+ SVGNames::cyAttr->impl(), >+ SVGNames::rAttr->impl(), >+ SVGNames::rxAttr->impl(), >+ SVGNames::ryAttr->impl(), >+ SVGNames::heightAttr->impl(), >+ SVGNames::widthAttr->impl(), >+ SVGNames::xAttr->impl(), >+ SVGNames::yAttr->impl() >+ }; >+ return isAnimatedLengthAttribute(attributeName) && animatedStyleAttributes.get().contains(attributeName.impl()); >+ } >+ >+ // Creates an SVGAnimator for a given attributeName. >+ RefPtr<SVGAnimator> createAnimator(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) const override >+ { >+ RefPtr<SVGAnimator> animator; >+ enumerateRecursively([&](const auto& entry) -> bool { >+ if (!entry.key.matches(attributeName)) >+ return true; >+ animator = entry.value->createAnimator(m_owner, attributeName, animationMode, calcMode, isAccumulated, isAdditive); >+ return false; >+ }); >+ return animator; >+ } >+ >+ void appendAnimatedInstance(const QualifiedName& attributeName, RefPtr<SVGAnimator>& animator) const override >+ { >+ enumerateRecursively([&](const auto& entry) -> bool { >+ if (!entry.key.matches(attributeName)) >+ return true; >+ entry.value->appendAnimatedInstance(m_owner, animator); >+ return false; >+ }); >+ } >+ >+private: >+ // Singleton map for every OwnerType. >+ static HashMap<QualifiedName, const SVGAccessor<OwnerType>*>& attributeNameToAccessorMap() >+ { >+ static NeverDestroyed<HashMap<QualifiedName, const SVGAccessor<OwnerType>*>> attributeNameToAccessorMap; >+ return attributeNameToAccessorMap; >+ } >+ >+ static void registerProperty(const QualifiedName& attributeName, const SVGAccessor<OwnerType>& propertyAccessor) >+ { >+ attributeNameToAccessorMap().add(attributeName, &propertyAccessor); >+ } >+ >+ // This is a template function with parameter 'I' whose default value = 0. So you can call it without any parameter >+ // from enumerateRecursively(). It returns true and is enable_if<I == sizeof...(BaseTypes)>. So it is mainly for >+ // breaking the recursion. >+ template<typename Functor, size_t I = 0> >+ static typename std::enable_if<I == sizeof...(BaseTypes), bool>::type enumerateRecursivelyBaseTypes(const Functor&) { return true; } >+ >+ // This version of animatedTypesBaseTypes() is enable_if<I < sizeof...(BaseTypes)>. >+ template<typename Functor, size_t I = 0> >+ static typename std::enable_if<I < sizeof...(BaseTypes), bool>::type enumerateRecursivelyBaseTypes(const Functor& functor) >+ { >+ // Get the base type at index 'I' using std::tuple and std::tuple_element. >+ using BaseType = typename std::tuple_element<I, typename std::tuple<BaseTypes...>>::type; >+ if (!BaseType::PropertyRegistry::enumerateRecursively(functor)) >+ return false; >+ // BaseType does not want to break the recursion. So recurse to the next BaseType. >+ return enumerateRecursivelyBaseTypes<Functor, I + 1>(functor); >+ } >+ >+ static const SVGAccessor<OwnerType>* findAccessor(const QualifiedName& attributeName) >+ { >+ // Here we need to loop through the entries in the map and use matches() to compare them with attributeName. >+ // m_map.contains() uses QualifiedName::operator==() which compares the impl pointers only while matches() >+ // compares the contents if the impl pointers differ. >+ auto it = std::find_if(attributeNameToAccessorMap().begin(), attributeNameToAccessorMap().end(), [&attributeName](const auto& entry) -> bool { >+ return entry.key.matches(attributeName); >+ }); >+ return it != attributeNameToAccessorMap().end() ? it->value : nullptr; >+ } >+ >+ OwnerType& m_owner; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGPropertyRegistry.h b/Source/WebCore/svg/properties/SVGPropertyRegistry.h >new file mode 100644 >index 00000000000..6ebb2fa52c6 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGPropertyRegistry.h >@@ -0,0 +1,52 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimator.h" >+ >+namespace WebCore { >+ >+class SVGAnimatedProperty; >+class SVGProperty; >+ >+class SVGPropertyRegistry { >+public: >+ SVGPropertyRegistry() = default; >+ virtual ~SVGPropertyRegistry() = default; >+ >+ virtual void detachAllProperties() const = 0; >+ virtual QualifiedName propertyAttributeName(const SVGProperty&) const = 0; >+ virtual QualifiedName animatedPropertyAttributeName(const SVGAnimatedProperty&) const = 0; >+ virtual std::optional<String> synchronize(const QualifiedName&) const = 0; >+ virtual HashMap<QualifiedName, String> synchronizeAllAttributes() const = 0; >+ >+ virtual bool isAnimatedPropertyAttribute(const QualifiedName&) const = 0; >+ virtual bool isAnimatedStylePropertyAttribute(const QualifiedName&) const = 0; >+ virtual RefPtr<SVGAnimator> createAnimator(const QualifiedName&, AnimationMode, CalcMode, bool isAccumulated, bool isAdditive) const = 0; >+ virtual void appendAnimatedInstance(const QualifiedName& attributeName, RefPtr<SVGAnimator>&) const = 0; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGPropertyTearOff.h b/Source/WebCore/svg/properties/SVGPropertyTearOff.h >deleted file mode 100644 >index 9008f3b8645..00000000000 >--- a/Source/WebCore/svg/properties/SVGPropertyTearOff.h >+++ /dev/null >@@ -1,174 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010. All rights reserved. >- * Copyright (C) 2016 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 "ExceptionOr.h" >-#include "SVGAnimatedProperty.h" >-#include "SVGProperty.h" >-#include <wtf/WeakPtr.h> >- >-namespace WebCore { >- >-class SVGElement; >- >-class SVGPropertyTearOffBase : public SVGProperty { >-public: >- virtual void detachWrapper() = 0; >-}; >- >-template<typename T> >-class SVGPropertyTearOff : public SVGPropertyTearOffBase, public CanMakeWeakPtr<SVGPropertyTearOff<T>> { >-public: >- using PropertyType = T; >- using Self = SVGPropertyTearOff<PropertyType>; >- >- // Used for child types (baseVal/animVal) of a SVGAnimated* property (for example: SVGAnimatedLength::baseVal()). >- // Also used for list tear offs (for example: text.x.baseVal.getItem(0)). >- static Ref<Self> create(SVGAnimatedProperty& animatedProperty, SVGPropertyRole role, PropertyType& value) >- { >- return adoptRef(*new Self(animatedProperty, role, value)); >- } >- >- // Used for non-animated POD types (for example: SVGSVGElement::createSVGLength()). >- static Ref<Self> create(const PropertyType& initialValue) >- { >- return adoptRef(*new Self(initialValue)); >- } >- >- template<typename U> static ExceptionOr<Ref<Self>> create(ExceptionOr<U>&& initialValue) >- { >- if (initialValue.hasException()) >- return initialValue.releaseException(); >- return create(initialValue.releaseReturnValue()); >- } >- >- virtual PropertyType& propertyReference() { return *m_value; } >- SVGAnimatedProperty* animatedProperty() const { return m_animatedProperty.get(); } >- >- virtual void setValue(PropertyType& value) >- { >- if (m_valueIsCopy) { >- detachChildren(); >- delete m_value; >- } >- m_valueIsCopy = false; >- m_value = &value; >- } >- >- void setAnimatedProperty(SVGAnimatedProperty* animatedProperty) >- { >- m_animatedProperty = animatedProperty; >- } >- >- SVGElement* contextElement() const >- { >- if (!m_animatedProperty || m_valueIsCopy) >- return nullptr; >- return m_animatedProperty->contextElement(); >- } >- >- void addChild(WeakPtr<SVGPropertyTearOffBase> child) >- { >- m_childTearOffs.append(child); >- } >- >- void detachWrapper() override >- { >- if (m_valueIsCopy) >- return; >- >- detachChildren(); >- >- // Switch from a live value, to a non-live value. >- // For example: <text x="50"/> >- // var item = text.x.baseVal.getItem(0); >- // text.setAttribute("x", "100"); >- // item.value still has to report '50' and it has to be possible to modify 'item' >- // w/o changing the "new item" (with x=100) in the text element. >- // Whenever the XML DOM modifies the "x" attribute, all existing wrappers are detached, using this function. >- m_value = new PropertyType(*m_value); >- m_valueIsCopy = true; >- m_animatedProperty = nullptr; >- } >- >- void commitChange() override >- { >- if (!m_animatedProperty || m_valueIsCopy) >- return; >- m_animatedProperty->commitChange(); >- } >- >- bool isReadOnly() const override >- { >- if (m_role == AnimValRole) >- return true; >- if (m_animatedProperty && m_animatedProperty->isReadOnly()) >- return true; >- return false; >- } >- >-protected: >- SVGPropertyTearOff(SVGAnimatedProperty* animatedProperty, SVGPropertyRole role, PropertyType& value) >- : m_animatedProperty(animatedProperty) >- , m_role(role) >- , m_value(&value) >- , m_valueIsCopy(false) >- { >- } >- >- SVGPropertyTearOff(const PropertyType& initialValue) >- : SVGPropertyTearOff(&initialValue) >- { >- } >- >- SVGPropertyTearOff(const PropertyType* initialValue) >- : m_animatedProperty(nullptr) >- , m_role(UndefinedRole) >- , m_value(initialValue ? new PropertyType(*initialValue) : nullptr) >- , m_valueIsCopy(true) >- { >- } >- >- virtual ~SVGPropertyTearOff() >- { >- if (m_valueIsCopy) { >- detachChildren(); >- delete m_value; >- } >- } >- >- void detachChildren() >- { >- for (const auto& childTearOff : m_childTearOffs) { >- if (childTearOff.get()) >- childTearOff.get()->detachWrapper(); >- } >- m_childTearOffs.clear(); >- } >- >- RefPtr<SVGAnimatedProperty> m_animatedProperty; >- SVGPropertyRole m_role; >- PropertyType* m_value; >- Vector<WeakPtr<SVGPropertyTearOffBase>> m_childTearOffs; >- bool m_valueIsCopy; >-}; >- >-} >diff --git a/Source/WebCore/svg/properties/SVGStaticListPropertyTearOff.h b/Source/WebCore/svg/properties/SVGStaticListPropertyTearOff.h >deleted file mode 100644 >index 786874dca01..00000000000 >--- a/Source/WebCore/svg/properties/SVGStaticListPropertyTearOff.h >+++ /dev/null >@@ -1,111 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010. 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 "SVGListProperty.h" >- >-namespace WebCore { >- >-template<typename PropertyType> >-class SVGStaticListPropertyTearOff : public SVGListProperty<PropertyType> { >-public: >- using Self = SVGStaticListPropertyTearOff<PropertyType>; >- using Base = SVGListProperty<PropertyType>; >- >- using ListItemType = typename SVGPropertyTraits<PropertyType>::ListItemType; >- using ListItemTearOff = typename SVGPropertyTraits<PropertyType>::ListItemTearOff; >- >- using Base::m_role; >- using Base::m_values; >- >- static Ref<Self> create(SVGElement& contextElement, PropertyType& values) >- { >- return adoptRef(*new Self(contextElement, values)); >- } >- >- ExceptionOr<void> clear() >- { >- return Base::clearValues(); >- } >- >- ExceptionOr<ListItemType> initialize(const ListItemType& newItem) >- { >- return Base::initializeValues(newItem); >- } >- >- ExceptionOr<ListItemType> getItem(unsigned index) >- { >- return Base::getItemValues(index); >- } >- >- ExceptionOr<ListItemType> insertItemBefore(const ListItemType& newItem, unsigned index) >- { >- return Base::insertItemBeforeValues(newItem, index); >- } >- >- ExceptionOr<ListItemType> replaceItem(const ListItemType& newItem, unsigned index) >- { >- return Base::replaceItemValues(newItem, index); >- } >- >- ExceptionOr<ListItemType> removeItem(unsigned index) >- { >- return Base::removeItemValues(index); >- } >- >- ExceptionOr<ListItemType> appendItem(const ListItemType& newItem) >- { >- return Base::appendItemValues(newItem); >- } >- >-protected: >- SVGStaticListPropertyTearOff(SVGElement* contextElement, PropertyType& values) >- : Base(UndefinedRole, values, nullptr) >- , m_contextElement(*contextElement) >- { >- } >- >- bool isReadOnly() const override >- { >- return m_role == AnimValRole; >- } >- >- void commitChange() override >- { >- ASSERT(m_values); >- m_values->commitChange(m_contextElement); >- } >- >- bool processIncomingListItemValue(const ListItemType&, unsigned*) override >- { >- // no-op for static lists >- return true; >- } >- >- bool processIncomingListItemWrapper(Ref<ListItemTearOff>&, unsigned*) override >- { >- ASSERT_NOT_REACHED(); >- return true; >- } >- >- Ref<SVGElement> m_contextElement; >-}; >- >-} >diff --git a/Source/WebCore/svg/properties/SVGStaticPropertyTearOff.h b/Source/WebCore/svg/properties/SVGStaticPropertyTearOff.h >deleted file mode 100644 >index 5e2ca09a0dd..00000000000 >--- a/Source/WebCore/svg/properties/SVGStaticPropertyTearOff.h >+++ /dev/null >@@ -1,61 +0,0 @@ >-/* >- * Copyright (C) Research In Motion Limited 2010. 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 >- >-namespace WebCore { >- >-#if COMPILER(MSVC) >-// UpdateMethod is 12 bytes. We have to pack to a size greater than or equal to that to avoid an >-// alignment warning (C4121). 16 is the next-largest size allowed for packing, so we use that. >-#pragma pack(push, 16) >-#endif >-template<typename ContextElement, typename PropertyTearOff> >-class SVGStaticPropertyTearOff final : public PropertyTearOff { >-public: >- using Self = SVGStaticPropertyTearOff<ContextElement, PropertyTearOff>; >- using PropertyType = typename PropertyTearOff::PropertyType; >- >- typedef void (ContextElement::*UpdateMethod)(); >- >- // Used for non-animated POD types that are not associated with a SVGAnimatedProperty object, nor with a XML DOM attribute >- // (for example: SVGSVGElement::currentTranslate). >- static Ref<Self> create(ContextElement& contextElement, PropertyType& value, UpdateMethod update) >- { >- return adoptRef(*new Self(contextElement, value, update)); >- } >- >- void commitChange() final { (m_contextElement.get()->*m_update)(); } >- >-private: >- SVGStaticPropertyTearOff(ContextElement& contextElement, PropertyType& value, UpdateMethod update) >- : PropertyTearOff(UndefinedRole, value) >- , m_update(update) >- , m_contextElement(&contextElement) >- { >- } >- >- UpdateMethod m_update; >- RefPtr<ContextElement> m_contextElement; >-}; >-#if COMPILER(MSVC) >-#pragma pack(pop) >-#endif >- >-} // namespace WebCore >diff --git a/Source/WebCore/svg/properties/SVGValueProperty.h b/Source/WebCore/svg/properties/SVGValueProperty.h >new file mode 100644 >index 00000000000..57dc24d78e0 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGValueProperty.h >@@ -0,0 +1,78 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGProperty.h" >+ >+namespace WebCore { >+ >+template<typename PropertyType> >+class SVGValueProperty : public SVGProperty { >+public: >+ using ValueType = PropertyType; >+ >+ static Ref<SVGValueProperty> create() >+ { >+ return adoptRef(*new SVGValueProperty()); >+ } >+ >+ // Getter/Setter for the value. >+ const PropertyType& value() const { return m_value; } >+ void setValue(const PropertyType& value) { m_value = value; } >+ >+ // Used the SVGAnimatedPropertyAnimator to pass m_value to SVGAnimationFunction. >+ PropertyType& value() { return m_value; } >+ >+protected: >+ // Create an initialized property, e.g creating an item to be appended in an SVGList. >+ SVGValueProperty(const PropertyType& value) >+ : m_value(value) >+ { >+ } >+ >+ // Needed when value should not be copied, e.g. SVGTransfromValue. >+ SVGValueProperty(PropertyType&& value) >+ : m_value(WTFMove(value)) >+ { >+ } >+ >+ // Base and default constructor. Do not use "using SVGProperty::SVGProperty" because of Windows and GTK ports. >+ SVGValueProperty(SVGPropertyOwner* owner = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite) >+ : SVGProperty(owner, access) >+ { >+ } >+ >+ // Create an initialized and attached property. >+ SVGValueProperty(SVGPropertyOwner* owner, SVGPropertyAccess access, const PropertyType& value) >+ : SVGProperty(owner, access) >+ , m_value(value) >+ { >+ } >+ >+ PropertyType m_value; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGValuePropertyAnimator.h b/Source/WebCore/svg/properties/SVGValuePropertyAnimator.h >new file mode 100644 >index 00000000000..cac280bb1c8 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGValuePropertyAnimator.h >@@ -0,0 +1,71 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGPropertyAnimator.h" >+ >+namespace WebCore { >+ >+template<typename PropertyType, typename AnimationFunction> >+class SVGValuePropertyAnimator : public SVGPropertyAnimator<AnimationFunction> { >+ using Base = SVGPropertyAnimator<AnimationFunction>; >+ using Base::Base; >+ using Base::applyAnimatedStylePropertyChange; >+ using Base::m_function; >+ >+public: >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) override >+ { >+ m_function.progress(targetElement, percentage, repeatCount, m_property->value()); >+ } >+ >+ void apply(SVGElement* targetElement) override >+ { >+ applyAnimatedStylePropertyChange(targetElement, m_property->valueAsString()); >+ } >+ >+protected: >+ using Base::computeCSSPropertyValue; >+ using Base::m_attributeName; >+ >+ template<typename... Arguments> >+ SVGValuePropertyAnimator(const QualifiedName& attributeName, Arguments&&... arguments) >+ : Base(attributeName, std::forward<Arguments>(arguments)...) >+ , m_property(PropertyType::create()) >+ { >+ } >+ >+ template<typename... Arguments> >+ SVGValuePropertyAnimator(const QualifiedName& attributeName, Ref<PropertyType>&& property, Arguments&&... arguments) >+ : Base(attributeName, std::forward<Arguments>(arguments)...) >+ , m_property(WTFMove(property)) >+ { >+ } >+ >+ Ref<PropertyType> m_property; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGValuePropertyAnimatorImpl.h b/Source/WebCore/svg/properties/SVGValuePropertyAnimatorImpl.h >new file mode 100644 >index 00000000000..c55941db3c3 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGValuePropertyAnimatorImpl.h >@@ -0,0 +1,60 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimationFunction.h" >+#include "SVGValuePropertyAnimator.h" >+ >+namespace WebCore { >+ >+class SVGLengthAnimator final : public SVGValuePropertyAnimator<SVGLength, SVGAnimationLengthFunction> { >+ using Base = SVGValuePropertyAnimator<SVGLength, SVGAnimationLengthFunction>; >+ using Base::Base; >+ using Base::m_attributeName; >+ using Base::m_property; >+ >+public: >+ static Ref<SVGAnimator> create(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGLengthAnimator(attributeName, animationMode, calcMode, isAccumulated, isAdditive, LengthModeOther)); >+ } >+ >+ void start(SVGElement* targetElement) override >+ { >+ String baseValue = computeCSSPropertyValue(targetElement, cssPropertyID(m_attributeName.localName())); >+ SVGLengthValue value(LengthModeOther); >+ if (!value.setValueAsString(baseValue).hasException()) >+ m_property->setValue(value); >+ } >+ >+private: >+ RefPtr<SVGAnimator> createSibling(AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) final >+ { >+ return adoptRef(*new SVGLengthAnimator(m_attributeName, m_property.copyRef(), animationMode, calcMode, isAccumulated, isAdditive, LengthModeOther)); >+ } >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGValuePropertyList.h b/Source/WebCore/svg/properties/SVGValuePropertyList.h >new file mode 100644 >index 00000000000..1a401135ac3 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGValuePropertyList.h >@@ -0,0 +1,89 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGPropertyList.h" >+ >+namespace WebCore { >+ >+template<typename PropertyType> >+class SVGValuePropertyList : public SVGPropertyList<PropertyType> { >+public: >+ using Base = SVGPropertyList<PropertyType>; >+ using Base::clearItems; >+ using Base::items; >+ using Base::size; >+ >+ SVGValuePropertyList& operator=(const SVGValuePropertyList& other) >+ { >+ clearItems(); >+ for (const auto& item : other.items()) >+ append(PropertyType::create(item->value())); >+ return *this; >+ } >+ >+ // This casting operator returns a Vector of the underlying ValueType, >+ // for example Vector<float> from SVGNumberList. >+ operator Vector<typename PropertyType::ValueType>() const >+ { >+ Vector<typename PropertyType::ValueType> values; >+ for (const auto& item : items()) >+ values.append(item->value()); >+ return values; >+ } >+ >+ void resize(size_t newSize) >+ { >+ // Add new items. >+ while (size() < newSize) >+ append(PropertyType::create()); >+ >+ // Remove existing items. >+ while (size() > newSize) >+ remove(size() - 1); >+ } >+ >+protected: >+ using Base::append; >+ using Base::remove; >+ >+ // Base and default constructor. Do not use "using Base::Base" because of Windows and GTK ports. >+ SVGValuePropertyList(SVGPropertyOwner* owner = nullptr, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite) >+ : Base(owner, access) >+ { >+ } >+ >+ // Used by SVGAnimatedPropertyList when creating it animVal from baseVal. >+ SVGValuePropertyList(const SVGValuePropertyList& other, SVGPropertyAccess access = SVGPropertyAccess::ReadWrite) >+ : Base(other.owner(), access) >+ { >+ // Clone all items. >+ for (const auto& item : other.items()) >+ append(PropertyType::create(item->value())); >+ } >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGValuePropertyListAnimator.h b/Source/WebCore/svg/properties/SVGValuePropertyListAnimator.h >new file mode 100644 >index 00000000000..2eb36a2c078 >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGValuePropertyListAnimator.h >@@ -0,0 +1,71 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGPropertyAnimator.h" >+ >+namespace WebCore { >+ >+template<typename ListType, typename AnimationFunction> >+class SVGValuePropertyListAnimator : public SVGPropertyAnimator<AnimationFunction> { >+ using Base = SVGPropertyAnimator<AnimationFunction>; >+ using Base::Base; >+ using Base::applyAnimatedStylePropertyChange; >+ using Base::m_function; >+ >+public: >+ void progress(SVGElement* targetElement, float percentage, unsigned repeatCount) override >+ { >+ m_function.progress(targetElement, percentage, repeatCount, m_list); >+ } >+ >+ void apply(SVGElement* targetElement) override >+ { >+ applyAnimatedStylePropertyChange(targetElement, m_list->valueAsString()); >+ } >+ >+protected: >+ using Base::computeCSSPropertyValue; >+ using Base::m_attributeName; >+ >+ template<typename... Arguments> >+ SVGValuePropertyListAnimator(const QualifiedName& attributeName, Arguments&&... arguments) >+ : Base(attributeName, std::forward<Arguments>(arguments)...) >+ , m_list(ListType::create()) >+ { >+ } >+ >+ template<typename... Arguments> >+ SVGValuePropertyListAnimator(const QualifiedName& attributeName, RefPtr<ListType>&& list, Arguments&&... arguments) >+ : Base(attributeName, std::forward<Arguments>(arguments)...) >+ , m_list(WTFMove(list)) >+ { >+ } >+ >+ RefPtr<ListType> m_list; >+}; >+ >+} >diff --git a/Source/WebCore/svg/properties/SVGValuePropertyListAnimatorImpl.h b/Source/WebCore/svg/properties/SVGValuePropertyListAnimatorImpl.h >new file mode 100644 >index 00000000000..f4e6ca4e2dc >--- /dev/null >+++ b/Source/WebCore/svg/properties/SVGValuePropertyListAnimatorImpl.h >@@ -0,0 +1,59 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include "SVGAnimationFunction.h" >+#include "SVGValuePropertyListAnimator.h" >+ >+namespace WebCore { >+ >+class SVGLengthListAnimator final : public SVGValuePropertyListAnimator<SVGLengthList, SVGAnimationLengthListFunction> { >+ using Base = SVGValuePropertyListAnimator<SVGLengthList, SVGAnimationLengthListFunction>; >+ using Base::Base; >+ using Base::m_attributeName; >+ using Base::m_list; >+ >+public: >+ static Ref<SVGAnimator> create(const QualifiedName& attributeName, AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) >+ { >+ return adoptRef(*new SVGLengthListAnimator(attributeName, animationMode, calcMode, isAccumulated, isAdditive, LengthModeOther)); >+ } >+ >+ void start(SVGElement* targetElement) override >+ { >+ String baseValue = computeCSSPropertyValue(targetElement, cssPropertyID(m_attributeName.localName())); >+ if (!m_list->parse(baseValue)) >+ m_list->clearItems(); >+ } >+ >+private: >+ RefPtr<SVGAnimator> createSibling(AnimationMode animationMode, CalcMode calcMode, bool isAccumulated, bool isAdditive) final >+ { >+ return adoptRef(*new SVGLengthListAnimator(m_attributeName, m_list.copyRef(), animationMode, calcMode, isAccumulated, isAdditive, LengthModeOther)); >+ } >+}; >+ >+}
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
Flags:
ews-watchlist
:
commit-queue-
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