Changeset 110545 in webkit
- Timestamp:
- Mar 13, 2012 1:27:14 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 37 added
- 110 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r110543 r110545 1 2012-03-12 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 SVG Animations update baseVal instead of animVal 4 https://bugs.webkit.org/show_bug.cgi?id=12437 5 6 Reviewed by Dirk Schulze. 7 8 Update test expectations after turning on animVal support for SVGLength, the first primitive now support animVal. 9 Added several new tests, checking additive behaviour with SVGLength objects, removing animation elements 10 while animations are running (+ test repainting of those cases), etc. 11 12 * platform/mac/svg/repaint/repainting-after-animation-element-removal-expected.png: Added. 13 * platform/mac/svg/repaint/repainting-after-animation-element-removal-expected.txt: Added. 14 * svg/animations/additive-from-to-width-animation-expected.txt: Added. 15 * svg/animations/additive-from-to-width-animation.html: Added. 16 * svg/animations/additive-values-width-animation-expected.txt: Added. 17 * svg/animations/additive-values-width-animation.html: Added. 18 * svg/animations/animVal-basics-expected.txt: 19 * svg/animations/animate-calcMode-spline-by-expected.txt: 20 * svg/animations/animate-calcMode-spline-from-by-expected.txt: 21 * svg/animations/animate-calcMode-spline-from-to-expected.txt: 22 * svg/animations/animate-calcMode-spline-to-expected.txt: 23 * svg/animations/animate-calcMode-spline-values-expected.txt: 24 * svg/animations/animate-elem-02-t-drt-expected.txt: 25 * svg/animations/animate-elem-09-t-drt-expected.txt: 26 * svg/animations/animate-elem-10-t-drt-expected.txt: 27 * svg/animations/animate-elem-11-t-drt-expected.txt: 28 * svg/animations/animate-elem-12-t-drt-expected.txt: 29 * svg/animations/animate-elem-13-t-drt-expected.txt: 30 * svg/animations/animate-elem-14-t-drt-expected.txt: 31 * svg/animations/animate-elem-15-t-drt-expected.txt: 32 * svg/animations/animate-elem-16-t-drt-expected.txt: 33 * svg/animations/animate-elem-17-t-drt-expected.txt: 34 * svg/animations/animate-elem-18-t-drt-expected.txt: 35 * svg/animations/animate-elem-19-t-drt-expected.txt: 36 * svg/animations/animate-end-attribute-expected.txt: 37 * svg/animations/animate-endElement-beginElement-expected.txt: 38 * svg/animations/animate-from-to-keyTimes-expected.txt: 39 * svg/animations/animate-insert-begin-expected.txt: 40 * svg/animations/animate-insert-no-begin-expected.txt: 41 * svg/animations/animate-keySplines-expected.txt: 42 * svg/animations/animate-number-calcMode-discrete-keyTimes-expected.txt: 43 * svg/animations/attributeTypes-expected.txt: 44 * svg/animations/change-baseVal-while-animating-fill-freeze-2-expected.txt: Added. 45 * svg/animations/change-baseVal-while-animating-fill-freeze-2.html: Added. 46 * svg/animations/change-baseVal-while-animating-fill-freeze-expected.txt: Added. 47 * svg/animations/change-baseVal-while-animating-fill-freeze.html: Added. 48 * svg/animations/change-baseVal-while-animating-fill-remove-2-expected.txt: Added. 49 * svg/animations/change-baseVal-while-animating-fill-remove-2.html: Added. 50 * svg/animations/change-baseVal-while-animating-fill-remove-expected.txt: Added. 51 * svg/animations/change-baseVal-while-animating-fill-remove.html: Added. 52 * svg/animations/change-target-while-animating-SVG-property-expected.txt: Added. 53 * svg/animations/change-target-while-animating-SVG-property.html: Added. 54 * svg/animations/multiple-animations-fill-freeze-expected.txt: Added. 55 * svg/animations/multiple-animations-fill-freeze.html: Added. 56 * svg/animations/remove-animation-element-while-animation-is-running-expected.txt: Added. 57 * svg/animations/remove-animation-element-while-animation-is-running.html: Added. 58 * svg/animations/resources/additive-from-to-width-animation.svg: Added. 59 * svg/animations/resources/additive-values-width-animation.svg: Added. 60 * svg/animations/resources/change-baseVal-while-animating-fill-freeze.svg: Added. 61 * svg/animations/resources/change-baseVal-while-animating-fill-remove.svg: Added. 62 * svg/animations/resources/change-target-while-animating-SVG-property.svg: Added. 63 * svg/animations/resources/multiple-animations-fill-freeze.svg: Added. 64 * svg/animations/resources/remove-animation-element-while-animation-is-running.svg: Added. 65 * svg/animations/script-tests/additive-from-to-width-animation.js: Added. 66 (sample1): 67 (sample2): 68 (sample3): 69 (executeTest): 70 * svg/animations/script-tests/additive-values-width-animation.js: Added. 71 (sample1): 72 (sample2): 73 (sample3): 74 (changeBaseVal): 75 (sample4): 76 (sample5): 77 (executeTest): 78 * svg/animations/script-tests/animVal-basics.js: 79 (sample2): 80 (sample3): 81 * svg/animations/script-tests/animate-calcMode-spline-by.js: 82 (sample2): 83 (sample3): 84 * svg/animations/script-tests/animate-calcMode-spline-from-by.js: 85 (sample2): 86 (sample3): 87 * svg/animations/script-tests/animate-calcMode-spline-from-to.js: 88 (sample2): 89 (sample3): 90 * svg/animations/script-tests/animate-calcMode-spline-to.js: 91 (sample2): 92 (sample3): 93 * svg/animations/script-tests/animate-calcMode-spline-values.js: 94 (sample2): 95 (sample3): 96 * svg/animations/script-tests/animate-elem-02-t-drt.js: 97 (sampleAfterBegin): 98 (sampleAfterMid): 99 (sampleAfterBeginOfFirstRepetition): 100 (sampleAfterMidOfFirstRepetition): 101 * svg/animations/script-tests/animate-elem-09-t-drt.js: 102 (sample1): 103 (sample2): 104 (sample3): 105 (sample4): 106 * svg/animations/script-tests/animate-elem-10-t-drt.js: 107 (sample1): 108 (sample2): 109 (sample3): 110 (sample4): 111 * svg/animations/script-tests/animate-elem-11-t-drt.js: 112 (sample1): 113 (sample2): 114 (sample3): 115 (sample4): 116 * svg/animations/script-tests/animate-elem-12-t-drt.js: 117 (sample1): 118 (sample2): 119 (sample3): 120 (sample4): 121 * svg/animations/script-tests/animate-elem-13-t-drt.js: 122 (sample1): 123 (sample2): 124 (sample3): 125 * svg/animations/script-tests/animate-elem-14-t-drt.js: 126 (sample1): 127 (sample2): 128 (sample3): 129 (sample4): 130 * svg/animations/script-tests/animate-elem-15-t-drt.js: 131 (sample1): 132 (sample2): 133 (sample3): 134 (sample4): 135 * svg/animations/script-tests/animate-elem-16-t-drt.js: 136 (sample1): 137 (sample2): 138 (sample3): 139 (sample4): 140 * svg/animations/script-tests/animate-elem-17-t-drt.js: 141 (sample1): 142 (sample2): 143 (sample3): 144 (sample4): 145 * svg/animations/script-tests/animate-elem-18-t-drt.js: 146 (sample1): 147 (sample2): 148 (sample3): 149 (sample4): 150 * svg/animations/script-tests/animate-elem-19-t-drt.js: 151 (sample1): 152 (sample2): 153 (sample3): 154 (sample4): 155 * svg/animations/script-tests/animate-end-attribute.js: 156 (sample2): 157 (sample3): 158 * svg/animations/script-tests/animate-endElement-beginElement.js: 159 (sample1): 160 * svg/animations/script-tests/animate-from-to-keyTimes.js: 161 (sample1): 162 (sample2): 163 * svg/animations/script-tests/animate-insert-begin.js: 164 (sample1): 165 (sample2): 166 * svg/animations/script-tests/animate-insert-no-begin.js: 167 (sample1): 168 (sample2): 169 * svg/animations/script-tests/animate-keySplines.js: 170 (sample1): 171 (sample2): 172 (sample3): 173 * svg/animations/script-tests/animate-number-calcMode-discrete-keyTimes.js: 174 (sample1): 175 (sample2): 176 (sample3): 177 * svg/animations/script-tests/attributeTypes.js: 178 (sample1): 179 (sample2): 180 (sample3): 181 * svg/animations/script-tests/change-baseVal-while-animating-fill-freeze-2.js: Added. 182 (sample1): 183 (sample2): 184 (sample3): 185 (sample4): 186 (sample5): 187 (executeTest): 188 * svg/animations/script-tests/change-baseVal-while-animating-fill-freeze.js: Added. 189 (sample1): 190 (sample2): 191 (sample3): 192 (sample4): 193 (sample5): 194 (executeTest): 195 * svg/animations/script-tests/change-baseVal-while-animating-fill-remove-2.js: Added. 196 (sample1): 197 (sample2): 198 (sample3): 199 (sample4): 200 (sample5): 201 (executeTest): 202 * svg/animations/script-tests/change-baseVal-while-animating-fill-remove.js: Added. 203 (sample1): 204 (sample2): 205 (sample3): 206 (sample4): 207 (sample5): 208 (executeTest): 209 * svg/animations/script-tests/change-target-while-animating-SVG-property.js: Added. 210 (sample1): 211 (sample2): 212 (sample3): 213 (sample4): 214 (sample5): 215 (executeTest): 216 * svg/animations/script-tests/multiple-animations-fill-freeze.js: Added. 217 (sample1): 218 (sample2): 219 (sample3): 220 (sample4): 221 (sample5): 222 (sample6): 223 (sample7): 224 (sample8): 225 (executeTest): 226 * svg/animations/script-tests/remove-animation-element-while-animation-is-running.js: Added. 227 (sample1): 228 (sample2): 229 (sample3): 230 (sample4): 231 (executeTest): 232 * svg/animations/script-tests/svglength-animation-LengthModeHeight.js: 233 (sample2): 234 (sample3): 235 * svg/animations/script-tests/svglength-animation-LengthModeOther.js: 236 (sample2): 237 (sample3): 238 * svg/animations/script-tests/svglength-animation-LengthModeWidth.js: 239 (sample2): 240 (sample3): 241 * svg/animations/script-tests/svglength-animation-invalid-value-1.js: 242 (sample2): 243 * svg/animations/script-tests/svglength-animation-invalid-value-2.js: 244 (sample2): 245 * svg/animations/script-tests/svglength-animation-invalid-value-3.js: 246 (sample2): 247 * svg/animations/script-tests/svglength-animation-number-to-number.js: 248 (sample2): 249 (sample3): 250 * svg/animations/script-tests/svglength-animation-px-to-cm.js: 251 (sample2): 252 (sample3): 253 * svg/animations/script-tests/svglength-animation-px-to-ems.js: 254 (sample2): 255 (sample3): 256 * svg/animations/script-tests/svglength-animation-px-to-exs.js: 257 (sample2): 258 (sample3): 259 * svg/animations/script-tests/svglength-animation-px-to-in.js: 260 (sample2): 261 (sample3): 262 * svg/animations/script-tests/svglength-animation-px-to-number.js: 263 (sample2): 264 (sample3): 265 * svg/animations/script-tests/svglength-animation-px-to-pc.js: 266 (sample2): 267 (sample3): 268 * svg/animations/script-tests/svglength-animation-px-to-percentage.js: 269 (sample2): 270 (sample3): 271 * svg/animations/script-tests/svglength-animation-px-to-pt.js: 272 (sample2): 273 (sample3): 274 * svg/animations/script-tests/svglength-animation-px-to-px.js: 275 (sample2): 276 (sample3): 277 * svg/animations/script-tests/svglength-animation-unitType.js: 278 (sample1): 279 (sample2): 280 (sample3): 281 * svg/animations/script-tests/svglength-animation-values.js: 282 (sample2): 283 (sample3): 284 (sample4): 285 (sample5): 286 * svg/animations/svglength-animation-LengthModeHeight-expected.txt: 287 * svg/animations/svglength-animation-LengthModeOther-expected.txt: 288 * svg/animations/svglength-animation-LengthModeWidth-expected.txt: 289 * svg/animations/svglength-animation-invalid-value-1-expected.txt: 290 * svg/animations/svglength-animation-invalid-value-2-expected.txt: 291 * svg/animations/svglength-animation-invalid-value-3-expected.txt: 292 * svg/animations/svglength-animation-number-to-number-expected.txt: 293 * svg/animations/svglength-animation-px-to-cm-expected.txt: 294 * svg/animations/svglength-animation-px-to-ems-expected.txt: 295 * svg/animations/svglength-animation-px-to-exs-expected.txt: 296 * svg/animations/svglength-animation-px-to-in-expected.txt: 297 * svg/animations/svglength-animation-px-to-number-expected.txt: 298 * svg/animations/svglength-animation-px-to-pc-expected.txt: 299 * svg/animations/svglength-animation-px-to-percentage-expected.txt: 300 * svg/animations/svglength-animation-px-to-pt-expected.txt: 301 * svg/animations/svglength-animation-px-to-px-expected.txt: 302 * svg/animations/svglength-animation-unitType-expected.txt: 303 * svg/animations/svglength-animation-values-expected.txt: 304 * svg/repaint/repainting-after-animation-element-removal.svg: Added. 305 1 306 2012-03-13 Philippe Normand <pnormand@igalia.com> 2 307 -
trunk/LayoutTests/svg/animations/animVal-basics-expected.txt
r107682 r110545 9 9 PASS rect.width.baseVal.value is 200 10 10 PASS rect.width.animVal.value is 150 11 PASS rect.width.baseVal.value is 15011 PASS rect.width.baseVal.value is 200 12 12 PASS rect.width.animVal.value is 100 13 PASS rect.width.baseVal.value is 10013 PASS rect.width.baseVal.value is 200 14 14 PASS rect.width.animVal.value is 200 15 15 PASS rect.width.baseVal.value is 200 -
trunk/LayoutTests/svg/animations/animate-calcMode-spline-by-expected.txt
r107791 r110545 9 9 PASS rect.x.baseVal.value is 100 10 10 PASS rect.x.animVal.value is 18.8 11 PASS rect.x.baseVal.value is 1 8.811 PASS rect.x.baseVal.value is 100 12 12 PASS rect.x.animVal.value is 0 13 PASS rect.x.baseVal.value is 013 PASS rect.x.baseVal.value is 100 14 14 PASS rect.x.animVal.value is 100 15 15 PASS rect.x.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/animate-calcMode-spline-from-by-expected.txt
r107791 r110545 9 9 PASS rect.x.baseVal.value is 100 10 10 PASS rect.x.animVal.value is 18.8 11 PASS rect.x.baseVal.value is 1 8.811 PASS rect.x.baseVal.value is 100 12 12 PASS rect.x.animVal.value is 0 13 PASS rect.x.baseVal.value is 013 PASS rect.x.baseVal.value is 100 14 14 PASS rect.x.animVal.value is 100 15 15 PASS rect.x.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/animate-calcMode-spline-from-to-expected.txt
r107791 r110545 9 9 PASS rect.x.baseVal.value is 100 10 10 PASS rect.x.animVal.value is 18.8 11 PASS rect.x.baseVal.value is 1 8.811 PASS rect.x.baseVal.value is 100 12 12 PASS rect.x.animVal.value is 0 13 PASS rect.x.baseVal.value is 013 PASS rect.x.baseVal.value is 100 14 14 PASS rect.x.animVal.value is 100 15 15 PASS rect.x.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/animate-calcMode-spline-to-expected.txt
r107791 r110545 9 9 PASS rect.x.baseVal.value is 100 10 10 PASS rect.x.animVal.value is 18.8 11 PASS rect.x.baseVal.value is 1 8.811 PASS rect.x.baseVal.value is 100 12 12 PASS rect.x.animVal.value is 0 13 PASS rect.x.baseVal.value is 013 PASS rect.x.baseVal.value is 100 14 14 PASS rect.x.animVal.value is 100 15 15 PASS rect.x.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/animate-calcMode-spline-values-expected.txt
r107791 r110545 9 9 PASS rect.x.baseVal.value is 100 10 10 PASS rect.x.animVal.value is 18.8 11 PASS rect.x.baseVal.value is 1 8.811 PASS rect.x.baseVal.value is 100 12 12 PASS rect.x.animVal.value is 0 13 PASS rect.x.baseVal.value is 013 PASS rect.x.baseVal.value is 100 14 14 PASS rect.x.animVal.value is 100 15 15 PASS rect.x.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/animate-elem-02-t-drt-expected.txt
r109215 r110545 8 8 9 9 PASS rect1.height.animVal.value is 200 10 PASS rect1.height.baseVal.value is 20 10 11 PASS rect2.height.animVal.value is 220 12 PASS rect2.height.baseVal.value is 20 11 13 PASS rect3.height.animVal.value is 200 14 PASS rect3.height.baseVal.value is 20 12 15 PASS rect1.height.animVal.value is 200 16 PASS rect1.height.baseVal.value is 20 13 17 PASS rect2.height.animVal.value is 220 18 PASS rect2.height.baseVal.value is 20 14 19 PASS rect3.height.animVal.value is 200 20 PASS rect3.height.baseVal.value is 20 15 21 PASS rect1.height.animVal.value is 20 22 PASS rect1.height.baseVal.value is 20 16 23 PASS rect2.height.animVal.value is 40 24 PASS rect2.height.baseVal.value is 20 17 25 PASS rect3.height.animVal.value is 20 26 PASS rect3.height.baseVal.value is 20 18 27 PASS rect1.height.animVal.value is 20 28 PASS rect1.height.baseVal.value is 20 19 29 PASS rect2.height.animVal.value is 40 30 PASS rect2.height.baseVal.value is 20 20 31 PASS rect3.height.animVal.value is 20 32 PASS rect3.height.baseVal.value is 20 21 33 PASS rect1.height.animVal.value is 200 34 PASS rect1.height.baseVal.value is 20 22 35 PASS rect2.height.animVal.value is 220 36 PASS rect2.height.baseVal.value is 20 23 37 PASS rect3.height.animVal.value is 220 38 PASS rect3.height.baseVal.value is 20 24 39 PASS rect1.height.animVal.value is 200 40 PASS rect1.height.baseVal.value is 20 25 41 PASS rect2.height.animVal.value is 220 42 PASS rect2.height.baseVal.value is 20 26 43 PASS rect3.height.animVal.value is 220 44 PASS rect3.height.baseVal.value is 20 27 45 PASS rect1.height.animVal.value is 20 46 PASS rect1.height.baseVal.value is 20 28 47 PASS rect2.height.animVal.value is 40 48 PASS rect2.height.baseVal.value is 20 29 49 PASS rect3.height.animVal.value is 40 50 PASS rect3.height.baseVal.value is 20 30 51 PASS rect1.height.animVal.value is 20 52 PASS rect1.height.baseVal.value is 20 31 53 PASS rect2.height.animVal.value is 40 54 PASS rect2.height.baseVal.value is 20 32 55 PASS rect3.height.animVal.value is 40 56 PASS rect3.height.baseVal.value is 20 33 57 PASS rect1.height.animVal.value is 20 58 PASS rect1.height.baseVal.value is 20 34 59 PASS rect2.height.animVal.value is 40 60 PASS rect2.height.baseVal.value is 20 35 61 PASS rect3.height.animVal.value is 40 62 PASS rect3.height.baseVal.value is 20 36 63 PASS rect1.height.animVal.value is 20 64 PASS rect1.height.baseVal.value is 20 37 65 PASS rect2.height.animVal.value is 40 66 PASS rect2.height.baseVal.value is 20 38 67 PASS rect3.height.animVal.value is 40 68 PASS rect3.height.baseVal.value is 20 39 69 PASS successfullyParsed is true 40 70 -
trunk/LayoutTests/svg/animations/animate-elem-09-t-drt-expected.txt
r109215 r110545 8 8 9 9 PASS rect1.height.animVal.value is 210 10 PASS rect1.height.baseVal.value is 210 10 11 PASS rootSVGElement.getTransformToElement(rect2).e is -250 11 12 PASS rootSVGElement.getTransformToElement(rect2).f is -250 12 13 PASS rect1.height.animVal.value is 177 14 PASS rect1.height.baseVal.value is 210 13 15 PASS rootSVGElement.getTransformToElement(rect2).e is -250 14 16 PASS rootSVGElement.getTransformToElement(rect2).f is -217 15 17 PASS rect1.height.animVal.value is 177 18 PASS rect1.height.baseVal.value is 210 16 19 PASS rootSVGElement.getTransformToElement(rect2).e is -250 17 20 PASS rootSVGElement.getTransformToElement(rect2).f is -217 18 21 PASS rect1.height.animVal.value is 121 22 PASS rect1.height.baseVal.value is 210 19 23 PASS rootSVGElement.getTransformToElement(rect2).e is -250 20 24 PASS rootSVGElement.getTransformToElement(rect2).f is -161 21 25 PASS rect1.height.animVal.value is 121 26 PASS rect1.height.baseVal.value is 210 22 27 PASS rootSVGElement.getTransformToElement(rect2).e is -250 23 28 PASS rootSVGElement.getTransformToElement(rect2).f is -161 24 29 PASS rect1.height.animVal.value is 10 30 PASS rect1.height.baseVal.value is 210 25 31 PASS rootSVGElement.getTransformToElement(rect2).e is -250 26 32 PASS rootSVGElement.getTransformToElement(rect2).f is -50 27 33 PASS rect1.height.animVal.value is 10 34 PASS rect1.height.baseVal.value is 210 28 35 PASS rootSVGElement.getTransformToElement(rect2).e is -250 29 36 PASS rootSVGElement.getTransformToElement(rect2).f is -50 30 37 PASS rect1.height.animVal.value is 10 38 PASS rect1.height.baseVal.value is 210 31 39 PASS rootSVGElement.getTransformToElement(rect2).e is -250 32 40 PASS rootSVGElement.getTransformToElement(rect2).f is -50 -
trunk/LayoutTests/svg/animations/animate-elem-10-t-drt-expected.txt
r109215 r110545 8 8 9 9 PASS rect1.height.animVal.value is 210 10 PASS rect1.height.baseVal.value is 210 10 11 PASS rootSVGElement.getTransformToElement(rect2).e is -250 11 12 PASS rootSVGElement.getTransformToElement(rect2).f is -250 12 13 PASS rect1.height.animVal.value is 177 14 PASS rect1.height.baseVal.value is 210 13 15 PASS rootSVGElement.getTransformToElement(rect2).e is -250 14 16 PASS rootSVGElement.getTransformToElement(rect2).f is -217 15 17 PASS rect1.height.animVal.value is 177 18 PASS rect1.height.baseVal.value is 210 16 19 PASS rootSVGElement.getTransformToElement(rect2).e is -250 17 20 PASS rootSVGElement.getTransformToElement(rect2).f is -217 18 21 PASS rect1.height.animVal.value is 121 22 PASS rect1.height.baseVal.value is 210 19 23 PASS rootSVGElement.getTransformToElement(rect2).e is -250 20 24 PASS rootSVGElement.getTransformToElement(rect2).f is -161 21 25 PASS rect1.height.animVal.value is 121 26 PASS rect1.height.baseVal.value is 210 22 27 PASS rootSVGElement.getTransformToElement(rect2).e is -250 23 28 PASS rootSVGElement.getTransformToElement(rect2).f is -161 24 29 PASS rect1.height.animVal.value is 10 30 PASS rect1.height.baseVal.value is 210 25 31 PASS rootSVGElement.getTransformToElement(rect2).e is -250 26 32 PASS rootSVGElement.getTransformToElement(rect2).f is -50 27 33 PASS rect1.height.animVal.value is 10 34 PASS rect1.height.baseVal.value is 210 28 35 PASS rootSVGElement.getTransformToElement(rect2).e is -250 29 36 PASS rootSVGElement.getTransformToElement(rect2).f is -50 30 37 PASS rect1.height.animVal.value is 10 38 PASS rect1.height.baseVal.value is 210 31 39 PASS rootSVGElement.getTransformToElement(rect2).e is -250 32 40 PASS rootSVGElement.getTransformToElement(rect2).f is -50 -
trunk/LayoutTests/svg/animations/animate-elem-11-t-drt-expected.txt
r109215 r110545 8 8 9 9 PASS rect1.height.animVal.value is 210 10 PASS rect1.height.baseVal.value is 210 10 11 PASS rootSVGElement.getTransformToElement(rect2).e is -250 11 12 PASS rootSVGElement.getTransformToElement(rect2).f is -250 12 13 PASS rect1.height.animVal.value is 143.4 14 PASS rect1.height.baseVal.value is 210 13 15 PASS rootSVGElement.getTransformToElement(rect2).e is -250 14 16 PASS rootSVGElement.getTransformToElement(rect2).f is -183.4 15 17 PASS rect1.height.animVal.value is 143.4 18 PASS rect1.height.baseVal.value is 210 16 19 PASS rootSVGElement.getTransformToElement(rect2).e is -250 17 20 PASS rootSVGElement.getTransformToElement(rect2).f is -183.4 18 21 PASS rect1.height.animVal.value is 76.7 22 PASS rect1.height.baseVal.value is 210 19 23 PASS rootSVGElement.getTransformToElement(rect2).e is -250 20 24 PASS rootSVGElement.getTransformToElement(rect2).f is -116.7 21 25 PASS rect1.height.animVal.value is 76.7 26 PASS rect1.height.baseVal.value is 210 22 27 PASS rootSVGElement.getTransformToElement(rect2).e is -250 23 28 PASS rootSVGElement.getTransformToElement(rect2).f is -116.7 24 29 PASS rect1.height.animVal.value is 10 30 PASS rect1.height.baseVal.value is 210 25 31 PASS rootSVGElement.getTransformToElement(rect2).e is -250 26 32 PASS rootSVGElement.getTransformToElement(rect2).f is -50 27 33 PASS rect1.height.animVal.value is 10 34 PASS rect1.height.baseVal.value is 210 28 35 PASS rootSVGElement.getTransformToElement(rect2).e is -250 29 36 PASS rootSVGElement.getTransformToElement(rect2).f is -50 30 37 PASS rect1.height.animVal.value is 10 38 PASS rect1.height.baseVal.value is 210 31 39 PASS rootSVGElement.getTransformToElement(rect2).e is -250 32 40 PASS rootSVGElement.getTransformToElement(rect2).f is -50 -
trunk/LayoutTests/svg/animations/animate-elem-12-t-drt-expected.txt
r109215 r110545 8 8 9 9 PASS rect1.height.animVal.value is 210 10 PASS rect1.height.baseVal.value is 210 10 11 PASS rootSVGElement.getTransformToElement(rect2).e is -250 11 12 PASS rootSVGElement.getTransformToElement(rect2).f is -250 12 13 PASS rect1.height.animVal.value is 177 14 PASS rect1.height.baseVal.value is 210 13 15 PASS rootSVGElement.getTransformToElement(rect2).e is -250 14 16 PASS rootSVGElement.getTransformToElement(rect2).f is -217 15 17 PASS rect1.height.animVal.value is 177 18 PASS rect1.height.baseVal.value is 210 16 19 PASS rootSVGElement.getTransformToElement(rect2).e is -250 17 20 PASS rootSVGElement.getTransformToElement(rect2).f is -217 18 21 PASS rect1.height.animVal.value is 121 22 PASS rect1.height.baseVal.value is 210 19 23 PASS rootSVGElement.getTransformToElement(rect2).e is -250 20 24 PASS rootSVGElement.getTransformToElement(rect2).f is -161 21 25 PASS rect1.height.animVal.value is 121 26 PASS rect1.height.baseVal.value is 210 22 27 PASS rootSVGElement.getTransformToElement(rect2).e is -250 23 28 PASS rootSVGElement.getTransformToElement(rect2).f is -161 24 29 PASS rect1.height.animVal.value is 10 30 PASS rect1.height.baseVal.value is 210 25 31 PASS rootSVGElement.getTransformToElement(rect2).e is -250 26 32 PASS rootSVGElement.getTransformToElement(rect2).f is -50 27 33 PASS rect1.height.animVal.value is 10 34 PASS rect1.height.baseVal.value is 210 28 35 PASS rootSVGElement.getTransformToElement(rect2).e is -250 29 36 PASS rootSVGElement.getTransformToElement(rect2).f is -50 30 37 PASS rect1.height.animVal.value is 10 38 PASS rect1.height.baseVal.value is 210 31 39 PASS rootSVGElement.getTransformToElement(rect2).e is -250 32 40 PASS rootSVGElement.getTransformToElement(rect2).f is -50 -
trunk/LayoutTests/svg/animations/animate-elem-13-t-drt-expected.txt
r109215 r110545 8 8 9 9 PASS rect1.width.animVal.value is 30 10 PASS rect1.width.baseVal.value is 30 10 11 PASS rect1.width.animVal.value is 165 12 PASS rect1.width.baseVal.value is 30 11 13 PASS rect1.width.animVal.value is 300 14 PASS rect1.width.baseVal.value is 30 12 15 PASS rect1.width.animVal.value is 300 16 PASS rect1.width.baseVal.value is 30 13 17 PASS successfullyParsed is true 14 18 -
trunk/LayoutTests/svg/animations/animate-elem-14-t-drt-expected.txt
r109215 r110545 8 8 9 9 PASS rect.width.animVal.value is 300 10 PASS rect.width.baseVal.value is 300 10 11 PASS rect.width.animVal.value is 300 12 PASS rect.width.baseVal.value is 300 11 13 PASS rect.width.animVal.value is 255 14 PASS rect.width.baseVal.value is 300 12 15 PASS rect.width.animVal.value is 255 16 PASS rect.width.baseVal.value is 300 13 17 PASS rect.width.animVal.value is 180 18 PASS rect.width.baseVal.value is 300 14 19 PASS rect.width.animVal.value is 180 20 PASS rect.width.baseVal.value is 300 15 21 FAIL rect.width.animVal.value should be close to 30. Was 180. 22 PASS rect.width.baseVal.value is 300 16 23 FAIL rect.width.animVal.value should be close to 30. Was 180. 24 PASS rect.width.baseVal.value is 300 17 25 FAIL rect.width.animVal.value should be close to 30. Was 180. 26 PASS rect.width.baseVal.value is 300 18 27 FAIL rect.width.animVal.value should be close to 30. Was 180. 28 PASS rect.width.baseVal.value is 300 19 29 FAIL rect.width.animVal.value should be close to 30. Was 180. 30 PASS rect.width.baseVal.value is 300 20 31 PASS rect.width.animVal.value is 30 32 PASS rect.width.baseVal.value is 300 21 33 PASS rect.width.animVal.value is 30 34 PASS rect.width.baseVal.value is 300 22 35 PASS successfullyParsed is true 23 36 -
trunk/LayoutTests/svg/animations/animate-elem-15-t-drt-expected.txt
r109215 r110545 8 8 9 9 PASS rect.width.animVal.value is 300 10 PASS rect.width.baseVal.value is 300 10 11 PASS rect.width.animVal.value is 232.5 12 PASS rect.width.baseVal.value is 300 11 13 PASS rect.width.animVal.value is 232.5 14 PASS rect.width.baseVal.value is 300 12 15 PASS rect.width.animVal.value is 165 16 PASS rect.width.baseVal.value is 300 13 17 PASS rect.width.animVal.value is 165 18 PASS rect.width.baseVal.value is 300 14 19 PASS rect.width.animVal.value is 30 20 PASS rect.width.baseVal.value is 300 15 21 PASS rect.width.animVal.value is 30 22 PASS rect.width.baseVal.value is 300 16 23 PASS rect.width.animVal.value is 30 24 PASS rect.width.baseVal.value is 300 17 25 PASS successfullyParsed is true 18 26 -
trunk/LayoutTests/svg/animations/animate-elem-16-t-drt-expected.txt
r109215 r110545 8 8 9 9 PASS rect.width.animVal.value is 300 10 PASS rect.width.baseVal.value is 300 10 11 PASS rect.width.animVal.value is 255 12 PASS rect.width.baseVal.value is 300 11 13 PASS rect.width.animVal.value is 255 14 PASS rect.width.baseVal.value is 300 12 15 PASS rect.width.animVal.value is 180 16 PASS rect.width.baseVal.value is 300 13 17 PASS rect.width.animVal.value is 180 18 PASS rect.width.baseVal.value is 300 14 19 PASS rect.width.animVal.value is 30 20 PASS rect.width.baseVal.value is 300 15 21 PASS rect.width.animVal.value is 30 22 PASS rect.width.baseVal.value is 300 16 23 PASS rect.width.animVal.value is 30 24 PASS rect.width.baseVal.value is 300 17 25 PASS successfullyParsed is true 18 26 -
trunk/LayoutTests/svg/animations/animate-elem-17-t-drt-expected.txt
r109215 r110545 8 8 9 9 PASS rect.width.animVal.value is 300 10 PASS rect.width.baseVal.value is 300 10 11 PASS rect.width.animVal.value is 255 12 PASS rect.width.baseVal.value is 300 11 13 PASS rect.width.animVal.value is 255 14 PASS rect.width.baseVal.value is 300 12 15 PASS rect.width.animVal.value is 180 16 PASS rect.width.baseVal.value is 300 13 17 PASS rect.width.animVal.value is 180 18 PASS rect.width.baseVal.value is 300 14 19 PASS rect.width.animVal.value is 30 20 PASS rect.width.baseVal.value is 300 15 21 PASS rect.width.animVal.value is 30 22 PASS rect.width.baseVal.value is 300 16 23 PASS rect.width.animVal.value is 30 24 PASS rect.width.baseVal.value is 300 17 25 PASS successfullyParsed is true 18 26 -
trunk/LayoutTests/svg/animations/animate-elem-18-t-drt-expected.txt
r109215 r110545 8 8 9 9 PASS rect.width.animVal.value is 300 10 PASS rect.width.baseVal.value is 300 10 11 PASS rect.width.animVal.value is 300 12 PASS rect.width.baseVal.value is 300 11 13 PASS rect.width.animVal.value is 255 14 PASS rect.width.baseVal.value is 300 12 15 PASS rect.width.animVal.value is 255 16 PASS rect.width.baseVal.value is 300 13 17 PASS rect.width.animVal.value is 180 18 PASS rect.width.baseVal.value is 300 14 19 PASS rect.width.animVal.value is 180 20 PASS rect.width.baseVal.value is 300 15 21 FAIL rect.width.animVal.value should be close to 30. Was 180. 22 PASS rect.width.baseVal.value is 300 16 23 FAIL rect.width.animVal.value should be close to 30. Was 180. 24 PASS rect.width.baseVal.value is 300 17 25 PASS rect.width.animVal.value is 30 26 PASS rect.width.baseVal.value is 300 18 27 PASS rect.width.animVal.value is 30 28 PASS rect.width.baseVal.value is 300 19 29 PASS successfullyParsed is true 20 30 -
trunk/LayoutTests/svg/animations/animate-elem-19-t-drt-expected.txt
r109215 r110545 8 8 9 9 PASS rect.width.animVal.value is 300 10 PASS rect.width.baseVal.value is 300 10 11 PASS rect.width.animVal.value is 255 12 PASS rect.width.baseVal.value is 300 11 13 PASS rect.width.animVal.value is 255 14 PASS rect.width.baseVal.value is 300 12 15 PASS rect.width.animVal.value is 180 16 PASS rect.width.baseVal.value is 300 13 17 PASS rect.width.animVal.value is 180 18 PASS rect.width.baseVal.value is 300 14 19 PASS rect.width.animVal.value is 30 20 PASS rect.width.baseVal.value is 300 15 21 PASS rect.width.animVal.value is 30 22 PASS rect.width.baseVal.value is 300 16 23 PASS rect.width.animVal.value is 30 24 PASS rect.width.baseVal.value is 300 17 25 PASS successfullyParsed is true 18 26 -
trunk/LayoutTests/svg/animations/animate-end-attribute-expected.txt
r107682 r110545 4 4 PASS rect.x.baseVal.value is 100 5 5 PASS rect.x.animVal.value is 50 6 PASS rect.x.baseVal.value is 506 PASS rect.x.baseVal.value is 100 7 7 PASS rect.x.animVal.value is 200 8 PASS rect.x.baseVal.value is 2008 PASS rect.x.baseVal.value is 100 9 9 PASS rect.x.animVal.value is 200 10 PASS rect.x.baseVal.value is 20010 PASS rect.x.baseVal.value is 100 11 11 PASS successfullyParsed is true 12 12 -
trunk/LayoutTests/svg/animations/animate-endElement-beginElement-expected.txt
r88234 r110545 7 7 8 8 PASS rect.x.animVal.value is 50 9 PASS rect.x.baseVal.value is 0 9 10 PASS successfullyParsed is true 10 11 -
trunk/LayoutTests/svg/animations/animate-from-to-keyTimes-expected.txt
r95907 r110545 1 1 SVG 1.1 dynamic animation tests 2 2 3 PASS rect.x.animVal.value is 100 3 4 PASS rect.x.baseVal.value is 100 4 PASS rect.x.baseVal.value is 200 5 PASS rect.x.baseVal.value is 200 5 PASS rect.x.animVal.value is 200 6 PASS rect.x.baseVal.value is 100 7 PASS rect.x.animVal.value is 200 8 PASS rect.x.baseVal.value is 100 6 9 PASS successfullyParsed is true 7 10 -
trunk/LayoutTests/svg/animations/animate-insert-begin-expected.txt
r87392 r110545 6 6 7 7 8 PASS rect.x.animVal.value is 0 8 9 PASS rect.x.baseVal.value is 0 9 PASS rect.x.baseVal.value is 90 10 PASS rect.x.animVal.value is 90 11 PASS rect.x.baseVal.value is 0 10 12 PASS successfullyParsed is true 11 13 -
trunk/LayoutTests/svg/animations/animate-insert-no-begin-expected.txt
r87392 r110545 6 6 7 7 8 PASS rect.x.animVal.value is 0 8 9 PASS rect.x.baseVal.value is 0 9 PASS rect.x.baseVal.value is 90 10 PASS rect.x.animVal.value is 90 11 PASS rect.x.baseVal.value is 0 10 12 PASS successfullyParsed is true 11 13 -
trunk/LayoutTests/svg/animations/animate-keySplines-expected.txt
r57140 r110545 6 6 7 7 8 PASS rect.height.baseVal.value is 1679 8 PASS rect.height.animVal.value is 167 10 PASS rect.height.baseVal.value is 1 119 PASS rect.height.baseVal.value is 100 11 10 PASS rect.height.animVal.value is 111 12 11 PASS rect.height.baseVal.value is 100 13 12 PASS rect.height.animVal.value is 100 13 PASS rect.height.baseVal.value is 100 14 14 PASS successfullyParsed is true 15 15 -
trunk/LayoutTests/svg/animations/animate-number-calcMode-discrete-keyTimes-expected.txt
r89993 r110545 1 1 SVG 1.1 dynamic animation tests 2 2 3 PASS rect.x.animVal.value is 100 3 4 PASS rect.x.baseVal.value is 100 4 PASS rect.x.baseVal.value is 200 5 PASS rect.x.baseVal.value is 300 5 PASS rect.x.animVal.value is 200 6 PASS rect.x.baseVal.value is 100 7 PASS rect.x.animVal.value is 300 8 PASS rect.x.baseVal.value is 100 6 9 PASS successfullyParsed is true 7 10 -
trunk/LayoutTests/svg/animations/attributeTypes-expected.txt
r109679 r110545 8 8 9 9 PASS rect1.width.animVal.value is 10 10 PASS rect1.width.baseVal.value is 10 10 11 PASS getComputedStyle(rect1).fill is "#008000" 11 12 PASS rect2.width.animVal.value is 100 13 PASS rect2.width.baseVal.value is 100 12 14 PASS getComputedStyle(rect2).fill is "#008000" 13 15 PASS rect3.width.animVal.value is 100 16 PASS rect3.width.baseVal.value is 100 14 17 PASS getComputedStyle(rect3).fill is "#ff0000" 15 18 PASS rect3.getAttribute('fill') is "red" 16 19 PASS rect4.width.animVal.value is 100 20 PASS rect4.width.baseVal.value is 100 17 21 PASS getComputedStyle(rect4).fill is "#ff0000" 18 22 PASS rect4.getAttribute('fill') is "red" 19 23 PASS rect1.width.animVal.value is 55 24 PASS rect1.width.baseVal.value is 10 20 25 PASS getComputedStyle(rect1).fill is "#008000" 21 26 PASS rect2.width.animVal.value is 100 27 PASS rect2.width.baseVal.value is 100 22 28 PASS getComputedStyle(rect2).fill is "#008000" 23 29 PASS rect3.width.animVal.value is 100 30 PASS rect3.width.baseVal.value is 100 24 31 PASS getComputedStyle(rect3).fill is "#804000" 25 32 PASS rect3.getAttribute('fill') is "red" 26 33 PASS rect4.width.animVal.value is 100 34 PASS rect4.width.baseVal.value is 100 27 35 PASS getComputedStyle(rect4).fill is "#804000" 28 36 PASS rect4.getAttribute('fill') is "red" 29 37 PASS rect1.width.animVal.value is 100 38 PASS rect1.width.baseVal.value is 10 30 39 PASS getComputedStyle(rect1).fill is "#008000" 31 40 PASS rect2.width.animVal.value is 100 41 PASS rect2.width.baseVal.value is 100 32 42 PASS getComputedStyle(rect2).fill is "#008000" 33 43 PASS rect3.width.animVal.value is 100 44 PASS rect3.width.baseVal.value is 100 34 45 PASS getComputedStyle(rect3).fill is "#008000" 35 46 PASS rect3.getAttribute('fill') is "red" 36 47 PASS rect4.width.animVal.value is 100 48 PASS rect4.width.baseVal.value is 100 37 49 PASS getComputedStyle(rect4).fill is "#008000" 38 50 PASS rect4.getAttribute('fill') is "red" 39 51 PASS rect1.width.animVal.value is 100 52 PASS rect1.width.baseVal.value is 10 40 53 PASS getComputedStyle(rect1).fill is "#008000" 41 54 PASS rect2.width.animVal.value is 100 55 PASS rect2.width.baseVal.value is 100 42 56 PASS getComputedStyle(rect2).fill is "#008000" 43 57 PASS rect3.width.animVal.value is 100 58 PASS rect3.width.baseVal.value is 100 44 59 PASS getComputedStyle(rect3).fill is "#008000" 45 60 PASS rect3.getAttribute('fill') is "red" 46 61 PASS rect4.width.animVal.value is 100 62 PASS rect4.width.baseVal.value is 100 47 63 PASS getComputedStyle(rect4).fill is "#008000" 48 64 PASS rect4.getAttribute('fill') is "red" -
trunk/LayoutTests/svg/animations/script-tests/animVal-basics.js
r107791 r110545 31 31 // Check half-time conditions 32 32 shouldBe("rect.width.animVal.value", "150"); 33 shouldBe("rect.width.baseVal.value", " 150");33 shouldBe("rect.width.baseVal.value", "200"); 34 34 } 35 35 … … 37 37 // Check just before-end conditions 38 38 shouldBeCloseEnough("rect.width.animVal.value", "100"); 39 shouldBe CloseEnough("rect.width.baseVal.value", "100");39 shouldBe("rect.width.baseVal.value", "200"); 40 40 } 41 41 -
trunk/LayoutTests/svg/animations/script-tests/animate-calcMode-spline-by.js
r107791 r110545 33 33 // Check half-time conditions 34 34 shouldBeCloseEnough("rect.x.animVal.value", "18.8"); 35 shouldBe CloseEnough("rect.x.baseVal.value", "18.8");35 shouldBe("rect.x.baseVal.value", "100"); 36 36 } 37 37 … … 39 39 // Check just before-end conditions 40 40 shouldBeCloseEnough("rect.x.animVal.value", "0"); 41 shouldBe CloseEnough("rect.x.baseVal.value", "0");41 shouldBe("rect.x.baseVal.value", "100"); 42 42 } 43 43 -
trunk/LayoutTests/svg/animations/script-tests/animate-calcMode-spline-from-by.js
r107791 r110545 34 34 // Check half-time conditions 35 35 shouldBeCloseEnough("rect.x.animVal.value", "18.8"); 36 shouldBe CloseEnough("rect.x.baseVal.value", "18.8");36 shouldBe("rect.x.baseVal.value", "100"); 37 37 } 38 38 … … 40 40 // Check just before-end conditions 41 41 shouldBeCloseEnough("rect.x.animVal.value", "0"); 42 shouldBe CloseEnough("rect.x.baseVal.value", "0");42 shouldBe("rect.x.baseVal.value", "100"); 43 43 } 44 44 -
trunk/LayoutTests/svg/animations/script-tests/animate-calcMode-spline-from-to.js
r107791 r110545 34 34 // Check half-time conditions 35 35 shouldBeCloseEnough("rect.x.animVal.value", "18.8"); 36 shouldBe CloseEnough("rect.x.baseVal.value", "18.8");36 shouldBe("rect.x.baseVal.value", "100"); 37 37 } 38 38 … … 40 40 // Check just before-end conditions 41 41 shouldBeCloseEnough("rect.x.animVal.value", "0"); 42 shouldBe CloseEnough("rect.x.baseVal.value", "0");42 shouldBe("rect.x.baseVal.value", "100"); 43 43 } 44 44 -
trunk/LayoutTests/svg/animations/script-tests/animate-calcMode-spline-to.js
r107791 r110545 33 33 // Check half-time conditions 34 34 shouldBeCloseEnough("rect.x.animVal.value", "18.8"); 35 shouldBe CloseEnough("rect.x.baseVal.value", "18.8");35 shouldBe("rect.x.baseVal.value", "100"); 36 36 } 37 37 … … 39 39 // Check just before-end conditions 40 40 shouldBeCloseEnough("rect.x.animVal.value", "0"); 41 shouldBe CloseEnough("rect.x.baseVal.value", "0");41 shouldBe("rect.x.baseVal.value", "100"); 42 42 } 43 43 -
trunk/LayoutTests/svg/animations/script-tests/animate-calcMode-spline-values.js
r107791 r110545 33 33 // Check half-time conditions 34 34 shouldBeCloseEnough("rect.x.animVal.value", "18.8"); 35 shouldBe CloseEnough("rect.x.baseVal.value", "18.8");35 shouldBe("rect.x.baseVal.value", "100"); 36 36 } 37 37 … … 39 39 // Check just before-end conditions 40 40 shouldBeCloseEnough("rect.x.animVal.value", "0"); 41 shouldBe CloseEnough("rect.x.baseVal.value", "0");41 shouldBe("rect.x.baseVal.value", "100"); 42 42 } 43 43 -
trunk/LayoutTests/svg/animations/script-tests/animate-elem-02-t-drt.js
r109215 r110545 5 5 function sampleAfterBegin() { 6 6 shouldBe("rect1.height.animVal.value", "200"); 7 //shouldBe("rect1.height.baseVal.value", "20");7 shouldBe("rect1.height.baseVal.value", "20"); 8 8 9 9 shouldBe("rect2.height.animVal.value", "220"); 10 //shouldBe("rect2.height.baseVal.value", "20");10 shouldBe("rect2.height.baseVal.value", "20"); 11 11 12 12 shouldBe("rect3.height.animVal.value", "200"); 13 //shouldBe("rect3.height.baseVal.value", "20");13 shouldBe("rect3.height.baseVal.value", "20"); 14 14 } 15 15 16 16 function sampleAfterMid() { 17 17 shouldBe("rect1.height.animVal.value", "20"); 18 //shouldBe("rect1.height.baseVal.value", "20");18 shouldBe("rect1.height.baseVal.value", "20"); 19 19 20 20 shouldBe("rect2.height.animVal.value", "40"); 21 //shouldBe("rect2.height.baseVal.value", "20");21 shouldBe("rect2.height.baseVal.value", "20"); 22 22 23 23 shouldBe("rect3.height.animVal.value", "20"); 24 //shouldBe("rect3.height.baseVal.value", "20");24 shouldBe("rect3.height.baseVal.value", "20"); 25 25 } 26 26 27 27 function sampleAfterBeginOfFirstRepetition() { 28 28 shouldBe("rect1.height.animVal.value", "200"); 29 //shouldBe("rect1.height.baseVal.value", "20");29 shouldBe("rect1.height.baseVal.value", "20"); 30 30 31 31 shouldBe("rect2.height.animVal.value", "220"); 32 //shouldBe("rect2.height.baseVal.value", "20");32 shouldBe("rect2.height.baseVal.value", "20"); 33 33 34 34 shouldBe("rect3.height.animVal.value", "220"); 35 //shouldBe("rect3.height.baseVal.value", "20");35 shouldBe("rect3.height.baseVal.value", "20"); 36 36 } 37 37 38 38 function sampleAfterMidOfFirstRepetition() { 39 39 shouldBe("rect1.height.animVal.value", "20"); 40 //shouldBe("rect1.height.baseVal.value", "20");40 shouldBe("rect1.height.baseVal.value", "20"); 41 41 42 42 shouldBe("rect2.height.animVal.value", "40"); 43 //shouldBe("rect2.height.baseVal.value", "20");43 shouldBe("rect2.height.baseVal.value", "20"); 44 44 45 45 shouldBe("rect3.height.animVal.value", "40"); 46 //shouldBe("rect3.height.baseVal.value", "20");46 shouldBe("rect3.height.baseVal.value", "20"); 47 47 } 48 48 -
trunk/LayoutTests/svg/animations/script-tests/animate-elem-09-t-drt.js
r109215 r110545 5 5 function sample1() { 6 6 shouldBe("rect1.height.animVal.value", "210"); 7 //shouldBe("rect1.height.baseVal.value", "210");7 shouldBe("rect1.height.baseVal.value", "210"); 8 8 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-250"); 9 9 } … … 11 11 function sample2() { 12 12 shouldBe("rect1.height.animVal.value", "177"); 13 //shouldBe("rect1.height.baseVal.value", "210");13 shouldBe("rect1.height.baseVal.value", "210"); 14 14 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-217"); 15 15 } … … 17 17 function sample3() { 18 18 shouldBe("rect1.height.animVal.value", "121"); 19 //shouldBe("rect1.height.baseVal.value", "210");19 shouldBe("rect1.height.baseVal.value", "210"); 20 20 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-161"); 21 21 } … … 23 23 function sample4() { 24 24 shouldBe("rect1.height.animVal.value", "10"); 25 //shouldBe("rect1.height.baseVal.value", "210");25 shouldBe("rect1.height.baseVal.value", "210"); 26 26 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-50"); 27 27 } -
trunk/LayoutTests/svg/animations/script-tests/animate-elem-10-t-drt.js
r109215 r110545 5 5 function sample1() { 6 6 shouldBeCloseEnough("rect1.height.animVal.value", "210"); 7 //shouldBe("rect1.height.baseVal.value", "210");7 shouldBe("rect1.height.baseVal.value", "210"); 8 8 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-250"); 9 9 } … … 11 11 function sample2() { 12 12 shouldBeCloseEnough("rect1.height.animVal.value", "177"); 13 //shouldBe("rect1.height.baseVal.value", "210");13 shouldBe("rect1.height.baseVal.value", "210"); 14 14 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-217"); 15 15 } … … 17 17 function sample3() { 18 18 shouldBeCloseEnough("rect1.height.animVal.value", "121"); 19 //shouldBe("rect1.height.baseVal.value", "210");19 shouldBe("rect1.height.baseVal.value", "210"); 20 20 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-161"); 21 21 } … … 23 23 function sample4() { 24 24 shouldBeCloseEnough("rect1.height.animVal.value", "10"); 25 //shouldBe("rect1.height.baseVal.value", "210");25 shouldBe("rect1.height.baseVal.value", "210"); 26 26 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-50"); 27 27 } -
trunk/LayoutTests/svg/animations/script-tests/animate-elem-11-t-drt.js
r109215 r110545 5 5 function sample1() { 6 6 shouldBeCloseEnough("rect1.height.animVal.value", "210"); 7 //shouldBe("rect1.height.baseVal.value", "210");7 shouldBe("rect1.height.baseVal.value", "210"); 8 8 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-250"); 9 9 } … … 11 11 function sample2() { 12 12 shouldBeCloseEnough("rect1.height.animVal.value", "143.4"); 13 //shouldBe("rect1.height.baseVal.value", "210");13 shouldBe("rect1.height.baseVal.value", "210"); 14 14 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-183.4"); 15 15 } … … 17 17 function sample3() { 18 18 shouldBeCloseEnough("rect1.height.animVal.value", "76.7"); 19 //shouldBe("rect1.height.baseVal.value", "210");19 shouldBe("rect1.height.baseVal.value", "210"); 20 20 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-116.7"); 21 21 } … … 23 23 function sample4() { 24 24 shouldBeCloseEnough("rect1.height.animVal.value", "10"); 25 //shouldBe("rect1.height.baseVal.value", "210");25 shouldBe("rect1.height.baseVal.value", "210"); 26 26 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-50"); 27 27 } -
trunk/LayoutTests/svg/animations/script-tests/animate-elem-12-t-drt.js
r109215 r110545 5 5 function sample1() { 6 6 shouldBeCloseEnough("rect1.height.animVal.value", "210"); 7 //shouldBe("rect1.height.baseVal.value", "210");7 shouldBe("rect1.height.baseVal.value", "210"); 8 8 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-250"); 9 9 } … … 11 11 function sample2() { 12 12 shouldBeCloseEnough("rect1.height.animVal.value", "177"); 13 //shouldBe("rect1.height.baseVal.value", "210");13 shouldBe("rect1.height.baseVal.value", "210"); 14 14 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-217"); 15 15 } … … 17 17 function sample3() { 18 18 shouldBeCloseEnough("rect1.height.animVal.value", "121"); 19 //shouldBe("rect1.height.baseVal.value", "210");19 shouldBe("rect1.height.baseVal.value", "210"); 20 20 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-161"); 21 21 } … … 23 23 function sample4() { 24 24 shouldBeCloseEnough("rect1.height.animVal.value", "10"); 25 //shouldBe("rect1.height.baseVal.value", "210");25 shouldBe("rect1.height.baseVal.value", "210"); 26 26 expectTranslationMatrix("rootSVGElement.getTransformToElement(rect2)", "-250", "-50"); 27 27 } -
trunk/LayoutTests/svg/animations/script-tests/animate-elem-13-t-drt.js
r109215 r110545 5 5 function sample1() { 6 6 shouldBeCloseEnough("rect1.width.animVal.value", "30"); 7 //shouldBe("rect1.width.baseVal.value", "30");7 shouldBe("rect1.width.baseVal.value", "30"); 8 8 } 9 9 10 10 function sample2() { 11 11 shouldBeCloseEnough("rect1.width.animVal.value", "165"); 12 //shouldBe("rect1.width.baseVal.value", "30");12 shouldBe("rect1.width.baseVal.value", "30"); 13 13 } 14 14 15 15 function sample3() { 16 16 shouldBeCloseEnough("rect1.width.animVal.value", "300"); 17 //shouldBe("rect1.width.baseVal.value", "30");17 shouldBe("rect1.width.baseVal.value", "30"); 18 18 } 19 19 -
trunk/LayoutTests/svg/animations/script-tests/animate-elem-14-t-drt.js
r109215 r110545 5 5 function sample1() { // From 0s to 2s 6 6 shouldBeCloseEnough("rect.width.animVal.value", "300"); 7 //shouldBe("rect.width.baseVal.value", "300");7 shouldBe("rect.width.baseVal.value", "300"); 8 8 } 9 9 10 10 function sample2() { // From 2s to 4s 11 11 shouldBeCloseEnough("rect.width.animVal.value", "255"); 12 //shouldBe("rect.width.baseVal.value", "300");12 shouldBe("rect.width.baseVal.value", "300"); 13 13 } 14 14 15 15 function sample3() { // From 4s to 6s 16 16 shouldBeCloseEnough("rect.width.animVal.value", "180"); 17 //shouldBe("rect.width.baseVal.value", "300");17 shouldBe("rect.width.baseVal.value", "300"); 18 18 } 19 19 20 20 function sample4() { // From 6s to 10s 21 21 shouldBeCloseEnough("rect.width.animVal.value", "30"); 22 //shouldBe("rect.width.baseVal.value", "300");22 shouldBe("rect.width.baseVal.value", "300"); 23 23 } 24 24 -
trunk/LayoutTests/svg/animations/script-tests/animate-elem-15-t-drt.js
r109215 r110545 5 5 function sample1() { // From 0s to 2.25s 6 6 shouldBeCloseEnough("rect.width.animVal.value", "300"); 7 //shouldBe("rect.width.baseVal.value", "300");7 shouldBe("rect.width.baseVal.value", "300"); 8 8 } 9 9 10 10 function sample2() { // From 2.25s to 4.5s 11 11 shouldBeCloseEnough("rect.width.animVal.value", "232.5"); 12 //shouldBe("rect.width.baseVal.value", "300");12 shouldBe("rect.width.baseVal.value", "300"); 13 13 } 14 14 15 15 function sample3() { // From 4.5s to 9s 16 16 shouldBeCloseEnough("rect.width.animVal.value", "165"); 17 //shouldBe("rect.width.baseVal.value", "300");17 shouldBe("rect.width.baseVal.value", "300"); 18 18 } 19 19 20 20 function sample4() { // From 9s to 9s 21 21 shouldBeCloseEnough("rect.width.animVal.value", "30"); 22 //shouldBe("rect.width.baseVal.value", "300");22 shouldBe("rect.width.baseVal.value", "300"); 23 23 } 24 24 -
trunk/LayoutTests/svg/animations/script-tests/animate-elem-16-t-drt.js
r109215 r110545 5 5 function sample1() { // From 0s to 2s 6 6 shouldBeCloseEnough("rect.width.animVal.value", "300"); 7 //shouldBe("rect.width.baseVal.value", "300");7 shouldBe("rect.width.baseVal.value", "300"); 8 8 } 9 9 10 10 function sample2() { // From 2s to 4s 11 11 shouldBeCloseEnough("rect.width.animVal.value", "255"); 12 //shouldBe("rect.width.baseVal.value", "300");12 shouldBe("rect.width.baseVal.value", "300"); 13 13 } 14 14 15 15 function sample3() { // From 4s to 8s 16 16 shouldBeCloseEnough("rect.width.animVal.value", "180"); 17 //shouldBe("rect.width.baseVal.value", "300");17 shouldBe("rect.width.baseVal.value", "300"); 18 18 } 19 19 20 20 function sample4() { // From 8s to 8s 21 21 shouldBeCloseEnough("rect.width.animVal.value", "30"); 22 //shouldBe("rect.width.baseVal.value", "300");22 shouldBe("rect.width.baseVal.value", "300"); 23 23 } 24 24 -
trunk/LayoutTests/svg/animations/script-tests/animate-elem-17-t-drt.js
r109215 r110545 5 5 function sample1() { // From 0s to 2s 6 6 shouldBeCloseEnough("rect.width.animVal.value", "300"); 7 //shouldBe("rect.width.baseVal.value", "300");7 shouldBe("rect.width.baseVal.value", "300"); 8 8 } 9 9 10 10 function sample2() { // From 2s to 4s 11 11 shouldBeCloseEnough("rect.width.animVal.value", "255"); 12 //shouldBe("rect.width.baseVal.value", "300");12 shouldBe("rect.width.baseVal.value", "300"); 13 13 } 14 14 15 15 function sample3() { // From 4s to 8s 16 16 shouldBeCloseEnough("rect.width.animVal.value", "180"); 17 //shouldBe("rect.width.baseVal.value", "300");17 shouldBe("rect.width.baseVal.value", "300"); 18 18 } 19 19 20 20 function sample4() { // From 8s to 8s 21 21 shouldBeCloseEnough("rect.width.animVal.value", "30"); 22 //shouldBe("rect.width.baseVal.value", "300");22 shouldBe("rect.width.baseVal.value", "300"); 23 23 } 24 24 -
trunk/LayoutTests/svg/animations/script-tests/animate-elem-18-t-drt.js
r109215 r110545 5 5 function sample1() { // From 0s to 2s 6 6 shouldBeCloseEnough("rect.width.animVal.value", "300"); 7 //shouldBe("rect.width.baseVal.value", "300");7 shouldBe("rect.width.baseVal.value", "300"); 8 8 } 9 9 10 10 function sample2() { // From 2s to 6s 11 11 shouldBeCloseEnough("rect.width.animVal.value", "255"); 12 //shouldBe("rect.width.baseVal.value", "300");12 shouldBe("rect.width.baseVal.value", "300"); 13 13 } 14 14 15 15 function sample3() { // From 6s to 8s 16 16 shouldBeCloseEnough("rect.width.animVal.value", "180"); 17 //shouldBe("rect.width.baseVal.value", "300");17 shouldBe("rect.width.baseVal.value", "300"); 18 18 } 19 19 20 20 function sample4() { // From 8s to 10s 21 21 shouldBeCloseEnough("rect.width.animVal.value", "30"); 22 //shouldBe("rect.width.baseVal.value", "300");22 shouldBe("rect.width.baseVal.value", "300"); 23 23 } 24 24 -
trunk/LayoutTests/svg/animations/script-tests/animate-elem-19-t-drt.js
r109215 r110545 5 5 function sample1() { // From 0s to 4s 6 6 shouldBeCloseEnough("rect.width.animVal.value", "300"); 7 //shouldBe("rect.width.baseVal.value", "300");7 shouldBe("rect.width.baseVal.value", "300"); 8 8 } 9 9 10 10 function sample2() { // From 4s to 6s 11 11 shouldBeCloseEnough("rect.width.animVal.value", "255"); 12 //shouldBe("rect.width.baseVal.value", "300");12 shouldBe("rect.width.baseVal.value", "300"); 13 13 } 14 14 15 15 function sample3() { // From 6s to 8s 16 16 shouldBeCloseEnough("rect.width.animVal.value", "180"); 17 //shouldBe("rect.width.baseVal.value", "300");17 shouldBe("rect.width.baseVal.value", "300"); 18 18 } 19 19 20 20 function sample4() { // From 8s to 8s 21 21 shouldBeCloseEnough("rect.width.animVal.value", "30"); 22 //shouldBe("rect.width.baseVal.value", "300");22 shouldBe("rect.width.baseVal.value", "300"); 23 23 } 24 24 -
trunk/LayoutTests/svg/animations/script-tests/animate-end-attribute.js
r107791 r110545 29 29 function sample2() { 30 30 shouldBe("rect.x.animVal.value", "50"); 31 shouldBe("rect.x.baseVal.value", " 50");31 shouldBe("rect.x.baseVal.value", "100"); 32 32 } 33 33 34 34 function sample3() { 35 35 shouldBeCloseEnough("rect.x.animVal.value", "200"); 36 shouldBe CloseEnough("rect.x.baseVal.value", "200");36 shouldBe("rect.x.baseVal.value", "100"); 37 37 } 38 38 -
trunk/LayoutTests/svg/animations/script-tests/animate-endElement-beginElement.js
r107682 r110545 27 27 // Check half-time conditions 28 28 shouldBe("rect.x.animVal.value", "50"); 29 shouldBe("rect.x.baseVal.value", "0"); 29 30 } 30 31 -
trunk/LayoutTests/svg/animations/script-tests/animate-from-to-keyTimes.js
r107682 r110545 23 23 // Setup animation test 24 24 function sample1() { 25 shouldBe("rect.x.animVal.value", "100"); 25 26 shouldBe("rect.x.baseVal.value", "100"); 26 27 } 27 28 28 29 function sample2() { 29 shouldBe("rect.x.baseVal.value", "200"); 30 shouldBe("rect.x.animVal.value", "200"); 31 shouldBe("rect.x.baseVal.value", "100"); 30 32 } 31 33 -
trunk/LayoutTests/svg/animations/script-tests/animate-insert-begin.js
r107682 r110545 24 24 // Setup animation test 25 25 function sample1() { 26 shouldBe("rect.x.animVal.value", "0"); 26 27 shouldBe("rect.x.baseVal.value", "0"); 27 28 } 28 29 29 30 function sample2() { 30 shouldBe("rect.x.baseVal.value", "90"); 31 shouldBe("rect.x.animVal.value", "90"); 32 shouldBe("rect.x.baseVal.value", "0"); 31 33 } 32 34 -
trunk/LayoutTests/svg/animations/script-tests/animate-insert-no-begin.js
r107682 r110545 24 24 // Setup animation test 25 25 function sample1() { 26 shouldBe("rect.x.animVal.value", "0"); 26 27 shouldBe("rect.x.baseVal.value", "0"); 27 28 } 28 29 29 30 function sample2() { 30 shouldBe("rect.x.baseVal.value", "90"); 31 shouldBe("rect.x.animVal.value", "90"); 32 shouldBe("rect.x.baseVal.value", "0"); 31 33 } 32 34 -
trunk/LayoutTests/svg/animations/script-tests/animate-keySplines.js
r107682 r110545 26 26 function sample1() { 27 27 // Check initial/end conditions 28 shouldBe ("rect.height.baseVal.value", "167");29 shouldBe("rect.height. animVal.value", "167");28 shouldBeCloseEnough("rect.height.animVal.value", "167"); 29 shouldBe("rect.height.baseVal.value", "100"); 30 30 } 31 31 32 32 function sample2() { 33 33 // Check half-time conditions 34 shouldBe ("rect.height.baseVal.value", "111");35 shouldBe("rect.height. animVal.value", "111");34 shouldBeCloseEnough("rect.height.animVal.value", "111"); 35 shouldBe("rect.height.baseVal.value", "100"); 36 36 } 37 37 38 38 function sample3() { 39 39 // Check just before-end conditions 40 shouldBeCloseEnough("rect.height.animVal.value", "100"); 40 41 shouldBe("rect.height.baseVal.value", "100"); 41 shouldBe("rect.height.animVal.value", "100");42 42 } 43 43 -
trunk/LayoutTests/svg/animations/script-tests/animate-number-calcMode-discrete-keyTimes.js
r107682 r110545 24 24 // Setup animation test 25 25 function sample1() { 26 shouldBe("rect.x.animVal.value", "100"); 26 27 shouldBe("rect.x.baseVal.value", "100"); 27 28 } 28 29 29 30 function sample2() { 30 shouldBe("rect.x.baseVal.value", "200"); 31 shouldBe("rect.x.animVal.value", "200"); 32 shouldBe("rect.x.baseVal.value", "100"); 31 33 } 32 34 33 35 function sample3() { 34 shouldBe("rect.x.baseVal.value", "300"); 36 shouldBe("rect.x.animVal.value", "300"); 37 shouldBe("rect.x.baseVal.value", "100"); 35 38 } 36 39 -
trunk/LayoutTests/svg/animations/script-tests/attributeTypes.js
r109679 r110545 5 5 function sample1() { 6 6 shouldBeCloseEnough("rect1.width.animVal.value", "10"); 7 //shouldBe("rect1.width.baseVal.value", "10");7 shouldBe("rect1.width.baseVal.value", "10"); 8 8 shouldBeEqualToString("getComputedStyle(rect1).fill", "#008000"); 9 9 10 10 shouldBe("rect2.width.animVal.value", "100"); 11 //shouldBe("rect2.width.baseVal.value", "100");11 shouldBe("rect2.width.baseVal.value", "100"); 12 12 shouldBeEqualToString("getComputedStyle(rect2).fill", "#008000"); 13 13 14 14 shouldBe("rect3.width.animVal.value", "100"); 15 //shouldBe("rect3.width.baseVal.value", "100");15 shouldBe("rect3.width.baseVal.value", "100"); 16 16 shouldBeEqualToString("getComputedStyle(rect3).fill", "#ff0000"); 17 17 shouldBeEqualToString("rect3.getAttribute('fill')", "red"); 18 18 19 19 shouldBe("rect4.width.animVal.value", "100"); 20 //shouldBe("rect4.width.baseVal.value", "100");20 shouldBe("rect4.width.baseVal.value", "100"); 21 21 shouldBeEqualToString("getComputedStyle(rect4).fill", "#ff0000"); 22 22 shouldBeEqualToString("rect4.getAttribute('fill')", "red"); … … 25 25 function sample2() { 26 26 shouldBeCloseEnough("rect1.width.animVal.value", "55"); 27 //shouldBe("rect1.width.baseVal.value", "10");27 shouldBe("rect1.width.baseVal.value", "10"); 28 28 shouldBeEqualToString("getComputedStyle(rect1).fill", "#008000"); 29 29 30 30 shouldBe("rect2.width.animVal.value", "100"); 31 //shouldBe("rect2.width.baseVal.value", "100");31 shouldBe("rect2.width.baseVal.value", "100"); 32 32 shouldBeEqualToString("getComputedStyle(rect2).fill", "#008000"); 33 33 34 34 shouldBe("rect3.width.animVal.value", "100"); 35 //shouldBe("rect3.width.baseVal.value", "100");35 shouldBe("rect3.width.baseVal.value", "100"); 36 36 shouldBeEqualToString("getComputedStyle(rect3).fill", "#804000"); 37 37 shouldBeEqualToString("rect3.getAttribute('fill')", "red"); 38 38 39 39 shouldBe("rect4.width.animVal.value", "100"); 40 //shouldBe("rect4.width.baseVal.value", "100");40 shouldBe("rect4.width.baseVal.value", "100"); 41 41 shouldBeEqualToString("getComputedStyle(rect4).fill", "#804000"); 42 42 shouldBeEqualToString("rect4.getAttribute('fill')", "red"); … … 45 45 function sample3() { 46 46 shouldBeCloseEnough("rect1.width.animVal.value", "100"); 47 //shouldBe("rect1.width.baseVal.value", "10");47 shouldBe("rect1.width.baseVal.value", "10"); 48 48 shouldBeEqualToString("getComputedStyle(rect1).fill", "#008000"); 49 49 50 50 shouldBe("rect2.width.animVal.value", "100"); 51 //shouldBe("rect2.width.baseVal.value", "100");51 shouldBe("rect2.width.baseVal.value", "100"); 52 52 shouldBeEqualToString("getComputedStyle(rect2).fill", "#008000"); 53 53 54 54 shouldBe("rect3.width.animVal.value", "100"); 55 //shouldBe("rect3.width.baseVal.value", "100");55 shouldBe("rect3.width.baseVal.value", "100"); 56 56 shouldBeEqualToString("getComputedStyle(rect3).fill", "#008000"); 57 57 shouldBeEqualToString("rect3.getAttribute('fill')", "red"); 58 58 59 59 shouldBe("rect4.width.animVal.value", "100"); 60 //shouldBe("rect4.width.baseVal.value", "100");60 shouldBe("rect4.width.baseVal.value", "100"); 61 61 shouldBeEqualToString("getComputedStyle(rect4).fill", "#008000"); 62 62 shouldBeEqualToString("rect4.getAttribute('fill')", "red"); -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-LengthModeHeight.js
r107791 r110545 35 35 function sample2() { 36 36 shouldBe("rect.height.animVal.value", "150"); 37 shouldBe("rect.height.baseVal.value", "1 50");37 shouldBe("rect.height.baseVal.value", "100"); 38 38 } 39 39 40 40 function sample3() { 41 41 shouldBeCloseEnough("rect.height.animVal.value", "200"); 42 shouldBe CloseEnough("rect.height.baseVal.value", "200");42 shouldBe("rect.height.baseVal.value", "100"); 43 43 } 44 44 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-LengthModeOther.js
r107791 r110545 34 34 function sample2() { 35 35 shouldBeCloseEnough("circle.r.animVal.value", "132.5"); 36 shouldBe CloseEnough("circle.r.baseVal.value", "132.5");36 shouldBe("circle.r.baseVal.value", "10"); 37 37 } 38 38 39 39 function sample3() { 40 40 shouldBeCloseEnough("circle.r.animVal.value", "254.9"); 41 shouldBe CloseEnough("circle.r.baseVal.value", "254.9");41 shouldBe("circle.r.baseVal.value", "10"); 42 42 } 43 43 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-LengthModeWidth.js
r107791 r110545 35 35 function sample2() { 36 36 shouldBeCloseEnough("rect.width.animVal.value", "200"); 37 shouldBe CloseEnough("rect.width.baseVal.value", "200");37 shouldBe("rect.width.baseVal.value", "100"); 38 38 } 39 39 40 40 function sample3() { 41 41 shouldBeCloseEnough("rect.width.animVal.value", "300"); 42 shouldBe CloseEnough("rect.width.baseVal.value", "300");42 shouldBe("rect.width.baseVal.value", "100"); 43 43 } 44 44 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-invalid-value-1.js
r107682 r110545 30 30 function sample2() { 31 31 shouldBe("rect.width.animVal.value", "0"); 32 shouldBe("rect.width.baseVal.value", " 0");32 shouldBe("rect.width.baseVal.value", "100"); 33 33 } 34 34 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-invalid-value-2.js
r107682 r110545 30 30 function sample2() { 31 31 shouldBe("rect.width.animVal.value", "0"); 32 shouldBe("rect.width.baseVal.value", " 0");32 shouldBe("rect.width.baseVal.value", "100"); 33 33 } 34 34 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-invalid-value-3.js
r107682 r110545 30 30 function sample2() { 31 31 shouldBe("rect.width.animVal.value", "0"); 32 shouldBe("rect.width.baseVal.value", " 0");32 shouldBe("rect.width.baseVal.value", "100"); 33 33 } 34 34 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-number-to-number.js
r107791 r110545 30 30 function sample2() { 31 31 shouldBe("rect.width.animVal.value", "150"); 32 shouldBe("rect.width.baseVal.value", "1 50");32 shouldBe("rect.width.baseVal.value", "100"); 33 33 } 34 34 35 35 function sample3() { 36 36 shouldBeCloseEnough("rect.width.animVal.value", "200"); 37 shouldBe CloseEnough("rect.width.baseVal.value", "200");37 shouldBe("rect.width.baseVal.value", "100"); 38 38 } 39 39 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-px-to-cm.js
r107791 r110545 30 30 function sample2() { 31 31 shouldBeCloseEnough("rect.width.animVal.value", "144.5"); 32 shouldBe CloseEnough("rect.width.baseVal.value", "144.5");32 shouldBe("rect.width.baseVal.value", "100"); 33 33 } 34 34 35 35 function sample3() { 36 36 shouldBeCloseEnough("rect.width.animVal.value", "189"); 37 shouldBe CloseEnough("rect.width.baseVal.value", "189");37 shouldBe("rect.width.baseVal.value", "100"); 38 38 } 39 39 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-px-to-ems.js
r107791 r110545 31 31 function sample2() { 32 32 shouldBe("rect.width.animVal.value", "150"); 33 shouldBe("rect.width.baseVal.value", "1 50");33 shouldBe("rect.width.baseVal.value", "100"); 34 34 } 35 35 36 36 function sample3() { 37 37 shouldBeCloseEnough("rect.width.animVal.value", "200"); 38 shouldBe CloseEnough("rect.width.baseVal.value", "200");38 shouldBe("rect.width.baseVal.value", "100"); 39 39 } 40 40 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-px-to-exs.js
r107791 r110545 31 31 function sample2() { 32 32 shouldBe("rect.width.animVal.value", "150"); 33 shouldBe("rect.width.baseVal.value", "1 50");33 shouldBe("rect.width.baseVal.value", "100"); 34 34 } 35 35 36 36 function sample3() { 37 37 shouldBeCloseEnough("rect.width.animVal.value", "200"); 38 shouldBe CloseEnough("rect.width.baseVal.value", "200");38 shouldBe("rect.width.baseVal.value", "100"); 39 39 } 40 40 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-px-to-in.js
r107791 r110545 30 30 function sample2() { 31 31 shouldBeCloseEnough("rect.width.animVal.value", "170"); 32 shouldBe CloseEnough("rect.width.baseVal.value", "170");32 shouldBe("rect.width.baseVal.value", "100"); 33 33 } 34 34 35 35 function sample3() { 36 36 shouldBeCloseEnough("rect.width.animVal.value", "240"); 37 shouldBe CloseEnough("rect.width.baseVal.value", "240");37 shouldBe("rect.width.baseVal.value", "100"); 38 38 } 39 39 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-px-to-number.js
r107791 r110545 30 30 function sample2() { 31 31 shouldBe("rect.width.animVal.value", "150"); 32 shouldBe("rect.width.baseVal.value", "1 50");32 shouldBe("rect.width.baseVal.value", "100"); 33 33 } 34 34 35 35 function sample3() { 36 36 shouldBeCloseEnough("rect.width.animVal.value", "200"); 37 shouldBe CloseEnough("rect.width.baseVal.value", "200");37 shouldBe("rect.width.baseVal.value", "100"); 38 38 } 39 39 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-px-to-pc.js
r107791 r110545 30 30 function sample2() { 31 31 shouldBe("rect.width.animVal.value", "170"); 32 shouldBe("rect.width.baseVal.value", "1 70");32 shouldBe("rect.width.baseVal.value", "100"); 33 33 } 34 34 35 35 function sample3() { 36 36 shouldBeCloseEnough("rect.width.animVal.value", "240"); 37 shouldBe CloseEnough("rect.width.baseVal.value", "240");37 shouldBe("rect.width.baseVal.value", "100"); 38 38 } 39 39 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-px-to-percentage.js
r107791 r110545 30 30 function sample2() { 31 31 shouldBeCloseEnough("rect.width.animVal.value", "350"); 32 shouldBe CloseEnough("rect.width.baseVal.value", "350");32 shouldBe("rect.width.baseVal.value", "100"); 33 33 } 34 34 35 35 function sample3() { 36 36 shouldBeCloseEnough("rect.width.animVal.value", "600", 1); 37 shouldBe CloseEnough("rect.width.baseVal.value", "600", 1);37 shouldBe("rect.width.baseVal.value", "100"); 38 38 } 39 39 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-px-to-pt.js
r107791 r110545 30 30 function sample2() { 31 31 shouldBeCloseEnough("rect.width.animVal.value", "161.2"); 32 shouldBe CloseEnough("rect.width.baseVal.value", "161.2");32 shouldBe("rect.width.baseVal.value", "100"); 33 33 } 34 34 35 35 function sample3() { 36 36 shouldBeCloseEnough("rect.width.animVal.value", "189"); 37 shouldBe CloseEnough("rect.width.baseVal.value", "189");37 shouldBe("rect.width.baseVal.value", "100"); 38 38 } 39 39 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-px-to-px.js
r107791 r110545 30 30 function sample2() { 31 31 shouldBe("rect.width.animVal.value", "150"); 32 shouldBe("rect.width.baseVal.value", "1 50");32 shouldBe("rect.width.baseVal.value", "100"); 33 33 } 34 34 35 35 function sample3() { 36 36 shouldBeCloseEnough("rect.width.animVal.value", "200"); 37 shouldBe CloseEnough("rect.width.baseVal.value", "200");37 shouldBe("rect.width.baseVal.value", "100"); 38 38 } 39 39 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-unitType.js
r107682 r110545 25 25 // Check initial/end conditions 26 26 shouldBe("rect.width.animVal.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER"); 27 shouldBe("rect.width.baseVal.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER"); 27 28 } 28 29 29 30 function sample2() { 30 31 shouldBe("rect.width.animVal.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER"); 32 shouldBe("rect.width.baseVal.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER"); 31 33 } 32 34 33 35 function sample3() { 34 36 shouldBe("rect.width.animVal.unitType", "SVGLength.SVG_LENGTHTYPE_PX"); 37 shouldBe("rect.width.baseVal.unitType", "SVGLength.SVG_LENGTHTYPE_NUMBER"); 35 38 } 36 39 -
trunk/LayoutTests/svg/animations/script-tests/svglength-animation-values.js
r107791 r110545 29 29 function sample2() { 30 30 shouldBe("rect.width.animVal.value", "130"); 31 shouldBe("rect.width.baseVal.value", "1 30");31 shouldBe("rect.width.baseVal.value", "100"); 32 32 } 33 33 34 34 function sample3() { 35 35 shouldBeCloseEnough("rect.width.animVal.value", "151.2"); 36 shouldBe CloseEnough("rect.width.baseVal.value", "151.2");36 shouldBe("rect.width.baseVal.value", "100"); 37 37 } 38 38 39 39 function sample4() { 40 40 shouldBe("rect.width.animVal.value", "576"); 41 shouldBe("rect.width.baseVal.value", " 576");41 shouldBe("rect.width.baseVal.value", "100"); 42 42 } 43 43 44 44 function sample5() { 45 45 shouldBeCloseEnough("rect.width.animVal.value", "267"); 46 shouldBe CloseEnough("rect.width.baseVal.value", "267");46 shouldBe("rect.width.baseVal.value", "100"); 47 47 } 48 48 -
trunk/LayoutTests/svg/animations/svglength-animation-LengthModeHeight-expected.txt
r107791 r110545 9 9 PASS rect.height.baseVal.value is 100 10 10 PASS rect.height.animVal.value is 150 11 PASS rect.height.baseVal.value is 1 5011 PASS rect.height.baseVal.value is 100 12 12 PASS rect.height.animVal.value is 200 13 PASS rect.height.baseVal.value is 20013 PASS rect.height.baseVal.value is 100 14 14 PASS rect.height.animVal.value is 100 15 15 PASS rect.height.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/svglength-animation-LengthModeOther-expected.txt
r107791 r110545 9 9 PASS circle.r.baseVal.value is 10 10 10 PASS circle.r.animVal.value is 132.5 11 PASS circle.r.baseVal.value is 1 32.511 PASS circle.r.baseVal.value is 10 12 12 PASS circle.r.animVal.value is 254.9 13 PASS circle.r.baseVal.value is 254.913 PASS circle.r.baseVal.value is 10 14 14 PASS circle.r.animVal.value is 10 15 15 PASS circle.r.baseVal.value is 10 -
trunk/LayoutTests/svg/animations/svglength-animation-LengthModeWidth-expected.txt
r107791 r110545 9 9 PASS rect.width.baseVal.value is 100 10 10 PASS rect.width.animVal.value is 200 11 PASS rect.width.baseVal.value is 20011 PASS rect.width.baseVal.value is 100 12 12 PASS rect.width.animVal.value is 300 13 PASS rect.width.baseVal.value is 30013 PASS rect.width.baseVal.value is 100 14 14 PASS rect.width.animVal.value is 100 15 15 PASS rect.width.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/svglength-animation-invalid-value-1-expected.txt
r88663 r110545 9 9 PASS rect.width.baseVal.value is 100 10 10 PASS rect.width.animVal.value is 0 11 PASS rect.width.baseVal.value is 011 PASS rect.width.baseVal.value is 100 12 12 PASS rect.width.animVal.value is 100 13 13 PASS rect.width.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/svglength-animation-invalid-value-2-expected.txt
r88663 r110545 9 9 PASS rect.width.baseVal.value is 100 10 10 PASS rect.width.animVal.value is 0 11 PASS rect.width.baseVal.value is 011 PASS rect.width.baseVal.value is 100 12 12 PASS rect.width.animVal.value is 100 13 13 PASS rect.width.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/svglength-animation-invalid-value-3-expected.txt
r88663 r110545 9 9 PASS rect.width.baseVal.value is 100 10 10 PASS rect.width.animVal.value is 0 11 PASS rect.width.baseVal.value is 011 PASS rect.width.baseVal.value is 100 12 12 PASS rect.width.animVal.value is 100 13 13 PASS rect.width.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/svglength-animation-number-to-number-expected.txt
r107791 r110545 9 9 PASS rect.width.baseVal.value is 100 10 10 PASS rect.width.animVal.value is 150 11 PASS rect.width.baseVal.value is 1 5011 PASS rect.width.baseVal.value is 100 12 12 PASS rect.width.animVal.value is 200 13 PASS rect.width.baseVal.value is 20013 PASS rect.width.baseVal.value is 100 14 14 PASS rect.width.animVal.value is 100 15 15 PASS rect.width.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/svglength-animation-px-to-cm-expected.txt
r107791 r110545 9 9 PASS rect.width.baseVal.value is 100 10 10 PASS rect.width.animVal.value is 144.5 11 PASS rect.width.baseVal.value is 1 44.511 PASS rect.width.baseVal.value is 100 12 12 PASS rect.width.animVal.value is 189 13 PASS rect.width.baseVal.value is 1 8913 PASS rect.width.baseVal.value is 100 14 14 PASS rect.width.animVal.value is 100 15 15 PASS rect.width.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/svglength-animation-px-to-ems-expected.txt
r107791 r110545 9 9 PASS rect.width.baseVal.value is 100 10 10 PASS rect.width.animVal.value is 150 11 PASS rect.width.baseVal.value is 1 5011 PASS rect.width.baseVal.value is 100 12 12 PASS rect.width.animVal.value is 200 13 PASS rect.width.baseVal.value is 20013 PASS rect.width.baseVal.value is 100 14 14 PASS rect.width.animVal.value is 100 15 15 PASS rect.width.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/svglength-animation-px-to-exs-expected.txt
r107791 r110545 9 9 PASS rect.width.baseVal.value is 100 10 10 PASS rect.width.animVal.value is 150 11 PASS rect.width.baseVal.value is 1 5011 PASS rect.width.baseVal.value is 100 12 12 PASS rect.width.animVal.value is 200 13 PASS rect.width.baseVal.value is 20013 PASS rect.width.baseVal.value is 100 14 14 PASS rect.width.animVal.value is 100 15 15 PASS rect.width.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/svglength-animation-px-to-in-expected.txt
r107791 r110545 9 9 PASS rect.width.baseVal.value is 100 10 10 PASS rect.width.animVal.value is 170 11 PASS rect.width.baseVal.value is 1 7011 PASS rect.width.baseVal.value is 100 12 12 PASS rect.width.animVal.value is 240 13 PASS rect.width.baseVal.value is 24013 PASS rect.width.baseVal.value is 100 14 14 PASS rect.width.animVal.value is 100 15 15 PASS rect.width.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/svglength-animation-px-to-number-expected.txt
r107791 r110545 9 9 PASS rect.width.baseVal.value is 100 10 10 PASS rect.width.animVal.value is 150 11 PASS rect.width.baseVal.value is 1 5011 PASS rect.width.baseVal.value is 100 12 12 PASS rect.width.animVal.value is 200 13 PASS rect.width.baseVal.value is 20013 PASS rect.width.baseVal.value is 100 14 14 PASS rect.width.animVal.value is 100 15 15 PASS rect.width.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/svglength-animation-px-to-pc-expected.txt
r107791 r110545 9 9 PASS rect.width.baseVal.value is 100 10 10 PASS rect.width.animVal.value is 170 11 PASS rect.width.baseVal.value is 1 7011 PASS rect.width.baseVal.value is 100 12 12 PASS rect.width.animVal.value is 240 13 PASS rect.width.baseVal.value is 24013 PASS rect.width.baseVal.value is 100 14 14 PASS rect.width.animVal.value is 100 15 15 PASS rect.width.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/svglength-animation-px-to-percentage-expected.txt
r107791 r110545 9 9 PASS rect.width.baseVal.value is 100 10 10 PASS rect.width.animVal.value is 350 11 PASS rect.width.baseVal.value is 35011 PASS rect.width.baseVal.value is 100 12 12 PASS rect.width.animVal.value is 600 13 PASS rect.width.baseVal.value is 60013 PASS rect.width.baseVal.value is 100 14 14 PASS rect.width.animVal.value is 100 15 15 PASS rect.width.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/svglength-animation-px-to-pt-expected.txt
r107791 r110545 9 9 PASS rect.width.baseVal.value is 100 10 10 PASS rect.width.animVal.value is 161.2 11 PASS rect.width.baseVal.value is 1 61.211 PASS rect.width.baseVal.value is 100 12 12 PASS rect.width.animVal.value is 189 13 PASS rect.width.baseVal.value is 1 8913 PASS rect.width.baseVal.value is 100 14 14 PASS rect.width.animVal.value is 100 15 15 PASS rect.width.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/svglength-animation-px-to-px-expected.txt
r107791 r110545 9 9 PASS rect.width.baseVal.value is 100 10 10 PASS rect.width.animVal.value is 150 11 PASS rect.width.baseVal.value is 1 5011 PASS rect.width.baseVal.value is 100 12 12 PASS rect.width.animVal.value is 200 13 PASS rect.width.baseVal.value is 20013 PASS rect.width.baseVal.value is 100 14 14 PASS rect.width.animVal.value is 100 15 15 PASS rect.width.baseVal.value is 100 -
trunk/LayoutTests/svg/animations/svglength-animation-unitType-expected.txt
r90219 r110545 7 7 8 8 PASS rect.width.animVal.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER 9 PASS rect.width.baseVal.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER 9 10 PASS rect.width.animVal.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER 11 PASS rect.width.baseVal.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER 10 12 PASS rect.width.animVal.unitType is SVGLength.SVG_LENGTHTYPE_PX 13 PASS rect.width.baseVal.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER 11 14 PASS rect.width.animVal.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER 15 PASS rect.width.baseVal.unitType is SVGLength.SVG_LENGTHTYPE_NUMBER 12 16 PASS successfullyParsed is true 13 17 -
trunk/LayoutTests/svg/animations/svglength-animation-values-expected.txt
r107791 r110545 9 9 PASS rect.width.baseVal.value is 100 10 10 PASS rect.width.animVal.value is 130 11 PASS rect.width.baseVal.value is 1 3011 PASS rect.width.baseVal.value is 100 12 12 PASS rect.width.animVal.value is 151.2 13 PASS rect.width.baseVal.value is 1 51.213 PASS rect.width.baseVal.value is 100 14 14 PASS rect.width.animVal.value is 576 15 PASS rect.width.baseVal.value is 57615 PASS rect.width.baseVal.value is 100 16 16 PASS rect.width.animVal.value is 267 17 PASS rect.width.baseVal.value is 26717 PASS rect.width.baseVal.value is 100 18 18 PASS rect.width.animVal.value is 100 19 19 PASS rect.width.baseVal.value is 100 -
trunk/Source/WebCore/ChangeLog
r110544 r110545 1 2012-03-12 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 SVG Animations update baseVal instead of animVal 4 https://bugs.webkit.org/show_bug.cgi?id=12437 5 6 Reviewed by Dirk Schulze. 7 8 Begin implementing the last missing core piece of the SVG DOM: proper animVal support. 9 Most SVG DOM interfaces exposing eg. lengths use SVGAnimatedLength. eg. from SVGRectElement: 10 "readonly attribute SVGAnimatedLength x;" SVGAnimatedXXX contains following methods: 11 "readonly attribute SVGLength baseVal; readonly attribute SVGLength animVal;" 12 From SVG DOM perspective, animVal and baseVal are two distinctive objects, animVal != baseVal. 13 Its underlying value is the same though, if no animation is running on that attribute. 14 15 As soon as a SMIL animation starts animating an SVGAnimated* target attribute, its 16 baseVal and animVal may begin to differ. The animVal always reflect the current animated 17 value (including all effects of additive/accumulated animations) which is shown on screen 18 when eg animating the width of a <rect>. The baseVal is is equal to the underlying XML 19 property value / SVG DOM value, but may be influenced through dynamic changes. 20 (Consider changing rect1.width.baseVal.value while 'width' is animated) 21 22 During the last year we prepared our animation code to turn on animVal support. 23 This patch adds the last missing pieces to turn on animVal support for the SVGLength. 24 SVGLengthList and all other types will follow, one after the other. 25 26 I've decided to write an exhaustive ChangeLog, as this as the base for any future 27 work in this area - hopefully making this more reviewable. 28 29 Tests: svg/animations/additive-from-to-width-animation.html 30 svg/animations/additive-values-width-animation.html 31 svg/animations/change-baseVal-while-animating-fill-freeze-2.html 32 svg/animations/change-baseVal-while-animating-fill-freeze.html 33 svg/animations/change-baseVal-while-animating-fill-remove-2.html 34 svg/animations/change-baseVal-while-animating-fill-remove.html 35 svg/animations/change-target-while-animating-SVG-property.html 36 svg/animations/multiple-animations-fill-freeze.html 37 svg/animations/remove-animation-element-while-animation-is-running.html 38 svg/repaint/repainting-after-animation-element-removal.svg 39 40 * svg/SVGAnimateElement.cpp: Remove unnecessary std namespace inclusion. 41 (WebCore::SVGAnimateElement::SVGAnimateElement): Remove now-obsolete m_aboutToStopAnimation. 42 (WebCore::SVGAnimateElement::calculateAnimatedValue): Swap assertion order, to test hasTagName() _before_ casting. 43 (WebCore::SVGAnimateElement::resetToBaseValue): 44 Stop relying on the cached baseValue (breaking additive="sum"+values animation) for SVG DOM primitive animations. 45 Avoid any string roundtrips previously needed to reset the SVGAnimatedType to the base value. Just grab the 46 currentBaseValue() from the associated SVGAnimatedProperty, which includes all dynamic changes to the baseVal 47 either by SVG DOM or setAttribute() calls - this way we don't need to utilize the buggy cache in SMILTimeContainer, 48 which can be removed once all SVG DOM primitive types switched to the new animVal concept. 49 50 NOTE: When multiple animations of the same attribute are applied to a target element, resetToBaseValue() will be called 51 for the highest priority SVGSMILElement, on every animation step! Consider two <animate> elements, applied to a target 52 <rect> which both animate the 'x' attribute, one from 0s to 2s, the other from 4s to 6s. The last <animate> element 53 will reuse the SVGAnimatedType m_animatedType from the first <animate> element, and never create an own m_animatedType. 54 When the animation starts the first time at 0s, we update the rect.x.animVals SVGLength* pointer, to point to the 55 SVGAnimatedType of the first <animate> element, owning the m_animatedType. From that point on each call to rect.x.animVal 56 will always return the same value as the SVGAnimatedType of the first <animate> element holds. Now after 2s the first 57 <animate> element becomes inactive, but its m_animatedType remains alive. The bindings don't notice this change at all. 58 Now at 4s, the second animation element gets active. It reuses the SVGAnimatedType of the first <animate> element, and 59 applies its animation changes to that SVGAnimatedType, which is immediately reflected in the bindings w/o any additional 60 work. It's very important for the understanding when animationStarted/animationEnded need to be called. 61 62 (WebCore::SVGAnimateElement::applyResultsToTarget): Remove now-obsolete m_aboutToStopAnimation logic. No need to know it at this point. 63 (WebCore::SVGAnimateElement::targetElementWillChange): 64 Renamed from targetElementDidChange(). This method is called from SVGSMILElement for following conditions: 65 - animation element is destructed 66 - animation element is removed from document 67 - target element of animation is destructed 68 - target element of animation is removed from document 69 - target element of animation changes id 70 71 Whenever any of this happens, we need to reset the animVal. Resetting the animVal involves resetting the PropertyType* pointer, 72 eg. SVGLength*, from the animVal property tear off, belonging to a certain SVGAnimatedProperty (eg. rect.x) to the initial 73 value again, which is the 'm_x' of the SVGRectElement. This is needed as the SVGAnimatedType the animVal currently points to, 74 if an animation is/was running, is destructed in targetElementWillChange(), to reset the SVGAnimateElement to the initial 75 state before it received a target. This is the only place which destructed the m_animatedType, and thus the only place that 76 needs to take care of resetting the animVal pointers. 77 78 * svg/SVGAnimatedLength.cpp: 79 (WebCore::SVGAnimatedLengthAnimator::constructFromCopy): 80 Add a new constructFromCopy(SVGGenericAnimatedType) function to SVGAnimatedLengthAnimator. 81 It takes a type-unsafe SVGGenericAnimatedType - the caller has to guarantee the type matches. 82 This is strictly enforced for the single caller of constructFromCopy, and guaranteed to be safe. 83 84 * svg/SVGAnimatedLength.h: Add new constructFromCopy method, which is used to avoid string-roundtrips when resetting to base values. 85 * svg/SVGAnimatedType.cpp: 86 (WebCore::SVGAnimatedType::supportsAnimVal): Only returns true for AnimatedLength, for now. 87 (WebCore::SVGAnimatedType::setVariantValue): Takes a SVGGenericAnimatedType, assuming the type matches. Callers have to guarantee type-safety! 88 * svg/SVGAnimatedType.h: 89 (SVGAnimatedType): Add new static supportsAnimVal(AnimatedPropertyType) function. 90 (WebCore::SVGAnimatedType::variantValue): Add a generic accessor for all animated types, called variant(). Only one place uses this. 91 * svg/SVGAnimatedTypeAnimator.h: 92 (WebCore::SVGAnimatedTypeAnimator::constructFromCopy): 93 New method to construct an eg. SVGAnimatedLengthAnimator right from a SVGLength, instead of a String. 94 In that case the SVGAnimatedType just stores a pointer to the underlying SVGLength, no copying and or other roundtrips involved. 95 96 * svg/SVGAnimationElement.cpp: 97 (WebCore::SVGAnimationElement::svgAttributeChanged): 98 Implement this instead of attributeChanged. The previous implementation reset the animation state to Inactive, causing a full 99 rebuild, whenever any attribute changes, even though it might not be related for the animation element, eg. 100 animate.setAttribute("stdDeviationX", "foobar"). Fix that by checking if we support the attribute (keyTimes/keySplines/etc..) 101 , if not pass it on to SVGSMILElement (which supports begin/end/etc..) to check if it can handle that. 102 103 (WebCore::SVGAnimationElement::animationAttributeChanged): 104 Called from our svgAttributeChanged, and/or from SVGSMILElement::svgAttributeChanged, whenever a _known_ attribute has changed. 105 This sledgehammer should be used with care, instead of each time attributeChanged() is called :-) 106 107 (WebCore::setTargetAttributeAnimatedCSSValue): 108 Remove support for removing properties from the override style sheet. I've added this optimization too early, we should reevaluate 109 this once more types support animVal. It currently complexifies the logic too much, requiring setAttributeAnimatedValue to know 110 if the animation ends (and that's not easy to figure out, at least not using started/endedActiveInterval, as I anticipated). 111 112 (WebCore::findMatchingAnimatedProperty): 113 Add helper functions which retrieves a SVGAnimatedProperty* for a given SVGElement* targetElement, an attributeName, and an attribute 114 type. eg. findMatchingAnimatedProperty(myRectElement, SVGNames::xAttr, AnimatedLength) returns the SVGAnimatedProperty which is 115 exposed to JS, that holds: SVGProperty* baseVal, and SVGProperty* animVal. (Lazily created if they got accessed from JS.). This is 116 used to update the animVal pointing to a new eg. SVGLength* value, once animation has started, to make rect->x() return that new 117 SVGLength* value (internally), and to reflect the current animated value in rect.x.animVal.value from JS. 118 119 (WebCore::SVGAnimationElement::applyAnimatedValue): Refactored from setTargetAttributeAnimatedValue, to simplify the code. 120 (WebCore::notifyAnimatedPropertyAboutAnimationBeginEnd): 121 Helper function to share code betweeen animationStarted/animationEnded. 122 It takes a SVGAnimatedProperty* and a SVGAnimatedType* which may be zero, indicating that the animation ended. 123 It calls animationStarted/animationEnded on the given SVGAnimatedProperty, to update the animVal state. 124 It also figures out all instances of the target element, and their SVGAnimatedProperties that may need updating. 125 126 (WebCore::SVGAnimationElement::animationStarted): Uses the helper above, passing on the given animatedType. 127 (WebCore::SVGAnimationElement::animationEnded): Uses the helper above, passing 0 as animatedType. 128 (WebCore::InstanceUpdateBlocker::InstanceUpdateBlocker): 129 Added new helper struct, doing element->setInstancesUpdatedBlock(true) on construction and setInstancesUpdatesBlocked(false) on 130 destruction, making it impossible to forget one. If we ever rewrite svgAttributeChanged & co to auto-update the cloned instances, 131 this can go away. 132 133 (WebCore::SVGAnimationElement::setTargetAttributeAnimatedValue): 134 Now takes an SVGAnimatedType* instead of a String parameter. In order to avoid string-roundtrips for animVal support, let us 135 decide if we need to construct a String out of it, or not. For animations supporting animVal (only SVGLength) we don't need 136 to update any attribute or animVal pointer here, that happens automatically! We only need to notify the targetElement eg, 137 that its xAttr changed! Previously we had to call targetElement->setAttribute("x", "...") on every animation step for 138 SVGLength animations - that's gone now! The SVGAnimatedType pointers remains the same during the whole animation, so there's 139 no need to call animationStarted() at each animated step! 140 141 (WebCore::SVGAnimationElement::animatedPropertyForType): 142 Helper function returning a SVGAnimatedProperty* for the current target element & current target attribute, if the 143 current animation is running on a type supporting animVal (SVGLength), or returning 0. This is needed for SVGAnimateElement. 144 Reuses the existing findMatchingAnimatedProperty code. 145 146 * svg/SVGAnimationElement.h: 147 * svg/animation/SMILTimeContainer.cpp: 148 (WebCore::SMILTimeContainer::updateAnimations): 149 Add comment to clarify why caching baseValues is just wrong. For SVGLength animations the problem is now gone. 150 This is exercised using the new additive-from-to-width-animation.html & additive-values-width-animation.html tests. 151 152 * svg/animation/SVGSMILElement.cpp: 153 (WebCore::SVGSMILElement::removedFromDocument): 154 Since animVal requires that the SVGAnimatedProperties are correctly reset if an animation element is removed from the document, 155 we have to call targetElementWillChange(0) from here. That requires to move the "m_attributeName = anyQName()" line down, 156 otherwise targetElementWillChange() would early exit, as no valid attributeName was specified. 157 158 This is verified using the new svg/animations/remove-animation-element-while-animation-is-running.html 159 and svg/repaint/repainting-after-animation-element-removal.svg tests. 160 161 (WebCore::SVGSMILElement::isSupportedAttribute): Add function like all SVG*Elements have identifying their supported attributes. 162 (WebCore::SVGSMILElement::svgAttributeChanged): 163 Implement svgAttributeChanged instead of attributeChanged. Only take action if the attribute is actually supported. 164 If one of the common attributes like begin/end/etc. changed, be sure to call animationAttributeChanged() so that our 165 ancestor-classes get notified about this and can take action as well. NOTE: This is not about animating begin/end attributes, 166 but about pure DOM changes. begin/end/et.. are not exposed to the SVG DOM, we still reuse the svgAttributeChanged logic 167 for consistency. (This does NOT make those attributes animatable, nothing this here as it came up while reviewing). 168 169 (WebCore::SVGSMILElement::targetElement): Adapt logic to targetElementDidChange -> targetElementWillChange change. 170 (WebCore::SVGSMILElement::targetElementWillChange): 171 Renamed from targetElementDidChange. Added "oldTarget" as parameter as well. Our ancestor-classes like SVGAnimateElement 172 use this to properly deregister the animVal in the old target, before resetting the SVGAnimatedType, otherwise we'd leave 173 dangling pointers around (verified manually by guard malloc runs, that none of this happens). 174 175 Also add a default implementation here in targetElementWillChange, that ancestor classes have to call. 176 Now we properly call endedActiveInterval() if the m_activeState is currently Active, so that animations are shut-down 177 just like if the animation properly ends (use the same cleanup routines, etc.). Not doing that now leads to assertions. 178 179 (WebCore::SVGSMILElement::resetTargetElement): 180 Instead of forcing m_activeState to be inactive, use the standard methods to end the animation. 181 targetElementWillChange(m_targetElement, 0) and animationAttributeChanged(). 182 183 resetTargetElement() is only called by SVGDocumentExtensions::removeAllAnimationElementsFromTarget() for following conditions: 184 - targetElement gets destructed 185 - targetElement gets removed from the document 186 - targetElement id changes 187 188 If the targetElement gets destructed or removed, no actions need to be taken, as the SVGAnimatedPropertys are teared down 189 as well. But if only the id changes, we still have to properly disconnect the animVals - this is all handled through 190 targetElementWillChange now - that's why this has to be called from here as well. 191 That explains why targetElementWillChange() now needs to check if the targetElement is destructing or not. 192 193 * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h: 194 Pass the AnimatedPropertyType from the SVGPropertyInfo to the SVGAnimatedProperties. 195 Requires mechanic changes in all SVGAnimated* classes. We need acccess to the AnimatedPropertyType 196 to verify the SVGAnimatedType objects, passed to animationStarted, match our type. This is to enforce 197 strict type-checking, whenever SVGGenericAnimatedTypes are passed around. 198 199 (WebCore::SVGAnimatedEnumerationPropertyTearOff::create): 200 (WebCore::SVGAnimatedEnumerationPropertyTearOff::SVGAnimatedEnumerationPropertyTearOff): 201 * svg/properties/SVGAnimatedListPropertyTearOff.h: Ditto. 202 (WebCore::SVGAnimatedListPropertyTearOff::create): 203 (WebCore::SVGAnimatedListPropertyTearOff::SVGAnimatedListPropertyTearOff): 204 * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: Ditto. 205 (WebCore::SVGAnimatedPathSegListPropertyTearOff::create): 206 (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff): 207 * svg/properties/SVGAnimatedProperty.h: Store AnimatedPropertyType, add accessors. 208 (WebCore::SVGAnimatedProperty::animatedPropertyType): Add accessor. 209 (WebCore::SVGAnimatedProperty::animationValueChanged): New animVal related functions to be implemented in the animated tear offs. 210 (WebCore::SVGAnimatedProperty::animationStarted): Ditto. 211 (WebCore::SVGAnimatedProperty::animationEnded): Ditto. 212 (WebCore::SVGAnimatedProperty::currentBaseValue): 213 Generic accessor for the baseVal: returns a SVGGenericAnimatedType. 214 It takes an AnimatedPropertyType as input, that's only needed to verify that the type we're returning matches 215 the expectation of the caller. If not, return 0 to avoid any potential casting mistakes, which would lead to crashes. 216 217 (WebCore::SVGAnimatedProperty::SVGAnimatedProperty): Store m_animatedPropertyType. 218 * svg/properties/SVGAnimatedPropertyTearOff.h: 219 (WebCore::SVGAnimatedPropertyTearOff::create): Same changes as in the other tear offs: pass around AnimatedPropertyType. 220 (WebCore::SVGAnimatedPropertyTearOff::currentBaseValue): Returns &m_property, if the type matches (see above). 221 (SVGAnimatedPropertyTearOff): Pass around AnimatedPropertyType. 222 (WebCore::SVGAnimatedPropertyTearOff::animationValueChanged): No-op for non list types, don't need to do anything here. 223 (WebCore::SVGAnimatedPropertyTearOff::animationStarted): 224 (WebCore::SVGAnimatedPropertyTearOff::animationEnded): 225 Store the currently animated value in the animVal() property tear off, that's also re-used as-is for the JS bindings. 226 As this is important, here's an example of how this affects methods like rect->x() used in the renderers. 227 228 Setting m_isAnimating to true, redirects any rect->x() calls that previously returned rect->m_x, to 229 rect->xAnimated()->animVal()->propertyReference() (which returns the same SVGLength& that the SVGAnimatedElement 230 m_animatedType contains). Calling rect->setXBaseValue() still modifies rect->m_x, and is used by all parseAttribute() 231 methods in svg/ as setAttribute() calls only ever modify the "baseValue", never the current animated value. 232 rect.x.baseVal will return a SVGLength object corresponding to rect->m_x. 233 rect.x.animVal will return a SVGLength object corresponding to rect->xAnimated()->animVal()->propertyReference(). 234 235 These implementation details are all hidden in the SVGAnimatedPropertyMacros. Here's an example from SVGRectElement: 236 DECLARE_ANIMATED_LENGTH(X, x) -> Replace PropertyType with 'SVGLength', LowerProperty with 'x', and UpperProperty with 'X'. 237 238 PropertyType& LowerProperty() const 239 { 240 if (TearOffType* wrapper = SVGAnimatedProperty::lookupWrapper<UseOwnerType, TearOffType, IsDerivedFromSVGElement<UseOwnerType>::value>(this, LowerProperty##PropertyInfo())) { 241 if (wrapper->isAnimating()) 242 return wrapper->currentAnimatedValue(); 243 } 244 return m_##LowerProperty.value; 245 } 246 247 PropertyType& LowerProperty##BaseValue() const 248 { 249 return m_##LowerProperty.value; 250 } 251 252 void set##UpperProperty##BaseValue(const PropertyType& type) 253 { 254 m_##LowerProperty.value = type; 255 } 256 257 Any code outside of svg/, eg. in rendering/svg, does not need to care about any baseVal/animVal differences. 258 During layout eg. RenderSVGRect calls rect->x().value(someLengthContext) to get the current 'x' as float. If an animation 259 is running on that rect element it will automatically retrieve the last set animated value here - all under the hood. 260 I hope that sheds some light in those myserious functions, they were designed with animVal in mind, but we never had that until now :-) 261 262 (WebCore::SVGAnimatedPropertyTearOff::SVGAnimatedPropertyTearOff): Pass around AnimatedPropertyType. 263 (WebCore::SVGAnimatedPropertyTearOff::~SVGAnimatedPropertyTearOff): Add destructor to debug builds veryifing that m_isAnimating is false. 264 * svg/properties/SVGAnimatedStaticPropertyTearOff.h: Ditto. 265 (WebCore::SVGAnimatedStaticPropertyTearOff::create): 266 (WebCore::SVGAnimatedStaticPropertyTearOff::SVGAnimatedStaticPropertyTearOff): 267 * svg/properties/SVGAnimatedTransformListPropertyTearOff.h: Ditto. 268 (WebCore::SVGAnimatedTransformListPropertyTearOff::create): 269 (WebCore::SVGAnimatedTransformListPropertyTearOff::SVGAnimatedTransformListPropertyTearOff): 270 * svg/properties/SVGPropertyInfo.h: Add SVGGenericAnimatedType definition. 271 * svg/properties/SVGPropertyTearOff.h: Remove obsolete updateAnimVal method - switched to using setValue directly. 272 1 273 2012-03-13 Luke Macpherson <macpherson@chromium.org> 2 274 -
trunk/Source/WebCore/svg/SVGAnimateElement.cpp
r109342 r110545 35 35 #include "SVGStyledElement.h" 36 36 37 using namespace std;38 39 37 namespace WebCore { 40 38 … … 42 40 : SVGAnimationElement(tagName, document) 43 41 , m_animatedPropertyType(AnimatedString) 44 , m_aboutToStopAnimation(false)45 42 , m_fromPropertyValueType(RegularPropertyValue) 46 43 , m_toPropertyValueType(RegularPropertyValue) … … 177 174 ASSERT(m_toType); 178 175 176 ASSERT(resultElement->hasTagName(SVGNames::animateTag) 177 || resultElement->hasTagName(SVGNames::animateColorTag) 178 || resultElement->hasTagName(SVGNames::setTag)); 179 179 180 SVGAnimateElement* resultAnimationElement = static_cast<SVGAnimateElement*>(resultElement); 180 181 ASSERT(resultAnimationElement->m_animatedType); 181 182 ASSERT(resultAnimationElement->m_animatedPropertyType == m_animatedPropertyType); 182 ASSERT(resultAnimationElement->hasTagName(SVGNames::animateTag)183 || resultAnimationElement->hasTagName(SVGNames::animateColorTag)184 || resultAnimationElement->hasTagName(SVGNames::setTag));185 183 186 184 if (hasTagName(SVGNames::setTag)) … … 218 216 void SVGAnimateElement::resetToBaseValue(const String& baseString) 219 217 { 218 // If animatedProperty is not null, we're dealing with a SVG DOM primitive animation. 219 // In that case we don't need any base value strings, but can directly operate on these 220 // SVG DOM primitives, like SVGLength. 221 SVGAnimatedTypeAnimator* animator = ensureAnimator(); 222 if (SVGAnimatedProperty* animatedProperty = animatedPropertyForType(animator->type())) { 223 if (!m_animatedType) { 224 m_animatedType = animator->constructFromCopy(animatedProperty->currentBaseValue(animator->type())); 225 animationStarted(animatedProperty, m_animatedType.get()); 226 } else 227 m_animatedType->setVariantValue(animatedProperty->currentBaseValue(m_animator->type())); 228 ASSERT(m_animatedPropertyType == animator->type()); 229 return; 230 } 231 220 232 if (!m_animatedType) 221 m_animatedType = ensureAnimator()->constructFromString(baseString);233 m_animatedType = animator->constructFromString(baseString); 222 234 else 223 235 m_animatedType->setValueAsString(attributeName(), baseString); 224 ASSERT(m_animatedPropertyType == m_animator->type());225 } 226 236 ASSERT(m_animatedPropertyType == animator->type()); 237 } 238 227 239 void SVGAnimateElement::applyResultsToTarget() 228 240 { … … 231 243 ASSERT(m_animatedPropertyType != AnimatedUnknown); 232 244 ASSERT(m_animatedType); 233 234 if (m_aboutToStopAnimation) { 235 m_aboutToStopAnimation = false; 236 resetAnimationState(m_animatedType->valueAsString()); 237 return; 245 setTargetAttributeAnimatedValue(m_animatedType.get()); 246 } 247 248 float SVGAnimateElement::calculateDistance(const String& fromString, const String& toString) 249 { 250 // FIXME: A return value of float is not enough to support paced animations on lists. 251 SVGElement* targetElement = this->targetElement(); 252 if (!targetElement) 253 return -1; 254 255 return ensureAnimator()->calculateDistance(fromString, toString); 256 } 257 258 void SVGAnimateElement::targetElementWillChange(SVGElement* currentTarget, SVGElement* newTarget) 259 { 260 SVGSMILElement::targetElementWillChange(currentTarget, newTarget); 261 262 // Be sure to never execute any of this, while the target element is being removed from the document or destructed. 263 if (currentTarget && currentTarget->inDocument() && currentTarget->parentNode()) { 264 ASSERT(!currentTarget->m_deletionHasBegun); 265 if (SVGAnimatedProperty* animatedProperty = animatedPropertyForType(m_animatedPropertyType)) 266 animationEnded(animatedProperty); 238 267 } 239 268 240 setTargetAttributeAnimatedValue(m_animatedType->valueAsString());241 }242 243 float SVGAnimateElement::calculateDistance(const String& fromString, const String& toString)244 {245 // FIXME: A return value of float is not enough to support paced animations on lists.246 SVGElement* targetElement = this->targetElement();247 if (!targetElement)248 return -1;249 250 return ensureAnimator()->calculateDistance(fromString, toString);251 }252 253 void SVGAnimateElement::targetElementDidChange(SVGElement* targetElement)254 {255 269 m_animatedType.clear(); 256 270 m_fromType.clear(); 257 271 m_toType.clear(); 258 272 m_animator.clear(); 259 m_animatedPropertyType = targetElement ? determineAnimatedPropertyType(targetElement) : AnimatedString;273 m_animatedPropertyType = newTarget ? determineAnimatedPropertyType(newTarget) : AnimatedString; 260 274 } 261 275 … … 268 282 } 269 283 270 void SVGAnimateElement::endedActiveInterval() 271 { 272 SVGAnimationElement::endedActiveInterval(); 273 m_aboutToStopAnimation = true; 274 } 275 276 } 284 } 285 277 286 #endif // ENABLE(SVG) -
trunk/Source/WebCore/svg/SVGAnimateElement.h
r109342 r110545 66 66 virtual float calculateDistance(const String& fromString, const String& toString); 67 67 68 virtual void endedActiveInterval(); 69 virtual void targetElementDidChange(SVGElement* targetElement) OVERRIDE; 68 virtual void targetElementWillChange(SVGElement* currentTarget, SVGElement* oldTarget) OVERRIDE; 70 69 71 70 private: … … 74 73 virtual bool hasValidAttributeType(); 75 74 AnimatedPropertyType m_animatedPropertyType; 76 bool m_aboutToStopAnimation;77 75 78 76 AnimatedPropertyValueType m_fromPropertyValueType; -
trunk/Source/WebCore/svg/SVGAnimatedLength.cpp
r99838 r110545 46 46 { 47 47 return SVGAnimatedType::createLength(new SVGLength(m_lengthMode, string)); 48 } 49 50 PassOwnPtr<SVGAnimatedType> SVGAnimatedLengthAnimator::constructFromCopy(SVGGenericAnimatedType* animatedType) 51 { 52 ASSERT(animatedType); 53 return SVGAnimatedType::createLength(new SVGLength(*reinterpret_cast<SVGLength*>(animatedType))); 48 54 } 49 55 -
trunk/Source/WebCore/svg/SVGAnimatedLength.h
r95901 r110545 38 38 39 39 class SVGAnimationElement; 40 class SVGGenericAnimatedType; 40 41 41 42 class SVGAnimatedLengthAnimator : public SVGAnimatedTypeAnimator { … … 46 47 47 48 virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&); 49 virtual PassOwnPtr<SVGAnimatedType> constructFromCopy(SVGGenericAnimatedType*); 48 50 49 51 virtual void calculateFromAndToValues(OwnPtr<SVGAnimatedType>& fromValue, OwnPtr<SVGAnimatedType>& toValue, const String& fromString, const String& toString); -
trunk/Source/WebCore/svg/SVGAnimatedType.cpp
r95901 r110545 428 428 } 429 429 430 430 bool SVGAnimatedType::supportsAnimVal(AnimatedPropertyType type) 431 { 432 // FIXME: This lists the current state of our animVal support: only SVGLength is supported for now. 433 switch (type) { 434 case AnimatedLength: 435 return true; 436 case AnimatedAngle: 437 case AnimatedBoolean: 438 case AnimatedColor: 439 case AnimatedEnumeration: 440 case AnimatedInteger: 441 case AnimatedLengthList: 442 case AnimatedNumber: 443 case AnimatedNumberList: 444 case AnimatedNumberOptionalNumber: 445 case AnimatedPath: 446 case AnimatedPoints: 447 case AnimatedPreserveAspectRatio: 448 case AnimatedRect: 449 case AnimatedString: 450 case AnimatedTransformList: 451 case AnimatedUnknown: 452 return false; 453 } 454 455 ASSERT_NOT_REACHED(); 456 return false; 457 } 458 459 void SVGAnimatedType::setVariantValue(SVGGenericAnimatedType* type) 460 { 461 // FIXME: This lists the current state of our animVal support: only SVGLength is supported for now. 462 switch (m_type) { 463 case AnimatedLength: 464 *m_data.length = *reinterpret_cast<SVGLength*>(type); 465 return; 466 case AnimatedAngle: 467 case AnimatedBoolean: 468 case AnimatedColor: 469 case AnimatedEnumeration: 470 case AnimatedInteger: 471 case AnimatedLengthList: 472 case AnimatedNumber: 473 case AnimatedNumberList: 474 case AnimatedNumberOptionalNumber: 475 case AnimatedPath: 476 case AnimatedPoints: 477 case AnimatedPreserveAspectRatio: 478 case AnimatedRect: 479 case AnimatedString: 480 case AnimatedTransformList: 481 case AnimatedUnknown: 482 break; 483 } 484 485 ASSERT_NOT_REACHED(); 486 } 487 431 488 } // namespace WebCore 432 489 -
trunk/Source/WebCore/svg/SVGAnimatedType.h
r95901 r110545 29 29 class FloatRect; 30 30 class SVGAngle; 31 class SVGGenericAnimatedType; 31 32 class SVGLength; 32 33 class SVGLengthList; … … 55 56 static PassOwnPtr<SVGAnimatedType> createRect(FloatRect*); 56 57 static PassOwnPtr<SVGAnimatedType> createString(String*); 58 static bool supportsAnimVal(AnimatedPropertyType); 57 59 58 60 AnimatedPropertyType type() const { return m_type; } … … 72 74 FloatRect& rect(); 73 75 String& string(); 76 77 // Use with care, the actual type of the generic animated object has to be equal to our type(). 78 void setVariantValue(SVGGenericAnimatedType*); 79 SVGGenericAnimatedType* variantValue() const { return m_data.variant; } 74 80 75 81 String valueAsString(); … … 104 110 FloatRect* rect; 105 111 String* string; 112 SVGGenericAnimatedType* variant; 106 113 } m_data; 107 114 }; -
trunk/Source/WebCore/svg/SVGAnimatedTypeAnimator.h
r108134 r110545 28 28 29 29 class SVGAnimationElement; 30 class SVGGenericAnimatedType; 30 31 31 32 class SVGAnimatedTypeAnimator { … … 34 35 virtual ~SVGAnimatedTypeAnimator() { } 35 36 virtual PassOwnPtr<SVGAnimatedType> constructFromString(const String&) = 0; 37 // FIXME: Make this pure once all types implement this. Its needed for animVal, and currently only SVGLengthAnimator implements this. 38 virtual PassOwnPtr<SVGAnimatedType> constructFromCopy(SVGGenericAnimatedType*) { return PassOwnPtr<SVGAnimatedType>(); } 36 39 37 40 virtual void calculateFromAndToValues(OwnPtr<SVGAnimatedType>& fromValue, OwnPtr<SVGAnimatedType>& toValue, const String& fromString, const String& toString) = 0; -
trunk/Source/WebCore/svg/SVGAnimationElement.cpp
r109679 r110545 157 157 return supportedAttributes.contains<QualifiedName, SVGAttributeHashTranslator>(attrName); 158 158 } 159 159 160 160 void SVGAnimationElement::parseAttribute(Attribute* attr) 161 161 { … … 202 202 } 203 203 204 void SVGAnimationElement::attributeChanged(Attribute* attr) 204 void SVGAnimationElement::svgAttributeChanged(const QualifiedName& attrName) 205 { 206 if (!isSupportedAttribute(attrName)) { 207 SVGSMILElement::svgAttributeChanged(attrName); 208 return; 209 } 210 211 animationAttributeChanged(); 212 } 213 214 void SVGAnimationElement::animationAttributeChanged() 205 215 { 206 216 // Assumptions may not hold after an attribute change. 207 217 m_animationValid = false; 208 218 setInactive(); 209 SVGSMILElement::attributeChanged(attr);210 219 } 211 220 … … 334 343 { 335 344 StylePropertySet* propertySet = targetElement->ensureAnimatedSMILStyleProperties(); 336 if (value.isNull()) {337 if (propertySet->removeProperty(cssPropertyID(attributeName.localName())))338 targetElement->setNeedsStyleRecalc();339 return;340 }341 342 345 if (propertySet->setProperty(cssPropertyID(attributeName.localName()), value, false, 0)) 343 346 targetElement->setNeedsStyleRecalc(); 344 347 } 345 348 346 static inline void setTargetAttributeAnimatedXMLValue(SVGElement* targetElement, const QualifiedName& attributeName, const String& value) 347 { 348 // FIXME: Detach animVal, if value.isNull() - once animVal support is enabled. 349 targetElement->setAttribute(attributeName, value); 350 } 351 352 void SVGAnimationElement::setTargetAttributeAnimatedValue(const String& value) 353 { 349 static inline SVGAnimatedProperty* findMatchingAnimatedProperty(SVGElement* targetElement, const QualifiedName& attributeName, AnimatedPropertyType type) 350 { 351 Vector<RefPtr<SVGAnimatedProperty> > properties; 352 targetElement->localAttributeToPropertyMap().animatedPropertiesForAttribute(targetElement, attributeName, properties); 353 354 size_t propertiesSize = properties.size(); 355 for (size_t i = 0; i < propertiesSize; ++i) { 356 SVGAnimatedProperty* property = properties[i].get(); 357 if (property->animatedPropertyType() != type) 358 continue; 359 360 // FIXME: This check can go away once all types support animVal. 361 if (SVGAnimatedType::supportsAnimVal(property->animatedPropertyType())) 362 return property; 363 return 0; 364 } 365 366 return 0; 367 } 368 369 void SVGAnimationElement::applyAnimatedValue(SVGAnimationElement::ShouldApplyAnimation shouldApply, SVGElement* targetElement, const QualifiedName& attributeName, SVGAnimatedType* animatedType) 370 { 371 ASSERT(animatedType); 372 373 switch (shouldApply) { 374 case DontApplyAnimation: 375 ASSERT_NOT_REACHED(); 376 break; 377 case ApplyCSSAnimation: 378 setTargetAttributeAnimatedCSSValue(targetElement, attributeName, animatedType->valueAsString()); 379 break; 380 case ApplyXMLAnimation: 381 if (SVGAnimatedProperty* property = findMatchingAnimatedProperty(targetElement, attributeName, animatedType->type())) { 382 property->animationValueChanged(); 383 break; 384 } 385 386 // FIXME: Deprecated legacy code path which mutates the DOM. 387 targetElement->setAttribute(attributeName, animatedType->valueAsString()); 388 break; 389 } 390 } 391 392 struct InstanceUpdateBlocker { 393 InstanceUpdateBlocker(SVGElement* targetElement) 394 : m_targetElement(targetElement->isStyled() ? static_cast<SVGStyledElement*>(targetElement) : 0) 395 { 396 if (m_targetElement) 397 m_targetElement->setInstanceUpdatesBlocked(true); 398 } 399 400 ~InstanceUpdateBlocker() 401 { 402 if (m_targetElement) 403 m_targetElement->setInstanceUpdatesBlocked(false); 404 } 405 406 SVGStyledElement* m_targetElement; 407 }; 408 409 void SVGAnimationElement::setTargetAttributeAnimatedValue(SVGAnimatedType* animatedType) 410 { 411 ASSERT(animatedType); 412 354 413 SVGElement* targetElement = this->targetElement(); 355 414 const QualifiedName& attributeName = this->attributeName(); … … 358 417 return; 359 418 360 if (targetElement->isStyled()) 361 static_cast<SVGStyledElement*>(targetElement)->setInstanceUpdatesBlocked(true); 362 363 if (shouldApply == ApplyCSSAnimation) 364 setTargetAttributeAnimatedCSSValue(targetElement, attributeName, value); 365 else 366 setTargetAttributeAnimatedXMLValue(targetElement, attributeName, value); 367 368 if (targetElement->isStyled()) 369 static_cast<SVGStyledElement*>(targetElement)->setInstanceUpdatesBlocked(false); 419 // Scope this block, so instances updates will be unblocked, before we try to update the instances. 420 { 421 InstanceUpdateBlocker blocker(targetElement); 422 applyAnimatedValue(shouldApply, targetElement, attributeName, animatedType); 423 } 424 425 // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. 426 const HashSet<SVGElementInstance*>& instances = targetElement->instancesForElement(); 427 const HashSet<SVGElementInstance*>::const_iterator end = instances.end(); 428 for (HashSet<SVGElementInstance*>::const_iterator it = instances.begin(); it != end; ++it) { 429 if (SVGElement* shadowTreeElement = (*it)->shadowTreeElement()) 430 applyAnimatedValue(shouldApply, shadowTreeElement, attributeName, animatedType); 431 } 432 } 433 434 static inline void notifyAnimatedPropertyAboutAnimationBeginEnd(SVGAnimatedProperty* property, SVGAnimatedType* type, SVGElement* targetElement, const QualifiedName& attributeName) 435 { 436 ASSERT(property); 437 ASSERT(targetElement); 438 ASSERT(property->contextElement() == targetElement); 439 ASSERT(property->attributeName() == attributeName); 440 if (type) 441 property->animationStarted(type); 442 else { 443 // animationEnded() notifies the targetElement about the attribute change - take care of blocking 444 // updates to instances of elements, otherwise they use trees got recloned, unncessary. 445 InstanceUpdateBlocker blocker(targetElement); 446 property->animationEnded(); 447 } 370 448 371 449 // If the target element has instances, update them as well, w/o requiring the <use> tree to be rebuilt. … … 377 455 continue; 378 456 379 if (shouldApply == ApplyCSSAnimation) 380 setTargetAttributeAnimatedCSSValue(shadowTreeElement, attributeName, value); 457 SVGAnimatedProperty* propertyInstance = findMatchingAnimatedProperty(shadowTreeElement, attributeName, property->animatedPropertyType()); 458 if (!propertyInstance) 459 continue; 460 461 if (type) 462 propertyInstance->animationStarted(type); 381 463 else 382 setTargetAttributeAnimatedXMLValue(shadowTreeElement, attributeName, value); 383 } 384 } 385 386 void SVGAnimationElement::resetAnimationState(const String& baseValue) 387 { 388 // FIXME: This extra check will go away, once animVal is enabled. 464 propertyInstance->animationEnded(); 465 } 466 } 467 468 void SVGAnimationElement::animationStarted(SVGAnimatedProperty* property, SVGAnimatedType* type) 469 { 470 ASSERT(type); 471 notifyAnimatedPropertyAboutAnimationBeginEnd(property, type, targetElement(), attributeName()); 472 } 473 474 void SVGAnimationElement::animationEnded(SVGAnimatedProperty* property) 475 { 476 notifyAnimatedPropertyAboutAnimationBeginEnd(property, 0, targetElement(), attributeName()); 477 } 478 479 SVGAnimatedProperty* SVGAnimationElement::animatedPropertyForType(AnimatedPropertyType type) 480 { 389 481 SVGElement* targetElement = this->targetElement(); 390 482 const QualifiedName& attributeName = this->attributeName(); 391 483 ShouldApplyAnimation shouldApply = shouldApplyAnimation(targetElement, attributeName); 392 if (shouldApply == DontApplyAnimation) 393 return; 394 395 if (isFrozen() || shouldApply == ApplyXMLAnimation) 396 setTargetAttributeAnimatedValue(baseValue); 397 else // Only CSS animations support detaching previously animated properties so far, indicating by passing a null-string. 398 setTargetAttributeAnimatedValue(String()); 484 if (shouldApply != ApplyXMLAnimation) 485 return 0; 486 return findMatchingAnimatedProperty(targetElement, attributeName, type); 399 487 } 400 488 … … 663 751 664 752 } 753 665 754 #endif // ENABLE(SVG) -
trunk/Source/WebCore/svg/SVGAnimationElement.h
r109342 r110545 58 58 class ConditionEventListener; 59 59 class TimeContainer; 60 class SVGAnimatedType; 60 61 61 62 class SVGAnimationElement : public SVGSMILElement, … … 87 88 bool isSupportedAttribute(const QualifiedName&); 88 89 virtual void parseAttribute(Attribute*) OVERRIDE; 90 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE; 89 91 90 92 enum AttributeType { … … 99 101 String fromValue() const; 100 102 101 String targetAttributeBaseValue() const; 102 void setTargetAttributeAnimatedValue(const String&); 103 String targetAttributeBaseValue(); 104 void setTargetAttributeAnimatedValue(SVGAnimatedType*); 105 SVGAnimatedProperty* animatedPropertyForType(AnimatedPropertyType); 106 107 void animationStarted(SVGAnimatedProperty*, SVGAnimatedType*); 108 void animationEnded(SVGAnimatedProperty*); 103 109 104 110 // from SVGSMILElement … … 106 112 virtual void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement); 107 113 108 void resetAnimationState(const String& baseValue);109 110 114 private: 111 virtual void a ttributeChanged(Attribute*) OVERRIDE;115 virtual void animationAttributeChanged() OVERRIDE; 112 116 113 117 virtual bool calculateFromAndToValues(const String& fromString, const String& toString) = 0; … … 132 136 133 137 ShouldApplyAnimation shouldApplyAnimation(SVGElement* targetElement, const QualifiedName& attributeName); 138 void applyAnimatedValue(ShouldApplyAnimation, SVGElement* targetElement, const QualifiedName& attributeName, SVGAnimatedType*); 134 139 135 140 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAnimationElement) -
trunk/Source/WebCore/svg/animation/SMILTimeContainer.cpp
r107682 r110545 266 266 continue; 267 267 resultElement = animation; 268 // FIXME: As soon as we stop mutating the DOM, we can stop passing the cached baseValue here. 269 // Caching the baseValue results in wrong additive="sum" behaviour. Reason: the m_savedBaseValues 270 // is NEVER reset, it always contains the state of the baseValue, at the point where we first 271 // called baseValueFor(), typically at the beginning of the animation. 268 272 resultElement->resetToBaseValue(baseValueFor(key)); 269 273 resultsElements.add(key, resultElement); -
trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp
r109345 r110545 217 217 void SVGSMILElement::removedFromDocument() 218 218 { 219 m_attributeName = anyQName();220 219 if (m_timeContainer) { 221 220 m_timeContainer->unschedule(this); … … 230 229 if (m_targetElement) { 231 230 document()->accessSVGExtensions()->removeAnimationElementFromTarget(this, m_targetElement); 231 targetElementWillChange(m_targetElement, 0); 232 232 m_targetElement = 0; 233 233 } 234 234 235 m_attributeName = anyQName(); 235 236 SVGElement::removedFromDocument(); 236 237 } … … 390 391 } 391 392 sortTimeList(timeList); 393 } 394 395 bool SVGSMILElement::isSupportedAttribute(const QualifiedName& attrName) 396 { 397 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); 398 if (supportedAttributes.isEmpty()) { 399 supportedAttributes.add(SVGNames::beginAttr); 400 supportedAttributes.add(SVGNames::endAttr); 401 supportedAttributes.add(SVGNames::durAttr); 402 supportedAttributes.add(SVGNames::repeatDurAttr); 403 supportedAttributes.add(SVGNames::repeatCountAttr); 404 supportedAttributes.add(SVGNames::minAttr); 405 supportedAttributes.add(SVGNames::maxAttr); 406 supportedAttributes.add(SVGNames::attributeNameAttr); 407 supportedAttributes.add(XLinkNames::hrefAttr); 408 } 409 return supportedAttributes.contains<QualifiedName, SVGAttributeHashTranslator>(attrName); 392 410 } 393 411 … … 416 434 } 417 435 418 void SVGSMILElement::attributeChanged(Attribute* attr) 419 { 420 SVGElement::attributeChanged(attr); 421 422 const QualifiedName& attrName = attr->name(); 436 void SVGSMILElement::svgAttributeChanged(const QualifiedName& attrName) 437 { 438 if (!isSupportedAttribute(attrName)) { 439 SVGElement::svgAttributeChanged(attrName); 440 return; 441 } 442 423 443 if (attrName == SVGNames::durAttr) 424 444 m_cachedDur = invalidCachedTime; … … 431 451 else if (attrName == SVGNames::maxAttr) 432 452 m_cachedMax = invalidCachedTime; 433 else if (attrName == SVGNames::attributeNameAttr) { 434 if (inDocument()) 435 m_attributeName = constructQualifiedName(this, attr->value()); 436 } 437 438 if (inDocument()) { 453 else if (inDocument()) { 439 454 if (attrName == SVGNames::beginAttr) 440 455 beginListChanged(elapsed()); 441 456 else if (attrName == SVGNames::endAttr) 442 457 endListChanged(elapsed()); 443 } 458 else if (attrName == SVGNames::attributeNameAttr) 459 m_attributeName = constructQualifiedName(this, fastGetAttribute(SVGNames::attributeNameAttr)); 460 else if (attrName.matches(XLinkNames::hrefAttr)) { 461 if (SVGElement* targetElement = this->targetElement()) 462 document()->accessSVGExtensions()->removeAllAnimationElementsFromTarget(targetElement); 463 } 464 } 465 466 animationAttributeChanged(); 444 467 } 445 468 … … 519 542 return m_targetElement; 520 543 521 String href = xlinkHref();544 String href = getAttribute(XLinkNames::hrefAttr); 522 545 ContainerNode* target = href.isEmpty() ? parentNode() : SVGURIReference::targetElementFromIRIString(href, document()); 523 546 if (!target || !target->isSVGElement()) 524 547 return 0; 525 548 526 m_targetElement = static_cast<SVGElement*>(target); 549 SVGElement* targetElement = static_cast<SVGElement*>(target); 550 targetElementWillChange(m_targetElement, targetElement); 551 m_targetElement = targetElement; 527 552 document()->accessSVGExtensions()->addAnimationElementToTarget(this, m_targetElement); 528 529 targetElementDidChange(m_targetElement);530 531 553 return m_targetElement; 532 554 } 533 555 556 void SVGSMILElement::targetElementWillChange(SVGElement*, SVGElement*) 557 { 558 // If the animation state is Active, always reset to a clear state before leaving the old target element. 559 if (m_activeState == Active) 560 endedActiveInterval(); 561 } 562 534 563 void SVGSMILElement::resetTargetElement() 535 564 { 565 targetElementWillChange(m_targetElement, 0); 536 566 m_targetElement = 0; 537 538 // Force the animation to recompute values that are only calculated when an animation becomes active. 539 // Failing to do this means that a target reset and change during active animation may result in 540 // invalid state. 541 m_activeState = Inactive; 542 543 targetElementDidChange(0); 567 animationAttributeChanged(); 544 568 } 545 569 … … 576 600 const AtomicString& value = fastGetAttribute(SVGNames::fillAttr); 577 601 return value == freeze ? FillFreeze : FillRemove; 578 }579 580 String SVGSMILElement::xlinkHref() const581 {582 return getAttribute(XLinkNames::hrefAttr);583 602 } 584 603 -
trunk/Source/WebCore/svg/animation/SVGSMILElement.h
r109342 r110545 45 45 static bool isSMILElement(Node*); 46 46 47 bool isSupportedAttribute(const QualifiedName&); 47 48 virtual void parseAttribute(Attribute*) OVERRIDE; 48 virtual void attributeChanged(Attribute*) OVERRIDE;49 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE; 49 50 virtual void insertedIntoDocument(); 50 51 virtual void removedFromDocument(); 51 52 52 53 virtual bool hasValidAttributeType() = 0; 54 virtual void animationAttributeChanged() = 0; 53 55 54 56 SMILTimeContainer* timeContainer() const { return m_timeContainer.get(); } … … 74 76 75 77 FillMode fill() const; 76 77 String xlinkHref() const;78 78 79 79 SMILTime dur() const; … … 116 116 117 117 // Sub-classes may need to take action when the target is changed. 118 virtual void targetElement DidChange(SVGElement*) { }118 virtual void targetElementWillChange(SVGElement* currentTarget, SVGElement* newTarget); 119 119 virtual void endedActiveInterval(); 120 120 -
trunk/Source/WebCore/svg/properties/SVGAnimatedEnumerationPropertyTearOff.h
r95901 r110545 41 41 } 42 42 43 static PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<EnumType> > create(SVGElement* contextElement, const QualifiedName& attributeName, EnumType& property)43 static PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<EnumType> > create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, EnumType& property) 44 44 { 45 45 ASSERT(contextElement); 46 return adoptRef(new SVGAnimatedEnumerationPropertyTearOff<EnumType>(contextElement, attributeName, reinterpret_cast<int&>(property)));46 return adoptRef(new SVGAnimatedEnumerationPropertyTearOff<EnumType>(contextElement, attributeName, animatedPropertyType, reinterpret_cast<int&>(property))); 47 47 } 48 48 … … 50 50 51 51 private: 52 SVGAnimatedEnumerationPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, int& property)53 : SVGAnimatedStaticPropertyTearOff<int>(contextElement, attributeName, property)52 SVGAnimatedEnumerationPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, int& property) 53 : SVGAnimatedStaticPropertyTearOff<int>(contextElement, attributeName, animatedPropertyType, property) 54 54 { 55 55 } -
trunk/Source/WebCore/svg/properties/SVGAnimatedListPropertyTearOff.h
r95901 r110545 87 87 PropertyType& currentAnimatedValue() { return m_values; } 88 88 89 static PassRefPtr<SVGAnimatedListPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& values)89 static PassRefPtr<SVGAnimatedListPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& values) 90 90 { 91 91 ASSERT(contextElement); 92 return adoptRef(new SVGAnimatedListPropertyTearOff<PropertyType>(contextElement, attributeName, values));92 return adoptRef(new SVGAnimatedListPropertyTearOff<PropertyType>(contextElement, attributeName, animatedPropertyType, values)); 93 93 } 94 94 95 95 protected: 96 SVGAnimatedListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& values)97 : SVGAnimatedProperty(contextElement, attributeName )96 SVGAnimatedListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& values) 97 : SVGAnimatedProperty(contextElement, attributeName, animatedPropertyType) 98 98 , m_values(values) 99 99 { -
trunk/Source/WebCore/svg/properties/SVGAnimatedPathSegListPropertyTearOff.h
r95901 r110545 52 52 } 53 53 54 static PassRefPtr<SVGAnimatedPathSegListPropertyTearOff> create(SVGElement* contextElement, const QualifiedName& attributeName, SVGPathSegList& values)54 static PassRefPtr<SVGAnimatedPathSegListPropertyTearOff> create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGPathSegList& values) 55 55 { 56 56 ASSERT(contextElement); 57 return adoptRef(new SVGAnimatedPathSegListPropertyTearOff(contextElement, attributeName, values));57 return adoptRef(new SVGAnimatedPathSegListPropertyTearOff(contextElement, attributeName, animatedPropertyType, values)); 58 58 } 59 59 60 60 private: 61 SVGAnimatedPathSegListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, SVGPathSegList& values)62 : SVGAnimatedListPropertyTearOff<SVGPathSegList>(contextElement, attributeName, values)61 SVGAnimatedPathSegListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGPathSegList& values) 62 : SVGAnimatedListPropertyTearOff<SVGPathSegList>(contextElement, attributeName, animatedPropertyType, values) 63 63 { 64 64 } -
trunk/Source/WebCore/svg/properties/SVGAnimatedProperty.h
r95901 r110545 29 29 namespace WebCore { 30 30 31 class SVGAnimatedType; 31 32 class SVGElement; 33 class SVGGenericAnimatedType; 32 34 33 35 class SVGAnimatedProperty : public RefCounted<SVGAnimatedProperty> { … … 35 37 SVGElement* contextElement() const { return m_contextElement.get(); } 36 38 const QualifiedName& attributeName() const { return m_attributeName; } 39 AnimatedPropertyType animatedPropertyType() const { return m_animatedPropertyType; } 37 40 38 41 void commitChange() … … 44 47 45 48 virtual bool isAnimatedListTearOff() const { return false; } 46 virtual void updateAnimVal(void*) { ASSERT_NOT_REACHED(); } 49 50 virtual void animationStarted(SVGAnimatedType*) { ASSERT_NOT_REACHED(); } 51 virtual void animationEnded() { ASSERT_NOT_REACHED(); } 52 virtual void animationValueChanged() { ASSERT_NOT_REACHED(); } 53 virtual SVGGenericAnimatedType* currentBaseValue(AnimatedPropertyType) const 54 { 55 ASSERT_NOT_REACHED(); 56 return 0; 57 } 47 58 48 59 // Caching facilities. … … 83 94 RefPtr<SVGAnimatedProperty> wrapper = animatedPropertyCache()->get(key); 84 95 if (!wrapper) { 85 wrapper = TearOffType::create(element, info->attributeName, property);96 wrapper = TearOffType::create(element, info->attributeName, info->animatedPropertyType, property); 86 97 animatedPropertyCache()->set(key, wrapper); 87 98 } … … 125 136 126 137 protected: 127 SVGAnimatedProperty(SVGElement* contextElement, const QualifiedName& attributeName )138 SVGAnimatedProperty(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType) 128 139 : m_contextElement(contextElement) 129 140 , m_attributeName(attributeName) 141 , m_animatedPropertyType(animatedPropertyType) 130 142 { 131 143 } … … 140 152 RefPtr<SVGElement> m_contextElement; 141 153 const QualifiedName& m_attributeName; 154 AnimatedPropertyType m_animatedPropertyType; 142 155 }; 143 156 -
trunk/Source/WebCore/svg/properties/SVGAnimatedPropertyTearOff.h
r95901 r110545 23 23 #if ENABLE(SVG) 24 24 #include "SVGAnimatedProperty.h" 25 #include "SVGAnimatedType.h" 25 26 #include "SVGPropertyTearOff.h" 26 27 … … 44 45 } 45 46 46 static PassRefPtr<SVGAnimatedPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)47 static PassRefPtr<SVGAnimatedPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& property) 47 48 { 48 49 ASSERT(contextElement); 49 return adoptRef(new SVGAnimatedPropertyTearOff<PropertyType>(contextElement, attributeName, property));50 return adoptRef(new SVGAnimatedPropertyTearOff<PropertyType>(contextElement, attributeName, animatedPropertyType, property)); 50 51 } 51 52 … … 59 60 } 60 61 61 virtual void updateAnimVal(void* value)62 virtual SVGGenericAnimatedType* currentBaseValue(AnimatedPropertyType expectedPropertyType) const 62 63 { 63 if (value) { 64 static_cast<SVGPropertyTearOff<PropertyType>*>(animVal())->updateAnimVal(reinterpret_cast<PropertyType*>(value)); 65 m_isAnimating = true; 66 return; 67 } 64 ASSERT_UNUSED(expectedPropertyType, animatedPropertyType() == expectedPropertyType); 65 return reinterpret_cast<SVGGenericAnimatedType*>(&m_property); 66 } 68 67 69 static_cast<SVGPropertyTearOff<PropertyType>*>(animVal())->updateAnimVal(&m_property); 68 virtual void animationStarted(SVGAnimatedType* animatedType) 69 { 70 ASSERT(animatedType); 71 ASSERT(animatedType->type() == animatedPropertyType()); 72 static_cast<SVGPropertyTearOff<PropertyType>*>(animVal())->setValue(*reinterpret_cast<PropertyType*>(animatedType->variantValue())); 73 m_isAnimating = true; 74 } 75 76 virtual void animationEnded() 77 { 78 ASSERT(m_isAnimating); 79 static_cast<SVGPropertyTearOff<PropertyType>*>(animVal())->setValue(m_property); 70 80 m_isAnimating = false; 81 82 ASSERT(contextElement()); 83 contextElement()->svgAttributeChanged(attributeName()); 84 } 85 86 virtual void animationValueChanged() 87 { 88 ASSERT(contextElement()); 89 contextElement()->svgAttributeChanged(attributeName()); 71 90 } 72 91 73 92 private: 74 SVGAnimatedPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)75 : SVGAnimatedProperty(contextElement, attributeName )93 SVGAnimatedPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& property) 94 : SVGAnimatedProperty(contextElement, attributeName, animatedPropertyType) 76 95 , m_property(property) 77 96 , m_isAnimating(false) 78 97 { 79 98 } 99 100 #ifndef NDEBUG 101 virtual ~SVGAnimatedPropertyTearOff() 102 { 103 ASSERT(!m_isAnimating); 104 } 105 #endif 80 106 81 107 PropertyType& m_property; -
trunk/Source/WebCore/svg/properties/SVGAnimatedStaticPropertyTearOff.h
r95901 r110545 50 50 PropertyType& currentAnimatedValue() { return m_property; } 51 51 52 static PassRefPtr<SVGAnimatedStaticPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)52 static PassRefPtr<SVGAnimatedStaticPropertyTearOff<PropertyType> > create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& property) 53 53 { 54 54 ASSERT(contextElement); 55 return adoptRef(new SVGAnimatedStaticPropertyTearOff<PropertyType>(contextElement, attributeName, property));55 return adoptRef(new SVGAnimatedStaticPropertyTearOff<PropertyType>(contextElement, attributeName, animatedPropertyType, property)); 56 56 } 57 57 58 58 protected: 59 SVGAnimatedStaticPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, PropertyType& property)60 : SVGAnimatedProperty(contextElement, attributeName )59 SVGAnimatedStaticPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, PropertyType& property) 60 : SVGAnimatedProperty(contextElement, attributeName, animatedPropertyType) 61 61 , m_property(property) 62 62 { -
trunk/Source/WebCore/svg/properties/SVGAnimatedTransformListPropertyTearOff.h
r95901 r110545 44 44 } 45 45 46 static PassRefPtr<SVGAnimatedTransformListPropertyTearOff> create(SVGElement* contextElement, const QualifiedName& attributeName, SVGTransformList& values)46 static PassRefPtr<SVGAnimatedTransformListPropertyTearOff> create(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGTransformList& values) 47 47 { 48 48 ASSERT(contextElement); 49 return adoptRef(new SVGAnimatedTransformListPropertyTearOff(contextElement, attributeName, values));49 return adoptRef(new SVGAnimatedTransformListPropertyTearOff(contextElement, attributeName, animatedPropertyType, values)); 50 50 } 51 51 52 52 private: 53 SVGAnimatedTransformListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, SVGTransformList& values)54 : SVGAnimatedListPropertyTearOff<SVGTransformList>(contextElement, attributeName, values)53 SVGAnimatedTransformListPropertyTearOff(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType, SVGTransformList& values) 54 : SVGAnimatedListPropertyTearOff<SVGTransformList>(contextElement, attributeName, animatedPropertyType, values) 55 55 { 56 56 } -
trunk/Source/WebCore/svg/properties/SVGPropertyTearOff.h
r95901 r110545 50 50 SVGAnimatedProperty* animatedProperty() const { return m_animatedProperty.get(); } 51 51 52 // Used only by the list tear offs!53 52 void setValue(PropertyType& value) 54 53 { … … 94 93 virtual SVGPropertyRole role() const { return m_role; } 95 94 96 void updateAnimVal(PropertyType* value)97 {98 ASSERT(!m_valueIsCopy);99 ASSERT(m_role == AnimValRole);100 m_value = value;101 }102 103 95 protected: 104 96 SVGPropertyTearOff(SVGAnimatedProperty* animatedProperty, SVGPropertyRole role, PropertyType& value)
Note: See TracChangeset
for help on using the changeset viewer.